SetRainLevel: Difference between revisions

From Multi Theft Auto: Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 9: Line 9:


===Required Arguments===  
===Required Arguments===  
*'''level:''' A floating point number representing the rain level.
*'''level:''' A floating point number representing the rain level. 1 represents the maximum rain level usually available in GTA, but higher values are accepted.


===Returns===
===Returns===

Revision as of 10:02, 18 May 2014

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.

Returns

Returns true if the rain level was set, false otherwise.

Example

Click to collapse [-]
Client

This example will make it rain when you enter a vehicle and stop it when you leave the vehicle.

function startRaining()
         setRainLevel(5)
end
addEventHandler("onClientVehicleEnter", getRootElement(), startRaining)

function stopRaining()
         resetRainLevel()
end
addEventHandler("onClientVehicleExit", getRootElement(), stopRaining)

See Also