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.
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.");
}
}
}
Users browsing this forum: No registered users and 3 guests