OnPlayerCommand: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 1: Line 1:
{{ScriptItem
{{ScriptItem2
|endpoint = server
|name = OnPlayerCommand
|side = server
|type = event
|type = event
|name = OnPlayerCommand
|games = iii vc sa iv
|usage = 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
|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
|callbackParameters = Event event, Client client, string command, string parameters
|arg1 = Client client The client that submitted a command.
|cancellable = true
|arg2 = string command The command name.
|parameter1 = Client client The client that submitted a command.
|arg3 = string parameters The command parameters as a string.
|parameter2 = string command The command name.
|cancel = true
|parameter3 = string parameters The command parameters as a string.
|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}'.`);
6,833

edits