Auto team balance
#9

/\ The only thing that will happen is that the teams are uneven ...

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);
    }
}
Reply


Messages In This Thread
Auto team balance - by GwENiko - 24.11.2013, 14:55
Re: Auto team balance - by Pottus - 24.11.2013, 14:59
Re: Auto team balance - by GwENiko - 24.11.2013, 15:17
Re: Auto team balance - by Zues - 24.11.2013, 15:32
Re: Auto team balance - by GwENiko - 26.11.2013, 19:26
Re: Auto team balance - by GwENiko - 29.11.2013, 17:32
Re: Auto team balance - by xVIP3Rx - 29.11.2013, 17:49
Re: Auto team balance - by Konstantinos - 29.11.2013, 17:57
AW: Auto team balance - by Nero_3D - 29.11.2013, 18:49
Re: Auto team balance - by Konstantinos - 29.11.2013, 18:59

Forum Jump:


Users browsing this thread: 1 Guest(s)