Register
Starts with a lowercase letter, then letters, digits and underscores, up to 32 characters. Registers
/name.Who can use it
config/permissions.lua logs a warning at registration and matches nobody. It does not raise, so renaming a group never breaks a resource.
Argument types
Each argument has
name, type, and optional optional, max and help. Optional arguments MUST be trailing.
Checks
For players, in order: ug-core is ready, rate limit,requirePlayer, permission and groups, arguments, handler. The console skips the first four checks. Console failures print the error code and the usage instead of emitting an event.
CanUse
permission and groups. Use it to show only usable commands in chat suggestions and menus. Rate limits, requirePlayer and arguments are not checked. Unknown commands return false. Source 0 is the console.
Chat suggestions
When the cfxchat resource runs, ug-core suggests commands in chat. Each player sees only the commands they may use, with help and one hint per argument: the argument’s help, or its type. Optional arguments show as [name].
Suggestions are sent when the player loads, when a resource registers commands, and when a group changes. Commands a player loses, or whose resource stops, are removed. They are hints only: every command checks access again when it runs.
GetAll
name, help, permission, groups and args.
Errors
ug-core shows nothing to players. A failed command emitsug-core:Commands:Failed so a chat or notification resource can display it:
Rate limited commands are dropped silently. Invalid options raise at registration.