SetRainLevel: Difference between revisions
Jump to navigation
Jump to search
OpenIDUser28 (talk | contribs) (Extended the info.) |
(Improve example and description.) |
||
(7 intermediate revisions by 6 users not shown) | |||
Line 5: | Line 5: | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
bool setRainLevel ( float | bool setRainLevel ( float level ) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*''' | *'''level:''' A floating point number representing the rain level. 1 represents the maximum rain level usually available in GTA, but higher values are accepted. | ||
** '''Note:''' The level value is clamped between 0.0 and 10.0 to avoid gameplay issues. | |||
===Returns=== | ===Returns=== | ||
Returns true if the rain level was set, ''false'' otherwise. | Returns ''true'' if the rain level was set, ''false'' otherwise. | ||
==Example== | |||
<section name="Client" class="client" show="true"> | |||
This example will make it rain when player or ped enters a vehicle, and stop once it leaves. | |||
<syntaxhighlight lang="lua"> | |||
function startRaining() | |||
setRainLevel(5) | |||
end | |||
addEventHandler("onClientVehicleEnter", root, startRaining) | |||
function stopRaining() | |||
resetRainLevel() | |||
end | |||
addEventHandler("onClientVehicleExit", root, stopRaining) | |||
</syntaxhighlight> | |||
</section> | |||
==See Also== | |||
{{World functions}} |
Latest revision as of 08:18, 16 September 2021
This function sets the rain level to any weather available in GTA. Use resetRainLevel to undo the changes.
Syntax
bool setRainLevel ( float level )
Required Arguments
- level: A floating point number representing the rain level. 1 represents the maximum rain level usually available in GTA, but higher values are accepted.
- Note: The level value is clamped between 0.0 and 10.0 to avoid gameplay issues.
Returns
Returns true if the rain level was set, false otherwise.
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