Command System
Go Back
CVRF uses an in-house admin command system that is built into the game. Owners of private servers have access to most commands and can give or take others’ permissions to use commands in said server with ;admin
and ;unadmin
.
In-game, you can run ;help
or ;cmds
to view a listing of all commands. You can search for a command and it will come up if the name or any aliases match your search. Hover over a command name to view more details. If you already know the command you’re looking for and just want to view that specific command’s information (aliases, description, arguments, etc) just run ;help (command name)
.
At the top of the help menu, there are two tabs. By default, the menu is on the command list, but switching to the “arguments” tab will show you how to correctly input each argument type. Arguments are generally quite flexible. Here’s how they work:
- Color input:
- Using RGB values:
- From 0 to 1, for example: 0.5,0.75,0
- From 0 to 255, for example: 127,191,0
- Using hex values:
- Standard six-character format, for example #7FBF00
- Using a shorter three-character format, for example #AD0
- Text
- Only 1 character: Input normally, e.g.
;newteam raiders
- More than 1 character: Use quotes, e.g.
;m “Event starting in 15 seconds.”
- Toggle/boolean input (no quotes needed):
- “true” or “false”
- “on” or “off”
- “yes” or “no”
- Player input
- Single username (partial results accepted, such as ‘Pla’ instead of ‘Player1’)
- Comma-separated list of usernames (‘Player1,Player2,Player3’)
- Percentage value (‘50%’, ‘22%’, etc)
- Text flags (“all”, “me”, “others”)
- Specific team with
t:<team name>
, for example t:Raiders
or t:”Cool People”
You can also string together multiple commands using the | character! For example:
;cm "Oops, everyone's dead!" | ;kill all
Command Blocks
There is also an experimental system called command blocks that allow you to write a sequence of commands to execute. You can use this feature by running ;blockeditor
. Command blocks can be written using commands, with each new command being in a new line. There are three non-command functions you can use as well, goto
, wait
, and breakif
. Goto
will move to whatever line is specified, and wait
will wait for the given number of seconds. Here’s a very basic example:
1 | ;cm “A second has passed.”
2 | wait 1
3 | goto 1
Running this in the block editor will print “A second has passed.”, wait 1 second, and then jump back to line 1. So, all together, this command block will print “A second has passed.” every second in a loop until you stop it.
breakif
halts execution of the block if a certain variable matches the condition. A basic variable system is currently functional, and the only condition that works with this function is ==
for now. Here’s an example:
1 | value = 0
2 |
3 | ;cm "value is ${value}"
4 | breakif ${value} == 10
5 |
6 | value = ${value} + 1
7 | wait 0.5
8 |
9 | goto 3
The above block will display “value is (value)” 11 times, incrementing from 0 to 10, before stopping.
In the future, there are plans to add more advanced variables, more conditional statements, and the ability to track multiple blocks at once.
Hooks
You can also assign commands to be run when a certain game event is fired. As of 0.14.1, there is only one event to hook to, PlayerDied
, but this will change in the future.
To hook an event, use the ;hook
command. The first argument is the name of the event, second is the name of the hook itself (used when deleting an existing hook), and third is the command to execute. In your command you want to execute, in any instance where the player’s name is required, insert <*>
. This is the flag where the affected player’s name is inserted into the command. So, for example, if you want to refresh a player in-place every time they die:
;hook PlayerDied autoRefresh ";re <*>"
And to delete an existing hook, provide the event name and hook name:
;delhook PlayerDied autoRefresh