Guest User

Untitled

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