diff --git a/shop.lua b/shop.lua index 62e602b..443af0f 100644 --- a/shop.lua +++ b/shop.lua @@ -46,7 +46,8 @@ function emeraldbank.get_shop_fs(pos, clicker) local owner = meta:get_string("owner") local player_press_key = clicker:get_player_control().aux1 local shop_fs = "" - if pname == owner and not player_press_key then + local is_admin = core.check_player_privs(pname, {server=true}) + if (pname == owner or is_admin) and not player_press_key then shop_fs = "size[9,8.75]".. "label[0,0;"..S("Your stock:").."]".. "list["..list_name..";stock;0,0.5;"..stock_w..","..stock_h..";]".. @@ -130,8 +131,9 @@ core.register_node("emeraldbank:shop", { end, on_rightclick = function(pos, node, clicker, itemstack) + local pname = clicker:get_player_name() get_stonks(pos, clicker) - core.show_formspec(clicker:get_player_name(), formspec_prefix..core.pos_to_string(pos), emeraldbank.get_shop_fs(pos, clicker) ) + core.show_formspec(pname, formspec_prefix..core.pos_to_string(pos), emeraldbank.get_shop_fs(pos, clicker) ) end, on_punch = function(pos, node, puncher, pointed_thing)