er2.setTimeAndWeather 88

Sets the current time of day of the mission and some weather conditions, like clouds, snow and fog.
To synchronize the weather changes to other clients you can use synchWeather.

NOTE: This function it's CPU heavy


Return value

Return TypeDescription
voidThis function doesn't return anything

Parameters

ParameterTypeDescription
1integerThe hour of the day. Must stay between 0 and 23
2integerThe minute of the day. Must stay between 0 and 59.
3float(Optional) The percentage of clouds in the map. From 0.0 to 1.0
4float(Optional) The percentage of snow over the terrain. From 0.0 to 1.0
5float(Optional) The percentage of fog all over the map. From 0.0 to 1.0

Examples

Set weather and snow, synched online

er2.setTimeAndWeather(17, 20, 0.5, 0.6, 0.4) -- Set 5:20 PM with cloudy sky, some rain on the ground and some fog
er2.setSnowing() -- set snow falling from the sky
er2.synchWeather() -- apply set weather to all clients, including future connecting ones

Back to Scripting API