forked from mtcontrib/factions
Update stats command.
This commit is contained in:
parent
186bcfd6ed
commit
c47102ca8a
@ -17,6 +17,10 @@ faction territory titles.
|
|||||||
|
|
||||||
faction territories (Like a faction within a faction)
|
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.
|
More claim and unclaim commands.
|
||||||
|
|
||||||
faction access manage command.
|
faction access manage command.
|
||||||
|
@ -1315,7 +1315,16 @@ factions.register_command("stats", {
|
|||||||
format = {"faction"},
|
format = {"faction"},
|
||||||
on_success = function(player, faction, pos, parcelpos, args)
|
on_success = function(player, faction, pos, parcelpos, args)
|
||||||
local f = args.factions[1]
|
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
|
return true
|
||||||
end
|
end
|
||||||
},false)
|
},false)
|
||||||
|
Loading…
Reference in New Issue
Block a user