Revamped GetVehicleProperties in compatible with the removal of customPrimay and secondary colors

This commit is contained in:
Muhammed Yaseen
2025-05-09 08:48:44 +05:30
parent 542b143e75
commit 9b0ffead47
+8 -11
View File
@@ -805,14 +805,19 @@ function ESX.Game.GetVehicleProperties(vehicle)
return
end
local colorPrimary, colorSecondary = GetVehicleColours(vehicle)
local colorPrimary, colorSecondary = GetVehicleColours(vehicle) ---@type number | number[], number | number[]
local pearlescentColor, wheelColor = GetVehicleExtraColours(vehicle)
local hasCustomPrimaryColor = GetIsVehiclePrimaryColourCustom(vehicle)
local hasCustomSecondaryColor = GetIsVehicleSecondaryColourCustom(vehicle)
local dashboardColor = GetVehicleDashboardColor(vehicle)
local interiorColor = GetVehicleInteriorColour(vehicle)
local customPrimaryColor = nil
if hasCustomPrimaryColor then
customPrimaryColor = { GetVehicleCustomPrimaryColour(vehicle) }
colorPrimary = { GetVehicleCustomPrimaryColour(vehicle) }
end
if hasCustomSecondaryColor then
colorSecondary = { GetVehicleCustomSecondaryColour(vehicle) }
end
local hasCustomXenonColor, customXenonColorR, customXenonColorG, customXenonColorB = GetVehicleXenonLightsCustomColor(vehicle)
@@ -821,12 +826,6 @@ function ESX.Game.GetVehicleProperties(vehicle)
customXenonColor = { customXenonColorR, customXenonColorG, customXenonColorB }
end
local hasCustomSecondaryColor = GetIsVehicleSecondaryColourCustom(vehicle)
local customSecondaryColor = nil
if hasCustomSecondaryColor then
customSecondaryColor = { GetVehicleCustomSecondaryColour(vehicle) }
end
local extras = {}
for extraId = 0, 20 do
if DoesExtraExist(vehicle, extraId) then
@@ -879,8 +878,6 @@ function ESX.Game.GetVehicleProperties(vehicle)
dirtLevel = ESX.Math.Round(GetVehicleDirtLevel(vehicle), 1),
color1 = colorPrimary,
color2 = colorSecondary,
customPrimaryColor = customPrimaryColor,
customSecondaryColor = customSecondaryColor,
pearlescentColor = pearlescentColor,
wheelColor = wheelColor,