mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-09 12:00:17 +01:00
debug et amélioration de future_ban
debug d'une mauvaise variable ajout d'une vérification pour éviter de rebannir un joueur déja banni
This commit is contained in:
parent
a8f0d53873
commit
7e58605553
|
@ -26,6 +26,12 @@ minetest.register_chatcommand("future_ban", {
|
|||
minetest.chat_send_player(name, "Future ban list: " .. dump(future_ban_list))
|
||||
return
|
||||
end
|
||||
for _,n in ipairs(future_ban_list) do
|
||||
if n == param then
|
||||
minetest.chat_send_player(name, param .. " is already in future ban list.")
|
||||
return
|
||||
end
|
||||
end
|
||||
if not minetest.get_player_by_name(param) then
|
||||
table.insert(future_ban_list, param)
|
||||
minetest.chat_send_player(name, param .. " to future ban list added.")
|
||||
|
@ -35,8 +41,8 @@ minetest.register_chatcommand("future_ban", {
|
|||
end
|
||||
if not minetest.ban_player(param) then
|
||||
table.insert(future_ban_list, param)
|
||||
minetest.chat_send_player(name, desc .. " to future ban list added.")
|
||||
minetest.log("action", name .. " added " .. desc .. " to future ban list.")
|
||||
minetest.chat_send_player(name, param .. " to future ban list added.")
|
||||
minetest.log("action", name .. " added " .. param .. " to future ban list.")
|
||||
save_file()
|
||||
else
|
||||
local desc = minetest.get_ban_description(param)
|
||||
|
|
Loading…
Reference in New Issue
Block a user