· 7 years ago · Mar 04, 2019, 02:04 PM
1/*******************************************************************************
2* SCRIPT NAME: ADMIN SYSTEM
3* SCRIPT VERSION: 0.5 (Mysql Version)
4* SCRIPT DEVELOPER: LOSIA
5* SCRIPT UPATES: Removed /arestart, Added bcrypt hash.
6*
7*******************************************************************************/
8//includes
9#include <a_samp>
10#include <sscanf2>
11#include <a_mysql41>
12#include <bcrypt>
13#include <zcmd>
14#include <foreach>
15
16new muted[MAX_PLAYERS];
17//[===========================Version 0.5===========================]
18new CarColors[][1] =
19{
20 {1},
21 {2},
22 {3},
23 {4},
24 {5},
25 {6},
26 {7},
27 {8},
28 {9},
29 {10},
30 {11},
31 {12},
32 {13},
33 {14},
34 {15},
35 {16},
36 {17},
37 {18},
38 {19},
39 {20},
40 {21},
41 {22},
42 {23},
43 {24},
44 {25},
45 {26},
46 {27},
47 {28},
48 {29},
49 {30},
50 {31},
51 {32},
52 {33},
53 {34},
54 {35},
55 {36},
56 {37},
57 {38},
58 {39},
59 {40},
60 {41},
61 {42},
62 {43},
63 {44},
64 {45},
65 {46},
66 {47},
67 {48},
68 {49},
69 {50},
70 {51},
71 {52},
72 {53},
73 {54},
74 {55},
75 {56},
76 {57},
77 {58},
78 {59},
79 {60},
80 {61},
81 {62},
82 {63},
83 {64},
84 {65},
85 {66},
86 {67},
87 {68},
88 {69},
89 {70},
90 {71},
91 {72},
92 {73},
93 {74},
94 {75},
95 {76},
96 {77},
97 {78},
98 {79},
99 {80},
100 {81},
101 {82},
102 {83},
103 {84},
104 {85},
105 {86},
106 {87},
107 {88},
108 {89},
109 {90},
110 {91},
111 {92},
112 {93},
113 {94},
114 {95},
115 {96},
116 {97},
117 {98},
118 {99},
119 {100},
120 {101},
121 {102},
122 {103},
123 {104},
124 {105},
125 {106},
126 {107},
127 {108},
128 {109},
129 {110},
130 {111},
131 {112},
132 {113},
133 {114},
134 {115},
135 {116},
136 {117},
137 {118},
138 {119},
139 {120},
140 {121},
141 {122},
142 {123},
143 {124},
144 {125},
145 {126}
146
147};
148new CarColors2[][1] =
149{
150 {126},
151 {125},
152 {124},
153 {123},
154 {122},
155 {121},
156 {120},
157 {119},
158 {118},
159 {117},
160 {116},
161 {115},
162 {114},
163 {113},
164 {112},
165 {111},
166 {110},
167 {109},
168 {108},
169 {107},
170 {106},
171 {105},
172 {104},
173 {103},
174 {102},
175 {101},
176 {100},
177 {99},
178 {98},
179 {97},
180 {96},
181 {95},
182 {94},
183 {93},
184 {92},
185 {91},
186 {90},
187 {89},
188 {88},
189 {87},
190 {86},
191 {85},
192 {84},
193 {83},
194 {82},
195 {81},
196 {80},
197 {79},
198 {78},
199 {77},
200 {76},
201 {75},
202 {74},
203 {73},
204 {72},
205 {71},
206 {70},
207 {69},
208 {68},
209 {67},
210 {66},
211 {65},
212 {64},
213 {63},
214 {62},
215 {61},
216 {60},
217 {59},
218 {58},
219 {57},
220 {56},
221 {55},
222 {54},
223 {53},
224 {52},
225 {51},
226 {50},
227 {49},
228 {48},
229 {47},
230 {46},
231 {45},
232 {44},
233 {43},
234 {42},
235 {41},
236 {40},
237 {39},
238 {38},
239 {37},
240 {36},
241 {35},
242 {34},
243 {33},
244 {32},
245 {31},
246 {30},
247 {29},
248 {28},
249 {27},
250 {26},
251 {25},
252 {24},
253 {23},
254 {22},
255 {21},
256 {20},
257 {19},
258 {18},
259 {17},
260 {16},
261 {15},
262 {14},
263 {13},
264 {12},
265 {11},
266 {10},
267 {9},
268 {8},
269 {7},
270 {6},
271 {5},
272 {4},
273 {3},
274 {2},
275 {1}
276
277};
278//[===========================Version 0.1a===========================]
279#define DIALOG_REGISTER 800
280#define DIALOG_LOGIN 8001
281#define DIALOG_SUCCESS_1 8003
282#define DIALOG_SUCCESS_2 8004
283#define Grey 0xC0C0C0C8
284
285//== Mysql Connection === //
286#define HOST "localhost"
287#define USER "root"
288#define DB "uff"
289#define PASS "server"
290//======================
291
292#define COL_WHITE "{FFFFFF}"
293#define COL_RED "{F81414}"
294#define COL_GREEN "{00FF22}"
295#define COL_LIGHTBLUE "{00CED1}"
296 //Shades of red
297#define COLOR_INDIANRED 0xCD5C5CFF
298#define COLOR_LIGHTCORAL 0xF08080FF
299#define COLOR_SALMON 0xFA8072FF
300#define COLOR_DARKSALMON 0xE9967AFF
301#define COLOR_LIGHTSALMON 0xFFA07AFF
302#define COLOR_CRIMSON 0xDC143CFF
303#define COLOR_RED 0xFF0000FF
304#define COLOR_FIREBRICK B22222FF
305#define COLOR_DARKRED 0x8B0000FF
306
307//Shades of pink
308#define COLOR_PINK 0xFFC0CBFF
309#define COLOR_LIGHTPINK 0xFFB6C1FF
310#define COLOR_HOTPINK 0xFF69B4FF
311#define COLOR_DEEPPINK 0xFF1493FF
312#define COLOR_MEDIUMVIOLETRED 0xC71585FF
313#define COLOR_PALEVIOLETRED 0xDB7093FF
314
315//Shades of Orange
316#define COLOR_CORAL 0xFF7F50FF
317#define COLOR_TOMATO 0xFF6347FF
318#define COLOR_ORANGERED 0xFF4500FF
319#define COLOR_DARKORANGE 0xFF8C00FF
320#define COLOR_ORANGE 0xFFA500FF
321
322//Shades of Yellow
323#define COLOR_GOLD 0xFFD700FF
324#define COLOR_YELLOW 0xFFFF00FF
325#define COLOR_LIGHTYELLOW 0xFFFFE0FF
326#define COLOR_LEMONCHIFFON 0xFFFACDFF
327#define COLOR_LIGHTGOLDENRODYELLOW 0xFAFAD2FF
328#define COLOR_PAPAYAWHIP 0xFFEFD5FF
329#define COLOR_MOCCASIN 0xFFE4B5FF
330#define COLOR_PEACHPUFF 0xFFDAB9FF
331#define COLOR_PALEGOLDENROD 0xEEE8AAFF
332#define COLOR_KHAKI 0xF0E68CFF
333#define COLOR_DARKKHAKI 0xBDB76BFF
334
335//Shades of Purple
336#define COLOR_LAVENDER 0xE6E6FAFF
337#define COLOR_THISTLE 0xD8BFD8FF
338#define COLOR_PLUM 0xDDA0DDFF
339#define COLOR_VIOLET 0xEE82EEFF
340#define COLOR_ORCHID 0xDA70D6FF
341#define COLOR_FUCHSIA 0xFF00FFFF
342#define COLOR_MAGENTA 0xFF00FFFF
343#define COLOR_MEDIUMORCHID 0xBA55D3FF
344#define COLOR_MEDIUMPURPLE 0x9370DBFF
345#define COLOR_AMETHYST 0x9966CCFF
346#define COLOR_BLUEVIOLET 0x8A2BE2FF
347#define COLOR_DARKVIOLET 0x9400D3FF
348#define COLOR_DARKORCHID 0x9932CCFF
349#define COLOR_DARKMAGENTA 0x8B008BFF
350#define COLOR_PURPLE 0x800080FF
351#define COLOR_INDIGO 0x4B0082FF
352#define COLOR_SLATEBLUE 0x6A5ACDFF
353#define COLOR_DARKSLATEBLUE 0x483D8BFF
354#define COLOR_MEDIUMSLATEBLUE 0x7B68EEFF
355
356//Shades of Green
357#define COLOR_GREENYELLOW 0xADFF2FFF
358#define COLOR_CHARTREUSE 0x7FFF00FF
359#define COLOR_LAWNGREEN 0x7CFC00FF
360#define COLOR_LIME 0x00FF00FF
361#define COLOR_LIMEGREEN 0x32CD32FF
362#define COLOR_PALEGREEN 0x98FB98FF
363#define COLOR_LIGHTGREEN 0x90EE90FF
364#define COLOR_MEDIUMSPRINGGREEN 0x00FA9AFF
365#define COLOR_SPRINGGREEN 0x00FF7FFF
366#define COLOR_MEDIUMSEAGREEN 0x3CB371FF
367#define COLOR_SEAGREEN 0x2E8B57FF
368#define COLOR_FORESTGREEN 0x228B22FF
369#define COLOR_GREEN 0x008000FF
370#define COLOR_DARKGREEN 0x006400FF
371#define COLOR_YELLOWGREEN 0x9ACD32FF
372#define COLOR_OLIVEDRAB 0x6B8E23FF
373#define COLOR_OLIVE 0x808000FF
374#define COLOR_DARKOLIVEGREEN 0x556B2FFF
375#define COLOR_MEDIUMAQUAMARINE 0x66CDAAFF
376#define COLOR_DARKSEAGREEN 0x8FBC8FFF
377#define COLOR_LIGHTSEAGREEN 0x20B2AAFF
378#define COLOR_DARKCYAN 0x008B8BFF
379#define COLOR_TEAL 0x008080FF
380
381//Shades of Blue/Cyan
382#define COLOR_AQUA 0x00FFFFFF
383#define COLOR_CYAN 0x00FFFFFF
384#define COLOR_LIGHTCYAN 0xE0FFFFFF
385#define COLOR_PALETURQUOISE 0xAFEEEEFF
386#define COLOR_AQUAMARINE 0x7FFFD4FF
387#define COLOR_TURQUOISE 0x40E0D0FF
388#define COLOR_MEDIUMTURQUOISE 0x48D1CC
389#define COLOR_DARKTURQUOISE 0x00CED1FF
390#define COLOR_CADETBLUE 0x5F9EA0FF
391#define COLOR_STEELBLUE 0x4682B4FF
392#define COLOR_LIGHTSTEELBLUE 0xB0C4DEFF
393#define COLOR_POWDERBLUE 0xB0E0E6FF
394#define COLOR_LIGHTBLUE 0xADD8E6FF
395#define COLOR_SKYBLUE 0x87CEEBFF
396#define COLOR_LIGHTSKYBLUE 0x87CEFAFF
397#define COLOR_DEEPSKYBLUE 0x00BFFFFF
398#define COLOR_DODGERBLUE 0x1E90FFFF
399#define COLOR_CORNFLOWERBLUE 0x6495EDFF
400#define COLOR_MEDIUMSLATEBLUE 0x7B68EEFF
401#define COLOR_ROYALBLUE 0x4169E1FF
402#define COLOR_BLUE 0x0000FFFF
403#define COLOR_MEDIUMBLUE 0x0000CDFF
404#define DARKBLUE 0x00008BFF
405#define COLOR_NAVY 0x000080FF
406#define COLOR_MIDNIGHTBLUE 0x191970FF
407
408//Shades of Brown
409#define COLOR_CORNSILK 0xFFF8DCFF
410#define COLOR_BLANCHEDALMOND 0xFFEBCDFF
411#define COLOR_BISQUE 0xFFE4C4FF
412#define COLOR_NAVAJOWHITE 0xFFDEADFF
413#define COLOR_WHEAT 0xF5DEB3FF
414#define COLOR_BURLYWOOD 0xDEB887FF
415#define COLOR_TAN 0xD2B48CFF
416#define COLOR_ROSYBROWN 0xBC8F8FFF
417#define COLOR_SANDYBROWN 0xF4A460FF
418#define COLOR_DARKGOLDENROD 0xB8860BFF
419#define COLOR_PERU 0xCD853FFF
420#define COLOR_SADDLEBROWN 0x8B4513FF
421#define COLOR_SIENNA 0xA0522DFF
422#define COLOR_BROWN 0xA52A2AFF
423#define COLOR_MAROON 0x800000FF
424
425//Shades of Grey
426#define COLOR_WHITE 0xFFFFFFFF
427#define COLOR_GAINSBORO 0xDCDCDCFF
428#define COLOR_LIGHTGREY 0xD3D3D3FF
429#define COLOR_SILVER 0xC0C0C0FF
430#define COLOR_DARKGRAY 0xA9A9A9FF
431#define COLOR_GRAY 0x808080FF
432#define COLOR_DIMGRAY 0x696969FF
433#define COLOR_LIGHTSLATEGRAY 0x778899FF
434#define COLOR_SLATEGRAY 0x708090FF
435#define COLOR_DARKSLATEGRAY 0x2F4F4FFF
436#define COLOR_BLACK 0x000000FFPS.
437#define BCRYPT_COST 15 // Limit 0-41
438
439new MySQL:Connection, String[300], query[400], Float:SpecX[MAX_PLAYERS], Float:SpecY[MAX_PLAYERS], Float:SpecZ[MAX_PLAYERS], vWorld[MAX_PLAYERS], Inter[MAX_PLAYERS];
440new IsSpecing[MAX_PLAYERS], Name[MAX_PLAYER_NAME], IsBeingSpeced[MAX_PLAYERS],spectatorid[MAX_PLAYERS];
441
442enum pInfo
443{
444 pID,
445 pCash,
446 pAdmin,
447 pKills,
448 pDeaths,
449 pActive,
450 pScore,
451 pPlayerName[MAX_PLAYER_NAME]
452}
453
454new PlayerInfo[MAX_PLAYERS][pInfo];
455
456public OnFilterScriptInit()
457{
458 Connection = mysql_connect(HOST, USER, PASS, DB);
459 if(Connection == MYSQL_INVALID_HANDLE)
460 {
461 print("Admin System: Connection to MySQL failed!");
462 return 1;
463 }
464 print("Admin System by Losia: Connection Established! Loaded");
465
466 new createstr[2600];
467
468 format(createstr, sizeof(createstr), "\
469 CREATE TABLE IF NOT EXISTS `Users` (\
470 `ID` int(7) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Players Reg ID',\
471 `name` varchar(24) NOT NULL COMMENT 'Player''s Name',\
472 `playerip` varchar(16) NOT NULL COMMENT 'Players IP',\
473 `password` varchar(42) NOT NULL COMMENT 'Players Password',\
474 `kills` int(6) unsigned NOT NULL DEFAULT 0 COMMENT 'Player Kills',\
475 `deaths` smallint(5) unsigned NOT NULL DEFAULT 0 COMMENT 'Player Deaths',\
476 `money` int(11) unsigned NOT NULL DEFAULT 0 COMMENT 'Player Money',\
477 `score` mediumint(6) unsigned NOT NULL DEFAULT 0 COMMENT 'Player Score',\
478 `active` tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT 'Player Active',\
479 PRIMARY KEY (`ID`),\
480 KEY `name` (`name`)\
481 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC COMMENT='Player Data Storage';");
482 mysql_tquery(Connection, createstr, "", "");
483 return 1;
484}
485
486public OnPlayerConnect(playerid)
487{
488 ResetVariables(playerid);
489 new pname[MAX_PLAYER_NAME];
490 GetPlayerName(playerid,pname, sizeof(pname));
491 PlayerInfo[playerid][pPlayerName] = pname;
492 mysql_format(Connection, query, sizeof(query), "SELECT * FROM `Users` WHERE `name` = '%e'", PlayerInfo[playerid][pPlayerName]);
493 mysql_tquery(Connection, query, "AccountExist", "d", playerid);
494 return 1;
495}
496
497forward AccountExist(playerid);
498public AccountExist(playerid)
499{
500 if(cache_num_rows())
501 {
502 ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Type your password to login to acces your account","Login","Quit");
503 }
504 else
505 {
506 ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Register",""COL_WHITE"{FFFFFF}You are {FF0000}not {FFFFFF}registered","Register","Quit");
507 }
508 return 1;
509}
510
511ResetVariables(playerid)
512{
513PlayerInfo[playerid][pActive] = 0;
514PlayerInfo[playerid][pScore] = 0;
515PlayerInfo[playerid][pKills] = 0;
516PlayerInfo[playerid][pAdmin] = 0;
517PlayerInfo[playerid][pDeaths] = 0;
518PlayerInfo[playerid][pKills] = 0;
519PlayerInfo[playerid][pCash] = 0;
520}
521public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
522{
523 switch( dialogid )
524 {
525 case DIALOG_REGISTER:
526 {
527 if(response)
528 {
529 bcrypt_hash(inputtext, BCRYPT_COST, "PlayerPasswordTyped", "d", playerid);
530 }
531 else Kick(playerid);
532 }
533 case DIALOG_LOGIN:
534 {
535 if( response )
536 {
537 new ppass[BCRYPT_HASH_LENGTH];
538 mysql_format(Connection, query, sizeof(query), "SELECT `password` FROM `Users` WHERE `name` = '%e'", PlayerInfo[playerid][pPlayerName]);
539 mysql_query(Connection, query);
540 cache_get_value_name(0, "password", ppass, BCRYPT_HASH_LENGTH);
541 bcrypt_check(inputtext, ppass, "PasswordRight", "d", playerid);
542 }
543 else Kick ( playerid );
544 }
545 }
546 return 1;
547}
548
549forward PlayerPasswordTyped(playerid);
550public PlayerPasswordTyped(playerid)
551{
552 new bhash[BCRYPT_HASH_LENGTH];
553 new PlayerIP[17];
554 GetPlayerIp(playerid, PlayerIP, sizeof(PlayerIP));
555 bcrypt_get_hash(bhash);
556 mysql_format(Connection, query, sizeof(query), "INSERT INTO `Users` (`name`, `password`, `playerip`, `active`) VALUES ('%e', '%e', '%e', '1')", PlayerInfo[playerid][pPlayerName], bhash, PlayerIP);
557 mysql_tquery(Connection, query, "", "");
558 SendClientMessage(playerid, -1, ""COL_WHITE"Server Register: You have successfully registered! Have Fun. :)");
559 PlayerInfo[playerid][pActive] = 1;
560 SpawnPlayer(playerid);
561 return 1;
562}
563
564
565forward PasswordRight(playerid);
566public PasswordRight(playerid)
567{
568 new bool:bmatch = bcrypt_is_equal();
569 if(!bmatch) return ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Wrong Password! Please type the correct password.","Login","Quit");
570 mysql_format(Connection, query, sizeof(query), "SELECT * FROM `Users` WHERE `name` = '%e'", PlayerInfo[playerid][pPlayerName]);
571 mysql_tquery(Connection, query, "LoadPlayerData", "d", playerid);
572
573 mysql_format(Connection, query, sizeof(query), "UPDATE `Users` SET `active` = '1' WHERE `ID` = '%i'", PlayerInfo[playerid][pID]);
574 mysql_query(Connection, query);
575 PlayerInfo[playerid][pActive] = 1;
576 return 1;
577}
578
579forward LoadPlayerData(playerid);
580public LoadPlayerData(playerid)
581{
582 cache_get_value_name_int(0, "ID", PlayerInfo[playerid][pID]);
583 cache_get_value_name_int(0, "money", PlayerInfo[playerid][pCash]);
584 cache_get_value_name_int(0, "kills", PlayerInfo[playerid][pKills]);
585 cache_get_value_name_int(0, "deaths", PlayerInfo[playerid][pDeaths]);
586 cache_get_value_name_int(0, "adminlevel", PlayerInfo[playerid][pDeaths]);
587 cache_get_value_name_int(0, "score", PlayerInfo[playerid][pScore]);
588 return 1;
589}
590
591
592forward Wheel1(playerid);
593public Wheel1(playerid)
594{
595 new Wheel = random(6);
596 switch(Wheel)
597 {
598 case 0: AddVehicleComponent(GetPlayerVehicleID(playerid), 1073);
599 case 1: AddVehicleComponent(GetPlayerVehicleID(playerid), 1098);
600 case 2: AddVehicleComponent(GetPlayerVehicleID(playerid), 1080);
601 case 3: AddVehicleComponent(GetPlayerVehicleID(playerid), 1077);
602 case 4: AddVehicleComponent(GetPlayerVehicleID(playerid), 1076);
603 case 5: AddVehicleComponent(GetPlayerVehicleID(playerid), 1075);
604 }
605}
606
607public OnPlayerDisconnect(playerid,reason)
608{
609 if(IsPlayerConnected(playerid)) SavePlayerData(playerid);
610 return 1;
611}
612
613
614stock SavePlayerData(playerid)
615{
616 PlayerInfo[playerid][pActive] = 0;
617 mysql_format(Connection, query, sizeof(query), "UPDATE `Users` SET `money` = '%i', `kills` = '%i', `deaths` = '%i', `adminlevel` = '%i', `score` = '%i', `active` = '0' WHERE `ID` = '%i'", PlayerInfo[playerid][pCash], PlayerInfo[playerid][pKills], PlayerInfo[playerid][pDeaths], PlayerInfo[playerid][pAdmin],PlayerInfo[playerid][pScore], PlayerInfo[playerid][pID]);
618 mysql_query(Connection, query);
619}
620
621
622public OnPlayerDeath(playerid,killerid,reason)
623{
624 if(IsBeingSpeced[playerid] == 1)
625 {
626 foreach(Player,i)
627 {
628 if(spectatorid[i] == playerid)
629 {
630 TogglePlayerSpectating(i,false);
631 }
632 }
633 }
634 return 1;
635}
636
637public OnPlayerText(playerid,text[])
638{
639
640 if(muted[playerid] == 1)
641 {
642 SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B}You can not talk while your muted.");
643 return 0;
644 }
645 return 1;
646}
647
648CMD:slap(playerid,params[])
649{
650 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
651
652 new target,Float:x,Float:y,Float:z;
653 if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /slap (playerid).");
654 if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
655 format(String,sizeof(String),"{F83934}[System]:{8B8B8B} %s got slapped by an Staff Member.",PlayerInfo[target][pPlayerName]);
656 SendClientMessageToAll(-1,String);
657 GetPlayerPos(target,x,y,z);
658 SetPlayerPos(target,x,y,z+15);
659 return 1;
660}
661
662CMD:banaka(playerid,params[])
663{
664 if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
665 new ip[44];
666 if(sscanf(params,"s[44]",ip)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /ban (playerid).");
667 format(String,sizeof(String),"banaka %s",ip);
668 SendRconCommand(String);
669 format(String,sizeof(String),"{F83934}[System]:{8B8B8B} %s got (IP)banned by an Staff Member.",ip);
670 SendClientMessage(playerid,-1,String);
671 PlayerPlaySound(playerid, 1009, 0.0, 0.0, 0.0);
672 return 1;
673}
674
675CMD:freeze(playerid,params[])
676{
677 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
678 new target;
679 if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /freeze (playerid).");
680 if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"ERROR:Player not connected.");
681 format(String,sizeof(String),"{F83934}[System]:{8B8B8B} %s got frozen by an Staff Member.",PlayerInfo[target][pPlayerName]);
682 SendClientMessageToAll(-1,String);
683 TogglePlayerControllable(target,0);
684 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
685 return 1;
686}
687
688CMD:unfreeze(playerid,params[])
689{
690 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
691 new target;
692 if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /unfreeze (playerid).");
693 if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected .");
694 format(String,sizeof(String),"{F83934}[System]:{8B8B8B} %s got unfrozen by an Staff Member.",PlayerInfo[target][pPlayerName]);
695 SendClientMessageToAll(-1,String);
696 TogglePlayerControllable(target,1);
697 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
698 return 1;
699}
700
701CMD:agoto(playerid,params[])
702{
703 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
704 new target,Float:x,Float:y,Float:z;
705 if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /agoto (playerid).");
706 if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected");
707 GetPlayerPos(target,x,y,z);
708 SetPlayerPos(playerid,x,y,z);
709 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
710 return 1;
711}
712
713CMD:aget(playerid,params[])
714{
715 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
716 new target,Float:x,Float:y,Float:z;
717 if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /get (playerid).");
718 if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
719 GetPlayerPos(playerid,x,y,z);
720 SetPlayerPos(target,x,y,z);
721 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
722 return 1;
723}
724
725CMD:mute(playerid,params[])
726{
727 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
728 new target;
729 if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /mute (playerid).");
730 if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
731 format(String,sizeof(String),"{F83934}[System]:{8B8B8B} %s got muted by an Staff Member.",PlayerInfo[target][pPlayerName]);
732 SendClientMessageToAll(-1,String);
733 muted[target] = 1;
734 PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
735 return 1;
736}
737
738CMD:unmute(playerid,params[])
739{
740 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
741 new target;
742 if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{FF0000}[Usage]: {FFFF00}/Unmute (PlayerID).");
743 if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
744 format(String,sizeof(String),"{F83934}[System]:{8B8B8B} %s got unmuted by an Staff Member.",PlayerInfo[target][pPlayerName]);
745 SendClientMessageToAll(-1,String);
746 muted[target] = 0;
747 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
748 return 1;
749}
750
751CMD:kick(playerid,params[])
752{
753 if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
754 new target,reason[66];
755 if(sscanf(params,"us[66]",target,reason)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B}/kick (PlayerID) (Reason).");
756 if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
757 format(String,sizeof(String),"{F83934}[System]:{8B8B8B} %s got unmuted by an Staff Member.[ Reason: %s ]",PlayerInfo[target][pPlayerName],reason);
758 SendClientMessageToAll(-1,String);
759 Kick(target);
760 PlayerPlaySound(playerid, 1009, 0.0, 0.0, 0.0);
761 return 1;
762}
763
764CMD:ban(playerid,params[])
765{
766 if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
767 new target,reason[66];
768 if(sscanf(params,"us[66]",target,reason)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} /Ban (PlayerID) (Reason)");
769 if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
770 format(String,sizeof(String),"{F83934}[System]:{8B8B8B} %s got banned by a Staff Member - [ Reason: %s ]",PlayerInfo[target][pPlayerName],reason);
771 SendClientMessageToAll(-1,String);
772 Ban(target);
773 PlayerPlaySound(playerid, 1009, 0.0, 0.0, 0.0);
774 return 1;
775}
776
777CMD:ip(playerid,params[])
778{
779 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
780 new target,pIP[34];
781 if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B}/IP (PlayerID)");
782 if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
783 GetPlayerIp(target,pIP,34);
784 format(String,sizeof(String),"{FFFF00}%s's IP is %s",PlayerInfo[target][pPlayerName],pIP);
785 SendClientMessage(playerid,-1,String);
786 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
787 return 1;
788}
789
790CMD:setadminlevel(playerid,params[])
791{
792 if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
793 new target,level;
794 if(sscanf(params,"ud",target,level)) return SendClientMessage(playerid,-1,"{FF0000}[Usage]: {FFFF00}/setadminlevel (PlayerID) (Level)");
795 if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
796 if(level < 0 || level > 3) return SendClientMessage(playerid,-1,"{F83934}[Error]:Invalid level. (1 - 3)");
797 SendClientMessageToAll(-1,String);
798 PlayerInfo[target][pAdmin] = level;
799 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
800 return 1;
801}
802
803COMMAND:spec(playerid, params[])
804{
805 new id;
806 if(PlayerInfo[playerid][pAdmin] < 1) return 0;
807 if(sscanf(params,"u", id))return SendClientMessage(playerid, Grey, "{F83934}[Usage]:{8B8B8B}/Spec (ID)");
808 if(id == playerid)return SendClientMessage(playerid,Grey,"{F83934}[Error]:{8B8B8B} You Cannot Spectate Yourself");
809 if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid, Grey, "{F83934}[Error]:Player Not Found");
810 if(IsSpecing[playerid] == 1)return SendClientMessage(playerid,Grey,"{F83934}[Error]:You Are Already Spectating Somebody");
811 GetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);
812 Inter[playerid] = GetPlayerInterior(playerid);
813 vWorld[playerid] = GetPlayerVirtualWorld(playerid);
814 TogglePlayerSpectating(playerid, true);
815 if(IsPlayerInAnyVehicle(id))
816
817 if(GetPlayerInterior(id) > 0)
818 {
819 SetPlayerInterior(playerid,GetPlayerInterior(id));
820 }
821 else if(GetPlayerVirtualWorld(id) > 0)
822 {
823 SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
824 }
825 PlayerSpectateVehicle(playerid,GetPlayerVehicleID(id));
826
827 {
828 if(GetPlayerInterior(id) > 0)
829 {
830 SetPlayerInterior(playerid,GetPlayerInterior(id));
831 }
832 if(GetPlayerVirtualWorld(id) > 0)
833 {
834 SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
835 }
836 PlayerSpectatePlayer(playerid,id);
837 }
838 GetPlayerName(id, Name, sizeof(Name));
839 format(String, sizeof(String),"{F83934}[System]:{8B8B8B} You're now Spectating %s.",Name);
840 SendClientMessage(playerid,0x0080C0FF,String);
841 IsSpecing[playerid] = 1;
842 IsBeingSpeced[id] = 1;
843 spectatorid[playerid] = id;
844 return 1;
845}
846
847 COMMAND:specoff(playerid, params[])
848{
849 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
850 TogglePlayerSpectating(playerid, 0);
851 return 1;
852}
853
854public OnPlayerStateChange(playerid, newstate, oldstate)
855{
856 if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
857 {
858 if(IsBeingSpeced[playerid] == 1)
859 {
860 foreach(Player,i)
861 {
862 if(spectatorid[i] == playerid)
863 {
864 PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid));
865 }
866 }
867 }
868 }
869 if(newstate == PLAYER_STATE_ONFOOT)
870 {
871 if(IsBeingSpeced[playerid] == 1)
872 {
873 foreach(Player,i)
874 {
875 if(spectatorid[i] == playerid)
876 {
877 PlayerSpectatePlayer(i, playerid);
878 }
879 }
880 }
881 }
882 return 1;
883}
884
885public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
886{
887 if(IsBeingSpeced[playerid] == 1)
888 {
889 foreach(Player,i)
890 {
891 if(spectatorid[i] == playerid)
892 {
893 SetPlayerInterior(i,GetPlayerInterior(playerid));
894 SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(playerid));
895 }
896 }
897 }
898 return 1;
899}
900public OnPlayerSpawn(playerid)
901{
902 SetPlayerInterior(playerid, 0);
903 SetPlayerVirtualWorld(playerid, 0);
904 SetPlayerHealth(playerid, 99999);
905
906 SetPlayerHealth(playerid, 999999);
907
908
909 SendClientMessage(playerid, 0xFF0000FF, "{F83934}[System]:{8B8B8B} Anti-Spawn kill protection");
910
911
912 SetTimerEx("EndAntiSpawnKill", 15000, false, "i", playerid);
913}
914
915
916forward EndAntiSpawnKill(playerid);
917
918
919public EndAntiSpawnKill(playerid)
920{
921
922 SetPlayerHealth(playerid, 100);
923
924
925 SendClientMessage(playerid, 0xFF0000FF, "{F83934}[System]:{8B8B8B} Anti-Spawn kill protection over");
926 return 1;
927}
928
929
930
931
932
933CMD:report(playerid, params[])
934{
935 new tmp[256], idx;
936 tmp = strrest(params, idx);
937 if(!strlen(tmp)){
938 SendClientMessage(playerid, 0x555252AA, "{F83934}[Usage]:{8B8B8B}/Report [PlayerID] [Reason]");
939 return 1;
940 }else{
941 new pid = strval(tmp);
942 tmp = strrest(params, idx);
943 if(!IsPlayerConnected(pid)){
944 SendClientMessage(playerid, 0x555252AA, "{F83934}[Error]:{8B8B8B} Invalid ID!");
945 return 1;
946 }else{
947 if(!strlen(tmp)){
948 SendClientMessage(playerid, 0x555252AA, "{F83934}[Usage]:{8B8B8B}/Report [PlayerID] [Reason]");
949 return 1;
950 }else{
951 new name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME];
952 GetPlayerName(playerid, name, sizeof(name));
953 GetPlayerName(pid, name2, sizeof(name2));
954 format(String, sizeof(String), "{00FFFF}>> - %s(%d) Has Reported %s(%d) For '%s'", name, playerid, name2, pid, tmp);
955 for(new i=0; i<GetMaxPlayers(); i++){
956 if(IsPlayerConnected(i)){
957 if(PlayerInfo[playerid][pAdmin] < 1) {
958 SendClientMessage(i, 0x555252AA, String);
959 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
960 }
961 }
962 }
963 }
964 }
965 }
966 return 1;
967}
968
969strrest(const sString[], &index)
970{
971 new length = strlen(sString);
972 while ((index < length) && (sString[index] <= ' '))
973 {
974 index++;
975 }
976
977 new offset = index;
978 new result[20];
979 while ((index < length) && (sString[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
980 {
981 result[index - offset] = sString[index];
982 index++;
983 }
984 result[index - offset] = EOS;
985 return result;
986}
987
988 COMMAND:announce(playerid, params[])
989{
990 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
991 new text[64], time, style;
992 if(PlayerInfo[playerid][pAdmin] < 2) return 0;
993 else if (sscanf(params, "iis[64]", style, time, text)) return SendClientMessage(playerid,Grey,"{F83934}[Usage]:{8B8B8B}/Announce (Style[0-6]) (Time) (Text)");
994 else if (strlen(text) > 64) return SendClientMessage(playerid,Grey,"{F83934}[Error]:{8B8B8B} Message is too long.");
995 else if (style == 2) return SendClientMessage(playerid,Grey,"{F83934}[Usage]:{8B8B8B} Bug with style No.2 don't use it!");
996 else if (style < 0 || style > 6) return SendClientMessage(playerid,0x854900FF,"{F83934}[Error]:{8B8B8B}");
997 else if (time > 20*1000) return SendClientMessage(playerid, Grey,"{F83934}[Error]:{8B8B8B} Message can not be longer then 20 seconds!");
998 else {
999 GameTextForAll(text, time, style);
1000 }
1001 return 1;
1002}
1003
1004CMD:acmds(playerid, params[])
1005{
1006 PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
1007 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
1008 SendClientMessage(playerid, 0x0077BB00 , "{00FF00}(Level 1 | Helper) ");
1009 SendClientMessage(playerid, 0x0077BB00 , "»»{FFFF00}/slap, /report, /freeze, /unfreeze, /agoto, /aget, /mute, /unmute, /ip, /spec, /god, /specoff««");
1010 SendClientMessage(playerid, 0x0077BB00 , "{00FF00}(Level 2 | Server Administrator) ");
1011 SendClientMessage(playerid, 0x0077BB00 , "»»{FFFF00}/kick, /vcolor, /repair, /aduty, /healme, /ban, /announce, /aexplode, /asetskin, /asetweather, /aclearchat««");
1012 SendClientMessage(playerid, 0x0077BB00 , "{00FF00}(Level 3 | Server Owner) ");
1013 SendClientMessage(playerid, 0x0077BB00 , "»»{FFFF00}/banaka, /setadminlevel, /gmx ««");
1014 return 1;
1015}
1016
1017CMD:aexplode(playerid, params[]){
1018 if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
1019 new amount;
1020 new Float:boomx, Float:boomy, Float:boomz;
1021 if(sscanf(params, "i", amount)) return SendClientMessage(playerid,Grey,"{F83934}[Usage]:{8B8B8B} /Aexplode [PlayerID]");
1022 GetPlayerPos(playerid,boomx, boomy, boomz);
1023 CreateExplosion(boomx, boomy , boomz, amount, 10);
1024 return 1;
1025}
1026
1027
1028
1029 COMMAND:admins(playerid,params[])
1030{
1031 if(IsPlayerConnected(playerid))
1032 {
1033 SendClientMessage(playerid, COLOR_RED, " ");
1034 SendClientMessage(playerid, 0xFF0080C8, "[============Online Staff Members============] ");
1035 for(new i = 0; i < MAX_PLAYERS; i++)
1036 {
1037 if(IsPlayerConnected(i))
1038 {
1039 if(PlayerInfo[i][pAdmin] > 1)
1040 {
1041 new admtext[64];
1042 new sendername[MAX_PLAYER_NAME];
1043
1044 if(PlayerInfo[i][pAdmin] == 1) { admtext = "{80FF00}Level 1 Trial Moderator"; }
1045 else if(PlayerInfo[i][pAdmin] == 2) { admtext = "{80FF00}Level 2 Server Administrator"; }
1046 else if(PlayerInfo[i][pAdmin] == 3) { admtext = "{80FF00}Level 3 Server Owner"; }
1047 GetPlayerName(i, sendername, sizeof(sendername));
1048 format(String, 256, "{FF00FF}%s {80FF00}( %s )", sendername, admtext);
1049 SendClientMessage(playerid, 0xFFFF00C8, String);
1050 SendClientMessage(playerid, 0xFF0080C8, "[============Online Staff Members============]");
1051 }
1052 }
1053 }
1054 }
1055 return 1;
1056}
1057
1058CMD:asetskin(playerid, params[])
1059{
1060
1061 new name[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], id, skinid;
1062 if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
1063 if(sscanf(params, "ui", id, skinid)) return SendClientMessage(playerid, -1, "{F83934}[Usage]:{8B8B8B}/Asetskin (PlayerID) (SkinID)");
1064 GetPlayerName(playerid, name, MAX_PLAYER_NAME);
1065 GetPlayerName(id, targetname, MAX_PLAYER_NAME);
1066 if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "{F83934}[Error]:{8B8B8B} Player Not Connected!");
1067 SetPlayerSkin(id, skinid);
1068 format(String, 128, "{F83934}[System]:{8B8B8B} Staff Member %s(%d) has changed your skin To %i", name, playerid, skinid);
1069 SendClientMessage(id, 0xFFFF00C8, String);
1070 format(String, 128, "{F83934}[System]:{8B8B8B} You have successfully set his skin to %i", targetname, id, skinid);
1071 SendClientMessage(playerid, -1, String);
1072 return 1;
1073}
1074
1075CMD:asetweather(playerid,params[])
1076 {
1077 if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
1078 new sendername[MAX_PLAYER_NAME];
1079 new weather;
1080 if(sscanf(params, "d", weather))
1081 return SendClientMessage(playerid, Grey, "{F83934}[Usage]:{8B8B8B}/Asetweather (WeatherID)");
1082 if(PlayerInfo[playerid][pAdmin] < 2)
1083 return SendClientMessage(playerid, Grey, "{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
1084 {
1085 SetWeather(weather);
1086 SendClientMessage(playerid, Grey, "[LOST:RP] The weather has been changed");
1087 GetPlayerName(playerid, sendername, sizeof(sendername));
1088 format(String, 256, "{F83934}[System]:{8B8B8B} Staff Member %s changed the weather to weather ID(%d)", sendername,weather);
1089 SendClientMessage(playerid, -1, String);
1090 }
1091 return 1;
1092 }
1093
1094CMD:aclearchat(playerid, params[])
1095{
1096 if(PlayerInfo[playerid][pAdmin] < 2)
1097 {
1098 ClearChatboxAll(playerid);
1099 }
1100 else
1101 {
1102 SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
1103 return 1;
1104 }
1105 return 1;
1106}
1107
1108
1109ClearChatboxAll(playerid)
1110{
1111 for(new i = 0; i < 50; i++)
1112 {
1113 SendClientMessage(playerid, 0xFFFFFFC8, "");
1114 }
1115 return 1;
1116}
1117
1118//[===========================Version 0.5===========================]
1119CMD:repair(playerid, params[])
1120{
1121 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
1122 if(IsPlayerInAnyVehicle(playerid))
1123 {
1124 new vehicleid = GetPlayerVehicleID(playerid);
1125 SetVehicleHealth(vehicleid, 1000);
1126 }
1127 else return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not in a vehicle.");
1128 return 1;
1129}
1130
1131CMD:healme(playerid, params[])
1132{
1133 if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
1134 {
1135 SetPlayerHealth(playerid, 100);
1136 return 1;
1137 }
1138}
1139
1140CMD:god(playerid, params[])
1141{
1142 if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
1143 {
1144 SetPlayerHealth(playerid, 99999);
1145 }
1146 return 1;
1147}
1148
1149CMD:vcolor(playerid, params[])
1150{
1151 if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
1152 {
1153 new vehicleid = GetPlayerVehicleID(playerid);
1154 new colors = random(sizeof(CarColors));
1155 new colors2 = random(sizeof(CarColors2));
1156 ChangeVehicleColor(vehicleid,CarColors[colors][0],CarColors2[colors2][0]);
1157 }
1158 return 1;
1159}