How can i stop the console command?
For example, if player write to console "chat.add" dont realize this command in the game world
Console Command
Discussion in 'Rust Development' started by bloodywind, Feb 8, 2015.
-
Wulf Community Admin
If you simply want to send chat via your own console, just use say. I don't see why you'd need to do that though.
If you are trying to send a message, you don't need to use chat.add. See http://docs.oxidemod.org/#sendchatmessage. -
Yes. I know command rust.SendChatMessage(player, name, message, userid).
But, I want block command "chat.add", if player press key F1, and write this command to console -
Wulf Community Admin
You could try this, but I'm pretty sure blocking chat.add will cause some issues with the chat. http://oxidemod.org/resources/command-block.647/
Otherwise, you could try something like this:
Code:function PLUGIN:OnRunCommand(arg) if not arg then return end if not arg.connection then return end if not arg.connection.player then return end if not arg.cmd then return end if not arg.cmd.name then return end local player = arg.connection.player local command = arg.cmd.namefull if command == "chat.add" then return false end
-
Thank you very much!
[DOUBLEPOST=1423423910][/DOUBLEPOST]I did so
Code:function PLUGIN:OnRunCommand(arg) if not arg then return end if not arg.connection then return end if not arg.connection.player then return end if not arg.cmd then return end if not arg.cmd.name then return end local player = arg.connection.player local command = arg.cmd.namefull if command == "chat.add" then return false end
chat.add is not blocked =(
Official Servers too allowed "chat.add"
[DOUBLEPOST=1423463399,1423416977][/DOUBLEPOST]Command "chat.add" not fixed in arg.cmd.namefull
[DOUBLEPOST=1423491589][/DOUBLEPOST]this is bug? -
Wulf Community Admin
I don't see what your issue is with it. The code is just an example, not a plug and play method. arg.cmd.namefull is not a "fix", it's a variable.
-
arg.cmd.namefill empty when the write command "chat.add"
-
Wulf Community Admin
-
empty
=( -
You can't block chat.add since that is the client command used to display the message in the actual game ui, basically everything send through "chat.add" is only visible to the player sending it unless it's specifically send to a player through a plugin. So OnRunCommand will never run on the command chat.add
-
Ok. Thank you.
-
Wulf Community Admin