12.05.2010, 23:24
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 |
ReturnPlayersInTeam(teamid)
{
new t;
for(new a;a<PLAYERS,IsPlayerConnected(a);a++)if(Team[a]==teamid)t++;
return t;
}