}
}
+void GameCommand_butcher(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)
+ {
+ if(head.weaponentity)
+ remove(head.weaponentity);
+
+ if(head.iceblock)
+ remove(head.iceblock);
+
+ WaypointSprite_Kill(head.sprite);
+
+ 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
+ print(sprintf("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 butcher\n");
+ print(" No arguments required.\n");
+ return;
+ }
+ }
+}
+
void GameCommand_allready(float request)
{
switch(request)
MapInfo_SwitchGameType(t);
MapInfo_FilterGametype(MapInfo_CurrentGametype(), MapInfo_CurrentFeatures(), MapInfo_RequiredFlags(), MapInfo_ForbiddenFlags(), 0);
if(MapInfo_count > 0)
+ {
+ // update lsmaps in case the gametype changed, this way people can easily list maps for it
+ if(lsmaps_reply != "") { strunzone(lsmaps_reply); }
+ lsmaps_reply = strzone(getlsmaps());
bprint("Game type successfully switched to ", s, "\n");
+ }
else
{
bprint("Cannot use this game type: no map for it found\n");
// Where are we putting this player?
if(destination == "spec" || destination == "spectator")
{
- if(client.classname != "spectator" && client.classname != "observer")
+ if(!IS_SPEC(client) && !IS_OBSERVER(client))
{
self = client;
PutObserverInServer();
}
else
{
- if(client.classname != "spectator" && client.classname != "observer")
+ if(!IS_SPEC(client) && !IS_OBSERVER(client))
{
if(teamplay)
{
entity plr;
FOR_EACH_CLIENT(plr) //give every spectator <g_maxplayers_spectator_blocktime> seconds time to become a player
{
- if(plr.classname == "spectator" || plr.classname == "observer")
+ if(IS_SPEC(plr) || IS_OBSERVER(plr))
{
plr.spectatortime = time;
Send_Notification(NOTIF_ONE_ONLY, plr, MSG_INFO, INFO_SPECTATE_WARNING, autocvar_g_maxplayers_spectator_blocktime);
case "walk":
{
- if(argc == 3)
+ if(argc == 4)
{
e = nextent(world);
- if(tracewalk(e, stov(argv(1)), e.mins, e.maxs, stov(argv(2)), MOVE_NORMAL))
+ if(tracewalk(e, stov(argv(2)), e.mins, e.maxs, stov(argv(3)), MOVE_NORMAL))
print("can walk\n");
else
print("cannot walk\n");
case "showline":
{
- if(argc == 3)
+ if(argc == 4)
{
- vv = stov(argv(1));
- dv = stov(argv(2));
+ vv = stov(argv(2));
+ dv = stov(argv(3));
traceline(vv, dv, MOVE_NORMAL, world);
trailparticles(world, particleeffectnum("TR_NEXUIZPLASMA"), vv, trace_endpos);
trailparticles(world, particleeffectnum("TR_CRYLINKPLASMA"), trace_endpos, dv);
// ==================================
// Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
-// 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") \