Any idea on how to send a broadcast/message to all users?
I have written a little script so that when a user joins they get a welcome %username% message using ChatMessage pulled from a config. I would also like to notify all other users that %username% has joined and or left the server
Learning so be gently
Cheers
Dave
Solved Broadcast chat to all players
Discussion in 'Rust Development' started by Taffy, Oct 16, 2014.
-
Here's a hack kinda
playerObject:SendConsoleCommand("chat.add \""..ChatName.."\"".."text")
I havnt even setup a server yet so there probably is an easier way. -
Will feedback results
Cheers -
Code:
global.ConsoleSystem.Broadcast("chat.add \"" .. ChatName .. "\" \"" .. text .. "\"")
-
Great stuff thanks chaps
Had some problems with your command Hatemail - Pushed the message out but was dropping all words after the first. For example it was pulling "Say hello to %username%" from the config but the message was only showing the first word, "Say"
thomasfn, worked a treat thanks. Was the dropping of words on the above down to there being no space between the .. text ..?
Workings of my first mod coming along nicely. Bit more to add like user disconnected etc but hopefully have something soon to upload.
Thanks again all for you patience and guidance -
Wulf Community Admin
-
Damn, just noticed renab already published a mod doing the same thing . Will finish it off (without looking at his lol ) , good learning experience. Back to the drawing board then. No point doing something a season developer such as him as already done.
-
Wulf Community Admin