06.03.2010, 12:45
I have made this function but it does not work. It does not get how many players are alive and connected. It always return 0. I have set sAlive to true at OnPlayerSpawn and have set it to false at OnPlayerDisconnect and OnPlayerDeath. Any reason why it should not work?
Код:
stock GetPlayers() {
new players;
for(new i=0; i<MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && sAlive[i] == true && !IsPlayerNPC(i)) {
players++;
}
}
return players;
}

