From dc6c86d98c87c8658bd7fbdd46b9557ccf944f79 Mon Sep 17 00:00:00 2001 From: Anand S <36130650+ClobberXD@users.noreply.github.com> Date: Fri, 6 Apr 2018 17:28:31 +0530 Subject: [PATCH] Add highlighted PM messages --- mods/chatplus/init.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/mods/chatplus/init.lua b/mods/chatplus/init.lua index 22e51e6..44e1101 100644 --- a/mods/chatplus/init.lua +++ b/mods/chatplus/init.lua @@ -82,3 +82,24 @@ chatplus.register_handler(function(from,to,msg) end return nil end) + + + +-- +-- Highlighted PMs +-- +minetest.registered_chatcommands["msg"].func = function(name, param) + local sendto, message = param:match("^(%S+)%s(.+)$") + if not sendto then + return false, "Invalid usage, see /help msg." + end + if not core.get_player_by_name(sendto) then + return false, "The player " .. sendto + .. " is not online." + end + core.log("action", "PM from " .. name .. " to " .. sendto + .. ": " .. message) + core.chat_send_player(sendto, minetest.colorize(#00FF55,"PM from " .. name .. ": " + .. message)) + return true, "Message sent." +end