6,834
edits
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
{{ | {{ScriptItem2 | ||
| | |name = OnPlayerCommand | ||
|side = server | |||
|type = event | |type = event | ||
| | |games = iii vc sa iv | ||
| | |desc = a player submits a chat command.<br>A command starts with a forward slash (the command character), and the command is not displayed in the chat box | ||
| | |arg1 = Client client The client that submitted a command. | ||
|arg2 = string command The command name. | |||
|arg3 = string parameters The command parameters as a string. | |||
| | |cancel = true | ||
| | |||
|exampleJS = addEventHandler('OnPlayerCommand', (event, client, command, parameters) => { | |exampleJS = addEventHandler('OnPlayerCommand', (event, client, command, parameters) => { | ||
console.log(`(Command) ${client.name} has used the command '/${command} ${parameters}'.`); | console.log(`(Command) ${client.name} has used the command '/${command} ${parameters}'.`); |
edits