log chat only for those with privilege

This commit is contained in:
Tai @ Flex 2017-03-03 14:13:30 +00:00
parent 57048f621a
commit 20f330cdb5

View File

@ -188,13 +188,13 @@ minetest.register_chatcommand("chatmodes", {
dodebug("Chat interception")
minetest.register_on_chat_message(function(playername, message)
minetest.log("action", "MODAL CHAT: "..message)
if not minetest.get_player_privs(playername, {shout = true}) then
minetest.chat_send_player(playername, "Chat message send failed. You do not have the 'shout' privilege.")
return true
end
minetest.log("action", "MODAL CHAT: "..message)
local targetmode = playermodes[playername]
local modedef = heuristics[ targetmode ]