/MakeItRain

/MakeItRain

Postby Minecrafter4ty6 » 15 Dec 2014, 03:17

/Makeitrain (/Mir) Could be used to randomly give all the players in the server a specified ammount of cash

/Mir 20 gives players 20 dollars

Message shows up as [Player] has just made it rain $20 say thanks!

Op+ Command permission
Minecrafter4ty6
 
Posts: 16
Joined: 16 Dec 2013, 20:37

Re: /MakeItRain

Postby Leeizazombie » 15 Dec 2014, 03:38

Here you go:
Code: Select all
using System;

namespace MCDzienny
{
   public class CmdMakeItRain : Command
   {
      public override string name { get { return "makeitrain"; } }
      public override string shortcut { get { return "mir"; } }
      public override string type { get { return "mod"; } }
      public override bool museumUsable { get { return false; } }
      public override LevelPermission defaultRank { get { return LevelPermission.Operator; } }

      public override void Use(Player p, string message)
      {
            int money;
            try
            {
                money = Convert.ToInt32(message.Split(' ')[0]);
            }
            catch
            {
                Player.SendMessage(p, "%cError: %fYou must enter a number!");
                Help(p);
                return;
            }
            Player.players.ForEachSync(pl =>
            {
                pl.money += money;
                Player.SendMessage(pl, "%2Note: %f" + p.color + p.PublicName + " %fhas made it rain %2" + money + " " + Server.moneys);
            });
      }

      public override void Help(Player p)
      {
         Player.SendMessage(p, "/makeitrain (money) - Rains money from the heavens, and everyone gets (money) from it!");
            Player.SendMessage(p, "/shortcut: /mir (money)");
      }
   }
}


Please note that this was untested, so let me know if anything goes wrong!
Owner of:
LeeIzaZombie Freebuild and Lava Survival V2 (Shut Down and updated)
LeeIzaZombie Survival (Comming back soon)

Contact:
Skype: leeizazombie
IRC: irc.geekshed.net, #leeizazombie, #mcclassichosting
User avatar
Leeizazombie
 
Posts: 536
Joined: 10 Jun 2013, 17:45
Location: Ireland.

Re: /MakeItRain

Postby Minecrafter4ty6 » 15 Dec 2014, 03:40

Thanks a bunch <3
Minecrafter4ty6
 
Posts: 16
Joined: 16 Dec 2013, 20:37


Return to Requests for Addon

Who is online

Users browsing this forum: No registered users and 1 guest

cron