Page 1 of 1
Send Chat to Player Who Has Just Joined

Posted:
Fri Apr 19, 2013 21:15
by davegoopot
The wiki says that you can't use minetest.chat_send_player() to send a message to a player who has just joined by registering to minetest.register_on_joinplayer. [1]
My question is: so how can you send a message to a player who has just joined?
[1]
http://dev.minetest.net/minetest.register_on_joinplayerThanks,
Dave.

Posted:
Fri Apr 19, 2013 21:55
by PilzAdam
Minimal uses minetest.after(2) to do that.

Posted:
Fri Apr 19, 2013 21:56
by Traxie21
the issue is that the player joins before his client has fully loaded, meaning he dosn't see the message. You could try minetest.after, but thats hacky, at best.

Posted:
Sat Apr 20, 2013 08:28
by davegoopot
Thanks. I've got something to work using minetest.after. It is a little hacky as you say. Is there an argument for adding another hook that you can register? Something like minetest.minetest.register_on_newplayerready ?
Dave.

Posted:
Sat Apr 20, 2013 13:34
by Traxie21
I wish, but there's nothing sent to the server once the client is fully ready afaik. You could check for any keypress once the client loads though, or detect changes in the player's look direction.