diff options
Diffstat (limited to 'builtin/chatcommands.lua')
-rw-r--r-- | builtin/chatcommands.lua | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/builtin/chatcommands.lua b/builtin/chatcommands.lua index b9661a888..66fcab63a 100644 --- a/builtin/chatcommands.lua +++ b/builtin/chatcommands.lua @@ -107,7 +107,7 @@ minetest.register_chatcommand("grant", { description = "Give privilege to player", privs = {}, func = function(name, param) - if not minetest.check_player_privs(name, {privs=true}) and + if not minetest.check_player_privs(name, {privs=true}) and not minetest.check_player_privs(name, {basic_privs=true}) then minetest.chat_send_player(name, "Your privileges are insufficient.") return @@ -153,7 +153,7 @@ minetest.register_chatcommand("revoke", { description = "Remove privilege from player", privs = {}, func = function(name, param) - if not minetest.check_player_privs(name, {privs=true}) and + if not minetest.check_player_privs(name, {privs=true}) and not minetest.check_player_privs(name, {basic_privs=true}) then minetest.chat_send_player(name, "Your privileges are insufficient.") return @@ -670,6 +670,24 @@ minetest.register_chatcommand("unban", { end, }) +minetest.register_chatcommand("kick", { + params = "<name> [reason]", + description = "kick a player", + privs = {kick=true}, + func = function(name, param) + local tokick, reason = string.match(param, "([^ ]+) (.+)") + if not tokick then + tokick = param + end + if not minetest.kick_player(tokick, reason) then + minetest.chat_send_player(name, "Failed to kick player " .. tokick) + else + minetest.chat_send_player(name, "kicked " .. tokick) + minetest.log("action", name .. " kicked " .. tokick) + end + end, +}) + minetest.register_chatcommand("clearobjects", { params = "", description = "clear all objects in world", |