onPlayerCommand
Description
This is called when a player uses a command.
| Name | Description |
|---|---|
| player | The player |
| cmd | The command that player used |
| parameters | List of command parameters as string |
Example
This example command heal the player if they type /heal
function onPlayerCommand(player, cmd, parameters) { if(cmd == "heal") { if(player.Health == 100) { PrivMessage(player, "You have the health to maximum."); } else { PrivMessage(player, "Healed."); player.Health = 100; } }}