Enable vehicle searching by hash

allows retrieving the shared vehicle data via the hash code in addition to the model/spawn name
This commit is contained in:
Kakarot
2025-01-03 16:47:19 -06:00
parent 12eefc35e6
commit c1e940240d
+4 -1
View File
@@ -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