+ //PrintToChatAll("TeamBalance_AutoBalanceBots");
+ entity balance = TeamBalance_CheckAllowedTeams(NULL);
+ TeamBalance_GetTeamCounts(balance, NULL);
+ int smallest_team_index = 0;
+ int smallest_team_player_count = 0;
+ int largest_team_index = 0;
+ int largest_team_player_count = 0;
+ for (int i = 1; i <= NUM_TEAMS; ++i)
+ {
+ entity team_ = TeamBalance_GetTeamFromIndex(balance, i);
+ if (!TeamBalanceTeam_IsAllowed(team_))
+ {
+ continue;
+ }
+ int player_count = TeamBalanceTeam_GetNumberOfPlayers(team_);
+ if (smallest_team_index == 0)
+ {
+ smallest_team_index = i;
+ smallest_team_player_count = player_count;
+ }
+ else if (player_count < smallest_team_player_count)
+ {
+ smallest_team_index = i;
+ smallest_team_player_count = player_count;
+ }
+ if (largest_team_index == 0)
+ {
+ largest_team_index = i;
+ largest_team_player_count = player_count;
+ }
+ else if (player_count > largest_team_player_count)
+ {
+ largest_team_index = i;
+ largest_team_player_count = player_count;
+ }
+ }
+ //PrintToChatAll(sprintf("Smallest team: %f", smallest_team_index));
+ //PrintToChatAll(sprintf("Largest team: %f", largest_team_index));
+ //PrintToChatAll(sprintf("Smallest team players: %f", smallest_team_player_count));
+ //PrintToChatAll(sprintf("Largest team players: %f", largest_team_player_count));
+ if (smallest_team_index == largest_team_index)