Squirrel/Server/Functions/Game/SetGravity

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(New page: __NOTOC__ Sets the gravity in the server. This affects all players. == Syntax == <code>bool SetGravity( float fGravity )</code> == Arguments == * '''fGravity''' - The value that you wa...)
 

Revision as of 20:07, 26 November 2009

Sets the gravity in the server. This affects all players.

Syntax

  1. bool SetGravity( float fGravity )

Arguments

  • fGravity - The value that you want to set the gravity to

Example

This will set the Gravity when a player types '/grav 0.001'

  1.  
  2. function OnPlayerCommand( id, cmd, text )
  3. {
  4. if ( cmd == "grav" )
  5. {
  6. SetGravity( text.tofloat() );
  7. }
  8. }
  9.  

Notes

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

Related Functions

Template:Squirrel/Functions/Game

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox