Squirrel/Server/Events/Game/onWeatherChange

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with '{{Squirrel/Title|onWeatherChange}} This event is called when the world weather changes. == Syntax == <code>function onWeatherChange( int old_weather, int new_weather )</code> …')
 

Latest revision as of 15:32, 4 November 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

This event is called when the world weather changes.

[edit] Syntax

  1. function onWeatherChange( int old_weather, int new_weather )

[edit] Arguments

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

[edit] Returns

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

[edit] 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.  

[edit] Notes

This example has no notes.

[edit] Related Events

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox