14.07.2017, 19:06
I need someone who understand visual studio c#, i make custom launcher design and all thath, but i can't fix the play button, i have this code, and i have no errors while compile, and when i test the launcher i type nickname and hit play a get error on line: Process.Start("samp.exe", ip+password); it says that can't be found location, Note: I want to launch to server with server password. (Sorry for bad english gramar.....) Also if someone have code for detecting cleo and ****** i will be thankfulll <3
Код:
private void play_Click(object sender, EventArgs e)
{
string ip = "192.168.1.2:7777";
string password = "pass";
if (username.Text.Length == 0)
{
MessageBox.Show("You didin't entered a name", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else if (username.Text.Length < 3)
{
MessageBox.Show("Your name is too short", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
else
{
using (RegistryKey key = Registry.ClassesRoot.OpenSubKey(@"samp\shell\open\command\"))
{
if (key == null)
{
MessageBox.Show("Install 0.3.7 client to play", "Error");
}
else
{
key.Close();
Registry.CurrentUser.OpenSubKey(@"Software\SAMP", true).SetValue("PlayerName", username.Text);
Process.Start("samp.exe", ip+password);
}
}
}
}

