GetGameSpeed: Difference between revisions
Jump to navigation
Jump to search
m (→Syntax) |
Dutchman101 (talk | contribs) (Fixed function name; including the typo it had, this example code didn't even work: outputChatbox doesnt exist, outputChatBox does.) |
||
(5 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
{{Server client function}} | |||
__NOTOC__ | __NOTOC__ | ||
This function gets the current game speed value. | |||
This function | |||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">getGameSpeed()</syntaxhighlight> | <syntaxhighlight lang="lua">float getGameSpeed ( )</syntaxhighlight> | ||
===Returns=== | |||
Returns a ''float'' representing the speed of the game. | |||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua"> | <section name="Server and Client" class="both" show="true"> | ||
function | This example adds a 'gamespeed' console command that prints the game speed to the chatbox. | ||
local speed = getGameSpeed () | <syntaxhighlight lang="lua"> | ||
function gameSpeedValue( ) | |||
end</syntaxhighlight> | local speed = getGameSpeed( ) | ||
outputChatBox( "Game speed is currently set to " .. speed .. "." ) | |||
end | |||
addCommandHandler( "gamespeed", gameSpeedValue ) | |||
</syntaxhighlight> | |||
</section> | |||
==See Also== | ==See Also== | ||
{{World functions}} | {{World functions}} | ||
[[ru:getGameSpeed]] |
Latest revision as of 22:13, 10 January 2015
This function gets the current game speed value.
Syntax
float getGameSpeed ( )
Returns
Returns a float representing the speed of the game.
Example
Click to collapse [-]
Server and ClientThis example adds a 'gamespeed' console command that prints the game speed to the chatbox.
function gameSpeedValue( ) local speed = getGameSpeed( ) outputChatBox( "Game speed is currently set to " .. speed .. "." ) end addCommandHandler( "gamespeed", gameSpeedValue )
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