Page 1 of 1

MOTD doesn't display at client side

PostPosted: Sun Jul 20, 2014 15:53
by Marshall_maz
Hi guys ,

I added a MOTD in my server's minetest.conf , but it doesn't display at the client side when a player connects.
When the player hits F10 to get the console the MOTD is there. But none of my clients ever use F10.

How can I set it that the MOTD shows automatically on-screen when a player connects ?

Thanx

Re: MOTD doesn't display at client side

PostPosted: Sun Jul 20, 2014 16:29
by rubenwardy
Seems to be a problem with long connecting times.

Create a folder in mods/, and name it what ever you like. I suggest calling it delayed_motd.
Create a init.lua file inside, and insert this content:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_on_joinplayer(function(player)
    local name = player:get_player_name()
    if name then
        minetest.after(10, function()
            minetest.chat_send_player(name, minetest.setting_get("motd"), false)
        end)
    end
end)

Re: MOTD doesn't display at client side

PostPosted: Sun Jul 20, 2014 18:46
by Marshall_maz
rubenwardy wrote:Seems to be a problem with long connecting times.

Create a folder in mods/, and name it what ever you like. I suggest calling it delayed_motd.
Create a init.lua file inside, and insert this content:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.register_on_joinplayer(function(player)
    local name = player:get_player_name()
    if name then
        minetest.after(10, function()
            minetest.chat_send_player(name, minetest.setting_get("motd"), false)
        end)
    end
end)


Works perfect , thank you