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.
This commit is contained in:
MrNewb committed 2026-03-13 12:35:30 -04:00
1 parent 8475f65ee5
commit e0c6d2f8c7
8 files changed
+9 -9

No files matched your search

+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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
+1 -1
View File
@@ -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
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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
@@ -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