Skip to content

Commit

Permalink
fix mismatched vehicles
Browse files Browse the repository at this point in the history
  • Loading branch information
Arctos2win authored Aug 15, 2023
1 parent bcf45cd commit f3054f5
Showing 1 changed file with 38 additions and 6 deletions.
44 changes: 38 additions & 6 deletions [core]/es_extended/client/functions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1328,15 +1328,47 @@ end)

---@param model number|string
---@return string
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
}

function ESX.GetVehicleType(model)
model = type(model) == 'string' and joaat(model) or model

if model == `submersible` or model == `submersible2` then
return 'submarine'
end

if model == `blimp` then
return 'heli'
if mismatchedTypes[model] then
return mismatchedTypes[model]
end

local vehicleType = GetVehicleClassFromName(model)
Expand Down

0 comments on commit f3054f5

Please sign in to comment.