From bc20ea080e1646b3862f4389c5b9b3580b044011 Mon Sep 17 00:00:00 2001 From: Coder12a <38924418+Coder12a@users.noreply.github.com> Date: Wed, 31 Oct 2018 23:51:42 -0500 Subject: [PATCH] Make the power command explain info better --- README.md | 2 ++ chatcommands.lua | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c5347c0..1cb33a4 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,8 @@ Player money tax. faction territory titles. +faction territories (Like a faction within a faction) + More claim and unclaim commands. faction access manage command. diff --git a/chatcommands.lua b/chatcommands.lua index 6fa0c83..404854d 100644 --- a/chatcommands.lua +++ b/chatcommands.lua @@ -1119,7 +1119,16 @@ factions.register_command("power", { description = "Display your faction's power", global_privileges = def_global_privileges, on_success = function(player, faction, pos, parcelpos, args) - minetest.chat_send_player(player, "Power: "..faction.power.."/".. faction.usedpower .."/"..faction.maxpower) + local pps = 0 + if factions_config.enable_power_per_player then + local t = faction.onlineplayers + local count = 0 + for _ in pairs(t) do count = count + 1 end + pps = factions_config.power_per_player * count + else + fpps = factions_config.power_per_tick + end + minetest.chat_send_player(player, "Power: "..faction.power.." / "..faction.maxpower - faction.usedpower.."\nPower per "..factions_config.tick_time.." seconds: "..pps.."\nPower per death: -"..factions_config.power_per_death) return true end },false)