Hooks called by Game Time

Summary

Hooks

Called on the server and the client when a new day of the game calendar has begun, after GameHourPassed.
Called on the server and the client when a new hour of the game clock has begun, after GameMinutePassed.
Called on the server and the client when a new minute of the game clock has begun.
Called on the server and the client when a new month of the game calendar has begun, after GameDayPassed.
Called on the client when the server has set the game clock to another moment, after the new clock has arrived.
Called on the server and the client when a new year of the game calendar has begun, after GameMonthPassed.
Asks whether the game date and time may be shown to the local player.

Hooks

GameDayPassed(current, previous)

shared plugins/gametime/plugin/sh_plugin.lua:543

Called on the server and the client when a new day of the game calendar has begun, after GameHourPassed. Runs once even if several game days have gone by since the previous check of the clock. Not called when the clock is set to another moment.

Parameters

  • current Map The date at the start of the minute that has begun, as returned by GameTime:get_date
  • previous Map The date at the start of the minute the clock was in at the previous check

Called from

Call sites

GameHourPassed(current, previous)

shared plugins/gametime/plugin/sh_plugin.lua:532

Called on the server and the client when a new hour of the game clock has begun, after GameMinutePassed. Runs once even if several game hours have gone by since the previous check of the clock. Not called when the clock is set to another moment.

Parameters

  • current Map The date at the start of the minute that has begun, as returned by GameTime:get_date; its minute is 0 unless more than an hour has gone by at once
  • previous Map The date at the start of the minute the clock was in at the previous check

Called from

Call sites

GameMinutePassed(current, previous)

shared plugins/gametime/plugin/sh_plugin.lua:522

Called on the server and the client when a new minute of the game clock has begun. The clock is checked eight times a second, and the hook runs once per check even if several game minutes have gone by since the last one, which happens when a game minute is shorter than that or when the clock follows the real time and the server has been hibernating. Not called when the clock is set to another moment: see GameTimeSet.

Parameters

  • current Map The date at the start of the minute that has begun, as returned by GameTime:get_date
  • previous Map The date at the start of the minute the clock was in at the previous check

Called from

Call sites

GameMonthPassed(current, previous)

shared plugins/gametime/plugin/sh_plugin.lua:554

Called on the server and the client when a new month of the game calendar has begun, after GameDayPassed. Runs once even if several game months have gone by since the previous check of the clock. Not called when the clock is set to another moment.

Parameters

  • current Map The date at the start of the minute that has begun, as returned by GameTime:get_date
  • previous Map The date at the start of the minute the clock was in at the previous check

Called from

Call sites

GameTimeSet(timestamp, self:read_clock(old_value))

shared plugins/gametime/plugin/cl_hooks.lua:66

Called on the client when the server has set the game clock to another moment, after the new clock has arrived. This is the client-side run of the hook that the server runs when it sets the clock. The rollover hooks carry on from the new time.

Parameters

  • timestamp Number The game time the clock has been set to, in game seconds since midnight of 1 January 1970
  • old_timestamp Number The game time the clock showed before it was set

Called from

Call sites

GameYearPassed(current, previous)

shared plugins/gametime/plugin/sh_plugin.lua:565

Called on the server and the client when a new year of the game calendar has begun, after GameMonthPassed. Runs once even if several game years have gone by since the previous check of the clock. Not called when the clock is set to another moment.

Parameters

  • current Map The date at the start of the minute that has begun, as returned by GameTime:get_date
  • previous Map The date at the start of the minute the clock was in at the previous check

Called from

Call sites

ShouldDrawGameTime()

client plugins/gametime/plugin/cl_hooks.lua:42

Asks whether the game date and time may be shown to the local player. Called on the client every frame while the tab menu is open, before its clock is drawn. A schema can use it to keep the time from characters that have no way of knowing it.

Returns

  • Boolean Return false to hide the clock

Called from

Call sites

Defined in