23.09.2010, 07:08
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:
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)
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)