mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-19 14:56:02 +01:00
Fix weapons caching for ox_inv
I completely overlooked the fact that when ox_inv shows weapon info, it does it with the upper case version `WEAPON_PISTOL` while my scripts were looking for `weapon_pistol` making my scripts think they didn't exist This fixes that
This commit is contained in:
@@ -75,27 +75,14 @@ if checkExists(Exports.OXInv) then
|
|||||||
while GetResourceState(Exports.OXInv) ~= "started" do Wait(100) end
|
while GetResourceState(Exports.OXInv) ~= "started" do Wait(100) end
|
||||||
itemResource = Exports.OXInv
|
itemResource = Exports.OXInv
|
||||||
Items = exports[Exports.OXInv]:Items()
|
Items = exports[Exports.OXInv]:Items()
|
||||||
-- IF QBX-Core is running, merge items from there
|
|
||||||
if checkExists(Exports.QBExport)then
|
-- Get Weapon info and duplicate them if they are uppercase
|
||||||
local tempWeapons = exports[Exports.QBExport]:GetCoreObject().Shared.Weapons
|
-- (duplicate incase anything checks for the uppercase version)
|
||||||
for k, v in pairs(tempWeapons) do
|
|
||||||
local info = exports[Exports.OXInv]:Items(v.name)
|
|
||||||
local weight = info and info.weight or 0
|
|
||||||
if not Items[v.name] then
|
|
||||||
Items[v.name] = {
|
|
||||||
name = v.name,
|
|
||||||
label = v.label,
|
|
||||||
type = "weapon",
|
|
||||||
ammotype = v.ammotype or "AMMO_PISTOL",
|
|
||||||
weight = weight,
|
|
||||||
image = v.image or (v.name..".png"),
|
|
||||||
description = v.label or "",
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
-- tidy info into something jim_bridge can use
|
|
||||||
for k, v in pairs(Items) do
|
for k, v in pairs(Items) do
|
||||||
|
if k:find("WEAPON") then
|
||||||
|
Items[k:lower()] = Items[k]
|
||||||
|
Items[k:lower()].image = k..".png"
|
||||||
|
end
|
||||||
Items[k].image = (v.client and v.client.image) and v.client.image:gsub("nui://"..Exports.OXInv.."/web/images/", "") or k..".png"
|
Items[k].image = (v.client and v.client.image) and v.client.image:gsub("nui://"..Exports.OXInv.."/web/images/", "") or k..".png"
|
||||||
Items[k].hunger = v.client and v.client.hunger
|
Items[k].hunger = v.client and v.client.hunger
|
||||||
Items[k].thirst = v.client and v.client.thirst
|
Items[k].thirst = v.client and v.client.thirst
|
||||||
@@ -225,7 +212,6 @@ elseif checkExists(Exports.ESXExport) then
|
|||||||
end
|
end
|
||||||
|
|
||||||
if highestGrade then
|
if highestGrade then
|
||||||
print("found boss for", Role)
|
|
||||||
Jobs[Role].grades[tostring(highestGrade)].isBoss = true
|
Jobs[Role].grades[tostring(highestGrade)].isBoss = true
|
||||||
end
|
end
|
||||||
::continue::
|
::continue::
|
||||||
|
|||||||
Reference in New Issue
Block a user