From 30a13c572622896984b16bb09c06dd1377baa8b8 Mon Sep 17 00:00:00 2001 From: Muhammed Yaseen Date: Fri, 9 May 2025 08:54:35 +0530 Subject: [PATCH] Revert "Revamped GetVehicleProperties in compatible with the removal of customPrimay and secondary colors" This reverts commit 9b0ffead471c6574d0c8998b61af17f10a5a8207. --- [core]/es_extended/client/functions.lua | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/[core]/es_extended/client/functions.lua b/[core]/es_extended/client/functions.lua index aa5f572e..71ed4882 100644 --- a/[core]/es_extended/client/functions.lua +++ b/[core]/es_extended/client/functions.lua @@ -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,