01.04.2013, 22:06
My pawno crashes when I add this:
an add this at the top:
Anyone know why?
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;
playercount++;
}
return playercount;
}
pawn Код:
new bluecount = GetPlayersCountInTeam(TEAM_HOME); // The team count of the home team.
new redcount = GetPlayersCountInTeam(TEAM_AWAY);