View difference between Paste ID: mDAS5PNn and qGD7kL9g
SHOW: | | - or go back to the newest paste.
1
/*
2
Script Title: zAdmin
3
Scripter: zDivine aka Mercenary
4
Script Date: 20130516 (YYYYMMDD)
5
Script Version: 1.0.1.0
6
*/
7
8
/*
9
SCRIPT CHANGELOG:
10
11-
~ Version 1.0.0.0 ~
11+
~ Version 1.0.0.0 ~ (20130516)
12
	- Initial Release
13
	
14-
~ Version 1.0.1.0 ~
14+
~ Version 1.0.1.0 ~ (20130517)
15
	- Added 10 new Admin commands
16
	- Added VIP system with 5 commands (Dynamic command levels)
17
	- Added zAdmin health system (tog-gable)
18
	- Added VIP alerting for Admins
19
*/
20
21
#define FILTERSCRIPT
22
23
// ----- [INCLUDES] -----
24
#include <a_samp>
25
#include <zcmd>
26
#include <sscanf2>
27
#include <YSI\y_ini>
28
#include <YSI\y_timers>
29
#include <foreach>
30
// ----------------------
31
32
#if defined FILTERSCRIPT
33
34
// ----- [COL DEFINES] -----
35
#define COL_NICEGREEN      "{6EF83C}"
36
#define COL_NICERED        "{FF0606}"
37
#define COL_GREY           "{AFAFAF}"
38
#define COL_ORANGE         "{FFAF00}"
39
#define COL_EASY           "{FFF1AF}"
40
#define COL_WHITE          "{FFFFFF}"
41
#define COL_BLACK          "{0E0101}"
42
#define COL_RED            "{A80000}"
43
#define COL_YELLOW         "{F3FF02}"
44
#define COL_YELLOW2        "{DAE368}"
45
#define COL_BYELLOW        "{FFFF80}"
46
#define COL_LIME           "{B7FF00}"
47
#define COL_CYAN           "{00FFEE}"
48
#define COL_LIGHTBLUE      "{00C0FF}"
49
#define COL_BLUE           "{0049FF}"
50
#define COL_MAGENTA        "{F300FF}"
51
#define COL_VIOLET         "{B700FF}"
52
#define COL_PINK           "{FF00EA}"
53
#define COL_MARONE         "{A90202}"
54
#define COL_CMD            "{B8FF02}"
55
#define COL_PARAM          "{3FCD02}"
56
#define COL_SERVER         "{AFE7FF}"
57
#define COL_VALUE          "{A3E4FF}"
58
#define COL_RULE           "{F9E8B7}"
59
#define COL_RULE2          "{FBDF89}"
60
#define COL_RWHITE         "{FFFFFF}"
61
#define COL_LGREEN         "{C9FFAB}"
62
#define COL_LRED           "{FFA1A1}"
63
#define COL_LRED2          "{C77D87}"
64
#define COL_GREEN          "{00BC2E}"
65
#define COL_LBLUE          "{00A5FF}"
66
#define COL_GRAD2          "{BFC0C2}"
67
#define COL_REALRED        "{FF0606}"
68
#define COL_PURPLE         "{C2A2DA}"
69
// -------------------------
70
71
// ----- [COLORS] -----
72
#define COLOR_NICEGREEN      0x6EF83CFF
73
#define COLOR_NICERED        0xFF0606FF
74
#define COLOR_GREY           0xAFAFAFFF
75
#define COLOR_ORANGE         0xFFAF00FF
76
#define COLOR_EASY           0xFFF1AFFF
77
#define COLOR_WHITE          0xFFFFFFFF
78
#define COLOR_BLACK          0x0E0101FF
79
#define COLOR_RED            0xA80000FF
80
#define COLOR_YELLOW         0xF3FF02FF
81
#define COLOR_YELLOW2        0xDAE368FF
82
#define COLOR_BYELLOW        0xFFFF80FF
83
#define COLOR_LIME           0xB7FF00FF
84
#define COLOR_CYAN           0x00FFEEFF
85
#define COLOR_LIGHTBLUE      0x00C0FFFF
86
#define COLOR_BLUE           0x0049FFFF
87
#define COLOR_MAGENTA        0xF300FFFF
88
#define COLOR_VIOLET         0xB700FFFF
89
#define COLOR_PINK           0xFF00EAFF
90
#define COLOR_MARONE         0xA90202FF
91
#define COLOR_CMD            0xB8FF02FF
92
#define COLOR_PARAM          0x3FCD02FF
93
#define COLOR_SERVER         0xAFE7FFFF
94
#define COLOR_VALUE          0xA3E4FFFF
95
#define COLOR_RULE           0xF9E8B7FF
96
#define COLOR_RULE2          0xFBDF89FF
97
#define COLOR_RWHITE         0xFFFFFFFF
98
#define COLOR_LGREEN         0xC9FFABFF
99
#define COLOR_LRED           0xFFA1A1FF
100
#define COLOR_LRED2          0xC77D87FF
101
#define COLOR_GREEN          0x00BC2EFF
102
#define COLOR_LBLUE          0x00A5FFFF
103
#define COLOR_GRAD2          0xBFC0C2FF
104
#define COLOR_REALRED        0xFF0606FF
105
#define COLOR_FADE1 		 0xE6E6E6E6
106
#define COLOR_FADE2 		 0xC8C8C8C8
107
#define COLOR_FADE3 		 0xAAAAAAAA
108
#define COLOR_FADE4 		 0x8C8C8C8C
109
#define COLOR_FADE5 		 0x6E6E6E6E
110
#define COLOR_PURPLE 		 0xC2A2DAAA
111
112
forward fcreate(filename[]);
113
public fcreate(filename[])
114
{
115
    if (fexist(filename)){return false;}
116
    new File:fhandle = fopen(filename,io_write);
117
    fclose(fhandle);
118
    return true;
119
}
120
121
public OnFilterScriptInit()
122
{
123
	// ----- [LOADING SERVER SETTINGS] -----
124
	LoadCommands();
125
	LoadVIPCommands();
126
	// -------------------------------------
127
	
128
	// ----- [FILE CHECKS] -----
129
	if(!fexist("zAdmin/commands.cfg"))
130
	{
131
	    print("WARNING: The commands.cfg file was missing, so it was automatically created.");
132
		fcreate("zAdmin/commands.cfg");
133
		SetCommandDefaults();
134
	}
135
	if(!fexist("zAdmin/bans.cfg"))
136
	{
137
	    print("WARNING: The bans.cfg file was missing, so it was automatically created.");
138
	    fcreate("zAdmin/bans.cfg");
139
	}
140-
	if(!fexist("/zAdmin/vipcommands.cfg"))
140+
	if(!fexist("zAdmin/vipcommands.cfg"))
141
	{
142
	    print("WARNING: The vipcommands.cfg file was missing, so it was automatically created.");
143
	    fcreate("zAdmin/vipcommands.cfg");
144
	}
145
	// -------------------------
146
	print("\n--------------------------------------");
147
	print(" zDivine's Admin System Loaded.");
148
	print("--------------------------------------\n");
149
	
150
	foreach(Player, i)
151
	{
152
	    if(IsPlayerConnected(i))
153
	    {
154
	        INI_ParseFile(UserPath(i), "LoadUser_%s", .bExtra = true, .extra = i);
155
	        SetTimerEx("UnsetLogin", 500, 0, "i", i);
156
	    }
157
	}
158
	return 1;
159
}
160
161
public OnFilterScriptExit()
162
{
163
	// ----- [SAVING SERVER SETTINGS] -----
164
	SaveCommands();
165
	SaveVIPCommands();
166
	// ------------------------------------
167
	return 1;
168
}
169
170
#endif
171
172
// ----- [SERVER SETTINGS] -----
173
174
#define USER_ACCOUNTS "zAdmin/Users/%s.ini"
175
#define PRESSED(%0) \
176
    (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
177
// -----------------------------
178
179
// ----- [DIALOGS] -----
180
#define     DIALOG_LOGIN        1
181
#define     DIALOG_REGISTER     2
182
#define     DIALOG_CMD_MAIN     3
183
#define     DIALOG_CMD_EDIT     4
184
#define     DIALOG_VCMD_MAIN    5
185
// ---------------------
186
187
// ----- [VARIABLES] -----
188
new bool: pLogged[MAX_PLAYERS] = false;
189
new bool: pFrozen[MAX_PLAYERS] = false;
190
191
// INFP: 1 = TRUE / 0 = FALSE
192
new bool: 	USE_ZADMIN_POSITION 	  	= true;
193
new bool: 	USE_ZADMIN_SKIN     	  	= true;
194
new bool: 	USE_ZADMIN_MONEY   	  		= true;
195
new bool: 	USE_ZADMIN_HEALTHARMOUR 	= true;
196
197
// ----- [VIP SYSTEM] -----
198
new bool:   ZADMIN_VIP_ALERT            = true;
199
// ------------------------
200
// -----------------------
201
202
// ----- [ENUMS] -----
203
enum p_Info
204
{
205
	p_Pass[64],
206
	p_Admin,
207
	p_IP[16],
208
	p_Level,
209
	p_Cash,
210
	p_Skin,
211
	Float: p_PosX,
212
	Float: p_PosY,
213
	Float: p_PosZ,
214
	Float: p_PosA,
215
	p_Banned,
216
	p_Isolated,
217
	p_IsolationTime,
218
	p_Muted,
219
	Float: p_Health,
220
	Float: p_Armour,
221
	p_VIP
222
}
223
new PI[MAX_PLAYERS][p_Info];
224
225
enum cmd_Info
226
{
227
	cmd_SetAdmin,
228
	cmd_Kick,
229
	cmd_Ban,
230
	cmd_Unban,
231
	cmd_Freeze,
232
	cmd_Unfreeze,
233
	cmd_Slap,
234
	cmd_Isolate,
235
	cmd_Unisolate,
236
	cmd_SetHealth,
237
	cmd_SetArmour,
238
	cmd_GiveGun,
239
	cmd_GiveCar,
240
	cmd_TakeGuns,
241
	cmd_Goto,
242
	cmd_GetHere,
243
	cmd_Explode,
244
	cmd_BanIP,
245
	cmd_UnbanIP,
246
	cmd_SetSkin,
247
	cmd_FreezeAll,
248
	cmd_UnfreezeAll,
249
	cmd_GetAllHere,
250
	cmd_KickAll,
251
	cmd_Ann,
252
	cmd_SetColor,
253
	cmd_MakeVIP,
254
	cmd_GotoLoc,
255
	cmd_SaveCFGs,
256
	cmd_VIPAlert
257
};
258
new CI[cmd_Info];
259
260
enum vcmd_Info
261
{
262
	vcmd_Car,
263
	vcmd_Gun,
264
	vcmd_Heal,
265
	vcmd_Fix,
266
	vcmd_VC
267
};
268
new VCI[vcmd_Info];
269
// -------------------
270
271
// ----- [TIMERS/TASKS] -----
272
task MinuteCount[60000]()
273
{
274
	foreach(Player, i)
275
	{
276
	    if(PI[i][p_Isolated] == 1)
277
	    {
278
	        if(PI[i][p_IsolationTime] > 0)
279
	        {
280
	            PI[i][p_IsolationTime]--;
281
	        }
282
	        else
283
	        {
284
	            new Float: x, Float: y, Float: z;
285
	            GetPlayerPos(i, x, y, z);
286
	            SetPlayerPos(i, x, y, z-2000);
287
				TogglePlayerControllable(i, 1);
288
				PI[i][p_Isolated] = 0;
289
				GameTextForPlayer(i, "~g~UN-ISOLATED!", 3000, 5);
290
	        }
291
	    }
292
	}
293
}
294
forward UnsetLogin(playerid);
295
public UnsetLogin(playerid)
296
{
297
	new string[256];
298
    format(string, sizeof(string), ""COL_WHITE"Welcome, "COL_LIGHTBLUE"%s\n\n"COL_WHITE"Account status: "COL_NICEGREEN"Registered\n\n"COL_WHITE"Please enter your password below to login.", GetName(playerid));
299
    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "zAdmin - Login", string, "Login", "Quit");
300
	return 1;
301
}
302
// --------------------------
303
304
// ----- [STOCKS] -----
305
stock udb_hash(buf[])
306
{
307
    new length=strlen(buf);
308
    new s1 = 1;
309
    new s2 = 0;
310
    new n;
311
    for (n=0; n<length; n++)
312
    {
313
       s1 = (s1 + buf[n]) % 65521;
314
       s2 = (s2 + s1)     % 65521;
315
    }
316
    return (s2 << 16) + s1;
317
}
318
stock GetAdminName(playerid)
319
{
320
	new aname[24];
321
	switch(PI[playerid][p_Admin])
322
	{
323
	    case 1: aname = "Moderator";
324
	    case 2: aname = "Administator";
325
	    case 3: aname = "Head Administrator";
326
	    case 4: aname = "Executive Administrator";
327
	    default: aname = "Player";
328
	}
329
	return aname;
330
}
331
stock GetName(playerid)
332
{
333
	new pname[MAX_PLAYER_NAME], i_pos;
334
	GetPlayerName(playerid, pname, sizeof(pname));
335
	while((i_pos = strfind(pname, "_", false, i_pos)) != -1) pname[i_pos] = ' ';
336
	return pname;
337
}
338
stock UserPath(playerid)
339
{
340
	new pname[MAX_PLAYER_NAME], string[64];
341
	GetPlayerName(playerid, pname, sizeof(pname));
342
	format(string, sizeof(string), USER_ACCOUNTS, pname);
343
	return string;
344
}
345
stock SendPermissionError(playerid)
346
{
347
	SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You are not permitted to use this command ::.");
348
}
349
stock SendConnectionError(playerid)
350
{
351
    SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Player not connected ::.");
352
    return 1;
353
}
354
stock CheckBan(ip[])
355
{
356
	new string[128];
357
	new File: file = fopen("zAdmin/bans.cfg", io_read);
358
	while(fread(file, string))
359
	{
360
	    if(strcmp(ip, string, true, strlen(ip)) == 0)
361
	    {
362
	        fclose(file);
363
	        return 1;
364
	    }
365
	}
366
	fclose(file);
367
	return 0;
368
}
369
stock AddBan(ip[])
370
{
371
	if(CheckBan(ip) == 0)
372
	{
373
	    new File: file = fopen("zAdmin/bans.cfg", io_write);
374
	    new string[20];
375
	    format(string, sizeof(string), "\n%s", ip);
376
	    fwrite(file, string);
377
	    fclose(file);
378
	    for(new i = 0; i < MAX_PLAYERS; i++)
379
	    {
380
	        new pIP[16];
381
	        GetPlayerIp(i, pIP, sizeof(pIP));
382
	        if(strcmp(pIP, ip) == 0)
383
	        {
384
	            SendClientMessage(i, COLOR_WHITE, "SERVER: You are banned from this server.");
385
	            Kick(i);
386
	        }
387
	    }
388
	    return 1;
389
	}
390
	return 0;
391
}
392
stock RemoveBan(ip[])
393
{
394
	if(CheckBan(ip) == 1)
395
	{
396
	    new string[20];
397
	    new File: file = fopen("zAdmin/bans.cfg", io_read);
398
	    fcreate("zAdmin/tmpban.cfg");
399
	    new File: file2 = fopen("zAdmin/tmpban.cfg", io_append);
400
	    while(fread(file, string))
401
	    {
402
	        if(strcmp(ip, string, true, strlen(ip)) != 0 && strcmp("\n", string) != 0)
403
	        {
404
	            fwrite(file2, string);
405
	        }
406
	    }
407
	    fclose(file);
408
	    fclose(file2);
409
	    file = fopen("zAdmin/bans.cfg", io_write);
410
	    file2 = fopen("zAdmin/tmpban.cfg", io_read);
411
	    while(fread(file2, string))
412
	    {
413
	        fwrite(file, string);
414
	    }
415
	    fclose(file);
416
	    fclose(file2);
417
	    fremove("zAdmin/tmpban.cfg");
418
		return 1;
419
	}
420
	return 0;
421
}
422
stock SetCommandDefaults()
423
{
424
    CI[cmd_SetAdmin] = 1;
425
	CI[cmd_Kick] = 1;
426
	CI[cmd_Ban] = 1;
427
	CI[cmd_Unban] = 1;
428
	CI[cmd_Freeze] = 1;
429
	CI[cmd_Unfreeze] = 1;
430
	CI[cmd_Slap] = 1;
431
    CI[cmd_Isolate] = 1;
432
    CI[cmd_Unisolate] = 1;
433
    CI[cmd_SetHealth] = 1;
434
    CI[cmd_SetArmour] = 1;
435
    CI[cmd_GiveGun] = 1;
436
    CI[cmd_GiveCar] = 1;
437
    CI[cmd_TakeGuns] = 1;
438
    CI[cmd_Goto] = 1;
439
    CI[cmd_GetHere] = 1;
440
    CI[cmd_Explode] = 1;
441
    CI[cmd_BanIP] = 1;
442
	CI[cmd_UnbanIP] = 1;
443
	CI[cmd_FreezeAll] = 1;
444
	CI[cmd_UnfreezeAll] = 1;
445
	CI[cmd_GetAllHere] = 1;
446
	CI[cmd_KickAll] = 1;
447
	CI[cmd_Ann] = 1;
448
	CI[cmd_SetColor] = 1;
449
	CI[cmd_MakeVIP] = 1;
450
	CI[cmd_GotoLoc] = 1;
451
	CI[cmd_SaveCFGs] = 1;
452
	SaveCommands();
453
}
454
stock SendAdminMessage(color, string[])
455
{
456
	foreach(Player, i)
457
	{
458
	    if(PI[i][p_Admin] >= 1)
459
	    {
460
	        SendClientMessage(i, color, string);
461
	    }
462
	}
463
}
464
// --------------------
465
466
// ----- [SAVING/LOADING] -----
467
forward SaveAccount(playerid);
468
public SaveAccount(playerid)
469
{
470
	if(pLogged[playerid] == true)
471
	{
472
	    new Float: x, Float: y, Float: z, Float: a;
473
	    GetPlayerPos(playerid, x, y, z);
474
	    GetPlayerFacingAngle(playerid, a);
475
	    
476
	    PI[playerid][p_PosX] = x;
477
	    PI[playerid][p_PosY] = y;
478
	    PI[playerid][p_PosZ] = z;
479
	    PI[playerid][p_PosA] = a;
480
	    
481
		new INI:File = INI_Open(UserPath(playerid));
482
		INI_SetTag(File, "data");
483
		INI_WriteInt(File, "Admin", PI[playerid][p_Admin]);
484
		INI_WriteString(File, "IP", PI[playerid][p_IP]);
485
		INI_WriteInt(File, "Level", PI[playerid][p_Level]);
486
		INI_WriteInt(File, "Cash", PI[playerid][p_Cash]);
487
		INI_WriteInt(File, "Skin", PI[playerid][p_Skin]);
488
		INI_WriteFloat(File, "PosX", PI[playerid][p_PosX]);
489
		INI_WriteFloat(File, "PosY", PI[playerid][p_PosY]);
490
		INI_WriteFloat(File, "PosZ", PI[playerid][p_PosZ]);
491
		INI_WriteFloat(File, "PosA", PI[playerid][p_PosA]);
492
		INI_WriteInt(File, "Banned", PI[playerid][p_Banned]);
493
		INI_WriteInt(File, "Isolated", PI[playerid][p_Isolated]);
494
		INI_WriteInt(File, "IsolationTime", PI[playerid][p_IsolationTime]);
495
		INI_WriteInt(File, "Muted", PI[playerid][p_Muted]);
496
		INI_WriteFloat(File, "Health", PI[playerid][p_Health]);
497
		INI_WriteFloat(File, "Armour", PI[playerid][p_Armour]);
498
		INI_WriteInt(File, "VIP", PI[playerid][p_VIP]);
499
		INI_Close(File);
500
	}
501
	return 1;
502
}
503
forward LoadUser_data(playerid, name[], value[]);
504
public LoadUser_data(playerid, name[], value[])
505
{
506
	INI_Int("Password", PI[playerid][p_Pass]);
507
	INI_Int("Admin", PI[playerid][p_Admin]);
508
	INI_String("IP", PI[playerid][p_IP], 16);
509
	INI_Int("Level", PI[playerid][p_Level]);
510
	INI_Int("Cash", PI[playerid][p_Cash]);
511
	INI_Int("Skin", PI[playerid][p_Skin]);
512
	INI_Float("PosX", PI[playerid][p_PosX]);
513
	INI_Float("PosY", PI[playerid][p_PosY]);
514
	INI_Float("PosZ", PI[playerid][p_PosZ]);
515
	INI_Float("PosA", PI[playerid][p_PosA]);
516
	INI_Int("Banned", PI[playerid][p_Banned]);
517
	INI_Int("Isolated", PI[playerid][p_Isolated]);
518
	INI_Int("IsolationTime", PI[playerid][p_IsolationTime]);
519
	INI_Int("Muted", PI[playerid][p_Muted]);
520
	INI_Float("Health", PI[playerid][p_Health]);
521
	INI_Float("Armour", PI[playerid][p_Armour]);
522
	INI_Int("VIP", PI[playerid][p_VIP]);
523
	return 1;
524
}
525
stock SaveVIPCommands()
526
{
527
	new string[128];
528
	new File: file  = fopen("zAdmin/vipcommands.cfg", io_write);
529
	format(string, sizeof(string), "%d|%d|%d|%d|%d",
530
	VCI[vcmd_Car],
531
	VCI[vcmd_Gun],
532
	VCI[vcmd_Heal],
533
	VCI[vcmd_Fix],
534
	VCI[vcmd_VC]);
535
	fwrite(file, string);
536
	fclose(file);
537
	return 1;
538
}
539
stock LoadVIPCommands()
540
{
541
	new string[128];
542
	new File: file = fopen("zAdmin/vipcommands.cfg", io_read);
543
	sscanf(string, "p<|>iiiii",
544
	VCI[vcmd_Car],
545
	VCI[vcmd_Gun],
546
	VCI[vcmd_Heal],
547
	VCI[vcmd_Fix],
548
	VCI[vcmd_VC]);
549
	fclose(file);
550
	return 1;
551
}
552
stock SaveCommands()
553
{
554
	new string[128];
555
	new File: file = fopen("zAdmin/commands.cfg", io_write);
556
	format(string, sizeof(string), "%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d",
557
	CI[cmd_SetAdmin],
558
	CI[cmd_Kick],
559
	CI[cmd_Ban],
560
	CI[cmd_Unban],
561
	CI[cmd_Freeze],
562
	CI[cmd_Unfreeze],
563
	CI[cmd_Slap],
564
    CI[cmd_Isolate],
565
    CI[cmd_Unisolate],
566
    CI[cmd_SetHealth],
567
    CI[cmd_SetArmour],
568
    CI[cmd_GiveGun],
569
    CI[cmd_GiveCar],
570
    CI[cmd_TakeGuns],
571
    CI[cmd_Goto],
572
    CI[cmd_GetHere],
573
    CI[cmd_Explode],
574
    CI[cmd_BanIP],
575
    CI[cmd_UnbanIP],
576
    CI[cmd_FreezeAll],
577
    CI[cmd_UnfreezeAll],
578
    CI[cmd_GetAllHere],
579
	CI[cmd_KickAll],
580
	CI[cmd_Ann],
581
	CI[cmd_SetColor],
582
	CI[cmd_MakeVIP],
583
	CI[cmd_GotoLoc],
584
	CI[cmd_SaveCFGs],
585
	CI[cmd_VIPAlert]);
586
    fwrite(file, string);
587
    fclose(file);
588
    return 1;
589
}
590
stock LoadCommands()
591
{
592
	new string[128];
593
	new File: file = fopen("zAdmin/commands.cfg", io_read);
594
	sscanf(string, "p<|>iiiiiiiiiiiiiiiiiiiiiiiiiiiii",
595
	CI[cmd_SetAdmin],
596
	CI[cmd_Kick],
597
	CI[cmd_Ban],
598
	CI[cmd_Unban],
599
	CI[cmd_Freeze],
600
	CI[cmd_Unfreeze],
601
	CI[cmd_Slap],
602
    CI[cmd_Isolate],
603
    CI[cmd_Unisolate],
604
    CI[cmd_SetHealth],
605
    CI[cmd_SetArmour],
606
    CI[cmd_GiveGun],
607
    CI[cmd_GiveCar],
608
    CI[cmd_TakeGuns],
609
    CI[cmd_Goto],
610
    CI[cmd_GetHere],
611
    CI[cmd_Explode],
612
    CI[cmd_BanIP],
613
	CI[cmd_UnbanIP],
614
	CI[cmd_FreezeAll],
615
    CI[cmd_UnfreezeAll],
616
    CI[cmd_GetAllHere],
617
	CI[cmd_KickAll],
618
	CI[cmd_Ann],
619
	CI[cmd_SetColor],
620
	CI[cmd_MakeVIP],
621
	CI[cmd_GotoLoc],
622
	CI[cmd_SaveCFGs],
623
	CI[cmd_VIPAlert]);
624
    fclose(file);
625
    return 1;
626
}
627
// ----------------------------
628
629
public OnPlayerConnect(playerid)
630
{
631
	new string[256], pIP[16];
632
	GetPlayerIp(playerid, pIP, sizeof(pIP));
633
	if(CheckBan(pIP) == 1)
634
	{
635
	    format(string, sizeof(string), ".:: ERROR: This IP (%s) is banned from the server ::.", pIP);
636
	    SendClientMessage(playerid, COLOR_REALRED, string);
637
	    return 1;
638
	}
639
	if(PI[playerid][p_Banned] == 1)
640
	{
641
	    format(string, sizeof(string), ".:: ERROR: This account (%s) is banned from the server ::.", GetName(playerid));
642
		SendClientMessage(playerid, COLOR_REALRED, string);
643
	    return 1;
644
	}
645
	if(PI[playerid][p_Banned] == 1 && CheckBan(pIP) == 0)
646
	{
647
	    foreach(Player, i)
648
	    {
649
	        if(PI[i][p_Admin] >= 1)
650
	        {
651
				format(string, sizeof(string), ".:: %s just attempted to login to the server on a banned account, and has been automatically IP banned ::.", GetName(playerid));
652
				SendClientMessage(i, COLOR_YELLOW, string);
653
				AddBan(pIP);
654
	        }
655
	    }
656
	}
657
	format(string, sizeof(string), ".:: [CONNECT] %s has joined the server ::.", GetName(playerid));
658
	SendClientMessageToAll(COLOR_GREY, string);
659
	if(!fexist(UserPath(playerid)))
660
	{
661
	    format(string, sizeof(string), ""COL_WHITE"Welcome, "COL_LIGHTBLUE"%s\n\n"COL_WHITE"Account status: "COL_NICERED"Unregistered\n\n"COL_WHITE"Please enter your desired password below to register.", GetName(playerid));
662
	    ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "zAdmin - Registration", string, "Register", "Quit");
663
	}
