24.04.2016, 02:19
pawn Code:
case DIALOG_INVENTORY:
{
if(response)
{
new count;
for(new item; item < MAX_ITEMS; item++)
{
if(!InventoryInfo[playerid][item][inventoryExist]) continue;
if (count == listitem)
{
CallLocalFunction("OnPlayerUseItem", "ds", playerid, InventoryInfo[playerid][item][inventoryName]);
break;
}
count++;
}
}
else
{
DeletePVar(playerid, "item_name");
}
}
I don't expect you to understand this at once !
EDIT: count++; should be in the bottom instead of top.