fix vehicle spawn

This commit is contained in:
Arctos2win
2023-09-19 23:42:22 +02:00
committed by GitHub
parent 0a91ca9118
commit a31c8787ce
+24 -5
View File
@@ -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",