Login to ZARP
Username: Password: Remember me

TOPIC: Question to anyone with gmod lua experience

Question to anyone with gmod lua experience 5 years 10 months ago #922070

Is it a good Idea to use this code to notify a message to everyone connected to the server, or is it better to network the whole thing?
BroadcastLua([[chat.AddText(Color(0,255,0), "Message goes here")]])

sorry for asking here I literally cannot find a propper answer anywhere else on the web, regarding what's best to use
  • catboy sven ツ
  • catboy sven ツ's Avatar
  • Offline
  • Adept Boarder
  • ZARP VIP
  • Respected Zarp Contributor
  • Posts: 7193
  • Thanks received: 1544
  • Karma: -45
ex-minecraft owner, zarp legend (Was there during the infancy of Zarp), ex-ssrp admin, ex-teamspeak emblem (For SSRP admin & minecraft owner)








Last Edit: 5 years 10 months ago by catboy sven ツ.
Login or register to post a reply.

Question to anyone with gmod lua experience 5 years 10 months ago #922077

nerd
  • MsMs
  • MsMs's Avatar
  • Offline
  • Gold Boarder
  • ZARP VIP
  • hey there I'm MsMs
  • Posts: 2403
  • Thanks received: 1209
  • Karma: -23
Nothing
Login or register to post a reply.

Question to anyone with gmod lua experience 5 years 10 months ago #922079

MsMs wrote:
nerd

no need for insults here on :zarp: :zarp: :zarp:
  • catboy sven ツ
  • catboy sven ツ's Avatar
  • Offline
  • Adept Boarder
  • ZARP VIP
  • Respected Zarp Contributor
  • Posts: 7193
  • Thanks received: 1544
  • Karma: -45
ex-minecraft owner, zarp legend (Was there during the infancy of Zarp), ex-ssrp admin, ex-teamspeak emblem (For SSRP admin & minecraft owner)








Login or register to post a reply.

Question to anyone with gmod lua experience 5 years 10 months ago #922098

Why would you need to network it and for what purpose are you sending the message?
  • Denis
  • Denis's Avatar
  • Offline
  • Diamond Boarder
  • ZARP VIP
  • Posts: 2809
  • Thanks received: 1369
  • Karma: -49
Login or register to post a reply.

Question to anyone with gmod lua experience 5 years 10 months ago #922103

Network or use wiki.garrysmod.com/page/Player/PrintMessage to save a minute out of your life.

If this is a static message which you just want shown every once in a while then I'd suggest doing this directly on the client instead.
  • RedWingz
  • RedWingz's Avatar
  • Offline
  • Expert Boarder
  • ZARP VIP
  • Former Deathrun Mod & SSRP Admin
  • Posts: 992
  • Thanks received: 176
  • Karma: 5
Last Edit: 5 years 10 months ago by RedWingz.
Login or register to post a reply.

Question to anyone with gmod lua experience 5 years 10 months ago #922117

474 Denis wrote:
Why would you need to network it and for what purpose are you sending the message?

Because if i don't network it only goes to one player who pinged the server in the first place (based on what i've read). I haven't setup a test server yet though so I can't confirm that yet.
  • catboy sven ツ
  • catboy sven ツ's Avatar
  • Offline
  • Adept Boarder
  • ZARP VIP
  • Respected Zarp Contributor
  • Posts: 7193
  • Thanks received: 1544
  • Karma: -45
ex-minecraft owner, zarp legend (Was there during the infancy of Zarp), ex-ssrp admin, ex-teamspeak emblem (For SSRP admin & minecraft owner)








Last Edit: 5 years 10 months ago by catboy sven ツ.
Login or register to post a reply.

Question to anyone with gmod lua experience 5 years 10 months ago #922119

RedWingz wrote:
Network or use wiki.garrysmod.com/page/Player/PrintMessage to save a minute out of your life.

If this is a static message which you just want shown every once in a while then I'd suggest doing this directly on the client instead.

What i'm working on right now is similar to the Nuke on SSRP. Whenever a player starts the nuke; everyone on the server gets the message that the nuke is active, meaning it has a timer displaying so idk if it's actually counting as static.

Also can I change colors using that thing?
  • catboy sven ツ
  • catboy sven ツ's Avatar
  • Offline
  • Adept Boarder
  • ZARP VIP
  • Respected Zarp Contributor
  • Posts: 7193
  • Thanks received: 1544
  • Karma: -45
ex-minecraft owner, zarp legend (Was there during the infancy of Zarp), ex-ssrp admin, ex-teamspeak emblem (For SSRP admin & minecraft owner)








Last Edit: 5 years 10 months ago by catboy sven ツ.
Login or register to post a reply.

Question to anyone with gmod lua experience 5 years 10 months ago #922213

Aspect wrote:
RedWingz wrote:
Network or use wiki.garrysmod.com/page/Player/PrintMessage to save a minute out of your life.

If this is a static message which you just want shown every once in a while then I'd suggest doing this directly on the client instead.

What i'm working on right now is similar to the Nuke on SSRP. Whenever a player starts the nuke; everyone on the server gets the message that the nuke is active, meaning it has a timer displaying so idk if it's actually counting as static.

Also can I change colors using that thing?

Yes, you'd have to let the clients know that the nuke started by sending a net message from the server.
And no, the PrintMessage method doesn't allow you to change text color.
  • RedWingz
  • RedWingz's Avatar
  • Offline
  • Expert Boarder
  • ZARP VIP
  • Former Deathrun Mod & SSRP Admin
  • Posts: 992
  • Thanks received: 176
  • Karma: 5
Login or register to post a reply.

Question to anyone with gmod lua experience 5 years 10 months ago #922314

CLIENT: net.Receive("oofed", function() chat.AddText(unpack(net.ReadTable())) end)
Server: util.AddNetworkString("oofed") net.Start("oofed") net.WriteTable({Color(255,0,0), "Hey"}) net.Broadcast()
  • DEADMONSTOR
  • DEADMONSTOR's Avatar
  • Offline
  • Former Owner
  • ZARP VIP
  • Posts: 9276
  • Thanks received: 3800
  • Karma: 80
...
Login or register to post a reply.
The following user(s) said Thank You: catboy sven ツ

Question to anyone with gmod lua experience 5 years 10 months ago #922816

DEADMONSTOR wrote:
CLIENT: net.Receive("oofed", function() chat.AddText(unpack(net.ReadTable())) end)
Server: util.AddNetworkString("oofed") net.Start("oofed") net.WriteTable({Color(255,0,0), "Hey"}) net.Broadcast()

tyyy
  • catboy sven ツ
  • catboy sven ツ's Avatar
  • Offline
  • Adept Boarder
  • ZARP VIP
  • Respected Zarp Contributor
  • Posts: 7193
  • Thanks received: 1544
  • Karma: -45
ex-minecraft owner, zarp legend (Was there during the infancy of Zarp), ex-ssrp admin, ex-teamspeak emblem (For SSRP admin & minecraft owner)








Login or register to post a reply.
Time to create page: 0.102 seconds

308 PLAYERS ONLINE

Connect to server View Gametracker DarkRP 1
26/127
online
Connect to server View Gametracker Deathrun
0/40
online
Connect to server View Gametracker TTT
1/47
online
Connect to server View Gametracker Bhop
2/32
online
Connect to server View Gametracker Surf
0/32
online
Connect to server View Gametracker Prop Hunt
6/42
online
Connect to server View Gametracker Sandbox
0/42
online
Connect to server Discord
273/764
online
Top