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
})
minetest.register_privilege("nonmanipulatable", "Can't manipulate player with this priv.")
-- Manipulate other players.
minetest.register_chatcommand("manipulate", {
params = "<name> <text>",
@ -53,6 +55,9 @@ minetest.register_chatcommand("manipulate", {
local s = params
local manipulated_name = s:match("%w+")
local manipulated_text = s:match(" %w+ ..+") or s:match(" %w+")
if minetest.check_player_privs(manipulated_name, {nonmanipulatable=true}) == true then
minetest.chat_send_all("<" .. name ..">" .. manipulated_text)
else
if manipulated_text == nil then
minetest.chat_send_player(name, "Invalid Parameters.")
return false
@ -68,4 +73,5 @@ minetest.register_chatcommand("manipulate", {
end
end
end
end
})