-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathForm1.cs
63 lines (52 loc) · 1.46 KB
/
Form1.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System.Diagnostics;
namespace GTASALauncher
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private enum GAME_SELECTION
{
GTA,
MTA,
SAMP
}
private string GTA_PATH = "gta_sa.exe";
private string MTA_PATH = "C:\\Program Files (x86)\\MTA San Andreas 1.6\\Multi Theft Auto.exe";
private string SAMP_PATH = "samp.exe";
private void run(GAME_SELECTION game)
{
string path;
if (game == GAME_SELECTION.GTA)
path = GTA_PATH;
else if (game == GAME_SELECTION.MTA)
path = MTA_PATH;
else
path = SAMP_PATH;
var process = Process.Start(path);
this.Hide();
process.WaitForExit();
Application.Exit();
}
// GTA SA
private void button1_Click(object sender, EventArgs e)
{
run(GAME_SELECTION.GTA);
}
// MTA
private void button2_Click(object sender, EventArgs e)
{
run(GAME_SELECTION.MTA);
}
// SAMP
private void button3_Click(object sender, EventArgs e)
{
run(GAME_SELECTION.SAMP);
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}