init.lua 525 B

12345678910111213141516171819202122
  1. if not minetest.global_exists("echo") then echo = {} end
  2. echo.modpath = minetest.get_modpath("echo")
  3. minetest.register_privilege("echo", {
  4. description = "Allows the player to send server chat messages.",
  5. give_to_singleplayer = false,
  6. })
  7. minetest.register_chatcommand("echo", {
  8. params = "<message>",
  9. description = "Send a message to all players as if it came from the server itself.",
  10. privs = {shout=true, echo=true},
  11. func = function(name, param)
  12. minetest.chat_send_all("# Server: " .. param)
  13. end,
  14. })