+ FOR_EACH_PLAYER(e) {
+ if (e.team == COLOR_TEAM1)
+ start_red_ca_players += 1;
+ else if (e.team == COLOR_TEAM2)
+ start_blue_ca_players += 1;
+ }
+ // teams are ok if there's at least 1 player in each team
+ ca_teams_ok = (start_red_ca_players && start_blue_ca_players);
+ }
+
+ if(self.classname == "player" && self.health > 0 && self.movetype == MOVETYPE_NONE)
+ self.movetype = MOVETYPE_WALK;
+
+ }
+
+ // clear champion to avoid centerprinting again the champion msg
+ if (champion)
+ champion = world;
+}
+
+void count_players()
+{
+ // count amount of players in each team
+ total_players = red_players = blue_players = yellow_players = pink_players = 0;
+ FOR_EACH_PLAYER(self) {
+ if (self.team == COLOR_TEAM1)
+ {
+ red_players += 1;
+ total_players += 1;
+ }
+ else if (self.team == COLOR_TEAM2)
+ {
+ blue_players += 1;
+ total_players += 1;
+ }
+ else if (self.team == COLOR_TEAM3)
+ {
+ yellow_players += 1;
+ total_players += 1;
+ }
+ else if (self.team == COLOR_TEAM4)
+ {
+ pink_players += 1;
+ total_players += 1;
+ }
+ }
+}
+
+void count_alive_players()
+{
+ totalalive = redalive = bluealive = yellowalive = pinkalive = 0;
+ if(g_ca)
+ {
+ FOR_EACH_PLAYER(self) {
+ if (self.team == COLOR_TEAM1 && self.health >= 1)
+ {
+ redalive += 1;
+ totalalive += 1;
+ }
+ else if (self.team == COLOR_TEAM2 && self.health >= 1)
+ {
+ bluealive += 1;
+ totalalive += 1;
+ }
+ }
+ FOR_EACH_REALCLIENT(self) {
+ self.redalive_stat = redalive;
+ self.bluealive_stat = bluealive;
+ }
+ }
+ else if(g_freezetag)
+ {
+ // count amount of alive players in each team
+ FOR_EACH_PLAYER(self) {
+ if (self.team == COLOR_TEAM1 && self.freezetag_frozen == 0 && self.health >= 1)
+ {
+ redalive += 1;
+ totalalive += 1;
+ }
+ else if (self.team == COLOR_TEAM2 && self.freezetag_frozen == 0 && self.health >= 1)
+ {
+ bluealive += 1;
+ totalalive += 1;
+ }
+ else if (self.team == COLOR_TEAM3 && self.freezetag_frozen == 0 && self.health >= 1)
+ {
+ yellowalive += 1;
+ totalalive += 1;
+ }
+ else if (self.team == COLOR_TEAM4 && self.freezetag_frozen == 0 && self.health >= 1)
+ {
+ pinkalive += 1;
+ totalalive += 1;
+ }
+ }
+ FOR_EACH_REALCLIENT(self) {
+ self.redalive_stat = redalive;
+ self.bluealive_stat = bluealive;
+ self.yellowalive_stat = yellowalive;
+ self.pinkalive_stat = pinkalive;