forked from Mirrorlandia_minetest/emeraldbank
el admin puede cambiar las tiendas de otros
This commit is contained in:
parent
cb6843565d
commit
b7b7db4820
6
shop.lua
6
shop.lua
@ -46,7 +46,8 @@ 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 = ""
|
||||||
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]"..
|
shop_fs = "size[9,8.75]"..
|
||||||
"label[0,0;"..S("Your stock:").."]"..
|
"label[0,0;"..S("Your stock:").."]"..
|
||||||
"list["..list_name..";stock;0,0.5;"..stock_w..","..stock_h..";]"..
|
"list["..list_name..";stock;0,0.5;"..stock_w..","..stock_h..";]"..
|
||||||
@ -130,8 +131,9 @@ core.register_node("emeraldbank:shop", {
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
on_rightclick = function(pos, node, clicker, itemstack)
|
on_rightclick = function(pos, node, clicker, itemstack)
|
||||||
|
local pname = clicker:get_player_name()
|
||||||
get_stonks(pos, clicker)
|
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,
|
end,
|
||||||
|
|
||||||
on_punch = function(pos, node, puncher, pointed_thing)
|
on_punch = function(pos, node, puncher, pointed_thing)
|
||||||
|
Loading…
Reference in New Issue
Block a user