SA-MP Forums Archive
Help... - 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... (/showthread.php?tid=145642)



Help... - Lorenc_ - 03.05.2010

Ok i need some help...

How do i make it show how many people are on one selected map?

Код:
 		ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Teleport Menu", "Circus Mania (People Currently on map: ???) \nRetard (People Currently on map: ???) ", "Select", "Cancel");
Like if 2 people selected the map ' Retard '

It would show "Retard (people currently on map: 2)"

or if im creating a function for it how do i do it?


Re: Help... - Desert - 03.05.2010

Make 2 variables like

new Retardplayers = 0;

Then you plus it by 1 when a player enters the area and minus by 1 when a player leaves.
Then you just makes the choices in the list into a string.


Re: Help... - Lorenc_ - 03.05.2010

I know how your thinking but im still not sure... could u show an example


Re: Help... - Desert - 03.05.2010

pawn Код:
new Retard = 0,Circus = 0; //Global variables

//Put this where you show the dialog. Like a command or something
new string[86];
format(string,sizeof(string),"Circus Mania (People Currently on map: %i) \nRetard (People Currently on map: %i)",Retard,Circus);
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Teleport Menu",string, "Select", "Cancel");
Then put Retard++; or Circus++; under the dialog response and put -- instead of ++ on the leave command or something like that


Re: Help... - Lorenc_ - 03.05.2010

Thanks