mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -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 LevelPermission defaultRank { get { return LevelPermission.Banned; } }
|
||||||
public override CommandAlias[] Aliases {
|
public override CommandAlias[] Aliases {
|
||||||
get { return new[] { new CommandAlias("cmdhelp"), new CommandAlias("ranks", "ranks"),
|
get { return new[] { new CommandAlias("cmdhelp"), new CommandAlias("ranks", "ranks"),
|
||||||
new CommandAlias("colors", "colors") }; }
|
new CommandAlias("colors", "colors") }; }
|
||||||
}
|
}
|
||||||
public CmdHelp() { }
|
public CmdHelp() { }
|
||||||
|
|
||||||
@ -46,13 +46,7 @@ namespace MCGalaxy.Commands {
|
|||||||
Player.Message(p, "To send private messages, type %T@PlayerName Message");
|
Player.Message(p, "To send private messages, type %T@PlayerName Message");
|
||||||
break;
|
break;
|
||||||
case "ranks":
|
case "ranks":
|
||||||
message = "";
|
PrintRanks(p); break;
|
||||||
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;
|
|
||||||
case "colours":
|
case "colours":
|
||||||
case "colors":
|
case "colors":
|
||||||
Player.Message(p, "&fTo use a color, put a '%' and then put the color code.");
|
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) {
|
bool ParseCommand(Player p, string message) {
|
||||||
string[] args = message.SplitSpaces(2);
|
string[] args = message.SplitSpaces(2);
|
||||||
Alias alias = Alias.Find(args[0].ToLower());
|
Alias alias = Alias.Find(args[0].ToLower());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user