Squirrel/Server/Functions/Game/SetGamespeed

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Updated old funcs)
Line 15: Line 15:
  
 
<code lang="squirrel">
 
<code lang="squirrel">
function OnPlayerCommand( id, cmd, text )
+
function onPlayerCommand( plr, cmd, text )
 
{
 
{
 
     if ( cmd == "speed" )
 
     if ( cmd == "speed" )
Line 26: Line 26:
 
=== Notes ===
 
=== Notes ===
  
The call [[Squirrel/Events/Player/OnPlayerCommand|OnPlayerCommand]] was used in this example. More info about this in its corresponding page.
+
The call [[Squirrel/Server/Events/Player/oPlayerCommand|onPlayerCommand]] was used in this example. More info about this in its corresponding page.
  
 
== Related Functions ==
 
== Related Functions ==
  
{{Squirrel/Functions/Game}}
+
{{Squirrel/Server/Functions/Game}}

Revision as of 00:01, 27 November 2009

Sets the gamespeed in the server. This affects all players.

Syntax

  1. bool SetGamespeed( float fSpeed )

Arguments

  • fSpeed - The value that you want to set the gamespeed to

Example

This will set the Gamespeed when a player types '/speed 0.5'

  1.  
  2. function onPlayerCommand( plr, cmd, text )
  3. {
  4. if ( cmd == "speed" )
  5. {
  6. SetGamespeed( text.tofloat() );
  7. }
  8. }
  9.  

Notes

The call onPlayerCommand was used in this example. More info about this in its corresponding page.

Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox