#include "common.qh"
-#include <server/defs.qh>
-#include <server/miscfunctions.qh>
-
#include <common/command/_mod.qh>
-#include "common.qh"
-
-#include "../scores.qh"
-
+#include <common/deathtypes/all.qh>
#include <common/monsters/_mod.qh>
#include <common/notifications/all.qh>
+#include <common/stats.qh>
+#include <common/vehicles/all.qh>
+#include <common/weapons/_all.qh>
#include <lib/warpzone/common.qh>
+#include <server/campaign.qh>
+#include <server/chat.qh>
+#include <server/client.qh>
+#include <server/command/common.qh>
+#include <server/mutators/_mod.qh>
+#include <server/scores.qh>
+#include <server/world.qh>
// ====================================================
// if client return player nickname, or if server return admin nickname
string GetCallerName(entity caller)
{
- if (caller) return playername(caller, false);
+ if (caller) return playername(caller.netname, caller.team, false);
else return ((autocvar_sv_adminnick != "") ? autocvar_sv_adminnick : "SERVER ADMIN"); // autocvar_hostname
}
return selection;
}
-// same thing, but instead return their edict number
-float GetFilteredNumber(string input)
-{
- entity selection = GetFilteredEntity(input);
- float output;
-
- output = etof(selection);
-
- return output;
-}
-
// switch between sprint and print depending on whether the receiver is the server or a player
void print_to(entity to, string input)
{
totalspawned += 1;
WarpZone_TraceBox(CENTER_OR_VIEWOFS(caller), caller.mins, caller.maxs, CENTER_OR_VIEWOFS(caller) + v_forward * 150, true, caller);
- mon = spawnmonster(spawn(), arg_lower, 0, caller, caller, trace_endpos, false, false, moveflag);
+ mon = spawnmonster(spawn(), arg_lower, MON_Null, caller, caller, trace_endpos, false, false, moveflag);
print_to(caller, strcat("Spawned ", mon.monster_name));
return;
}
if (mon.realowner != caller && autocvar_g_monsters_edit < 2) { print_to(caller, "This monster does not belong to you"); return; }
if (!is_visible) { print_to(caller, "You must look at your monster to edit it"); return; }
- Damage(mon, NULL, NULL, GetResourceAmount(mon, RES_HEALTH) + mon.max_health + 200, DEATH_KILL.m_id, DMG_NOWEP, mon.origin, '0 0 0');
+ Damage(mon, NULL, NULL, GetResource(mon, RES_HEALTH) + mon.max_health + 200, DEATH_KILL.m_id, DMG_NOWEP, mon.origin, '0 0 0');
print_to(caller, strcat("Your pet '", mon.monster_name, "' has been brutally mutilated"));
return;
}
if (!autocvar_g_monsters_edit) { print_to(caller, "Monster editing is disabled"); return; }
if (!is_visible) { print_to(caller, "You must look at your monster to edit it"); return; }
if (mon.realowner != caller && autocvar_g_monsters_edit < 2) { print_to(caller, "This monster does not belong to you"); return; }
- if (mon.monsterid == MON_MAGE.monsterid) { print_to(caller, "Mage skins can't be changed"); return; } // TODO
+ if (mon.monsterdef == MON_MAGE) { print_to(caller, "Mage skins can't be changed"); return; } // TODO
mon.skin = stof(argument);
print_to(caller, strcat("Monster skin successfully changed to ", ftos(mon.skin)));
case "butcher":
{
if (caller) { print_to(caller, "This command is not available to players"); return; }
- if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFOF("%s", M_ARGV(0, string)); return; }
+ if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFO(M_ARGV(0, string)); return; }
int tmp_remcount = 0;
default:
case CMD_REQUEST_USAGE:
{
- print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " editmob command [arguments]"));
- print_to(caller, " Where 'command' can be butcher spawn skin movetarget kill name");
- print_to(caller, " spawn, skin, movetarget and name require 'arguments'");
+ print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " editmob <command> [<arguments>]"));
+ print_to(caller, " Where <command> can be butcher spawn skin movetarget kill name");
+ print_to(caller, " spawn, skin, movetarget and name require <arguments>");
print_to(caller, " spawn also takes arguments list and random");
print_to(caller, " Monster will follow owner if third argument of spawn command is not defined");
return;
{
case CMD_REQUEST_COMMAND:
{
- string command = builtin_cvar_string(strcat("sv_info_", argv(1)));
+ string command = cvar_string(strcat("sv_info_", argv(1)));
if (command) wordwrap_sprint(caller, command, 1000);
else print_to(caller, "ERROR: unsupported info command");
default:
case CMD_REQUEST_USAGE:
{
- print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " info request"));
- print_to(caller, " Where 'request' is the suffixed string appended onto the request for cvar.");
+ print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " info <request>"));
+ print_to(caller, " Where <request> is the suffixed string appended onto the request for cvar.");
return;
}
}
default:
case CMD_REQUEST_USAGE:
{
- print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " records"));
- print_to(caller, " No arguments required.");
+ print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " records [<pagenum>]"));
+ print_to(caller, " Without arguments it prints all records (all pages) for the current gametype,");
+ print_to(caller, " otherwise if there are multiple pages it only prints page <pagenum> (1..10),");
return;
}
}
timeout_status = TIMEOUT_INACTIVE;
timeout_time = 0;
timeout_handler.nextthink = time; // timeout_handler has to take care of it immediately
+ Kill_Notification(NOTIF_ALL, NULL, MSG_CENTER, CPID_TIMEOUT);
bprint(strcat("^7The timeout was aborted by ", GetCallerName(caller), " !\n"));
return;
}
{
print_to(caller, "^7Error: You can not call a timeout while a vote is active.");
}
- else if (warmup_stage && !g_warmup_allow_timeout)
+ else if (warmup_stage && !autocvar_g_warmup_allow_timeout)
{
print_to(caller, "^7Error: You can not call a timeout in warmup-stage.");
}
timeout_time = autocvar_sv_timeout_length;
timeout_leadtime = autocvar_sv_timeout_leadtime;
- timeout_handler = spawn();
+ timeout_handler = new(timeout_handler);
setthink(timeout_handler, timeout_handler_think);
timeout_handler.nextthink = time; // always let the entity think asap
default:
case CMD_REQUEST_USAGE:
{
- print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " who [separator]"));
- print_to(caller, " Where 'separator' is the optional string to separate the values with, default is a space.");
+ print_to(caller, strcat("\nUsage:^3 ", GetCommandPrefix(caller), " who [<separator>]"));
+ print_to(caller, " Where <separator> is the optional string to separate the values with, default is a space.");
return;
}
}