SA-MP Forums Archive
About Team balance - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: About Team balance (/showthread.php?tid=132604)



About Team balance - Mr L - 08.03.2010

can some one help me to how i can create team balance i have this one:
Код:
public OnPlayerRequestSpawn(playerid)
{
  if(gTeam[playerid] == TEAM_CT && CTcount > TTcount)
	{
	  SendClientMessage(playerid,COLOR_RED,"[SERVER] Please choose another team so match will be balanced.");
	  return 0;
	}
	else if(gTeam[playerid] == TEAM_TT && TTcount > CTcount)
	{
	  SendClientMessage(playerid,COLOR_RED,"[SERVER] Please choose another team so match will be balanced.");
	  return 0;
	}
	return 1;
}
for OnPlayerDisconnect
Код:
if(gTeam[playerid] == TEAM_CT) CTcount --;
  else if(gTeam[playerid] == TEAM_TT) TTcount --;
can some one help me or give me other team balance, i got problem when someone loginto my server he can choose the team with 5players and the other one have 0.


Re: About Team balance - Mr L - 08.03.2010

and this its on, OnPlayerSpawn
Код:
if(gTeam[playerid] == TEAM_CT)
	{
	  CTcount += 1;
  }
	else if(gTeam[playerid] == TEAM_TT)
	{
	  TTcount += 1;
	}
comon guys help me...