664
	else
665
	{
666
	    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
667
	    SetTimerEx("UnsetLogin", 500, 0, "i", playerid);
668
	}
669
	return 1;
670
}
671
672
public OnPlayerDisconnect(playerid, reason)
673
{
674
	new string[128];
675
	if(pLogged[playerid] == true)
676
	{
677
	    SaveAccount(playerid);
678
	    pLogged[playerid] = false;
679
	}
680
	switch(reason)
681
	{
682
	    case 0: format(string, sizeof(string), ".:: [DISCONNECT] %s has left the server [TIMED-OUT] ::.", GetName(playerid));
683
	    case 1: format(string, sizeof(string), ".:: [DISCONNECT] %s has left the server [LEAVING] ::.", GetName(playerid));
684
	    case 2: format(string, sizeof(string), ".:: [DISCONNECT] %s has left the server [KICKED/BANNED] ::.", GetName(playerid));
685
	}
686
	SendClientMessageToAll(COLOR_GREY, string);
687
	return 1;
688
}
689
690
public OnPlayerSpawn(playerid)
691
{
692
	if(PI[playerid][p_PosX] == 0.0 && PI[playerid][p_PosY] == 0.0 && PI[playerid][p_PosZ] == 0.0)
693
	{
694
	    SetPlayerSkin(playerid, PI[playerid][p_Skin]);
695
	    // You can set their position here.
696
	}
697
	else
698
	{
699
	    if(USE_ZADMIN_POSITION == true)
700
	    {
701
		    SetPlayerPos(playerid, PI[playerid][p_PosX], PI[playerid][p_PosY], PI[playerid][p_PosZ]);
702
		    SetPlayerFacingAngle(playerid, PI[playerid][p_PosA]);
703
		}
704
		if(USE_ZADMIN_SKIN == true)
705
		{
706
	    	SetPlayerSkin(playerid, PI[playerid][p_Skin]);
707
		}
708
		if(USE_ZADMIN_MONEY == true)
709
		{
710
		    ResetPlayerMoney(playerid);
711
			GivePlayerMoney(playerid, PI[playerid][p_Cash]);
712
		}
713
		if(USE_ZADMIN_HEALTHARMOUR == true)
714
		{
715
		    SetPlayerHealth(playerid, PI[playerid][p_Health]);
716
		    SetPlayerArmour(playerid, PI[playerid][p_Armour]);
717
		}
718
	}
719
	return 1;
720
}
721
722
public OnPlayerDeath(playerid, killerid, reason)
723
{
724
	return 1;
725
}
726
727
public OnVehicleSpawn(vehicleid)
728
{
729
	return 1;
730
}
731
732
public OnVehicleDeath(vehicleid, killerid)
733
{
734
	return 1;
735
}
736
737
public OnPlayerText(playerid, text[])
738
{
739
	return 1;
740
}
741
742
public OnPlayerCommandText(playerid, cmdtext[])
743
{
744
	return 0;
745
}
746
747
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
748
{
749
	return 1;
750
}
751
752
public OnPlayerExitVehicle(playerid, vehicleid)
753
{
754
	return 1;
755
}
756
757
public OnPlayerStateChange(playerid, newstate, oldstate)
758
{
759
	return 1;
760
}
761
762
public OnPlayerEnterCheckpoint(playerid)
763
{
764
	return 1;
765
}
766
767
public OnPlayerLeaveCheckpoint(playerid)
768
{
769
	return 1;
770
}
771
772
public OnPlayerEnterRaceCheckpoint(playerid)
773
{
774
	return 1;
775
}
776
777
public OnPlayerLeaveRaceCheckpoint(playerid)
778
{
779
	return 1;
780
}
781
782
public OnRconCommand(cmd[])
783
{
784
	return 1;
785
}
786
787
public OnPlayerRequestSpawn(playerid)
788
{
789
	return 1;
790
}
791
792
public OnObjectMoved(objectid)
793
{
794
	return 1;
795
}
796
797
public OnPlayerObjectMoved(playerid, objectid)
798
{
799
	return 1;
800
}
801
802
public OnPlayerPickUpPickup(playerid, pickupid)
803
{
804
	return 1;
805
}
806
807
public OnVehicleMod(playerid, vehicleid, componentid)
808
{
809
	return 1;
810
}
811
812
public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
813
{
814
	return 1;
815
}
816
817
public OnVehicleRespray(playerid, vehicleid, color1, color2)
818
{
819
	return 1;
820
}
821
822
public OnPlayerSelectedMenuRow(playerid, row)
823
{
824
	return 1;
825
}
826
827
public OnPlayerExitedMenu(playerid)
828
{
829
	return 1;
830
}
831
832
public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
833
{
834
	return 1;
835
}
836
837
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
838
{
839
	return 1;
840
}
841
842
public OnRconLoginAttempt(ip[], password[], success)
843
{
844
	return 1;
845
}
846
847
public OnPlayerUpdate(playerid)
848
{
849
	return 1;
850
}
851
852
public OnPlayerStreamIn(playerid, forplayerid)
853
{
854
	return 1;
855
}
856
857
public OnPlayerStreamOut(playerid, forplayerid)
858
{
859
	return 1;
860
}
861
862
public OnVehicleStreamIn(vehicleid, forplayerid)
863
{
864
	return 1;
865
}
866
867
public OnVehicleStreamOut(vehicleid, forplayerid)
868
{
869
	return 1;
870
}
871
872
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
873
{
874
	new string[256];
875
	if(dialogid == DIALOG_REGISTER)
876
	{
877
	    if(!response) Kick(playerid);
878
	    if(response)
879
	    {
880
	        if(strlen(inputtext) >= 5 && strlen(inputtext) <= 16)
881
	        {
882
	            new pIP[16];
883
	            GetPlayerIp(playerid, pIP, sizeof(pIP));
884
	            new INI:File = INI_Open(UserPath(playerid));
885
	            INI_SetTag(File, "data");
886
	            INI_WriteInt(File, "Password", udb_hash(inputtext));
887
	            INI_WriteInt(File, "Admin", 0);
888
	            INI_WriteString(File, "IP", pIP);
889
				INI_WriteInt(File, "Level", 0);
890
				INI_WriteInt(File, "Cash", 0);
891
				INI_WriteInt(File, "Skin", 299);
892
				INI_WriteFloat(File, "PosX", 0.0);
893
				INI_WriteFloat(File, "PosY", 0.0);
894
				INI_WriteFloat(File, "PosZ", 0.0);
895
				INI_WriteFloat(File, "PosA", 0.0);
896
				INI_WriteInt(File, "Banned", 0);
897
				INI_WriteInt(File, "Isolated", 0);
898
				INI_WriteInt(File, "IsolationTime", 0);
899
				INI_WriteInt(File, "Muted", 0);
900
				INI_WriteFloat(File, "Health", 100.0);
901
				INI_WriteFloat(File, "Armour", 0.0);
902
				INI_WriteInt(File, "VIP", 0);
903
				INI_Close(File);
904
				PlayerPlaySound(playerid, 5201, 0.0, 0.0, 0.0);
905
				format(string, sizeof(string), ".:: Account '%s' successfully registered with password '%s' ::.", GetName(playerid), inputtext);
906
				SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
907
				pLogged[playerid] = true;
908
				SetSpawnInfo(playerid, 0, 299, 0.0, 0.0, 0.0, 0.0, 0, 0, 0, 0, 0, 0);
909
				SpawnPlayer(playerid);
910
	        }
911
	        else
912
	        {
913
	            format(string, sizeof(string), ""COL_NICERED"ERROR: "COL_WHITE"Invalid password length. (5 - 16 characters.\n\n"COL_WHITE"Welcome, "COL_LIGHTBLUE"%s\n\n"COL_WHITE"Account status: "COL_NICERED"Unregistered\n\n"COL_WHITE"Please enter your desired password below to register.", GetName(playerid));
914
	    		ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "zAdmin - Registration", string, "Register", "Quit");
915
	        }
916
	    }
917
	}
