private void button4_Click(object sender, EventArgs e) { bool flag = false; if (tbIme.Text == "") { MessageBox.Show("Vnesete Ime!"); return; } if (cmbLevel.SelectedIndex == -1) { MessageBox.Show("Izberete level!"); return; } foreach (Player p in players) { if (p.Nickname == tbIme.Text) { flag = true; p.Poeni = 0; } } if (flag == false) { Player p = new Player(tbIme.Text, 0); players.Add(p); } //this.Hide(); if (cmbLevel.SelectedIndex == 0) { Program.Poeni = 0; Igra igra = new Igra(); if (igra.ShowDialog() == DialogResult.Cancel) { } } if (cmbLevel.SelectedIndex == 1) { Program.Poeni = 0; Igraa1 igra1 = new Igraa1(); if (igra1.ShowDialog() == DialogResult.Cancel) { } } if (cmbLevel.SelectedIndex == 2) { Program.Poeni = 0; Igra2 igra2 = new Igra2(); if (igra2.ShowDialog() == DialogResult.Cancel) { } } for (int i = 0; i < players.Count; i++) { if (players[i].Nickname == tbIme.Text) { players[i].Poeni = Program.Poeni; } } }