Fixed Translation For RefreshJob Command

Added /refreshitems To Update The ESX.Items Table
This commit is contained in:
Cyzxin
2023-05-22 09:47:07 +01:00
parent fca0756c65
commit 6be5fd5478
3 changed files with 15 additions and 1 deletions
+2
View File
@@ -108,6 +108,8 @@ Locales['en'] = {
['command_giveammo_noweapon_found'] = '%s does not have that weapon',
['command_giveammo_weapon'] = 'Weapon name',
['command_giveammo_ammo'] = 'Ammo Quantity',
['command_refreshjobs'] = 'Refresh The ESX Jobs Table',
['command_refreshitems'] = 'Refresh The ESX Items Table',
['tpm_nowaypoint'] = 'No Waypoint Set.',
['tpm_success'] = 'Successfully Teleported',
+5 -1
View File
@@ -184,7 +184,11 @@ end, true, {help = TranslateCap('command_clearall')})
ESX.RegisterCommand("refreshjobs", 'admin', function(xPlayer, args, showError)
ESX.RefreshJobs()
end, true, {help = TranslateCap('command_clearall')})
end, true, {help = TranslateCap('command_refreshjobs')})
ESX.RegisterCommand("refreshitems", 'admin', function(xPlayer, args, showError)
ESX.RefreshItems()
end, true, {help = TranslateCap('command_refreshitems')})
if not Config.OxInventory then
ESX.RegisterCommand('clearinventory', 'admin', function(xPlayer, args, showError)
+8
View File
@@ -348,6 +348,14 @@ function ESX.RefreshJobs()
end
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
end
function ESX.RegisterUsableItem(item, cb)
Core.UsableItemsCallbacks[item] = cb
end