GetGravity: Difference between revisions
Jump to navigation
Jump to search
(Checked, minor fixes) |
(Syntax fix, added return info, added template, added sections) |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | |||
This function returns the current gravity level for the context in which it is called (server or client). | This function returns the current gravity level for the context in which it is called (server or client). | ||
==Syntax== | ==Syntax== | ||
<section name="Server and Client" class="both" show="true"> | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
getGravity() | float getGravity() | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Returns=== | |||
Returns a float with the current server or client (depending on where you call the function) gravity level. | |||
</section> | |||
==Example== | ==Example== | ||
<section name="Server" class="server" show="true"> | |||
This serverside command outputs the serverside gravity level. | This serverside command outputs the serverside gravity level. | ||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
Line 19: | Line 26: | ||
==See Also== | ==See Also== | ||
{{World functions}} | {{World functions}}</section> |
Revision as of 20:42, 4 August 2007
This function returns the current gravity level for the context in which it is called (server or client).
Syntax
Click to collapse [-]
Server and Clientfloat getGravity()
Returns
Returns a float with the current server or client (depending on where you call the function) gravity level.
Example
Click to collapse [-]
ServerThis serverside command outputs the serverside gravity level.
function getGravityLevel( playerSource ) local gravity = getGravity() outputConsole ( "The gravity is currently set to "..gravity, playerSource ) end -- attach the 'getGravityLevel' function to the "gravity" command addCommandHandler ( getGravityLevel, "gravity" )
See Also
- areTrafficLightsLocked
- getAircraftMaxHeight
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getInteriorSoundsEnabled
- getJetpackMaxHeight
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getSkyGradient
- getPlayerBlurLevel
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxHeight
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity
- setJetpackMaxHeight
- setPlayerBlurLevel