918
	if(dialogid == DIALOG_LOGIN)
919
	{
920
	    if(!response) Kick(playerid);
921
	    if(response)
922
	    {
923
	        if(udb_hash(inputtext) == PI[playerid][p_Pass])
924
	        {
925
	            format(string, sizeof(string), ".:: Successfully logged into account '%s' ::.", GetName(playerid));
926
	            PlayerPlaySound(playerid, 5201, 0.0, 0.0, 0.0);
927
	            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
928
	            SpawnPlayer(playerid);
929
	        }
930
	        else
931
	        {
932
	        	format(string, sizeof(string), ""COL_NICERED"ERROR: "COL_WHITE"Invalid password.\n\n"COL_WHITE"Welcome, "COL_LIGHTBLUE"%s\n\n"COL_WHITE"Account status: "COL_NICEGREEN"Registered\n\n"COL_WHITE"Please enter your password below to login.", GetName(playerid));
933
        		ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "zAdmin - Login", string, "Login", "Quit");
934
			}
935
	    }
936
	}
937
	if(dialogid == DIALOG_CMD_MAIN)
938
	{
939
	    if(response)
940
	    {
941
	        switch(listitem)
942
	        {
943
	            case 0:
944
	            {
945
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SetAdmin\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
946
	                SetPVarInt(playerid, "cmd_SetAdmin", 1);
947
	            }
948
	            case 1:
949
	            {
950
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Kick\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
951
	                SetPVarInt(playerid, "cmd_Kick", 1);
952
	            }
953
	            case 2:
954
	            {
955
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Ban\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
956
	                SetPVarInt(playerid, "cmd_Ban", 1);
957
	            }
958
	            case 3:
959
	            {
960
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Unban\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
961
	                SetPVarInt(playerid, "cmd_Unban", 1);
962
	            }
963
	            case 4:
964
	            {
965
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Freeze\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
966
	                SetPVarInt(playerid, "cmd_Freeze", 1);
967
	            }
968
	            case 5:
969
	            {
970
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Unfreeze\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
971
	                SetPVarInt(playerid, "cmd_Unfreeze", 1);
972
	            }
973
	            case 6:
974
	            {
975
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Slap\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
976
	                SetPVarInt(playerid, "cmd_Slap", 1);
977
	            }
978
	            case 7:
979
	            {
980
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Isolate\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
981
	                SetPVarInt(playerid, "cmd_Isolate", 1);
982
	            }
983
	            case 8:
984
	            {
985
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Unisolate\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
986
	                SetPVarInt(playerid, "cmd_Unisolate", 1);
987
	            }
988
	            case 9:
989
	            {
990
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SetHealth\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
991
	                SetPVarInt(playerid, "cmd_SetHealth", 1);
992
	            }
993
	            case 10:
994
	            {
995
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SetArmour\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
996
	                SetPVarInt(playerid, "cmd_SetArmour", 1);
997
	            }
998
	            case 11:
999
	            {
1000
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: GiveGun\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1001
	                SetPVarInt(playerid, "cmd_GiveGun", 1);
1002
	            }
1003
	            case 12:
1004
	            {
1005
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: GiveCar\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1006
	                SetPVarInt(playerid, "cmd_GiveCar", 1);
1007
	            }
1008
	            case 13:
1009
	            {
1010
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: TakeGuns\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1011
	                SetPVarInt(playerid, "cmd_TakeGuns", 1);
1012
	            }
1013
	            case 14:
1014
	            {
1015
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Goto\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1016
	                SetPVarInt(playerid, "cmd_Goto", 1);
1017
	            }
1018
	            case 15:
1019
	            {
1020
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: GetHere\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1021
	                SetPVarInt(playerid, "cmd_GetHere", 1);
1022
	            }
1023
	            case 16:
1024
	            {
1025
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Explode\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1026
	                SetPVarInt(playerid, "cmd_Explode", 1);
1027
	            }
1028
	            case 17:
1029
	            {
1030
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: BanIP\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1031
	                SetPVarInt(playerid, "cmd_BanIP", 1);
1032
	            }
1033
	            case 18:
1034
	            {
1035
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: UnbanIP\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1036
	                SetPVarInt(playerid, "cmd_UnbanIP", 1);
1037
	            }
1038
	            case 19:
1039
	            {
1040
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SetSkin\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1041
	                SetPVarInt(playerid, "cmd_SetSkin", 1);
1042
	            }
1043
	            case 20:
1044
	            {
1045
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: FreezeAll\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1046
	                SetPVarInt(playerid, "cmd_FreezeAll", 1);
1047
	            }
1048
	            case 21:
1049
	            {
1050
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: UnfreezeAll\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1051
	                SetPVarInt(playerid, "cmd_UnfreezeAll", 1);
1052
	            }
1053
	            case 22:
1054
	            {
1055
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: GetAllHere\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1056
	                SetPVarInt(playerid, "cmd_GetAllHere", 1);
1057
	            }
1058
	            case 23:
1059
	            {
1060
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: KickAll\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1061
	                SetPVarInt(playerid, "cmd_KickAll", 1);
1062
	            }
1063
	            case 24:
1064
	            {
1065
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: Ann\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1066
	                SetPVarInt(playerid, "cmd_Ann", 1);
1067
	            }
1068
	            case 25:
1069
	            {
1070
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SetColor\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1071
	                SetPVarInt(playerid, "cmd_SetColor", 1);
1072
	            }
1073
	            case 26:
1074
	            {
1075
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: MakeVIP\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1076
	                SetPVarInt(playerid, "cmd_MakeVIP", 1);
1077
	            }
1078
	            case 27:
1079
	            {
1080
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: GotoLoc\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1081
	                SetPVarInt(playerid, "cmd_GotoLoc", 1);
1082
	            }
1083
	            case 28:
1084
	            {
1085
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: SaveCFGs\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1086
	                SetPVarInt(playerid, "cmd_SaveCFGs", 1);
1087
	            }
1088
	            case 29:
1089
	            {
1090
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - Command Editor", "Command name: VIPAlert\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1091
	                SetPVarInt(playerid, "cmd_VIPAlert", 1);
1092
	            }
1093
	        }
1094
	    }
1095
	}
