]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Command to kill the server Melanosuchus/killserver
authorMattia Basaglia <mattia.basaglia@gmail.com>
Sun, 10 May 2015 08:15:35 +0000 (10:15 +0200)
committerMattia Basaglia <mattia.basaglia@gmail.com>
Sun, 10 May 2015 08:15:35 +0000 (10:15 +0200)
qcsrc/server/command/sv_cmd.qc

index 43c53792e5a755ea5e991625924974ac30b40f78..17e02f10a858cd36b7885986297a46d4dcd5623d 100644 (file)
@@ -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()