SendMessage() public method

public SendMessage ( string message ) : void
message string
return void
Ejemplo n.º 1
0
 public override void PlayerUse(Player p, string[] parameters, string fullCommand)
 {
     if (parameters.Length == 0)
     {
         PlayerHelp(p);
         return;
     }
     Level level = Level.Find(parameters[0]);
     if (level == null) p.SendMessage("Not found!");
     else
     p.SwitchMap(level);
 }
Ejemplo n.º 2
0
 public override void PlayerUse(Player p, string[] parameters, string fullCommand)
 {
     p._enableWaterMode = !p._enableWaterMode;
     p.SendMessage("Water mode is now: " + p._enableWaterMode);
 }
Ejemplo n.º 3
0
        public override void PlayerUse(Player p, string[] parameters, string fullCommand)
        {
            if (parameters.Length == 0)
            {
                PlayerHelp(p);
                return;
            }

            if (parameters[0].Equals("create", StringComparison.OrdinalIgnoreCase) || parameters[0].Equals("new", StringComparison.OrdinalIgnoreCase))
            {
                if (parameters.Length == 2)
                {
                    Level lfind = Level.Find(parameters[1]);
                    if (lfind != null)
                    {
                        //Called when a player types /level create <name> or /level new <name> and the name is already used for another level
                        p.SendMessage("Level Already Exists!");
                    }
                    else
                    {
                        //Called when a player types /level create <name> or /level new <name> and the name isn't already a level
                        Level level = new Level(parameters[1], 256, 256, 256);
                    }
                }
                else if (parameters.Length == 3)
                {
                    //Called when a player types /level create <name> <type> or /level new <name> <type>
                    if (parameters[2].Equals("flatgrass", StringComparison.OrdinalIgnoreCase))
                    {
                        Level level = new Level(parameters[1], 256, 256, 256, parameters[2]);
                    }
                    else if (parameters[2].Equals("pixel", StringComparison.OrdinalIgnoreCase))
                    {
                        Level level = new Level(parameters[1], 256, 256, 256, parameters[2]);
                    }
                    else
                    {
                        //Called when a player types /level create <name> <type> or /level new <name> <type> and the type is invalid.
                        p.SendMessage("Invalid world type! Valid types are flatgrass and pixel.");
                    }
                }
                else
                {
                    //This is called when the player types /level create or /level new
                    Level level = new Level("temporary", 256, 256, 256);
                }
            }
            if (parameters[0].Equals("load", StringComparison.OrdinalIgnoreCase))
            {
                //This is called when the player types /level load
                if (parameters.Length < 2) { PlayerHelp(p); return; }
                Level level = Level.Find(parameters[1]);
                if (level != null) p.SendMessage("Level Already Loaded! found!");
                else
                {
                    new Level(parameters[1], false);
                }
            }
            if (parameters[0].Equals("unload", StringComparison.OrdinalIgnoreCase))
            {
                //This is called when the player types /level unload
                if (parameters.Length < 2) { PlayerHelp(p); return; }
                Level level = Level.Find(parameters[1]);
                if (level == null) p.SendMessage("Level not found!");
                else
                {
                    level.Unload();
                }
            }
        }
Ejemplo n.º 4
0
 public override void PlayerHelp(Player p)
 {
     p.SendMessage("Invalid command usages!");
 }
Ejemplo n.º 5
0
 public override void PlayerUse(Player p, string[] parameters, string fullCommand)
 {
     p.EnableHistoryMode = !p.EnableHistoryMode;
     p.SendMessage("History mode is now: " + p.EnableHistoryMode);
 }