mirror of
https://github.com/minetest-mods/filter.git
synced 2025-04-30 05:41:45 -04:00
priv check before unmuting
Only unmutes a player if their shout priv hasn't been granted already
This commit is contained in:
parent
53312940c0
commit
66c61c8e6c
1 changed files with 6 additions and 5 deletions
11
init.lua
11
init.lua
|
@ -78,11 +78,12 @@ function filter.mute(name, duration)
|
|||
|
||||
minetest.after(duration * 60, function()
|
||||
muted[name] = nil
|
||||
minetest.chat_send_player(name, "Chat privilege reinstated. Please do not abuse chat.")
|
||||
|
||||
local privs = minetest.get_player_privs(name)
|
||||
privs.shout = true
|
||||
minetest.set_player_privs(name, privs)
|
||||
local privs = minetest.get_player_privs(name)
|
||||
if privs.shout == false then
|
||||
minetest.chat_send_player(name, "Chat privilege reinstated. Please do not abuse chat.")
|
||||
privs.shout = true
|
||||
minetest.set_player_privs(name, privs)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue