Squirrel/Server/Functions/Game/GetGamespeed
From Liberty Unleashed Wiki
(Difference between revisions)
m (Squirrel/Functions/Game/GetGamespeed moved to Squirrel/Server/Functions/Game/GetGamespeed: Server-side scripting only) |
m (Updated with the latest functions) |
||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
− | This will return the current gamespeed in the server when somebody types '/ | + | This will return the current gamespeed in the server when somebody types '/gamespeed'. |
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function | + | function onPlayerCommand( plr, cmd, text ) |
{ | { | ||
if ( cmd == "serverspeed" ) | if ( cmd == "serverspeed" ) | ||
{ | { | ||
− | MessagePlayer( "Current gamespeed in the server is: " + GetGamespeed(), | + | MessagePlayer( "Current gamespeed in the server is: " + GetGamespeed(), 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:10, 26 November 2009
This returns the current gamespeed setting in the server.
Syntax
float GetGamespeed()
Arguments
- None
Example
This will return the current gamespeed in the server when somebody types '/gamespeed'.
function onPlayerCommand( plr, cmd, text ) { if ( cmd == "serverspeed" ) { MessagePlayer( "Current gamespeed in the server is: " + GetGamespeed(), 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