SetMinuteDuration: Difference between revisions
Jump to navigation
Jump to search
(New page: __NOTOC__ {{Client function}} Sets the real-world duration of an ingame minute. The GTA default is 1000. ==Syntax== <syntaxhighlight lang="lua"> bool setMinuteDuration ( int milliseconds ) </syntaxhighlight> ===Req...) |
(Replace to predefined variables.) |
||
(7 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{ | {{Server client function}} | ||
Sets the real-world duration of an ingame minute. The GTA default is 1000. | Sets the real-world duration of an ingame minute. The GTA default is 1000. | ||
Line 9: | Line 9: | ||
===Required Arguments=== | ===Required Arguments=== | ||
*'''milliseconds''': the new duration of an ingame minute | *'''milliseconds''': the new duration of an ingame minute, accepted values 0 - 2147483647. | ||
===Returns=== | ===Returns=== | ||
Line 16: | Line 16: | ||
==Example== | ==Example== | ||
This example will make the ingame time correspond to the real-world time of the server. | This example will make the ingame time correspond to the real-world time of the server. | ||
<section class="server" name="Server" show="true"> | |||
Server | |||
<syntaxhighlight lang="lua"> | <syntaxhighlight lang="lua"> | ||
function | function resourceStart() | ||
local realtime = getRealTime() | local realtime = getRealTime() | ||
setTime(realtime.hour, realtime.minute) | |||
setTime( | |||
setMinuteDuration(60000) | setMinuteDuration(60000) | ||
end | end | ||
addEventHandler("onResourceStart", resourceRoot, resourceStart) | |||
addEventHandler(" | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | |||
==See Also== | ==See Also== | ||
{{ | {{World_functions}} | ||
[[ru:setMinuteDuration]] |
Latest revision as of 23:14, 11 January 2023
Sets the real-world duration of an ingame minute. The GTA default is 1000.
Syntax
bool setMinuteDuration ( int milliseconds )
Required Arguments
- milliseconds: the new duration of an ingame minute, accepted values 0 - 2147483647.
Returns
Returns true if successful, false otherwise.
Example
This example will make the ingame time correspond to the real-world time of the server.
Click to collapse [-]
Serverfunction resourceStart() local realtime = getRealTime() setTime(realtime.hour, realtime.minute) setMinuteDuration(60000) end addEventHandler("onResourceStart", resourceRoot, resourceStart)
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