[HELP]Team balancer
#1

How can I make a team balancer ?

Note: I have 2 teams in my script.
Reply
#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


Forum Jump:


Users browsing this thread: 1 Guest(s)