RU/setTime

From Multi Theft Auto: Wiki
Revision as of 18:00, 7 March 2010 by PoliticalOrel (talk | contribs) (Created page with '__NOTOC__ {{RU/Server client function}} This function sets the current GTA time to the given time. ==Использование== <section name="Server and Client" class="both" …')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

Использование

Click to collapse [-]
Server and Client
bool setTime ( int hour, int minute )

Необходимые параметры

  • hour: The hour of the new time (range 0-23).
  • minute: The minute of the new time (range 0-59).

Что возвращается

Returns true if the new time was successfully set, false otherwise.

Пример

This serverside function sets the time and notifies players.

Click to collapse [-]
Server
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

Смотри также