1096
	if(dialogid == DIALOG_CMD_EDIT)
1097
	{
1098
	    if(response)
1099
	    {
1100
	        if(strval(inputtext) > 0 && strval(inputtext) < 5)
1101
			{
1102
   				if(GetPVarInt(playerid, "cmd_SetAdmin") == 1)
1103
				{
1104
				    format(string, sizeof(string), ".:: Command level set. [Command: SetAdmin | Level: %d] ::.", strval(inputtext));
1105
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1106
				    DeletePVar(playerid, "cmd_SetAdmin");
1107
				    CI[cmd_SetAdmin] = strval(inputtext);
1108
				    SaveCommands();
1109
				}
1110
				if(GetPVarInt(playerid, "cmd_Kick") == 1)
1111
				{
1112
				    format(string, sizeof(string), ".:: Command level set. [Command: Kick | Level: %d] ::.", strval(inputtext));
1113
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1114
				    DeletePVar(playerid, "cmd_Kick");
1115
				    CI[cmd_Kick] = strval(inputtext);
1116
				    SaveCommands();
1117
				}
1118
				if(GetPVarInt(playerid, "cmd_Ban") == 1)
1119
				{
1120
				    format(string, sizeof(string), ".:: Command level set. [Command: Ban | Level: %d] ::.", strval(inputtext));
1121
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1122
				    DeletePVar(playerid, "cmd_Ban");
1123
				    CI[cmd_Ban] = strval(inputtext);
1124
				    SaveCommands();
1125
				}
1126
				if(GetPVarInt(playerid, "cmd_Unban") == 1)
1127
				{
1128
				    format(string, sizeof(string), ".:: Command level set. [Command: Unban | Level: %d] ::.", strval(inputtext));
1129
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1130
				    DeletePVar(playerid, "cmd_Unban");
1131
				    CI[cmd_Unban] = strval(inputtext);
1132
				    SaveCommands();
1133
				}
1134
				if(GetPVarInt(playerid, "cmd_Freeze") == 1)
1135
				{
1136
				    format(string, sizeof(string), ".:: Command level set. [Command: Freeze | Level: %d] ::.", strval(inputtext));
1137
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1138
				    DeletePVar(playerid, "cmd_Freeze");
1139
				    CI[cmd_Freeze] = strval(inputtext);
1140
				    SaveCommands();
1141
				}
1142
				if(GetPVarInt(playerid, "cmd_Unfreeze") == 1)
1143
				{
1144
				    format(string, sizeof(string), ".:: Command level set. [Command: Unfreeze | Level: %d] ::.", strval(inputtext));
1145
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1146
				    DeletePVar(playerid, "cmd_Unfreeze");
1147
				    CI[cmd_Unfreeze] = strval(inputtext);
1148
				    SaveCommands();
1149
				}
1150
				if(GetPVarInt(playerid, "cmd_Slap") == 1)
1151
				{
1152
				    format(string, sizeof(string), ".:: Command level set. [Command: Slap | Level: %d] ::.", strval(inputtext));
1153
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1154
				    DeletePVar(playerid, "cmd_Slap");
1155
				    CI[cmd_Slap] = strval(inputtext);
1156
				    SaveCommands();
1157
				}
1158
				if(GetPVarInt(playerid, "cmd_Isolate") == 1)
1159
				{
1160
				    format(string, sizeof(string), ".:: Command level set. [Command: Isolate | Level: %d] ::.", strval(inputtext));
1161
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1162
				    DeletePVar(playerid, "cmd_Isolate");
1163
				    CI[cmd_Isolate] = strval(inputtext);
1164
				    SaveCommands();
1165
				}
1166
				if(GetPVarInt(playerid, "cmd_Unisolate") == 1)
1167
				{
1168
				    format(string, sizeof(string), ".:: Command level set. [Command: Unisolate | Level: %d] ::.", strval(inputtext));
1169
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1170
				    DeletePVar(playerid, "cmd_Unisolate");
1171
				    CI[cmd_Unisolate] = strval(inputtext);
1172
				    SaveCommands();
1173
				}
1174
				if(GetPVarInt(playerid, "cmd_SetHealth") == 1)
1175
				{
1176
				    format(string, sizeof(string), ".:: Command level set. [Command: SetHealth | Level: %d] ::.", strval(inputtext));
1177
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1178
				    DeletePVar(playerid, "cmd_SetHealth");
1179
				    CI[cmd_SetHealth] = strval(inputtext);
1180
				    SaveCommands();
1181
				}
1182
				if(GetPVarInt(playerid, "cmd_SetArmour") == 1)
1183
				{
1184
				    format(string, sizeof(string), ".:: Command level set. [Command: SetArmour | Level: %d] ::.", strval(inputtext));
1185
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1186
				    DeletePVar(playerid, "cmd_SetArmour");
1187
				    CI[cmd_SetArmour] = strval(inputtext);
1188
				    SaveCommands();
1189
				}
1190
				if(GetPVarInt(playerid, "cmd_GiveGun") == 1)
1191
				{
1192
				    format(string, sizeof(string), ".:: Command level set. [Command: GiveGun | Level: %d] ::.", strval(inputtext));
1193
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1194
				    DeletePVar(playerid, "cmd_GiveGun");
1195
				    CI[cmd_GiveGun] = strval(inputtext);
1196
				    SaveCommands();
1197
				}
1198
				if(GetPVarInt(playerid, "cmd_GiveCar") == 1)
1199
				{
1200
				    format(string, sizeof(string), ".:: Command level set. [Command: GiveCar | Level: %d] ::.", strval(inputtext));
1201
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1202
				    DeletePVar(playerid, "cmd_GiveCar");
1203
				    CI[cmd_GiveCar] = strval(inputtext);
1204
				    SaveCommands();
1205
				}
1206
				if(GetPVarInt(playerid, "cmd_TakeGuns") == 1)
1207
				{
1208
				    format(string, sizeof(string), ".:: Command level set. [Command: TakeGuns | Level: %d] ::.", strval(inputtext));
1209
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1210
				    DeletePVar(playerid, "cmd_TakeGuns");
1211
				    CI[cmd_TakeGuns] = strval(inputtext);
1212
				    SaveCommands();
1213
				}
1214
				if(GetPVarInt(playerid, "cmd_Goto") == 1)
1215
				{
1216
				    format(string, sizeof(string), ".:: Command level set. [Command: Goto | Level: %d] ::.", strval(inputtext));
1217
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1218
				    DeletePVar(playerid, "cmd_Goto");
1219
				    CI[cmd_Goto] = strval(inputtext);
1220
				    SaveCommands();
1221
				}
1222
				if(GetPVarInt(playerid, "cmd_GetHere") == 1)
1223
				{
1224
				    format(string, sizeof(string), ".:: Command level set. [Command: GetHere | Level: %d] ::.", strval(inputtext));
1225
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1226
				    DeletePVar(playerid, "cmd_GetHere");
1227
				    CI[cmd_GetHere] = strval(inputtext);
1228
				    SaveCommands();
1229
				}
1230
				if(GetPVarInt(playerid, "cmd_Explode") == 1)
1231
				{
1232
				    format(string, sizeof(string), ".:: Command level set. [Command: Explode | Level: %d] ::.", strval(inputtext));
1233
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1234
				    DeletePVar(playerid, "cmd_Explode");
1235
				    CI[cmd_Explode] = strval(inputtext);
1236
				    SaveCommands();
1237
				}
1238
				if(GetPVarInt(playerid, "cmd_BanIP") == 1)
1239
				{
1240
				    format(string, sizeof(string), ".:: Command level set. [Command: BanIP | Level: %d] ::.", strval(inputtext));
1241
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1242
				    DeletePVar(playerid, "cmd_BanIP");
1243
				    CI[cmd_BanIP] = strval(inputtext);
1244
				    SaveCommands();
1245
				}
1246
				if(GetPVarInt(playerid, "cmd_UnbanIP") == 1)
1247
				{
1248
				    format(string, sizeof(string), ".:: Command level set. [Command: UnbanIP | Level: %d] ::.", strval(inputtext));
1249
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1250
				    DeletePVar(playerid, "cmd_UnbanIP");
1251
				    CI[cmd_UnbanIP] = strval(inputtext);
1252
				    SaveCommands();
1253
				}
1254
				if(GetPVarInt(playerid, "cmd_SetSkin") == 1)
1255
				{
1256
				    format(string, sizeof(string), ".:: Command level set. [Command: SetSkin | Level: %d] ::.", strval(inputtext));
1257
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1258
				    DeletePVar(playerid, "cmd_SetSkin");
1259
				    CI[cmd_SetSkin] = strval(inputtext);
1260
				    SaveCommands();
1261
				}
1262
				if(GetPVarInt(playerid, "cmd_FreezeAll") == 1)
1263
				{
1264
				    format(string, sizeof(string), ".:: Command level set. [Command: FreezeAll | Level: %d] ::.", strval(inputtext));
1265
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1266
				    DeletePVar(playerid, "cmd_FreezeAll");
1267
				    CI[cmd_FreezeAll] = strval(inputtext);
1268
				    SaveCommands();
1269
				}
1270
				if(GetPVarInt(playerid, "cmd_UnfreezeAll") == 1)
1271
				{
1272
				    format(string, sizeof(string), ".:: Command level set. [Command: UnfreezeAll | Level: %d] ::.", strval(inputtext));
1273
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1274
				    DeletePVar(playerid, "cmd_UnfreezeAll");
1275
				    CI[cmd_UnfreezeAll] = strval(inputtext);
1276
				    SaveCommands();
1277
				}
1278
				if(GetPVarInt(playerid, "cmd_GetAllHere") == 1)
1279
				{
1280
				    format(string, sizeof(string), ".:: Command level set. [Command: GetAllHere | Level: %d] ::.", strval(inputtext));
1281
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1282
				    DeletePVar(playerid, "cmd_GetAllHere");
1283
				    CI[cmd_GetAllHere] = strval(inputtext);
1284
				    SaveCommands();
1285
				}
1286
				if(GetPVarInt(playerid, "cmd_KickAll") == 1)
1287
				{
1288
				    format(string, sizeof(string), ".:: Command level set. [Command: KickAll | Level: %d] ::.", strval(inputtext));
1289
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1290
				    DeletePVar(playerid, "cmd_KickAll");
1291
				    CI[cmd_KickAll] = strval(inputtext);
1292
				    SaveCommands();
1293
				}
1294
				if(GetPVarInt(playerid, "cmd_Ann") == 1)
1295
				{
1296
				    format(string, sizeof(string), ".:: Command level set. [Command: Ann | Level: %d] ::.", strval(inputtext));
1297
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1298
				    DeletePVar(playerid, "cmd_Ann");
1299
				    CI[cmd_Ann] = strval(inputtext);
1300
				    SaveCommands();
1301
				}
1302
				if(GetPVarInt(playerid, "cmd_SetColor") == 1)
1303
				{
1304
				    format(string, sizeof(string), ".:: Command level set. [Command: SetColor | Level: %d] ::.", strval(inputtext));
1305
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1306
				    DeletePVar(playerid, "cmd_SetColor");
1307
				    CI[cmd_SetColor] = strval(inputtext);
1308
				    SaveCommands();
1309
				}
1310
				if(GetPVarInt(playerid, "cmd_MakeVIP") == 1)
1311
				{
1312
				    format(string, sizeof(string), ".:: Command level set. [Command: MakeVIP | Level: %d] ::.", strval(inputtext));
1313
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1314
				    DeletePVar(playerid, "cmd_MakeVIP");
1315
				    CI[cmd_MakeVIP] = strval(inputtext);
1316
				    SaveCommands();
1317
				}
1318
				if(GetPVarInt(playerid, "cmd_GotoLoc") == 1)
1319
				{
1320
				    format(string, sizeof(string), ".:: Command level set. [Command: GotoLoc | Level: %d] ::.", strval(inputtext));
1321
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1322
				    DeletePVar(playerid, "cmd_GotoLoc");
1323
				    CI[cmd_GotoLoc] = strval(inputtext);
1324
				    SaveCommands();
1325
				}
1326
				if(GetPVarInt(playerid, "cmd_SaveCFGs") == 1)
1327
				{
1328
				    format(string, sizeof(string), ".:: Command level set. [Command: SaveCFGs | Level: %d] ::.", strval(inputtext));
1329
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1330
				    DeletePVar(playerid, "cmd_SaveCFGs");
1331
				    CI[cmd_SaveCFGs] = strval(inputtext);
1332
				    SaveCommands();
1333
				}
1334
				if(GetPVarInt(playerid, "cmd_VIPAlert") == 1)
1335
				{
1336
				    format(string, sizeof(string), ".:: Command level set. [Command: VIPAlert | Level: %d] ::.", strval(inputtext));
1337
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1338
				    DeletePVar(playerid, "cmd_VIPAlert");
1339
				    CI[cmd_VIPAlert] = strval(inputtext);
1340
				    SaveCommands();
1341
				}
1342
				if(GetPVarInt(playerid, "vcmd_Car") == 1)
1343
				{
1344
				    format(string, sizeof(string), ".:: VIP Command level set. [Command: vCar | Level: %d] ::.", strval(inputtext));
1345
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1346
				    DeletePVar(playerid, "vcmd_Car");
1347
				    VCI[vcmd_Car] = strval(inputtext);
1348
				    SaveVIPCommands();
1349
				}
1350
				if(GetPVarInt(playerid, "vcmd_Gun") == 1)
1351
				{
1352
				    format(string, sizeof(string), ".:: VIP Command level set. [Command: vGun | Level: %d] ::.", strval(inputtext));
1353
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1354
				    DeletePVar(playerid, "vcmd_Gun");
1355
				    VCI[vcmd_Gun] = strval(inputtext);
1356
				    SaveVIPCommands();
1357
				}
1358
				if(GetPVarInt(playerid, "vcmd_Heal") == 1)
1359
				{
1360
				    format(string, sizeof(string), ".:: VIP Command level set. [Command: vHeal | Level: %d] ::.", strval(inputtext));
1361
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1362
				    DeletePVar(playerid, "vcmd_Heal");
1363
				    VCI[vcmd_Heal] = strval(inputtext);
1364
				    SaveVIPCommands();
1365
				}
1366
				if(GetPVarInt(playerid, "vcmd_Fix") == 1)
1367
				{
1368
				    format(string, sizeof(string), ".:: VIP Command level set. [Command: vFix | Level: %d] ::.", strval(inputtext));
1369
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1370
				    DeletePVar(playerid, "vcmd_Fix");
1371
				    VCI[vcmd_Fix] = strval(inputtext);
1372
				    SaveVIPCommands();
1373
				}
1374
				if(GetPVarInt(playerid, "vcmd_VC") == 1)
1375
				{
1376
				    format(string, sizeof(string), ".:: VIP Command level set. [Command: VC | Level: %d] ::.", strval(inputtext));
1377
				    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1378
				    DeletePVar(playerid, "vcmd_VC");
1379
				    VCI[vcmd_VC] = strval(inputtext);
1380
				    SaveVIPCommands();
1381
				}
1382
	        }
1383
	        else
1384
	        {
1385
	            SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Command level must be between 1 and 4 ::.");
1386
	        }
1387
	    }
1388
	}
