Need help for one Native (SetArtificialLightsState AffectsVehicles)

Hi ! i have a problem, i put the Native “SetArtificialLightsStateAffectsVehicles(true)” but i dont know why she dont work… You know how use it ?

Build: set sv_enforceGameBuild 2189
Build server: 3886 (2021-04-28 19:52:07)

—> SetArtificialLightsStateAffectsVehicles()

Screenshot_28

This?

Yes (but the Native SetBlackout, is now SetArtificialLightsState)
And the Native SetArtificialLightsStateAffectsVehicles, this native allows you to ignore “blackout” for vehicles but i dont know why, she doesn’t work…

hmmm …

sorry i cant find out the problem :frowning:

1 Like

Could you solve it?

1 Like

i see this Native dont work with build 2189 work only on game build 2060

1 Like

in B2189 you need set this native in a loop thread

Lua example:

local state = false
AddEventHandler('adminControl:apagon',function(st)
	state = st
end)

Citizen.CreateThread(function()
	while true do
		print(state)
		SetArtificialLightsState(state)
		Citizen.Wait(0)
	end
end)

I dont talk of this native x)
It’s then: SetArtificialLightsStateAffectsVehicles


i found the problem:

try this:

Citizen.CreateThread(function()
	while true do
		--SetArtificialLightsStateAffectsVehicles(true)
		Citizen.InvokeNative(0xE2B187C0939B3D32, 0)
		SetArtificialLightsState(true)
		Citizen.Wait(0)
	end
end)
2 Likes

You’re in Build 2189 ?

image
yes

1 Like

It’s work ! Thx !

1 Like

What about 2060 build ? Can you give me the exact one as this won’t work in 2060

i check the problem is because have a any script using blackout in my i use vSync this have a blackout method you need delete for get work without a while

where would I put that is this a resource or something with in default fx data