How to balance teams
#6

pawn Code:
new TeamCount[2];

public OnPlayerRequestSpawn(playerid)
{
  if((gTeam[playerid] == TEAM_CT) ? (TeamCount[0] > TeamCount[1]+3) : (TeamCount[0] < TeamCount[1]+3))
  {
    SendClientMessage(playerid, 0x00ff00ff, "Unable to spawn, the teams aren't balanced!");
    return 0;
  }
  TeamCount[(gTeam[playerid] == TEAM_CT) ? (0) : (1)]++;
}
You'll need to work on something to reset this variable again, for example when a player joins a different team or disconnect, set the specific team's count minus one.

Also, this is just a crappy example. I guess it's best to make your own system
Reply


Messages In This Thread
How to balance teams - by Matej_ - 18.09.2010, 12:02
Re: How to balance teams - by Seven. - 18.09.2010, 12:11
Re: How to balance teams - by Hiddos - 18.09.2010, 12:18
Re: How to balance teams - by Matej_ - 18.09.2010, 12:19
Re: How to balance teams - by Matej_ - 18.09.2010, 12:21
Re: How to balance teams - by Hiddos - 18.09.2010, 12:26
Re: How to balance teams - by FireCat - 18.09.2010, 12:29

Forum Jump:


Users browsing this thread: 1 Guest(s)