-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjobcreation.cs
415 lines (387 loc) · 12.3 KB
/
jobcreation.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DCFF
{
public partial class jobcreation : Form
{
int owmyass = 0;
SoundPlayer snd;
bool good_for_sound = false;
public jobcreation()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
ColorDialog cd = new ColorDialog();
cd.ShowDialog();
btn_CLR.BackColor = cd.Color;
}
private void jobcreation_Load(object sender, EventArgs e)
{
activate_volet(1);
activate_volet(2);
checkBox2.Enabled = false;
activate_volet(3);
activate_volet(4);
}
void activate_volet(int vol)
{
if (vol == 1)
{
gb_PERMISSION.Enabled = not(gb_PERMISSION.Enabled);
}
else if(vol == 2)
{
gb_TYPE.Enabled = not(gb_TYPE.Enabled);
}else if (vol == 3)
{
gb_SPAWN.Enabled = not(gb_SPAWN.Enabled);
}else if (vol == 4)
{
gb_OTHER.Enabled = not(gb_OTHER.Enabled);
}
}
bool not(bool input)
{
if (input == true)
{
return false;
}
else
{
return true;
}
}
private void checkBox2_CheckedChanged(object sender, EventArgs e)
{
activate_volet(2);
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
activate_volet(1);
}
private void checkBox3_CheckedChanged(object sender, EventArgs e)
{
activate_volet(3);
}
private void checkBox4_CheckedChanged(object sender, EventArgs e)
{
activate_volet(4);
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
/*MessageBox.Show(@"It just works, it just works
Little lies, stunning shows
People buy, money flows, it just works
It just works, it just works
Overpriced open worlds
Earnings rise, take my word
It just works
It just works
It just works
It just works");*/
if (textBox1.Text.Length > 0)
{
try
{
Clipboard.SetText(textBox1.Text);
}catch (Exception ex)
{
MessageBox.Show("Une erreur interne nous empêches d'utiliser le presse papier.");
}
owmyass = 0;
if (good_for_sound)
{
snd = new SoundPlayer(Properties.Resources.copied_text);
snd.Play();
}
}
else
{
owmyass += 1;
if (owmyass == 39)
{
if (good_for_sound)
{
snd = new SoundPlayer(Properties.Resources.bethesda);
snd.Play();
}
MessageBox.Show(@"It just works, it just works
Little lies, stunning shows
People buy, money flows, it just works
It just works, it just works
Overpriced open worlds
Earnings rise, take my word
It just works
It just works
It just works
It just works");
Clipboard.SetText(@"It just works, it just works
Little lies, stunning shows
People buy, money flows, it just works
It just works, it just works
Overpriced open worlds
Earnings rise, take my word
It just works
It just works
It just works
It just works");
}
else
{
if (good_for_sound)
{
snd = new SoundPlayer(Properties.Resources.ui_click);
snd.Play();
}
}
}
}
private void button1_Click_1(object sender, EventArgs e)
{
if (good_for_sound)
{
snd = new SoundPlayer(Properties.Resources.start_func);
snd.Play();
}
string tl = transform_lua();
if (not(tl == "none"))
{
textBox1.Text = transform_lua();
}
}
string transform_lua()
{
string basetxt = "";
bool g = true;
/*
* BASE
*/
// TEAM_ID
if (not(tb_TEAMID.Text == "") && g) {
tb_TEAMID.Text = tb_TEAMID.Text.Replace(" ", "_");
basetxt += tb_TEAMID.Text + " = DarkRP.createJob(\"";
}
else
{
MessageBox.Show("Une erreur est détecté !\n\nTEAM_ID INCORRECT");
return "none";
}
// NAME
if (not(tb_NAME.Text == "") && g)
{
basetxt += tb_NAME.Text + "\", {";
}
else
{
MessageBox.Show("Une erreur est détecté !\n\nNAME INCORRECT");
return "none";
}
// CATEGORY
if (not(tb_CATEGORY.Text == "") && g)
{
basetxt += "\n\tcategory = \"" + tb_CATEGORY.Text + "\",";
}
// MODEL
if (not(tb_MODEL.Text == "") && g)
{
if (tb_MODEL.Text.EndsWith(";")) { tb_MODEL.Text = tb_MODEL.Text.Substring(0, tb_MODEL.Text.Length - 1); }
basetxt += "\n\tmodel = {\"" + tb_MODEL.Text.Replace(";","\",\"") + "\"},";
}
else
{
MessageBox.Show("Une erreur est détecté !\n\nMODEL INCORRECT");
return "none";
}
/*
* JOB
*/
// COLOR
basetxt += "\n\tcolor = Color(" + btn_CLR.BackColor.R + "," + btn_CLR.BackColor.G + "," + btn_CLR.BackColor.B + "),";
// DESCRIPTIONS
if (not(tb_DESCRIPTION.Text == "") && g)
{
basetxt += "\n\tdescription = [[" + tb_DESCRIPTION.Text + "]],";
}
else
{
MessageBox.Show("Une erreur est détecté !\n\nDESCRIPTIONS INCORRECT");
return "none";
}
// COMMAND
if (not(tb_COMMAND.Text == "") && g)
{
tb_COMMAND.Text = tb_COMMAND.Text.Replace(" ", "_");
basetxt += "\n\tcommand = \"" + tb_COMMAND.Text + "\",";
}
else
{
MessageBox.Show("Une erreur est détecté !\n\nCOMMAND INCORRECT");
return "none";
}
// WEAPONS
if (not(tb_WEAPON.Text == "") && g)
{
if (tb_WEAPON.Text.EndsWith(";")) { tb_WEAPON.Text = tb_WEAPON.Text.Substring(0, tb_WEAPON.Text.Length - 1); }
basetxt += "\n\tweapons = {\"" + tb_WEAPON.Text.Replace(";", "\",\"").Replace(" ", "\",\"") + "\"},";
}
else
{
basetxt += "\n\tweapons = {},";
}
// Change
if (not(tb_CHANGE.Text == "") && g)
{
basetxt += "\n\tNeedToChangeFrom = \"" + tb_CHANGE.Text + "\",";
}
/*
* ECONOMY
*/
// SALARY
basetxt += "\n\tsalary = " + nud_SALARY.Value + ",";
// Max
basetxt += "\n\tmax = " + nud_MAX.Value + ",";
/*
* Permission
*/
if (gb_PERMISSION.Enabled == true)
{
// ACCESS
if (not(cbb_ACCESS.Text == "") && g)
{
basetxt += "admin = " + cbb_ACCESS.Text.Substring(1,1) + ",";
}
else
{
MessageBox.Show("Une erreur est détecté !\n\nACCESS INCORRECT");
return "none";
}
// VOTE
if (not(cbb_VOTE.Text == "") && g)
{
if (cbb_VOTE.Text.Substring(1, 4) == "true")
{
basetxt += "vote = true,";
}
else
{
basetxt += "vote = false,";
}
}
else
{
MessageBox.Show("Une erreur est détecté !\n\nVOTE INCORRECT");
return "none";
}
// LICENCE D'ARME
if (not(cbb_LICENCE.Text == "") && g)
{
if (cbb_LICENCE.Text.Substring(1, 4) == "true")
{
basetxt += "hasLicence = true,";
}
else
{
basetxt += "hasLicence = false,";
}
}
else
{
MessageBox.Show("Une erreur est détecté !\n\nLICENCE INCORRECT");
return "none";
}
// DEMOTE
if (not(cbb_DEMOTE.Text == "") && g)
{
if (cbb_DEMOTE.Text.Substring(1, 4) == "true")
{
basetxt += "canDemote = true,";
}
else
{
basetxt += "canDemote = false,";
}
}
else
{
MessageBox.Show("Une erreur est détecté !\n\nDEMOTE INCORRECT");
return "none";
}
}
else
{
basetxt += "\n\tadmin = 0,";
basetxt += "\n\tvote = false,";
basetxt += "\n\thasLicense = false,";
basetxt += "\n\tcanDemote = false,";
}
/*
* SPAWN
*/
if (gb_SPAWN.Enabled == true)
{
string t = "\n\tPlayerSpawn = function(ply)";
// HEALTH
t += "\n\t\tply:SetHealth(" + nud_HEALTH.Value + ")";
t += "\n\t\tply:SetMaxHealth(" + nud_HEALTH.Value + ")";
// Armor
if (nud_ARMOR.Value > 0)
{
t += "\n\t\tply:SetArmor(" + nud_ARMOR.Value + ")";
t += "\n\t\tply:SetMaxArmor(" + nud_ARMOR.Value + ")";
}
t += "\n\tend,";
basetxt += t;
}
/*
* OTHER
*/
if (gb_OTHER.Enabled == true)
{
// DEMOTE-DEATH
if (not(cbb_DEMOTEDEATH.Text == "") && g)
{
if (cbb_DEMOTEDEATH.Text.Substring(1, 4) == "true")
{
string t = "";
t += "\n\tPlayerDeath = function(ply,weapon;killer)";
t += "\n\t\tply:TeamBan()";
t += "\n\t\tply:changeTEAM(GAMEMODE.DefaultTeam, true)";
if (not(tb_MESSAGEDEMOTE.Text == ""))
{
t += "\n\t\tDarkRP.notifyAll(0,4, \"" + tb_MESSAGEDEMOTE + "\"";
}
t += "\n\tend,";
}
}
else
{
MessageBox.Show("Une erreur est détecté !\n\nDEMOTE-DEATH INCORRECT");
return "none";
}
}
if (not(g))
{
basetxt = "none";
}
else
{
basetxt += "\n})";
}
return basetxt;
}
private void checkBox5_CheckedChanged(object sender, EventArgs e)
{
good_for_sound = not(good_for_sound);
}
}
}