OnPlayerCommand: Difference between revisions

no edit summary
(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
Line 2: Line 2:
|endpoint = server
|endpoint = server
|type = event
|type = event
|name = onPlayerCommand
|name = OnPlayerCommand
|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
|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
|callbackParameters = Event event, Client client, string command, string parameters
|callbackParameters = Event event, Client client, string command, string parameters
Line 9: Line 9:
|parameter2 = string command The command name.
|parameter2 = string command The command name.
|parameter3 = string parameters The command parameters as a string.
|parameter3 = string parameters The command parameters as a string.
|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);
}}
}}
21

edits