From bc5aadc3949071dc26b1c9d695e8cd2448f8940a Mon Sep 17 00:00:00 2001 From: Jim Shield Date: Thu, 18 Jan 2024 15:14:38 +0000 Subject: [PATCH] add export error check to stashRemoveItem --- crafting.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crafting.lua b/crafting.lua index b39dd5e..27bf336 100644 --- a/crafting.lua +++ b/crafting.lua @@ -456,7 +456,7 @@ function stashRemoveItem(stashItems, stashName, items) local amount = amount and if Config.System.Debug then print("^6Bridge^7: ^3saveStash^7: ^2Saving ^3QB^2 stash ^7'^6"..stashName.."^7'") end - else + elseif GetResourceState(QBInv):find("start") then for k, v in pairs(items) do for l in pairs(stashItems) do if stashItems[l].name == k then @@ -478,6 +478,8 @@ function stashRemoveItem(stashItems, stashName, items) local amount = amount and print("^6Bridge^7: ^3saveStash^7: ^2Saving ^3QB^2 stash ^7'^6"..stashName.."^7'") end MySQL.Async.insert('INSERT INTO stashitems (stash, items) VALUES (:stash, :items) ON DUPLICATE KEY UPDATE items = :items', { ['stash'] = stashName, ['items'] = json.encode(stashItems) }) + else + print("^4ERROR^7: ^2No Inventory detected ^7- ^2Check ^3exports^1.^2lua^7") end end RegisterNetEvent(GetCurrentResourceName()..":server:stashRemoveItem", stashRemoveItem)