[HELP]Team balancer
#2

Use an array or two variables to store the players in each induvidual(sp?) team, then prevent the player to join the certain team, if it's player count is too much.

Example:

pawn Код:
new pCount[ 2 ];
pawn Код:
//when player joins team
if( pCount[ 0 ] - pCount[ 1 ] > 2 || pCount[ 1 ] - pCount[ 0 ] > 2 )
{
    SendClientMessage( playerid, 0xFF0000FF, "To balance the teams, you are forced to join the other team." );
    //join the other team
}
//join the team he wanted to join (else)
EDIT: And if you want an automatic updater, make a timer to check the team counts, then balance them by moving a player over (or two)
Reply


Messages In This Thread
[HELP]Team balancer - by Matej_ - 23.09.2010, 05:27
Re: [HELP]Team balancer - by LarzI - 23.09.2010, 07:08

Forum Jump:


Users browsing this thread: 1 Guest(s)