mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Lockdown autocompletes maps. Also fix help of /os go (Thanks VenkSociety)
This commit is contained in:
parent
03c024d942
commit
f559e38fef
@ -29,19 +29,23 @@ namespace MCGalaxy.Commands.World {
|
|||||||
get { return new[] { new CommandAlias("WLock"), new CommandAlias("WUnlock") }; }
|
get { return new[] { new CommandAlias("WLock"), new CommandAlias("WUnlock") }; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Use(Player p, string message) {
|
public override void Use(Player p, string map) {
|
||||||
if (message.Length == 0) { Help(p); return; }
|
if (map.Length == 0) { Help(p); return; }
|
||||||
if (!Formatter.ValidName(p, message, "level")) return;
|
if (!Formatter.ValidName(p, map, "level")) return;
|
||||||
|
|
||||||
bool unlocking = Server.lockdown.Contains(message);
|
map = Matcher.FindMaps(p, map);
|
||||||
Chat.MessageGlobal("The map {0} has been {1}locked", message, unlocking ? "un" : "");
|
if (map == null) return;
|
||||||
|
|
||||||
|
bool unlocking = Server.lockdown.Contains(map);
|
||||||
|
string action = unlocking ? "unlocked" : "locked";
|
||||||
|
Chat.MessageGlobal("Map " + map + " was " + action);
|
||||||
|
|
||||||
if (unlocking) {
|
if (unlocking) {
|
||||||
Server.lockdown.Remove(message);
|
Server.lockdown.Remove(map);
|
||||||
Chat.MessageFromOps(p, "Map unlocked by: λNICK");
|
Chat.MessageFromOps(p, "Map " + map + " unlocked by: λNICK");
|
||||||
} else {
|
} else {
|
||||||
Server.lockdown.AddIfNotExists(message);
|
Server.lockdown.AddIfNotExists(map);
|
||||||
Chat.MessageFromOps(p, "Map locked by: λNICK");
|
Chat.MessageFromOps(p, "Map " + map + " locked by: λNICK");
|
||||||
}
|
}
|
||||||
Server.lockdown.Save();
|
Server.lockdown.Save();
|
||||||
}
|
}
|
||||||
|
@ -144,8 +144,8 @@ namespace MCGalaxy.Commands.World {
|
|||||||
};
|
};
|
||||||
|
|
||||||
static string[] gotoHelp = new string[] {
|
static string[] gotoHelp = new string[] {
|
||||||
"%T/os goto %H- Teleports you to your first map.",
|
"%T/os go %H- Teleports you to your first map.",
|
||||||
"%T/os goto [num] %H- Teleports you to your nth map.",
|
"%T/os go [num] %H- Teleports you to your nth map.",
|
||||||
};
|
};
|
||||||
|
|
||||||
static string[] kickHelp = new string[] {
|
static string[] kickHelp = new string[] {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user