Update stats command.

This commit is contained in:
Coder12a 2018-11-01 00:22:39 -05:00
parent 186bcfd6ed
commit c47102ca8a
2 changed files with 14 additions and 1 deletions

View File

@ -17,6 +17,10 @@ faction territory titles.
faction territories (Like a faction within a faction)
faction color.
Color tags based on faction color(add support for entity tag mods).
More claim and unclaim commands.
faction access manage command.

View File

@ -1315,7 +1315,16 @@ factions.register_command("stats", {
format = {"faction"},
on_success = function(player, faction, pos, parcelpos, args)
local f = args.factions[1]
minetest.chat_send_player(player, "Power: "..f.power.."/"..f.maxpower - f.usedpower.."/"..f.maxpower)
local pps = 0
if factions_config.enable_power_per_player then
local t = f.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: "..f.power.." / "..f.maxpower - f.usedpower.."\nPower per "..factions_config.tick_time.." seconds: "..pps.."\nPower per death: -"..factions_config.power_per_death)
return true
end
},false)