SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/05/2014, 05:57 PM   #1
GeekSiMo
Huge Clucker
 
GeekSiMo's Avatar
 
Join Date: Apr 2014
Location: Morocco, Fes
Posts: 467
Reputation: 37
Thumbs up Number of players in a world ?

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
__________________
.:: | Xtremies Server | ::.
IP : 94.76.214.51:8237


_________________________________________________

My Works:
[Filterscript] Rainbow Name
[Filterscript] Basic Teleport Menu
GeekSiMo is offline   Reply With Quote
Old 23/05/2014, 06:02 PM   #2
ball
Huge Clucker
 
ball's Avatar
 
Join Date: Jul 2012
Location: Poznan, Poland
Posts: 267
Reputation: 28
Default Re: Number of players in a world ?

Code:
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);
ball is offline   Reply With Quote
Old 23/05/2014, 06:08 PM   #3
GeekSiMo
Huge Clucker
 
GeekSiMo's Avatar
 
Join Date: Apr 2014
Location: Morocco, Fes
Posts: 467
Reputation: 37
Default Re: Number of players in a world ?

No, Not This !!
Enter to the server and see the dialog of worlds i want to add the number of players near each world
__________________
.:: | Xtremies Server | ::.
IP : 94.76.214.51:8237


_________________________________________________

My Works:
[Filterscript] Rainbow Name
[Filterscript] Basic Teleport Menu
GeekSiMo is offline   Reply With Quote
Old 23/05/2014, 06:21 PM   #4
ball
Huge Clucker
 
ball's Avatar
 
Join Date: Jul 2012
Location: Poznan, Poland
Posts: 267
Reputation: 28
Default Re: Number of players in a world ?

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.
ball is offline   Reply With Quote
Old 23/05/2014, 06:51 PM   #5
GeekSiMo
Huge Clucker
 
GeekSiMo's Avatar
 
Join Date: Apr 2014
Location: Morocco, Fes
Posts: 467
Reputation: 37
Default Re: Number of players in a world ?

Thanks !!
__________________
.:: | Xtremies Server | ::.
IP : 94.76.214.51:8237


_________________________________________________

My Works:
[Filterscript] Rainbow Name
[Filterscript] Basic Teleport Menu
GeekSiMo is offline   Reply With Quote
Old 23/05/2014, 06:53 PM   #6
mirou123
Huge Clucker
 
Join Date: Jul 2013
Posts: 354
Reputation: 22
Default Re : Number of players in a world ?

Consider using "foreach" instead of "for" as well.
mirou123 is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Let admins read players' PM's selectively without players number limitation WellDone Scripting Help 6 15/05/2013 09:34 AM
How to set a max number of properties per players ? Kethrios Scripting Help 4 22/11/2012 04:34 PM
[HELP] Players press key number 0 .Skool_. Scripting Help 1 19/04/2012 12:00 AM
[FilterScript] [FS] Number of Players Online + Last logged in & OUT! adsy Filterscripts 38 13/08/2011 12:25 PM
[SOLVED]setting the number of players per team WSD Help Archive 2 17/02/2010 11:54 PM


All times are GMT. The time now is 06:25 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.