Squirrel/Server/Functions/Game/SetWeather
From Liberty Unleashed Wiki
(Difference between revisions)
m (Squirrel/Functions/Game/SetWeather moved to Squirrel/Server/Functions/Game/SetWeather: Server-side scripting only) |
|||
Line 15: | Line 15: | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function | + | function onPlayerCommand( plr, cmd, text ) |
{ | { | ||
if ( cmd == "setweather" ) | if ( cmd == "setweather" ) | ||
Line 26: | Line 26: | ||
=== Notes === | === Notes === | ||
− | The call [[Squirrel/Events/Player/ | + | The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in in this example. More info about this in the corresponding page. |
== Related Functions == | == Related Functions == | ||
− | {{Squirrel/Functions/Game}} | + | {{Squirrel/Server/Functions/Game}} |
Revision as of 00:05, 27 November 2009
Changes the weather in the server. This affects all players.
Syntax
bool SetWeather( int weatherid )
Arguments
- weatherid - The WeatherID you want to change the server weather to
Example
This will change the weather in the server when a player types '/setweather 1'.
function onPlayerCommand( plr, cmd, text ) { if ( cmd == "setweather" ) { SetWeather( text.tointeger() ); } }
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.
Related Functions
- CloseGarage
- CloseSSVBridge
- EnableTrains
- GetBoundariesLower
- GetBoundariesUpper
- GetFriendlyFire
- GetGamespeed
- GetGravity
- GetHour
- GetIslands
- GetMinute
- GetSSVBridgeLock
- GetSSVBridgeUpdateTime
- GetSurfaceTraction
- GetTimeLock
- GetWeather
- GetWeatherLock
- IsSSVBridgeUp
- OpenGarage
- OpenSSVBridge
- SetBoundaries
- SetFriendlyFire
- SetGamespeed
- SetGravity
- SetIslands
- SetSSVBridgeLock
- SetSSVBridgeUpdateTime
- SetSurfaceTraction
- SetTime
- SetTimeLock
- SetWeather
- SetWeatherLock