MOTD doesn't display at client side

Marshall_maz
Member
 
Posts: 240
Joined: Mon Jul 14, 2014 17:13
In-game: Mazal

MOTD doesn't display at client side

by Marshall_maz » Sun Jul 20, 2014 15:53

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
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

Re: MOTD doesn't display at client side

by rubenwardy » Sun Jul 20, 2014 16:29

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)
 

Marshall_maz
Member
 
Posts: 240
Joined: Mon Jul 14, 2014 17:13
In-game: Mazal

Re: MOTD doesn't display at client side

by Marshall_maz » Sun Jul 20, 2014 18:46

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
 


Return to Minetest Servers

Who is online

Users browsing this forum: No registered users and 42 guests