29.11.2013, 18:49
/\ The only thing that will happen is that the teams are uneven ...
That should be what [uL]Pottus said, just compromised
That should be what [uL]Pottus said, just compromised
pawn Код:
new
rand,
count,
i = -1,
tmp[MAX_PLAYERS]
;
// 1)
while(++i != MAX_PLAYERS) {
if(IsPlayerConnected(i)) {
tmp[count++] = i;
}
}
// 2) 3) 4)
for(i = count / 2; count; ) {
if(i < count) {
rand = random(count--);
SetPlayerTeam(tmp[rand], 1);
tmp[rand] = tmp[count];
} else {
SetPlayerTeam(tmp[--count], 2);
}
}