/multiplebuy

/multiplebuy

Postby jokeonthego » 19 Jul 2011, 11:22

well some people on my server are wondering why they can only get so many of a single object that they want like hammer water and other items and keep on having to waste there money on it and keep buying it .ps this is ust basically an update towards ./buy command
:/ your decision on me leaving server software or staying
jokeonthego
 
Posts: 58
Joined: 27 Jun 2011, 17:34
Location: facebook

Re: /BUY ITEM <howmany>

Postby jkl139 » 19 Jul 2011, 15:07

You can change the amount of the objects in the folder "itemprices"
Image
Image
User avatar
jkl139
 
Posts: 444
Joined: 13 Jun 2011, 11:46
Location: MCDzienny Forum

Re: /BUY ITEM <howmany>

Postby JSchweigert » 19 Jul 2011, 18:13

Here's a command I quickly made up for you:
(type /multiplebuy [item number] [number of the item] to use)
Code: Select all
using System;

namespace MCDzienny
{
   public class CmdMultiplebuy : Command
   {
      public override string name { get { return "multiplebuy"; } }
      public override string shortcut { get { return "mbuy"; } }
      public override string type { get { return "other"; } }
      public override bool museumUsable { get { return true; } }
      public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }
       
      public override void Use(Player p, string message)
      {
            int pos = message.IndexOf(' ');
         int numberOf = Convert.ToInt32(message.Substring(pos + 1));
            string item;
            if(numberOf <= 100){
                while(numberOf != 0){
                    item = message.Substring(0, pos);
                    Command.all.Find("buy").Use(p, item);
                    numberOf--;
                }
            }
            else {
            Player.SendMessage(p, "You can't buy more than 100 items at a time.");
            }
      }

      public override void Help(Player p)
      {
         Player.SendMessage(p, "/mbuy [item] [number] - buys a certain number of an item.");
      }
   }
}
JSchweigert
 
Posts: 6
Joined: 16 Jun 2011, 20:21


Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 12 guests

cron