Scripting/Squirrel/Functions/Game/GetGravity

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 gravity. Default gravity is 0.008.

Syntax

float GetGravity()

Arguments

  • none

Example

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

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "gravity" )
     {
          MessagePlayer( "Current gravity: " + GetGravity(), 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