Scripting/Squirrel/Functions/Game/SetGravity

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

Syntax

bool SetGravity( float fGravity )

Arguments

  • fGravity - New gravity value

Example

This example will change the server gravity when someone types '/c setgravity 1'.

function onPlayerCommand( player, cmd, text )
{
     if ( cmd == "setgravity" )
     {
          SetGravity( 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