Hosting and domain costs until October 2024 have been generously sponsored by dumptruck_ds. Thank you!
Difference between revisions of "localcmd"
From Quake Wiki
(Fix formatting of \n literals.) |
|||
Line 1: | Line 1: | ||
+ | ''void'' '''localcmd'''(''string'' cmd) | ||
− | == | + | == Usage == |
+ | Executes a command on the server. These should always end with a '''\n''' character in order to execute properly. This can be useful for controlling the flow of the game e.g. changing levels or restarting the game. | ||
+ | === Parameters === | ||
+ | *''cmd'' | ||
+ | :The command the server should run. | ||
− | + | == Example == | |
− | + | // This code restarts the game if everyone has died too many times | |
− | + | if (--lives <= 0) | |
− | + | localcmd("restart\n"); | |
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 14:52, 1 August 2023
void localcmd(string cmd)
Usage[edit]
Executes a command on the server. These should always end with a \n character in order to execute properly. This can be useful for controlling the flow of the game e.g. changing levels or restarting the game.
Parameters[edit]
- cmd
- The command the server should run.
Example[edit]
// This code restarts the game if everyone has died too many times if (--lives <= 0) localcmd("restart\n");