TeamBalancer Help
#2

Quote:
Originally Posted by [ĦŁ₣
ЉǾǖŦĦЗŁΛẄ ]
Use this simple function to get amount of team variables assigned to players:

ReturnPlayersInTeam(teamid)
{
new t;
for(new a;a<PLAYERS,IsPlayerConnected(a);a++)if(Team[a]==teamid)t++;
return t;
}

It loops connected players then checks the team array against each player and every time a playerid is assigned to a part of the team array it adds 1 to the variable 't' then at the end of the funciton it returns the value of 't', this being the amount of players in the team input.

Then simply use this in a if statement:
if(ReturnPlayersInTeam(0)>ReturnPlayersInTeam(1)) etc...


Hope that helps
so use this for every team ? :


ReturnPlayersInTeam(teamid)
{
new t;
for(new a;a<PLAYERS,IsPlayerConnected(a);a++)if(Team[a]==teamid)t++;
return t;
}

Reply


Messages In This Thread
TeamBalancer Help - by Saurik - 12.05.2010, 22:57
Re: TeamBalancer Help - by Saurik - 12.05.2010, 23:24

Forum Jump:


Users browsing this thread: 4 Guest(s)