]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/sv_cmd.qc
Add a new model for tarbaby
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / sv_cmd.qc
index c5fcdca0bcd0d7848f3835e7178dbd27f65c5fea..627a1108e87d04ebd042382162fff4f4f4ba03ea 100644 (file)
@@ -139,6 +139,55 @@ void GameCommand_adminmsg(float request, float argc)
        }
 }
 
+void GameCommand_butcher(float request)
+{
+       switch(request)
+       {
+               case CMD_REQUEST_COMMAND:
+               {
+                       if(g_td) { print("This command doesn't work in Tower Defense.\n"); return; }
+                       if(autocvar_g_campaign) { print("This command doesn't work in campaign mode.\n"); return; }
+               
+            float removed_count = 0;
+                       entity montokill, head;
+                       
+            FOR_EACH_MONSTER(montokill)
+            {
+                               WaypointSprite_Kill(montokill.sprite);
+                               
+                               if(montokill.weaponentity)
+                                       remove(montokill.weaponentity);
+                    
+                remove(montokill);
+                removed_count += 1;
+            }
+                       
+                       FOR_EACH_PLAYER(head)
+                               head.monstercount = 0;
+                               
+                       monsters_total = 0; // reset stats?
+                       monsters_killed = 0;
+                               
+                       totalspawned = 0;
+                       
+                       if(removed_count <= 0)
+                               print("No monsters to kill\n");
+                       else
+                               print(strcat("Killed ", ftos(removed_count), " monster", ((removed_count == 1) ? "\n" : "s\n")));
+                               
+                       return; // never fall through to usage
+               }
+                       
+               default:
+               case CMD_REQUEST_USAGE:
+               {
+                       print("\nUsage:^3 sv_cmd butcher\n");
+                       print("  No arguments required.\n");
+                       return;
+               }
+       }
+}
+
 void GameCommand_allready(float request)
 {
        switch(request)
@@ -1041,10 +1090,10 @@ void GameCommand_moveplayer(float request, float argc)
                                                                // Check to see if the destination team is even available
                                                                switch(team_id) 
                                                                {
-                                                                       case FL_TEAM_1: if(c1 == -1) { print("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break;
-                                                                       case FL_TEAM_2: if(c2 == -1) { print("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break;
-                                                                       case FL_TEAM_3: if(c3 == -1) { print("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break;
-                                                                       case FL_TEAM_4: if(c4 == -1) { print("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break;
+                                                                       case NUM_TEAM_1: if(c1 == -1) { print("Sorry, can't move player to red team if it doesn't exist.\n"); return; } break;
+                                                                       case NUM_TEAM_2: if(c2 == -1) { print("Sorry, can't move player to blue team if it doesn't exist.\n"); return; } break;
+                                                                       case NUM_TEAM_3: if(c3 == -1) { print("Sorry, can't move player to yellow team if it doesn't exist.\n"); return; } break;
+                                                                       case NUM_TEAM_4: if(c4 == -1) { print("Sorry, can't move player to pink team if it doesn't exist.\n"); return; } break;
                                                                        
                                                                        default: print("Sorry, can't move player here if team ", destination, " doesn't exist.\n"); return;
                                                                }
@@ -1108,7 +1157,7 @@ void GameCommand_nospectators(float request)
                                if(plr.classname == "spectator" || plr.classname == "observer")
                                {
                                        plr.spectatortime = time;
-                                       sprint(plr, strcat("^7You have to become a player within the next ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds, otherwise you will be kicked, because spectators aren't allowed at this time!\n"));
+                                       Send_Notification(NOTIF_ONE_ONLY, plr, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
                                }
                        }
                        bprint(strcat("^7All spectators will be automatically kicked when not joining the game after ", ftos(autocvar_g_maxplayers_spectator_blocktime), " seconds!\n"));
@@ -1411,7 +1460,7 @@ void GameCommand_stuffto(float request, float argc)
        // we can be certain they understand the risks of it... So to enable, compile server with -DSTUFFTO_ENABLED argument.
 
        #ifdef STUFFTO_ENABLED
-       //#message stuffto command enabled
+       #message "stuffto command enabled"
        switch(request)
        {
                case CMD_REQUEST_COMMAND:
@@ -1724,6 +1773,7 @@ void GameCommand_(float request)
 // Common commands have double indentation to separate them a bit.
 #define SERVER_COMMANDS(request,arguments,command) \
        SERVER_COMMAND("adminmsg", GameCommand_adminmsg(request, arguments), "Send an admin message to a client directly") \
+       SERVER_COMMAND("butcher", GameCommand_butcher(request), "Instantly removes all monsters on the map") \
        SERVER_COMMAND("allready", GameCommand_allready(request), "Restart the server and reset the players") \
        SERVER_COMMAND("allspec", GameCommand_allspec(request, arguments), "Force all players to spectate") \
        SERVER_COMMAND("anticheat", GameCommand_anticheat(request, arguments), "Create an anticheat report for a client") \