mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-19 14:56:02 +01:00
Testing fixing stashes
This commit is contained in:
@@ -303,12 +303,14 @@ function getStash(stashName) local stashResource = ""
|
|||||||
local result = MySQL.scalar.await('SELECT items FROM stashitems WHERE stash = ?', { stashName })
|
local result = MySQL.scalar.await('SELECT items FROM stashitems WHERE stash = ?', { stashName })
|
||||||
if result then stashItems = json.decode(result) end
|
if result then stashItems = json.decode(result) end
|
||||||
end
|
end
|
||||||
|
|
||||||
if Config.System.Debug then print("^6Bridge^7: ^2Retrieving ^3Stash^2 with ^7"..stashResource) end
|
if Config.System.Debug then print("^6Bridge^7: ^2Retrieving ^3Stash^2 with ^7"..stashResource) end
|
||||||
if stashItems then
|
if stashItems then
|
||||||
for _, item in pairs(stashItems) do
|
for _, item in pairs(stashItems) do
|
||||||
local itemInfo = Items[item.name:lower()]
|
local itemInfo = Items[item.name:lower()]
|
||||||
if itemInfo then
|
if itemInfo then
|
||||||
items[#items+1] = {
|
local indexNum = #items+1
|
||||||
|
items[(item.slot and item.slot) or #indexNum)] = {
|
||||||
name = itemInfo.name or nil,
|
name = itemInfo.name or nil,
|
||||||
amount = tonumber(item.amount) or tonumber(item.count),
|
amount = tonumber(item.amount) or tonumber(item.count),
|
||||||
info = item.info or "",
|
info = item.info or "",
|
||||||
@@ -319,8 +321,9 @@ function getStash(stashName) local stashResource = ""
|
|||||||
unique = itemInfo.unique or nil,
|
unique = itemInfo.unique or nil,
|
||||||
useable = itemInfo.useable or nil,
|
useable = itemInfo.useable or nil,
|
||||||
image = itemInfo.image 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
|
||||||
end
|
end
|
||||||
if Config.System.Debug then print("^6Bridge^7: ^3GetStashItems^7: ^2Stash information for ^7'^6"..stashName.."^7' ^2retrieved^7") 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)
|
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
|
if Config.System.Debug then print("^6Bridge^7: ^2Removing item from ^3Stash^2 with ^7"..OXInv, k, v) end
|
||||||
end
|
end
|
||||||
|
|
||||||
elseif GetResourceState(QSInv):find("start") then
|
elseif GetResourceState(QSInv):find("start") then
|
||||||
for k, v in pairs(items) do
|
for k, v in pairs(items) do
|
||||||
for l in pairs(stashItems) do
|
for l in pairs(stashItems) do
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name "Jim_Bridge"
|
name "Jim_Bridge"
|
||||||
author "Jimathy"
|
author "Jimathy"
|
||||||
version "1.0.8"
|
version "1.0.9"
|
||||||
description "Framework Bridge By Jimathy"
|
description "Framework Bridge By Jimathy"
|
||||||
fx_version "cerulean"
|
fx_version "cerulean"
|
||||||
game "gta5"
|
game "gta5"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
1.0.8
|
1.0.9
|
||||||
|
|||||||
@@ -1248,13 +1248,13 @@ function invImg(item)
|
|||||||
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 or "")
|
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 "")
|
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 "")
|
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 "")
|
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 "")
|
imgLink = "nui://"..QBInv.."/html/images/"..(Items[item].image or "")
|
||||||
else
|
else
|
||||||
print("^4ERROR^7: ^2No Inventory detected for invImg ^7- ^2Check ^3exports^1.^2lua^7")
|
print("^4ERROR^7: ^2No Inventory detected for invImg ^7- ^2Check ^3exports^1.^2lua^7")
|
||||||
|
|||||||
Reference in New Issue
Block a user