mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-22 12:05:51 -04:00
Core: /summon now allows you to summon players who cannot normally visit the map (but asks to confirm this first).
This commit is contained in:
parent
c1eb867022
commit
2bbba49106
@ -66,8 +66,9 @@ namespace MCGalaxy.Commands {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (p.level != who.level) {
|
if (p.level != who.level) {
|
||||||
Player.Message(p, who.ColoredName + " %Sis in a different Level, moving them..");
|
if (!CheckVisitPerm(p, who, confirmed)) return;
|
||||||
PlayerActions.ChangeMap(who, p.level);
|
Player.Message(p, who.ColoredName + " %Sis in a different level, moving them..");
|
||||||
|
PlayerActions.ChangeMap(who, p.level, confirmed);
|
||||||
p.BlockUntilLoad(10); // wait for them to load
|
p.BlockUntilLoad(10); // wait for them to load
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -76,6 +77,28 @@ namespace MCGalaxy.Commands {
|
|||||||
who.SendMessage("You were summoned by " + p.ColoredName + "%S.");
|
who.SendMessage("You were summoned by " + p.ColoredName + "%S.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool CheckVisitPerm(Player p, Player who, bool confirmed) {
|
||||||
|
LevelAccessResult result = p.level.VisitAccess.Check(who, confirmed);
|
||||||
|
if (result == LevelAccessResult.Allowed) return true;
|
||||||
|
if (result == LevelAccessResult.Whitelisted) return true;
|
||||||
|
|
||||||
|
if (result == LevelAccessResult.Blacklisted) {
|
||||||
|
Player.Message(p, "{0} %Sis blacklisted from visiting this map.", who.ColoredName);
|
||||||
|
return false;
|
||||||
|
} else if (result == LevelAccessResult.BelowMinRank) {
|
||||||
|
Player.Message(p, "Only {0}%S+ may normally visit this map. {1}%S is ranked {2}",
|
||||||
|
Group.GetColoredName(p.level.permissionvisit),
|
||||||
|
who.ColoredName, who.group.ColoredName);
|
||||||
|
} else if (result == LevelAccessResult.AboveMaxRank) {
|
||||||
|
Player.Message(p, "Only {0}%S and below may normally visit this map. {1}%S is ranked {2}",
|
||||||
|
Group.GetColoredName(p.level.pervisitmax),
|
||||||
|
who.ColoredName, who.group.ColoredName);
|
||||||
|
}
|
||||||
|
|
||||||
|
Player.Message(p, "If you still want to summon them, type %T/summon {0} confirm", who.name);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
public override void Help(Player p) {
|
public override void Help(Player p) {
|
||||||
Player.Message(p, "%T/summon [player]");
|
Player.Message(p, "%T/summon [player]");
|
||||||
Player.Message(p, "%HSummons [player] to your position.");
|
Player.Message(p, "%HSummons [player] to your position.");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user