Esempio n. 1
0
        public MainClient()
        {
            PersonalVehicleController = new PersonalVehicleController();

            InteractionMenu = new InteractionMenu();
            InteractionMenu.CreateMenu();

            API.StatSetInt((uint)API.GetHashKey("MP0_STAMINA"), 100, true);
            API.RegisterCommand("passive", new Action(Gameplay.PassiveMode.Enable), false);

            Client.Players.Colors.Setup();

            WorldContent.WeaponPickups.CreatePickups();

            HUD.Blips.Create();
            HUD.GamerTags.Create();

            API.SetRadarBigmapEnabled(false, false);

            playerList = new Playerlist();

            wastedScreen = new WastedScreen();

            Tick += OnTick;
        }
Esempio n. 2
0
        public BXH GetTop10()
        {
            cnn.Open();
            SqlCommand com = new SqlCommand("select top 10 * from BangXepHang order by SoDiem desc", cnn);

            com.CommandType = CommandType.Text;
            SqlDataAdapter adapter = new SqlDataAdapter(com);
            DataTable      tb      = new DataTable();

            com.ExecuteNonQuery();

            adapter.Fill(tb);
            BXH        bxh  = new BXH();
            Playerlist list = new Playerlist();

            for (int i = 0; i < tb.Rows.Count; i++)
            {
                DateTime date   = (DateTime)tb.Rows[i][1];
                Player   player = new Player(tb.Rows[i][0].ToString(), Int32.Parse(tb.Rows[i][2].ToString()), date.ToString());
                list.AddPlayer(player);
            }
            bxh.ListPlayer = list;
            cnn.Close();
            return(bxh);
        }
Esempio n. 3
0
        public Stage(Playerlist l, Form x, WindowsMediaPlayer y)
        {
            InitializeComponent();
            QLTD.SetPlayerlist(l);
            Numplayer      = QLTD.PlayerList().ListPLayer.Count;
            parent         = x;
            hinhChiecNon   = ChiecNonBitmap;
            DoubleBuffered = true;
            wplayer        = y;

            TopicBUS topic = new TopicBUS();

            QLQN.GetListPoint();
            List <ChuDe> list = topic.GetAllTopics();

            for (int i = 0; i < list.Count; i++)
            {
                comboBoxTopic.Items.Add(list[i].NameTopic);
            }

            RuleBUS data = new RuleBUS();

            qd            = data.GetGuideLine();
            TimeCountDown = qd.TimeForAnswer;

            timer1.Interval           = 500;
            timer1.Tick              += Timer1_Tick;
            timerWin.Interval         = 500;
            timerWin.Tick            += TimerWin_Tick;
            timerFinishRound.Interval = 500;
            timerFinishRound.Tick    += TimerFinishRound_Tick;
            timerCountDown.Interval   = 1000;
            timerCountDown.Tick      += TimerCountDown_Tick;
            labelRound.Text           = "Vòng " + Round;
            labelCountDown.Text       = TimeCountDown.ToString();
            // qd.NumberRound = 1;
        }
Esempio n. 4
0
 private void HandlePlayerNumberList(string username, int playerNumber)
 {
     Playerlist.Add(new PlayerInGameData(username, playerNumber));
 }
Esempio n. 5
0
        private void rectangleShapeNext_MouseClick(object sender, MouseEventArgs e)
        {
            soundButton.Play();

            bool          isSame  = false;
            bool          isEmpty = false;
            bool          isOK    = true;
            List <string> l       = new List <string>();
            Regex         reg     = new Regex("^[A-Za-z0-9]+$", RegexOptions.IgnoreCase);

            if (Numplayer == 2)
            {
                if (textBoxPlayer1.Text == "" || textBoxPlayer2.Text == "")
                {
                    isEmpty = true;
                }
                else
                if (!reg.IsMatch(textBoxPlayer1.Text) || !reg.IsMatch(textBoxPlayer2.Text))
                {
                    isOK = false;
                }
                else
                if (textBoxPlayer1.Text != "" && textBoxPlayer2.Text != "")
                {
                    l.Add(textBoxPlayer1.Text);
                    l.Add(textBoxPlayer2.Text);
                }
            }
            else if (Numplayer == 3)
            {
                if (textBoxPlayer1.Text == "" || textBoxPlayer2.Text == "" || textBoxPlayer3.Text == "")
                {
                    isEmpty = true;
                }
                else
                if (!reg.IsMatch(textBoxPlayer1.Text) || !reg.IsMatch(textBoxPlayer2.Text) || !reg.IsMatch(textBoxPlayer3.Text))
                {
                    isOK = false;
                }
                else
                if (textBoxPlayer1.Text != "" && textBoxPlayer2.Text != "" && textBoxPlayer3.Text != "")
                {
                    l.Add(textBoxPlayer1.Text);
                    l.Add(textBoxPlayer2.Text);
                    l.Add(textBoxPlayer3.Text);
                }
            }
            else if (Numplayer == 4)
            {
                if (textBoxPlayer1.Text == "" || textBoxPlayer2.Text == "" || textBoxPlayer3.Text == "" || textBoxPlayer4.Text
                    == "")
                {
                    isEmpty = true;
                }
                else
                if (!reg.IsMatch(textBoxPlayer1.Text) || !reg.IsMatch(textBoxPlayer2.Text) || !reg.IsMatch(textBoxPlayer3.Text) || !reg.IsMatch(textBoxPlayer4.Text))
                {
                    isOK = false;
                }
                else
                if (textBoxPlayer1.Text != "" && textBoxPlayer2.Text != "" && textBoxPlayer3.Text != "" && textBoxPlayer4.Text != "")
                {
                    l.Add(textBoxPlayer1.Text);
                    l.Add(textBoxPlayer2.Text);
                    l.Add(textBoxPlayer3.Text);
                    l.Add(textBoxPlayer4.Text);
                }
            }

            if (isEmpty)
            {
                labelAlert.Visible = true;
                labelAlert.Text    = "Nickname Không Được Để Trống!";
            }
            else
            if (!isOK)
            {
                labelAlert.Visible = true;
                labelAlert.Text    = "Nickname gồm các kí tự hoa, thường và chữ số!";
            }
            else
            {
                for (int i = 0; i < l.Count; i++)
                {
                    for (int j = 0; j < l.Count; j++)
                    {
                        if (j != i)
                        {
                            if (l[i] == l[j])
                            {
                                isSame = true;
                                break;
                            }
                        }
                    }
                }
                if (isSame)
                {
                    labelAlert.Visible = true;
                    labelAlert.Text    = "Hãy Nhập Nickname Khác Nhau!";
                }
                else
                {
                    labelAlert.Visible = false;
                    Playerlist listPlayer = new Playerlist();
                    string     date       = DateTime.Now.ToString("MM-dd-yyyy HH:mm:ss");
                    for (int i = 0; i < l.Count; i++)
                    {
                        listPlayer.AddPlayer(new Player(l[i], 0, date));
                    }

                    Stage stg = new Stage(listPlayer, parent, wplayer);
                    wplayer.controls.stop();
                    this.Close();
                    stg.Show();
                }
            }
        }