[HELP] How to get players' count? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP] How to get players' count? (
/showthread.php?tid=175551)
[HELP] How to get players' count? -
RoCK'N'Rolla - 10.09.2010
hi,
i want to get the count of all players in the server. I mean, if there are 52 players online, it will take "52" as count. How can i provide it?
Re: [HELP] How to get players' count? -
Thebest96 - 10.09.2010
Quote:
Originally Posted by whitetigerswt
Код:
GetPlayersOnServer() {
new count;
for(new x=0; x< MAX_PLAYERS; x++) { //x = MAX_PLAYERS
if(IsPlayerConnected(x))) {
count++;
}
}
return count;
}
Then call that function whenever you need to know how many players are on the server.
|
here.....