Results 1 to 7 of 7
  1. #1
    Desire's Avatar
    Join Date
    Sep 2013
    Gender
    male
    Location
    Insert Name Here
    Posts
    1,039
    Reputation
    58
    Thanks
    1,394
    My Mood
    Amused

    [Fab] /bring Command (Mob)

    This command brings the nearest entity to you


     
    Requested by @BurgerLoverMx
    Helped by @OmegaBm
    Majority by Me



     
    /bring Medusa (Not case-sensitive)


     
    When you /bring the same entity again, it will not bring the previous entity, it will look for another near entity instead of the one you just did


     
    Code:
        internal class BringMobCommand : Command    {
            public BringMobCommand()
                : base("bring", 8)
            {
            }
    
    
    
    
            protected override bool Process(Player player, RealmTime time, string[] args)
            {
                if (string.IsNullOrEmpty(args[0]))
                {
                    player.SendHelp("Usage: /bring <entity>");
                    return false;
                }
                {
                    string name = string.Join(" ", args);
                    ushort objType;
                    //creates a new case insensitive dictionary based on the XmlDatas
                    Dictionary<string, ushort> icdatas = new Dictionary<string, ushort>(
                        player.Manager.GameData.IdToObjectType,
                        StringComparer.OrdinalIgnoreCase);
                    if (!icdatas.TryGetValue(name, out objType) || !player.Manager.GameData.ObjectDescs.ContainsKey(objType))
                    { }
                    else
                    {
    
    
                        var entity = player.GetNearestEntity(10000, objType);
                        entity.Move(player.X, player.Y);
                        player.SendInfo("Success!");
                        return true;
                    }
                    player.SendError("Entity does not exist!");
                    return false;
                }
            }
        }
    Last edited by Desire; 11-19-2016 at 11:04 PM.
    im not really back nor will i ever get back into developing pservers
    though ill check once every month atleast


     

  2. The Following 2 Users Say Thank You to Desire For This Useful Post:

    BurgerLoverMx (11-19-2016),EHaehthsthethetheh (11-20-2016)

  3. #2
    BurgerLoverMx's Avatar
    Join Date
    Jan 2014
    Gender
    male
    Location
    Québec
    Posts
    411
    Reputation
    23
    Thanks
    843
    My Mood
    Relaxed
    Quote Originally Posted by Desire View Post
    This command brings the nearest entity to you


     
    Requested by @BurgerLoverMx
    Helped by @OmegaBm
    Majority by Me



     
    /bring Medusa (Not case-sensitive)


     
    When you /bring the same entity again, it will not bring the previous entity, it will look for another near entity instead of the one you just did


     
    Code:
        internal class BringMobCommand : Command
        {
            public BringMobCommand()
                : base("bring", 8)
            {
            }
    
    
            protected override bool Process(Player player, RealmTime time, string[] args)
            {
                if (string.IsNullOrEmpty(args[0]))
                {
                    player.SendHelp("Usage: /bring <entity>");
                    return false;
                }
                {
                    string name = string.Join(" ", args);
                    ushort objType;
                    //creates a new case insensitive dictionary based on the XmlDatas
                    Dictionary<string, ushort> icdatas = new Dictionary<string, ushort>(
                        player.Manager.GameData.IdToObjectType,
                        StringComparer.OrdinalIgnoreCase);
                    if (!icdatas.TryGetValue(name, out objType) || !player.Manager.GameData.ObjectDescs.ContainsKey(objType))
                    { }
                    else
                    {
                        
                        var entity = player.GetNearestEntity(10000, objType);
                        entity.Move(player.X, player.Y);
                        player.SendInfo("Success!");
                        return true;
                    }
                }
                player.SendError("Entity does not exist!");
                return false;
            }
        }
    Thanks for helping me!

  4. #3
    lordbaconzx's Avatar
    Join Date
    Sep 2016
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0
    it just says no permission ;-; the other commands work (give, etc.)

  5. #4
    EHaehthsthethetheh's Avatar
    Join Date
    Oct 2016
    Gender
    male
    Location
    MPGH.net
    Posts
    219
    Reputation
    10
    Thanks
    56
    Quote Originally Posted by lordbaconzx View Post
    it just says no permission ;-; the other commands work (give, etc.)
    You need to change the "8" to whatever rank you want.

    Quote Originally Posted by Desire View Post
     
    Code:
        internal class BringMobCommand : Command    {
            public BringMobCommand()
                : base("bring", 8)
            {
            }

  6. The Following 2 Users Say Thank You to EHaehthsthethetheh For This Useful Post:

    Desire (11-24-2016),lordbaconzx (11-27-2016)

  7. #5
    0rbitz's Avatar
    Join Date
    Sep 2016
    Gender
    female
    Location
    Space
    Posts
    929
    Reputation
    13
    Thanks
    177
    My Mood
    Amazed
    Thanks for the release

  8. The Following User Says Thank You to 0rbitz For This Useful Post:

    Desire (11-24-2016)

  9. #6
    The 7th Hokage's Avatar
    Join Date
    Feb 2015
    Gender
    male
    Location
    Konoha
    Posts
    2,424
    Reputation
    264
    Thanks
    1,324
    My Mood
    Chatty
    Nice release.

  10. #7
    ZeusAlmighty's Avatar
    Join Date
    Sep 2011
    Gender
    male
    Posts
    689
    Reputation
    27
    Thanks
    2,198
    My Mood
    Buzzed
    Thanks for the contribution, although cant really see a use for this but might help someone I guess.

Similar Threads

  1. [Fab] PetMax command!
    By Caesar1928 in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 8
    Last Post: 01-05-2017, 02:08 PM
  2. [Fab] /maxplayer command
    By B3CLAWED in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 7
    Last Post: 08-05-2016, 09:42 PM
  3. [Fab] /ip command
    By Caesar1928 in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 0
    Last Post: 01-11-2016, 08:02 PM
  4. [Fab] Gamble command (rolls number 1-100)
    By Caesar1928 in forum Realm of the Mad God Private Servers Tutorials/Source Code
    Replies: 6
    Last Post: 10-31-2015, 03:27 PM
  5. [Outdated] [1.2.5]SinglePlayerCommands - Bring commands of multiplayer to Single Player!
    By Jailbroken671 in forum Minecraft Mods
    Replies: 6
    Last Post: 06-14-2012, 12:41 PM