1389
	if(dialogid == DIALOG_VCMD_MAIN)
1390
	{
1391
	    if(response)
1392
	    {
1393
	        switch(listitem)
1394
	        {
1395
                case 0:
1396
	            {
1397
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - VIP Command Editor", "Command name: vCar\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1398
	                SetPVarInt(playerid, "vcmd_Car", 1);
1399
	            }
1400
	            case 1:
1401
	            {
1402
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - VIP Command Editor", "Command name: vGun\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1403
	                SetPVarInt(playerid, "vcmd_Gun", 1);
1404
	            }
1405
	            case 2:
1406
	            {
1407
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - VIP Command Editor", "Command name: vHeal\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1408
	                SetPVarInt(playerid, "vcmd_Heal", 1);
1409
	            }
1410
	            case 3:
1411
	            {
1412
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - VIP Command Editor", "Command name: vFix\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1413
	                SetPVarInt(playerid, "vcmd_Fix", 1);
1414
	            }
1415
	            case 4:
1416
	            {
1417
	                ShowPlayerDialog(playerid, DIALOG_CMD_EDIT, DIALOG_STYLE_INPUT, "zAdmin - VIP Command Editor", "Command name: VC\n\nPlease enter the desired level for this command.", "Enter", "Cancel");
1418
	                SetPVarInt(playerid, "vcmd_VC", 1);
1419
	            }
1420
	        }
1421
	    }
1422
	}
1423
	return 1;
