Testing fixing stashes

This commit is contained in:
Jim Shield
2024-01-25 17:32:40 +00:00
committed by GitHub
parent 7563b4abdf
commit c18932443a
4 changed files with 12 additions and 8 deletions

View File

@@ -303,12 +303,14 @@ function getStash(stashName) local stashResource = ""
local result = MySQL.scalar.await('SELECT items FROM stashitems WHERE stash = ?', { stashName })
if result then stashItems = json.decode(result) end
end
if Config.System.Debug then print("^6Bridge^7: ^2Retrieving ^3Stash^2 with ^7"..stashResource) end
if stashItems then
for _, item in pairs(stashItems) do
local itemInfo = Items[item.name:lower()]
if itemInfo then
items[#items+1] = {
local indexNum = #items+1
items[(item.slot and item.slot) or #indexNum)] = {
name = itemInfo.name or nil,
amount = tonumber(item.amount) or tonumber(item.count),
info = item.info or "",
@@ -319,8 +321,9 @@ function getStash(stashName) local stashResource = ""
unique = itemInfo.unique or nil,
useable = itemInfo.useable or nil,
image = itemInfo.image or nil,
slot = itemInfo.slot or nil,
slot = (item.slot and item.slot) or indexNum,
}
print("TEST:", item.slot and ("slot info found: "..item.slot) or "reverting to indexnum "..indexNum)
end
end
if Config.System.Debug then print("^6Bridge^7: ^3GetStashItems^7: ^2Stash information for ^7'^6"..stashName.."^7' ^2retrieved^7") end
@@ -334,6 +337,7 @@ function stashRemoveItem(stashItems, stashName, items) local amount = amount and
exports[OXInv]:RemoveItem(stashName, k, v)
if Config.System.Debug then print("^6Bridge^7: ^2Removing item from ^3Stash^2 with ^7"..OXInv, k, v) end
end
elseif GetResourceState(QSInv):find("start") then
for k, v in pairs(items) do
for l in pairs(stashItems) do

View File

@@ -1,6 +1,6 @@
name "Jim_Bridge"
author "Jimathy"
version "1.0.8"
version "1.0.9"
description "Framework Bridge By Jimathy"
fx_version "cerulean"
game "gta5"

View File

@@ -1 +1 @@
1.0.8
1.0.9

View File

@@ -1248,13 +1248,13 @@ function invImg(item)
if item ~= "" and Items[item] then
if GetResourceState(OXInv):find("start") then
imgLink = "nui://"..OXInv.."/web/images/"..(Items[item].image or "")
elseif GetResourceState(QSInv and QSInv or ""):find("start") then
elseif GetResourceState(QSInv):find("start") then
imgLink = "nui://"..QSInv.."/html/images/"..(Items[item].image or "")
elseif GetResourceState(CoreInv and CoreInv or ""):find("start") then
elseif GetResourceState(CoreInv):find("start") then
imgLink = "nui://"..CoreInv.."/html/img/"..(Items[item].image or "")
elseif GetResourceState(OrigenInv and OrigenInv or ""):find("start") then
elseif GetResourceState(OrigenInv):find("start") then
imgLink = "nui://"..OrigenInv.."/html/img/"..(Items[item].image or "")
elseif GetResourceState(QBInv and QBInv or ""):find("start") then
elseif GetResourceState(QBInv):find("start") then
imgLink = "nui://"..QBInv.."/html/images/"..(Items[item].image or "")
else
print("^4ERROR^7: ^2No Inventory detected for invImg ^7- ^2Check ^3exports^1.^2lua^7")