mirror of
https://github.com/mt-mods/mail.git
synced 2025-07-04 21:50:28 -04:00
separated from webmail mod
This commit is contained in:
commit
ca88374fbd
19 changed files with 941 additions and 0 deletions
19
onjoin.lua
Normal file
19
onjoin.lua
Normal file
|
@ -0,0 +1,19 @@
|
|||
minetest.register_on_joinplayer(function(player)
|
||||
minetest.after(2, function(name)
|
||||
local messages = mail.getMessages(name)
|
||||
|
||||
local unreadcount = 0
|
||||
|
||||
for _, message in pairs(messages) do
|
||||
if message.unread then
|
||||
unreadcount = unreadcount + 1
|
||||
end
|
||||
end
|
||||
|
||||
if unreadcount > 0 then
|
||||
minetest.chat_send_player(name,
|
||||
"(" .. unreadcount .. ") You have mail! Type /mail to read")
|
||||
|
||||
end
|
||||
end, player:get_player_name())
|
||||
end)
|
Loading…
Add table
Add a link
Reference in a new issue