1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 15:20:48 -05:00

fixed another issue with config creation

fixed issue with player count
added topstats command
This commit is contained in:
RaidMax
2015-03-10 16:56:01 -05:00
parent 57ddbebd8c
commit 74312d5b4e
9 changed files with 76 additions and 15 deletions

View File

@ -460,4 +460,38 @@ namespace IW4MAdmin
}
}
class TopStats : Command
{
public TopStats(String N, String D, String U, Player.Permission P, int args, bool nT) : base(N, D, U, P, args, nT) { }
public override void Execute(Event E)
{
List<Stats> Top = E.Owner.stats.topStats();
List<Player> TopP = new List<Player>();
foreach (Stats S in Top)
{
Player P = E.Owner.DB.findPlayers(S.Kills); // BAD
if (P != null)
{
P.stats = S;
TopP.Add(P);
}
}
if (TopP.Count > 0)
{
E.Origin.Tell("^1TOP PLAYERS");
foreach (Player P in TopP)
{
if (P != null)
E.Origin.Tell(String.Format("^3{0}^7 - ^5{1} ^7KDR | ^5{2} ^7SKILL", P.getName(), P.stats.KDR, P.stats.Skill));
}
}
else
E.Origin.Tell("There are no top players yet!");
}
}
}