Get Team Count?
#1

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:

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;
}
This doesn't work either

Any thoughts on how I can get the team count with a command?
Reply


Messages In This Thread
Get Team Count? - by (_AcE_) - 03.04.2013, 01:14
Re: Get Team Count? - by LarzI - 03.04.2013, 01:20
Re: Get Team Count? - by (_AcE_) - 03.04.2013, 01:30
Re: Get Team Count? - by JJB562 - 03.04.2013, 01:59
Re: Get Team Count? - by kamzaf - 03.04.2013, 02:09

Forum Jump:


Users browsing this thread: 2 Guest(s)