From 9bc4491f2c596caac7cd4449571b681f2a3eacc5 Mon Sep 17 00:00:00 2001 From: olliy <55839810+olliy1or@users.noreply.github.com> Date: Sat, 30 Jan 2021 18:09:22 +0500 Subject: [PATCH] Update init.lua --- mods/other/disallowed_names/init.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/mods/other/disallowed_names/init.lua b/mods/other/disallowed_names/init.lua index 324db77..993ee01 100644 --- a/mods/other/disallowed_names/init.lua +++ b/mods/other/disallowed_names/init.lua @@ -20,32 +20,28 @@ minetest.register_chatcommand("bdname_add", { table.insert(disallowed_names,tostring(param)) minetest.chat_send_player(name, "added "..param.." to the list of banned words") local serial_table = minetest.serialize(disallowed_names) - storage:set_string("disallowed_names", serial_table) - - else + storage:set_string("disallowed_names", serial_table) + else minetest.chat_send_player(name, "You need to add a name\n/bdname_add ") end - end }) - --removes a name from disallowed names minetest.register_chatcommand("bdname_remove",{ description = "removes a name from disallowed names", params = "", privs = {ban=true}, func = function(name, param) - if param ~="" then + if param ~="" then for k in pairs(disallowed_names) do if param == disallowed_names[k] then table.remove(disallowed_names,k) - end + end end storage:set_string("disallowed_names", minetest.serialize(disallowed_names)) end end - }) --list disallowed names