SA-MP Forums Archive
[HELP] About sa-mp custom launcher C# - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [HELP] About sa-mp custom launcher C# (/showthread.php?tid=637449)



[HELP] About sa-mp custom launcher C# - chikov - 14.07.2017

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);
                    }
                }
            }
        }



Re: [HELP] About sa-mp custom launcher C# - Vince - 14.07.2017

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.


Re: [HELP] About sa-mp custom launcher C# - RowdyrideR - 14.07.2017

[REMOVE]


Re: [HELP] About sa-mp custom launcher C# - orcununal - 13.12.2018

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


Re: [HELP] About sa-mp custom launcher C# - G4M30V3R - 13.12.2018

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