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
#2

Sorry for bumping, but i really need this before 12:00 pm, and here in my country is already 11:13 pm
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)