mirror of
https://github.com/ClassiCube/MCGalaxy.git
synced 2025-09-23 04:32:50 -04:00
Make commands that are designed to only be used in-game show 'can only be used in game' when called from IRC.
This commit is contained in:
parent
b2e59bd7cd
commit
9ba03f3bd4
@ -26,7 +26,7 @@ namespace MCGalaxy.Commands.CPE {
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.AdvBuilder; } }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (message == "") { Help(p); return; }
|
||||
|
||||
float dist;
|
||||
|
@ -38,7 +38,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
string[] parts = message.ToLower().Split(' ');
|
||||
|
||||
if (parts.Length == 0) {
|
||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands {
|
||||
public override CommandEnable Enabled { get { return CommandEnable.Economy; } }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
string[] parts = message.Split(' ');
|
||||
|
||||
foreach (Item item in Economy.Items)
|
||||
|
@ -31,7 +31,7 @@ namespace MCGalaxy.Commands {
|
||||
public override CommandEnable Enabled { get { return CommandEnable.Zombie | CommandEnable.Lava; } }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (!p.EnoughMoney(10)) {
|
||||
Player.Message(p, "You need &f10 " + Server.moneys + " %Sto enter the lottery."); return;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace MCGalaxy.Commands {
|
||||
public CmdHuman() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (p.Game.PledgeSurvive) {
|
||||
Player.Message(p, "You cannot un-pledge that you will be infected."); return;
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ namespace MCGalaxy.Commands {
|
||||
public CmdReferee() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
|
||||
if (p.Game.Referee) {
|
||||
Player.SendChatFrom(p, p.ColoredName + " %Sis no longer a referee", false);
|
||||
|
@ -31,10 +31,8 @@ namespace MCGalaxy.Commands
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }
|
||||
public CmdAbout() { }
|
||||
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
Player.Message(p, "Break/build a block to display information.");
|
||||
p.ClearBlockchange();
|
||||
p.Blockchange += new Player.BlockchangeEventHandler(AboutBlockchange);
|
||||
|
@ -27,7 +27,7 @@ namespace MCGalaxy.Commands {
|
||||
public CmdAfk() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (message == "list") {
|
||||
Player[] players = PlayerInfo.Online.Items;
|
||||
foreach (Player pl in players) {
|
||||
|
@ -29,7 +29,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (!p.canBuild)
|
||||
{
|
||||
Player.Message(p, "You're currently being &4possessed%S!");
|
||||
|
@ -34,7 +34,7 @@ namespace MCGalaxy.Commands
|
||||
public CmdHide() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (message == "check") {
|
||||
string state = p.hidden ? "" : "not ";
|
||||
Player.Message(p, "You are " + state + "currently hidden!"); return;
|
||||
|
@ -34,7 +34,7 @@ namespace MCGalaxy.Commands {
|
||||
public override void Use(Player p, string message) {
|
||||
long seconds;
|
||||
bool FoundUser = false;
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (message == "") message = p.name + " 300";
|
||||
string[] args = message.Split(' ');
|
||||
string name = args[0];
|
||||
|
@ -40,7 +40,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (message != "") { Help(p); return; }
|
||||
|
||||
List<string> getpatrol = (from pl in PlayerInfo.players where (int) pl.@group.Permission <= CommandOtherPerms.GetPerm(this) select pl.name).ToList();
|
||||
|
@ -28,7 +28,7 @@ namespace MCGalaxy.Commands {
|
||||
public CmdPossess() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
string[] args = message.Split(' ');
|
||||
if (args.Length > 2) { Help(p); return; }
|
||||
|
||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands {
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
CatchPos cpos = default(CatchPos);
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (message == "") { Player.Message(p, "You need to provide a player name."); return; }
|
||||
|
||||
string[] parts = message.Split(' ');
|
||||
|
@ -96,7 +96,7 @@ namespace MCGalaxy.Commands {
|
||||
}
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
CmdReveal.ReloadMap(p, p, false);
|
||||
}
|
||||
|
||||
|
@ -25,7 +25,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
public CmdAbort() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
p.ClearBlockchange();
|
||||
p.painting = false;
|
||||
p.cmdTimer = false;
|
||||
|
@ -25,7 +25,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "") { Help(p); return; }
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
string[] args = message.ToLower().Split(' ');
|
||||
if (args.Length > 2) { Help(p); return; }
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
}
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (message == "") {
|
||||
Player.Message(p, "Your current brush is: " + p.BrushName); return;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ namespace MCGalaxy.Commands {
|
||||
static char[] trimChars = { ' ' };
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
|
||||
if (message == "") {
|
||||
bool foundBind = false;
|
||||
|
@ -27,7 +27,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
}
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
// convert player pos to block coords
|
||||
Vec3U16 P = Vec3U16.ClampPos(p.pos[0], (ushort)(p.pos[1] - 32), p.pos[2], p.level);
|
||||
P.X /= 32; P.Y /= 32; P.Z /= 32;
|
||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (message == "") { Help(p); return; }
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
string replaceCmd = ReplaceNot ? "replacenot" : "replace";
|
||||
if (!p.group.CanExecute(replaceCmd) || !p.group.CanExecute("brush")) {
|
||||
Player.Message(p, "You cannot use /brush and/or /" + replaceCmd +
|
||||
|
@ -29,7 +29,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
public override void Use(Player p, string message) {
|
||||
ushort distance = 0, interval = 0;
|
||||
if (message == "") { Help(p); return; }
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
|
||||
string[] parts = message.Split(' ');
|
||||
if (!ushort.TryParse(parts[0], out distance)) {
|
||||
|
@ -28,7 +28,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
static char[] trimChars = {' '};
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
int mode = TreeDrawOp.T_Tree;
|
||||
string[] parts = message.Split(trimChars, 2);
|
||||
string brushMsg = parts.Length >= 2 ? parts[1] : "";
|
||||
|
@ -29,7 +29,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
static char[] trimChars = { ' ' };
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (!p.group.CanExecute("write")) {
|
||||
Player.Message(p, "You must be able to use /write to use /writetext."); return;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ namespace MCGalaxy.Commands.Building {
|
||||
public override LevelPermission defaultRank { get { return LevelPermission.Builder; } }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
message = message.ToLower();
|
||||
string[] parts = message.Split(' ');
|
||||
CatchPos cpos = default(CatchPos);
|
||||
|
@ -32,7 +32,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (Server.agreetorulesonentry == false)
|
||||
{
|
||||
Player.Message(p, "This command can only be used if agree-to-rules-on-entry is enabled!");
|
||||
|
@ -29,7 +29,7 @@ namespace MCGalaxy.Commands
|
||||
public CmdC4() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
|
||||
if (p.level.physics >= 1 && p.level.physics < 5) {
|
||||
sbyte numb = C4Physics.NextCircuit(p.level);
|
||||
|
@ -29,7 +29,7 @@ namespace MCGalaxy.Commands
|
||||
public CmdChain() { }
|
||||
|
||||
public override void Use(Player p, string message) {
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (p.level.permissionbuild > p.group.Permission) {
|
||||
Player.Message(p, "You cannot build on this map!"); return;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ namespace MCGalaxy.Commands
|
||||
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (!Server.agreetorulesonentry)
|
||||
{
|
||||
Player.Message(p, "This command can only be used if agree-to-rules-on-entry is enabled in the console!");
|
||||
|
@ -34,7 +34,7 @@ namespace MCGalaxy.Commands
|
||||
public override void Use(Player p, string message)
|
||||
{
|
||||
if (message == "") { Help(p); return; }
|
||||
if (p == null) { MessageInGameOnly(p); return; }
|
||||
if (Player.IsSuper(p)) { MessageInGameOnly(p); return; }
|
||||
if (message.ToLower() == "all")
|
||||
{
|
||||
Player[] players = PlayerInfo.Online.Items;
|
||||
|
Loading…
x
Reference in New Issue
Block a user