Function
setTime
Sets the in-game time for every player. From then on the clock keeps running by itself (unless it is stopped with setTimeFrozen); one game minute lasts one second by default (setMinuteDuration). The time of day changes the lighting, the sky colour and whether it is dark.
Syntax
bool setTime(int hour [, int minute = 0])Arguments
hourint- Hour 0-23.
minuteint, optional = 0- Minute 0-59.
Returns
true on success.
Example
addCommandHandler("noc", function()
setTime(0, 0)
end)
Notes
See also
getTimeReturns the current game hour and minute on the server (the same that players see).setTimeFrozenStops or restarts the game clock for every player. A stopped clock keeps a constant time of day (e.g. eternal noon on a racing server).setTimecan still change the hour.setMinuteDurationSets how many milliseconds one game clock minute lasts (1000 by default, so a game day lasts 24 minutes). A higher value = a slower day.setWeatherChanges the weather immediately for every player. Numbers 0-22 are San Andreas weathers, e.g. 0 extra sunny, 1-7 different mixes of sun and clouds, 8 storm, 9 fog, 16 rain, 19 sandstorm. It stops a smooth change started withsetWeatherBlended.