Move vehicle garage to seperate file, see desc for full change

This commit is contained in:
ElPumpo
2020-01-24 13:25:10 +01:00
parent 7037671420
commit 355c04bebb
14 changed files with 398 additions and 445 deletions
+5 -22
View File
@@ -436,29 +436,12 @@ ESX.RegisterServerCallback('esx_policejob:storeNearbyVehicle', function(source,
end
end)
function getPriceFromHash(hashKey, jobGrade, type)
if type == 'helicopter' then
local vehicles = Config.AuthorizedHelicopters[jobGrade]
function getPriceFromHash(vehicleHash, jobGrade, type)
local vehicles = Config.AuthorizedVehicles[type][jobGrade]
for k,v in ipairs(vehicles) do
if GetHashKey(v.model) == hashKey then
return v.price
end
end
elseif type == 'car' then
local vehicles = Config.AuthorizedVehicles[jobGrade]
local shared = Config.AuthorizedVehicles['Shared']
for k,v in ipairs(vehicles) do
if GetHashKey(v.model) == hashKey then
return v.price
end
end
for k,v in ipairs(shared) do
if GetHashKey(v.model) == hashKey then
return v.price
end
for k,v in ipairs(vehicles) do
if GetHashKey(v.model) == vehicleHash then
return v.price
end
end