From f3054f5fa94578d0747907d72b894d5e10c7815e Mon Sep 17 00:00:00 2001 From: Arctos2win <116841243+Arctos2win@users.noreply.github.com> Date: Tue, 15 Aug 2023 22:29:29 +0200 Subject: [PATCH] fix mismatched vehicles --- [core]/es_extended/client/functions.lua | 44 +++++++++++++++++++++---- 1 file changed, 38 insertions(+), 6 deletions(-) diff --git a/[core]/es_extended/client/functions.lua b/[core]/es_extended/client/functions.lua index fa791cde2..9d7aed813 100644 --- a/[core]/es_extended/client/functions.lua +++ b/[core]/es_extended/client/functions.lua @@ -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)