/shop for Freebuild

/shop for Freebuild

Postby GurkE » 21 Jun 2013, 22:28

Hello,

I wanted to ask since I do not hammer out there. Maybe if someone could write a command undzwar Store for Free Build you have to buy the color, title, title color itself.

I'm sorry that my English is so bad, but I'm from Germany.
GurkE
 
Posts: 43
Joined: 21 Aug 2012, 20:27

Re: /shop for Freebuild

Postby lucasds12 » 21 Jun 2013, 22:33

Actually, this is a easy setting. Basically all you have to do is change the code from /store and change it so it can be enabled for freebuild. It may be a little bit hard but I ensure you this will be solved. I will be making a command similar to this function.
-Lucas
There is only one thing I do in life, that's contributing here.
lucasds12
 
Posts: 334
Joined: 17 Apr 2013, 16:17
Location: In the deep caves.

Re: /shop for Freebuild

Postby HETAL » 21 Jun 2013, 23:05

Code: Select all
    using System;

    namespace MCDzienny
    {
       public class CmdShop : Command
       {
          // The command's name, in all lowercase.  What you'll be putting behind the slash when using it.
          public override string name { get { return "shop"; } }

          // Command's shortcut (please take care not to use an existing one, or you may have issues.
          public override string shortcut { get { return ""; } }

          // Determines which submenu the command displays in under /help.
          public override string type { get { return "other"; } }

          public override bool museumUsable { get { return false; } }

          public override LevelPermission defaultRank { get { return LevelPermission.Guest; } }

          public override void Use(Player p, string message)
          {
            message = message.ToLower();
          int cost;
          if(message=="color"){
          cost=50;
          }
          else if(message=="farewell"){
          cost=20;
          }
          else if(message=="title"){
          cost=20;
          }
          else if(message=="welcome"){
          cost=20;
          }
          else{cost=0;}
            if (p.money < cost)
            {
                int left;
                left = cost-p.money;
                if (left <= 0)
                {
                    left = 0;
                }
                Player.SendMessage(p, "You need " + cost.ToString() + " " + Server.moneys);
                Player.SendMessage(p, "You are " + left.ToString() + " away from " + cost.ToString());
            }
            else
            {
                if (message == "color")
                {
                    p.boughtColor = true;
                    Player.SendMessage(p, "In order to change the color of your name use the command: /color");
                }
                else if (message == "farewell")
                {
                    p.boughtFarewell = true;
                    Player.SendMessage(p, "In order to set your farewell message write: /farewell [message]");
                }
                else if (message == "title")
                {
                    p.boughtTitle = true;
                    Player.SendMessage(p, "In order to change your title use the command: /title");
                }
                else if (message == "welcome")
                {
                    p.boughtWelcome = true;
                    Player.SendMessage(p, "In order to set your welcome message write: /welcome [message]");
                }
                else
                {


                    Player.SendMessage(p, "Color...50");
                    Player.SendMessage(p, "Farewell...20");
                    Player.SendMessage(p, "Title...20");
                    Player.SendMessage(p, "Welcome...20");
                }
            }
          }
          public override void Help(Player p)
          {
             Player.SendMessage(p, "/shop- browse the shop.");
                Player.SendMessage(p, "/shop [item] - buy an item.");
          }
       }
    }


Give all credit to ismellike all i did was edit his code for /market to make it /shop
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: /shop for Freebuild

Postby ismellike » 21 Jun 2013, 23:08

It turns out this code didn't work, to actually use the titles and stuff you have to do /title. /title requires you to be in lava or zombie.
What a beast...
User avatar
ismellike
Coder
 
Posts: 731
Joined: 31 Oct 2012, 04:04
Location: Kansas

Re: /shop for Freebuild

Postby HETAL » 21 Jun 2013, 23:11

now you tell me that..ill replace it soon
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: /shop for Freebuild

Postby HETAL » 21 Jun 2013, 23:14

is it just the title or is it also the color?
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10

Re: /shop for Freebuild

Postby GurkE » 22 Jun 2013, 16:59

Ok, probably because this command because / title etc is not what I want then surfaces?
GurkE
 
Posts: 43
Joined: 21 Aug 2012, 20:27

Re: /shop for Freebuild

Postby HETAL » 23 Jun 2013, 01:36

What exactly do you want in /shop
YOU HAVENT SEEN THE LAST OF ME ISMELLIKE
HETAL
 
Posts: 397
Joined: 24 May 2013, 12:10


Return to Requests for Addon

Who is online

Users browsing this forum: No registered users and 6 guests

cron