Citizen.CreateThread(function()
while true do
Citizen.Wait(10000)
local veh = GetVehiclePedIsIn(PlayerPedId(), false)
_,lightson,highbeams = GetVehicleLightsState(veh)
local color =GetVehicleHeadlightsColour(veh)
local plate = GetVehicleNumberPlateText(veh)
if plate == nil then
else
ESX.TriggerServerCallback("esx_swiatla:pobierz_swiatla", function(isPurchasable)
if isPurchasable == color then
else
if MenuGUI == false then
ToggleVehicleMod(veh, 22, true)
SetVehicleHeadlightsColour(veh, isPurchasable)
end
end
end, plate)
end
end
end)
To
while true do
Citizen.Wait(1000)
local veh = GetVehiclePedIsIn(PlayerPedId(), false)
_,lightson,highbeams = GetVehicleLightsState(veh)
local color =GetVehicleHeadlightsColour(veh)
local plate = GetVehicleNumberPlateText(veh)
if plate == nil then
else
ESX.TriggerServerCallback("esx_swiatla:pobierz_swiatla", function(isPurchasable)
if isPurchasable == color then
else
if MenuGUI == false then
ToggleVehicleMod(veh, 22, true)
SetVehicleHeadlightsColour(veh, isPurchasable)
end
end
end, plate)
end
end
end)
Okay wtf… I sat here for like 40 min trying to figure out what the hell is the problem lmao, For some odd ass reason nothing is changing it sets it to xeon lights but thats it. No color change nothing.
Yep, It’s not working with 6. I changed my plate format to 8 instead of 6 and everything works.
I suggest to change the plate format and you will be more happy instead of fixing it to work with 6.
Also don’t just change the plate number from ‘‘menu’’ It needs to check the plate you get from the garage or shop.
I am having an issue where I set the color of the lights, but then I cannot interact with the game anymore. I see my mouse cursor after Saving the light color and I have to Alt+F4 my game.