Merge pull request #2 from jimathy/fixes

Fixes
This commit is contained in:
Jim Shield
2024-01-18 00:54:51 +00:00
committed by GitHub

View File

@@ -1083,12 +1083,21 @@ function getPlayer(source) local Player = {}
bank = info.Functions.GetMoney("bank"), bank = info.Functions.GetMoney("bank"),
} }
elseif GetResourceState(QBExport):find("start") and not GetResourceState(QBXExport):find("start") then elseif GetResourceState(QBExport):find("start") and not GetResourceState(QBXExport):find("start") then
local info = exports[QBExport]:GetPlayer(src) if Core.Functions.GetPlayer ~= nil then -- support older qb-core functions
Player = { local info = Core.Functions.GetPlayer(src).PlayerData
name = info.PlayerData.charinfo.firstname.." "..info.PlayerData.charinfo.lastname, Player = {
cash = info.PlayerData.money["cash"], name = info.charinfo.firstname.." "..info.charinfo.lastname,
bank = info.PlayerData.money["bank"], cash = info.money["cash"],
} bank = info.money["bank"],
}
else
local info = exports[QBExport]:GetPlayer(src).PlayerData
Player = {
name = info.charinfo.firstname.." "..info.charinfo.lastname,
cash = info.money["cash"],
bank = info.money["bank"],
}
end
end end
else else
if GetResourceState(ESXExport):find("start") and ESX ~= nil then if GetResourceState(ESXExport):find("start") and ESX ~= nil then
@@ -1144,13 +1153,13 @@ function invImg(item)
local imgLink = "" local imgLink = ""
if item ~= "" and Items[item] then if item ~= "" and Items[item] then
if GetResourceState(OXInv):find("start") then if GetResourceState(OXInv):find("start") then
imgLink = "nui://"..OXInv.."/web/images/"..Items[item].image imgLink = "nui://"..OXInv.."/web/images/"..(Items[item].image or "")
elseif GetResourceState(QSInv and QSInv or ""):find("start") then elseif GetResourceState(QSInv and QSInv or ""):find("start") then
imgLink = "nui://"..QSInv.."/html/images/"..Items[item].image imgLink = "nui://"..QSInv.."/html/images/"..(Items[item].image or "")
elseif GetResourceState(CoreInv and CoreInv or ""):find("start") then elseif GetResourceState(CoreInv and CoreInv or ""):find("start") then
imgLink = "nui://"..CoreInv.."/html/img/"..Items[item].image imgLink = "nui://"..CoreInv.."/html/img/"..(Items[item].image or "")
elseif GetResourceState(QBInv and QBInv or ""):find("start") then elseif GetResourceState(QBInv and QBInv or ""):find("start") then
imgLink = "nui://"..QBInv.."/html/images/"..Items[item].image imgLink = "nui://"..QBInv.."/html/images/"..(Items[item].image or "")
end end
end end
return imgLink return imgLink
@@ -1165,4 +1174,4 @@ function registerStash(name, label)
exports[QSInv]:RegisterStash(name, 50, 4000000) exports[QSInv]:RegisterStash(name, 50, 4000000)
end end
end end
-- IN NO WAY PERFECT -- -- IN NO WAY PERFECT --