18.03.2011, 20:05
How do i get the number of players online? eg. new players = GetAllPlayersOnline(); or something... please help me!
stock CountPlayersOnline() {
new
iCount;
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) iCount++;
}
return iCount;
}
new players;
players++;
players--;
stock GetAllPlayersOnline()
{
return players;
}
GetAllPlayersOnline()
Top of your script, below the defines:
pawn Код:
pawn Код:
pawn Код:
pawn Код:
pawn Код:
|
so if i wanted to print the players online in the server thing... i would do printf("players online: %s", players);
|
printf("Players Online: %d", players);