Dynamic LIST
#1

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.
Reply
#2

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", "");
Reply
#3

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
Reply
#4

BroZeus thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)