PDA

View Full Version : [HELP] About sa-mp custom launcher C#


chikov
14/07/2017, 08:06 PM
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);
}
}
}
}

Vince
14/07/2017, 08:13 PM
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.

RowdyrideR
14/07/2017, 09:42 PM
[REMOVE]

orcununal
13/12/2018, 10:49 AM
Username textbox how to add? #c(Bad english.)

G4M30V3R
13/12/2018, 11:14 AM
Process.Start("path/file.exe", args);