setTime | Multi Theft Auto: Wiki Skip to content

setTime

Client-side
Server-side
Shared

This page is incomplete! Help wanted!

Please finish this page using the corresponding Old Wiki article.
Go to Contribution guidelines for more information.


This function sets the current GTA time to the given time.

Syntax

setTime ( )

Code Examples

server

This serverside function sets the time and notifies players.

function setTimeAndNotify( hour, minute )
-- set the time first
setTime ( hour, minute )
-- format a notification message, adding leading zeros (e.g. 12:03 instead of 12:3)
local notifyMessage = string.format("Time changed to %02d:%02d!", hour, minute)
-- output the message
outputChatBox ( notifyMessage )
end

See Also

World Functions