Checking how many players are alive and connected
#1

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;
}
Reply


Messages In This Thread
Checking how many players are alive and connected - by Hot - 06.03.2010, 12:45
Re: Checking how many players are alive and connected - by Hot - 06.03.2010, 13:15

Forum Jump:


Users browsing this thread: 2 Guest(s)