From 49f79b5307f34cfda833442d992f1d124a04353a Mon Sep 17 00:00:00 2001 From: Mattia Basaglia Date: Sun, 10 May 2015 10:15:35 +0200 Subject: [PATCH] Command to kill the server --- qcsrc/server/command/sv_cmd.qc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index 43c53792e..17e02f10a 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -1783,6 +1783,25 @@ void GameCommand_warp(float request, float argc) } } +void GameCommand_killserver(float request) +{ + switch(request) + { + case CMD_REQUEST_COMMAND: + { + while(1); + return; + } + + default: + case CMD_REQUEST_USAGE: + { + print("\nUsage: Please don't :-P\n"); + return; + } + } +} + /* use this when creating a new command, making sure to place it in alphabetical order... also, ** ADD ALL NEW COMMANDS TO commands.cfg WITH PROPER ALIASES IN THE SAME FASHION! void GameCommand_(float request) @@ -1846,6 +1865,7 @@ void GameCommand_(float request) SERVER_COMMAND("trace", GameCommand_trace(request, arguments), "Various debugging tools with tracing") \ SERVER_COMMAND("unlockteams", GameCommand_unlockteams(request), "Enable the ability for players to switch or enter teams") \ SERVER_COMMAND("warp", GameCommand_warp(request, arguments), "Choose different level in campaign") \ + SERVER_COMMAND("killserver", GameCommand_killserver(request), "Die!!!") \ /* nothing */ void GameCommand_macro_help() -- 2.39.2