Results 1 to 9 of 9
  1. #1
    Chiroy's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Location
    127.0.0.1:80
    Posts
    1,500
    Reputation
    28
    Thanks
    2,295

    Give command (Multiple items at once)

    Multiple items at 1 time

    Used such as:

    /give 8 Kithio

    ^^



    Even if you have 8 slots available , and do /give 20 you'll get how many slots you have available.

     
    [SPOILER]click me again!
     

    Code:
                    internal class GiveCommand : ICommand
                    {
                        public string Command
                        {
                            get { return "give"; }
                        }
    
                        public int RequiredRank
                        {
                            get { return 1; }
                        }
    
                        public void Execute(Player player, string[] args)
                        {
                            if (args.Length == 0)
                            {
                                player.SendHelp("Usage: /give [amount] <item name>");
                            }
                            else
                            {
    
                                var dir = @"logs";
                                int num;
                                int amount = 1;
                                var name = "";
                                if (args.Length > 0 && int.TryParse(args[0], out num)) //multi
                                {
                                    name = string.Join(" ", args.Skip(1).ToArray()).Trim();
                                    amount = int.Parse(args[0]);
                                }
                                else
                                {
                                    name = string.Join(" ", args.ToArray()).Trim();
                                }
    
                                short objType;
                                var icdatas = new Dictionary<string, short>(XmlData*****ToType, StringComparer.OrdinalIgnoreCase);
                                if (!icdatas.TryGetValue(name, out objType))
                                {
                                    player.SendError("Unknown item!");
                                    return;
                                }
                                if (!XmlDatas.ItemDescs[objType].Secret || player.Client.Account.Rank >= 5)
                                {
                                    for (var x = 0; x < amount; x++)
                                    {
                                        for (var i = 0; i < player.Inventory.Length; i++)
                                        {
                                            if (player.Inventory[i] == null)
                                            {
                                                player.Inventory[i] = XmlDatas.ItemDescs[objType];
                                                player.UpdateCount++;
                                                break;
                                            }
                                            else
                                            {
                                                if (i == 11 && x < amount)
                                                {
                                                    player.SendError("Inventory full!");
                                                    if (!Directory.Exists(dir))
                                                    {
                                                        Directory.CreateDirectory(dir);
                                                    }
                                                    using (var writer = new StreamWriter(@"logs\GiveLog.log", true))
                                                    {
                                                        writer.WriteLine(player.Name + " gave themselves " + amount + " " + name);
                                                    }
                                                    return;
                                                }
                                            }
                                        }
                                    }
                                    if (!Directory.Exists(dir))
                                    {
                                        Directory.CreateDirectory(dir);
                                    }
                                    using (var writer = new StreamWriter(@"logs\GiveLog.log", true))
                                    {
                                        writer.WriteLine(player.Name + " gave themselves " + amount + " " + name);
                                    }
                                    player.SendInfo("Success!");
                                    return;
    
                                }
                                else
                                {
                                    player.SendError("Item cannot be given!");
                                    if (!Directory.Exists(dir))
                                    {
                                        Directory.CreateDirectory(dir);
                                    }
                                    using (var writer = new StreamWriter(@"logs\GiveLog.log", true))
                                    {
                                        writer.WriteLine(player.Name + " tried to give themselves " + amount + " " + name);
                                    }
                                }
                            }
                        }
                    }
    [/SPOILER]

  2. #2
    Ahl's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    /modcp
    Posts
    16,599
    Reputation
    3219
    Thanks
    5,383
    My Mood
    Angelic
    Copy and paste much?
    News Force Head Editor from 09/14/2018 - 03/02/2020
    Publicist from 11/23/2017 - 06/07/2019
    Global Moderator since 09/24/2017
    Minion+ from 04/16/2017 - 09/24/2017
    Market Place Minion from 04/16/2017 - 09/24/2017
    Minecraft Minion from 02/23/2017 - 09/24/2017
    Realm of the Mad God Minion from 11/06/2016 - 09/24/2017

    Middleman from 09/14/2016 - 09/24/2017
    News Force Editor from 08/23/2016 - 09/14/2018
    News Force (Section of the Week) from 03/21/2016 - 07/17/2017
    News Force (User News) from 10/18/2015 - 09/14/2018

    Donator since 03/16/2015
    Realm of the Mad God Editor from 05/20/2014 - 07/08/2014
    Member since 12/23/2012


    Rep Power: 82

  3. The Following 3 Users Say Thank You to Ahl For This Useful Post:

    Fawflance (08-30-2015),Lunatic's Sheep (09-01-2015),Transferred (08-30-2015)

  4. #3
    Transferred's Avatar
    Join Date
    Jun 2015
    Gender
    male
    Posts
    766
    Reputation
    31
    Thanks
    447
    My Mood
    Buzzed
    Quote Originally Posted by Hunter's Best Sheep View Post
    Copy and paste much?
    r3kt much?

  5. #4
    Nyaro's Avatar
    Join Date
    May 2014
    Gender
    male
    Location
    Somewhere
    Posts
    4,260
    Reputation
    2727
    Thanks
    3,270
    My Mood
    Sleepy
    Hmmmm okay

    Thanks i guess
    Last edited by Nyaro; 08-31-2015 at 10:41 AM.
     
    MPGH Member Level 1 May 2014
    MPGH Donator May 2015
    MPGH Premium Member December 2015
    MPGH News Force Interviewer July 2016 - October 2017
    MPGH Member Level 2 August 2016
    MPGH Premium Seller March 2017
    MPGH Dave's Ballsack Rag - Unknown
    MPGH Realm of the Mad God Minion December 2017 - December 2018

  6. #5
    Chiroy's Avatar
    Join Date
    Jun 2014
    Gender
    male
    Location
    127.0.0.1:80
    Posts
    1,500
    Reputation
    28
    Thanks
    2,295
    I'm sure it only works for doomed.


    And I copied and pasted because I was just giving things that could help the realm community do it.

  7. #6
    Nyaro's Avatar
    Join Date
    May 2014
    Gender
    male
    Location
    Somewhere
    Posts
    4,260
    Reputation
    2727
    Thanks
    3,270
    My Mood
    Sleepy
    Quote Originally Posted by Fox10 View Post
    I'm sure it only works for doomed.


    And I copied and pasted because I was just giving things that could help the realm community do it.
    no1 uses doomed
     
    MPGH Member Level 1 May 2014
    MPGH Donator May 2015
    MPGH Premium Member December 2015
    MPGH News Force Interviewer July 2016 - October 2017
    MPGH Member Level 2 August 2016
    MPGH Premium Seller March 2017
    MPGH Dave's Ballsack Rag - Unknown
    MPGH Realm of the Mad God Minion December 2017 - December 2018

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

    Lunatic's Sheep (09-01-2015)

  9. #7
    Lunatic's Sheep's Avatar
    Join Date
    Oct 2013
    Gender
    male
    Location
    www.mpgh.net
    Posts
    2,105
    Reputation
    142
    Thanks
    403
    My Mood
    Stressed
    Quote Originally Posted by ★Hυntεr's Pαndαツ View Post
    no1 uses doomed
    That is so trueeeeee

  10. #8
    lkdjnfoskjednfblksjdfn's Avatar
    Join Date
    Apr 2014
    Gender
    male
    Location
    127.0.0.1
    Posts
    1,340
    Reputation
    198
    Thanks
    841
    My Mood
    Inspired
    Quote Originally Posted by Fox10 View Post
    Multiple items at 1 time

    Used such as:

    /give 8 Kithio

    ^^



    Even if you have 8 slots available , and do /give 20 you'll get how many slots you have available.

     
    [SPOILER]click me again!
     

    Code:
                    internal class GiveCommand : ICommand
                    {
                        public string Command
                        {
                            get { return "give"; }
                        }
    
                        public int RequiredRank
                        {
                            get { return 1; }
                        }
    
                        public void Execute(Player player, string[] args)
                        {
                            if (args.Length == 0)
                            {
                                player.SendHelp("Usage: /give [amount] <item name>");
                            }
                            else
                            {
    
                                var dir = @"logs";
                                int num;
                                int amount = 1;
                                var name = "";
                                if (args.Length > 0 && int.TryParse(args[0], out num)) //multi
                                {
                                    name = string.Join(" ", args.Skip(1).ToArray()).Trim();
                                    amount = int.Parse(args[0]);
                                }
                                else
                                {
                                    name = string.Join(" ", args.ToArray()).Trim();
                                }
    
                                short objType;
                                var icdatas = new Dictionary<string, short>(XmlData*****ToType, StringComparer.OrdinalIgnoreCase);
                                if (!icdatas.TryGetValue(name, out objType))
                                {
                                    player.SendError("Unknown item!");
                                    return;
                                }
                                if (!XmlDatas.ItemDescs[objType].Secret || player.Client.Account.Rank >= 5)
                                {
                                    for (var x = 0; x < amount; x++)
                                    {
                                        for (var i = 0; i < player.Inventory.Length; i++)
                                        {
                                            if (player.Inventory[i] == null)
                                            {
                                                player.Inventory[i] = XmlDatas.ItemDescs[objType];
                                                player.UpdateCount++;
                                                break;
                                            }
                                            else
                                            {
                                                if (i == 11 && x < amount)
                                                {
                                                    player.SendError("Inventory full!");
                                                    if (!Directory.Exists(dir))
                                                    {
                                                        Directory.CreateDirectory(dir);
                                                    }
                                                    using (var writer = new StreamWriter(@"logs\GiveLog.log", true))
                                                    {
                                                        writer.WriteLine(player.Name + " gave themselves " + amount + " " + name);
                                                    }
                                                    return;
                                                }
                                            }
                                        }
                                    }
                                    if (!Directory.Exists(dir))
                                    {
                                        Directory.CreateDirectory(dir);
                                    }
                                    using (var writer = new StreamWriter(@"logs\GiveLog.log", true))
                                    {
                                        writer.WriteLine(player.Name + " gave themselves " + amount + " " + name);
                                    }
                                    player.SendInfo("Success!");
                                    return;
    
                                }
                                else
                                {
                                    player.SendError("Item cannot be given!");
                                    if (!Directory.Exists(dir))
                                    {
                                        Directory.CreateDirectory(dir);
                                    }
                                    using (var writer = new StreamWriter(@"logs\GiveLog.log", true))
                                    {
                                        writer.WriteLine(player.Name + " tried to give themselves " + amount + " " + name);
                                    }
                                }
                            }
                        }
                    }
    [/SPOILER]
    Copypaste lvl 99999999999999

  11. #9
    Ahl's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    /modcp
    Posts
    16,599
    Reputation
    3219
    Thanks
    5,383
    My Mood
    Angelic
    Quote Originally Posted by ★Hυntεr's Pαndαツ View Post
    no1 uses doomed
    Even if someone did, it could've easily been copy + pasted from the Phoenix release Proph has
    News Force Head Editor from 09/14/2018 - 03/02/2020
    Publicist from 11/23/2017 - 06/07/2019
    Global Moderator since 09/24/2017
    Minion+ from 04/16/2017 - 09/24/2017
    Market Place Minion from 04/16/2017 - 09/24/2017
    Minecraft Minion from 02/23/2017 - 09/24/2017
    Realm of the Mad God Minion from 11/06/2016 - 09/24/2017

    Middleman from 09/14/2016 - 09/24/2017
    News Force Editor from 08/23/2016 - 09/14/2018
    News Force (Section of the Week) from 03/21/2016 - 07/17/2017
    News Force (User News) from 10/18/2015 - 09/14/2018

    Donator since 03/16/2015
    Realm of the Mad God Editor from 05/20/2014 - 07/08/2014
    Member since 12/23/2012


    Rep Power: 82

Similar Threads

  1. Replies: 9
    Last Post: 04-27-2011, 09:14 PM
  2. [Solved]Ascension Give Commands
    By grimreaper935 in forum Call of Duty Black Ops Help
    Replies: 7
    Last Post: 04-08-2011, 05:45 AM
  3. [Release] Custum dvars, give command
    By YuDi21 in forum Call of Duty Modern Warfare 2 Server / GSC Modding
    Replies: 1
    Last Post: 01-24-2011, 11:03 AM
  4. [Zombies] Weapon List for /give Command
    By Dapk123 in forum Call of Duty Black Ops Discussions
    Replies: 8
    Last Post: 01-03-2011, 07:25 AM
  5. The /give commands for playing with bots.
    By aIW|Convery in forum Call of Duty Black OPS Tutorials
    Replies: 19
    Last Post: 12-04-2010, 08:37 AM