Squirrel/Server/Functions/Game/SetGravity

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
(Still updating old functions...)
 
Line 1: Line 1:
__NOTOC__
+
{{Squirrel/Title|SetGravity}}
 
Sets the gravity in the server. This affects all players.
 
Sets the gravity in the server. This affects all players.
  

Latest revision as of 10:45, 11 October 2010

Home   |   Squirrel Scripting   |   Server Functions   |   Server Events   |   Client Functions   |   Client Events

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

[edit] Syntax

  1. bool SetGravity( float fGravity )

[edit] Arguments

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

[edit] Example

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

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

[edit] Notes

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

[edit] Related Functions

Personal tools
Namespaces

Variants
Actions
Navigation
scripting
Toolbox