From 9834a78f6db5b7a3b0e7e8220c76d72e992bb812 Mon Sep 17 00:00:00 2001 From: Mycroft Date: Fri, 9 Sep 2022 17:33:38 +0100 Subject: [PATCH] feat(es_extended): Support For Custom Xenon Colours --- [esx]/es_extended/client/functions.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/[esx]/es_extended/client/functions.lua b/[esx]/es_extended/client/functions.lua index 299e21ea..f31ef975 100644 --- a/[esx]/es_extended/client/functions.lua +++ b/[esx]/es_extended/client/functions.lua @@ -692,6 +692,12 @@ function ESX.Game.GetVehicleProperties(vehicle) customPrimaryColor = {r, g, b} end + local customXenonColorR, customXenonColorG, customXenonColorB = GetVehicleXenonLightsCustomColor(vehicle) + local customXenonColor = nil + if customXenonColorR and customXenonColorG and customXenonColorB then + customXenonColor = {customXenonColorR, customXenonColorG, customXenonColorB} + end + local hasCustomSecondaryColor = GetIsVehicleSecondaryColourCustom(vehicle) local customSecondaryColor = nil if hasCustomSecondaryColor then @@ -771,6 +777,7 @@ function ESX.Game.GetVehicleProperties(vehicle) wheels = GetVehicleWheelType(vehicle), windowTint = GetVehicleWindowTint(vehicle), xenonColor = GetVehicleXenonLightsColor(vehicle), + customXenonColor = customXenonColor, neonEnabled = {IsVehicleNeonLightEnabled(vehicle, 0), IsVehicleNeonLightEnabled(vehicle, 1), IsVehicleNeonLightEnabled(vehicle, 2), IsVehicleNeonLightEnabled(vehicle, 3)}, @@ -912,6 +919,10 @@ function ESX.Game.SetVehicleProperties(vehicle, props) if props.xenonColor then SetVehicleXenonLightsColor(vehicle, props.xenonColor) end + if props.customXenonColor then + SetVehicleXenonLightsCustomColor(vehicle, props.customXenonColor[1], props.customXenonColor[2], + props.customXenonColor[3]) + end if props.modSmokeEnabled then ToggleVehicleMod(vehicle, 20, true) end