onWeatherChange

From Liberty Unleashed Wiki
Jump to: navigation, search
Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This event is called when the world weather changes.

Syntax

  1. function onWeatherChange( int old_weather, int new_weather )

Arguments

  • old_weather - The weather before it changes
  • new_weather - The weather after changing

Returns

  • 1 - Allows the weather to change normally
  • 0 - Cancels the weather change

Example

This example will cancel the weather change if the new weather is foggy (ID 3).

  1.  
  2. function onWeatherChange( old, new )
  3. {
  4. if ( new == 3 ) return 0;
  5. return 1;
  6. }
  7.  

Notes

This example has no notes.

Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox