mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-24 05:03:34 -04:00
Should be able to use /fly when +fly in MOTD
This commit is contained in:
parent
88db6ff127
commit
80cf6c2ced
@ -28,7 +28,7 @@ namespace MCGalaxy.Commands.Misc {
|
||||
public override bool SuperUseable { get { return false; } }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (!Hacks.CanUseHacks(p, p.level)) {
|
||||
if (!Hacks.CanUseFly(p, p.level)) {
|
||||
Player.Message(p, "You cannot use %T/Fly %Son this map.");
|
||||
p.isFlying = false; return;
|
||||
}
|
||||
|
@ -22,11 +22,13 @@ namespace MCGalaxy {
|
||||
public static class Hacks {
|
||||
|
||||
public static bool CanUseHacks(Player p, Level lvl) {
|
||||
string motd = lvl.GetMotd(p);
|
||||
bool noHacks = motd.CaselessContains("-hax");
|
||||
if (noHacks && p.Rank >= LevelPermission.Operator && motd.CaselessContains("+ophax"))
|
||||
return true;
|
||||
return !noHacks;
|
||||
byte[] packet = MakeHackControl(p, lvl.GetMotd(p));
|
||||
return packet[1] != 0 && packet[2] != 0 && packet[3] != 0 && packet[4] != 0 && packet[5] != 0;
|
||||
}
|
||||
|
||||
public static bool CanUseFly(Player p, Level lvl) {
|
||||
byte[] packet = MakeHackControl(p, lvl.GetMotd(p));
|
||||
return packet[1] != 0;
|
||||
}
|
||||
|
||||
public static byte[] MakeHackControl(Player p, string motd) {
|
||||
@ -40,8 +42,6 @@ namespace MCGalaxy {
|
||||
string part = parts[i];
|
||||
if (part.CaselessEq("-hax")) {
|
||||
fly = false; noclip = false; speed = false; respawn = false; _3rdPerson = false;
|
||||
} if (part.CaselessEq("-hax")) {
|
||||
fly = false; noclip = false; speed = false; respawn = false; _3rdPerson = false;
|
||||
} else if (part.CaselessEq("-ophax") && isOp) {
|
||||
fly = false; noclip = false; speed = false; respawn = false; _3rdPerson = false;
|
||||
} else if (part.CaselessEq("+ophax") && isOp) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user