Загрузить файлы в «/»
This commit is contained in:
parent
2f80e78d79
commit
4962b31bcc
23
onjoin.lua
Normal file
23
onjoin.lua
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
-- translation
|
||||||
|
local S = mail.S
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
minetest.after(2, function(name)
|
||||||
|
local entry = mail.get_storage_entry(name)
|
||||||
|
local messages = entry.inbox
|
||||||
|
mail.hud_update(name, messages)
|
||||||
|
|
||||||
|
local unreadcount = 0
|
||||||
|
|
||||||
|
for _, message in pairs(messages) do
|
||||||
|
if not message.read then
|
||||||
|
unreadcount = unreadcount + 1
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if unreadcount > 0 and mail.get_setting(name, "onjoin_notifications") then
|
||||||
|
minetest.chat_send_player(name,
|
||||||
|
minetest.colorize(mail.get_color("new"), "(" .. unreadcount .. ") " .. S("You have mail! Type /mail to read")))
|
||||||
|
end
|
||||||
|
end, player:get_player_name())
|
||||||
|
end)
|
Loading…
Reference in New Issue
Block a user