mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
revert "a969785d3697a384132202a07d4b357afb668048"
This commit is contained in:
@@ -281,11 +281,7 @@ end, true, {help = TranslateCap('command_clearall')})
|
||||
|
||||
ESX.RegisterCommand("refreshjobs", 'admin', function(xPlayer, _, _)
|
||||
ESX.RefreshJobs()
|
||||
end, true, {help = TranslateCap('command_refreshjobs')})
|
||||
|
||||
ESX.RegisterCommand("refreshitems", 'admin', function(xPlayer, args, showError)
|
||||
ESX.RefreshItems()
|
||||
end, true, {help = TranslateCap('command_refreshitems')})
|
||||
end, true, {help = TranslateCap('command_clearall')})
|
||||
|
||||
if not Config.OxInventory then
|
||||
ESX.RegisterCommand('clearinventory', 'admin', function(xPlayer, args, _)
|
||||
|
||||
@@ -40,11 +40,25 @@ end
|
||||
|
||||
MySQL.ready(function()
|
||||
Core.DatabaseConnected = true
|
||||
if not Config.OxInventory then
|
||||
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)
|
||||
|
||||
ESX.RefreshItems()
|
||||
AddEventHandler('ox_inventory:itemList', function(items)
|
||||
ESX.Items = items
|
||||
end)
|
||||
|
||||
while not next(ESX.Items) do
|
||||
Wait(0)
|
||||
while not next(ESX.Items) do
|
||||
Wait(0)
|
||||
end
|
||||
end
|
||||
|
||||
ESX.RefreshJobs()
|
||||
|
||||
@@ -356,26 +356,6 @@ function ESX.RefreshJobs()
|
||||
end
|
||||
end
|
||||
|
||||
function ESX.RefreshItems()
|
||||
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)
|
||||
Core.UsableItemsCallbacks[item] = cb
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user