22.10.2009, 19:45
pawn Код:
new Team1;
new Team2;
new PlayerTeam[playerid];
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.
}
On Disconnect:
pawn Код:
if(PlayerTeam[playerid] == 1)
{
Team1 -= 1;
}
else
{
Team2 -= 1;
}
UNTESTED. Should work, I think you get the point