Squirrel/Server/Functions/Game/SetGravity
From Liberty Unleashed Wiki
(Difference between revisions)
m (Squirrel/Functions/Game/SetGravity moved to Squirrel/Server/Functions/Game/SetGravity: Server-side scripting only) |
(Still updating old functions...) |
||
Line 12: | Line 12: | ||
== Example == | == Example == | ||
− | This will set the | + | This will set the gravity when a player types '/grav 0.001' |
<code lang="squirrel"> | <code lang="squirrel"> | ||
− | function | + | function onPlayerCommand( plr, cmd, text ) |
{ | { | ||
if ( cmd == "grav" ) | if ( cmd == "grav" ) | ||
Line 26: | Line 26: | ||
=== Notes === | === Notes === | ||
− | The call [[Squirrel/Events/Player/ | + | The call [[Squirrel/Server/Events/Player/onPlayerCommand|onPlayerCommand]] was used in in this example. More info about this in the corresponding page. |
== Related Functions == | == Related Functions == | ||
− | {{Squirrel/Functions/Game}} | + | {{Squirrel/Server/Functions/Game}} |
Revision as of 00:03, 27 November 2009
Sets the gravity in the server. This affects all players.
Syntax
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'
function onPlayerCommand( plr, cmd, text ) { if ( cmd == "grav" ) { SetGravity( text.tofloat() ); } }
Notes
The call onPlayerCommand was used in in this example. More info about this in the corresponding page.
Related Functions
- CloseGarage
- CloseSSVBridge
- EnableTrains
- GetBoundariesLower
- GetBoundariesUpper
- GetFriendlyFire
- GetGamespeed
- GetGravity
- GetHour
- GetIslands
- GetMinute
- GetSSVBridgeLock
- GetSSVBridgeUpdateTime
- GetSurfaceTraction
- GetTimeLock
- GetWeather
- GetWeatherLock
- IsSSVBridgeUp
- OpenGarage
- OpenSSVBridge
- SetBoundaries
- SetFriendlyFire
- SetGamespeed
- SetGravity
- SetIslands
- SetSSVBridgeLock
- SetSSVBridgeUpdateTime
- SetSurfaceTraction
- SetTime
- SetTimeLock
- SetWeather
- SetWeatherLock