ResetRainLevel: Difference between revisions
Jump to navigation
Jump to search
QuantumZ94 (talk | contribs) No edit summary |
(Improve example.) |
||
(One intermediate revision by one other user not shown) | |||
Line 13: | Line 13: | ||
==Example== | ==Example== | ||
<section name="Client" class="client" show="true"> | <section name="Client" class="client" show="true"> | ||
This example will make it rain when | This example will make it rain when player or ped enters a vehicle, and stop once it leaves. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function startRaining() | function startRaining() | ||
setRainLevel(5) | setRainLevel(5) | ||
end | end | ||
addEventHandler("onClientVehicleEnter", | addEventHandler("onClientVehicleEnter", root, startRaining) | ||
function stopRaining() | function stopRaining() | ||
resetRainLevel() | resetRainLevel() | ||
end | end | ||
addEventHandler("onClientVehicleExit", | addEventHandler("onClientVehicleExit", root, stopRaining) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> | ||
==See Also== | |||
{{World functions}} |
Latest revision as of 08:05, 16 September 2021
This function resets the rain level of the current weather to its default.
Syntax
bool resetRainLevel ( )
Returns
Returns true if the rain level was reset.
Example
Click to collapse [-]
ClientThis example will make it rain when player or ped enters a vehicle, and stop once it leaves.
function startRaining() setRainLevel(5) end addEventHandler("onClientVehicleEnter", root, startRaining) function stopRaining() resetRainLevel() end addEventHandler("onClientVehicleExit", root, stopRaining)
See Also
- areTrafficLightsLocked
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getSkyGradient
- getPlayerBlurLevel
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity
- setJetpackMaxHeight
- setPlayerBlurLevel