Closed bdxndev closed 3 years ago
Nevermind, the problem occured because they are not usable if you go to es_extended/server/main.lua and find 'esx:useItem' change:
RegisterNetEvent('esx:useItem') AddEventHandler('esx:useItem', function(itemName) local xPlayer = ESX.GetPlayerFromId(source) local count = xPlayer.getInventoryItem(itemName).count
if count > 0 then
ESX.UseItem(source, itemName)
else
xPlayer.showNotification(_U('act_imp'))
end
end)
to
RegisterNetEvent('esx:useItem') AddEventHandler('esx:useItem', function(itemName) local xPlayer = ESX.GetPlayerFromId(source) local count = xPlayer.getInventoryItem(itemName).count local canUse = xPlayer.getInventoryItem(itemName).usable
if count > 0 and canUse then
ESX.UseItem(source, itemName)
else
xPlayer.showNotification(_U('act_imp'))
end
end)
You get this error when using some items from your hotbar. Not all items.