SA-MP Forums Archive
Number of players in a world ? - 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: Number of players in a world ? (/showthread.php?tid=514868)



Number of players in a world ? - GeekSiMo - 23.05.2014

I have a Worlds server, i want to in the dialog of world near the name of the world the number of players in.
Like :
FreeRoam World Players : 28
TDM World Players : 12
Plzz Help Me and Sorry for my bad english
The server i am talking about : 176.31.103.65:10980


Re: Number of players in a world ? - ball - 23.05.2014

Код:
new __pl;

for(new playerid; playerid != MAX_PLAYERS; playerid++)
{
if(IsPlayerConnected(playerid) && GetPlayerVirtualWorld(playerid) == your_world)
{
__pl++;
}
}
printf ("%d players in world %d", __pl, your_world);



Re: Number of players in a world ? - GeekSiMo - 23.05.2014

No, Not This !!
Enter to the server and see the dialog of worlds i want to add the number of players near each world


Re: Number of players in a world ? - ball - 23.05.2014

Its only clue for your question - if you wanna make a good server you have to learn on your own. I don't give you finished code, because you will come tomorrow and again 'gave me finished code' and by this method you will learn nothing, so please try combine your code - i will help you, but you have to code by yourself.


Re: Number of players in a world ? - GeekSiMo - 23.05.2014

Thanks !!


Re : Number of players in a world ? - mirou123 - 23.05.2014

Consider using "foreach" instead of "for" as well.