View Single Post
p3tsin
Senior Member
Join Date: Sep 2005
Location: Finland
Old 09-26-2008 , 08:42   Re: Need Psuedo Code for Team Scramble
Reply With Quote #5

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     } }
__________________
plop
p3tsin is offline