mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-29 00:01:22 +00:00
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:
+4
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user