team balancer
#6

pawn Код:
new Team1;
new Team2;
new PlayerTeam[playerid];
When a player tries to join team 1:
pawn Код:
if(Team1 < Team 2) //Checks if Team 1 has less players than team 2
{
Team1 += 1; //adds a player to the team
PlayerTeam[playerid] = 1;
return 1; //spawns the player
}
else
{
SendClientMessage(playerid,COLOR,"...");//Message telling the player the team wouldnt be balanced if they joined it.
return 0; // Makes it so the player dosen't spawn.
}
Do the same for team 2.

On Disconnect:
pawn Код:
if(PlayerTeam[playerid] == 1)
{
Team1 -= 1;
}
else
{
Team2 -= 1;
}

UNTESTED. Should work, I think you get the point
Reply


Messages In This Thread
team balancer - by thuron - 22.10.2009, 18:44
Re: team balancer - by Peter_Corneile - 22.10.2009, 19:28
Re: team balancer - by thuron - 22.10.2009, 19:42
Re: team balancer - by Tigerbeast11 - 22.10.2009, 19:43
Re: team balancer - by Peter_Corneile - 22.10.2009, 19:45
Re: team balancer - by miokie - 22.10.2009, 19:45
Re: team balancer - by thuron - 22.10.2009, 19:47
Re: team balancer - by Tigerbeast11 - 22.10.2009, 19:49
Re: team balancer - by thuron - 23.10.2009, 15:53
Re: team balancer - by Nero_3D - 23.10.2009, 16:32

Forum Jump:


Users browsing this thread: 1 Guest(s)