SA-MP Forums Archive
Counting player online? - 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)
+--- Thread: Counting player online? (/showthread.php?tid=560373)



Counting player online? - Razturach - 28.01.2015

Hello!

I'm wondering how it's possible to do code that will count players online, yeah I know that samp program is couting them already in samp browser but I just have little idea how I will use that code. If I'm right I should somehow open Loop OnPlayerConnect and variable that will count players that Connect and Disconnect but I'm not sure how to do that so I'm asking for help.

Thank you for answers, tips in advance.


Re: Counting player online? - DobbysGamertag - 28.01.2015

Iter_Count(Player);. No need for a loop.

pawn Code:
new string[128];
format(string,sizeof(string),"There are %d connected players.",Iter_Count(Player));
SendClientMessage(playerid, -1, string);



Re: Counting player online? - Razturach - 28.01.2015

Ty, repped