mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Builtin: Add basic_privs setting
This commit is contained in:
parent
30083d1e00
commit
17bfe2fe5b
4 changed files with 14 additions and 3 deletions
|
@ -181,8 +181,10 @@ core.register_chatcommand("grant", {
|
|||
end
|
||||
local privs = core.get_player_privs(grantname)
|
||||
local privs_unknown = ""
|
||||
local basic_privs =
|
||||
core.string_to_privs(core.setting_get("basic_privs") or "interact,shout")
|
||||
for priv, _ in pairs(grantprivs) do
|
||||
if priv ~= "interact" and priv ~= "shout" and
|
||||
if not basic_privs[priv] and
|
||||
not core.check_player_privs(name, {privs=true}) then
|
||||
return false, "Your privileges are insufficient."
|
||||
end
|
||||
|
@ -223,8 +225,10 @@ core.register_chatcommand("revoke", {
|
|||
end
|
||||
local revoke_privs = core.string_to_privs(revoke_priv_str)
|
||||
local privs = core.get_player_privs(revoke_name)
|
||||
local basic_privs =
|
||||
core.string_to_privs(core.setting_get("basic_privs") or "interact,shout")
|
||||
for priv, _ in pairs(revoke_privs) do
|
||||
if priv ~= "interact" and priv ~= "shout" and
|
||||
if not basic_privs[priv] and
|
||||
not core.check_player_privs(name, {privs=true}) then
|
||||
return false, "Your privileges are insufficient."
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue