Hi there my friends.
On my way to port my Groups System from the RPG System that I'm working into, I saw some opportunities to make it better.
There, we have a command called /gc that let players send messages only to their group. (e.g. /gc hello group)
So, I wanted to use the same command to send a message to the group whenever a new member joins or quits the group. How would I proceed to do that?
Force a player command to be executed
Discussion in 'Rust Development' started by TheRotAG, Jan 25, 2015.
-
Wulf Community Admin
Make a console command perhaps and execute that?
-
-
Wulf Community Admin
-
What i tried:
msg = "testing here"
self:C_GC(player, cmd, msg) also tried (player, msg) and (msg)
[DOUBLEPOST=1422150513][/DOUBLEPOST]Solved.
I can call the function and it will read the (player, "", "") where the others "" just doesnt matter... whatever info u put instead of "" will trigger the function anyway and it will never understand how many args we have, what means if we try (player, cmd, "whatever msg") the command will be triggered but wont recognize the "args" that I input as a msg or any variable with a message inside of it.
What I did was create a global to store the message that I need to send and then make the command /gc understand that if I wasn't inputing any args, the args should be equal to the global with the message.