}
}
+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)
// 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;
}
// 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") \