Add vote_kick privilege to grant access to kick voting
This commit is contained in:
parent
def3b99150
commit
2ae45bba97
1 changed files with 5 additions and 3 deletions
|
@ -227,12 +227,10 @@ minetest.after(5, vote.update_all_hud)
|
||||||
|
|
||||||
minetest.register_privilege("vote", {
|
minetest.register_privilege("vote", {
|
||||||
description = "Can vote on issues",
|
description = "Can vote on issues",
|
||||||
basic_priv = true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_privilege("vote_starter", {
|
minetest.register_privilege("vote_starter", {
|
||||||
description = "Can start votes on issues",
|
description = "Can start votes on issues",
|
||||||
basic_priv = true
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("yes", {
|
minetest.register_chatcommand("yes", {
|
||||||
|
@ -311,10 +309,14 @@ minetest.register_chatcommand("abstain", {
|
||||||
|
|
||||||
local set = minetest.setting_get("vote.kick_vote")
|
local set = minetest.setting_get("vote.kick_vote")
|
||||||
if set == nil or minetest.is_yes(set) then
|
if set == nil or minetest.is_yes(set) then
|
||||||
|
minetest.register_privilege("vote_kick", {
|
||||||
|
description = "Can (start) vote to kick a player",
|
||||||
|
})
|
||||||
|
|
||||||
minetest.register_chatcommand("vote_kick", {
|
minetest.register_chatcommand("vote_kick", {
|
||||||
privs = {
|
privs = {
|
||||||
interact = true,
|
interact = true,
|
||||||
vote_starter = true
|
vote_kick = true,
|
||||||
},
|
},
|
||||||
func = function(name, param)
|
func = function(name, param)
|
||||||
if not minetest.get_player_by_name(param) then
|
if not minetest.get_player_by_name(param) then
|
||||||
|
|
Loading…
Reference in a new issue