ExecuteCommandHandler
executeCommandHandler
Executes a registered command as a specific connected player.
Syntax
bool executeCommandHandler(string commandName, int playerId, ...)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
commandName |
string |
yes | Command name without the leading slash. |
playerId |
int |
yes | The connected player treated as the command issuer. |
... |
string/number/bool |
no | Up to 32 command arguments. |
Returns
Returns true when the command is accepted for execution; otherwise returns false.
Examples
Execute the heal command from another server script:
executeCommandHandler("heal", playerId, 25)
Notes
- Available only in server-side resource scripts.
- Arguments are converted to strings and may not exceed 2,048 bytes in total.