Handle the ohide part of /ohide myrank

Set a global levelperm to p's permission to use in entities.cs
This commit is contained in:
Peteys93 2016-04-26 03:28:24 -04:00
parent 110211c45d
commit dfc32f2c00

View File

@ -41,13 +41,23 @@ namespace MCGalaxy.Commands
{
MessageTooHighRank(p, "hide", false); return;
}
Command.all.Find("hide").Use(who, "");
Player.SendMessage(p, "Used /hide on " + who.color + who.name + "%S.");
if (args.Length >= 2 && args[1].ToLower() == "myrank")
{
who.oHideRank = p.group.Permission;
Command.all.Find("hide").Use(who, "myrank");
Player.SendMessage(p, "Used /hide myrank on " + who.color + who.name + "%S.");
}
else
{
Command.all.Find("hide").Use(who, "");
Player.SendMessage(p, "Used /hide on " + who.color + who.name + "%S.");
}
}
public override void Help(Player p)
{
Player.SendMessage(p, "/ohide <player> - Hides/unhides the player specified.");
Player.SendMessage(p, "/ohide <player> <myrank> - Hides/unhides the player specified to players below your rank.");
Player.SendMessage(p, "Only works on players of lower rank.");
}
}