From 10256bc6f2798bfeb975cd6d8d647c634bed6a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D1=80=D1=85=D0=B0=D1=80=D0=B4=20PICCORO=20Len?= =?UTF-8?q?z=20McKAY?= Date: Tue, 25 Jan 2022 18:00:46 -0400 Subject: [PATCH] give to admin automatically by settings --- init.lua | 5 +++++ settingtypes.txt | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/init.lua b/init.lua index 84f6f43..767b8b6 100644 --- a/init.lua +++ b/init.lua @@ -46,6 +46,8 @@ end local kill_hitter = core.settings:get_bool("pvpinvul_kill_hitter") or false +local admin_privs = core.settings:get_bool("pvpinvul_admin_privs") or true + -- compat with irc mod fork if core.get_modpath("irc") then if irc.saysec == nil then @@ -57,6 +59,9 @@ end core.register_privilege("pvpinvul", { description = S("Invulnerable in PVP"), give_to_singleplayer = false + if admin_privs then + give_to_admin = true + end }) diff --git a/settingtypes.txt b/settingtypes.txt index 0d940ef..2370d16 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -1,3 +1,7 @@ # if enabled will Kill with one hit only when pvpinvul are grant pvpinvul_kill_hitter (Kill hitter to pvpinvul privilegies) bool false + +# if enable admin will be pvp invulnerable +pvpinvul_admin_privs (Give automatically to admins pvp ivul privs) bool true +