Commands
The general use of commands and introduction to Carbon-only features that will benefit you.
Console commands
These commands can be executed from your RCon, Windows Console window or from the in-game F1 console.
Side note, using arg.ReplyWith
will print a reply log from the place where it was called, for example calling mycommand
from the client F1 console, it'll print that log only there.
Chat commands
They can only be executed by clients.
Universal commands
They're executable by both in-game client chat, F1 console and windows console (or RCon).
Whenever the universal commands are called from the windows console or RCon, the player
will always be null.
Protected commands
This is a special type of command mainly used by Carbon CUI elements (eg. ProtectedButton, ProtectedInputField) which randomizes the command in a server-specific way to protect servers from players calling plugin commands that are meant to be called using the authority-based UIs and having the ability to do so if they own the said plugins, and know what the commands of the plugin are.
This can be used in many other ways, and it is highly recommended that ALL your plugins that have commands that aren't supposed to be manually called (in console/chat by players) should use this system.
Authentication
This allows you to grant authentication levels to your commands, from auth level to permissions, groups, and command cooldowns. All these authentication attributes work on any kinds of commands explained above.
Permission attribute (multiple allowed)
Will only allow players which are granted the permission(s) (or their groups) to execute the command.
Group attribute (multiple allowed)
Will only allow players which are granted the groups(s) to execute the command.
AuthLevel attribute
Will only allow players which minimally have the auth-level set to execute the command.
Level 0: Standard players.
Level 1: Moderator players.
Level 2: Owner players.
Level 3: Developer players.
Cooldown attribute
This will disallow players from executing a command too fast. It's relative to player calls, meaning others can call the command.
Multiple authentication levels
You may use one (like above) or multiple authentication levels, like the following example:
Last updated