feat(es_extended): Support For Custom Xenon Colours

This commit is contained in:
Mycroft
2022-09-09 17:33:38 +01:00
parent 19967e47ac
commit 9834a78f6d
+11
View File
@@ -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