mirror of
https://github.com/mt-mods/playerfactions.git
synced 2024-11-29 10:43:50 +01:00
add local is_admin
stash commit...
This commit is contained in:
parent
f021427f04
commit
978861ae3e
3
init.lua
3
init.lua
@ -203,6 +203,7 @@ local function handle_command(name, param)
|
||||
for p in string.gmatch(param, "[^%s]+") do
|
||||
table.insert(params, p)
|
||||
end
|
||||
local is_admin = minetest.get_player_privs(name)[factions.priv]
|
||||
local action = params[1]
|
||||
if action == "create" then
|
||||
local faction_name = params[2]
|
||||
@ -243,8 +244,8 @@ local function handle_command(name, param)
|
||||
table.concat(own_factions, ", ")
|
||||
)
|
||||
elseif not facts[faction_name] then
|
||||
elseif name ~= factions.get_owner(faction_name) and not minetest.get_player_privs(name)[factions.priv] then
|
||||
return false, S("Faction @1 doesn't exist.", faction_name)
|
||||
elseif name ~= factions.get_owner(faction_name) and not is_admin then
|
||||
return false, S("Permission denied: You are not the owner of that faction, " ..
|
||||
"and don't have the @1 privilege.", factions.priv)
|
||||
elseif not factions.valid_password(faction_name, password) then
|
||||
|
Loading…
Reference in New Issue
Block a user