Dynamic dialog problem - 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 dialog problem (
/showthread.php?tid=378587)
Dynamic dialog problem -
Devix - 18.09.2012
Hey guys!
I got the following:
Код:
while( listInventoryItems( playerid, itemName, itemDesc, itemAmm, idx ) )
{
format( ilist, sizeof ilist, "{FFFFFF}%s \t %s (Amount: %i)\n", itemName, itemDesc, itemAmm );
ShowPlayerDialog(playerid, 789, DIALOG_STYLE_LIST, "Inventory", ilist, "Close", "Close");
idx ++;
}
It works with one object in the inventory, but when I add another object into my inventory I only see the last one.
Why? It's a correct loop right?
Re: Dynamic dialog problem -
blank. - 18.09.2012
At a glance I would say you need to append ilist at the end of ilist, like so:
pawn Код:
format( ilist, sizeof ilist, "{FFFFFF}%s \t %s (Amount: %i)\n%s", itemName, itemDesc, itemAmm,ilist );
EDIT:
ShowPlayerDialog shouldn't be in a loop.
Re: Dynamic dialog problem -
Devix - 18.09.2012
EDIT: found the problem.
New problem: how can I make it that people can actually select the object?
Like:
Код:
if(listitem == "Cola")
{
SendClientMessage(playerid, COLOR_GREEN, "Drunk");
return 1;
}
where listitem = the name of the selected.
Re: Dynamic dialog problem -
blank. - 18.09.2012
Not possible.
Re: Dynamic dialog problem -
Devix - 19.09.2012
Is there a way to somehow to this? Like differently?
Also, howcome I sometimes get 2 of the same objects in the dialog while only having 1 object spawned?