• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Pawn] Getting online players of specific team
#1
Hello, how can I get online players of specific team?
  Reply
#2
Code:
GetOnlinePlayersFromTeam(teamid) {

? ? new count;

? ? foreach(new i : Player) {

? ? ? ? if (GetPlayerTeam(i) == teamid) count;

? ? }

? ? return count;

}



// new count =?GetOnlinePlayersFromTeam(5);
  Reply
#3
Code:
for(new player = 0, pool = GetPlayerPoolSize(); player <= pool; player) // cycle through all players

{

    if(GetPlayerTeam(player) == YOUR_TEAM) // if the player has the right team

    {

        // do whatever you want

    }

}
  Reply


Forum Jump: