|
|
@ -37,17 +37,14 @@ minetest.register_chatcommand("creative_region_privs", { |
|
|
|
return false, "Player not found" |
|
|
|
end |
|
|
|
local found, _, region_id, privstring = param:find("^([+-]?%a?%d+)%s*,%s*(.+)$") |
|
|
|
if not found then |
|
|
|
if not found or not region_id or not privstring then |
|
|
|
return false, "Syntax error" |
|
|
|
end |
|
|
|
if privstring and region_id then |
|
|
|
creative_regions:set_region_privs(tostring(region_id), privstring) |
|
|
|
minetest.chat_send_player(name, "[creative_regions] Privstring set for region " .. region_id .. ": " .. privstring) |
|
|
|
creative_regions:save_regions() |
|
|
|
return true, "Done" |
|
|
|
else |
|
|
|
return false, "Failed" |
|
|
|
end |
|
|
|
|
|
|
|
creative_regions:set_region_privs(tostring(region_id), privstring) |
|
|
|
minetest.chat_send_player(name, "[creative_regions] Privstring set for region " .. region_id .. ": " .. privstring) |
|
|
|
creative_regions:save_regions() |
|
|
|
return true, "Done" |
|
|
|
end, |
|
|
|
}) |
|
|
|
|
|
|
@ -61,7 +58,7 @@ minetest.register_chatcommand("creative_region_rm", { |
|
|
|
return false, "Player not found" |
|
|
|
end |
|
|
|
local found, _, region_id = param:find("^([+-]?%d+)%s*$") |
|
|
|
if not found then |
|
|
|
if not found or not region_id then |
|
|
|
return false, "Syntax error" |
|
|
|
end |
|
|
|
local success = creative_regions.astore:remove_area(tonumber(region_id)) |
|
|
@ -69,7 +66,8 @@ minetest.register_chatcommand("creative_region_rm", { |
|
|
|
minetest.chat_send_player(name, "[creative_regions] Region " .. region_id .. "removed") |
|
|
|
creative_regions:set_region_privs(tostring(region_id), nil) |
|
|
|
else |
|
|
|
minetest.chat_send_player(name, "[creative_regions] Error removing region " .. region_id) |
|
|
|
minetest.chat_send_player(name, "Failed to remove region " .. region_id) |
|
|
|
return false, "Region not found" |
|
|
|
end |
|
|
|
creative_regions:save_regions() |
|
|
|
return true, "Done." |
|
|
|