1424
}
1425
1426
public OnPlayerClickPlayer(playerid, clickedplayerid, source)
1427
{
1428
	return 1;
1429
}
1430
CMD:editcmds(playerid, params[])
1431
{
1432
	if(PI[playerid][p_Admin] >= 4)
1433
	{
1434
	    ShowPlayerDialog(playerid, DIALOG_CMD_MAIN, DIALOG_STYLE_LIST, "zAdmin - Command Editor", "SetAdmin\nKick\nBan\nUnban\nFreeze\nUnfreeze\nSlap\nIsolate\nUnisolate\nSetHealth\nSetArmour\nGiveGun\nGiveCar\nTakeGuns\nGoto\nGetHere\nExplode\nBanIP\nUnbanIP\nSetSkin\nFreezeAll\nUnfreezeAll\nGetAllHere\nKickAll\nAnn\nSetColor\nMakeVIP\nGotoLoc\nSaveCFGs\nVIPAlert", "Select", "Cancel");
1435
	}
1436
	else
1437
	{
1438
	    SendPermissionError(playerid);
1439
	}
1440
	return 1;
1441
}
1442
CMD:editvcmds(playerid, params[])
1443
{
1444
	if(PI[playerid][p_Admin] >= 4)
1445
	{
1446
	    ShowPlayerDialog(playerid, DIALOG_VCMD_MAIN, DIALOG_STYLE_LIST, "zAdmin - VIP Command Editor", "vCar\nvGun\nvHeal\nvFix\nVC", "Select", "Cancel");
1447
	}
1448
	else
1449
	{
1450
	    SendPermissionError(playerid);
1451
	}
1452
	return 1;
1453
}
1454
CMD:setadmin(playerid, params[])
1455
{
1456
	if(PI[playerid][p_Admin] >= CI[cmd_SetAdmin])
1457
	{
1458
	    new targetid, level, string[128];
1459
	    if(sscanf(params, "ud", targetid, level)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /setadmin [playerid] [level]");
1460
1461
		if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1462
		if(PI[targetid][p_Admin] == level) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player is already that level ::.");
1463
1464
		PI[targetid][p_Admin] = level;
1465
		format(string, sizeof(string), ".:: You have set %s to a(n) %s ::.", GetName(targetid), GetAdminName(targetid));
1466
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1467
		format(string, sizeof(string), ".:: %s %s has set you to a(n) %s ::.", GetAdminName(playerid), GetName(playerid), GetAdminName(targetid));
1468
		SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
1469
	}
1470
	else
1471
	{
1472
	    SendPermissionError(playerid);
1473
	}
1474
	return 1;
1475
}
1476
CMD:kick(playerid, params[])
1477
{
1478
	if(PI[playerid][p_Admin] >= CI[cmd_Kick])
1479
	{
1480
	    new targetid, reason[64], string[128];
1481
	    if(sscanf(params, "us[64]", targetid, reason)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /kick [playerid] [reason]");
1482
	    
1483
	    if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1484
	    
1485
	    format(string, sizeof(string), ".:: %s %s has kicked %s, reason: %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid), reason);
1486
	    SendClientMessageToAll(COLOR_REALRED, string);
1487
	    Kick(targetid);
1488
	}
1489
	else
1490
	{
1491
	    SendPermissionError(playerid);
1492
	}
1493
	return 1;
1494
}
1495
CMD:ban(playerid, params[])
1496
{
1497
	if(PI[playerid][p_Admin] >= CI[cmd_Ban])
1498
	{
1499
	    new targetid, reason[64], string[128], tIP[16];
1500
	    if(sscanf(params, "us[64]", targetid, reason)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /ban [playerid] [reaosn]");
1501
	    
1502
	    if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1503
	    
1504
	    format(string, sizeof(string), ".:: %s %s has banned %s, reason: %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid), reason);
1505
	    SendClientMessageToAll(COLOR_REALRED, string);
1506
	    GetPlayerIp(targetid, tIP, sizeof(tIP));
1507
		PI[targetid][p_Banned] = 1;
1508
		AddBan(tIP);
1509
		Kick(targetid);
1510
		SaveAccount(targetid);
1511
	}
1512
	else
1513
	{
1514
	    SendPermissionError(playerid);
1515
	}
1516
	return 1;
1517
}
1518
CMD:unban(playerid, params[])
1519
{
1520
	if(PI[playerid][p_Admin] >= CI[cmd_Unban])
1521
	{
1522
	    new targetname[MAX_PLAYER_NAME], string[128], pathstring[64];
1523
	    if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /unban [account name]");
1524
1525
		format(pathstring, sizeof(pathstring), "zAdmin/Users/%s.ini", targetname);
1526
		if(!fexist(pathstring)) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player's file does not exist.");
1527
		
1528
		new INI:File = INI_Open(pathstring);
1529
		INI_SetTag(File, "data");
1530
		INI_WriteInt(File, "Banned", 0);
1531
		INI_Close(File);
1532
		
1533
		format(string, sizeof(string), ".:: %s %s has unbanned account '%s' ::.", GetAdminName(playerid), GetName(playerid), targetname);
1534
		SendClientMessageToAll(COLOR_REALRED, string);
1535
	}
1536
	else
1537
	{
1538
	    SendPermissionError(playerid);
1539
	}
1540
	return 1;
1541
}
1542
CMD:banip(playerid, params[])
1543
{
1544
	if(PI[playerid][p_Admin] >= CI[cmd_BanIP])
1545
	{
1546
	    new tIP[16], string[128];
1547
	    if(sscanf(params, "s[16]", tIP)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /banip [IP]");
1548
	    
1549
	    if(CheckBan(tIP) == 1) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That IP is already banned ::.");
1550
	    
1551
	    format(string, sizeof(string), ".:: %s %s has banned IP '%s' ::.", GetAdminName(playerid), GetName(playerid), tIP);
1552
	    SendClientMessageToAll(COLOR_REALRED, string);
1553
	    AddBan(tIP);
1554
	}
1555
	else
1556
	{
1557
	    SendPermissionError(playerid);
1558
	}
1559
	return 1;
1560
}
1561
CMD:unbanip(playerid, params[])
1562
{
1563
	if(PI[playerid][p_Admin] >= CI[cmd_UnbanIP])
1564
	{
1565
	    new tIP[16], string[128];
1566
	    if(sscanf(params, "s[16]", tIP)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /unbanip [IP]");
1567
	    
1568
	    if(CheckBan(tIP) == 0) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That IP is not banned ::.");
1569
	    
1570
	    format(string, sizeof(string), ".:: %s %s has unbanned IP '%s' ::.", GetAdminName(playerid), GetName(playerid), tIP);
1571
	    SendClientMessageToAll(COLOR_REALRED, string);
1572
	    RemoveBan(tIP);
1573
	}
1574
	else
1575
	{
1576
	    SendPermissionError(playerid);
1577
	}
1578
	return 1;
1579
}
1580
CMD:freeze(playerid, params[])
1581
{
1582
	if(PI[playerid][p_Admin] >= CI[cmd_Freeze])
1583
	{
1584
	    new targetid, string[128];
1585
	    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /freeze [playerid]");
1586
	    
1587
	    if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1588
	    if(pFrozen[targetid] == true) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player is already frozen ::.");
1589
	    
1590
	    format(string, sizeof(string), ".:: %s %s has frozen %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid));
1591
	    SendClientMessageToAll(COLOR_REALRED, string);
1592
	    TogglePlayerControllable(targetid, 0);
1593
	    pFrozen[targetid] = true;
1594
	}
1595
	else
1596
	{
1597
	    SendPermissionError(playerid);
1598
	}
1599
	return 1;
1600
}
1601
CMD:unfreeze(playerid, params[])
1602
{
1603
	if(PI[playerid][p_Admin] >= CI[cmd_Unfreeze])
1604
	{
1605
	    new targetid, string[128];
1606
	    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /unfreeze [playerid]");
1607
	    
1608
	    if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1609
	    if(pFrozen[targetid] == false) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player is not frozen ::.");
1610
	    
1611
	    format(string, sizeof(string), ".:: %s %s has unfrozen %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid));
1612
	    SendClientMessageToAll(COLOR_REALRED, string);
1613
	    TogglePlayerControllable(targetid, 1);
1614
	    pFrozen[targetid] = false;
1615
	}
1616
	else
1617
	{
1618
	    SendPermissionError(playerid);
1619
	}
1620
	return 1;
1621
}
1622
CMD:slap(playerid, params[])
1623
{
1624
	if(PI[playerid][p_Admin] >= CI[cmd_Slap])
1625
	{
1626
	    new targetid, height, string[128];
1627
	    if(sscanf(params, "ud", targetid, height)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /slap [playerid] [height]");
1628
1629
		if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1630
		
1631
		new Float: x, Float: y, Float: z;
1632
		GetPlayerPos(targetid, x, y, z);
1633
		format(string, sizeof(string), ".:: %s %s has slapped %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid));
1634
		SendClientMessageToAll(COLOR_REALRED, string);
1635
		SetPlayerPos(targetid, x, y, z+height);
1636
		GameTextForPlayer(targetid, "~r~SLAPPED!", 3000, 5);
1637
	}
1638
	else
1639
	{
1640
	    SendPermissionError(playerid);
1641
	}
1642
	return 1;
1643
}
1644
CMD:isolate(playerid, params[])
1645
{
1646
	if(PI[playerid][p_Admin] >= CI[cmd_Isolate])
1647
	{
1648
	    new targetid, time, reason[64], string[128];
1649
	    if(sscanf(params, "uds[64]", targetid, time, reason)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /isolate [playerid] [time(minutes)] [reason]");
1650
	    
1651
	    if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1652
	    if(strlen(reason) <= 0) reason = "Not specified.";
1653
	    if(time < 1 || time > 30) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Time must be between 1 and 30 ::.");
1654
	    if(PI[targetid][p_Isolated] == 1) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player is already isolated ::.");
1655
1656
		new Float: x, Float: y, Float: z;
1657
	    GetPlayerPos(targetid, x, y, z);
1658
	    format(string, sizeof(string), ".:: %s %s has isolated %s for %d minute(s), reason: %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid), time, reason);
1659
	    SendClientMessageToAll(COLOR_REALRED, string);
1660
	    PI[targetid][p_IsolationTime] = time;
1661
	    PI[targetid][p_Isolated] = 1;
1662
	    SetPlayerPos(targetid, x, y, z+2000);
1663
	    TogglePlayerControllable(targetid, 0);
1664
	}
1665
	else
1666
	{
1667
	    SendPermissionError(playerid);
1668
	}
1669
	return 1;
1670
}
1671
CMD:unisolate(playerid, params[])
1672
{
1673
	if(PI[playerid][p_Admin] >= CI[cmd_Unisolate])
1674
	{
1675
	    new targetid, string[128];
1676
	    if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /unisolate [playerid]");
1677
	    
1678
	    if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1679
	    if(PI[targetid][p_Isolated] == 0) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player is not isolated ::.");
1680
	    
1681
	    new Float: x, Float: y, Float: z;
1682
	    GetPlayerPos(targetid, x, y, z);
1683
	    format(string, sizeof(string), ".:: %s %s has un-isolated %s ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid));
1684
	    SendClientMessageToAll(COLOR_REALRED, string);
1685
	    SetPlayerPos(targetid, x, y, z-2000);
1686
	    TogglePlayerControllable(targetid, 1);
1687
	    PI[targetid][p_Isolated] = 0;
1688
	    PI[targetid][p_IsolationTime] = 0;
1689
	}
1690
	else
1691
	{
1692
	    SendPermissionError(playerid);
1693
	}
1694
	return 1;
1695
}
1696
CMD:sethealth(playerid, params[])
1697
{
1698
	if(PI[playerid][p_Admin] >= CI[cmd_SetHealth])
1699
	{
1700
	    new targetid, Float: health, string[128];
1701
	    if(sscanf(params, "uf", targetid, health)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /sethealth [playerid] [health]");
1702
	    
1703
	    if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1704
	    
1705
	    format(string, sizeof(string), ".:: You have set %s's health to %.01f ::.", GetName(targetid), health);
1706
	    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1707
	    format(string, sizeof(string), ".:: %s %s has set your health to %.01f ::.", GetAdminName(playerid), GetName(playerid), health);
1708
	    SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
1709
	    SetPlayerHealth(targetid, health);
1710
	}
1711
	else
1712
	{
1713
		SendPermissionError(playerid);
1714
	}
1715
	return 1;
1716
}
1717
CMD:setarmour(playerid, params[])
1718
{
1719
    if(PI[playerid][p_Admin] >= CI[cmd_SetArmour])
1720
	{
1721
        new targetid, Float: armour, string[128];
1722
	    if(sscanf(params, "uf", targetid, armour)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /sethealth [playerid] [armour]");
1723
1724
	    if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1725
1726
	    format(string, sizeof(string), ".:: You have set %s's armour to %.01f ::.", GetName(targetid), armour);
1727
	    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1728
	    format(string, sizeof(string), ".:: %s %s has set your armour to %.01f ::.", GetAdminName(playerid), GetName(playerid), armour);
1729
	    SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
1730
	    SetPlayerArmour(targetid, armour);
1731
	}
1732
	else
1733
	{
1734
		SendPermissionError(playerid);
1735
	}
1736
	return 1;
1737
}
1738
CMD:givegun(playerid, params[])
1739
{
1740
    if(PI[playerid][p_Admin] >= CI[cmd_GiveGun])
1741
	{
1742
		new targetid, weapon, string[128];
1743
		if(sscanf(params, "ud", targetid, weapon)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /givegun [playerid] [weapon]");
1744
		
1745
		if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1746
		
1747
		format(string, sizeof(string), ".:: You have given %s weapon ID %d ::.", GetName(targetid), weapon);
1748
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1749
		format(string, sizeof(string), ".:: %s %s has given you weapon ID %d ::.", GetAdminName(playerid), GetName(playerid), weapon);
1750
		SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
1751
		GivePlayerWeapon(targetid, weapon, 999999);
1752
	}
1753
	else
1754
	{
1755
		SendPermissionError(playerid);
1756
	}
1757
	return 1;
1758
}
1759
CMD:givecar(playerid, params[])
1760
{
1761
    if(PI[playerid][p_Admin] >= CI[cmd_GiveCar])
1762
	{
1763
		new targetid, car, string[128];
1764
		if(sscanf(params, "ud", targetid, car)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /givecar [playerid] [vehicleid]");
1765
		
1766
		if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1767
		
1768
		new Float: x, Float: y, Float: z, Float: a;
1769
		GetPlayerPos(targetid, x, y, z);
1770
		GetPlayerFacingAngle(targetid, a);
1771
		new rd1 = random(20);
1772
		new rd2 = random(20);
1773
		format(string, sizeof(string), ".:: You have given %s vehicle ID %d ::.", GetName(targetid), car);
1774
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1775
		format(string, sizeof(string), ".:: %s %s has given you vehicle ID %d ::.", GetAdminName(playerid), GetName(playerid), car);
1776
		SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
1777
		new veh = CreateVehicle(car, x, y, z, a, rd1, rd2, -1);
1778
		PutPlayerInVehicle(targetid, veh, 0);
1779
	}
1780
	else
1781
	{
1782
		SendPermissionError(playerid);
1783
	}
1784
	return 1;
1785
}
1786
CMD:takeguns(playerid, params[])
1787
{
1788
    if(PI[playerid][p_Admin] >= CI[cmd_TakeGuns])
1789
	{
1790
		new targetid, string[128];
1791
		if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /takeguns [playerid]");
1792
		
1793
		if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1794
		
1795
		format(string, sizeof(string), ".:: %s %s has stripped %s of all his weapons ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid));
1796
		SendClientMessageToAll(COLOR_REALRED, string);
1797
		ResetPlayerWeapons(targetid);
1798
	}
1799
	else
1800
	{
1801
		SendPermissionError(playerid);
1802
	}
1803
	return 1;
1804
}
1805
CMD:goto(playerid, params[])
1806
{
1807
    if(PI[playerid][p_Admin] >= CI[cmd_Goto])
1808
	{
1809
		new targetid;
1810
		if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /goto [playerid]");
1811
1812
		if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1813
		
1814
		new Float: x, Float: y, Float: z;
1815
		GetPlayerPos(targetid, x, y, z);
1816
		SetPlayerPos(playerid, x, y, z+0.2);
1817
	}
1818
	else
1819
	{
1820
		SendPermissionError(playerid);
1821
	}
1822
	return 1;
1823
}
1824
CMD:gethere(playerid, params[])
1825
{
1826
    if(PI[playerid][p_Admin] >= CI[cmd_GetHere])
1827
	{
1828
        new targetid, string[128];
1829
		if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /gethere [playerid]");
1830
1831
		if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1832
1833
		new Float: x, Float: y, Float: z;
1834
		GetPlayerPos(playerid, x, y, z);
1835
		format(string, sizeof(string), ".:: %s %s has teleported you to them ::.", GetAdminName(playerid), GetName(playerid));
1836
		SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
1837
		SetPlayerPos(targetid, x, y, z+0.2);
1838
	}
1839
	else
1840
	{
1841
		SendPermissionError(playerid);
1842
	}
1843
	return 1;
1844
}
1845
CMD:explode(playerid, params[])
1846
{
1847
    if(PI[playerid][p_Admin] >= CI[cmd_Explode])
1848
	{
1849
		new targetid, type, Float: radius, string[128];
1850
		if(sscanf(params, "udf", targetid, type, radius)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /explode [playerid] [type(0-13)] [radius]");
1851
		
1852
		if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1853
		if(type < 0 || type > 13) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Explosion type must must be between 0 and 13 ::.");
1854
		
1855
		new Float: x, Float: y, Float: z;
1856
		GetPlayerPos(targetid, x, y, z);
1857
		format(string, sizeof(string), ".:: %s %s has exploded %s [Type: %d | Radius: %.01f] ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid), type, radius);
1858
		SendClientMessageToAll(COLOR_REALRED, string);
1859
		CreateExplosion(x, y, z, type, radius);
1860
	}
1861
	else
1862
	{
1863
		SendPermissionError(playerid);
1864
	}
1865
	return 1;
1866
}
1867
CMD:setskin(playerid, params[])
1868
{
1869
    if(PI[playerid][p_Admin] >= CI[cmd_SetSkin])
1870
	{
1871
		new targetid, skin, string[128];
1872
		if(sscanf(params, "ui", targetid, skin)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /setskin [playerid] [skinid]");
1873
		
1874
		if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
1875
		if(GetPlayerSkin(targetid) == skin) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: That player already has that skin ::.");
1876
		
1877
		format(string, sizeof(string), ".:: You have set %s's skin to %i ::.", GetName(targetid), skin);
1878
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1879
		format(string, sizeof(string), ".:: %s %s has set your skin to %i ::.", GetAdminName(playerid), GetName(playerid), skin);
1880
		SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
1881
		SetPlayerSkin(targetid, skin);
1882
		PI[targetid][p_Skin] = skin;
1883
		SaveAccount(targetid);
1884
	}
1885
	else
1886
	{
1887
		SendPermissionError(playerid);
1888
	}
1889
	return 1;
1890
}
1891
// ----- [NEW COMMANDS IN VERSION 1.0.1.0] -----
1892
// ----- [NEW VIP SYSTEM COMMANDS (1.0.1.0)] -----
1893
CMD:vcar(playerid, params[])
1894
{
1895
	if(PI[playerid][p_VIP] >= VCI[vcmd_Car])
1896
	{
1897
	    new car, col1, col2, string[128];
1898
	    if(sscanf(params, "ddd", car, col1, col2)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /vcar [modelid] [color1] [color2]");
1899
	    
1900
	    new rdc1 = random(25);
1901
	    new rdc2 = random(25);
1902
	    if(car < 400 || car > 611) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Vehicle model must be between 400 and 611 ::.");
1903
	    if(!col1) col1 = rdc1;
1904
	    if(!col2) col2 = rdc2;
1905
	    
1906
	    new Float: x, Float: y, Float: z, Float: a;
1907
	    GetPlayerPos(playerid, x, y, z);
1908
	    GetPlayerFacingAngle(playerid, a);
1909
	    new veh = CreateVehicle(car, x, y, z, a, col1, col2, -1);
1910
	    PutPlayerInVehicle(playerid, veh, 0);
1911
	    format(string, sizeof(string), ".:: Vehicle created! [Model: %d | Color1: %d | Color2: %d] ::.", car, col1, col2);
1912
	    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1913
		if(ZADMIN_VIP_ALERT == true)
1914
		{
1915
			format(string, sizeof(string), ".:: [VIP NOTICE]: %s just created a vehicle with model ID %d ::.", GetName(playerid), car);
1916
			SendAdminMessage(COLOR_YELLOW, string);
1917
		}
1918
	}
1919
	else
1920
	{
1921
	    SendPermissionError(playerid);
1922
	}
1923
	return 1;
1924
}
1925
CMD:vgun(playerid, params[])
1926
{
1927
    if(PI[playerid][p_VIP] >= VCI[vcmd_Gun])
1928
	{
1929
		new gun, string[128];
1930
		if(sscanf(params, "d", gun)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /vgun [weaponid]");
1931
		
1932
		switch(gun)
1933
		{
1934
		    case 38, 39, 40, 44, 45, 47, 48, 49, 50, 51, 52, 53, 54, 200, 201:
1935
		    {
1936
				SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: Invalid weapon ID ::.");
1937
				return 1;
1938
		    }
1939
		}
1940
		
1941
		GivePlayerWeapon(playerid, gun, 999999);
1942
		format(string, sizeof(string), ".:: Weapon created! [Weapon ID: %d] ::.", gun);
1943
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1944
		if(ZADMIN_VIP_ALERT == true)
1945
		{
1946
		    format(string, sizeof(string), ".:: [VIP NOTICE]: %s has just spawned weapon ID %d ::.", GetName(playerid), gun);
1947
		    SendAdminMessage(COLOR_YELLOW, string);
1948
		}
1949
	}
1950
	else
1951
	{
1952
	    SendPermissionError(playerid);
1953
	}
1954
	return 1;
1955
}
1956
CMD:vheal(playerid, params[])
1957
{
1958
	new string[128];
1959
	if(PI[playerid][p_VIP] >= VCI[vcmd_Heal])
1960
	{
1961
		format(string, sizeof(string), ".:: You have set your health and armour to 100 ::.");
1962
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1963
		if(ZADMIN_VIP_ALERT == true)
1964
		{
1965
		    format(string, sizeof(string), ".:: [VIP NOTICE]: %s has just used /vheal ::.", GetName(playerid));
1966
		    SendAdminMessage(COLOR_YELLOW, string);
1967
		}
1968
	}
1969
	else
1970
	{
1971
	    SendPermissionError(playerid);
1972
	}
1973
	return 1;
1974
}
1975
CMD:vfix(playerid, params[])
1976
{
1977
	new string[128];
1978
	if(PI[playerid][p_VIP] >= VCI[vcmd_Fix])
1979
	{
1980
	    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You must be in a vehicle to use this ::.");
1981
	    
1982
	    format(string, sizeof(string), ".:: Vehicle repaired! ::.");
1983
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
1984
		new veh = GetPlayerVehicleID(playerid);
1985
		SetVehicleHealth(veh, 1000.0);
1986
		RepairVehicle(veh);
1987
		if(ZADMIN_VIP_ALERT == true)
1988
		{
1989
		    format(string, sizeof(string), ".:: [VIP NOTICE]: %s has just used /vfix ::.", GetName(playerid));
1990
		    SendAdminMessage(COLOR_YELLOW, string);
1991
		}
1992
	}
1993
	else
1994
	{
1995
	    SendPermissionError(playerid);
1996
	}
1997
	return 1;
1998
}
1999
CMD:vc(playerid, params[])
2000
{
2001
	if(PI[playerid][p_VIP] >= VCI[vcmd_VC])
2002
	{
2003
	    new msg[64], string[128];
2004
	    if(sscanf(params, "s[64]", msg)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /vc [message]");
2005
	    
2006
	    if(strlen(msg) <= 0) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter a message ::.");
2007
	    
2008
	    foreach(Player, i)
2009
	    {
2010
	        if(IsPlayerConnected(i) && PI[i][p_VIP] >= 1 || PI[i][p_Admin] >= 1)
2011
	        {
2012
	            SendClientMessage(i, COLOR_PURPLE, string);
2013
	        }
2014
	    }
2015
	}
2016
	else
2017
	{
2018
	    SendPermissionError(playerid);
2019
	}
2020
	return 1;
2021
}
2022
// -----------------------------------------------
2023
CMD:freezeall(playerid, params[])
2024
{
2025
	if(PI[playerid][p_Admin] >= CI[cmd_FreezeAll])
2026
	{
2027
	    new string[128];
2028
	    format(string, sizeof(string), ".:: %s %s has frozen all players ::.", GetAdminName(playerid), GetName(playerid));
2029
	    SendClientMessageToAll(COLOR_REALRED, string);
2030
	    foreach(Player, i)
2031
	    {
2032
	        if(IsPlayerConnected(i) && PI[i][p_Admin] != 0)
2033
	        {
2034
	            pFrozen[i] = true;
2035
	            TogglePlayerControllable(i, 0);
2036
	        }
2037
	    }
2038
	}
2039
	else
2040
	{
2041
	    SendPermissionError(playerid);
2042
	}
2043
	return 1;
2044
}
2045
CMD:unfreezeall(playerid, params[])
2046
{
2047
	if(PI[playerid][p_Admin] >= CI[cmd_UnfreezeAll])
2048
	{
2049
	    new string[128];
2050
	    format(string, sizeof(string), ".:: %s %s has unfrozen all players ::.", GetAdminName(playerid), GetName(playerid));
2051
	    SendClientMessageToAll(COLOR_REALRED, string);
2052
	    foreach(Player, i)
2053
	    {
2054
	        if(IsPlayerConnected(i) && PI[i][p_Admin] == 0)
2055
	        {
2056
	            pFrozen[i] = true;
2057
	            TogglePlayerControllable(i, 1);
2058
	        }
2059
	    }
2060
	}
2061
	else
2062
	{
2063
	    SendPermissionError(playerid);
2064
	}
2065
	return 1;
2066
}
2067
CMD:getallhere(playerid, params[])
2068
{
2069
	if(PI[playerid][p_Admin] >= CI[cmd_GetAllHere])
2070
	{
2071
	    new string[128];
2072
	    format(string, sizeof(string), ".:: %s %s has teleported all players to his location ::.", GetAdminName(playerid), GetName(playerid));
2073
	    SendClientMessageToAll(COLOR_REALRED, string);
2074
	    new Float: x, Float: y, Float: z;
2075
	    GetPlayerPos(playerid, x, y, z);
2076
	    foreach(Player, i)
2077
		{
2078
		    if(IsPlayerConnected(i))
2079
		    {
2080
		    	SetPlayerPos(i, x, y, z+0.2);
2081
			}
2082
		}
2083
	}
2084
	else
2085
	{
2086
	    SendPermissionError(playerid);
2087
	}
2088
	return 1;
2089
}
2090
CMD:kickall(playerid, params[])
2091
{
2092
	if(PI[playerid][p_Admin] >= CI[cmd_KickAll])
2093
	{
2094
	    new string[128];
2095
	    format(string, sizeof(string), ".:: %s %s has kicked all players ::.", GetAdminName(playerid), GetName(playerid));
2096
	    SendClientMessageToAll(COLOR_REALRED, string);
2097
	    foreach(Player, i)
2098
	    {
2099
	        if(IsPlayerConnected(i) && PI[i][p_Admin] == 0)
2100
	        {
2101
	            Kick(i);
2102
	        }
2103
	    }
2104
	}
2105
	else
2106
	{
2107
	    SendPermissionError(playerid);
2108
	}
2109
	return 1;
2110
}
2111
CMD:ann(playerid, params[])
2112
{
2113
	if(PI[playerid][p_Admin] >= CI[cmd_Ann])
2114
	{
2115
	    new text[64], time, style, string[128];
2116
	    if(sscanf(params, "s[64]dd", text, time, style)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /ann [text] [time(ms)] [style(0-5)]");
2117
	    
2118
	    if(strlen(text) < 0) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter any text ::.");
2119
	    if(!time) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter a time ::.");
2120
	    if(!style) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter a style ::.");
2121
2122
		format(string, sizeof(string), "%s", text);
2123
	    foreach(Player, i)
2124
	    {
2125
	        if(IsPlayerConnected(i))
2126
	        {
2127
	            GameTextForPlayer(i, string, time, style);
2128
	        }
2129
	    }
2130
	}
2131
	else
2132
	{
2133
	    SendPermissionError(playerid);
2134
	}
2135
	return 1;
2136
}
2137
CMD:setcolor(playerid, params[])
2138
{
2139
	if(PI[playerid][p_Admin] >= CI[cmd_SetColor])
2140
	{
2141
	    new targetid, color[8], string[128];
2142
	    if(sscanf(params, "us[8]", targetid, color))
2143
		{
2144
			SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /setcolor [playerid] [color]");
2145
			SendClientMessage(playerid, COLOR_WHITE, "COLORS: White | Blue | Yellow | Orange | Purple | Grey | DarkRed | Red | Green | Cyan");
2146
			return 1;
2147
		}
2148
		
2149
		if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
2150
		
2151
		if(strcmp(color, "white", true) == 0)
2152
		{
2153
			format(string, sizeof(string), ".:: %s %s has set your color to "COL_WHITE"white"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
2154
			SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
2155
			SetPlayerColor(targetid, COLOR_WHITE);
2156
		}
2157
		if(strcmp(color, "blue", true) == 0)
2158
		{
2159
			format(string, sizeof(string), ".:: %s %s has set your color to "COL_BLUE"blue"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
2160
			SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
2161
			SetPlayerColor(targetid, COLOR_BLUE);
2162
		}
2163
		if(strcmp(color, "yellow", true) == 0)
2164
		{
2165
			format(string, sizeof(string), ".:: %s %s has set your color to "COL_YELLOW"yellow"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
2166
			SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
2167
			SetPlayerColor(targetid, COLOR_YELLOW);
2168
		}
2169
		if(strcmp(color, "orange", true) == 0)
2170
		{
2171
			format(string, sizeof(string), ".:: %s %s has set your color to "COL_ORANGE"orange"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
2172
			SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
2173
			SetPlayerColor(targetid, COLOR_ORANGE);
2174
		}
2175
		if(strcmp(color, "purple", true) == 0)
2176
		{
2177
			format(string, sizeof(string), ".:: %s %s has set your color to "COL_PURPLE"purple"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
2178
			SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
2179
			SetPlayerColor(targetid, COLOR_PURPLE);
2180
		}
2181
		if(strcmp(color, "grey", true) == 0)
2182
		{
2183
			format(string, sizeof(string), ".:: %s %s has set your color to "COL_GREY"grey"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
2184
			SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
2185
			SetPlayerColor(targetid, COLOR_GREY);
2186
		}
2187
		if(strcmp(color, "darkred", true) == 0)
2188
		{
2189
			format(string, sizeof(string), ".:: %s %s has set your color to "COL_RED"dark red"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
2190
			SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
2191
			SetPlayerColor(targetid, COLOR_RED);
2192
		}
2193
		if(strcmp(color, "red", true) == 0)
2194
		{
2195
			format(string, sizeof(string), ".:: %s %s has set your color to "COL_NICERED"red"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
2196
			SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
2197
			SetPlayerColor(targetid, COLOR_REALRED);
2198
		}
2199
		if(strcmp(color, "green", true) == 0)
2200
		{
2201
			format(string, sizeof(string), ".:: %s %s has set your color to "COL_GREEN"green"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
2202
			SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
2203
			SetPlayerColor(targetid, COLOR_GREEN);
2204
		}
2205
		if(strcmp(color, "cyan", true) == 0)
2206
		{
2207
			format(string, sizeof(string), ".:: %s %s has set your color to "COL_CYAN"cyan"COL_LIGHTBLUE" ::.", GetAdminName(playerid), GetName(playerid));
2208
			SendClientMessage(targetid, COLOR_LIGHTBLUE, string);
2209
			SetPlayerColor(targetid, COLOR_CYAN);
2210
		}
2211
	}
2212
	else
2213
	{
2214
	    SendPermissionError(playerid);
2215
	}
2216
	return 1;
2217
}
2218
CMD:makevip(playerid, params[])
2219
{
2220
	if(PI[playerid][p_Admin] >= CI[cmd_MakeVIP])
2221
	{
2222
	    new targetid, viplevel, string[128];
2223
	    if(sscanf(params, "ud", targetid, viplevel)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /makevip [playerid] [level(1-4)]");
2224
	    
2225
	    if(!IsPlayerConnected(targetid)) return SendConnectionError(playerid);
2226
	    if(viplevel < 1 || viplevel > 4) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: VIP level must be between 1 and 4 ::.");
2227
	    
2228
	    format(string, sizeof(string), ".:: %s %s has set %s's VIP level to %d ::.", GetAdminName(playerid), GetName(playerid), GetName(targetid), viplevel);
2229
	    SendClientMessageToAll(COLOR_REALRED, string);
2230
	    PI[targetid][p_VIP] = viplevel;
2231
	    SaveAccount(targetid);
2232
	}
2233
	else
2234
	{
2235
	    SendPermissionError(playerid);
2236
	}
2237
	return 1;
2238
}
2239
CMD:gotoloc(playerid, params[])
2240
{
2241
	if(PI[playerid][p_Admin] >= CI[cmd_GotoLoc])
2242
	{
2243
	    new Float: x, Float: y, Float: z, Interior, VW, string[128];
2244
	    if(sscanf(params, "fffdd", x, y, z, Interior, VW)) return SendClientMessage(playerid, COLOR_LIGHTBLUE, "USAGE: /gotoloc [X] [Y] [Z] [INT] [VW]");
2245
	    
2246
	    if(!Interior) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter an interior ::.");
2247
	    if(!VW) return SendClientMessage(playerid, COLOR_REALRED, ".:: ERROR: You did not enter a virtual world ::.");
2248
	    
2249
		format(string, sizeof(string), ".:: Teleported! [X: %.02f | Y: %.02f | Z: %.02f | INT: %d | VW: %d", x, y, z, Interior, VW);
2250
		SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
2251
		SetPlayerPos(playerid, x, y, z);
2252
		SetPlayerInterior(playerid, Interior);
2253
		SetPlayerVirtualWorld(playerid, VW);
2254
	}
2255
	else
2256
	{
2257
	    SendPermissionError(playerid);
2258
	}
2259
	return 1;
2260
}
2261
CMD:savecfgs(playerid, params[])
2262
{
2263
	if(PI[playerid][p_Admin] >= CI[cmd_SaveCFGs])
2264
	{
2265
		foreach(Player, i)
2266
		{
2267
		    if(IsPlayerConnected(i) && pLogged[i] == true)
2268
		    {
2269
		        SaveAccount(i);
2270
		    }
2271
		}
2272
		SaveCommands();
2273
		SaveVIPCommands();
2274
		foreach(Player, a)
2275
		{
2276
		    if(IsPlayerConnected(a) && PI[a][p_Admin] >= 1)
2277
		    {
2278
		        SendClientMessage(a, COLOR_YELLOW, ".:: SERVER: All configuration files have been updated ::.");
2279
		    }
2280
		}
2281
	}
2282
	else
2283
	{
2284
	    SendPermissionError(playerid);
2285
	}
2286
	return 1;
2287
}
2288
CMD:vipalert(playerid, params[])
2289
{
2290
	new string[128];
2291
	if(PI[playerid][p_Admin] >= CI[cmd_VIPAlert])
2292
	{
2293
	    if(ZADMIN_VIP_ALERT == true)
2294
	    {
2295
			format(string, sizeof(string), ".:: [VIP ALERT]: %s %s has disabled VIP alerting ::.", GetAdminName(playerid), GetName(playerid));
2296
			SendAdminMessage(COLOR_YELLOW, string);
2297
			ZADMIN_VIP_ALERT = false;
2298
	    }
2299
	    else
2300
	    {
2301
	        format(string, sizeof(string), ".:: [VIP ALERT]: %s %s has enabled VIP alerting ::.", GetAdminName(playerid), GetName(playerid));
2302
			SendAdminMessage(COLOR_YELLOW, string);
2303
			ZADMIN_VIP_ALERT = true;
2304
	    }
2305
	}
2306
	else
2307
	{
2308
	    SendPermissionError(playerid);
2309
	}
2310
	return 1;
2311
}
2312
// ---------------------------------------------