1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-17 07:50:29 +01:00
server-nalc/mods/_misc/chatlog.lua

15 lines
443 B
Lua
Raw Normal View History

2014-10-28 18:01:32 +01:00
local chatlog = minetest.get_worldpath().."/chatlog.txt"
monthfirst = true -- Wheter the 1st of Feb should be 1/2/13(monthfirst = true) or 2/1/13(monthfirst = false)
function playerspeak(name,msg)
f = io.open(chatlog, "a")
if monthfirst then
f:write(os.date("(%m/%d/%y %X) ["..name.."]: "..msg.."\n"))
else
f:write(os.date("(%d/%m/%y %X) ["..name.."]: "..msg.."\n"))
end
f:close()
end
minetest.register_on_chat_message(playerspeak)