addCommand
Library
Updated 2 months ago ·
v1.3.7i
Server Module - This can only be used on the server
lib.addCommand
Register a chat command with automatic parameter parsing, type validation, and ACE permission restrictions.
Signature
| Parameter | Type | Required | Description |
|---|---|---|---|
| commandName | string | string[] | yes | Command name(s) to register |
| properties | table | false | yes | Command properties, or false for no restrictions/params |
| cb | function | yes | Handler function(source, args, raw) |
Properties
| Field | Type | Description |
|---|---|---|
help | string | Description shown in chat suggestions |
restricted | string | false | ACE permission required (e.g. "group.admin") |
params | table[] | Parameter definitions |
Parameter Types
| Type | Description |
|---|---|
number | Parsed as a number |
playerId | Validated server ID of an online player |
string | Single word string |
longString | Rest of the input as one string (must be last param) |
Multiple Aliases
Pass a table to register the same handler under multiple command names:
Was this page helpful?
This page was last updated on 12 March 2026