mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -04:00
Fix /xjail still moving higher ranked players to the xjail map (but not actually jailing them). (thanks lavacraft)
This commit is contained in:
parent
b8a306e62c
commit
f020920ba5
@ -42,32 +42,35 @@ namespace MCGalaxy.Commands {
|
||||
return;
|
||||
}
|
||||
|
||||
Player pl = PlayerInfo.FindMatches(p, message);
|
||||
if (pl == null) return;
|
||||
Player who = PlayerInfo.FindMatches(p, message);
|
||||
if (who == null) return;
|
||||
if (p != null && who.Rank >= p.Rank) {
|
||||
MessageTooHighRank(p, "xjail", false); return;
|
||||
}
|
||||
|
||||
Command spawn = Command.all.Find("spawn");
|
||||
Command freeze = Command.all.Find("freeze");
|
||||
Command mute = Command.all.Find("mute");
|
||||
|
||||
string data = Server.jailed.Find(pl.name);
|
||||
string data = Server.jailed.Find(who.name);
|
||||
if (data == null) {
|
||||
if (!pl.muted) mute.Use(p, message);
|
||||
if (!pl.frozen) freeze.Use(p, message);
|
||||
if (!who.muted) mute.Use(p, message);
|
||||
if (!who.frozen) freeze.Use(p, message);
|
||||
|
||||
PlayerActions.ChangeMap(pl, xjailMap);
|
||||
pl.BlockUntilLoad(10);
|
||||
PlayerActions.ChangeMap(who, xjailMap);
|
||||
who.BlockUntilLoad(10);
|
||||
jail.Use(p, message);
|
||||
Chat.MessageAll("{0} %Swas XJailed!", pl.ColoredName);
|
||||
Chat.MessageAll("{0} %Swas XJailed!", who.ColoredName);
|
||||
} else {
|
||||
if (pl.muted) mute.Use(p, message);
|
||||
if (pl.frozen) freeze.Use(p, message);
|
||||
if (who.muted) mute.Use(p, message);
|
||||
if (who.frozen) freeze.Use(p, message);
|
||||
|
||||
PlayerActions.ChangeMap(pl, Server.mainLevel.name);
|
||||
pl.BlockUntilLoad(10);
|
||||
PlayerActions.ChangeMap(who, Server.mainLevel.name);
|
||||
who.BlockUntilLoad(10);
|
||||
|
||||
jail.Use(p, message);
|
||||
spawn.Use(pl, "");
|
||||
Chat.MessageAll("{0} %Swas released from XJail!", pl.ColoredName);
|
||||
spawn.Use(who, "");
|
||||
Chat.MessageAll("{0} %Swas released from XJail!", who.ColoredName);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user