Guest User

Untitled

a guest
Dec 30th, 2013
715
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_WriteInt(File,"Status:Offline",0);
  619. INI_Close(File);
  620. return 1;
  621. }
  622.  
  623.  
  624.  
  625. public OnPlayerDeath(playerid,killerid,reason)
  626. {
  627. if(IsBeingSpeced[playerid] == 1)
  628. {
  629. foreach(Player,i)
  630. {
  631. if(spectatorid[i] == playerid)
  632. {
  633. TogglePlayerSpectating(i,false);
  634. }
  635. }
  636. }
  637. return 1;
  638. }
  639.  
  640. public OnPlayerText(playerid,text[])
  641. {
  642.  
  643. if(muted[playerid] == 1)
  644. {
  645. SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B}You can not talk while your muted.");
  646. return 0;
  647. }
  648. return 1;
  649. }
  650.  
  651. CMD:slap(playerid,params[])
  652. {
  653. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  654.  
  655. new target,pName[MAX_PLAYER_NAME],Float:x,Float:y,Float:z,string[124];
  656. if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /slap (playerid).");
  657. if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
  658. GetPlayerName(target,pName,sizeof(pName));
  659. format(string,sizeof(string),"{F83934}[System]:{8B8B8B} %s got slapped by an administrator.",pName);
  660. SendClientMessageToAll(-1,string);
  661. GetPlayerPos(target,x,y,z);
  662. SetPlayerPos(target,x,y,z+15);
  663. return 1;
  664. }
  665.  
  666. CMD:banip(playerid,params[])
  667. {
  668. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  669. new ip[44],string[124];
  670. if(sscanf(params,"s[44]",ip)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /ban (playerid).");
  671. format(string,sizeof(string),"banip %s",ip);
  672. SendRconCommand(string);
  673. format(string,sizeof(string),"{F83934}[System]:{8B8B8B} %s got (IP)banned by an administrator.",ip);
  674. SendClientMessage(playerid,-1,string);
  675. PlayerPlaySound(playerid, 1009, 0.0, 0.0, 0.0);
  676. return 1;
  677. }
  678.  
  679. CMD:freeze(playerid,params[])
  680. {
  681. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  682. new target,string[124],pName[24];
  683. if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /freeze (playerid).");
  684. if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"ERROR:Player not connected.");
  685. GetPlayerName(target,pName,24);
  686. format(string,sizeof(string),"{F83934}[System]:{8B8B8B} %s got frozen by an administrator.",pName);
  687. SendClientMessageToAll(-1,string);
  688. TogglePlayerControllable(target,0);
  689. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  690. return 1;
  691. }
  692.  
  693. CMD:unfreeze(playerid,params[])
  694. {
  695. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  696. new target,string[124],pName[24];
  697. if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /unfreeze (playerid).");
  698. if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected .");
  699. GetPlayerName(target,pName,24);
  700. format(string,sizeof(string),"{F83934}[System]:{8B8B8B} %s got unfrozen by an administrator.",pName);
  701. SendClientMessageToAll(-1,string);
  702. TogglePlayerControllable(target,1);
  703. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  704. return 1;
  705. }
  706.  
  707. CMD:goto(playerid,params[])
  708. {
  709. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  710. new target,Float:x,Float:y,Float:z;
  711. if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /goto (playerid).");
  712. if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected");
  713. GetPlayerPos(target,x,y,z);
  714. SetPlayerPos(playerid,x,y,z);
  715. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  716. return 1;
  717. }
  718.  
  719. CMD:get(playerid,params[])
  720. {
  721. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  722. new target,Float:x,Float:y,Float:z;
  723. if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /get (playerid).");
  724. if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
  725. GetPlayerPos(playerid,x,y,z);
  726. SetPlayerPos(target,x,y,z);
  727. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  728. return 1;
  729. }
  730.  
  731. CMD:mute(playerid,params[])
  732. {
  733. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  734. new target,string[124],pName[24];
  735. if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} Use /mute (playerid).");
  736. if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
  737. GetPlayerName(target,pName,sizeof(pName));
  738. format(string,sizeof(string),"{F83934}[System]:{8B8B8B} %s got muted by an administrator.",pName);
  739. SendClientMessageToAll(-1,string);
  740. muted[target] = 1;
  741. PlayerPlaySound(playerid, 1085, 0.0, 0.0, 0.0);
  742. return 1;
  743. }
  744.  
  745. CMD:unmute(playerid,params[])
  746. {
  747. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  748. new target,string[124],pName[24];
  749. if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{FF0000}[Usage]: {FFFF00}/Unmute (PlayerID).");
  750. if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
  751. GetPlayerName(target,pName,sizeof(pName));
  752. format(string,sizeof(string),"{F83934}[System]:{8B8B8B} %s got unmuted by an administrator.",pName);
  753. SendClientMessageToAll(-1,string);
  754. muted[target] = 0;
  755. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  756. return 1;
  757. }
  758.  
  759. CMD:kick(playerid,params[])
  760. {
  761. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  762. new target,reason[66],string[124],pName[24];
  763. if(sscanf(params,"us[66]",target,reason)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B}/kick (PlayerID) (Reason).");
  764. if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
  765. GetPlayerName(target,pName,sizeof(pName));
  766. format(string,sizeof(string),"{F83934}[System]:{8B8B8B} %s got unmuted by an administrator.[ Reason: %s ]",pName,reason);
  767. SendClientMessageToAll(-1,string);
  768. Kick(target);
  769. PlayerPlaySound(playerid, 1009, 0.0, 0.0, 0.0);
  770. return 1;
  771. }
  772.  
  773. CMD:ban(playerid,params[])
  774. {
  775. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  776. new target,reason[66],string[124],pName[24];
  777. if(sscanf(params,"us[66]",target,reason)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B} /Ban (PlayerID) (Reason)");
  778. if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
  779. GetPlayerName(target,pName,sizeof(pName));
  780. format(string,sizeof(string),"{F83934}[System]:{8B8B8B} %s got banned by a administrator - [ Reason: %s ]",pName,reason);
  781. SendClientMessageToAll(-1,string);
  782. Ban(target);
  783. PlayerPlaySound(playerid, 1009, 0.0, 0.0, 0.0);
  784. return 1;
  785. }
  786.  
  787. CMD:ip(playerid,params[])
  788. {
  789. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  790. new target,pIP[34],pName[24],string[124];
  791. if(sscanf(params,"u",target)) return SendClientMessage(playerid,-1,"{F83934}[Usage]:{8B8B8B}/IP (PlayerID)");
  792. if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
  793. GetPlayerName(target,pName,sizeof(pName));
  794. GetPlayerIp(target,pIP,34);
  795. format(string,sizeof(string),"{FFFF00}%s's IP is %s",pName,pIP);
  796. SendClientMessage(playerid,-1,string);
  797. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  798. return 1;
  799. }
  800.  
  801. CMD:setlevel(playerid,params[])
  802. {
  803. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  804. new target,level,string[124],pName[24];
  805. if(sscanf(params,"ud",target,level)) return SendClientMessage(playerid,-1,"{FF0000}[Usage]: {FFFF00}/Setlevel (PlayerID) (Level)");
  806. if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} Player is not connected.");
  807. if(level < 0 || level > 3) return SendClientMessage(playerid,-1,"{F83934}[Error]:Invalid level. (1 - 3)");
  808. GetPlayerName(target,pName,sizeof(pName));
  809. SendClientMessageToAll(-1,string);
  810. PlayerInfo[target][pAdmin] = level;
  811. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  812. return 1;
  813. }
  814.  
  815. COMMAND:spec(playerid, params[])
  816. {
  817. new id;
  818. if(PlayerInfo[playerid][pAdmin] < 1) return 0;
  819. if(sscanf(params,"u", id))return SendClientMessage(playerid, Grey, "{F83934}[Usage]:{8B8B8B}/Spec (ID)");
  820. if(id == playerid)return SendClientMessage(playerid,Grey,"{F83934}[Error]:{8B8B8B} You Cannot Spectate Yourself");
  821. if(id == INVALID_PLAYER_ID)return SendClientMessage(playerid, Grey, "{F83934}[Error]:Player Not Found");
  822. if(IsSpecing[playerid] == 1)return SendClientMessage(playerid,Grey,"{F83934}[Error]:You Are Already Spectating Somebody");
  823. GetPlayerPos(playerid,SpecX[playerid],SpecY[playerid],SpecZ[playerid]);
  824. Inter[playerid] = GetPlayerInterior(playerid);
  825. vWorld[playerid] = GetPlayerVirtualWorld(playerid);
  826. TogglePlayerSpectating(playerid, true);
  827. if(IsPlayerInAnyVehicle(id))
  828.  
  829. if(GetPlayerInterior(id) > 0)
  830. {
  831. SetPlayerInterior(playerid,GetPlayerInterior(id));
  832. }
  833. else if(GetPlayerVirtualWorld(id) > 0)
  834. {
  835. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
  836. }
  837. PlayerSpectateVehicle(playerid,GetPlayerVehicleID(id));
  838.  
  839. {
  840. if(GetPlayerInterior(id) > 0)
  841. {
  842. SetPlayerInterior(playerid,GetPlayerInterior(id));
  843. }
  844. if(GetPlayerVirtualWorld(id) > 0)
  845. {
  846. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
  847. }
  848. PlayerSpectatePlayer(playerid,id);
  849. }
  850. GetPlayerName(id, Name, sizeof(Name));
  851. format(String, sizeof(String),"{F83934}[System]:{8B8B8B} You're now Spectating %s.",Name);
  852. SendClientMessage(playerid,0x0080C0FF,String);
  853. IsSpecing[playerid] = 1;
  854. IsBeingSpeced[id] = 1;
  855. spectatorid[playerid] = id;
  856. return 1;
  857. }
  858.  
  859. COMMAND:specoff(playerid, params[])
  860. {
  861. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  862. TogglePlayerSpectating(playerid, 0);
  863. return 1;
  864. }
  865.  
  866. public OnPlayerStateChange(playerid, newstate, oldstate)
  867. {
  868. if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER)
  869. {
  870. if(IsBeingSpeced[playerid] == 1)
  871. {
  872. foreach(Player,i)
  873. {
  874. if(spectatorid[i] == playerid)
  875. {
  876. PlayerSpectateVehicle(i, GetPlayerVehicleID(playerid));
  877. }
  878. }
  879. }
  880. }
  881. if(newstate == PLAYER_STATE_ONFOOT)
  882. {
  883. if(IsBeingSpeced[playerid] == 1)
  884. {
  885. foreach(Player,i)
  886. {
  887. if(spectatorid[i] == playerid)
  888. {
  889. PlayerSpectatePlayer(i, playerid);
  890. }
  891. }
  892. }
  893. }
  894. return 1;
  895. }
  896.  
  897. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  898. {
  899. if(IsBeingSpeced[playerid] == 1)
  900. {
  901. foreach(Player,i)
  902. {
  903. if(spectatorid[i] == playerid)
  904. {
  905. SetPlayerInterior(i,GetPlayerInterior(playerid));
  906. SetPlayerVirtualWorld(i,GetPlayerVirtualWorld(playerid));
  907. }
  908. }
  909. }
  910. return 1;
  911. }
  912.  
  913. public OnPlayerSpawn(playerid)
  914. {
  915. SetPlayerInterior(playerid, 0);
  916. SetPlayerVirtualWorld(playerid, 0);
  917. SetPlayerHealth(playerid, 99999);
  918. new INI:File = INI_Open(UserPath(playerid));
  919. INI_WriteInt(File,"Status:Online",0);
  920. INI_Close(File);
  921.  
  922.  
  923. SetPlayerHealth(playerid, 999999);
  924.  
  925.  
  926. SendClientMessage(playerid, 0xFF0000FF, "{F83934}[System]:{8B8B8B} Anti-Spawn kill protection");
  927.  
  928.  
  929. SetTimerEx("EndAntiSpawnKill", 15000, false, "i", playerid);
  930. }
  931.  
  932.  
  933. forward EndAntiSpawnKill(playerid);
  934.  
  935.  
  936. public EndAntiSpawnKill(playerid)
  937. {
  938.  
  939. SetPlayerHealth(playerid, 100);
  940.  
  941.  
  942. SendClientMessage(playerid, 0xFF0000FF, "{F83934}[System]:{8B8B8B} Anti-Spawn kill protection over");
  943. return 1;
  944. }
  945.  
  946.  
  947.  
  948.  
  949.  
  950. CMD:report(playerid, params[])
  951. {
  952. new tmp[256], idx;
  953. tmp = strrest(params, idx);
  954. if(!strlen(tmp)){
  955. SendClientMessage(playerid, 0x555252AA, "{F83934}[Usage]:{8B8B8B}/Report [PlayerID] [Reason]");
  956. return 1;
  957. }else{
  958. new pid = strval(tmp);
  959. tmp = strrest(params, idx);
  960. if(!IsPlayerConnected(pid)){
  961. SendClientMessage(playerid, 0x555252AA, "{F83934}[Error]:{8B8B8B} Invalid ID!");
  962. return 1;
  963. }else{
  964. if(!strlen(tmp)){
  965. SendClientMessage(playerid, 0x555252AA, "{F83934}[Usage]:{8B8B8B}/Report [PlayerID] [Reason]");
  966. return 1;
  967. }else{
  968. new name[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[124];
  969. GetPlayerName(playerid, name, sizeof(name));
  970. GetPlayerName(pid, name2, sizeof(name2));
  971. format(string, sizeof(string), "{00FFFF}>> - %s(%d) Has Reported %s(%d) For '%s'", name, playerid, name2, pid, tmp);
  972. for(new i=0; i<GetMaxPlayers(); i++){
  973. if(IsPlayerConnected(i)){
  974. if(PlayerInfo[playerid][pAdmin] < 1) {
  975. SendClientMessage(i, 0x555252AA, string);
  976. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  977. }
  978. }
  979. }
  980. }
  981. }
  982. }
  983. return 1;
  984. }
  985.  
  986. strrest(const string[], &index)
  987. {
  988. new length = strlen(string);
  989. while ((index < length) && (string[index] <= ' '))
  990. {
  991. index++;
  992. }
  993.  
  994. new offset = index;
  995. new result[20];
  996. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  997. {
  998. result[index - offset] = string[index];
  999. index++;
  1000. }
  1001. result[index - offset] = EOS;
  1002. return result;
  1003. }
  1004.  
  1005. COMMAND:announce(playerid, params[])
  1006. {
  1007. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  1008. new text[64], time, style;
  1009. if(PlayerInfo[playerid][pAdmin] < 2) return 0;
  1010. else if (sscanf(params, "iis[64]", style, time, text)) return SendClientMessage(playerid,Grey,"{F83934}[Usage]:{8B8B8B}/Announce (Style[0-6]) (Time) (Text)");
  1011. else if (strlen(text) > 64) return SendClientMessage(playerid,Grey,"{F83934}[Error]:{8B8B8B} Message is too long.");
  1012. else if (style == 2) return SendClientMessage(playerid,Grey,"{F83934}[Usage]:{8B8B8B} Bug with style No.2 don't use it!");
  1013. else if (style < 0 || style > 6) return SendClientMessage(playerid,0x854900FF,"{F83934}[Error]:{8B8B8B}");
  1014. else if (time > 20*1000) return SendClientMessage(playerid, Grey,"{F83934}[Error]:{8B8B8B} Message can not be longer then 20 seconds!");
  1015. else {
  1016. GameTextForAll(text, time, style);
  1017. }
  1018. return 1;
  1019. }
  1020.  
  1021. CMD:acmds(playerid, params[])
  1022. {
  1023. PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
  1024. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  1025. SendClientMessage(playerid, 0x0077BB00 , "{00FF00}(Level 1 | Moderator) ");
  1026. SendClientMessage(playerid, 0x0077BB00 , "»»{FFFF00}/slap, /freeze, /unfreeze, /goto, /get, /mute, /unmute, /ip, /spec, /specoff««");
  1027. SendClientMessage(playerid, 0x0077BB00 , "{00FF00}(Level 2 | Administrator) ");
  1028. SendClientMessage(playerid, 0x0077BB00 , "»»{FFFF00}/kick, /ban, /announce, /explode, /setskin, /setweather, /clearchat««");
  1029. SendClientMessage(playerid, 0x0077BB00 , "{00FF00}(Level 3 | Owners) ");
  1030. SendClientMessage(playerid, 0x0077BB00 , "»»{FFFF00}/banip, /setlevel, /restart, /gmx««");
  1031. return 1;
  1032. }
  1033.  
  1034. CMD:explode(playerid, params[]){
  1035. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  1036. new amount;
  1037. new Float:boomx, Float:boomy, Float:boomz;
  1038. if(sscanf(params, "i", amount)) return SendClientMessage(playerid,Grey,"{F83934}[Usage]:{8B8B8B} /Explode [PlayerID]");
  1039. GetPlayerPos(playerid,boomx, boomy, boomz);
  1040. CreateExplosion(boomx, boomy , boomz, amount, 10);
  1041. return 1;
  1042. }
  1043.  
  1044.  
  1045.  
  1046. COMMAND:admins(playerid,params[])
  1047. {
  1048. if(IsPlayerConnected(playerid))
  1049. {
  1050. SendClientMessage(playerid, COLOR_RED, " ");
  1051. SendClientMessage(playerid, 0xFF0080C8, "[============Online Administrators============] ");
  1052. for(new i = 0; i < MAX_PLAYERS; i++)
  1053. {
  1054. if(IsPlayerConnected(i))
  1055. {
  1056. if(PlayerInfo[i][pAdmin] > 1)
  1057. {
  1058. new admtext[64];
  1059. new sendername[MAX_PLAYER_NAME];
  1060. new string[256];
  1061. if(PlayerInfo[i][pAdmin] == 1) { admtext = "{80FF00}Level 1 Moderator"; }
  1062. else if(PlayerInfo[i][pAdmin] == 2) { admtext = "{80FF00}Level 2 Administrator"; }
  1063. else if(PlayerInfo[i][pAdmin] == 3) { admtext = "{80FF00}Level 3 Master Administrator"; }
  1064. GetPlayerName(i, sendername, sizeof(sendername));
  1065. format(string, 256, "{FF00FF}%s {80FF00}( %s )", sendername, admtext);
  1066. SendClientMessage(playerid, 0xFFFF00C8, string);
  1067. SendClientMessage(playerid, 0xFF0080C8, "[============Online Administrators============]");
  1068. }
  1069. }
  1070. }
  1071. }
  1072. return 1;
  1073. }
  1074.  
  1075. CMD:setskin(playerid, params[])
  1076. {
  1077.  
  1078. new name[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], id, skinid, string[128];
  1079. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  1080. if(sscanf(params, "ui", id, skinid)) return SendClientMessage(playerid, -1, "{F83934}[Usage]:{8B8B8B}/Setskin (PlayerID) (SkinID)");
  1081. GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  1082. GetPlayerName(id, targetname, MAX_PLAYER_NAME);
  1083. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "{F83934}[Error]:{8B8B8B} Player Not Connected!");
  1084. SetPlayerSkin(id, skinid);
  1085. format(string, 128, "{F83934}[System]:{8B8B8B} Administrator %s(%d) has changed your skin To %i", name, playerid, skinid);
  1086. SendClientMessage(id, 0xFFFF00C8, string);
  1087. format(string, 128, "{F83934}[System]:{8B8B8B} You have successfully set his skin to %i", targetname, id, skinid);
  1088. SendClientMessage(playerid, -1, string);
  1089. return 1;
  1090. }
  1091.  
  1092. CMD:setweather(playerid,params[])
  1093. {
  1094. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  1095. new string[128];
  1096. new sendername[MAX_PLAYER_NAME];
  1097. new weather;
  1098. if(sscanf(params, "d", weather))
  1099. return SendClientMessage(playerid, Grey, "{F83934}[Usage]:{8B8B8B}/Setweather (WeatherID)");
  1100. if(PlayerInfo[playerid][pAdmin] < 2)
  1101. return SendClientMessage(playerid, Grey, "{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  1102. {
  1103. SetWeather(weather);
  1104. SendClientMessage(playerid, Grey, "[LOST:RP] The weather has been changed");
  1105. GetPlayerName(playerid, sendername, sizeof(sendername));
  1106. format(string, 256, "{F83934}[System]:{8B8B8B} Administrator %s changed the weather to weather ID(%d)", sendername,weather);
  1107. SendClientMessage(playerid, -1, string);
  1108. }
  1109. return 1;
  1110. }
  1111.  
  1112. CMD:clearchat(playerid, params[])
  1113. {
  1114. if(PlayerInfo[playerid][pAdmin] < 2)
  1115. {
  1116. ClearChatboxAll(playerid);
  1117. }
  1118. else
  1119. {
  1120. SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  1121. return 1;
  1122. }
  1123. return 1;
  1124. }
  1125.  
  1126.  
  1127. ClearChatboxAll(playerid)
  1128. {
  1129. for(new i = 0; i < 50; i++)
  1130. {
  1131. SendClientMessage(playerid, 0xFFFFFFC8, "");
  1132. }
  1133. return 1;
  1134. }
  1135.  
  1136. CMD:restart(playerid, params[])
  1137. {
  1138. if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  1139. foreach(Player,i)
  1140. {
  1141. KillTimer(WTimer1);
  1142. new INI:File = INI_Open(UserPath(playerid));
  1143. INI_SetTag(File,"data");
  1144. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  1145. INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  1146. INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  1147. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  1148. INI_Close(File);
  1149. return 1;
  1150. }
  1151. return 1;
  1152. }
  1153.  
  1154. //[===========================Version 0.2a===========================]
  1155. CMD:repair(playerid, params[])
  1156. {
  1157. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  1158. if(IsPlayerInAnyVehicle(playerid))
  1159. {
  1160. new vehicleid = GetPlayerVehicleID(playerid);
  1161. SetVehicleHealth(vehicleid, 1000);
  1162. }
  1163. else return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not in a vehicle.");
  1164. return 1;
  1165. }
  1166.  
  1167. CMD:healme(playerid, params[])
  1168. {
  1169. if(PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  1170. {
  1171. SetPlayerHealth(playerid, 100);
  1172. return 1;
  1173. }
  1174. }
  1175.  
  1176. CMD:godadmin(playerid, params[])
  1177. {
  1178. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  1179. {
  1180. SetPlayerHealth(playerid, 99999);
  1181. }
  1182. return 1;
  1183. }
  1184.  
  1185.  
  1186. CMD:vcolor(playerid, params[])
  1187. {
  1188. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,-1,"{F83934}[Error]:{8B8B8B} You're not authorized to use this command.");
  1189. {
  1190. new vehicleid = GetPlayerVehicleID(playerid);
  1191. new colors = random(sizeof(CarColors));
  1192. new colors2 = random(sizeof(CarColors2));
  1193. ChangeVehicleColor(vehicleid,CarColors[colors][0],CarColors2[colors2][0]);
  1194. }
  1195. return 1;
  1196. }
Advertisement
Add Comment
Please, Sign In to add comment