mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 04:01:22 +00:00
fix vehicle spawn
This commit is contained in:
@@ -1326,19 +1326,39 @@ AddEventHandler('onResourceStop', function(resourceName)
|
||||
end)
|
||||
|
||||
local mismatchedTypes = {
|
||||
[`airtug`] = "automobile", -- trailer
|
||||
[`avisa`] = "submarine", -- boat
|
||||
[`blimp`] = "heli", -- plane
|
||||
[`blimp2`] = "heli", -- plane
|
||||
[`blimp3`] = "heli", -- plane
|
||||
[`caddy`] = "automobile", -- trailer
|
||||
[`caddy2`] = "automobile", -- trailer
|
||||
[`caddy3`] = "automobile", -- trailer
|
||||
[`chimera`] = "automobile", -- bike
|
||||
[`docktug`] = "automobile", -- trailer
|
||||
[`forklift`] = "automobile", -- trailer
|
||||
[`kosatka`] = "submarine", -- boat
|
||||
[`mower`] = "automobile", -- trailer
|
||||
[`policeb`] = "bike", -- automobile
|
||||
[`ripley`] = "automobile", -- trailer
|
||||
[`rrocket`] = "automobile", -- bike
|
||||
[`sadler`] = "automobile", -- trailer
|
||||
[`sadler2`] = "automobile", -- trailer
|
||||
[`scrap`] = "automobile", -- trailer
|
||||
[`slamtruck`] = "automobile", -- trailer
|
||||
[`Stryder`] = "automobile", -- bike
|
||||
[`submersible`] = "submarine", -- boat
|
||||
[`submersible2`] = "submarine", -- boat
|
||||
[`thruster`] = "heli", -- automobile
|
||||
[`towtruck`] = "automobile", -- trailer
|
||||
[`towtruck2`] = "automobile", -- trailer
|
||||
[`tractor`] = "automobile", -- trailer
|
||||
[`tractor2`] = "automobile", -- trailer
|
||||
[`tractor3`] = "automobile", -- trailer
|
||||
[`trailersmall2`] = "trailer", -- automobile
|
||||
[`utillitruck`] = "automobile", -- trailer
|
||||
[`utillitruck2`] = "automobile", -- trailer
|
||||
[`utillitruck3`] = "automobile", -- trailer
|
||||
}
|
||||
|
||||
---@param model number|string
|
||||
@@ -1346,15 +1366,14 @@ local mismatchedTypes = {
|
||||
function ESX.GetVehicleType(model)
|
||||
model = type(model) == 'string' and joaat(model) or model
|
||||
if not IsModelInCdimage(model) then return end
|
||||
|
||||
if mismatchedTypes[model] then
|
||||
return mismatchedTypes[model]
|
||||
end
|
||||
if mismatchedTypes[model] then
|
||||
return mismatchedTypes[model]
|
||||
end
|
||||
|
||||
local vehicleType = GetVehicleClassFromName(model)
|
||||
|
||||
local types = {
|
||||
[8] = "bike",
|
||||
[11] = "trailer",
|
||||
[13] = "bike",
|
||||
[14] = "boat",
|
||||
[15] = "heli",
|
||||
|
||||
Reference in New Issue
Block a user