mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 20:53:40 -04:00
Show player count in /help ranks.
This commit is contained in:
parent
eed355e7af
commit
9d3e5f22eb
@ -26,7 +26,7 @@ namespace MCGalaxy.Commands {
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
|
||||
public override CommandAlias[] Aliases {
|
||||
get { return new[] { new CommandAlias("cmdhelp"), new CommandAlias("ranks", "ranks"),
|
||||
new CommandAlias("colors", "colors") }; }
|
||||
new CommandAlias("colors", "colors") }; }
|
||||
}
|
||||
public CmdHelp() { }
|
||||
|
||||
@ -46,13 +46,7 @@ namespace MCGalaxy.Commands {
|
||||
Player.Message(p, "To send private messages, type %T@PlayerName Message");
|
||||
break;
|
||||
case "ranks":
|
||||
message = "";
|
||||
foreach (Group grp in Group.GroupList)
|
||||
{
|
||||
if (grp.Permission < LevelPermission.Nobody) // Note that -1 means max undo. Undo anything and everything.
|
||||
Player.Message(p, grp.ColoredName + " - &bCmd: " + grp.maxBlocks + " - &2Undo: " + ((grp.maxUndo != -1) ? grp.maxUndo.ToString() : "max") + " - &cPerm: " + (int)grp.Permission);
|
||||
}
|
||||
break;
|
||||
PrintRanks(p); break;
|
||||
case "colours":
|
||||
case "colors":
|
||||
Player.Message(p, "&fTo use a color, put a '%' and then put the color code.");
|
||||
@ -71,6 +65,16 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
}
|
||||
|
||||
static void PrintRanks(Player p) {
|
||||
foreach (Group grp in Group.GroupList) {
|
||||
if (grp.Permission >= LevelPermission.Nobody) continue; // Note that -1 means max undo. Undo anything and everything.
|
||||
int count = grp.playerList.Count;
|
||||
Player.Message(p, "{0} ({1}) %S- Cmd: {2}, Undo: {3}, Perm: {4}",
|
||||
grp.ColoredName, count, grp.maxBlocks,
|
||||
grp.maxUndo == -1 ? "max" : grp.maxUndo.ToString(), (int)grp.Permission);
|
||||
}
|
||||
}
|
||||
|
||||
bool ParseCommand(Player p, string message) {
|
||||
string[] args = message.SplitSpaces(2);
|
||||
Alias alias = Alias.Find(args[0].ToLower());
|
||||
|
Loading…
x
Reference in New Issue
Block a user