forked from Mirrorlandia_minetest/emeraldbank
el privilegio de admin para tiendas ya no es server
ahora es admin_shop
This commit is contained in:
parent
46875a8b1d
commit
b14ae5c5f4
10
shop.lua
10
shop.lua
@ -23,6 +23,12 @@ local S = core.get_translator(core.get_current_modname())
|
|||||||
|
|
||||||
local shopcraft = core.settings:get_bool("emeraldbank.shop_craft") or true
|
local shopcraft = core.settings:get_bool("emeraldbank.shop_craft") or true
|
||||||
|
|
||||||
|
-- privilege
|
||||||
|
core.register_privilege("admin_shop", {
|
||||||
|
description = "Permission edit others shops",
|
||||||
|
give_to_singleplayer = false,
|
||||||
|
})
|
||||||
|
|
||||||
local shop_timer = 5
|
local shop_timer = 5
|
||||||
|
|
||||||
local stock_h = 3
|
local stock_h = 3
|
||||||
@ -48,7 +54,7 @@ function emeraldbank.get_shop_fs(pos, clicker)
|
|||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
local player_press_key = clicker:get_player_control().aux1
|
local player_press_key = clicker:get_player_control().aux1
|
||||||
local shop_fs = ""
|
local shop_fs = ""
|
||||||
local is_admin = core.check_player_privs(pname, {server=true})
|
local is_admin = core.check_player_privs(pname, {admin_shop=true})
|
||||||
if (pname == owner or is_admin) and not player_press_key then
|
if (pname == owner or is_admin) and not player_press_key then
|
||||||
shop_fs = "size[9,8.75]"..
|
shop_fs = "size[9,8.75]"..
|
||||||
"label[0,0;"..S("Your stock:").."]"..
|
"label[0,0;"..S("Your stock:").."]"..
|
||||||
@ -169,7 +175,7 @@ core.register_node("emeraldbank:shop", {
|
|||||||
|
|
||||||
can_dig = function(pos, player)
|
can_dig = function(pos, player)
|
||||||
local pname = player:get_player_name()
|
local pname = player:get_player_name()
|
||||||
local is_admin = core.check_player_privs(pname, {server=true})
|
local is_admin = core.check_player_privs(pname, {admin_shop=true})
|
||||||
local meta = core.get_meta(pos)
|
local meta = core.get_meta(pos)
|
||||||
local owner = meta:get_string("owner")
|
local owner = meta:get_string("owner")
|
||||||
local inv = meta:get_inventory()
|
local inv = meta:get_inventory()
|
||||||
|
Loading…
Reference in New Issue
Block a user