mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Cleanup /help cmdset and /help undo, make /help on aliases print the help for their actual command. (Thanks FabTheZen)
This commit is contained in:
parent
76b5c33f1b
commit
b47caa9c86
@ -74,6 +74,9 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
bool ParseCommand(Player p, string message) {
|
||||
string[] args = message.Split(trimChars, 2);
|
||||
Alias alias = Alias.Find(args[0].ToLower());
|
||||
if (alias != null) args[0] = alias.Target;
|
||||
|
||||
Command cmd = Command.all.Find(args[0]);
|
||||
if (cmd == null) return false;
|
||||
|
||||
@ -109,7 +112,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
Player.Message(p, builder.ToString());
|
||||
|
||||
PrintAliases(p, cmd);
|
||||
PrintAliases(p, cmd);
|
||||
CommandPerm[] addPerms = cmd.AdditionalPerms;
|
||||
if (addPerms == null) return;
|
||||
|
||||
|
@ -34,12 +34,11 @@ namespace MCGalaxy.Commands
|
||||
public CmdViewRanks() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "") { Help(p); return; }
|
||||
|
||||
if (message == "") {
|
||||
Player.Message(p, "Available ranks: " + Group.concatList()); return;
|
||||
}
|
||||
Group grp = Group.Find(message);
|
||||
if (grp == null) {
|
||||
Player.Message(p, "Could not find group"); return;
|
||||
}
|
||||
if (grp == null) { Player.Message(p, "Could not find group"); return; }
|
||||
|
||||
StringBuilder builder = new StringBuilder();
|
||||
foreach (string s in grp.playerList.All())
|
||||
|
@ -92,7 +92,7 @@ namespace MCGalaxy.Commands {
|
||||
Player.Message(p, "%T/cmdset [cmd] [rank] <additional permission number>");
|
||||
Player.Message(p, "%HSet the lowest rank that has that additional permission for [cmd] " +
|
||||
"(Most commands do not use these)");
|
||||
Player.Message(p, "Available ranks: " + Group.concatList());
|
||||
Player.Message(p, "To see available ranks, type %T/viewranks");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -170,10 +170,10 @@ namespace MCGalaxy.Commands.Building {
|
||||
Player.Message(p, "/undo - Undoes your last draw operation.");
|
||||
Player.Message(p, "/undo [player] [seconds] - Undoes the blockchanges made by [player] in the previous [seconds].");
|
||||
if (p == null || (p.group.maxUndo <= 500000 || p.group.maxUndo == 0))
|
||||
Player.Message(p, "/undo [player] all - &cWill undo 68 years, 18 days, 15 hours, 28 minutes, 31 seconds for [player]");
|
||||
Player.Message(p, "/undo [player] all - &cUndoes 68 years for [player]");
|
||||
if (p == null || (p.group.maxUndo <= 1800 || p.group.maxUndo == 0))
|
||||
Player.Message(p, "/undo [player] - &cWill undo 30 minutes");
|
||||
Player.Message(p, "/undo physics [seconds] - Undoes the physics for the current map");
|
||||
Player.Message(p, "/undo [player] - &cUndoes 30 minutes for [player]");
|
||||
Player.Message(p, "/undo physics [seconds] - Undoes physics on your current map");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user