float roundstarttime = getstatf(STAT_ROUNDSTARTTIME);
if(roundstarttime == -1)
{
- // stop countdown immediately
- centerprint_generic(CPID_GAME_STARTING, "", 1, 0);
remove(self);
return;
}
else // countdown is still going
{
if(roundstarttime == starttime)
- centerprint_generic(CPID_GAME_STARTING, _("^1Round starts in %d seconds"), 1, countdown_rounded);
+ Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_ROUNDSTART, countdown_rounded);
else
Local_Notification(MSG_CENTER, CENTER_COUNTDOWN_GAMESTART, countdown_rounded);
entity tm;
float teams_count = 0;
for(tm = teams.sort_next; tm; tm = tm.sort_next)
- if(tm.team != COLOR_SPECTATOR)
+ if(tm.team != NUM_SPECTATOR)
++teams_count;
float layout;
MSG_INFO_NOTIF(1, INFO_DEATH_SELF_VOID, 2, 1, "s1 s2loc spree_lost", "s1", "notify_void", _("^BG%s^K1 was in the wrong place%s%s\n"), "") \
MULTITEAM_INFO(1, INFO_DEATH_TEAMKILL_, 4, 3, 1, "s1 s2 s3loc spree_end", "s2 s1", "notify_teamkill_%s", _("^BG%s^K1 was betrayed by ^BG%s^K1%s\n"), "") \
MSG_INFO_NOTIF(1, INFO_FREEZETAG_FREEZE, 2, 0, "s1 s2", "", "", _("^BG%s^K1 was frozen by ^BG%s\n"), "") \
- MSG_INFO_NOTIF(1, INFO_FREEZETAG_REVIVE, 2, 0, "s1 s2", "", "", _("^BG%s^K3 was revived by ^BG%s\n"), "") \
- MULTITEAM_INFO(1, INFO_FREEZETAG_ROUND_WIN_, 4, 0, 0, "", "", "", _("^TC^TT^BG team wins the round, all other teams were frozen\n"), "") \
+ MSG_INFO_NOTIF(1, INFO_FREEZETAG_REVIVED, 2, 0, "s1 s2", "", "", _("^BG%s^K3 was revived by ^BG%s\n"), "") \
+ MSG_INFO_NOTIF(1, INFO_FREEZETAG_AUTO_REVIVED, 1, 1, "s1 f1", "", "", _("^BG%s^K3 was automatically revived after %s second(s)\n"), "") \
+ MULTITEAM_INFO(1, INFO_ROUND_TEAM_WIN_, 4, 0, 0, "", "", "", _("^TC^TT^BG team wins the round\n"), "") \
+ MSG_INFO_NOTIF(1, INFO_ROUND_PLAYER_WIN, 1, 0, "s1", "", "", _("^BG%s^BG wins the round\n"), "") \
+ MSG_INFO_NOTIF(1, INFO_ROUND_TIED, 0, 0, "", "", "", _("^BGRound tied\n"), "") \
+ MSG_INFO_NOTIF(1, INFO_ROUND_OVER, 0, 0, "", "", "", _("^BGRound over, there's no winner\n"), "") \
MSG_INFO_NOTIF(1, INFO_FREEZETAG_SELF, 1, 0, "s1", "", "", _("^BG%s^K1 froze themself\n"), "") \
MSG_INFO_NOTIF(1, INFO_GODMODE_OFF, 0, 1, "f1", "", "", _("^BGGodmode saved you %s units of damage, cheater!\n"), "") \
MSG_INFO_NOTIF(0, INFO_ITEM_WEAPON_DONTHAVE, 0, 1, "item_wepname", "", "", _("^BGYou do not have the ^F1%s\n"), "") \
MSG_CENTER_NOTIF(1, CENTER_ARENA_ROUNDSTART, 0, 1, "", CPID_ARENA, "1 f1", _("^F4Round will start in ^COUNT"), "") \
MSG_CENTER_NOTIF(1, CENTER_ASSAULT_ATTACKING, 0, 0, "", CPID_ASSAULT_ROLE, "0 0", _("^BGYou are attacking!"), "") \
MSG_CENTER_NOTIF(1, CENTER_ASSAULT_DEFENDING, 0, 0, "", CPID_ASSAULT_ROLE, "0 0", _("^BGYou are defending!"), "") \
- MSG_CENTER_NOTIF(1, CENTER_COUNTDOWN_BEGIN, 0, 0, "", CPID_GAMESTART, "2 0", _("^F4Begin!"), "") \
- MSG_CENTER_NOTIF(1, CENTER_COUNTDOWN_GAMESTART, 0, 1, "", CPID_GAMESTART, "1 f1", _("^F4Game starts in ^COUNT"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_COUNTDOWN_BEGIN, 0, 0, "", CPID_ROUND, "2 0", _("^F4Begin!"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_COUNTDOWN_GAMESTART, 0, 1, "", CPID_ROUND, "1 f1", _("^F4Game starts in ^COUNT"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_COUNTDOWN_ROUNDSTART, 0, 1, "", CPID_ROUND, "1 f1", _("^F4Round starts in ^COUNT"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_ROUND_TIED, 0, 0, "", CPID_ROUND, "0 0", _("^BGRound tied"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_ROUND_OVER, 0, 0, "", CPID_ROUND, "0 0", _("^BGRound over, there's no winner"), "") \
MSG_CENTER_NOTIF(1, CENTER_CTF_CAPTURESHIELD_FREE, 0, 0, "", CPID_CTF_CAPSHIELD, "0 0", _("^BGYou are now free.\n^BGFeel free to ^F2try to capture^BG the flag again\n^BGif you think you will succeed."), "") \
MSG_CENTER_NOTIF(1, CENTER_CTF_CAPTURESHIELD_SHIELDED, 0, 0, "", CPID_CTF_CAPSHIELD, "0 0", _("^BGYou are now ^F1shielded^BG from the flag\n^BGfor ^F2too many unsuccessful attempts^BG to capture.\n^BGMake some defensive scores before trying again."), "") \
MULTITEAM_CENTER(1, CENTER_CTF_CAPTURE_, 2, 0, 0, "", CPID_CTF_LOWPRIO, "0 0", _("^BGYou captured the ^TC^TT^BG flag!"), "") \
MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_FROZEN, 1, 0, "s1", NO_CPID, "0 0", _("^K1You were frozen by ^BG%s"), "") \
MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_REVIVE, 1, 0, "s1", NO_CPID, "0 0", _("^K3You revived ^BG%s"), "") \
MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_REVIVED, 1, 0, "s1", NO_CPID, "0 0", _("^K3You were revived by ^BG%s"), "") \
- MULTITEAM_CENTER(1, CENTER_FREEZETAG_ROUND_WIN_, 4, 0, 0, "", NO_CPID, "0 0", _("^TC^TT^BG team wins the round, all other teams were frozen"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_AUTO_REVIVED, 0, 1, "f1", NO_CPID, "0 0", _("^K3You were automatically revived after %s second(s)"), "") \
+ MULTITEAM_CENTER(1, CENTER_ROUND_TEAM_WIN_, 4, 0, 0, "", CPID_ROUND, "0 0", _("^TC^TT^BG team wins the round"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_ROUND_PLAYER_WIN, 1, 0, "s1", CPID_ROUND, "0 0", _("^BG%s^BG wins the round"), "") \
MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_SELF, 0, 0, "", NO_CPID, "0 0", _("^K1You froze yourself"), "") \
- MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_SPAWN_LATE, 0, 0, "", NO_CPID, "0 0", _("^K1You spawned after the round started, you'll spawn as frozen"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_FREEZETAG_SPAWN_LATE, 0, 0, "", NO_CPID, "0 0", _("^K1Round already started, you spawn as frozen"), "") \
MSG_CENTER_NOTIF(1, CENTER_ITEM_WEAPON_DONTHAVE, 0, 1, "item_wepname", CPID_ITEM, "item_centime 0", _("^BGYou do not have the ^F1%s"), "") \
MSG_CENTER_NOTIF(1, CENTER_ITEM_WEAPON_DROP, 1, 1, "item_wepname item_wepammo", CPID_ITEM, "item_centime 0", _("^BGYou dropped the ^F1%s^BG%s"), "") \
MSG_CENTER_NOTIF(1, CENTER_ITEM_WEAPON_GOT, 0, 1, "item_wepname", CPID_ITEM, "item_centime 0", _("^BGYou got the ^F1%s"), "") \
MSG_CENTER_NOTIF(1, CENTER_KEYHUNT_MEET, 0, 0, "", CPID_KEYHUNT, "0 0", _("^BGAll keys are in your team's hands!\nMeet the other key carriers ^F4NOW^BG!"), "") \
MSG_CENTER_NOTIF(1, CENTER_KEYHUNT_SCAN, 0, 1, "", CPID_KEYHUNT_OTHER, "f1 0", _("^BGScanning frequency range..."), "") \
MULTITEAM_CENTER(1, CENTER_KEYHUNT_START_, 4, 0, 0, "", CPID_KEYHUNT, "0 0", _("^BGYou are starting with the ^TC^TT Key"), "") \
- MSG_CENTER_NOTIF(1, CENTER_KEYHUNT_WAIT, 0, 4, "kh_teams", CPID_KEYHUNT_OTHER, "0 0", _("^BGWaiting for players to join...\nNeed active players for: %s"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_KEYHUNT_WAIT, 0, 4, "missing_teams", CPID_KEYHUNT_OTHER, "0 0", _("^BGWaiting for players to join...\nNeed active players for: %s"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_MISSING_TEAMS, 0, 4, "missing_teams", CPID_ROUND, "0 0", _("^BGWaiting for players to join...\nNeed active players for: %s"), "") \
+ MSG_CENTER_NOTIF(1, CENTER_MISSING_PLAYERS, 0, 1, "f1", CPID_ROUND, "0 0", _("^BGWaiting for %s player(s) to join..."), "") \
MSG_CENTER_NOTIF(1, CENTER_LMS_CAMPCHECK, 0, 0, "", CPID_LMS_CAMP, "0 0", _("^F2Don't camp!"), "") \
MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO, 0, 0, "", CPID_MINSTA_FINDAMMO, "1 9", _("^F4^COUNT^BG left to find some ammo!"), "") \
MSG_CENTER_NOTIF(1, CENTER_MINSTA_FINDAMMO_FIRST, 0, 0, "", CPID_MINSTA_FINDAMMO, "1 10", _("^BGGet some ammo or you'll be dead in ^F4^COUNT^BG!"), _("^BGGet some ammo! ^F4^COUNT^BG left!")) \
f2race_time: mmssss of f2
race_col: color of race time/position (i.e. good or bad)
race_diff: show time difference between f2 and f3
- kh_teams: show which teams still need players in keyhunt centerprint
+ missing_teams: show which teams still need players
pass_key: find the keybind for "passing" or "dropping" in CTF game mode
frag_ping: show the ping of a player
frag_stats: show health/armor/ping of a player
ARG_CASE(ARG_CS_SV, "f2race_time", mmssss(f2)) \
ARG_CASE(ARG_CS_SV, "race_col", CCR(((f1 == 1) ? "^F1" : "^F2"))) \
ARG_CASE(ARG_CS_SV, "race_diff", ((f2 > f3) ? sprintf(CCR("^1[+%s]"), mmssss(f2 - f3)) : sprintf(CCR("^2[-%s]"), mmssss(f3 - f2)))) \
- ARG_CASE(ARG_CS, "kh_teams", notif_arg_kh_teams(f1, f2, f3, f4)) \
+ ARG_CASE(ARG_CS, "missing_teams", notif_arg_missing_teams(f1, f2, f3, f4)) \
ARG_CASE(ARG_CS, "pass_key", ((((tmp_s = getcommandkey("pass", "+use")) != "pass") && !(strstrofs(tmp_s, "not bound", 0) >= 0)) ? sprintf(CCR(_(" ^F1(Press %s)")), tmp_s) : "")) \
ARG_CASE(ARG_CS, "frag_ping", notif_arg_frag_ping(TRUE, f2)) \
ARG_CASE(ARG_CS, "frag_stats", notif_arg_frag_stats(f2, f3, f4)) \
return sprintf(CCR(_("\n(^F4Dead^BG)%s")), notif_arg_frag_ping(FALSE, fping));
}
-string notif_arg_kh_teams(float f1, float f2, float f3, float f4)
+string notif_arg_missing_teams(float f1, float f2, float f3, float f4)
{
return sprintf("%s%s%s%s",
(f1 ?
// Game logic for warmup
// =======================
-// Resets the state of all clients, items, flags, runes, keys, weapons, waypoints, ... of the map.
+// Resets the state of all clients, items, weapons, waypoints, ... of the map.
void reset_map(float dorespawn)
{
entity oldself;
}
if(g_keyhunt)
- kh_Controller_SetThink_NoMsg(autocvar_g_balance_keyhunt_delay_round+(game_starttime - time), kh_StartRound);
+ kh_Controller_SetThink(autocvar_g_balance_keyhunt_delay_round + (game_starttime - time), kh_StartRound);
self = oldself;
}
if(round_handler_GetTimeLeft() <= 0)
{
- FOR_EACH_REALCLIENT(e)
- centerprint(e, "Round over, there's no winner");
- bprint("Round over, there's no winner\n");
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, CENTER_ROUND_OVER);
round_handler_Init(5, autocvar_g_arena_warmup, autocvar_g_arena_round_timelimit);
return 1;
}
if(champion)
{
- FOR_EACH_REALCLIENT(e)
- centerprint(e, strcat("The Champion is ", champion.netname));
- bprint("The Champion is ", champion.netname, "\n");
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_PLAYER_WIN, champion.netname);
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_PLAYER_WIN, champion.netname);
UpdateFrags(champion, +1);
}
else
{
- FOR_EACH_REALCLIENT(e)
- centerprint(e, "Round tied");
- bprint("Round tied\n");
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
}
round_handler_Init(5, autocvar_g_arena_warmup, autocvar_g_arena_round_timelimit);
return 1;
float prev_numspawned;
float Arena_CheckPlayers()
{
- entity e;
-
Arena_AddChallengers();
if(numspawned >= 2)
{
- if(prev_numspawned != -1)
- {
- FOR_EACH_REALCLIENT(e)
- Send_CSQC_Centerprint_Generic_Expire(e, CPID_WAITING_PLAYERS);
- }
+ Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_PLAYERS);
prev_numspawned = -1;
return 1;
}
if(prev_numspawned != numspawned && numspawned == 1)
{
- FOR_EACH_REALCLIENT(e)
- Send_CSQC_Centerprint_Generic(e, CPID_WAITING_PLAYERS, "Waiting for players to join...", -1, 0);
+ if(maxspawned - numspawned > 0)
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_PLAYERS, maxspawned - numspawned);
prev_numspawned = numspawned;
}
entity e;
total_players = redalive = bluealive = yellowalive = pinkalive = 0;
FOR_EACH_PLAYER(e) {
- if(e.team == COLOR_TEAM1)
+ if(e.team == NUM_TEAM_1)
{
++total_players;
if (e.health >= 1) ++redalive;
}
- else if(e.team == COLOR_TEAM2)
+ else if(e.team == NUM_TEAM_2)
{
++total_players;
if (e.health >= 1) ++bluealive;
}
- else if(e.team == COLOR_TEAM3)
+ else if(e.team == NUM_TEAM_3)
{
++total_players;
if (e.health >= 1) ++yellowalive;
}
- else if(e.team == COLOR_TEAM4)
+ else if(e.team == NUM_TEAM_4)
{
++total_players;
if (e.health >= 1) ++pinkalive;
{
float winner_team = 0;
if(redalive >= 1)
- winner_team = COLOR_TEAM1;
+ winner_team = NUM_TEAM_1;
if(bluealive >= 1)
{
if(winner_team) return 0;
- winner_team = COLOR_TEAM2;
+ winner_team = NUM_TEAM_2;
}
if(yellowalive >= 1)
{
if(winner_team) return 0;
- winner_team = COLOR_TEAM3;
+ winner_team = NUM_TEAM_3;
}
if(pinkalive >= 1)
{
if(winner_team) return 0;
- winner_team = COLOR_TEAM4;
+ winner_team = NUM_TEAM_4;
}
if(winner_team)
return winner_team;
#define CA_ALIVE_TEAMS_OK() (CA_ALIVE_TEAMS() == ca_teams)
float CA_CheckWinner()
{
- entity e;
if(round_handler_GetTimeLeft() <= 0)
{
- FOR_EACH_REALCLIENT(e)
- centerprint(e, "Round over, there's no winner");
- bprint("Round over, there's no winner.\n");
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, CENTER_ROUND_OVER);
allowed_to_spawn = FALSE;
round_handler_Init(5, autocvar_g_ca_warmup, autocvar_g_ca_round_timelimit);
return 1;
if(CA_ALIVE_TEAMS() > 1)
return 0;
- float winner_team;
- string teamname;
- winner_team = CA_GetWinnerTeam();
+ float winner_team = CA_GetWinnerTeam();
if(winner_team > 0)
{
- teamname = ColoredTeamName(winner_team);
- FOR_EACH_REALCLIENT(e)
- centerprint(e, strcat(teamname, " wins the round"));
- bprint(teamname, " wins the round.\n");
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM_4(winner_team, CENTER_ROUND_TEAM_WIN_));
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(winner_team, INFO_ROUND_TEAM_WIN_));
TeamScore_AddToTeam(winner_team, ST_SCORE, +1);
}
else if(winner_team == -1)
{
- FOR_EACH_REALCLIENT(e)
- centerprint(e, "Round tied");
- bprint("Round tied.\n");
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
}
allowed_to_spawn = FALSE;
float prev_total_players;
float CA_CheckTeams()
{
- entity e;
allowed_to_spawn = TRUE;
CA_count_alive_players();
if(CA_ALIVE_TEAMS_OK())
{
- if(prev_total_players != -1)
- {
- FOR_EACH_REALCLIENT(e)
- Send_CSQC_Centerprint_Generic_Expire(e, CPID_WAITING_PLAYERS);
- }
+ Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS);
prev_total_players = -1;
return 1;
}
if(prev_total_players != total_players)
{
- string teams_missing = "";
- if(!redalive) teams_missing = strcat(teams_missing, ColoredTeamName(COLOR_TEAM1), ", ");
- if(!bluealive) teams_missing = strcat(teams_missing, ColoredTeamName(COLOR_TEAM2), ", ");
+ float p1 = 0, p2 = 0, p3 = 0, p4 = 0;
+ if(!redalive) p1 = NUM_TEAM_1;
+ if(!bluealive) p2 = NUM_TEAM_2;
if(ca_teams >= 3)
- if(!yellowalive) teams_missing = strcat(teams_missing, ColoredTeamName(COLOR_TEAM3), ", ");
- if(ca_teams == 4)
- if(!pinkalive) teams_missing = strcat(teams_missing, ColoredTeamName(COLOR_TEAM4), ", ");
- teams_missing = substring(teams_missing, 0, strlen(teams_missing)-2);
-
- FOR_EACH_REALCLIENT(e)
- Send_CSQC_Centerprint_Generic(e, CPID_WAITING_PLAYERS, strcat("Waiting for players to join...\n\nNeed active players for: ", teams_missing), -1, 0);
+ if(!yellowalive) p3 = NUM_TEAM_3;
+ if(ca_teams >= 4)
+ if(!pinkalive) p4 = NUM_TEAM_4;
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS, p1, p2, p3, p4);
prev_total_players = total_players;
}
return 0;
entity e;
total_players = redalive = bluealive = yellowalive = pinkalive = 0;
FOR_EACH_PLAYER(e) {
- if(e.team == COLOR_TEAM1 && e.health >= 1)
+ if(e.team == NUM_TEAM_1 && e.health >= 1)
{
++total_players;
if (!e.freezetag_frozen) ++redalive;
}
- else if(e.team == COLOR_TEAM2 && e.health >= 1)
+ else if(e.team == NUM_TEAM_2 && e.health >= 1)
{
++total_players;
if (!e.freezetag_frozen) ++bluealive;
}
- else if(e.team == COLOR_TEAM3 && e.health >= 1)
+ else if(e.team == NUM_TEAM_3 && e.health >= 1)
{
++total_players;
if (!e.freezetag_frozen) ++yellowalive;
}
- else if(e.team == COLOR_TEAM4 && e.health >= 1)
+ else if(e.team == NUM_TEAM_4 && e.health >= 1)
{
++total_players;
if (!e.freezetag_frozen) ++pinkalive;
float prev_total_players;
float freezetag_CheckTeams()
{
- entity e;
if(FREEZETAG_ALIVE_TEAMS_OK())
{
- if(prev_total_players != -1)
- {
- FOR_EACH_REALCLIENT(e)
- Send_CSQC_Centerprint_Generic_Expire(e, CPID_WAITING_PLAYERS);
- }
+ Kill_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS);
prev_total_players = -1;
return 1;
}
if(prev_total_players != total_players)
{
- string teams_missing = "";
- if(!redalive) teams_missing = strcat(teams_missing, ColoredTeamName(COLOR_TEAM1), ", ");
- if(!bluealive) teams_missing = strcat(teams_missing, ColoredTeamName(COLOR_TEAM2), ", ");
+ float p1 = 0, p2 = 0, p3 = 0, p4 = 0;
+ if(!redalive) p1 = NUM_TEAM_1;
+ if(!bluealive) p2 = NUM_TEAM_2;
if(freezetag_teams >= 3)
- if(!yellowalive) teams_missing = strcat(teams_missing, ColoredTeamName(COLOR_TEAM3), ", ");
- if(freezetag_teams == 4)
- if(!pinkalive) teams_missing = strcat(teams_missing, ColoredTeamName(COLOR_TEAM4), ", ");
- teams_missing = substring(teams_missing, 0, strlen(teams_missing)-2);
-
- FOR_EACH_REALCLIENT(e)
- Send_CSQC_Centerprint_Generic(e, CPID_WAITING_PLAYERS, strcat("Waiting for players to join...\n\nNeed active players for: ", teams_missing), -1, 0);
+ if(!yellowalive) p3 = NUM_TEAM_3;
+ if(freezetag_teams >= 4)
+ if(!pinkalive) p4 = NUM_TEAM_4;
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_MISSING_TEAMS, p1, p2, p3, p4);
prev_total_players = total_players;
}
return 0;
{
float winner_team = 0;
if(redalive >= 1)
- winner_team = COLOR_TEAM1;
+ winner_team = NUM_TEAM_1;
if(bluealive >= 1)
{
if(winner_team) return 0;
- winner_team = COLOR_TEAM2;
+ winner_team = NUM_TEAM_2;
}
if(yellowalive >= 1)
{
if(winner_team) return 0;
- winner_team = COLOR_TEAM3;
+ winner_team = NUM_TEAM_3;
}
if(pinkalive >= 1)
{
if(winner_team) return 0;
- winner_team = COLOR_TEAM4;
+ winner_team = NUM_TEAM_4;
}
if(winner_team)
return winner_team;
entity e;
if(round_handler_GetTimeLeft() <= 0)
{
- FOR_EACH_REALCLIENT(e)
- centerprint(e, "Round over, there's no winner");
- bprint("Round over, there's no winner.\n");
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_OVER);
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_OVER);
FOR_EACH_PLAYER(e)
e.freezetag_frozen_timeout = 0;
round_handler_Init(5, autocvar_g_freezetag_warmup, autocvar_g_freezetag_round_timelimit);
return 0;
float winner_team;
- string teamname;
winner_team = freezetag_getWinnerTeam();
if(winner_team > 0)
{
- Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM_4(winner.team, CENTER_FREEZETAG_ROUND_WIN_));
- Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(winner.team, INFO_FREEZETAG_ROUND_WIN_));
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, APP_TEAM_NUM_4(winner_team, CENTER_ROUND_TEAM_WIN_));
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, APP_TEAM_NUM_4(winner_team, INFO_ROUND_TEAM_WIN_));
TeamScore_AddToTeam(winner_team, ST_SCORE, +1);
}
else if(winner_team == -1)
{
- FOR_EACH_REALCLIENT(e)
- centerprint(e, "^5Round tied! All teams were frozen.");
- bprint("^5Round tied! All teams were frozen.\n");
+ Send_Notification(NOTIF_ALL, world, MSG_CENTER, CENTER_ROUND_TIED);
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_ROUND_TIED);
}
FOR_EACH_PLAYER(e)
ice.nextthink = time;
ice.frame = floor(random() * 21); // ice model has 20 different looking frames
ice.alpha = ICE_MAX_ALPHA;
- ice.colormod = TeamColor(self.team);
+ ice.colormod = Team_ColorRGB(self.team);
ice.glowmod = ice.colormod;
setmodel(ice, "models/ice/ice.md3");
if(n == -1)
{
- string s = ftos(autocvar_g_freezetag_frozen_maxtime);
- centerprint(self, strcat("^5You were automatically revived after ", s, " seconds^5.\n"));
- bprint("^7", self.netname, "^5 were automatically revived after ", s, " seconds^5.\n");
+ Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_FREEZETAG_AUTO_REVIVED, autocvar_g_freezetag_frozen_maxtime);
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_AUTO_REVIVED, self.netname, autocvar_g_freezetag_frozen_maxtime);
return 1;
}
Send_Notification(NOTIF_ONE, self, MSG_CENTER, CENTER_FREEZETAG_REVIVED, o.netname);
Send_Notification(NOTIF_ONE, o, MSG_CENTER, CENTER_FREEZETAG_REVIVE, self.netname);
- Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVE, self.netname, o.netname);
+ Send_Notification(NOTIF_ALL, world, MSG_INFO, INFO_FREEZETAG_REVIVED, self.netname, o.netname);
}
FOR_EACH_PLAYER(other)