|
|
@ -17,7 +17,7 @@ if minetest.get_modpath("areas") then |
|
|
|
end |
|
|
|
|
|
|
|
if player_owns_id then |
|
|
|
meta:set_string("infotext", string.format("No-Fly-Zone Protector for area %s owned by %s", player_owns_id, name) |
|
|
|
meta:set_string("infotext", string.format("No-Fly-Zone Protector for area %s owned by %s", player_owns_id, name)) |
|
|
|
meta:set_string("area_id", player_owns_id) |
|
|
|
meta:set_string("owner", name) |
|
|
|
|
|
|
@ -25,6 +25,7 @@ if minetest.get_modpath("areas") then |
|
|
|
minetest.chat_send_player(name, "[creative_regions] No-Fly-Zone set for region " .. player_owns_id) |
|
|
|
creative_regions.save_regions() |
|
|
|
else |
|
|
|
minetest.chat_send_player(name, "[creative_regions] You need to be inside an area to set a No-Fly-Zone") |
|
|
|
minetest.after(0.2, function(pos) |
|
|
|
minetest.remove_node(pos) |
|
|
|
end, pos) |
|
|
@ -40,9 +41,13 @@ if minetest.get_modpath("areas") then |
|
|
|
local meta = minetest.get_meta(pos) |
|
|
|
local id = meta:get_string("area_id") |
|
|
|
local owner = meta:get_string("owner") |
|
|
|
|
|
|
|
local player_owns_id = nil |
|
|
|
|
|
|
|
-- allow for players with areas privilege |
|
|
|
if minetest.check_player_privs(name, { areas=true }) then |
|
|
|
return true |
|
|
|
end |
|
|
|
|
|
|
|
local current_areas = areas:getAreasAtPos(pos) |
|
|
|
for areas_id, areas_area in pairs( current_areas ) do |
|
|
|
if areas_area.owner == name then |
|
|
|