From e73b8b47dcaf5c5d2f5ea5ebe7990eab2934e687 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 7 Dec 2015 22:51:51 +0000 Subject: [PATCH] Add vote_admin --- mods/vote/init.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mods/vote/init.lua b/mods/vote/init.lua index 7709c65..9659273 100644 --- a/mods/vote/init.lua +++ b/mods/vote/init.lua @@ -139,6 +139,21 @@ function vote.vote(voteset, name, value) vote.check_vote(voteset) end +minetest.register_privilege("vote_admin", { + description = "Allows a player to manage running votes." +}) + +minetest.register_chatcommand("vote_clear", { + privs = { + vote_admin = true, + }, + func = function(name, params) + vote.active = {} + vote.queue = {} + vote.update_all_hud() + end +}) + local hudkit = dofile(minetest.get_modpath("vote") .. "/hudkit.lua") vote.hud = hudkit() function vote.update_hud(player)