Squirrel/Server/Functions/Game/GetGamespeed
From Liberty Unleashed Wiki
(Difference between revisions)
(New page: __NOTOC__ This returns the current gamespeed setting in the server. == Syntax == <code>float GetGamespeed()</code> == Arguments == * '''None''' == Example == This will return the cur...) |
m |
||
Line 19: | Line 19: | ||
if ( cmd == "serverspeed" ) | if ( cmd == "serverspeed" ) | ||
{ | { | ||
− | + | MessagePlayer( "Current gamespeed in the server is: " + GetGamespeed(), id ); | |
} | } | ||
} | } | ||
Line 26: | Line 26: | ||
=== Notes === | === Notes === | ||
− | The call [[Squirrel/Events/Player/OnPlayerCommand|OnPlayerCommand]] | + | The function [[Squirrel/Functions/Misc/MessagePlayer|MessagePlayer]] and call [[Squirrel/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/Functions/Game}} |
Revision as of 15:55, 17 October 2008
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 '/serverspeed'.
function OnPlayerCommand( id, cmd, text ) { if ( cmd == "serverspeed" ) { MessagePlayer( "Current gamespeed in the server is: " + GetGamespeed(), id ); } }
Notes
The function MessagePlayer and call OnPlayerCommand were used in in this example. More info about them in corresponding pages.