24.06.2013, 22:48
pawn Код:
#define TEAM_ARMY 0
#define TEAM_TERRO 1
pawn Код:
stock GetPlayersInTeamFromMaxPlayers(teamid)//Stock developed by Weponz (Weponz Inc. © 2010 - 2011)
{
new playercount = 0;//Set our count to 0 as we have not counted any players yet..
for(new i = 0; i < MAX_PLAYERS; i++)//Loop through MAX_PLAYERS(I suggest you redefine MAX_PLAYERS to ensure max efficency)..
{
if(GetPlayerState(i) == PLAYER_STATE_NONE) continue;//If a player is in class selection continue..
if(gTeam[i] != teamid) continue;//If a player is NOT in the specified teamid continue..
playercount++;//else (there in the teamid) so count the player in the team..
}
return playercount;//Return the total players counted in the specified team..
}