|Hook name||onChatCommand(Player ply, string command, string arguments, table return)|
|Called after a player has run any chat command or uses the DarkRP console command. Note: the chat command has already been run. Use canChatCommand if you want to stop chat commands from being run.|
|Returns:||string overrideText, function overrideSayFunc|
|BBCode Link:||[b][url=http://wiki.darkrp.com/index.php?title=Hooks/Server/onChatCommand]onChatCommand hook[/url][/b]|
- ply (Player)
- command (string)
- arguments (string)
- return (table)
The player who spoke.
The thing they said.
The arguments of the chat command, given either as one string or a table of strings. That depends on whether the command is declared to use table arguments.
The return value of the chat command function. Should contain a chat text override and/or a say function. See the return values of this hook for a description
- overrideText (string)
- overrideSayFunc (function)
Overrides the text a chat command will put in everyone's chat box. Return nil to not change behaviour.
Say functions handle what needs to be said to whom. The say function for PMs for example make sure only the sender and receiver see the message. You can override this behaviour by returning a different say function in this hook. Return nil to not change behaviour.