ResetRainLevel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
(Improve example.)
 
(2 intermediate revisions by 2 users not shown)
Line 10: Line 10:
==Returns==
==Returns==
Returns true if the rain level was reset.
Returns true if the rain level was reset.
==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: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 [-]
Client

This 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