From c1e940240d5f305369b37e96678894dacf5bdf13 Mon Sep 17 00:00:00 2001 From: Kakarot <57848836+GhzGarage@users.noreply.github.com> Date: Fri, 3 Jan 2025 16:47:19 -0600 Subject: [PATCH] Enable vehicle searching by hash allows retrieving the shared vehicle data via the hash code in addition to the model/spawn name --- shared/vehicles.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shared/vehicles.lua b/shared/vehicles.lua index bf6bf87..b745c09 100644 --- a/shared/vehicles.lua +++ b/shared/vehicles.lua @@ -765,7 +765,9 @@ local Vehicles = { { model = 'formula', name = 'PR4', brand = 'Progen', price = 100000, category = 'openwheel', type = 'automobile', shop = 'none' }, } +QBShared.VehicleHashes = QBShared.VehicleHashes or {} for i = 1, #Vehicles do + local hash = joaat(Vehicles[i].model) QBShared.Vehicles[Vehicles[i].model] = { spawncode = Vehicles[i].model, name = Vehicles[i].name, @@ -773,8 +775,9 @@ for i = 1, #Vehicles do model = Vehicles[i].model, price = Vehicles[i].price, category = Vehicles[i].category, - hash = joaat(Vehicles[i].model), + hash = hash, type = Vehicles[i].type, shop = Vehicles[i].shop } + QBShared.VehicleHashes[hash] = QBShared.Vehicles[Vehicles[i].model] end