GetTime
From Multi Theft Auto: Wiki
This function is used to get the current time in the game. If you want to get the real server time, use getRealTime.
Syntax
int int getTime ()
Returns
Returns two ints that represent hours and minutes.
Example
These two examples adds the command gettime which outputs the local game time and the server game time.
Click to collapse [-]
Clientfunction currentTime() local timehour, timeminute = getTime() outputChatBox( "The current game time is "..timehour..":"..timeminute ) end addCommandHandler("gettime", currentTime)
Click to collapse [-]
Serverfunction currentTime(sourcePlayer) local timehour, timeminute = getTime() outputChatBox( "The current game time (server) is "..timehour..":"..timeminute, sourcePlayer ) end addCommandHandler("gettime", currentTime)
See Also
- areTrafficLightsLocked
- getAircraftMaxVelocity
- getCloudsEnabled
- getFarClipDistance
- getFogDistance
- getGameSpeed
- getGravity
- getHeatHaze
- getJetpackMaxHeight
- getJetpackWeaponEnabled
- getMinuteDuration
- getMoonSize
- getOcclusionsEnabled
- getRainLevel
- getSkyGradient
- getSunColor
- getSunSize
- getTime
- getTrafficLightState
- getWeather
- getWindVelocity
- getZoneName
- isGarageOpen
- removeWorldModel
- resetFarClipDistance
- resetFogDistance
- resetHeatHaze
- resetMoonSize
- resetRainLevel
- resetSkyGradient
- resetSunColor
- resetSunSize
- resetWindVelocity
- restoreAllWorldModels
- restoreWorldModel
- setAircraftMaxVelocity
- setCloudsEnabled
- setFarClipDistance
- setFogDistance
- setGameSpeed
- setGarageOpen
- setGravity
- setHeatHaze
- setInteriorSoundsEnabled
- setJetpackWeaponEnabled
- setMinuteDuration
- setMoonSize
- setOcclusionsEnabled
- setRainLevel
- setSkyGradient
- setSunColor
- setSunSize
- setTime
- setTrafficLightState
- setTrafficLightsLocked
- setWeather
- setWeatherBlended
- setWindVelocity