X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcommand%2Fsv_cmd.qc;h=45871b7aeb60ad51101651ca3c019fdcd1c5a4d8;hb=83fec76999cac6042182490dbeb3fe7b7596f45a;hp=ff07f2458a0608ed5f7f3696f129531da76d9f8d;hpb=bf20397b0c62c9de0335ef9d70d60842fde9d0b2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/command/sv_cmd.qc b/qcsrc/server/command/sv_cmd.qc index ff07f2458..45871b7ae 100644 --- a/qcsrc/server/command/sv_cmd.qc +++ b/qcsrc/server/command/sv_cmd.qc @@ -139,6 +139,50 @@ void GameCommand_adminmsg(float request, float argc) } } +void GameCommand_mobbutcher(float request) +{ + switch(request) + { + case CMD_REQUEST_COMMAND: + { + if(autocvar_g_campaign) { print("This command doesn't work in campaign mode.\n"); return; } + if(g_invasion) { print("This command doesn't work during an invasion.\n"); return; } + + float removed_count = 0; + entity head; + + FOR_EACH_MONSTER(head) + { + monster_remove(head); + ++removed_count; + } + + 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 + printf("Killed %d monster%s\n", removed_count, ((removed_count == 1) ? "" : "s")); + + return; // never fall through to usage + } + + default: + case CMD_REQUEST_USAGE: + { + print("\nUsage:^3 sv_cmd mobbutcher\n"); + print(" No arguments required.\n"); + return; + } + } +} + void GameCommand_allready(float request) { switch(request) @@ -1035,6 +1079,7 @@ void GameCommand_moveplayer(float request, float argc) } else if(team_id == 0) // auto team { + CheckAllowedTeams(client); team_id = Team_NumberToTeam(FindSmallestTeam(client, FALSE)); } else @@ -1728,6 +1773,7 @@ void GameCommand_(float request) // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;) #define SERVER_COMMANDS(request,arguments,command) \ SERVER_COMMAND("adminmsg", GameCommand_adminmsg(request, arguments), "Send an admin message to a client directly") \ + SERVER_COMMAND("mobbutcher", GameCommand_mobbutcher(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") \