Scripting/Squirrel/Functions/Game/GetGamespeed

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 returns the current gamespeed. Default gamespeed is 1.0.

Syntax

float GetGamespeed()

Arguments

  • none

Example

This example will return the server gamespeed when someone types '/c gamespeed'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "gamespeed" )
     {
          MessagePlayer( "Current gamespeed: " + GetGamespeed(), player );
     }
}

Notes

The functions MessagePlayer and call onPlayerCommand were used in this example. More info about them in corresponding pages.

Related Functions

Personal tools
squirrel scripting