SetMinuteDuration: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
{{Server client function}} | {{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 17: | 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) | |||
setMinuteDuration(60000) | |||
end | end | ||
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), resourceStart) | addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), resourceStart) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</section> | </section> |
Revision as of 12:19, 29 June 2010
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
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", getResourceRootElement(getThisResource()), 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