From f46a279600c5fe5a6a23ad5b33a0504d9868fd15 Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Fri, 9 Sep 2016 11:42:22 -0400 Subject: Show areas in chat /pvp_areas without arguments lists areas to chat. --- init.lua | 11 +++++------ 1 file 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 }) -- cgit v1.2.3