SA-MP Forums Archive
Dynamic LIST - 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: Dynamic LIST (/showthread.php?tid=523065)



Dynamic LIST - speed258 - 30.06.2014

Hello everyone, i have question about dialogs. Is possible to make DIALOG_STYLE_LIST rows in OnDialogResponse dynamic? I explain more: example i got 2 cars so loop genarate for me rows like Sultan\nElegy after i click on sultan dialog pop up with this car info, then i click on elegy and come same as sultan, but problem is if i got 1000 cars and i want to check info which id is in list 995, so theoretically it should somehow generate that id and dialog pop up with that car info, so any ideas how to avoid 1000 dialog creation for each listitem or is no other way to do that? Thanks.


Re: Dynamic LIST - LivingLikeYouDo - 30.06.2014

Use strings?
for example;

pawn Код:
new string[128];
format(string, sizeof(string), "Here you can insert the checked strings from player file!");
ShowPlayerDialog(playerid, DIALOG_CARLIST, DIALOG_STYLE_LIST, "Your cars", string, "Ok", "");



Re: Dynamic LIST - BroZeus - 30.06.2014

well a way of doing it is like this
pawn Код:
new CarID[MAX_VEHICLES];//on top

CarID[i]=vehicleid;//now while creating dialog string you would probably go through a loop caz u cant create a string with 1000 cars like that , i this i is variable with help of which u loop

//now on dialog box use the variable "CarID[listitem]" to generate another dialog for it



Re: Dynamic LIST - speed258 - 30.06.2014

BroZeus thanks!