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



Help with dialogs - Swiftz - 18.01.2011

I made a dm arena where if you do /dm you will get a dialog giving diffrent types of arenas like spas12, deagle arenas e.t.c, And when you click one of those it will set you to a interior and vitrual world and gives you certain guns. How can make the number of players display besside certain arena in the dialog menu

Example:-
'dialog'
Spas12 arena Players:20 ( i need this number to display
Deagle arena Players:6
.... arena

oK cancel

please help thanks


Re: Help with dialogs - iggy1 - 18.01.2011

Heres an example
pawn Код:
new
    d_str[64];
format(d_str, sizeof(d_str), "Spas12 arena Players: %d \nDeagle arena Players: %d", PLAYERS_IN_SPAZDM, PLAYERS_IN_DEAGLE_DM); //swap these for the amount of players in the respective arenas
ShowPlayerDialog(playerid, DUEL_DIALOG, DIALOG_STYLE_LIST, "Choose an arena", d_str, "Ok","Cancel");



Re: Help with dialogs - Alex_Valde - 18.01.2011

Make a global variable ( new PlayersOnlineInSpas12Arena; )
and when player enters some arena just add it to existing number ( PlayersOnlineInSpas12Arena++; ).

When players exit it just reduce the number ( PlayersOnlineInSpas12Arena--; ).

Then Format it and then show it in the way you like