This commit is contained in:
Tmanyo 2016-12-06 21:33:07 -05:00 committed by GitHub
parent e11f744913
commit 08c1b65022

View File

@ -44,6 +44,8 @@ minetest.register_chatcommand("reboot", {
end end
}) })
minetest.register_privilege("nonmanipulatable", "Can't manipulate player with this priv.")
-- Manipulate other players. -- Manipulate other players.
minetest.register_chatcommand("manipulate", { minetest.register_chatcommand("manipulate", {
params = "<name> <text>", params = "<name> <text>",
@ -53,16 +55,20 @@ minetest.register_chatcommand("manipulate", {
local s = params local s = params
local manipulated_name = s:match("%w+") local manipulated_name = s:match("%w+")
local manipulated_text = s:match(" %w+ ..+") or s:match(" %w+") local manipulated_text = s:match(" %w+ ..+") or s:match(" %w+")
if manipulated_text == nil then if minetest.check_player_privs(manipulated_name, {nonmanipulatable=true}) == true then
minetest.chat_send_player(name, "Invalid Parameters.") minetest.chat_send_all("<" .. name ..">" .. manipulated_text)
return false
else else
if minetest.check_player_privs(name, {server=true}) == true then if manipulated_text == nil then
minetest.chat_send_all("<" .. manipulated_name .. ">" .. manipulated_text) minetest.chat_send_player(name, "Invalid Parameters.")
end return false
if minetest.get_modpath("irc") then else
if irc.connected and irc.config.send_join_part then if minetest.check_player_privs(name, {server=true}) == true then
irc:say("<" .. manipulated_name .. ">" .. manipulated_text) minetest.chat_send_all("<" .. manipulated_name .. ">" .. manipulated_text)
end
if minetest.get_modpath("irc") then
if irc.connected and irc.config.send_join_part then
irc:say("<" .. manipulated_name .. ">" .. manipulated_text)
end
end end
end end
end end