+
+ if(self.classname == "player" && self.health > 0 && self.movetype == MOVETYPE_NONE)
+ self.movetype = MOVETYPE_WALK;
+ }
+}
+
+void count_spawned_players()
+{
+ // TODO fix "*spawned" name, it should rather be "*players" or so
+ // not doing this now to prevent merge hell with Tag
+ // fix after merging with Tag
+
+ // count amount of players in each team
+ totalspawned = redspawned = bluespawned = yellowspawned = pinkspawned = 0;
+ FOR_EACH_PLAYER(self) {
+ if (self.team == COLOR_TEAM1)
+ {
+ redspawned += 1;
+ totalspawned += 1;
+ }
+ else if (self.team == COLOR_TEAM2)
+ {
+ bluespawned += 1;
+ totalspawned += 1;
+ }
+ else if (self.team == COLOR_TEAM3)
+ {
+ yellowspawned += 1;
+ totalspawned += 1;
+ }
+ else if (self.team == COLOR_TEAM4)
+ {
+ pinkspawned += 1;
+ totalspawned += 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_PLAYER(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_PLAYER(self) {
+ self.redalive_stat = redalive;
+ self.bluealive_stat = bluealive;
+ self.yellowalive_stat = yellowalive;
+ self.pinkalive_stat = pinkalive;
+ }