Update functions.lua

This commit is contained in:
Thekuca
2023-05-23 11:28:09 +02:00
committed by GitHub
parent adee354a47
commit fab8f3aa74
+17 -5
View File
@@ -357,11 +357,23 @@ function ESX.RefreshJobs()
end
function ESX.RefreshItems()
if Config.OxInventory then return end
local items = MySQL.query.await('SELECT * FROM items')
for k, v in ipairs(items) do
ESX.Items[v.name] = {label = v.label, weight = v.weight, rare = v.rare, canRemove = v.can_remove}
end
if not Config.OxInventory then
ESX.Items = {}
local items = MySQL.query.await('SELECT * FROM items')
for k, v in ipairs(items) do
ESX.Items[v.name] = {label = v.label, weight = v.weight, rare = v.rare, canRemove = v.can_remove}
end
else
TriggerEvent('__cfx_export_ox_inventory_Items', function(ref)
if ref then
ESX.Items = ref()
end
end)
AddEventHandler('ox_inventory:itemList', function(items)
ESX.Items = items
end)
end
end
function ESX.RegisterUsableItem(item, cb)