Dynamic dialog problem
#1

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

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

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

Not possible.
Reply
#5

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?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)