- Documentation
- Server events
- onPlayerCommand
Event
onPlayerCommand
A player typed a command (before addCommandHandler runs it). You can block it.
Handler
addEventHandler("onPlayerCommand", root, function(command, ...) ... end)Parameters
commandstring- The command name.
...string- The words after the command.
Source
source is the player.
cancelEvent() blocks the command.
Example
addEventHandler("onPlayerCommand", root, function(command)
if command == "kill" and getElementData(source, "wiezien") then cancelEvent() end
end)