Scripting/Squirrel/Functions/SetGravity

From Vice City Multiplayer
Revision as of 08:37, 26 April 2019 by Xhefri (talk | contribs) (→‎Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

This function will set the gravity of the game.

Syntax

SetGravity( gravity )

Arguments

  • float gravity - The gravity of the game (default is 0.008)

Example

else if ( cmd == "setgravity" )
{
if ( !text ) MessagePlayer( "Use /setgravity <Gravity>.", player );
else if ( !IsNum( text ) ) MessagePlayer( "Gravity must be an integer.", player );
else {
SetGravity(text.tointeger())
MessagePlayer( "Game gravity has been changed." , player );
}
}

Notes

Related Functions