Make the power command explain info better

This commit is contained in:
Coder12a 2018-10-31 23:51:42 -05:00
parent 4a037c538c
commit bc20ea080e
2 changed files with 12 additions and 1 deletions

View File

@ -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.

View File

@ -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)