#include "common.qh"
+
+#include <server/defs.qh>
+#include <server/miscfunctions.qh>
+
#include <common/command/_mod.qh>
#include "common.qh"
}
else // no, maybe it's a name?
{
- FOREACH_CLIENT(true, LAMBDA(
+ FOREACH_CLIENT(true, {
if(strdecolorize(it.netname) == strdecolorize(argv(start_index)))
{
selection = it;
break; // no reason to keep looking
}
- ));
+ });
index = (start_index + 1);
}
else
{
selection = NULL;
- FOREACH_CLIENT(true, LAMBDA(
+ FOREACH_CLIENT(true, {
if(strdecolorize(it.netname) == strdecolorize(input))
{
selection = it;
break; // no reason to keep looking
}
- ));
+ });
}
return selection;
void print_to(entity to, string input)
{
if (to) sprint(to, strcat(input, "\n"));
- else LOG_INFO(input, "\n");
+ else print(input, "\n");
}
// ==========================================
cvar_set("slowmo", ftos(orig_slowmo));
// unlock the view for players so they can move around again
- FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
+ FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
it.fixangle = false;
- ));
+ });
timeout_handler_reset(this);
}
cvar_set("slowmo", ftos(TIMEOUT_SLOWMO_VALUE));
// reset all the flood variables
- FOREACH_CLIENT(true, LAMBDA(
+ FOREACH_CLIENT(true, {
it.nickspamcount = it.nickspamtime = it.floodcontrol_chat =
it.floodcontrol_chatteam = it.floodcontrol_chattell =
it.floodcontrol_voice = it.floodcontrol_voiceteam = 0;
- ));
+ });
// copy .v_angle to .lastV_angle for every player in order to fix their view during pause (see PlayerPreThink)
- FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), LAMBDA(
+ FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it), {
it.lastV_angle = it.v_angle;
- ));
+ });
this.nextthink = time; // think again next frame to handle it under TIMEOUT_ACTIVE code
}
break;
});
- if (!found && arg_lower != "random") { print_to(caller, "Invalid monster"); return; }
+ if (!found && arg_lower != "random" && arg_lower != "anyrandom") { print_to(caller, "Invalid monster"); return; }
totalspawned += 1;
WarpZone_TraceBox(CENTER_OR_VIEWOFS(caller), caller.mins, caller.maxs, CENTER_OR_VIEWOFS(caller) + v_forward * 150, true, caller);
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, mon.health + mon.max_health + 200, DEATH_KILL.m_id, mon.origin, '0 0 0');
+ Damage(mon, NULL, NULL, mon.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;
}
case "butcher":
{
if (caller) { print_to(caller, "This command is not available to players"); return; }
- if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFO(M_ARGV(0, string), "\n"); return; }
+ if (MUTATOR_CALLHOOK(AllowMobButcher)) { LOG_INFOF("%s", M_ARGV(0, string)); return; }
int tmp_remcount = 0;
"ent", "nickname", "ping", "pl", "time", "ip", "crypto_id"));
total_listed_players = 0;
- FOREACH_CLIENT(true, LAMBDA(
+ FOREACH_CLIENT(true, {
is_bot = (IS_BOT_CLIENT(it));
if (is_bot)
tmp_crypto_idfp));
++total_listed_players;
- ));
+ });
print_to(caller, strcat("Finished listing ", ftos(total_listed_players), " client(s) out of ", ftos(maxclients), " slots."));