SetWeatherTypeTransition()?

Hi, I’m trying to do a transitionning weather synced to all players, but the SetWeatherTypeTransition() doesn’t seem to work. Am I using it the wrong way ?

w1 = “CLEAR”
w2 = “THUNDER”
for instance

   Citizen.CreateThread(function()
		local percent = 0
		while percent < 0.9 do
			percent = percent + 0.1
			SetWeatherTypeTransition(w1, w2, percent)
			print(w1.." > "..w2.." "..percent)
			Citizen.Wait(1*1000)
		end
		transitioning = false
		CurrentWeather = w2
	end)

That native doesn’t work. Try to use SetWeatherTypeOverTime instead.
https://runtime.fivem.net/doc/reference.html#_0xFB5045B7C42B75BF

Example: SetWeatherTypeOverTime("CLEAR", timeInSeconds) (note the time is in seconds, NOT in milliseconds!. Also, 15 seconds seems to be the max, anything >15 will cause it to break. That’s just from personal experience.

You also need to “clear” any persistent or “override” weather states first.

Works flawless ! Ty !

why the native SetWeatherTypeTransition doesn’t work?

the native GetWeatherTypeTransition return true answer only if you use the native ClearWeatherTypePersist.

and the native SetWeatherTypeTransition give for the developer more options of weather types.

do you think that fivem can fix the native SetWeatherTypeTransition?

by the way i think the native GetWeatherTypeTransition is sync for all players.

Hopefully this will work some day.

1 Like

HOW TO MAKE A SERVER HAVE ALWAYS CLEAR WEATHER AND NO CLOUDS ?