mirror of
https://gitlab.com/4w/mtimer.git
synced 2024-11-25 00:33:47 +01:00
89cd1f6212
Convert ingame time to millihours and calculate the timestamp from this. It results in a default timestampo that is parsed by default date and time functions. Replacement variables: {24h} = 24 hours time {12h} = 12 hours time {min} = minutes {its} = ingame timestamp For some reason I was not able to get the am/pm indicator (`%p`) so 12 hours format is only the time and no optional indicator.
11 lines
325 B
Lua
11 lines
325 B
Lua
local m = mtimer
|
|
|
|
minetest.register_on_joinplayer(function(player)
|
|
local meta = player:get_meta()
|
|
for _,def in pairs(m.meta) do
|
|
local current = meta:get_string(def.key)
|
|
if current == '' then meta:set_string(def.key, def.default) end
|
|
end
|
|
meta:set_string('mtimer:session_start', os.time())
|
|
end)
|