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

This reverts commit 9b0ffead47.
This commit is contained in:
Muhammed Yaseen
2025-05-09 08:54:35 +05:30
parent 9b0ffead47
commit 30a13c5726
+11 -8
View File
@@ -805,19 +805,14 @@ function ESX.Game.GetVehicleProperties(vehicle)
return
end
local colorPrimary, colorSecondary = GetVehicleColours(vehicle) ---@type number | number[], number | number[]
local colorPrimary, colorSecondary = GetVehicleColours(vehicle)
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
colorPrimary = { GetVehicleCustomPrimaryColour(vehicle) }
end
if hasCustomSecondaryColor then
colorSecondary = { GetVehicleCustomSecondaryColour(vehicle) }
customPrimaryColor = { GetVehicleCustomPrimaryColour(vehicle) }
end
local hasCustomXenonColor, customXenonColorR, customXenonColorG, customXenonColorB = GetVehicleXenonLightsCustomColor(vehicle)
@@ -826,6 +821,12 @@ 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
@@ -878,6 +879,8 @@ function ESX.Game.GetVehicleProperties(vehicle)
dirtLevel = ESX.Math.Round(GetVehicleDirtLevel(vehicle), 1),
color1 = colorPrimary,
color2 = colorSecondary,
customPrimaryColor = customPrimaryColor,
customSecondaryColor = customSecondaryColor,
pearlescentColor = pearlescentColor,
wheelColor = wheelColor,