From e0c6d2f8c7f70ab00e6dc573b54bbb70992b7dd7 Mon Sep 17 00:00:00 2001 From: MrNewb <47620135+MrNewb@users.noreply.github.com> Date: Fri, 13 Mar 2026 12:35:30 -0400 Subject: [PATCH] fix for jg-mechanic is missing Replace earlier GetResourceState checks in multiple inventory modules so they only return early when the 'jg-mechanic' resource state is 'missing'. This standardizes behavior across modules (jpr, origen, ox, ps, qb, qs, tgiann) and fixes an inverted check in ox_inventory so the exports['jg-mechanic']:vehiclePlateUpdated call runs unless the resource is actually missing. --- modules/inventory/core_inventory/server.lua | 2 +- modules/inventory/jpr-inventory/server.lua | 2 +- modules/inventory/origen_inventory/server.lua | 2 +- modules/inventory/ox_inventory/server.lua | 2 +- modules/inventory/ps-inventory/server.lua | 2 +- modules/inventory/qb-inventory/server.lua | 4 ++-- modules/inventory/qs-inventory/server.lua | 2 +- modules/inventory/tgiann-inventory/server.lua | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/modules/inventory/core_inventory/server.lua b/modules/inventory/core_inventory/server.lua index c6407e6..64e473f 100644 --- a/modules/inventory/core_inventory/server.lua +++ b/modules/inventory/core_inventory/server.lua @@ -235,7 +235,7 @@ Inventory.UpdatePlate = function(oldplate, newplate) trunk_oldplate = 'trunk-' .. oldplate } MySQL.transaction.await(queries, values) - if GetResourceState('jg-mechanic') ~= 'started' then return true end + if GetResourceState('jg-mechanic') == 'missing' then return true end return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) end diff --git a/modules/inventory/jpr-inventory/server.lua b/modules/inventory/jpr-inventory/server.lua index d8ce57d..bdd78f8 100644 --- a/modules/inventory/jpr-inventory/server.lua +++ b/modules/inventory/jpr-inventory/server.lua @@ -102,7 +102,7 @@ Inventory.UpdatePlate = function(oldplate, newplate) } local values = { newplate = newplate, oldplate = oldplate } MySQL.transaction.await(queries, values) - if GetResourceState('jg-mechanic') ~= 'started' then return true end + if GetResourceState('jg-mechanic') == 'missing' then return true end return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) end diff --git a/modules/inventory/origen_inventory/server.lua b/modules/inventory/origen_inventory/server.lua index 9a634cf..4e06f2f 100644 --- a/modules/inventory/origen_inventory/server.lua +++ b/modules/inventory/origen_inventory/server.lua @@ -229,7 +229,7 @@ Inventory.UpdatePlate = function(oldplate, newplate) } local values = { newplate = newplate, oldplate = oldplate } MySQL.transaction.await(queries, values) - if GetResourceState('jg-mechanic') ~= 'started' then return true end + if GetResourceState('jg-mechanic') == 'missing' then return true end return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) end diff --git a/modules/inventory/ox_inventory/server.lua b/modules/inventory/ox_inventory/server.lua index 7e022ac..dda2f60 100644 --- a/modules/inventory/ox_inventory/server.lua +++ b/modules/inventory/ox_inventory/server.lua @@ -179,7 +179,7 @@ end Inventory.UpdatePlate = function(oldplate, newplate) ox_inventory:UpdateVehicle(oldplate, newplate) -- ox standard doesnt return anything so probably shouldnt return so everything else has the same standard. Yeaaaa probably should change this. - if GetResourceState('jg-mechanic') ~= 'missing' then return true end + if GetResourceState('jg-mechanic') == 'missing' then return true end return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) end diff --git a/modules/inventory/ps-inventory/server.lua b/modules/inventory/ps-inventory/server.lua index 335bc97..9bf1390 100644 --- a/modules/inventory/ps-inventory/server.lua +++ b/modules/inventory/ps-inventory/server.lua @@ -122,7 +122,7 @@ Inventory.UpdatePlate = function(oldplate, newplate) local values = { newplate = newplate, oldplate = oldplate } MySQL.transaction.await(queries, values) -- ox standard doesnt return anything so probably shouldnt return so everything else has the same standard. Yeaaaa probably should change this. - if GetResourceState('jg-mechanic') ~= 'started' then return true end + if GetResourceState('jg-mechanic') == 'missing' then return true end return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) end diff --git a/modules/inventory/qb-inventory/server.lua b/modules/inventory/qb-inventory/server.lua index e0ace95..1f626af 100644 --- a/modules/inventory/qb-inventory/server.lua +++ b/modules/inventory/qb-inventory/server.lua @@ -209,7 +209,7 @@ Inventory.UpdatePlate = function(oldplate, newplate) qbInventory:SetInventory('glovebox-'..newplate, storedGloveBox.items, "Community Bridge Moving Items In GloveBox") qbInventory:CreateInventory('trunk-'..newplate, {label = 'trunk-'..newplate, slots = storedTrunk.slots, maxweight = storedTrunk.maxweight}) qbInventory:SetInventory('trunk-'..newplate, storedTrunk.items, "Community Bridge Moving Items In Trunk") - if GetResourceState('jg-mechanic') ~= 'started' then return true end + if GetResourceState('jg-mechanic') == 'missing' then return true end return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) end @@ -272,7 +272,7 @@ Inventory.Old.UpdatePlate = function(oldplate, newplate) } local values = { newplate = newplate, oldplate = oldplate } MySQL.transaction.await(queries, values) - if GetResourceState('jg-mechanic') ~= 'started' then return true end + if GetResourceState('jg-mechanic') == 'missing' then return true end return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) end diff --git a/modules/inventory/qs-inventory/server.lua b/modules/inventory/qs-inventory/server.lua index cb7cc4d..4c550cf 100644 --- a/modules/inventory/qs-inventory/server.lua +++ b/modules/inventory/qs-inventory/server.lua @@ -178,7 +178,7 @@ Inventory.UpdatePlate = function(oldplate, newplate) } local values = { newplate = newplate, oldplate = oldplate } MySQL.transaction.await(queries, values) - if GetResourceState('jg-mechanic') ~= 'started' then return true end + if GetResourceState('jg-mechanic') == 'missing' then return true end return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) end diff --git a/modules/inventory/tgiann-inventory/server.lua b/modules/inventory/tgiann-inventory/server.lua index 2d7b629..c77e0e1 100644 --- a/modules/inventory/tgiann-inventory/server.lua +++ b/modules/inventory/tgiann-inventory/server.lua @@ -155,7 +155,7 @@ Inventory.UpdatePlate = function(oldplate, newplate) local values = { newplate = newplate, oldplate = oldplate } MySQL.transaction.await(queries, values) tgiann:UpdateVehicle(oldplate, newplate) - if GetResourceState('jg-mechanic') ~= 'started' then return true end + if GetResourceState('jg-mechanic') == 'missing' then return true end return true, exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate) end