[HELP] About sa-mp custom launcher C#
#1

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);
                    }
                }
            }
        }
Reply
#2

This is going to sound condescending (and it probably is) but what's the deal with these custom launchers? It's just an application with one button that launches the client. As if selecting the server in the favorites list and clicking play is such a big deal. And I think I and many others here are not particularly interested in littering our systems with applications from questionable origins that could do god knows what on our systems.
Reply
#3

[REMOVE]
Reply
#4

Username textbox how to add? #c(Bad english.)
Reply
#5

Код:
Process.Start("path/file.exe", args);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)