Scripting/Client/Events/onClientCommand
The player typed a /command that the built-in chat does not know. Return true to swallow it (it will not be sent to the server); anything else lets it go through to the server's onPlayerCommand.
Syntax
onClientCommand(cmd, text)Arguments
- string cmd
- string text
Returns
bool
Example
function onClientCommand( cmd, text )
{
Message( "onClientCommand fired" );
return true; // return false to cancel it
}This sample was generated from the signature – adapt the values to your gamemode.
Related pages
- onScriptLoad
- onScriptUnload
- onClientSpawn
- onClientRender
- onClientMouseMove
- onClientMouseClick
- onClientMouseWheel
- onClientKeyStateChange
- onGameWindowResize
- onObjectShot
Section: Client events
Categories: Client events | Client events