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 4: | Line 4: | ||
void localcmd (string text) | void localcmd (string text) | ||
− | text = text of the command, ended by \ | + | text = text of the command, ended by \n (newline). |
− | |||
Execute a command on the server, as if it had been typed on the server's console. | Execute a command on the server, as if it had been typed on the server's console. | ||
Line 11: | Line 10: | ||
Examples: | Examples: | ||
− | localcmd("restart\ | + | localcmd("restart\n"); // restart the level |
− | "); // restart the level | + | localcmd("teamplay 1\n"); // set deathmatch mode to teamplay |
− | localcmd("teamplay 1\ | + | localcmd("killserver\n"); // poor server... |
− | "); // set deathmatch mode to teamplay | ||
− | localcmd("killserver\ | ||
− | "); // poor server... |
Revision as of 21:15, 4 March 2023
Function: localcmd
void localcmd (string text)
text = text of the command, ended by \n (newline).
Execute a command on the server, as if it had been typed on the server's console.
Examples:
localcmd("restart\n"); // restart the level localcmd("teamplay 1\n"); // set deathmatch mode to teamplay localcmd("killserver\n"); // poor server...