SetMinuteDuration: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(Replace to predefined variables.) |
||
(6 intermediate revisions by 6 users not shown) | |||
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"> | <section class="server" name="Server" show="true"> | ||
<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> | </section> | ||
Line 58: | Line 30: | ||
==See Also== | ==See Also== | ||
{{World_functions}} | {{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