Scripting/Squirrel/Functions/Game/SetGamespeed

From VC-MP Wiki

Jump to: navigation, search

NOTE: This function has been added in VC:MP 0.3z r2. It will not work in previous versions.


This function sets the gamespeed. Default gamespeed is 1.0.

Syntax

bool SetGamespeed( float fSpeed )

Arguments

  • fSpeed - The new gamespeed

Example

This example will change the server gamespeed when someone types '/c setspeed 5'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "setspeed" )
     {
          SetGamespeed( text.tofloat() );
     }
}

Notes

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

Related Functions

Personal tools
squirrel scripting