Well, no... This is how I'd do it:
Code:
RandomizeTeams() {
decl players[MAXPLAYERS], i
new max_clients = GetMaxClients()
new count, bool:team
for(i = 1; i <= max_clients; i++) {
if(IsClientInGame(i)) {
players[count++] = i
}
}
SortIntegers(players,count,Sort_Random)
for(i = 0; i < count; i++) {
ChangeClientTeam(players[i],team ? TEAM_RED : TEAM_BLUE)
team = !team
}
}
__________________