Update init.lua
This commit is contained in:
parent
e91b7c0521
commit
9bc4491f2c
1 changed files with 4 additions and 8 deletions
|
@ -20,32 +20,28 @@ minetest.register_chatcommand("bdname_add", {
|
||||||
table.insert(disallowed_names,tostring(param))
|
table.insert(disallowed_names,tostring(param))
|
||||||
minetest.chat_send_player(name, "added "..param.." to the list of banned words")
|
minetest.chat_send_player(name, "added "..param.." to the list of banned words")
|
||||||
local serial_table = minetest.serialize(disallowed_names)
|
local serial_table = minetest.serialize(disallowed_names)
|
||||||
storage:set_string("disallowed_names", serial_table)
|
storage:set_string("disallowed_names", serial_table)
|
||||||
|
else
|
||||||
else
|
|
||||||
minetest.chat_send_player(name, "You need to add a name\n/bdname_add <name>")
|
minetest.chat_send_player(name, "You need to add a name\n/bdname_add <name>")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
--removes a name from disallowed names
|
--removes a name from disallowed names
|
||||||
minetest.register_chatcommand("bdname_remove",{
|
minetest.register_chatcommand("bdname_remove",{
|
||||||
description = "removes a name from disallowed names",
|
description = "removes a name from disallowed names",
|
||||||
params = "<name>",
|
params = "<name>",
|
||||||
privs = {ban=true},
|
privs = {ban=true},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if param ~="" then
|
if param ~="" then
|
||||||
for k in pairs(disallowed_names) do
|
for k in pairs(disallowed_names) do
|
||||||
if param == disallowed_names[k] then
|
if param == disallowed_names[k] then
|
||||||
table.remove(disallowed_names,k)
|
table.remove(disallowed_names,k)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
storage:set_string("disallowed_names", minetest.serialize(disallowed_names))
|
storage:set_string("disallowed_names", minetest.serialize(disallowed_names))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
--list disallowed names
|
--list disallowed names
|
||||||
|
|
Loading…
Reference in a new issue