03.04.2013, 01:14
How do i get the number of players on each team? I've got two teams TEAM_HOME and TEAM_AWAY but when i try to get the count it never works.
I tried adding ++ to everytime they connect, switch teams, or disconnect and even tried:
This doesn't work either
Any thoughts on how I can get the team count with a command?
I tried adding ++ to everytime they connect, switch teams, or disconnect and even tried:
pawn Код:
stock GetPlayersCountInTeam(teamid)
{
new playercount = 0;
for(new x = 0; x < MAX_PLAYERS; x ++)
{
if(GetPlayerState(x) == PLAYER_STATE_NONE) continue;
if(GetPlayerTeam(x) != teamid) continue;
if(iRound[x] == 1) continue;
playercount++;
}
return playercount;
}
Any thoughts on how I can get the team count with a command?