6,834
edits
(Created page with "{{ScriptItem |endpoint = server |type = event |name = onPlayerCommand |usage = a player submits a chat command.<br>A command starts with a forward slash (the command character...") |
No edit summary |
||
(2 intermediate revisions by 2 users not shown) | |||
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 chat command is different than a chat message; a chat command starts with the command character (a forward slash).<br>By default, chat commands (along with it's parameters, if applicable), are not displayed in the chat box.<br>By default, if there are spacing character(s) before the command character, then it is treated as a chat message instead and 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) => { | ||
console.log(`(Command) ${client.name} has used the command '/${command} ${parameters}'.`); | |||
}); | |||
|exampleLua = addEventHandler('OnPlayerCommand', function(event, client, command, parameters) | |||
console.log(`(Command) ${client.name} has used the command '/${command} ${parameters}'.`); | |||
end); | |||
}} | }} |
edits