コード例 #1
0
ファイル: Marry.cs プロジェクト: itsdavvid/MCGalaxy-Plugins
        public override void Use(Player p, string message)
        {
            string marriedTo = MarryPlugin.marriages.FindData(p.name);

            if (marriedTo == null)
            {
                p.Message("You are not married to anyone."); return;
            }

            if (p.money < 50)
            {
                p.Message("You need at least 50 &3{0} %Sto divorce your partner.", Server.Config.Currency); return;
            }
            p.SetMoney(p.money - 50);

            MarryPlugin.marriages.Remove(p.name);
            MarryPlugin.marriages.Remove(marriedTo);
            MarryPlugin.marriages.Save();
            Player partner = PlayerInfo.FindExact(marriedTo);

            Chat.MessageGlobal("-{0}%S just divorced {1}%S-",
                               p.ColoredName, PlayerInfo.GetColoredName(p, marriedTo));
            if (partner != null)
            {
                partner.Message("{0} &bjust divorced you.", p.ColoredName);
            }
        }
コード例 #2
0
ファイル: Marry.cs プロジェクト: itsdavvid/MCGalaxy-Plugins
        public override void Use(Player p, string message)
        {
            Player proposer = CheckProposal(p);

            if (proposer == null)
            {
                return;
            }

            Chat.MessageGlobal("-{0} &aaccepted {1}%S's proposal, and they are now happily married-",
                               p.ColoredName, proposer.ColoredName);
            p.Message("&bYou &aaccepted &b{0}&b's proposal", proposer.ColoredName);
            proposer.SetMoney(proposer.money - 200);

            MarryPlugin.marriages.AddOrReplace(p.name, proposer.name);
            MarryPlugin.marriages.AddOrReplace(proposer.name, p.name);
            MarryPlugin.marriages.Save();
            p.Extras.Remove(MarryPlugin.ExtraName);
        }
コード例 #3
0
        public override void Use(Player p, string message, CommandData data)
        {
            string date     = DateTime.UtcNow.ToShortDateString();
            string lastDate = DailyBonus.dailyList.FindData(p.name);

            if (lastDate == null || lastDate != date)   // Check if they've already claimed their bonus
            // Add the player's current date to the list
            {
                DailyBonus.dailyList.AddOrReplace(p.name, date);
                DailyBonus.dailyList.Save();

                p.Message("%SYou claimed your daily bonus of &b" + DailyBonus.amount + " %S" + Server.Config.Currency + "%S.");
                p.SetMoney(p.money + DailyBonus.amount);
            }

            if (lastDate == date)
            {
                p.Message("%cYou have already claimed your daily bonus for today.");
            }
        }
コード例 #4
0
        void HandlePlayerConnect(Player p)
        {
            string date     = DateTime.UtcNow.ToShortDateString();
            string lastDate = dailyList.FindData(p.name);

            if (lastDate == null || lastDate != date)   // Check if they've already claimed their bonus
            // Add the player's current date to the list
            {
                dailyList.AddOrReplace(p.name, date);
                dailyList.Save();

                p.Message("%SYou claimed your daily bonus of &b" + amount + " %S" + Server.Config.Currency + "%S.");
                p.SetMoney(p.money + amount);
            }

            if (lastDate == date)
            {
                p.Message("%cYou have already claimed your daily bonus for today.");
            }
        }