void CA_count_alive_players()
{
total_players = redalive = bluealive = yellowalive = pinkalive = 0;
- FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(
+ FOREACH_CLIENT(IS_PLAYER(it), {
switch(it.team)
{
case NUM_TEAM_1: ++total_players; if(!IS_DEAD(it)) ++redalive; break;
case NUM_TEAM_3: ++total_players; if(!IS_DEAD(it)) ++yellowalive; break;
case NUM_TEAM_4: ++total_players; if(!IS_DEAD(it)) ++pinkalive; break;
}
- ));
- FOREACH_CLIENT(IS_REAL_CLIENT(it), LAMBDA(
+ });
+ FOREACH_CLIENT(IS_REAL_CLIENT(it), {
it.redalive_stat = redalive;
it.bluealive_stat = bluealive;
it.yellowalive_stat = yellowalive;
it.pinkalive_stat = pinkalive;
- ));
+ });
}
float CA_GetWinnerTeam()
{
Send_Notification(NOTIF_ALL, NULL, MSG_CENTER, CENTER_ROUND_OVER);
Send_Notification(NOTIF_ALL, NULL, MSG_INFO, INFO_ROUND_OVER);
+ FOREACH_CLIENT(IS_PLAYER(it), { nades_Clear(it); });
+
allowed_to_spawn = false;
+ game_stopped = true;
round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
- FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(nades_Clear(it)));
return 1;
}
}
allowed_to_spawn = false;
+ game_stopped = true;
round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
- FOREACH_CLIENT(IS_PLAYER(it), LAMBDA(nades_Clear(it)));
+ FOREACH_CLIENT(IS_PLAYER(it), { nades_Clear(it); });
return 1;
}
if (!allowed_to_spawn && IS_PLAYER(player)) // this is true even when player is trying to join
{
TRANSMUTE(Observer, player);
- if (player.jointime != time && !player.caplayer) // not when connecting
+ if (CS(player).jointime != time && !player.caplayer) // not when connecting
{
player.caplayer = 0.5;
Send_Notification(NOTIF_ONE_ONLY, player, MSG_INFO, INFO_CA_JOIN_LATE);
MUTATOR_HOOKFUNCTION(ca, reset_map_players)
{
FOREACH_CLIENT(true, {
- it.killcount = 0;
+ CS(it).killcount = 0;
if (!it.caplayer && IS_BOT_CLIENT(it))
{
it.team = -1;
PutClientInServer(it);
}
});
+ bot_relinkplayerlist();
return true;
}
return true;
}
-MUTATOR_HOOKFUNCTION(ca, GetTeamCount, CBC_ORDER_EXCLUSIVE)
+MUTATOR_HOOKFUNCTION(ca, CheckAllowedTeams, CBC_ORDER_EXCLUSIVE)
{
M_ARGV(0, float) = ca_teams;
}
frag_target.respawn_flags = RESPAWN_SILENT;
if (!warmup_stage)
eliminatedPlayers.SendFlags |= 1;
+ if(IS_BOT_CLIENT(frag_target))
+ bot_clear(frag_target);
return true;
}
if (!IS_DEAD(player))
ca_LastPlayerForTeam_Notify(player);
- if (player.killindicator_teamchange == -2) // player wants to spectate
+ if (CS(player).killindicator_teamchange == -2) // player wants to spectate
player.caplayer = 0;
if (player.caplayer)
player.frags = FRAGS_LMS_LOSER;
start_ammo_fuel = warmup_start_ammo_fuel = cvar("g_lms_start_ammo_fuel");
}
-MUTATOR_HOOKFUNCTION(ca, PlayerDamage_Calculate)
+MUTATOR_HOOKFUNCTION(ca, Damage_Calculate)
{
entity frag_attacker = M_ARGV(1, entity);
entity frag_target = M_ARGV(2, entity);
M_ARGV(2, bool) = true; // all weapons
}
+MUTATOR_HOOKFUNCTION(ca, HideTeamNagger)
+{
+ return true; // doesn't work well with the whole spectator as player thing
+}
+
MUTATOR_HOOKFUNCTION(ca, GetPlayerStatus)
{
entity player = M_ARGV(0, entity);