Squirrel/Server/Functions/Game/GetWeather
From Liberty Unleashed Wiki
(Difference between revisions)
m (Squirrel/Functions/Game/GetWeather moved to Squirrel/Server/Functions/Game/GetWeather: Server-side scripting only) |
(Updated old functions) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | Returns the current weather in the server. | + | Returns the current weather ID in the server. |
== Syntax == | == Syntax == | ||
Line 15: | Line 15: | ||
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function | + | function onPlayerCommand( plr, cmd, text ) |
{ | { | ||
if ( cmd == "weather" ) | if ( cmd == "weather" ) | ||
{ | { | ||
− | MessagePlayer( "Server weather ID is: " + GetWeather(), | + | MessagePlayer( "Server weather ID is: " + GetWeather(), plr ); |
} | } | ||
} | } | ||
Line 26: | Line 26: | ||
=== Notes === | === Notes === | ||
− | The function [[Squirrel/Functions/ | + | The function [[Squirrel/Server/Functions/Messages/MessagePlayer|MessagePlayer]] and call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] were used in in this example. More info about them in corresponding pages. |
== Related Functions == | == Related Functions == | ||
− | {{Squirrel/Functions/Game}} | + | {{Squirrel/Server/Functions/Game}} |
Revision as of 23:30, 26 November 2009
Returns the current weather ID in the server.
Syntax
int GetWeather()
Arguments
- None
Example
This command will tell player the current weather ID when they type '/weather'.
function onPlayerCommand( plr, cmd, text ) { if ( cmd == "weather" ) { MessagePlayer( "Server weather ID is: " + GetWeather(), plr ); } }
Notes
The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.
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