mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-30 17:58:54 +00:00
Move vehicle garage to seperate file, see desc for full change
This commit is contained in:
+5
-22
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user