setWeather | Multi Theft Auto: Wiki Skip to content

setWeather

Client-side
Server-side
Shared

Manual Review Required

Please finish this page using the corresponding Old Wiki article. Go to Contribution guidelines for more information.


This function sets the current weather to the given valid value. To change the weather gradually, see setWeatherBlended.

Syntax

bool setWeather ( int weatherID )
Required Arguments
  • weatherID: The ID of new weather . Valid values are 0 to 255 inclusive.

Returns

  • bool: value

Returns true if the weather was set succesfully, false if an invalid weatherID was specified.

Code Examples

shared

This example will change the weather to foggy.

setWeather ( 9 )
outputChatBox ( "Weather changed to foggy!" )

See Also

World Functions