Squirrel/Sandbox

From Liberty Unleashed Wiki
(Difference between revisions)
Jump to: navigation, search
m (A sandbox page to test stuff)
 
 
Line 1: Line 1:
 
{{DISPLAYTITLE:Sandbox}}
 
{{DISPLAYTITLE:Sandbox}}
 +
 
__NOTOC__
 
__NOTOC__
 
This is a 'sandbox' page to test different stuff.
 
This is a 'sandbox' page to test different stuff.
Line 23: Line 24:
 
     {
 
     {
 
           SetGravity( text.tofloat() );
 
           SetGravity( text.tofloat() );
 +
         
 +
          return 1;
 
     }
 
     }
 
}
 
}

Latest revision as of 22:59, 11 April 2010


This is a 'sandbox' page to test different stuff.

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. return 1;
  8. }
  9. }
  10.  

[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