private void AddUserBtn_Click(object sender, EventArgs e) { if (Program.UserInfo.Team == string.Empty) { MessageBox.Show("You are not in a team.", "No u", MessageBoxButtons.OK); return; } if(Program.UserInfo.TeamRank <= 0) { MessageBox.Show("Your rank is too low.", "No u", MessageBoxButtons.OK); return; } var form = new Input_frm("Add Team Member","Enter Users name","Send","Cancel"); form.InputBox.MaxLength = 14; if(form.ShowDialog() == DialogResult.OK) { Program.ChatServer.SendPacket("ADMIN||TEAMADD||" + form.InputBox.Text); } }
private void Getitem(object handler, EventArgs e) { bool input = (((Button)handler).Name[0].ToString() == "1" ? true:false); string servercommand = ((Button)handler).Name.Substring(1); if (input) { if (servercommand != "DEVCOLOR") { Input_frm form = new Input_frm("Input", descriptions[servercommand], "Confirm", "Cancel"); if (servercommand != "DEVCREATETEAM" && servercommand != "DEVMSG") form.InputBox.KeyDown += new KeyEventHandler(Suppress_Space); if (servercommand == "DEVCREATETEAM") form.InputBox.MaxLength = 20; else if (servercommand == "DEVMSG") form.InputBox.MaxLength = 250; else form.InputBox.MaxLength = 14; if (form.ShowDialog() == DialogResult.OK) { if (form.InputBox.Text == "") { MessageBox.Show("Input cannot be empty"); return; } Program.ChatServer.SendPacket("DEVPOINTS||" + servercommand + "||" + form.InputBox.Text.Trim()); } } else { ColorDialog selectcolor = new ColorDialog(); if (selectcolor.ShowDialog() == DialogResult.OK) { Program.ChatServer.SendPacket("DEVPOINTS||" + servercommand + "||" + selectcolor.Color.R + "," + selectcolor.Color.G + "," + selectcolor.Color.B); } } } else { if(MessageBox.Show("Confirm","Are you sure?",MessageBoxButtons.YesNo) == DialogResult.Yes) { Program.ChatServer.SendPacket("DEVPOINTS||" + servercommand); } } }