SetGameSpeed: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
|||
(13 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | |||
This function sets the game speed to the given value | This function sets the game speed to the given value. | ||
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="lua">setGameSpeed ( | <syntaxhighlight lang="lua">bool setGameSpeed ( float value )</syntaxhighlight> | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''value''': The | *'''value''': The float value of the game speed (Range 0 - 10) | ||
===Returns=== | |||
Returns ''true'' if the gamespeed was set successfully, ''false'' otherwise. | |||
The normal game speed is '1'. | |||
==Example== | ==Example== | ||
<syntaxhighlight lang="lua">addCommandHandler ( "setgamespeed", " | <section name="Server" class="server" show="true"> | ||
function | <syntaxhighlight lang="lua"> | ||
setGameSpeed ( tonumber ( value ) ) | addCommandHandler("setgamespeed", | ||
end</syntaxhighlight> | function(sourcePlayer, command, value) | ||
setGameSpeed(tonumber(value)) | |||
end | |||
) | |||
</syntaxhighlight> | |||
</section> | |||
<section name="Client" class="client" show="true"> | |||
<syntaxhighlight lang="lua"> | |||
addCommandHandler("setgamespeed", | |||
function(command, value) | |||
setGameSpeed(tonumber(value)) | |||
end | |||
) | |||
</syntaxhighlight> | |||
</section> | |||
==See Also== | ==See Also== | ||
{{World functions}} | {{World functions}} | ||
[[ru:setGameSpeed]] |
Latest revision as of 18:43, 16 November 2011
This function sets the game speed to the given value.
Syntax
bool setGameSpeed ( float value )
Required Arguments
- value: The float value of the game speed (Range 0 - 10)
Returns
Returns true if the gamespeed was set successfully, false otherwise. The normal game speed is '1'.
Example
Click to collapse [-]
ServeraddCommandHandler("setgamespeed", function(sourcePlayer, command, value) setGameSpeed(tonumber(value)) end )
Click to collapse [-]
ClientaddCommandHandler("setgamespeed", function(command, value) setGameSpeed(tonumber(value)) end )
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