diff options
author | TenPlus1 <kinsellaja@yahoo.com> | 2015-11-13 12:10:52 +0000 |
---|---|---|
committer | TenPlus1 <kinsellaja@yahoo.com> | 2015-11-13 12:10:52 +0000 |
commit | 9387e6f0b7a61f21d525d0dc086f69c600aa4fab (patch) | |
tree | f62656f7ec2e471290aa08acf65e372f3977503d /admin.lua | |
parent | fdfec1fd4a6fcb98cbef3b33850082ca5500857e (diff) |
added delprot command to remove protectors in bulk from banned/old players
Diffstat (limited to 'admin.lua')
-rw-r--r-- | admin.lua | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/admin.lua b/admin.lua new file mode 100644 index 0000000..063d5ed --- /dev/null +++ b/admin.lua @@ -0,0 +1,59 @@ + +protector.removal_names = "" + +minetest.register_chatcommand("delprot", { + params = "", + description = "Remove Protectors near players with names provided (separate names with spaces)", + privs = {server = true}, + func = function(name, param) + + if not param or param == "" then + + minetest.chat_send_player(name, + "Protector Names to remove: " + .. protector.removal_names) + + return + end + + if param == "-" then + minetest.chat_send_player(name, + "Name List Reset") + + protector.removal_names = "" + + return + end + + protector.removal_names = param + + end, +}) + +minetest.register_abm({ + nodenames = {"protector:protect", "protector:protect2"}, + interval = 8, + chance = 1, + catch_up = false, + action = function(pos, node) + + if protector.removal_names == "" then + return + end + + local meta = minetest.get_meta(pos) + local owner = meta:get_string("owner") + --local members = meta:get_string("members") + + local names = protector.removal_names:split(" ") + + for _, n in ipairs(names) do + + if n == owner then + minetest.set_node(pos, {name = "air"}) + end + + end + + end +})
\ No newline at end of file |