diff options
Diffstat (limited to 'firealarm_pullstation')
-rw-r--r-- | firealarm_pullstation/init.lua | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/firealarm_pullstation/init.lua b/firealarm_pullstation/init.lua index 1d0756b..88ad7ac 100644 --- a/firealarm_pullstation/init.lua +++ b/firealarm_pullstation/init.lua @@ -1,3 +1,8 @@ +minetest.register_privilege("firealarm",{ + description = "Can bypass area protection when pulling fire alarms", + give_to_singleplayer = true, +}) + minetest.register_node(":firealarm:pullstation_off",{ description = "Fire Alarm Pull Station", groups = { oddly_breakable_by_hand = 1 }, @@ -23,6 +28,10 @@ minetest.register_node(":firealarm:pullstation_off",{ minetest.chat_send_player(name,string.format("Position: %d,%d,%d",pos.x,pos.y,pos.z)) end, on_rightclick = function(pos,node,clicker) + if minetest.is_protected(pos,clicker:get_player_name()) and not minetest.check_player_privs(clicker,"protection_bypass") and not minetest.check_player_privs(clicker,"firealarm") then + minetest.record_protection_violation(pos,clicker:get_player_name()) + return + end local devInfo = firealarm.getDevInfo("signaling",pos) if devInfo then devInfo.active = true |