Hello,
I have add a item, you can buy him in the store and u see him in inventory. But if I click the right button u not the the option to use the item. I have registrated the item correct in esx_optionalneeds but still no useable item.
This is the code:
ESX = nil
TriggerEvent('esx:getSharedObject', function(obj)
ESX = obj
end)
ESX.RegisterUsableItem('beer', function(source)
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem('beer', 1)
TriggerClientEvent('esx_status:add', source, 'drunk', 250000)
TriggerClientEvent('esx_optionalneeds:onDrink', source)
TriggerClientEvent('esx:showNotification', source, _U('used_beer'))
end)
Why the item not working?