Exemple #1
0
        public void Info()
        {
            var stringBuilder = new StringBuilder();

            stringBuilder.AppendLine(Module.Config.Open ? TranslatesUtils.GetInfoId("open") : TranslatesUtils.GetInfoId("close"));
            stringBuilder.AppendLine(String.Format(TranslatesUtils.GetInfoId("next"), Module.Config.NextDraw));
            stringBuilder.AppendLine("");

            List <int> listPlayerNumbers = PlayersUtils.PlayerNumbers(base.Context.Player.IdentityId);

            if (listPlayerNumbers.Count != 0)
            {
                foreach (var item in listPlayerNumbers)
                {
                    stringBuilder.AppendLine(String.Format(TranslatesUtils.GetInfoId("play"), item));
                }
            }
            else
            {
                stringBuilder.AppendLine(TranslatesUtils.GetInfoId("dont"));
                stringBuilder.AppendLine(TranslatesUtils.GetHelpId("play"));
            }

            stringBuilder.AppendLine("");
            stringBuilder.AppendLine(String.Format(TranslatesUtils.GetInfoId("prix"), Module.Config.TicketPrix));
            stringBuilder.AppendLine(Module.Config.TicketMultiple ? TranslatesUtils.GetInfoId("multiple") : TranslatesUtils.GetInfoId("dontMultiple"));
            stringBuilder.AppendLine(String.Format(TranslatesUtils.GetInfoId("number"), Module.Config.MaxNumber));
            stringBuilder.AppendLine(String.Format(TranslatesUtils.GetInfoId("gain"), Module.Config.GainTotal));
            stringBuilder.AppendLine("");

            var win = PlayersUtils.PlayerWinLotto(base.Context.Player.IdentityId);

            if (win == null)
            {
                stringBuilder.AppendLine(TranslatesUtils.GetInfoId("dontRecove"));
            }
            else
            {
                long allGain = 0L;
                foreach (var item in win)
                {
                    allGain += item.gain;
                }

                stringBuilder.AppendLine(String.Format(TranslatesUtils.GetInfoId("recove"), win.Count, allGain));
            }

            stringBuilder.AppendLine("");
            stringBuilder.AppendLine("");
            stringBuilder.AppendLine("");
            stringBuilder.AppendLine(String.Format(TranslatesUtils.GetGeneralId("stats"), Module.Config.NumberTotalDraw, Module.Config.NumberTotalPlayersWin));

            DialogMessage dialogMessage = new DialogMessage(TranslatesUtils.GetInfoId("title"), TranslatesUtils.GetGeneralId("lotto"), stringBuilder.ToString());

            ModCommunication.SendMessageTo(dialogMessage, base.Context.Player.SteamUserId);
        }
Exemple #2
0
        public void Recove()
        {
            var win = PlayersUtils.PlayerWinLotto(base.Context.Player.IdentityId);

            if (win == null)
            {
                base.Context.Respond(TranslatesUtils.GetInfoId("dontRecove"), TranslatesUtils.GetGeneralId("lotto"), null);
                return;
            }

            foreach (var item in win)
            {
                base.Context.Respond(String.Format(TranslatesUtils.GetRespondId("recove"), item.gain), TranslatesUtils.GetGeneralId("lotto"), null);
                base.Context.Player.RequestChangeBalance(item.gain);
            }
        }