summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Stevenson <everamzah@gmail.com>2016-09-09 11:42:22 -0400
committerJames Stevenson <everamzah@gmail.com>2016-09-09 11:42:22 -0400
commitf46a279600c5fe5a6a23ad5b33a0504d9868fd15 (patch)
treeb7051e63da774f0f503bd276fc33eb22fabcaf20
parent877ef09eedba7663b2c8e5be1e017499a6ffd5c0 (diff)
Show areas in chat
/pvp_areas without arguments lists areas to chat.
-rw-r--r--init.lua11
1 files changed, 5 insertions, 6 deletions
diff --git a/init.lua b/init.lua
index 9c6268e..3fec4d5 100644
--- a/init.lua
+++ b/init.lua
@@ -84,13 +84,12 @@ minetest.register_chatcommand("pvp_areas", {
elseif param ~= "" then
minetest.chat_send_player(name, "Invalid usage. Type \"/help pvp_areas\" for more information.")
else
- minetest.chat_send_player(name, "Listing information to STDOUT.")
- print()
- print("---")
- for i = 0, #pvp_areas - 1 do
- print(dump(pvp_areas_store:get_area(i)))
+ for k, v in pairs(pvp_areas) do
+ local id = k - 1
+ local min = v.min
+ local max = v.max
+ minetest.chat_send_player(name, id .. ": " .. minetest.pos_to_string(min) .. " " .. minetest.pos_to_string(max))
end
- print()
end
end
})