UpdatePlate added for all bridged inventories

This commit is contained in:
MrNewb committed 2025-02-16 07:14:27 -05:00
1 parent 1399b2e754
commit 17d68505a6
5 files changed
+60

No files matched your search

@@ -75,4 +75,16 @@ Inventory.GetImagePath = function(item)
local webpPath = LoadResourceFile("inventory_images", string.format("html/images/%s.webp", item))
local imagePath = pngPath and string.format("nui://inventory_images/html/images/%s.png", item) or webpPath and string.format("nui://inventory_images/html/images/%s.webp", item)
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
end
Inventory.UpdatePlate = function(oldplate, newplate)
local queries = {
'UPDATE tgiann_inventory_trunkitems SET plate = @newplate WHERE plate = @oldplate',
'UPDATE tgiann_inventory_gloveboxitems SET plate = @newplate WHERE plate = @oldplate',
}
local values = { newplate = newplate, oldplate = oldplate }
MySQL.transaction.await(queries, values)
if GetResourceState('jg-mechanic') ~= 'started' then return true end
exports["jg-mechanic"]:vehiclePlateUpdated(oldplate, newplate)
return true
end