11.10.2017, 07:31
Hey,
This is my code to get items from an actor which will be displayed in a dialog later.
The slot in which there is no item, I used the string "Empty" for that so that the listitem would be the itemid of cActor which I've to use to remove the item in OnDialogRepsonse. So what I wanted to ask is, it looks ugly with everywhere "Empty" in the dialog. Is there any way to just display only the items with correct IDS?
For example, if I display only the items in dialog and leave the slots which are empty, I won't be able to get the slot id in listitem on OnDialogResponse then.
If you don't know what I'm trying to say is this, I currently use listitem to get the ID of the selected item.
And if I remove the "Empty" string
PHP код:
for(new c = 0; c < MAX_INVENTORY_SLOTS; c++)
{
if(cActor[i][items][c] == -1) format(string,sizeof(string),"%s\n{FFAF00}Empty",string);
else format(string,sizeof(string),"%s\n{FFAF00}%s: %d",string,Itens[cActor[i][items][c]][item_nome],cActor[i][ia][c]);
}
The slot in which there is no item, I used the string "Empty" for that so that the listitem would be the itemid of cActor which I've to use to remove the item in OnDialogRepsonse. So what I wanted to ask is, it looks ugly with everywhere "Empty" in the dialog. Is there any way to just display only the items with correct IDS?
For example, if I display only the items in dialog and leave the slots which are empty, I won't be able to get the slot id in listitem on OnDialogResponse then.
If you don't know what I'm trying to say is this, I currently use listitem to get the ID of the selected item.
PHP код:
cActor[i][item][listitem]--;
PHP код:
cActor[i][ia][listitem]--; // the "listitem" won't give the correct slot ID so any other way.