13.07.2016, 21:08
I did a simple UseItem function
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == INVENTORY_DIALOG) { new item_name[50], get_id = -1; if (response) { get_id = ArrayList::Get(InventoryList[playerid], PlayerInventory[playerid][i_item_type][listitem] - 1); if(get_id + 1 == 1) return GivePlayerWeapon(playerid, 24, 100), SendClientMessage(playerid, -1, "You succesfully takes your weapon!"),PlayerInventory[playerid][i_item_amount][listitem] -= 1; if(get_id + 1 == 2) return SetPlayerHealth(playerid, 100.0), SendClientMessage(playerid, -1, "You succesfully sets your health full!"),PlayerInventory[playerid][i_item_amount][listitem] -= 1; if(get_id + 1 == 3) return ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.1, 0, 1, 1, 0, 0, 1), SendClientMessage(playerid, -1, "You succesfully eats your burger!"),PlayerInventory[playerid][i_item_amount][listitem] -= 1; get_id = -1; } } return 1; }