Advertisement
Guest User

Untitled

a guest
Jun 12th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 100.01 KB | None | 0 0
  1. /*x---------------------------------Important-------------------------------------x*/
  2. //**INCLUDES**//
  3. #include <a_samp>
  4. #include <md5>
  5. //**MISC**//
  6.  
  7. /*x---------------------------------Defining-------------------------------------x*/
  8. //**COLORS*//
  9. #define GREEN 0x21DD00FF
  10. #define RED 0xE60000FF
  11. #define ADMIN_RED 0xFB0000FF
  12. #define YELLOW 0xFFFF00FF
  13. #define ORANGE 0xF97804FF
  14. #define LIGHTRED 0xFF8080FF
  15. #define LIGHTBLUE 0x00C2ECFF
  16. #define PURPLE 0xB360FDFF
  17. #define BLUE 0x1229FAFF
  18. #define LIGHTGREEN 0x38FF06FF
  19. #define DARKPINK 0xE100E1FF
  20. #define DARKGREEN 0x008040FF
  21. #define AQUAGREEN 0x00CACAFB
  22. #define NICESKY 0x99FFFFAA
  23. #define GREY 0xCECECEFF
  24. #define WHITE 0xFFFFFFFF
  25. //**MISC**//
  26. //#define LOGIN_BEFORE_SPAWN // If uncommented, players will have to login before spawning if their ac exists. If commented, they can spawn without logging in.
  27. //#define ENABLE_AUTO_LOGIN // LEAVE IT COMMENTED(BUGGED) -- Allows you to auto-login when you connect if you had the same IP as previous login.
  28. //**VARIABLES**//
  29. enum Info
  30. {
  31. AdminLevel,
  32. Password[128],
  33. Cash,
  34. Warns,
  35. Jail,
  36. Logged,
  37. Mute,
  38. WarnReason1[128],
  39. WarnReason2[128],
  40. WarnReason3[128],
  41. IP[20],
  42. };
  43. new ViewCommands[1][128] = // 2 = amount of commands to view
  44. {
  45. {"/admins"}
  46.  
  47. };
  48. new VehNames[212][] = { // Vehicle Names - Betamaster
  49. {"Landstalker"},
  50. {"Bravura"},
  51. {"Buffalo"},
  52. {"Linerunner"},
  53. {"Perrenial"},
  54. {"Sentinel"},
  55. {"Dumper"},
  56. {"Firetruck"},
  57. {"Trashmaster"},
  58. {"Stretch"},
  59. {"Manana"},
  60. {"Infernus"},
  61. {"Voodoo"},
  62. {"Pony"},
  63. {"Mule"},
  64. {"Cheetah"},
  65. {"Ambulance"},
  66. {"Leviathan"},
  67. {"Moonbeam"},
  68. {"Esperanto"},
  69. {"Taxi"},
  70. {"Washington"},
  71. {"Bobcat"},
  72. {"Mr Whoopee"},
  73. {"BF Injection"},
  74. {"Hunter"},
  75. {"Premier"},
  76. {"Enforcer"},
  77. {"Securicar"},
  78. {"Banshee"},
  79. {"Predator"},
  80. {"Bus"},
  81. {"Rhino"},
  82. {"Barracks"},
  83. {"Hotknife"},
  84. {"Trailer 1"}, //artict1
  85. {"Previon"},
  86. {"Coach"},
  87. {"Cabbie"},
  88. {"Stallion"},
  89. {"Rumpo"},
  90. {"RC Bandit"},
  91. {"Romero"},
  92. {"Packer"},
  93. {"Monster"},
  94. {"Admiral"},
  95. {"Squalo"},
  96. {"Seasparrow"},
  97. {"Pizzaboy"},
  98. {"Tram"},
  99. {"Trailer 2"}, //artict2
  100. {"Turismo"},
  101. {"Speeder"},
  102. {"Reefer"},
  103. {"Tropic"},
  104. {"Flatbed"},
  105. {"Yankee"},
  106. {"Caddy"},
  107. {"Solair"},
  108. {"Berkley's RC Van"},
  109. {"Skimmer"},
  110. {"PCJ-600"},
  111. {"Faggio"},
  112. {"Freeway"},
  113. {"RC Baron"},
  114. {"RC Raider"},
  115. {"Glendale"},
  116. {"Oceanic"},
  117. {"Sanchez"},
  118. {"Sparrow"},
  119. {"Patriot"},
  120. {"Quad"},
  121. {"Coastguard"},
  122. {"Dinghy"},
  123. {"Hermes"},
  124. {"Sabre"},
  125. {"Rustler"},
  126. {"ZR-350"},
  127. {"Walton"},
  128. {"Regina"},
  129. {"Comet"},
  130. {"BMX"},
  131. {"Burrito"},
  132. {"Camper"},
  133. {"Marquis"},
  134. {"Baggage"},
  135. {"Dozer"},
  136. {"Maverick"},
  137. {"News Chopper"},
  138. {"Rancher"},
  139. {"FBI Rancher"},
  140. {"Virgo"},
  141. {"Greenwood"},
  142. {"Jetmax"},
  143. {"Hotring"},
  144. {"Sandking"},
  145. {"Blista Compact"},
  146. {"Police Maverick"},
  147. {"Boxville"},
  148. {"Benson"},
  149. {"Mesa"},
  150. {"RC Goblin"},
  151. {"Hotring Racer A"}, //hotrina
  152. {"Hotring Racer B"}, //hotrinb
  153. {"Bloodring Banger"},
  154. {"Rancher"},
  155. {"Super GT"},
  156. {"Elegant"},
  157. {"Journey"},
  158. {"Bike"},
  159. {"Mountain Bike"},
  160. {"Beagle"},
  161. {"Cropdust"},
  162. {"Stunt"},
  163. {"Tanker"}, //petro
  164. {"Roadtrain"},
  165. {"Nebula"},
  166. {"Majestic"},
  167. {"Buccaneer"},
  168. {"Shamal"},
  169. {"Hydra"},
  170. {"FCR-900"},
  171. {"NRG-500"},
  172. {"HPV1000"},
  173. {"Cement Truck"},
  174. {"Tow Truck"},
  175. {"Fortune"},
  176. {"Cadrona"},
  177. {"FBI Truck"},
  178. {"Willard"},
  179. {"Forklift"},
  180. {"Tractor"},
  181. {"Combine"},
  182. {"Feltzer"},
  183. {"Remington"},
  184. {"Slamvan"},
  185. {"Blade"},
  186. {"Freight"},
  187. {"Streak"},
  188. {"Vortex"},
  189. {"Vincent"},
  190. {"Bullet"},
  191. {"Clover"},
  192. {"Sadler"},
  193. {"Firetruck LA"}, //firela
  194. {"Hustler"},
  195. {"Intruder"},
  196. {"Primo"},
  197. {"Cargobob"},
  198. {"Tampa"},
  199. {"Sunrise"},
  200. {"Merit"},
  201. {"Utility"},
  202. {"Nevada"},
  203. {"Yosemite"},
  204. {"Windsor"},
  205. {"Monster A"}, //monstera
  206. {"Monster B"}, //monsterb
  207. {"Uranus"},
  208. {"Jester"},
  209. {"Sultan"},
  210. {"Stratum"},
  211. {"Elegy"},
  212. {"Raindance"},
  213. {"RC Tiger"},
  214. {"Flash"},
  215. {"Tahoma"},
  216. {"Savanna"},
  217. {"Bandito"},
  218. {"Freight Flat"}, //freiflat
  219. {"Streak Carriage"}, //streakc
  220. {"Kart"},
  221. {"Mower"},
  222. {"Duneride"},
  223. {"Sweeper"},
  224. {"Broadway"},
  225. {"Tornado"},
  226. {"AT-400"},
  227. {"DFT-30"},
  228. {"Huntley"},
  229. {"Stafford"},
  230. {"BF-400"},
  231. {"Newsvan"},
  232. {"Tug"},
  233. {"Trailer 3"}, //petrotr
  234. {"Emperor"},
  235. {"Wayfarer"},
  236. {"Euros"},
  237. {"Hotdog"},
  238. {"Club"},
  239. {"Freight Carriage"}, //freibox
  240. {"Trailer 3"}, //artict3
  241. {"Andromada"},
  242. {"Dodo"},
  243. {"RC Cam"},
  244. {"Launch"},
  245. {"Police Car (LSPD)"},
  246. {"Police Car (SFPD)"},
  247. {"Police Car (LVPD)"},
  248. {"Police Ranger"},
  249. {"Picador"},
  250. {"S.W.A.T. Van"},
  251. {"Alpha"},
  252. {"Phoenix"},
  253. {"Glendale"},
  254. {"Sadler"},
  255. {"Luggage Trailer A"}, //bagboxa
  256. {"Luggage Trailer B"}, //bagboxb
  257. {"Stair Trailer"}, //tugstair
  258. {"Boxville"},
  259. {"Farm Plow"}, //farmtr1
  260. {"Utility Trailer"} //utiltr1
  261. };
  262.  
  263. new WeapNames[][32] = {
  264. {"Unarmed (Fist)"}, // 0
  265. {"Brass Knuckles"}, // 1
  266. {"Golf Club"}, // 2
  267. {"Night Stick"}, // 3
  268. {"Knife"}, // 4
  269. {"Baseball Bat"}, // 5
  270. {"Shovel"}, // 6
  271. {"Pool Cue"}, // 7
  272. {"Katana"}, // 8
  273. {"Chainsaw"}, // 9
  274. {"Purple Dildo"}, // 10
  275. {"Big White Vibrator"}, // 11
  276. {"Medium White Vibrator"}, // 12
  277. {"Small White Vibrator"}, // 13
  278. {"Flowers"}, // 14
  279. {"Cane"}, // 15
  280. {"Grenade"}, // 16
  281. {"Teargas"}, // 17
  282. {"Molotov"}, // 18
  283. {" "}, // 19
  284. {" "}, // 20
  285. {" "}, // 21
  286. {"Colt 45"}, // 22
  287. {"Colt 45(Silenced)"}, // 23
  288. {"Deagle"}, // 24
  289. {"Normal Shotgun"}, // 25
  290. {"Sawnoff Shotgun"}, // 26
  291. {"Combat Shotgun"}, // 27
  292. {"Micro Uzi(Mac 10)"}, // 28
  293. {"SMG(MP5)"}, // 29
  294. {"AK47"}, // 30
  295. {"M4"}, // 31
  296. {"Tec9"}, // 32
  297. {"Country Rifle"}, // 33
  298. {"Sniper Rifle"}, // 34
  299. {"Rocket Launcher"}, // 35
  300. {"Heat-Seeking Rocket Launcher"}, // 36
  301. {"Flamethrower"}, // 37
  302. {"Minigun"}, // 38
  303. {"Satchel Charge"}, // 39
  304. {"Detonator"}, // 40
  305. {"Spray Can"}, // 41
  306. {"Fire Extinguisher"}, // 42
  307. {"Camera"}, // 43
  308. {"Night Vision Goggles"}, // 44
  309. {"Infrared Vision Goggles"}, // 45
  310. {"Parachute"}, // 46
  311. {"Fake Pistol"} // 47
  312. };
  313. new AccountInfo[MAX_PLAYERS][Info];
  314. new SuperPunch[MAX_PLAYERS];
  315. new ViewCmds[MAX_PLAYERS];
  316. new Count = 999;
  317. new Hide[MAX_PLAYERS];
  318. new Drugs[MAX_PLAYERS];
  319. new bool:PMBlock[MAX_PLAYERS];
  320. new Nuke[MAX_PLAYERS];
  321. new Missile[MAX_PLAYERS];
  322. //**FORWARDS**//
  323. forward SendClientMessageToAdmins(color,string[],alevel);
  324. forward OnPlayerRegister(playerid,password[]);
  325. forward OnPlayerLogin(playerid,password[]);
  326. forward OnPlayerUpdateAccount(playerid);
  327. forward BanLog(string[]);
  328. forward KickLog(string[]);
  329. forward VehicleLog(string[]);
  330. forward CountDown();
  331. /*x---------------------------------CallBacks-------------------------------------x*/
  332. stock strtok(const string[], &index,seperator=' ')
  333. {
  334. new length = strlen(string);
  335. new offset = index;
  336. new result[128];
  337. while ((index < length) && (string[index] != seperator) && ((index - offset) < (sizeof(result) - 1)))
  338. {
  339. result[index - offset] = string[index];
  340. index++;
  341. }
  342.  
  343. result[index - offset] = EOS;
  344. if ((index < length) && (string[index] == seperator))
  345. {
  346. index++;
  347. }
  348. return result;
  349. }
  350. stock IsNumeric(const string[])
  351. {
  352. for (new i = 0, j = strlen(string); i < j; i++)
  353. if (string[i] > '9' || string[i] < '0')
  354. return 0;
  355. return 1;
  356. }
  357.  
  358. ReturnUser(text[], playerid = INVALID_PLAYER_ID)
  359. {
  360. new pos = 0;
  361. while (text[pos] < 0x21)
  362. {
  363. if (text[pos] == 0) return INVALID_PLAYER_ID;
  364. pos++;
  365. }
  366. new userid = INVALID_PLAYER_ID;
  367. if (IsNumeric(text[pos]))
  368. {
  369. userid = strval(text[pos]);
  370. if (userid >=0 && userid < MAX_PLAYERS)
  371. {
  372. if(!IsPlayerConnected(userid))
  373. userid = INVALID_PLAYER_ID;
  374. else return userid;
  375. }
  376. }
  377. new len = strlen(text[pos]);
  378. new count = 0;
  379. new pname[MAX_PLAYER_NAME];
  380. for (new i = 0; i < MAX_PLAYERS; i++)
  381. {
  382. if (IsPlayerConnected(i))
  383. {
  384. GetPlayerName(i, pname, sizeof (pname));
  385. if (strcmp(pname, text[pos], true, len) == 0)
  386. {
  387. if (len == strlen(pname)) return i;
  388. else
  389. {
  390. count++;
  391. userid = i;
  392. }
  393. }
  394. }
  395. }
  396. if (count != 1)
  397. {
  398. if (playerid != INVALID_PLAYER_ID)
  399. {
  400. if (count) SendClientMessage(playerid, YELLOW, "There are multiple users, enter full playername.");
  401. else SendClientMessage(playerid, RED, "Playername not found.");
  402. }
  403. userid = INVALID_PLAYER_ID;
  404. }
  405. return userid;
  406. }
  407. stock GetFileString(string[])
  408. {
  409. new result[128];
  410. result[0] = 0;
  411. if (strfind(string, ":", true) == -1) return result;
  412. new id = strfind(string, ":", true);
  413. strmid(result, string, 0, id, 128);
  414. return result;
  415. }
  416.  
  417. stock GetFileValue(string[])
  418. {
  419. new val[128];
  420. val[0] = 0;
  421. if (strfind(string , ":", true) == -1) return val;
  422. new id = strfind(string, ":", true);
  423. strmid(val, string, id+2, strlen(string), 128);
  424. return val;
  425. }
  426.  
  427. public VehicleLog(string[])
  428. {
  429. new entry[128];
  430. format(entry, sizeof(entry), "%s\r\n",string);
  431. new File:hFile;
  432. hFile = fopen("vehiclespawn.log", io_append);
  433. if (hFile)
  434. {
  435. fwrite(hFile, entry);
  436. fclose(hFile);
  437. }
  438. }
  439.  
  440. public KickLog(string[])
  441. {
  442. new entry[128];
  443. format(entry, sizeof(entry), "%s\r\n",string);
  444. new File:hFile;
  445. hFile = fopen("kick.log", io_append);
  446. if (hFile)
  447. {
  448. fwrite(hFile, entry);
  449. fclose(hFile);
  450. }
  451. }
  452.  
  453. public BanLog(string[])
  454. {
  455. new entry[128];
  456. format(entry, sizeof(entry), "%s\r\n",string);
  457. new File:hFile;
  458. hFile = fopen("ban.log", io_append);
  459. if (hFile)
  460. {
  461. fwrite(hFile, entry);
  462. fclose(hFile);
  463. }
  464. }
  465. public SendClientMessageToAdmins(color,string[],alevel)
  466. {
  467. for(new i = 0; i < MAX_PLAYERS; i++)
  468. {
  469. if(IsPlayerConnected(i))
  470. {
  471. if (AccountInfo[i][AdminLevel] >= alevel)
  472. {
  473. SendClientMessage(i, color, string);
  474. printf("%s", string);
  475. }
  476. }
  477. }
  478. return 1;
  479. }
  480. public OnPlayerRegister(playerid, password[])
  481. {
  482. if(IsPlayerConnected(playerid))
  483. {
  484. new name[MAX_PLAYER_NAME], str[128], ip[15];
  485. GetPlayerName(playerid, name, sizeof name);
  486. GetPlayerIp(playerid, ip, sizeof ip);
  487. format(str, sizeof str, "/sAccounts/%s.seifadmin", name);
  488. new File:account = fopen(str, io_write);
  489. if (account)
  490. {
  491. strmid(AccountInfo[playerid][Password], password, 0, strlen(password), 255);
  492. AccountInfo[playerid][Cash] = GetPlayerMoney(playerid);
  493. new file[128];
  494. {
  495. format(file, sizeof file, "Password: %s\n\r", AccountInfo[playerid][Password]);
  496. { fwrite(account, file); }
  497. format(file, sizeof file, "AdminLevel: %d\n\r", 0);
  498. { fwrite(account, file); AccountInfo[playerid][AdminLevel] = 0; }
  499. format(file, sizeof file, "Cash: %d\n\r", AccountInfo[playerid][Cash]);
  500. { fwrite(account, file); }
  501. format(file, sizeof file, "Warnings: %d\n\r",AccountInfo[playerid][Warns]);
  502. { fwrite(account, file); }
  503. format(file, sizeof file, "WarnReason1: %s\n\r",AccountInfo[playerid][WarnReason1]);
  504. { fwrite(account, file); }
  505. format(file, sizeof file, "WarnReason2: %s\n\r",AccountInfo[playerid][WarnReason2]);
  506. { fwrite(account, file); }
  507. format(file, sizeof file, "WarnReason3: %s\n\r",AccountInfo[playerid][WarnReason3]);
  508. { fwrite(account, file); }
  509. format(file, sizeof file, "IPAddress: %s\n\r",ip);
  510. { fwrite(account, file); }
  511. }
  512. fclose(account);
  513. SendClientMessage(playerid, GREEN, "|- Account successfully registered. You can now login ( /login [password] ) -|");
  514. }
  515. }
  516. return 1;
  517. }
  518.  
  519. public OnPlayerUpdateAccount(playerid)
  520. {
  521. if(IsPlayerConnected(playerid))
  522. {
  523. if(AccountInfo[playerid][Logged] == 1)
  524. {
  525. new name[MAX_PLAYER_NAME], str[128];
  526. GetPlayerName(playerid, name, sizeof name);
  527. format(str, sizeof str, "/sAccounts/%s.seifadmin", name);
  528. new File:account = fopen(str, io_write);
  529. if (account)
  530. {
  531. AccountInfo[playerid][Cash] = GetPlayerMoney(playerid);
  532. new file[128];
  533. {
  534. format(file, sizeof file, "Password: %s\n\r", AccountInfo[playerid][Password]);
  535. { fwrite(account, file); }
  536. format(file, sizeof file, "AdminLevel: %d\n\r",AccountInfo[playerid][AdminLevel]);
  537. { fwrite(account, file); }
  538. format(file, sizeof file, "Cash: %d\n\r", AccountInfo[playerid][Cash]);
  539. { fwrite(account, file); }
  540. format(file, sizeof file, "Warnings: %d\n\r",AccountInfo[playerid][Warns]);
  541. { fwrite(account, file); }
  542. format(file, sizeof file, "WarnReason1: %s\n\r",AccountInfo[playerid][WarnReason1]);
  543. { fwrite(account, file); }
  544. format(file, sizeof file, "WarnReason2: %s\n\r",AccountInfo[playerid][WarnReason2]);
  545. { fwrite(account, file); }
  546. format(file, sizeof file, "WarnReason3: %s\n\r",AccountInfo[playerid][WarnReason3]);
  547. { fwrite(account, file); }
  548. format(file, sizeof file, "IPAddress: %s\n\r",AccountInfo[playerid][IP]);
  549. { fwrite(account, file); }
  550. }
  551. fclose(account);
  552. }
  553. }
  554. }
  555. return 1;
  556. }
  557.  
  558. public OnPlayerLogin(playerid, password[])
  559. {
  560. new name[MAX_PLAYER_NAME], str[128];
  561. GetPlayerName(playerid, name, sizeof name);
  562. format(str, sizeof str, "/sAccounts/%s.seifadmin", name);
  563. new File:account = fopen(str, io_read);
  564. if (account)
  565. {
  566. new pass[256];
  567. new passres[128], value[128];
  568. fread(account, pass, sizeof pass);
  569. passres = GetFileString(pass);
  570. if (!strcmp("Password", passres))
  571. {
  572. value = GetFileValue(pass);
  573. strmid(AccountInfo[playerid][Password], value, 0, strlen(value)-1, 128);
  574. }
  575. if (!strcmp(AccountInfo[playerid][Password], password, true))
  576. {
  577. while (fread(account, pass, 256))
  578. {
  579. passres = GetFileString(pass);
  580. if (strfind(passres, "AdminLevel") != -1)
  581. {
  582. value = GetFileValue(pass);
  583. AccountInfo[playerid][AdminLevel] = strval(value);
  584. }
  585. if (strfind(passres, "Cash") != -1)
  586. {
  587. value = GetFileValue(pass);
  588. AccountInfo[playerid][Cash] = strval(value);
  589. }
  590. if (strfind(passres, "Warnings") != -1)
  591. {
  592. value = GetFileValue(pass);
  593. AccountInfo[playerid][Warns] = strval(value);
  594. }
  595. if (strfind(passres, "WarnReason1") != -1)
  596. {
  597. value = GetFileValue(pass);
  598. strmid(AccountInfo[playerid][WarnReason1], value, 0, strlen(value)-1, 128);
  599. }
  600. if (strfind(passres, "WarnReason2") != -1)
  601. {
  602. value = GetFileValue(pass);
  603. strmid(AccountInfo[playerid][WarnReason2], value, 0, strlen(value)-1, 128);
  604. }
  605. if (strfind(passres, "WarnReason3") != -1)
  606. {
  607. value = GetFileValue(pass);
  608. strmid(AccountInfo[playerid][WarnReason3], value, 0, strlen(value)-1, 128);
  609. }
  610. }
  611. fclose(account);
  612. AccountInfo[playerid][Logged] = 1;
  613. }
  614. else
  615. {
  616. SendClientMessage(playerid, RED, "Incorrect Password.");
  617. fclose(account);
  618. return 1;
  619. }
  620. GivePlayerMoney(playerid, AccountInfo[playerid][Cash]);
  621. format(str, sizeof str, "|- You have successfully logged in as %s -|", name);
  622. SendClientMessage(playerid, GREEN, str);
  623. printf("%s has logged in", name);
  624. if (AccountInfo[playerid][AdminLevel] > 0)
  625. {
  626. format(str, sizeof str, "|» You are now logged in as a level %d admin «|", AccountInfo[playerid][AdminLevel]);
  627. SendClientMessage(playerid, LIGHTGREEN, str);
  628. ViewCmds[playerid] = 0;
  629. }
  630. }
  631. return 1;
  632. }
  633.  
  634. public OnFilterScriptInit()
  635. {
  636. print("<|-----------------------------------------|>");
  637. print(" | .: [ - SeifAdmin Script by Seif - ] :. |");
  638. print("<|-----------------------------------------|>");
  639. return 1;
  640. }
  641.  
  642. public OnFilterScriptExit()
  643. {
  644. return 1;
  645. }
  646.  
  647.  
  648. public OnPlayerRequestSpawn(playerid)
  649. {
  650. #if defined LOGIN_BEFORE_SPAWN
  651. new string[128];
  652. new sendername[MAX_PLAYER_NAME];
  653. GetPlayerName(playerid,sendername,24);
  654. format(string,128,"/sAccounts/%s.seifadmin",sendername);
  655. if (fexist(string) && AccountInfo[playerid][Logged] == 0)
  656. {
  657. SendClientMessage(playerid,RED,"Your account is registered. You must first login in order to spawn.");
  658. return 0;
  659. }
  660. #endif
  661. return 1;
  662. }
  663.  
  664. public OnPlayerConnect(playerid)
  665. {
  666. AccountInfo[playerid][Jail] = 0;
  667. AccountInfo[playerid][AdminLevel] = 0;
  668. AccountInfo[playerid][Warns] = 0;
  669. AccountInfo[playerid][Logged] = 0;
  670. AccountInfo[playerid][Mute] = 0;
  671. format(AccountInfo[playerid][Password], 128, " ");
  672. format(AccountInfo[playerid][WarnReason1], 128, "NONE");
  673. format(AccountInfo[playerid][WarnReason2], 128, "NONE");
  674. format(AccountInfo[playerid][WarnReason3], 128, "NONE");
  675. Drugs[playerid] = 0;
  676. Hide[playerid] = 0;
  677. SuperPunch[playerid] = 0;
  678. ViewCmds[playerid] = 0;
  679. PMBlock[playerid] = false;
  680. new string[128];
  681. new ip[20];
  682. new sendername[MAX_PLAYER_NAME];
  683. GetPlayerName(playerid, sendername, sizeof(sendername));
  684. GetPlayerIp(playerid, ip, sizeof ip);
  685. strmid(AccountInfo[playerid][IP], ip, 0, strlen(ip), 128);
  686. format(string, sizeof(string), "/sAccounts/%s.seifadmin", sendername);
  687. if (!fexist(string)) return SendClientMessage(playerid,WHITE,"SERVER: Your account isn't registered. Please register ( /register [password] )");
  688. #if defined ENABLE_AUTO_LOGIN
  689. {
  690. new File:user = fopen(string, io_read);
  691. if (user)
  692. {
  693. new pass[128];
  694. new passres[128], value[128];
  695. new loop = 1;
  696. WHILE:
  697. while (fread(user, pass))
  698. {
  699. printf("line: %s", pass);
  700. strmid(passres, GetFileString(pass), 0, strlen(GetFileString(pass)), 128);
  701. if (loop == 1)
  702. {
  703. if (!strcmp("IPAddress", passres)) printf("IP; %s", GetFileValue(pass));
  704. if (!strcmp("Password", passres))
  705. {
  706. value = GetFileValue(pass);
  707. strmid(AccountInfo[playerid][Password], value, 0, strlen(value)-1, 128);
  708. loop = 2;
  709. goto WHILE;
  710. }
  711. }
  712. else if (loop == 2)
  713. {
  714. if (!strcmp("IPAddress", passres))
  715. {
  716. printf("%s", passres);
  717. strmid(passres, value, 0, strlen(value)-1, 20);
  718. printf("file-ip: %s | player-ip: %s", GetFileValue(pass), AccountInfo[playerid][IP]);
  719. if (!strcmp(AccountInfo[playerid][IP], passres, true))
  720. {
  721. SendClientMessage(playerid, YELLOW, "|- Auto Login -|");
  722. fclose(user);
  723. OnPlayerLogin(playerid, AccountInfo[playerid][Password]);
  724. return 1;
  725. }
  726. else
  727. {
  728. if (fexist(string))
  729. {
  730. SendClientMessage(playerid, WHITE, "SERVER: That account is registered.");
  731. SendClientMessage(playerid, ORANGE, "Please login to retrieve your account stats ( /login [password] )");
  732. }
  733. fclose(user);
  734. }
  735. }
  736. }
  737. }
  738. fclose(user);
  739. }
  740. }
  741. #else
  742. {
  743. if (fexist(string))
  744. {
  745. SendClientMessage(playerid, WHITE, "SERVER: That account is registered.");
  746. SendClientMessage(playerid, ORANGE, "Please login to retrieve your account stats ( /login [password] )");
  747. }
  748. }
  749. #endif
  750. return 1;
  751. }
  752.  
  753. public OnPlayerDisconnect(playerid, reason)
  754. {
  755. OnPlayerUpdateAccount(playerid);
  756. AccountInfo[playerid][Jail] = 0;
  757. AccountInfo[playerid][AdminLevel] = 0;
  758. AccountInfo[playerid][Warns] = 0;
  759. AccountInfo[playerid][Logged] = 0;
  760. AccountInfo[playerid][Mute] = 0;
  761. Drugs[playerid] = 0;
  762. Hide[playerid] = 0;
  763. SuperPunch[playerid] = 0;
  764. ViewCmds[playerid] = 0;
  765. strmid(AccountInfo[playerid][IP], " ", 0, strlen(" "), 20);
  766. return 1;
  767. }
  768.  
  769. public OnPlayerSpawn(playerid)
  770. {
  771. return 1;
  772. }
  773.  
  774. public OnPlayerDeath(playerid, killerid, reason)
  775. {
  776. Drugs[playerid] = 0;
  777. return 1;
  778. }
  779.  
  780. public OnVehicleSpawn(vehicleid)
  781. {
  782. return 1;
  783. }
  784.  
  785. public OnVehicleDeath(vehicleid, killerid)
  786. {
  787. return 1;
  788. }
  789.  
  790. public OnPlayerText(playerid, text[])
  791. {
  792. if (AccountInfo[playerid][Mute] == 1)
  793. {
  794. SendClientMessage(playerid, RED, "You are muted! You cannot talk.");
  795. return 0;
  796. }
  797. return 1;
  798. }
  799.  
  800. public OnPlayerCommandText(playerid, cmdtext[])
  801. {
  802. new cmd[128];
  803. new tmp[128];
  804. new idx;
  805. new giveplayername[MAX_PLAYER_NAME];
  806. new sendername[MAX_PLAYER_NAME];
  807. new string[128];
  808. cmd = strtok(cmdtext,idx);
  809.  
  810. for(new i = 0; i < GetMaxPlayers(); i++)
  811. {
  812. if (IsPlayerConnected(i))
  813. {
  814. if (AccountInfo[i][AdminLevel] > 0 && ViewCmds[i] == 1)
  815. {
  816. for(new v = 0; v < sizeof(ViewCommands); v++) if (!strcmp(cmdtext, ViewCommands[v], true))
  817. {
  818. GetPlayerName(playerid, sendername, sizeof sendername);
  819. format(tmp, 128, "[VIEWCMDS] [%d]%s: %s", playerid, sendername, cmdtext);
  820. SendClientMessage(i, PURPLE, tmp);
  821. }
  822. }
  823. }
  824. }
  825.  
  826. /*»»»»»»»»»»»»»»»»»»»»»»»»»»»» [ADMINS] «««««««««««««««««««««««««««*/
  827.  
  828. if(strcmp(cmd, "/makeadmin", true) == 0) // Make player an admin
  829. {
  830. if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
  831. {
  832. tmp = strtok(cmdtext, idx);
  833. if(!strlen(tmp))
  834. {
  835. SendClientMessage(playerid, ORANGE, "USAGE: /makeadmin [playerid] [level 1-5]");
  836. SendClientMessage(playerid, ORANGE, "FUNCTION: Player will be an admin depending on the given level.");
  837. return 1;
  838. }
  839. new giveplayerid = ReturnUser(tmp, playerid);
  840. tmp = strtok(cmdtext, idx);
  841. new level = strval(tmp);
  842. if(giveplayerid != INVALID_PLAYER_ID)
  843. {
  844. if (level >= 0)
  845. {
  846. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  847. GetPlayerName(playerid, sendername, sizeof(sendername));
  848. printf("ADMIN: %s made %s a level %d admin.", sendername, giveplayername, level);
  849. format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level, sendername);
  850. SendClientMessage(giveplayerid, LIGHTBLUE, string);
  851. format(string, sizeof(string), "|- Administrator %s has given %s an Admin Level. [Level: %d] -|", sendername,giveplayername,level);
  852. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  853. AccountInfo[giveplayerid][AdminLevel] = level;
  854. format(string, sizeof(string), "You have given %s level %d admin.", giveplayername,AccountInfo[giveplayerid][AdminLevel]);
  855. SendClientMessage(playerid, LIGHTBLUE, string);
  856. }
  857. else return SendClientMessage(playerid, RED, "You can't go below level 0!");
  858. }
  859. else if(giveplayerid == INVALID_PLAYER_ID)
  860. {
  861. format(string, sizeof(string), "%i is not an active player.", giveplayerid);
  862. SendClientMessage(playerid, RED, string);
  863. }
  864. }
  865. else SendClientMessage(playerid, RED, "You are not a lead admin!");
  866. return 1;
  867. }
  868.  
  869. if(strcmp(cmd, "/gmx", true) == 0) // Reboot the server
  870. {
  871. if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid)) return GameModeExit();
  872. else return SendClientMessage(playerid, RED, "You are not a lead admin!");
  873. }
  874.  
  875. if(strcmp(cmd, "/kickall", true) == 0) // Kick everyone except the one who does this
  876. {
  877. new reason[128];
  878. if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
  879. {
  880. GetPlayerName(playerid, sendername, sizeof(sendername));
  881. reason = bigstrtok(cmdtext, idx);
  882. if(!strlen(reason))
  883. {
  884. SendClientMessage(playerid, ORANGE, "USAGE: /kickall [reason]");
  885. SendClientMessage(playerid, ORANGE, "FUNCTION: Will kick all the players.");
  886. return 1;
  887. }
  888. printf("ADMIN: Admin %s kicked everyone. Reason: %s", sendername, reason);
  889. format(string, sizeof(string), "-| Administrator %s kicked everyone. [Reason: %s ] |-", sendername,reason);
  890. SendClientMessageToAll(ADMIN_RED, string);
  891. for(new i = 0; i < MAX_PLAYERS; i++)
  892. {
  893. if (i != playerid)
  894. {
  895. Kick(i);
  896. KickLog(string);
  897. }
  898. }
  899. }
  900. else SendClientMessage(playerid, RED, "You are not a lead admin!");
  901. return 1;
  902. }
  903.  
  904. if(strcmp(cmd, "/nuke", true) == 0) // Nuke a player (explode)
  905. {
  906. if (AccountInfo[playerid][AdminLevel] >= 3)
  907. {
  908. tmp = strtok(cmdtext, idx);
  909. if(!strlen(tmp))
  910. {
  911. SendClientMessage(playerid, ORANGE, "USAGE: /nuke [playerid]");
  912. SendClientMessage(playerid, ORANGE, "FUNCTION: Player will explode.");
  913. return 1;
  914. }
  915. new Float:X,Float:Y,Float:Z;
  916. new giveplayerid = ReturnUser(tmp, playerid);
  917. if(IsPlayerConnected(giveplayerid))
  918. {
  919. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  920. GetPlayerName(playerid, sendername, sizeof(sendername));
  921. GetPlayerPos(giveplayerid, X,Y,Z);
  922. CreateExplosion(X,Y,Z,2,3.0);
  923. SetPlayerHealth(giveplayerid, 0.0);
  924. format(string, sizeof(string), "-| Administrator %s nuked %s |-",sendername,giveplayername);
  925. SendClientMessageToAdmins(ADMIN_RED, string,1);
  926. }
  927. else if (!IsPlayerConnected(giveplayerid))
  928. {
  929. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  930. SendClientMessage(playerid, RED, string);
  931. }
  932. }
  933. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  934. return 1;
  935. }
  936.  
  937. if(strcmp(cmd, "/setscore", true) == 0) // Set player a score
  938. {
  939. if (IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 1)
  940. {
  941. tmp = strtok(cmdtext, idx);
  942. if(!strlen(tmp))
  943. {
  944. SendClientMessage(playerid, ORANGE, "USAGE: /setscore [playerid] [score]");
  945. SendClientMessage(playerid, ORANGE, "FUNCTION: Will set a specified player's score");
  946. return 1;
  947. }
  948. new giveplayerid = ReturnUser(tmp);
  949. tmp = strtok(cmdtext, idx);
  950. if(!strlen(tmp))
  951. {
  952. SendClientMessage(playerid, ORANGE, "USAGE: /score [playerid] [score]");
  953. SendClientMessage(playerid, ORANGE, "FUNCTION: Will set a specified player's score");
  954. return 1;
  955. }
  956. new score = strval(tmp);
  957. if(IsPlayerConnected(giveplayerid))
  958. {
  959. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  960. GetPlayerScore(giveplayerid);
  961. SetPlayerScore(giveplayerid, score);
  962. format(string, sizeof(string), "You have changed %s's score number to %d.",giveplayername, score);
  963. SendClientMessage(playerid, GREEN, string);
  964. }
  965. else if (!IsPlayerConnected(giveplayerid))
  966. {
  967. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  968. SendClientMessage(playerid, RED, string);
  969. }
  970. }
  971. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  972. return 1;
  973. }
  974.  
  975. if(strcmp(cmd, "/angle", true) == 0) // Shows your current angle + sets it
  976. {
  977. if (IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 1)
  978. {
  979. new Float:angle;
  980. tmp = strtok(cmdtext, idx);
  981. if(!strlen(tmp))
  982. {
  983. SendClientMessage(playerid, ORANGE, "USAGE: /angle [angle degree]");
  984. SendClientMessage(playerid, ORANGE, "FUNCTION: Will change your current angle.");
  985. GetPlayerFacingAngle(playerid,angle);
  986. format(string, sizeof(string), "HELP: Your current angle is %f", angle);
  987. SendClientMessage(playerid, ORANGE, string);
  988. return 1;
  989. }
  990. angle = floatstr(tmp);
  991. if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  992. {
  993. SetVehicleZAngle(GetPlayerVehicleID(playerid), angle);
  994. format(string, sizeof(string), "You have changed your angle degree to %f" ,angle);
  995. SendClientMessage(playerid, GREEN, string);
  996. }
  997. else
  998. {
  999. SetPlayerFacingAngle(playerid,angle);
  1000. format(string, sizeof(string), "You have changed your angle degree to %f",angle);
  1001. SendClientMessage(playerid, GREEN, string);
  1002. }
  1003. }
  1004. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  1005. return 1;
  1006. }
  1007.  
  1008. if(strcmp(cmd, "/rangeban", true) == 0) // Range-bans a player with the amount of ranges entered.
  1009. {
  1010. if (AccountInfo[playerid][AdminLevel] >= 4)
  1011. {
  1012. tmp = strtok(cmdtext,idx);
  1013. if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /rangeban [playername/id] [ranges(2 max)]");
  1014. new ip[20],ban[128];
  1015. new giveplayerid = ReturnUser(tmp);
  1016. if (IsPlayerConnected(giveplayerid))
  1017. {
  1018. tmp = strtok(cmdtext,idx);
  1019. if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /rangeban [playername/id] [RANGES(2 max)]");
  1020. new ranges = strval(tmp);
  1021. if (ranges < 0 || ranges > 2) return SendClientMessage(playerid, RED, "Minimum ranges: 0 | Maximum ranges: 2");
  1022. if (ranges == 0)
  1023. {
  1024. Ban(giveplayerid);
  1025. }
  1026. GetPlayerName(giveplayerid, giveplayername, sizeof giveplayername);
  1027. GetPlayerIp(giveplayerid, ip, sizeof ip);
  1028. new count = 1;
  1029. for(new i = strlen(ip); i > 0; i--)
  1030. {
  1031. if (ip[i] == '.')
  1032. {
  1033. if (count == ranges)
  1034. {
  1035. format(ban, sizeof ban, "banip %s", ip);
  1036. SendRconCommand(ban);
  1037. break;
  1038. }
  1039. else count++;
  1040. }
  1041. else ip[i] = '*';
  1042. }
  1043. format(ban, sizeof ban, "%s has been banned with the ip '%s'", giveplayername, ip);
  1044. SendClientMessage(playerid, GREEN, ban);
  1045. }
  1046. else
  1047. {
  1048. format(string, sizeof(string), "%i is not an active player.", giveplayerid);
  1049. SendClientMessage(playerid, RED, string);
  1050. }
  1051. }
  1052. else SendClientMessage(playerid, RED, "You're not a lead admin !");
  1053. return 1;
  1054. }
  1055.  
  1056. if(strcmp(cmd, "/ip", true) == 0) // Look at the player's IP address
  1057. {
  1058. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  1059. {
  1060. tmp = strtok(cmdtext, idx);
  1061. if(!strlen(tmp))
  1062. {
  1063. SendClientMessage(playerid, ORANGE, "USAGE: /ip [playername/id]");
  1064. SendClientMessage(playerid, ORANGE, "FUNCTION: View a player's IP.");
  1065. return 1;
  1066. }
  1067.  
  1068. new giveplayerid = ReturnUser(tmp);
  1069. if(IsPlayerConnected(giveplayerid))
  1070. {
  1071. new sstring[256];
  1072. new ip[20];
  1073. GetPlayerIp(giveplayerid, ip, sizeof ip);
  1074. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1075. format(sstring, sizeof(sstring), "-| %s's IP: %s |-", giveplayername,ip);
  1076. SendClientMessage(playerid,LIGHTBLUE, sstring);
  1077. }
  1078. else
  1079. {
  1080. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1081. SendClientMessage(playerid, RED, string);
  1082. }
  1083. }
  1084. else SendClientMessage(playerid, RED, "You are not an admin.");
  1085. return 1;
  1086. }
  1087.  
  1088. if(strcmp(cmd, "/ban", true) == 0) // Bans a player from the server
  1089. {
  1090. new reason[128];
  1091. if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
  1092. {
  1093. tmp = strtok(cmdtext, idx);
  1094. if(!strlen(tmp))
  1095. {
  1096. SendClientMessage(playerid, ORANGE, "USAGE: /ban [playername/id] [reason]");
  1097. SendClientMessage(playerid, ORANGE, "FUNCTION: Will BAN the specified player.");
  1098. return 1;
  1099. }
  1100.  
  1101. new giveplayerid = ReturnUser(tmp);
  1102.  
  1103. if (AccountInfo[giveplayerid][AdminLevel] > AccountInfo[playerid][AdminLevel])
  1104. {
  1105. format(string, sizeof(string), "-| [%i]%s tried to ban you! |-",playerid,sendername);
  1106. SendClientMessage(giveplayerid, ADMIN_RED,string);
  1107. SendClientMessage(playerid, ADMIN_RED, "You are not allowed to ban an admin with a higher level than you!");
  1108. }
  1109.  
  1110. else if (giveplayerid != INVALID_PLAYER_ID)
  1111. {
  1112. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1113. GetPlayerName(playerid, sendername, sizeof(sendername));
  1114. reason = bigstrtok(cmdtext, idx);
  1115. if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /ban [playername/id] [reason]");
  1116. new ip[20];
  1117. printf("ADMIN: Admin %s banned %s. Reason: %s", sendername, giveplayername, reason);
  1118. format(string, sizeof(string), "-| Administrator %s banned %s. [Reason: %s ] |-", sendername, giveplayername, reason);
  1119. SendClientMessageToAll(ADMIN_RED, string);
  1120. GetPlayerIp(giveplayerid, ip, sizeof ip);
  1121. format(string, sizeof(string), "-| Banned Player's IP: %s |-", ip);
  1122. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  1123. AccountInfo[giveplayerid][AdminLevel] = 0; // Resets the banned player's admin level for security reasons
  1124. format(reason, sizeof reason, "[%s]%s", sendername, reason);
  1125. BanEx(giveplayerid, reason);
  1126. }
  1127. else if(giveplayerid == INVALID_PLAYER_ID)
  1128. {
  1129. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1130. SendClientMessage(playerid, RED, string);
  1131. }
  1132. }
  1133. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1134. return 1;
  1135. }
  1136.  
  1137. if(strcmp(cmd, "/kick", true) == 0) // Kicks the player from the server
  1138. {
  1139. new reason[128];
  1140. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  1141. {
  1142. tmp = strtok(cmdtext, idx);
  1143. if(!strlen(tmp))
  1144. {
  1145. SendClientMessage(playerid, ORANGE, "USAGE: /kick [playername/id] [reason]");
  1146. SendClientMessage(playerid, ORANGE, "FUNCTION: Will kick the specified player.");
  1147. return 1;
  1148. }
  1149.  
  1150. new giveplayerid = ReturnUser(tmp);
  1151. if(giveplayerid != INVALID_PLAYER_ID)
  1152. {
  1153. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1154. GetPlayerName(playerid, sendername, sizeof(sendername));
  1155. reason = bigstrtok(cmdtext, idx);
  1156. if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /kick [playername/id] [reason]");
  1157. printf("ADMIN: Admin %s kicked %s. Reason: %s", sendername, giveplayername, reason);
  1158. format(string, sizeof(string), "-| Administrator %s kicked %s. [Reason: %s ] |-", sendername, giveplayername, reason);
  1159. SendClientMessageToAll(ADMIN_RED, string);
  1160. Kick(giveplayerid);
  1161. KickLog(string);
  1162. }
  1163. else if(giveplayerid == INVALID_PLAYER_ID)
  1164. {
  1165. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1166. SendClientMessage(playerid, RED, string);
  1167. }
  1168. }
  1169. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1170. return 1;
  1171. }
  1172.  
  1173. if(strcmp(cmd, "/mute", true) == 0) // Mutes the player from talking in the chat box
  1174. {
  1175. new reason[128];
  1176. if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
  1177. {
  1178. tmp = strtok(cmdtext, idx);
  1179. if(!strlen(tmp))
  1180. {
  1181. SendClientMessage(playerid, ORANGE, "USAGE: /mute [playername/id] [reason]");
  1182. SendClientMessage(playerid, ORANGE, "FUNCTION: Will mute the specified player.");
  1183. return 1;
  1184. }
  1185.  
  1186. new giveplayerid = ReturnUser(tmp);
  1187.  
  1188. if(giveplayerid != INVALID_PLAYER_ID)
  1189. {
  1190. if (AccountInfo[giveplayerid][Mute] == 0)
  1191. {
  1192. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1193. GetPlayerName(playerid, sendername, sizeof(sendername));
  1194. reason = bigstrtok(cmdtext, idx);
  1195. if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /mute [playername/id] [reason]");
  1196. printf("ADMIN: Admin %s muted %s. Reason: %s", sendername, giveplayername, reason);
  1197. format(string, sizeof(string), "-| Administrator %s muted %s. [Reason: %s ]|-", sendername,giveplayername,reason);
  1198. SendClientMessageToAll(ADMIN_RED, string);
  1199. AccountInfo[giveplayerid][Mute] = 1;
  1200. }
  1201. else if (AccountInfo[giveplayerid][Mute] == 1) SendClientMessage(playerid, RED, "Player is already muted!");
  1202. }
  1203.  
  1204. else if(giveplayerid == INVALID_PLAYER_ID)
  1205. {
  1206. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1207. SendClientMessage(playerid, RED, string);
  1208. }
  1209. }
  1210. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1211. return 1;
  1212. }
  1213.  
  1214. if(strcmp(cmd, "/unmute", true) == 0) // Unmutes a muted player
  1215. {
  1216. if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
  1217. {
  1218. tmp = strtok(cmdtext, idx);
  1219. if(!strlen(tmp))
  1220. {
  1221. SendClientMessage(playerid, ORANGE, "USAGE: /unmute [playername/id]");
  1222. SendClientMessage(playerid, ORANGE, "FUNCTION: Will unmute the specified player.");
  1223. return 1;
  1224. }
  1225.  
  1226. new giveplayerid = ReturnUser(tmp);
  1227.  
  1228. if(giveplayerid != INVALID_PLAYER_ID)
  1229. {
  1230. if (AccountInfo[giveplayerid][Mute] == 1)
  1231. {
  1232. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1233. GetPlayerName(playerid, sendername, sizeof(sendername));
  1234. format(string, sizeof(string), "-| Administrator %s unmuted %s |-", sendername,giveplayername);
  1235. SendClientMessageToAll(ADMIN_RED, string);
  1236. AccountInfo[giveplayerid][Mute] = 0;
  1237. }
  1238. else if (AccountInfo[giveplayerid][Mute] == 0) SendClientMessage(playerid, RED, "Player isn't muted.");
  1239. }
  1240.  
  1241. else if(giveplayerid == INVALID_PLAYER_ID)
  1242. {
  1243. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1244. SendClientMessage(playerid, RED, string);
  1245. }
  1246. }
  1247. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1248. return 1;
  1249. }
  1250.  
  1251. if(strcmp(cmd, "/drugs", true) == 0) // Will make the player invinsible until death
  1252. {
  1253. if (AccountInfo[playerid][AdminLevel] > 1 || IsPlayerAdmin(playerid))
  1254. {
  1255. SetPlayerHealth(playerid,999999999); // max HP
  1256. Drugs[playerid] = 1;
  1257. SendClientMessage(playerid, GREEN, "You are now high on drugs...");
  1258. }
  1259. else SendClientMessage(playerid, RED, "Drugs are bad for you!");
  1260. return 1;
  1261. }
  1262.  
  1263. if(strcmp(cmd, "/freeze", true) == 0) // Freezes the player. Prevents him from moving
  1264. {
  1265. new reason[128];
  1266. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  1267. {
  1268. tmp = strtok(cmdtext, idx);
  1269. if(!strlen(tmp))
  1270. {
  1271. SendClientMessage(playerid, ORANGE, "USAGE: /freeze [playername/id] [reason]");
  1272. SendClientMessage(playerid, ORANGE, "FUNCTION: Will freeze the specified player.");
  1273. return 1;
  1274. }
  1275.  
  1276. new giveplayerid = ReturnUser(tmp);
  1277. if(giveplayerid != INVALID_PLAYER_ID)
  1278. {
  1279. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1280. GetPlayerName(playerid, sendername, sizeof(sendername));
  1281. reason = bigstrtok(cmdtext, idx);
  1282. if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /freeze [playername/id] [reason]");
  1283. format(string, sizeof(string), "-| Administrator %s froze %s. [Reason: %s ] |-", sendername, giveplayername, reason);
  1284. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  1285. TogglePlayerControllable(giveplayerid, false);
  1286. }
  1287. else if(giveplayerid == INVALID_PLAYER_ID)
  1288. {
  1289. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1290. SendClientMessage(playerid, RED, string);
  1291. }
  1292. }
  1293. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1294. return 1;
  1295. }
  1296. if(strcmp(cmd, "/unfreeze", true) == 0) // Unfreezes the player
  1297. {
  1298. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  1299. {
  1300. tmp = strtok(cmdtext, idx);
  1301. if(!strlen(tmp))
  1302. {
  1303. SendClientMessage(playerid, ORANGE, "USAGE: /unfreeze [playername/id]");
  1304. SendClientMessage(playerid, ORANGE, "FUNCTION: Will unfreeze the specified player.");
  1305. return 1;
  1306. }
  1307.  
  1308. new giveplayerid = ReturnUser(tmp);
  1309. if(giveplayerid != INVALID_PLAYER_ID)
  1310. {
  1311. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1312. GetPlayerName(playerid, sendername, sizeof(sendername));
  1313. format(string, sizeof(string), "-| Administrator %s unfroze %s |-", sendername,giveplayername);
  1314. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  1315. TogglePlayerControllable(giveplayerid, true);
  1316. }
  1317. else if(giveplayerid == INVALID_PLAYER_ID)
  1318. {
  1319. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1320. SendClientMessage(playerid, RED, string);
  1321. }
  1322. }
  1323. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1324. return 1;
  1325. }
  1326.  
  1327. if(strcmp(cmd, "/setname", true) == 0) // Changes a player's name
  1328. {
  1329. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  1330. {
  1331. tmp = strtok(cmdtext, idx);
  1332. if(!strlen(tmp))
  1333. {
  1334. SendClientMessage(playerid, ORANGE, "USAGE: /setname [playername/id] [newname]");
  1335. SendClientMessage(playerid, ORANGE, "FUNCTION: Will change the player's current name. ");
  1336. return 1;
  1337. }
  1338.  
  1339. new giveplayerid = ReturnUser(tmp);
  1340. if(giveplayerid != INVALID_PLAYER_ID)
  1341. {
  1342. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1343. GetPlayerName(playerid, sendername, sizeof(sendername));
  1344. tmp = strtok(cmdtext, idx);
  1345. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /setname [playername/id] [newname]");
  1346. format(string, sizeof(string), "-| Administrator %s renamed %s. [New Name: %s ] |-", sendername, giveplayername, tmp);
  1347. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  1348. SetPlayerName(giveplayerid, tmp);
  1349. }
  1350. else if(giveplayerid == INVALID_PLAYER_ID)
  1351. {
  1352. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1353. SendClientMessage(playerid, RED, string);
  1354. }
  1355. }
  1356. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1357. return 1;
  1358. }
  1359.  
  1360. if(strcmp(cmd, "/givecash", true) == 0) // Gives some cash to the player
  1361. {
  1362. if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
  1363. {
  1364. tmp = strtok(cmdtext, idx);
  1365. if(!strlen(tmp))
  1366. {
  1367. SendClientMessage(playerid, ORANGE, "USAGE: /givecash [playername/id] [cash]");
  1368. SendClientMessage(playerid, ORANGE, "FUNCTION: Will give the player some cash. ");
  1369. return 1;
  1370. }
  1371.  
  1372. new giveplayerid = ReturnUser(tmp);
  1373. if(giveplayerid != INVALID_PLAYER_ID)
  1374. {
  1375. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1376. GetPlayerName(playerid, sendername, sizeof(sendername));
  1377. tmp = strtok(cmdtext, idx);
  1378. new cash = strval(tmp);
  1379. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /givecash [playername/id] [cash]");
  1380. format(string, sizeof(string), "-| Administrator %s gave %s $%d |-", sendername,giveplayername,cash);
  1381. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  1382. GivePlayerMoney(giveplayerid, cash);
  1383. }
  1384. else if(giveplayerid == INVALID_PLAYER_ID)
  1385. {
  1386. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1387. SendClientMessage(playerid, RED, string);
  1388. }
  1389. }
  1390. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1391. return 1;
  1392. }
  1393.  
  1394. if(strcmp(cmd, "/kill", true) == 0) // If an admin, it kills the player you want. If not, suicide.
  1395. {
  1396. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  1397. {
  1398. tmp = strtok(cmdtext, idx);
  1399. if(!strlen(tmp))
  1400. {
  1401. SendClientMessage(playerid, ORANGE, "USAGE: /kill [playername/id]");
  1402. SendClientMessage(playerid, ORANGE, "FUNCTION: Will kill the specified player.");
  1403. return 1;
  1404. }
  1405.  
  1406. new giveplayerid = ReturnUser(tmp);
  1407. if(giveplayerid != INVALID_PLAYER_ID)
  1408. {
  1409. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1410. GetPlayerName(playerid, sendername, sizeof(sendername));
  1411. format(string, sizeof(string), "-| Administrator %s killed %s |-", sendername,giveplayername);
  1412. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  1413. SetPlayerHealth(giveplayerid, 0.0);
  1414. }
  1415. else if(giveplayerid == INVALID_PLAYER_ID)
  1416. {
  1417. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1418. SendClientMessage(playerid, RED, string);
  1419. }
  1420. }
  1421. else
  1422. {
  1423. SendClientMessage(playerid, RED, "You have committed suicide.");
  1424. SetPlayerHealth(playerid,0.0);
  1425. }
  1426. return 1;
  1427. }
  1428.  
  1429. if(strcmp(cmd, "/goto", true) == 0) // Teleports to a player
  1430. {
  1431. new Float:pX,Float:pY,Float:pZ;
  1432. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  1433. {
  1434. tmp = strtok(cmdtext, idx);
  1435. if(!strlen(tmp))
  1436. {
  1437. SendClientMessage(playerid, ORANGE, "USAGE: /goto [playername/id]");
  1438. SendClientMessage(playerid, ORANGE, "FUNCTION: Will teleport to the specified player.");
  1439. return 1;
  1440. }
  1441. new giveplayerid = ReturnUser(tmp);
  1442. if(giveplayerid != INVALID_PLAYER_ID)
  1443. {
  1444. if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
  1445. {
  1446. GetPlayerPos(giveplayerid,pX,pY,pZ);
  1447. SetVehiclePos(GetPlayerVehicleID(playerid),pX,pY,pZ+2);
  1448. }
  1449. else
  1450. {
  1451. GetPlayerPos(giveplayerid,pX,pY,pZ);
  1452. SetPlayerPos(playerid,pX,pY,pZ+2);
  1453. }
  1454. SetPlayerInterior(playerid,GetPlayerInterior(giveplayerid));
  1455. }
  1456. else if(giveplayerid == INVALID_PLAYER_ID)
  1457. {
  1458. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1459. SendClientMessage(playerid, RED, string);
  1460. }
  1461. }
  1462. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1463. return 1;
  1464. }
  1465.  
  1466. if(strcmp(cmd, "/get", true) == 0) // Teleports the player to your position
  1467. {
  1468. new Float:pX,Float:pY,Float:pZ;
  1469. if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
  1470. {
  1471. tmp = strtok(cmdtext, idx);
  1472. if(!strlen(tmp))
  1473. {
  1474. SendClientMessage(playerid, ORANGE, "USAGE: /get [playername/id]");
  1475. SendClientMessage(playerid, ORANGE, "FUNCTION: Will teleport the specified player to you.");
  1476. return 1;
  1477. }
  1478. new giveplayerid = ReturnUser(tmp);
  1479. if(giveplayerid != INVALID_PLAYER_ID)
  1480. {
  1481. if (GetPlayerState(giveplayerid) == PLAYER_STATE_DRIVER)
  1482. {
  1483. GetPlayerPos(playerid,pX,pY,pZ);
  1484. SetVehiclePos(GetPlayerVehicleID(giveplayerid),pX,pY,pZ+2);
  1485. }
  1486. else
  1487. {
  1488. GetPlayerPos(playerid,pX,pY,pZ);
  1489. SetPlayerPos(giveplayerid,pX,pY,pZ+2);
  1490. }
  1491. SetPlayerInterior(giveplayerid,GetPlayerInterior(playerid));
  1492. }
  1493. else if(giveplayerid == INVALID_PLAYER_ID)
  1494. {
  1495. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1496. SendClientMessage(playerid, RED, string);
  1497. }
  1498. }
  1499. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1500. return 1;
  1501. }
  1502.  
  1503. if(strcmp(cmd, "/teleport", true) == 0) // Teleports the player to the other player
  1504. {
  1505. if (AccountInfo[playerid][AdminLevel] >= 4 || IsPlayerAdmin(playerid))
  1506. {
  1507. tmp = strtok(cmdtext, idx);
  1508. if(!strlen(tmp))
  1509. {
  1510. SendClientMessage(playerid, ORANGE, "USAGE: /teleport [playername/id] [targetname/id]");
  1511. SendClientMessage(playerid, ORANGE, "FUNCTION: Will teleport the player to the target.");
  1512. return 1;
  1513. }
  1514. new giveplayerid = ReturnUser(tmp);
  1515. if(giveplayerid != INVALID_PLAYER_ID)
  1516. {
  1517. tmp = strtok(cmdtext, idx);
  1518. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /teleport [playername/id] [targetname/id]");
  1519. new targetid = ReturnUser(tmp, playerid);
  1520. if (targetid == INVALID_PLAYER_ID) return 1;
  1521. new Float:tX,Float:tY,Float:tZ;
  1522. if (GetPlayerState(giveplayerid) == PLAYER_STATE_DRIVER)
  1523. {
  1524. GetPlayerPos(targetid,tX,tY,tZ);
  1525. SetVehiclePos(GetPlayerVehicleID(giveplayerid),tX,tY,tZ+2);
  1526. }
  1527. else
  1528. {
  1529. GetPlayerPos(targetid,tX,tY,tZ);
  1530. SetPlayerPos(giveplayerid,tX,tY,tZ+2);
  1531. }
  1532. SetPlayerInterior(giveplayerid,GetPlayerInterior(targetid));
  1533. }
  1534. else if(giveplayerid == INVALID_PLAYER_ID)
  1535. {
  1536. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1537. SendClientMessage(playerid, RED, string);
  1538. }
  1539. }
  1540. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1541. return 1;
  1542. }
  1543.  
  1544. if(!strcmp(cmdtext, "//", true, 2)) // Admin chat
  1545. {
  1546. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  1547. {
  1548. if(!strlen(cmdtext[2])) return SendClientMessage(playerid, ORANGE, "USAGE: //<text>"), SendClientMessage(playerid, ORANGE, "HELP: Example: //Hi");
  1549. GetPlayerName(playerid, sendername, sizeof(sendername));
  1550. format(string, sizeof(string), "Admin [%i]%s: %s" ,playerid,sendername, cmdtext[2]);
  1551. SendClientMessageToAdmins(DARKPINK, string, 1);
  1552. return 1;
  1553. }
  1554. else return SendClientMessage(playerid, RED, "You are not an admin!");
  1555. }
  1556.  
  1557. if(strcmp(cmd, "/slap", true) == 0) // Slap a player
  1558. {
  1559. new Float:pX,Float:pY,Float:pZ;
  1560. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  1561. {
  1562. tmp = strtok(cmdtext, idx);
  1563. if(!strlen(tmp))
  1564. {
  1565. SendClientMessage(playerid, ORANGE, "USAGE: /slap [playername/id]");
  1566. SendClientMessage(playerid, ORANGE, "FUNCTION: Will slap the specified player");
  1567. return 1;
  1568. }
  1569.  
  1570. new giveplayerid = ReturnUser(tmp);
  1571. if(giveplayerid != INVALID_PLAYER_ID)
  1572. {
  1573. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1574. GetPlayerName(playerid, sendername, sizeof(sendername));
  1575. GetPlayerPos(giveplayerid,pX,pY,pZ);
  1576. SetPlayerPos(giveplayerid,pX,pY,pZ+5);
  1577. format(string, sizeof(string), "-| Administrator %s slapped %s |-",sendername, giveplayername);
  1578. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  1579. }
  1580. else if(giveplayerid == INVALID_PLAYER_ID)
  1581. {
  1582. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1583. SendClientMessage(playerid, RED, string);
  1584. }
  1585. }
  1586. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1587. return 1;
  1588. }
  1589.  
  1590. if(strcmp(cmd, "/bslap", true) == 0) // Slap a player 2 times higher than /slap
  1591. {
  1592. new Float:pX,Float:pY,Float:pZ;
  1593. if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
  1594. {
  1595. tmp = strtok(cmdtext, idx);
  1596. if(!strlen(tmp))
  1597. {
  1598. SendClientMessage(playerid, ORANGE, "USAGE: /bslap [playername/id]");
  1599. SendClientMessage(playerid, ORANGE, "FUNCTION: Will double slap the specified player");
  1600. return 1;
  1601. }
  1602.  
  1603. new giveplayerid = ReturnUser(tmp);
  1604. if(giveplayerid != INVALID_PLAYER_ID)
  1605. {
  1606. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1607. GetPlayerName(playerid, sendername, sizeof(sendername));
  1608. GetPlayerPos(giveplayerid,pX,pY,pZ);
  1609. SetPlayerPos(giveplayerid,pX,pY,pZ+10);
  1610. format(string, sizeof(string), "-| Administrator %s bitch slapped %s |-",sendername, giveplayername);
  1611. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  1612. }
  1613. else if(giveplayerid == INVALID_PLAYER_ID)
  1614. {
  1615. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1616. SendClientMessage(playerid, RED, string);
  1617. }
  1618. }
  1619. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1620. return 1;
  1621. }
  1622.  
  1623. if(strcmp(cmd, "/disarm", true) == 0) // Reset the player's weapons
  1624. {
  1625. if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
  1626. {
  1627. tmp = strtok(cmdtext, idx);
  1628. if(!strlen(tmp))
  1629. {
  1630. SendClientMessage(playerid, ORANGE, "USAGE: /disarm [playername/id]");
  1631. SendClientMessage(playerid, ORANGE, "FUNCTION: Will disarm the player.");
  1632. return 1;
  1633. }
  1634.  
  1635. new giveplayerid = ReturnUser(tmp);
  1636. if(giveplayerid != INVALID_PLAYER_ID)
  1637. {
  1638. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1639. GetPlayerName(playerid, sendername, sizeof(sendername));
  1640. ResetPlayerWeapons(giveplayerid);
  1641. format(string, sizeof(string), "-| Administrator %s disarmed %s |-",sendername, giveplayername);
  1642. SendClientMessageToAdmins(ADMIN_RED,string,1);
  1643. }
  1644. else if(giveplayerid == INVALID_PLAYER_ID)
  1645. {
  1646. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1647. SendClientMessage(playerid, RED, string);
  1648. }
  1649. }
  1650. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1651. return 1;
  1652. }
  1653.  
  1654. if(strcmp(cmd, "/say", true) == 0) // Publicly says an admin message. Exact same as RCON's 'say' but in a red color.
  1655. {
  1656. if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
  1657. {
  1658. GetPlayerName(playerid, sendername, sizeof(sendername));
  1659. new result[128];
  1660. result = bigstrtok(cmdtext, idx);
  1661. if(!strlen(result))
  1662. {
  1663. SendClientMessage(playerid, ORANGE, "USAGE: /say [message]");
  1664. SendClientMessage(playerid, ORANGE, "FUNCTION: Will broadcast an admin message.");
  1665. return 1;
  1666. }
  1667. format(string, sizeof(string), "* Admin: %s", result);
  1668. SendClientMessageToAll(LIGHTRED, string);
  1669. printf("%s", string);
  1670. }
  1671. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1672. return 1;
  1673. }
  1674.  
  1675. if(strcmp(cmd, "/bc", true) == 0 || strcmp(cmd, "/broadcast", true) == 0) // Displays a screen message
  1676. {
  1677. if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
  1678. {
  1679. GetPlayerName(playerid, sendername, sizeof(sendername));
  1680. new result[128];
  1681. result = bigstrtok(cmdtext, idx);
  1682. if(!strlen(result))
  1683. {
  1684. SendClientMessage(playerid, ORANGE, "USAGE: /bc [message] [time in seconds(if non entered, 5 seconds will be the time by default)]");
  1685. SendClientMessage(playerid, ORANGE, "FUNCTION: Will broadcast a screen message");
  1686. return 1;
  1687. }
  1688. new time;
  1689. tmp = strtok(cmdtext, idx);
  1690. if (!strlen(tmp)) time = 5;
  1691. else time = strval(tmp);
  1692. format(string, sizeof(string), "~w~%s", result);
  1693. GameTextForAll(string, time*1000, 4);
  1694. printf("%s", string);
  1695. }
  1696. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1697. return 1;
  1698. }
  1699.  
  1700. if(strcmp(cmd, "/veh", true) == 0) // Spawn a vehicle. Name supported too.
  1701. {
  1702. if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
  1703. {
  1704. tmp = strtok(cmdtext, idx);
  1705. if(!strlen(tmp))
  1706. {
  1707. SendClientMessage(playerid, ORANGE, "USAGE: /veh [modelname/id] [color1] [color2]");
  1708. return 1;
  1709. }
  1710. new car = GetVehicleModelIDFromName(tmp);
  1711. if (car == -1)
  1712. {
  1713. car = strval(tmp);
  1714. if(car < 400 || car > 611) return SendClientMessage(playerid, RED, "Vehicle ID can't be below 400 nor above 611 !");
  1715. }
  1716.  
  1717. tmp = strtok(cmdtext, idx);
  1718. if(!strlen(tmp))
  1719. {
  1720. SendClientMessage(playerid, ORANGE, "USAGE: /veh [modelname/id] [color1] [color2]");
  1721. return 1;
  1722. }
  1723. new color1 = strval(tmp);
  1724.  
  1725. tmp = strtok(cmdtext, idx);
  1726. if(!strlen(tmp))
  1727. {
  1728. SendClientMessage(playerid, ORANGE, "USAGE: /veh [modelname/id] [color1] [color2]");
  1729. return 1;
  1730. }
  1731. new color2 = strval(tmp);
  1732.  
  1733. new Float:X,Float:Y,Float:Z,Float:A;
  1734. GetPlayerPos(playerid, X,Y,Z);
  1735. GetPlayerFacingAngle(playerid, A);
  1736. X += (5 * floatsin(-A, degrees));
  1737. Y += (5 * floatcos(-A, degrees));
  1738. new carid = CreateVehicle(car, X,Y,Z, 0.0, color1, color2, 600000000);
  1739. format(string, sizeof(string), "Vehicle %s(%d) spawned.", VehNames[GetVehicleModel(carid)-400], carid);
  1740. SendClientMessage(playerid, GREEN, string);
  1741. GetPlayerName(playerid,sendername,sizeof(sendername));
  1742. format(string, sizeof(string), "-| Administrator %s spawned a vehicle(%d) [ Model: %s ] |-", sendername, carid, VehNames[GetVehicleModel(carid)-400]);
  1743. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  1744. }
  1745. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  1746. return 1;
  1747. }
  1748.  
  1749. if(strcmp(cmd, "/pweapons", true) == 0) // Checks a player's weapons
  1750. {
  1751. if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 1)
  1752. {
  1753. tmp = strtok(cmdtext, idx);
  1754. if(!strlen(tmp))
  1755. {
  1756. SendClientMessage(playerid, ORANGE, "USAGE: /pweapons [playerid/name]");
  1757. return 1;
  1758. }
  1759. new giveplayerid = ReturnUser(tmp);
  1760. if (giveplayerid != INVALID_PLAYER_ID)
  1761. {
  1762. new bullets[12];
  1763. new weapons[12];
  1764. new weapname[12][20];
  1765. for(new i = 0; i < 12; i++)
  1766. {
  1767. GetPlayerWeaponData(giveplayerid, i+1, weapons[i], bullets[i]);
  1768. GetWeaponName(weapons[i], weapname[i], 20);
  1769. }
  1770. GetPlayerName(giveplayerid, giveplayername, sizeof(giveplayername));
  1771. format(string,sizeof(string)," |- %s's Weapons -|",giveplayername);
  1772. SendClientMessage(playerid,LIGHTGREEN,string);
  1773. format(string, sizeof(string),"%s(0) - %s(%d) - %s(%d) - %s(%d) - %s(%d) - %s(%d)",weapname[0],weapname[1],bullets[1],weapname[2],bullets[2],weapname[3],bullets[3],weapname[4],bullets[4],weapname[5],bullets[5]);
  1774. SendClientMessage(playerid,YELLOW,string);
  1775. format(string,sizeof(string),"%s(%d) - %s(%d) - %s(%d) - %s(0) - %s(0) - %s(0)",weapname[6],bullets[6],weapname[7],bullets[7],weapname[8],bullets[8],weapname[9],weapname[10],weapname[11]);
  1776. SendClientMessage(playerid,YELLOW,string);
  1777. }
  1778. else SendClientMessage(playerid, RED, "Player is not active.");
  1779. }
  1780. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  1781. return 1;
  1782. }
  1783.  
  1784. if(strcmp(cmd, "/sethp", true) == 0) // Sets a player's health
  1785. {
  1786. if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 3)
  1787. {
  1788. tmp = strtok(cmdtext, idx);
  1789. if(!strlen(tmp))
  1790. {
  1791. SendClientMessage(playerid, ORANGE, "USAGE: /sethp [playerid/name] [health]");
  1792. return 1;
  1793. }
  1794. new targetid = ReturnUser(tmp);
  1795. tmp = strtok(cmdtext, idx);
  1796. new Float:hp = floatstr(tmp);
  1797. if (targetid != INVALID_PLAYER_ID)
  1798. {
  1799. if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /sethp [playerid/name] [health]");
  1800. SetPlayerHealth(targetid,hp);
  1801. if (hp < 1) Drugs[targetid] = 0;
  1802. GetPlayerName(playerid, sendername, sizeof(sendername));
  1803. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  1804. format(string,sizeof(string),"|- Administrator %s has changed %s's HP. [HP: %.2f] -|",sendername,giveplayername,hp);
  1805. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  1806. }
  1807. else SendClientMessage(playerid, RED, "Player is not active.");
  1808. }
  1809. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  1810. return 1;
  1811. }
  1812.  
  1813. if (strcmp(cmd, "/logout", true) == 0) // Logs off the admin
  1814. {
  1815. if(AccountInfo[playerid][Logged] == 1)
  1816. {
  1817. if(AccountInfo[playerid][AdminLevel] >= 1)
  1818. {
  1819. OnPlayerUpdateAccount(playerid);
  1820. AccountInfo[playerid][Logged] = 0;
  1821. AccountInfo[playerid][AdminLevel] = 0;
  1822. SendClientMessage(playerid, GREEN, "You have successfuly logged out.");
  1823. }
  1824. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  1825. }
  1826. else return SendClientMessage(playerid, RED, "You're not logged in! ( /login [password] )");
  1827. return 1;
  1828. }
  1829.  
  1830. if(strcmp(cmd, "/warn", true) == 0) // Warns a player. 3 warnings = auto-ban
  1831. {
  1832. if (AccountInfo[playerid][AdminLevel] >= 3)
  1833. {
  1834. tmp = strtok(cmdtext, idx);
  1835. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /warn [playername/id] [reason]");
  1836. new targetid = ReturnUser(tmp);
  1837. if(IsPlayerConnected(targetid))
  1838. {
  1839. if(targetid != INVALID_PLAYER_ID)
  1840. {
  1841. new reason[128];
  1842. reason = bigstrtok(cmdtext, idx);
  1843. if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /warn [playername/id] [reason]");
  1844. new sstring[128];
  1845. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  1846. GetPlayerName(playerid, sendername, sizeof(sendername));
  1847. AccountInfo[targetid][Warns] += 1;
  1848. format(string, sizeof(string), "You got warned by Admin %s. Reason: %s", sendername, reason);
  1849. SendClientMessage(targetid, ADMIN_RED, string);
  1850. format(string, sizeof(string), "-| Administrator %s warned %s. [Reason: %s ] |-", sendername,giveplayername, reason);
  1851. SendClientMessageToAdmins(ADMIN_RED,string,1);
  1852. format(string, sizeof(string), "-| %s's warnings: %d |-",giveplayername, AccountInfo[targetid][Warns]);
  1853. SendClientMessageToAdmins(ADMIN_RED,string,1);
  1854. if (AccountInfo[targetid][Warns] == 1) strmid(AccountInfo[targetid][WarnReason1], reason, 0, strlen(reason), 128);
  1855. else if (AccountInfo[targetid][Warns] == 2) strmid(AccountInfo[targetid][WarnReason2], reason, 0, strlen(reason), 128);
  1856. else if (AccountInfo[targetid][Warns] == 3) strmid(AccountInfo[targetid][WarnReason3], reason, 0, strlen(reason), 128);
  1857. SendClientMessage(targetid, RED, "3 Warnings = Auto-Ban!");
  1858. if(AccountInfo[targetid][Warns] >= 3)
  1859. {
  1860. new ip[128];
  1861. format(string, sizeof(string), "-| Administrator %s banned %s. [Reason: 3 Warnings...] |-", sendername,giveplayername);
  1862. BanLog(string);
  1863. SendClientMessageToAll(ADMIN_RED, string);
  1864. for(new i = 0; i < 3; i++)
  1865. {
  1866. if (i == 0) format(string, sizeof (string), "-| Reason #%d: %s |-", i+1, AccountInfo[targetid][WarnReason1]);
  1867. else if (i == 1) format(string, sizeof (string), "-| Reason #%d: %s |-", i+1, AccountInfo[targetid][WarnReason2]);
  1868. else if (i == 2) format(string, sizeof (string), "-| Reason #%d: %s |-", i+1, AccountInfo[targetid][WarnReason3]);
  1869. SendClientMessageToAll(ADMIN_RED, string);
  1870. }
  1871. GetPlayerIp(targetid,ip,128);
  1872. format(sstring, sizeof(sstring), "-| Banned Player's IP: %s |-", ip);
  1873. SendClientMessageToAdmins(ADMIN_RED, sstring,1);
  1874. AccountInfo[targetid][AdminLevel]= 0;
  1875. AccountInfo[targetid][Warns] = 0;
  1876. format(AccountInfo[targetid][WarnReason1], 128, "NONE");
  1877. format(AccountInfo[targetid][WarnReason2], 128, "NONE");
  1878. format(AccountInfo[targetid][WarnReason3], 128, "NONE");
  1879. Ban(giveplayerid);
  1880. return 1;
  1881. }
  1882. }
  1883. else
  1884. {
  1885. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1886. SendClientMessage(playerid, RED, string);
  1887. }
  1888. }
  1889. else
  1890. {
  1891. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1892. SendClientMessage(playerid, RED, string);
  1893. }
  1894. }
  1895. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1896. return 1;
  1897. }
  1898.  
  1899. if(strcmp(cmd, "/pstats", true) == 0) // Views the player's stats
  1900. {
  1901. if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 1)
  1902. {
  1903. tmp = strtok(cmdtext, idx);
  1904. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /pstats [playername/id]");
  1905. new targetid = ReturnUser(tmp);
  1906. if (targetid != INVALID_PLAYER_ID)
  1907. {
  1908. new Float:health,Float:armor;
  1909. GetPlayerHealth(targetid,health);
  1910. GetPlayerArmour(targetid,armor);
  1911. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  1912. format(string, sizeof(string), "Stats of %s: Health: '%.2f' - Cash: '$%d' - Warnings: '%d' - Armor: '%.2f'",giveplayername, health,GetPlayerMoney(targetid),AccountInfo[targetid][Warns],armor);
  1913. SendClientMessage(playerid,PURPLE,string);
  1914. if(AccountInfo[giveplayerid][Logged] == 1) SendClientMessage(playerid, PURPLE, "Logged In: Yes");
  1915. else if(AccountInfo[giveplayerid][Logged] == 0) SendClientMessage(playerid, PURPLE, "Logged In: No");
  1916. SendClientMessage(playerid,YELLOW,"Type /pweapons [playername/id] to check the player's weapons");
  1917. }
  1918. else SendClientMessage(playerid, RED, "Player is not active.");
  1919. }
  1920. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  1921. return 1;
  1922. }
  1923.  
  1924. if(strcmp(cmd, "/fuck", true) == 0) // Sends a player in the air and explodes
  1925. {
  1926. new Float:pX,Float:pY,Float:pZ;
  1927. new Float:X,Float:Y,Float:Z;
  1928. if (AccountInfo[playerid][AdminLevel] >= 4 || IsPlayerAdmin(playerid))
  1929. {
  1930. tmp = strtok(cmdtext, idx);
  1931. if(!strlen(tmp))
  1932. {
  1933. SendClientMessage(playerid, ORANGE, "USAGE: /fuck [playerid]");
  1934. SendClientMessage(playerid, ORANGE, "FUNCTION: Will fuck up a player.");
  1935. return 1;
  1936. }
  1937.  
  1938. new targetid = ReturnUser(tmp);
  1939. if(targetid != INVALID_PLAYER_ID)
  1940. {
  1941. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  1942. GetPlayerName(playerid, sendername, sizeof(sendername));
  1943. GetPlayerPos(targetid,pX,pY,pZ);
  1944. CreateExplosion(X,Y,Z+50,2,5.0);
  1945. SetPlayerPos(targetid,pX,pY,pZ+50);
  1946. format(string, sizeof(string), "-| Administrator %s fucked %s up |-",sendername, giveplayername);
  1947. SendClientMessageToAdmins(ADMIN_RED,string,1);
  1948. SendClientMessage(targetid, RED, "You've been fucked up by an admin.");
  1949. }
  1950. else if(giveplayerid == INVALID_PLAYER_ID)
  1951. {
  1952. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  1953. SendClientMessage(playerid, RED, string);
  1954. }
  1955. }
  1956. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  1957. return 1;
  1958. }
  1959.  
  1960. if(strcmp(cmd, "/giveweapon", true) == 0) // Gives a weapon to a player
  1961. {
  1962. if (AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
  1963. {
  1964. tmp = strtok(cmdtext, idx);
  1965. if(!strlen(tmp))
  1966. {
  1967. SendClientMessage(playerid, ORANGE, "USAGE: /giveweapon [playername/id] [weaponid] [ammo]");
  1968. return 1;
  1969. }
  1970. new gun;
  1971. new ammo;
  1972. new targetid = ReturnUser(tmp);
  1973. tmp = strtok(cmdtext, idx);
  1974. gun = strval(tmp);
  1975. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /giveweapon [playername/id] [weaponid] [ammo]");
  1976. tmp = strtok(cmdtext, idx);
  1977. ammo = strval(tmp);
  1978. if(targetid != INVALID_PLAYER_ID)
  1979. {
  1980. new weap[50];
  1981. GetPlayerName(playerid, sendername, sizeof(sendername));
  1982. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  1983. GivePlayerWeapon(targetid, gun, ammo);
  1984. GetWeaponName(gun, weap, sizeof weap);
  1985. format(string, sizeof(string), "-| Administrator %s gave a weapon(%s) to %s |-",sendername, weap, giveplayername);
  1986. SendClientMessageToAdmins(ADMIN_RED,string,1);
  1987. }
  1988. else if(targetid == INVALID_PLAYER_ID)
  1989. {
  1990. format(string, sizeof(string), "%d is not an active player.", targetid);
  1991. SendClientMessage(playerid, RED, string);
  1992. }
  1993. }
  1994. else SendClientMessage(playerid, RED, "You are not an admin with the required level!");
  1995. return 1;
  1996. }
  1997. if(strcmp(cmd, "/crash", true) == 0) // Crashes a player's client
  1998. {
  1999. if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
  2000. {
  2001. tmp = strtok(cmdtext, idx);
  2002. if(!strlen(tmp))
  2003. {
  2004. SendClientMessage(playerid, ORANGE, "USAGE: /crash [playername/id]");
  2005. SendClientMessage(playerid, ORANGE, "FUNCTION: Will crash a player.");
  2006. return 1;
  2007. }
  2008. new Float:X,Float:Y,Float:Z;
  2009. new targetid = ReturnUser(tmp);
  2010. if(IsPlayerConnected(targetid))
  2011. {
  2012. GetPlayerPos(giveplayerid,X,Y,Z);
  2013. new objectcrash = CreatePlayerObject(targetid,666666,X,Y,Z,0,0,0); // double-devil has spoken
  2014. SendClientMessage(playerid,GREEN, "Player successfuly crashed.");
  2015. DestroyPlayerObject(targetid, objectcrash);
  2016. }
  2017. else if (!IsPlayerConnected(giveplayerid))
  2018. {
  2019. format(string, sizeof(string), "%d is not an active player.", targetid);
  2020. SendClientMessage(playerid, RED, string);
  2021. }
  2022. }
  2023. else SendClientMessage(playerid, RED, "You're not a lead admin.");
  2024. return 1;
  2025. }
  2026.  
  2027. if(strcmp(cmd, "/setwarn", true) == 0) // Sets the player's warnings
  2028. {
  2029. if (AccountInfo[playerid][AdminLevel] >= 4 || IsPlayerAdmin(playerid))
  2030. {
  2031. tmp = strtok(cmdtext, idx);
  2032. if(!strlen(tmp))
  2033. {
  2034. SendClientMessage(playerid, ORANGE, "USAGE: /setwarn [playername/id] [warning]");
  2035. SendClientMessage(playerid, ORANGE, "FUNCTION: Will set a certain player's warning.");
  2036. return 1;
  2037. }
  2038. new targetid = ReturnUser(tmp);
  2039. if(targetid != INVALID_PLAYER_ID)
  2040. {
  2041. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  2042. GetPlayerName(playerid, sendername, sizeof(sendername));
  2043. tmp = strtok(cmdtext, idx);
  2044. new warnings = strval(tmp);
  2045. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /setwarn [playername/id] [warning]");
  2046. AccountInfo[targetid][Warns] = warnings;
  2047. format(string, sizeof(string), "Admin %s changed your warnings to %d", sendername, warnings);
  2048. SendClientMessage(targetid, GREEN, string);
  2049. SendClientMessage(targetid, RED, "3 Warnings = Auto-Ban! Ask an admin to check how many warnings you have");
  2050. format(string, sizeof(string), "-| Administrator %s changed %s's warnings. [Warnings: %d ] |-",sendername,giveplayername, AccountInfo[giveplayerid][Warns]);
  2051. SendClientMessageToAdmins(ADMIN_RED,string,1);
  2052. }
  2053. else if(giveplayerid == INVALID_PLAYER_ID)
  2054. {
  2055. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  2056. SendClientMessage(playerid, RED, string);
  2057. }
  2058. }
  2059. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  2060. return 1;
  2061. }
  2062.  
  2063. if(strcmp(cmd, "/an", true) == 0 || strcmp(cmd, "/announce", true) == 0) // Broadcasts an 'announcement' message.
  2064. {
  2065. if (AccountInfo[playerid][AdminLevel] >= 4 || IsPlayerAdmin(playerid))
  2066. {
  2067. GetPlayerName(playerid, sendername, sizeof(sendername));
  2068. new result[128];
  2069. result = bigstrtok(cmdtext, idx);
  2070. if(!strlen(result))
  2071. {
  2072. SendClientMessage(playerid, ORANGE, "USAGE: /(an)nounce [message]");
  2073. SendClientMessage(playerid, ORANGE, "FUNCTION: Will broadcast an announcement.");
  2074. return 1;
  2075. }
  2076. format(string, sizeof(string), "%s", result);
  2077. SendClientMessageToAll(AQUAGREEN, string);
  2078. printf("Announcement by %s: %s", sendername, string);
  2079. }
  2080. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  2081. return 1;
  2082. }
  2083.  
  2084. if(strcmp(cmd, "/superpunch", true) == 0) // Triggers an explosion when you use the punch key
  2085. {
  2086. if (AccountInfo[playerid][AdminLevel] >= 4 || IsPlayerAdmin(playerid))
  2087. {
  2088. tmp = strtok(cmdtext,idx);
  2089. if(!strlen(tmp))
  2090. {
  2091. SendClientMessage(playerid, ORANGE, "USAGE: /superpunch [on/off]");
  2092. SendClientMessage(playerid, ORANGE, "FUNCTION: Will give you the power of Super Punch. When pressing 'PUNCH' button, you will explode but will live.");
  2093. }
  2094. else if(strcmp(tmp,"on",true) == 0)
  2095. {
  2096. SuperPunch[playerid] = 1;
  2097. SendClientMessage(playerid,GREEN,"You are now blessed with SUPER PUNCH! Go knock someone out.");
  2098. }
  2099. else if(strcmp(tmp,"off",true) == 0)
  2100. {
  2101. SuperPunch[playerid] = 0;
  2102. SendClientMessage(playerid,GREEN,"Your super punch is now disabled.");
  2103. }
  2104. }
  2105. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  2106. return 1;
  2107. }
  2108.  
  2109. if (strcmp(cmd, "/superpunchp", true) == 0) // Gives the Super Punch ability to a player
  2110. {
  2111. new tmp2[128];
  2112. if (AccountInfo[playerid][AdminLevel] > 4 || IsPlayerAdmin(playerid))
  2113. {
  2114. tmp = strtok(cmdtext,idx);
  2115. if(!strlen(tmp))
  2116. {
  2117. SendClientMessage(playerid,ORANGE,"USAGE: /superpunchp [playername/id] [on/off]");
  2118. SendClientMessage(playerid,ORANGE,"FUNCTION: Will give the player the power of SuperPunch.");
  2119. }
  2120. new targetid = ReturnUser(tmp);
  2121. if(targetid != INVALID_PLAYER_ID)
  2122. {
  2123. tmp2 = strtok(cmdtext,idx);
  2124. if(strcmp(tmp2,"on",true) == 0)
  2125. {
  2126. GetPlayerName(playerid, sendername, sizeof(sendername));
  2127. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  2128. SuperPunch[targetid] = 1;
  2129. format(string, sizeof(string), "Admin %s blessed you with the power of Super Punch !", sendername);
  2130. SendClientMessage(targetid,GREEN,string);
  2131. format(string, sizeof(string), "-| Administrator %s blessed %s with the power of Super Punch |-", sendername,giveplayername);
  2132. SendClientMessageToAdmins(ADMIN_RED,string,1);
  2133. }
  2134. else if(strcmp(tmp2,"off",true) == 0)
  2135. {
  2136. format(string, sizeof(string), "Admin %s removed your Super Punch power.", sendername);
  2137. SendClientMessage(targetid,RED,string);
  2138. SuperPunch[targetid] = 0;
  2139. }
  2140. }
  2141. else if(giveplayerid == INVALID_PLAYER_ID)
  2142. {
  2143. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  2144. SendClientMessage(playerid,RED,string);
  2145. }
  2146. }
  2147. else SendClientMessage(playerid,RED,"You are not an admin with the required level.");
  2148. return 1;
  2149. }
  2150.  
  2151. if(strcmp(cmd, "/viewcmds", true) == 0) // Views unknown commands and commands mentioned in 'ViewCommands' variable entered by players
  2152. {
  2153. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  2154. {
  2155. tmp = strtok(cmdtext,idx);
  2156. if(!strlen(tmp))
  2157. {
  2158. SendClientMessage(playerid, ORANGE, "USAGE: /viewcmds [on/off]");
  2159. SendClientMessage(playerid, ORANGE, "FUNCTION: Will see the players typing some commands and wrong commands.");
  2160. }
  2161. else if(strcmp(tmp,"on",true) == 0)
  2162. {
  2163. ViewCmds[playerid] = 1;
  2164. SendClientMessage(playerid,GREEN,"You can know view players typing some commands and wrong commands.");
  2165. }
  2166. else if(strcmp(tmp,"off",true) == 0)
  2167. {
  2168. ViewCmds[playerid] = 0;
  2169. SendClientMessage(playerid,GREEN,"You can no longer view players typing some commands and wrong commands.");
  2170. }
  2171. }
  2172. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  2173. return 1;
  2174. }
  2175.  
  2176. if(strcmp(cmd, "/jail", true) == 0) // Jails a player
  2177. {
  2178. if (AccountInfo[playerid][AdminLevel] >= 2)
  2179. {
  2180. tmp = strtok(cmdtext, idx);
  2181. if(!strlen(tmp))
  2182. {
  2183. SendClientMessage(playerid, ORANGE, "USAGE: /jail [playername/id] [reason]");
  2184. return 1;
  2185. }
  2186. new targetid = ReturnUser(tmp);
  2187. if(IsPlayerConnected(targetid))
  2188. {
  2189. if(targetid != INVALID_PLAYER_ID)
  2190. {
  2191. if(AccountInfo[giveplayerid][Jail] == 0)
  2192. {
  2193. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  2194. GetPlayerName(playerid, sendername, sizeof(sendername));
  2195. new reason[128];
  2196. reason = bigstrtok(cmdtext, idx);
  2197. if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /jail [playername/id] [reason]");
  2198. format(string, sizeof(string), "You got jailed by Admin %s. Reason: %s", sendername, reason);
  2199. SendClientMessage(targetid, ADMIN_RED, string);
  2200. format(string, sizeof(string), "-| Administrator %s jailed %s. [ Reason: %s ] |-",sendername,giveplayername, reason);
  2201. SendClientMessageToAll(ADMIN_RED,string);
  2202. AccountInfo[targetid][Jail] = 1;
  2203. OnPlayerJailed(targetid);
  2204. return 1;
  2205. }
  2206. else SendClientMessage(playerid, RED, "Player is already jailed!");
  2207. }
  2208. else
  2209. {
  2210. format(string, sizeof(string), "%d is not an active player.", targetid);
  2211. SendClientMessage(playerid, RED, string);
  2212. }
  2213. }
  2214. else
  2215. {
  2216. format(string, sizeof(string), "%d is not an active player.", targetid);
  2217. SendClientMessage(playerid, RED, string);
  2218. }
  2219. }
  2220. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  2221. return 1;
  2222. }
  2223.  
  2224. if(strcmp(cmd, "/unjail", true) == 0) // Unjails a player
  2225. {
  2226. if (AccountInfo[playerid][AdminLevel] >= 2 || IsPlayerAdmin(playerid))
  2227. {
  2228. tmp = strtok(cmdtext, idx);
  2229. if(!strlen(tmp))
  2230. {
  2231. SendClientMessage(playerid, ORANGE, "USAGE: /unjail [playername/id]");
  2232. return 1;
  2233. }
  2234.  
  2235. new targetid = ReturnUser(tmp);
  2236. if(targetid != INVALID_PLAYER_ID)
  2237. {
  2238. if(AccountInfo[giveplayerid][Jail] == 1)
  2239. {
  2240. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  2241. GetPlayerName(playerid, sendername, sizeof(sendername));
  2242. format(string, sizeof(string), "-| Administrator %s unjailed %s |-",sendername, giveplayername);
  2243. SendClientMessageToAll(ADMIN_RED,string);
  2244. AccountInfo[targetid][Jail] = 0;
  2245. OnPlayerUnjailed(targetid);
  2246. }
  2247. else SendClientMessage(playerid, RED, "Player is not jailed!");
  2248. }
  2249. else
  2250. {
  2251. format(string, sizeof(string), "%d is not an active player.", targetid);
  2252. SendClientMessage(playerid, RED, string);
  2253. }
  2254. }
  2255. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  2256. return 1;
  2257. }
  2258.  
  2259. if(strcmp(cmd, "/gotoveh", true) == 0) // Teleports to a vehicle's position
  2260. {
  2261. tmp = strtok(cmdtext, idx);
  2262. if(!strlen(tmp))
  2263. {
  2264. SendClientMessage(playerid, ORANGE, "USAGE: /gotoveh [vehicleid]");
  2265. return 1;
  2266. }
  2267. new car = strval(tmp);
  2268. if (AccountInfo[playerid][AdminLevel] >= 3)
  2269. {
  2270. new Float:vx,Float:vy,Float:vz;
  2271. GetVehiclePos(car,vx,vy,vz);
  2272. if (GetPlayerState(playerid) == 2)
  2273. SetVehiclePos(GetPlayerVehicleID(playerid),vx,vy+2,vz);
  2274. else
  2275. SetPlayerPos(playerid,vx,vy,vz+1);
  2276. SetPlayerInterior(playerid,0);
  2277. format(string,256,"You have teleported to vehicle id %d(%s)",car, VehNames[GetVehicleModel(car)-400]);
  2278. SendClientMessage(playerid,GREEN,string);
  2279. }
  2280. else SendClientMessage(playerid,RED,"You're not an admin with the required level");
  2281. return 1;
  2282. }
  2283. if(!strcmp(cmdtext, "/aclearchat", true)) // Clears the chatbox for everyone
  2284. {
  2285. if(AccountInfo[playerid][AdminLevel] >= 3 || IsPlayerAdmin(playerid))
  2286. {
  2287. for(new chat = 0; chat <= 50; chat++) SendClientMessageToAll(GREEN, " ");
  2288. GetPlayerName(playerid, sendername, 20);
  2289. format(string, 256, "-| Administrator %s cleared the chat |-", sendername);
  2290. SendClientMessageToAll(ADMIN_RED, string);
  2291. return 1;
  2292. }
  2293. else SendClientMessage(playerid, RED, "You are not an admin with the required level.");
  2294. return 1;
  2295. }
  2296. if(strcmp(cmd, "/hide", true) == 0) // Hides you from the admin list
  2297. {
  2298. if (AccountInfo[playerid][AdminLevel] >= 4)
  2299. {
  2300. Hide[playerid] = 1;
  2301. SendClientMessage(playerid,GREEN,"|- You're now hidden from the admin list -|");
  2302. }
  2303. return 1;
  2304. }
  2305. if(strcmp(cmd, "/unhide", true) == 0)
  2306. {
  2307. if (AccountInfo[playerid][AdminLevel] >= 4) // Unhides you from the admin list
  2308. {
  2309. if (Hide[playerid] != 1) return SendClientMessage(playerid,RED,"You're not hidden in the admin list!");
  2310. Hide[playerid] = 0;
  2311. SendClientMessage(playerid,GREEN,"|- You're now visible in the admin list -|");
  2312. }
  2313. return 1;
  2314. }
  2315.  
  2316. if(strcmp(cmd, "/virtual", true) == 0) // Sets the player's virtual world
  2317. {
  2318. if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 2)
  2319. {
  2320. tmp = strtok(cmdtext, idx);
  2321. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /virtual [playerid/name] [virtual world (0-255)]");
  2322. new targetid = ReturnUser(tmp);
  2323. tmp = strtok(cmdtext, idx);
  2324. new v = strval(tmp);
  2325. if (targetid != INVALID_PLAYER_ID)
  2326. {
  2327. if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /virtual [playerid/name] [virtual world (0-255)]");
  2328. SetPlayerVirtualWorld(targetid,v);
  2329. GetPlayerName(playerid, sendername, sizeof(sendername));
  2330. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  2331. format(string,sizeof(string),"|- Administrator %s has changed %s's Virtual World. [World: %d] -|",sendername,giveplayername,v);
  2332. SendClientMessageToAdmins(ADMIN_RED,string,1);
  2333. }
  2334. else SendClientMessage(playerid, RED, "Player is not active.");
  2335. }
  2336. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  2337. return 1;
  2338. }
  2339.  
  2340.  
  2341.  
  2342. if(strcmp(cmd, "/view", true) == 0) // Spectates a player
  2343. {
  2344. if (AccountInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid,RED,"You're not an admin !");
  2345. tmp = strtok(cmdtext, idx);
  2346. if(!strlen(tmp))
  2347. {
  2348. SendClientMessage(playerid, ORANGE, "|__________________________________|");
  2349. SendClientMessage(playerid, ORANGE, "USAGE: /view [playerid]");
  2350. SendClientMessage(playerid, ORANGE, "FUNCTION: Will spectate a player.");
  2351. SendClientMessage(playerid, ORANGE, "HELP: /view off to stop spectating");
  2352. SendClientMessage(playerid, ORANGE, "|__________________________________|");
  2353. return 1;
  2354. }
  2355. new targetid = ReturnUser(tmp);
  2356. if (giveplayerid != INVALID_PLAYER_ID)
  2357. {
  2358. if (AccountInfo[playerid][AdminLevel] < 1) return SendClientMessage(playerid,RED,"You're not an admin !");
  2359. TogglePlayerSpectating(playerid, 1);
  2360. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(targetid));
  2361. SetPlayerInterior(playerid,GetPlayerInterior(targetid));
  2362. if (IsPlayerInAnyVehicle(targetid)) PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid));
  2363. else PlayerSpectatePlayer(playerid, targetid);
  2364. SendClientMessage(playerid, ORANGE, "HELP: '/view off' to stop spectating");
  2365. }
  2366. else if(strcmp(tmp, "off", true) == 0)
  2367. {
  2368. TogglePlayerSpectating(playerid, 0);
  2369. SetPlayerVirtualWorld(playerid,0);
  2370. }
  2371. else
  2372. {
  2373. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  2374. SendClientMessage(playerid, RED, string);
  2375. }
  2376. return 1;
  2377. }
  2378.  
  2379. if(strcmp(cmd, "/blockpm", true) == 0) // Blocks PMs
  2380. {
  2381. if (AccountInfo[playerid][AdminLevel] >= 5)
  2382. {
  2383. if (PMBlock[playerid] == true)
  2384. {
  2385. PMBlock[playerid] = false;
  2386. SendClientMessage(playerid, GREEN, "|- Private messages BLOCKED -|");
  2387. return 1;
  2388. }
  2389. if (PMBlock[playerid] == false)
  2390. {
  2391. PMBlock[playerid] = true;
  2392. SendClientMessage(playerid, GREEN, "|- Private messages UNBLOCKED -|");
  2393. return 1;
  2394. }
  2395. }
  2396. else return SendClientMessage(playerid, RED, "You're not a lead admin!");
  2397. }
  2398.  
  2399. if(!strcmp(cmd, "/seifocalypse", true)) // Launches explosion(s) in front of the player(it follow the previous explosion so it goes straight) as many times has he wants
  2400. {
  2401. if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
  2402. {
  2403. tmp = strtok(cmdtext, idx);
  2404. if (!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /seifocalypse [explosions]");
  2405. new Float:X,Float:Y,Float:Z,Float:A;
  2406. GetPlayerPos(playerid, X,Y,Z);
  2407. GetPlayerFacingAngle(playerid, A);
  2408. Nuke[playerid] = 1;
  2409. SetTimerEx("NukeBlast", 200, 0, "ddffff",playerid, strval(tmp), X, Y, Z, A);
  2410. }
  2411. else return SendClientMessage(playerid, RED, "You're not a lead admin!");
  2412. return 1;
  2413. }
  2414.  
  2415. if(!strcmp(cmd, "/missile", true)) // Spawns a missile 50 Z higher than player's and drops it to the ground, toggling a huge explosion
  2416. {
  2417. if (AccountInfo[playerid][AdminLevel] >= 5 || IsPlayerAdmin(playerid))
  2418. {
  2419. if (IsValidObject(Missile[playerid])) return SendClientMessage(playerid, RED, "You already dropped a missile that's currently in progress of exploding");
  2420. new Float:X,Float:Y,Float:Z;
  2421. GetPlayerPos(playerid, X,Y,Z);
  2422. Missile[playerid] = CreateObject(3786, X, Y, Z+50, 357.6293, 272.3375, 6.8755);
  2423. MoveObject(Missile[playerid], X, Y, Z, 20.0);
  2424. }
  2425. else return SendClientMessage(playerid, RED, "You're not a lead admin!");
  2426. return 1;
  2427. }
  2428.  
  2429. if (!strcmp(cmd, "/push", true)) // Pushes a player back. Player gets pushed back in motions
  2430. {
  2431. if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 3)
  2432. {
  2433. tmp = strtok(cmdtext, idx);
  2434. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /push [playername/id]");
  2435. new targetid = ReturnUser(tmp);
  2436. if (targetid != INVALID_PLAYER_ID)
  2437. {
  2438. PushPlayer(targetid, 20, true);
  2439. GetPlayerName(playerid, sendername, sizeof(sendername));
  2440. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  2441. format(string,sizeof(string),"|- Administrator %s has pushed %s -|", sendername, giveplayername);
  2442. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  2443. }
  2444. else SendClientMessage(playerid, RED, "Player is not active.");
  2445. }
  2446. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  2447. return 1;
  2448. }
  2449.  
  2450. if (!strcmp(cmd, "/setgravity", true)) // Changes gravity
  2451. {
  2452. if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 4)
  2453. {
  2454. tmp = strtok(cmdtext, idx);
  2455. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /pussetgravity [gravity float]");
  2456. new Float:gravity = floatstr(tmp);
  2457. SetGravity(gravity);
  2458. GetPlayerName(playerid, sendername, sizeof(sendername));
  2459. format(string,sizeof(string),"|- Administrator %s has changed gravity [ Gravity: %.4f ] -|", sendername, gravity);
  2460. SendClientMessageToAll(ADMIN_RED, string);
  2461. }
  2462. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  2463. return 1;
  2464. }
  2465.  
  2466. if (!strcmp(cmd, "/settime", true)) // Changes time
  2467. {
  2468. if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 3)
  2469. {
  2470. tmp = strtok(cmdtext, idx);
  2471. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /settime [time(0-23)]");
  2472. new time = strval(tmp);
  2473. if (time < 0 || time > 23) return SendClientMessage(playerid, RED, "Time can only be from 0 to 23!");
  2474. SetWorldTime(time);
  2475. GetPlayerName(playerid, sendername, sizeof(sendername));
  2476. format(string,sizeof(string),"|- Administrator %s has changed time [ Hour: %d ] -|", sendername, time);
  2477. SendClientMessageToAll(ADMIN_RED, string);
  2478. }
  2479. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  2480. return 1;
  2481. }
  2482.  
  2483. if (!strcmp(cmd, "/setweather", true)) // Changes time
  2484. {
  2485. if(IsPlayerAdmin(playerid) || AccountInfo[playerid][AdminLevel] >= 4)
  2486. {
  2487. tmp = strtok(cmdtext, idx);
  2488. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /setweather [weather id]");
  2489. new weather = strval(tmp);
  2490. SetWeather(weather);
  2491. GetPlayerName(playerid, sendername, sizeof(sendername));
  2492. format(string,sizeof(string),"|- Administrator %s has changed weather [ Weather: %d ] -|", sendername, weather);
  2493. SendClientMessageToAdmins(ADMIN_RED, string, 1);
  2494. }
  2495. else SendClientMessage(playerid, RED, "You're not an admin with the required level.");
  2496. return 1;
  2497. }
  2498.  
  2499. if(strcmp(cmd, "/report", true) == 0) // Available for everyone: reports a player to the admins
  2500. {
  2501. tmp = strtok(cmdtext, idx);
  2502. if(!strlen(tmp))
  2503. {
  2504. SendClientMessage(playerid, ORANGE, "USAGE: /report [playername/id] [reason]");
  2505. SendClientMessage(playerid, ORANGE, "FUNCTION: Will report the specified player to the administrators(online).");
  2506. return 1;
  2507. }
  2508. new targetid = ReturnUser(tmp);
  2509. if(targetid != INVALID_PLAYER_ID)
  2510. {
  2511. GetPlayerName(targetid, giveplayername, sizeof(giveplayername));
  2512. GetPlayerName(playerid, sendername, sizeof(sendername));
  2513. new reason[128];
  2514. reason = bigstrtok(cmdtext, idx);
  2515. if(!strlen(reason)) return SendClientMessage(playerid, ORANGE, "USAGE: /report [playerid] [reason]");
  2516. format(string, sizeof(string), "|- %s reported %s [ Reason: %s ]", sendername,giveplayername,reason);
  2517. SendClientMessageToAdmins(ADMIN_RED, string,1);
  2518. format(string, sizeof(string), "Your report on '%s' has been sent to the current online admins. Thank you.", giveplayername);
  2519. SendClientMessage(playerid, GREEN, string);
  2520. }
  2521.  
  2522. else if(giveplayerid == INVALID_PLAYER_ID)
  2523. {
  2524. format(string, sizeof(string), "%d is not an active player.", giveplayerid);
  2525. SendClientMessage(playerid, RED, string);
  2526. }
  2527. return 1;
  2528. }
  2529.  
  2530. if(strcmp(cmd, "/ah", true) == 0 || strcmp(cmd, "/ahelp", true) == 0 || strcmp(cmd, "/acommands", true) == 0) // List of admin commands
  2531. {
  2532. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  2533. {
  2534. SendClientMessage(playerid, YELLOW, " |- Server Admin Commands -|");
  2535. SendClientMessage(playerid, ORANGE, "LEAD(5): /gmx /makeadmin /kickall /crash /blockpm /seifocalypse /missile");
  2536. SendClientMessage(playerid, ORANGE, "LEVEL 1+: /9gates /(un)freeze /setscore /angle /kick /setname /kill /goto /ip /pweapons /view /changepassword /enginchat /nohacking");
  2537. SendClientMessage(playerid, ORANGE, "LEVEL 2+: /(un)mute /givecash /get /pstats /warn /viewcmds /logout /virtual");
  2538. SendClientMessage(playerid, ORANGE, "LEVEL 3+: /nuke /ban /disarm /say /giveweapon /slap /gotoveh /(un)jail /sethp /push /settime");
  2539. SendClientMessage(playerid, ORANGE, "LEVEL 4+: /fuck /bc /setwarn /announce /aclearchat /bslap /(un)hide /rangeban /teleport /setgravity /setweather");
  2540. SendClientMessage(playerid, ORANGE, "ADMIN CHAT: // Example: //hello");
  2541. SendClientMessage(playerid, WHITE, "RCON CMDS: /carmenu /adminmenu /rcon kick /rcon ban /rcon login /rcon loadfs /rcon unloadfs");
  2542. }
  2543. else SendClientMessage(playerid, RED, "You are not an admin!");
  2544. return 1;
  2545. }
  2546. if(strcmp(cmd, "/enginchat", true) == 0) // List of admin command
  2547. {
  2548. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  2549. {
  2550. SendClientMessageToAll(RED, "USE ENGLISH IN MAINCHAT OTHER LANGUAGE IN /PM!!");
  2551. SendClientMessageToAll(RED, "USE ENGLISH IN MAINCHAT OTHER LANGUAGE IN /PM!!");
  2552. SendClientMessageToAll(RED, "USE ENGLISH IN MAINCHAT OTHER LANGUAGE IN /PM!!");
  2553. SendClientMessageToAll(RED, "USE ENGLISH IN MAINCHAT OTHER LANGUAGE IN /PM!!");
  2554. }
  2555.  
  2556. return 1;
  2557. }
  2558. if(strcmp(cmd, "/nohacking", true) == 0) // List of admin command
  2559. {
  2560. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  2561. {
  2562. SendClientMessageToAll(RED, "NO HACKING PLEASE TURN OFF THE HACKS OR FACE A /KICK OR /BAN!!");
  2563. SendClientMessageToAll(RED, "NO HACKING PLEASE TURN OFF THE HACKS OR FACE A /KICK OR /BAN!!");
  2564. SendClientMessageToAll(RED, "NO HACKING PLEASE TURN OFF THE HACKS OR FACE A /KICK OR /BAN!!");
  2565. SendClientMessageToAll(RED, "NO HACKING PLEASE TURN OFF THE HACKS OR FACE A /KICK OR /BAN!!");
  2566. }
  2567.  
  2568. return 1;
  2569. }
  2570. if(strcmp(cmd, "/9gates", true) == 0) // List of admin command
  2571. {
  2572. if (AccountInfo[playerid][AdminLevel] >= 1 || IsPlayerAdmin(playerid))
  2573. {
  2574. SendClientMessage(playerid, RED, "/9mainc - Closes main gate");
  2575. SendClientMessage(playerid, RED, "/9maino - Opens main gate");
  2576. SendClientMessage(playerid, RED, "/9garagec - Closes garage door");
  2577. SendClientMessage(playerid, RED, "/9garageo - Opens garage door");
  2578. SendClientMessage(playerid, RED, "/9lifd - Lifts down the elevator");
  2579. SendClientMessage(playerid, RED, "/9liftu - Lifts up the elevator");
  2580.  
  2581. }
  2582.  
  2583. return 1;
  2584. }
  2585.  
  2586.  
  2587. if (strcmp(cmd, "/admins", true) == 0) // Admin list if they're online
  2588. {
  2589. new count = 0;
  2590. SendClientMessage(playerid, GREEN, " [Online Admins]");
  2591. for(new i = 0; i < MAX_PLAYERS; i++)
  2592. {
  2593. if (IsPlayerConnected(i))
  2594. {
  2595. if(AccountInfo[i][AdminLevel] >= 1 && AccountInfo[i][AdminLevel] <= 5 && Hide[i] == 0)
  2596. {
  2597. GetPlayerName(i, sendername, sizeof(sendername));
  2598. format(string, 128, "Level %d [%i]%s", AccountInfo[i][AdminLevel],i,sendername);
  2599. SendClientMessage(playerid, LIGHTGREEN, string);
  2600. count++;
  2601. }
  2602. }
  2603. }
  2604. if (count == 0) SendClientMessage(playerid,RED,"No admin online in the list");
  2605. SendClientMessage(playerid, GREEN, "[____________________________________]");
  2606. return 1;
  2607. }
  2608.  
  2609. if (strcmp(cmd, "/register", true) == 0) // Registers an account
  2610. {
  2611. if(IsPlayerConnected(playerid))
  2612. {
  2613. if(AccountInfo[playerid][Logged] == 1)
  2614. {
  2615. SendClientMessage(playerid, RED, "You are already logged in.");
  2616. return 1;
  2617. }
  2618. GetPlayerName(playerid, sendername, sizeof(sendername));
  2619. format(string, sizeof(string), "/sAccounts/%s.seifadmin", sendername);
  2620. new File: hFile = fopen(string, io_read);
  2621. if (hFile)
  2622. {
  2623. SendClientMessage(playerid, RED, "That name is already taken. Please reconnect using a different username.");
  2624. fclose(hFile);
  2625. return 1;
  2626. }
  2627. new tmppass[128];
  2628. tmp = strtok(cmdtext, idx);
  2629. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /register [password]");
  2630. strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
  2631. OnPlayerRegister(playerid, MD5_Hash(tmppass));
  2632. }
  2633. return 1;
  2634. }
  2635.  
  2636. if (strcmp(cmd, "/login", true) == 0) // Logins
  2637. {
  2638. new tmppass[128];
  2639. if(AccountInfo[playerid][Logged] == 1) return SendClientMessage(playerid, RED, "You are already logged in.");
  2640. tmp = strtok(cmdtext, idx);
  2641. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /login [password]");
  2642. new plname[MAX_PLAYER_NAME];
  2643. GetPlayerName(playerid, plname, sizeof(plname));
  2644. format(string, sizeof(string), "/sAccounts/%s.seifadmin", plname);
  2645. if(!fexist(string)) return SendClientMessage(playerid, RED, "That account isn't registered! Please register: /register [password]");
  2646. strmid(tmppass, tmp, 0, strlen(cmdtext), 255);
  2647. OnPlayerLogin(playerid, MD5_Hash(tmppass));
  2648. return 1;
  2649. }
  2650.  
  2651. if (!strcmp(cmd, "/changepassword", true)) // Changes your password
  2652. {
  2653. if (!AccountInfo[playerid][Logged]) return SendClientMessage(playerid, RED, "You're not logged in.");
  2654. if (AccountInfo[playerid][AdminLevel] >= 1)
  2655. {
  2656. new oldpass[128];
  2657. oldpass = strtok(cmdtext, idx);
  2658. if(!strlen(oldpass)) return SendClientMessage(playerid, ORANGE, "USAGE: /changepassword [CURRENT PASSWORD] [new password]");
  2659. if (strcmp(MD5_Hash(oldpass), AccountInfo[playerid][Password], true)) return SendClientMessage(playerid, RED, "Invalid password.");
  2660. tmp = strtok(cmdtext, idx);
  2661. if(!strlen(tmp)) return SendClientMessage(playerid, ORANGE, "USAGE: /changepassword [current password] [NEW PASSWORD]");
  2662. format(oldpass, 128, "|- You've changed your password to '%s' -|", tmp);
  2663. SendClientMessage(playerid, LIGHTGREEN, oldpass);
  2664. strmid(AccountInfo[playerid][Password], MD5_Hash(tmp), 0, strlen(MD5_Hash(tmp)), 128);
  2665. }
  2666. return 1;
  2667. }
  2668.  
  2669. /*»»»»»»»»»»»»»»»»»»»»»»»»»»»» [WRONG COMMAND] «««««««««««««««««««««««««««*/
  2670. else
  2671. {
  2672. for(new i = 0; i < GetMaxPlayers(); i++)
  2673. {
  2674. if (IsPlayerConnected(i))
  2675. {
  2676. if (AccountInfo[i][AdminLevel] > 0 && ViewCmds[i] == 1)
  2677. {
  2678. GetPlayerName(playerid, sendername, sizeof sendername);
  2679. format(tmp, 128, "[VIEWCMDS] [%d]%s: %s", playerid, sendername, cmdtext);
  2680. SendClientMessage(i, PURPLE, tmp);
  2681. }
  2682. }
  2683. }
  2684. return 0;
  2685. }
  2686. }
  2687.  
  2688. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2689. {
  2690. if (SuperPunch[playerid] == 1)
  2691. {
  2692. if (GetPlayerState(playerid) != 2)
  2693. {
  2694. if (newkeys & KEY_FIRE && Drugs[playerid] == 0)
  2695. {
  2696. new Float:X,Float:Y,Float:Z,Float:Health;
  2697. GetPlayerHealth(playerid,Health);
  2698. if (GetPlayerWeapon(playerid) == 0)
  2699. {
  2700. GetPlayerPos(playerid,X,Y,Z);
  2701. CreateExplosion(X,Y,Z,7,7.0);
  2702. SetPlayerHealth(playerid,Health);
  2703. }
  2704. }
  2705. else if (newkeys & KEY_FIRE && Drugs[playerid] == 1)
  2706. {
  2707. new Float:X,Float:Y,Float:Z;
  2708. if (GetPlayerWeapon(playerid) == 0)
  2709. {
  2710. SetPlayerHealth(playerid,999999999);
  2711. GetPlayerPos(playerid,X,Y,Z);
  2712. CreateExplosion(X,Y,Z,7,7.0);
  2713. SetPlayerHealth(playerid,999999999);
  2714. }
  2715. }
  2716. }
  2717. }
  2718. }
  2719.  
  2720. OnPlayerJailed(playerid)
  2721. {
  2722. SetPlayerInterior(playerid, 0);
  2723. SetPlayerPos(playerid, 575.8542,-3169.3997,10.3052);
  2724. SetPlayerFacingAngle(playerid, 272.6900);
  2725. TogglePlayerControllable(playerid, 1);
  2726. return 1;
  2727. }
  2728.  
  2729. OnPlayerUnjailed(playerid)
  2730. {
  2731. SetPlayerInterior(playerid, 0);
  2732. SetPlayerPos(playerid, 631.2733,-3058.4495,10.4870);
  2733. SetPlayerFacingAngle(playerid, 266.9169);
  2734. TogglePlayerControllable(playerid, 1);
  2735. return 1;
  2736. }
  2737.  
  2738. public CountDown()
  2739. {
  2740. if (Count > 0)
  2741. {
  2742. new str[5];
  2743. format(str, sizeof str, "~w~%d", Count);
  2744. GameTextForAll(str,2500,3);
  2745. Count--;
  2746. SetTimer("CountDown",1000,0);
  2747. }
  2748. else
  2749. {
  2750. GameTextForAll("~g~~h~Go ~w~!!",2500,3);
  2751. Count = 999;
  2752. }
  2753. return 1;
  2754. }
  2755.  
  2756. public OnPlayerPrivmsg(playerid, recieverid, text[])
  2757. {
  2758. if (PMBlock[recieverid] == true) return SendClientMessage(playerid, RED, "That admin has blocked private messages"), 0;
  2759. return 1;
  2760. }
  2761.  
  2762. forward NukeBlast(playerid, times, Float:X,Float:Y,Float:Z,Float:A);
  2763. public NukeBlast(playerid, times, Float:X,Float:Y,Float:Z,Float:A)
  2764. {
  2765. if (Nuke[playerid] == times+1) return 1;
  2766. //printf("Nukeblast %d",Nuke[playerid]);
  2767. new Float:x,Float:y;
  2768. x = X + ((10*Nuke[playerid]) * floatsin(-A+5, degrees));
  2769. y = Y + ((10*Nuke[playerid]) * floatcos(-A+5, degrees));
  2770. CreateExplosion(x, y, Z, 3, 3.0);
  2771. Nuke[playerid]++;
  2772. SetTimerEx("NukeBlast", 200, 0, "ddffff",playerid, times, X, Y, Z, A);
  2773. return 1;
  2774. }
  2775.  
  2776. public OnObjectMoved(objectid)
  2777. {
  2778. for(new i; i < MAX_PLAYERS; i++) if (objectid == Missile[i])
  2779. {
  2780. new Float:X,Float:Y,Float:Z,Float:x,Float:y,Float:z;
  2781. GetObjectPos(objectid, X, Y, Z);
  2782. GetObjectPos(objectid, x, y, z);
  2783. DestroyObject(objectid);
  2784. CreateExplosion(X, Y, Z, 7, 5);
  2785. //front
  2786. X += (5.0 * floatsin(0, degrees));
  2787. Y += (5.0 * floatcos(0, degrees));
  2788. CreateExplosion(X, Y, Z, 7, 5);
  2789. X += (3.0 * floatsin(0+45, degrees));
  2790. Y += (3.0 * floatcos(0+45, degrees));
  2791. CreateExplosion(X, Y, Z, 7, 5);
  2792. X += (3.0 * floatsin(0-45, degrees));
  2793. Y += (3.0 * floatcos(0-45, degrees));
  2794. CreateExplosion(X, Y, Z, 7, 5);
  2795. //right-left
  2796. X += (5.0 * floatcos(0, degrees));
  2797. Y += (5.0 * floatsin(0, degrees));
  2798. CreateExplosion(X, Y, Z, 7, 5);
  2799. //back
  2800. X -= (5.0 * floatcos(0, degrees));
  2801. Y -= (5.0 * floatsin(0, degrees));
  2802. CreateExplosion(X, Y, Z, 7, 5);
  2803. X -= (5.0 * floatsin(0, degrees));
  2804. Y -= (5.0 * floatcos(0, degrees));
  2805. CreateExplosion(X, Y, Z, 7, 5);
  2806. X -= (3.0 * floatsin(0+45, degrees));
  2807. Y -= (3.0 * floatcos(0+45, degrees));
  2808. CreateExplosion(X, Y, Z, 7, 5);
  2809. X -= (3.0 * floatsin(0-45, degrees));
  2810. Y -= (3.0 * floatcos(0-45, degrees));
  2811. CreateExplosion(X, Y, Z, 7, 5);
  2812. SetTimerEx("MissileExplosion", 700, 0, "fffd", x, y, z, 3);
  2813. break;
  2814. }
  2815. }
  2816.  
  2817. forward MissileExplosion(Float:X, Float:Y, Float:Z, times);
  2818. public MissileExplosion(Float:X, Float:Y, Float:Z, times)
  2819. {
  2820. new Float:x = X;
  2821. new Float:y = Y;
  2822. new Float:z = Z;
  2823. if (times == 3)
  2824. {
  2825. //front
  2826. X += (10.0 * floatsin(0, degrees));
  2827. Y += (10.0 * floatcos(0, degrees));
  2828. CreateExplosion(X, Y, Z, 7, 5);
  2829. X += (6.0 * floatsin(0+45, degrees));
  2830. Y += (6.0 * floatcos(0+45, degrees));
  2831. CreateExplosion(X, Y, Z, 7, 5);
  2832. X += (6.0 * floatsin(0-45, degrees));
  2833. Y += (6.0 * floatcos(0-45, degrees));
  2834. CreateExplosion(X, Y, Z, 7, 5);
  2835. //right-left
  2836. X += (10.0 * floatcos(0, degrees));
  2837. Y += (10.0 * floatsin(0, degrees));
  2838. CreateExplosion(X, Y, Z, 7, 5);
  2839. //back
  2840. X -= (10.0 * floatcos(0, degrees));
  2841. Y -= (10.0 * floatsin(0, degrees));
  2842. CreateExplosion(X, Y, Z, 7, 5);
  2843. X -= (10.0 * floatsin(0, degrees));
  2844. Y -= (10.0 * floatcos(0, degrees));
  2845. CreateExplosion(X, Y, Z, 7, 5);
  2846. X -= (6.0 * floatsin(0+45, degrees));
  2847. Y -= (6.0 * floatcos(0+45, degrees));
  2848. CreateExplosion(X, Y, Z, 7, 5);
  2849. X -= (6.0 * floatsin(0-45, degrees));
  2850. Y -= (6.0 * floatcos(0-45, degrees));
  2851. CreateExplosion(X, Y, Z, 7, 5);
  2852. }
  2853. else if (times == 2)
  2854. {
  2855. //front
  2856. X += (15.0 * floatsin(0, degrees));
  2857. Y += (15.0 * floatcos(0, degrees));
  2858. CreateExplosion(X, Y, Z, 7, 5);
  2859. X += (9.0 * floatsin(0+45, degrees));
  2860. Y += (9.0 * floatcos(0+45, degrees));
  2861. CreateExplosion(X, Y, Z, 7, 5);
  2862. X += (9.0 * floatsin(0-45, degrees));
  2863. Y += (9.0 * floatcos(0-45, degrees));
  2864. CreateExplosion(X, Y, Z, 7, 5);
  2865. //right-left
  2866. X += (15.0 * floatcos(0, degrees));
  2867. Y += (15.0 * floatsin(0, degrees));
  2868. CreateExplosion(X, Y, Z, 7, 5);
  2869. //back
  2870. X -= (15.0 * floatcos(0, degrees));
  2871. Y -= (15.0 * floatsin(0, degrees));
  2872. CreateExplosion(X, Y, Z, 7, 5);
  2873. X -= (15.0 * floatsin(0, degrees));
  2874. Y -= (15.0 * floatcos(0, degrees));
  2875. CreateExplosion(X, Y, Z, 7, 5);
  2876. X -= (9.0 * floatsin(0+45, degrees));
  2877. Y -= (9.0 * floatcos(0+45, degrees));
  2878. CreateExplosion(X, Y, Z, 7, 5);
  2879. X -= (9.0 * floatsin(0-45, degrees));
  2880. Y -= (9.0 * floatcos(0-45, degrees));
  2881. CreateExplosion(X, Y, Z, 7, 5);
  2882. }
  2883. else if (times == 1)
  2884. {
  2885. //front
  2886. X += (20.0 * floatsin(0, degrees));
  2887. Y += (20.0 * floatcos(0, degrees));
  2888. CreateExplosion(X, Y, Z, 7, 5);
  2889. X += (12.0 * floatsin(0+45, degrees));
  2890. Y += (12.0 * floatcos(0+45, degrees));
  2891. CreateExplosion(X, Y, Z, 7, 5);
  2892. X += (12.0 * floatsin(0-45, degrees));
  2893. Y += (12.0 * floatcos(0-45, degrees));
  2894. CreateExplosion(X, Y, Z, 7, 5);
  2895. //right-left
  2896. X += (20.0 * floatcos(0, degrees));
  2897. Y += (20.0 * floatsin(0, degrees));
  2898. CreateExplosion(X, Y, Z, 7, 5);
  2899. //back
  2900. X -= (20.0 * floatcos(0, degrees));
  2901. Y -= (20.0 * floatsin(0, degrees));
  2902. CreateExplosion(X, Y, Z, 7, 5);
  2903. X -= (20.0 * floatsin(0, degrees));
  2904. Y -= (20.0 * floatcos(0, degrees));
  2905. CreateExplosion(X, Y, Z, 7, 5);
  2906. X -= (12.0 * floatsin(0+45, degrees));
  2907. Y -= (12.0 * floatcos(0+45, degrees));
  2908. CreateExplosion(X, Y, Z, 7, 5);
  2909. X -= (12.0 * floatsin(0-45, degrees));
  2910. Y -= (12.0 * floatcos(0-45, degrees));
  2911. CreateExplosion(X, Y, Z, 7, 5);
  2912. }
  2913.  
  2914. if (times > 0) SetTimerEx("MissileExplosion", 700, 0, "fffd", x, y, z, times-1);
  2915. }
  2916.  
  2917. forward PushPlayer(playerid, distance, zup);
  2918. public PushPlayer(playerid, distance, zup)
  2919. {
  2920. new Float:X,Float:Y,Float:Z,Float:A;
  2921. GetPlayerPos(playerid, X, Y, Z);
  2922. GetPlayerFacingAngle(playerid, A);
  2923. if (zup == 1) SetPlayerPos(playerid, X, Y, Z+5);
  2924. GetPlayerPos(playerid, X, Y, Z);
  2925. X -= (2.0 * floatsin(-A, degrees));
  2926. Y -= (2.0 * floatcos(-A, degrees));
  2927. SetPlayerPos(playerid, X, Y, Z);
  2928. if (distance > 0) SetTimerEx("PushPlayer", 100, 0, "ddd", playerid, distance-1, 0);
  2929. }
  2930.  
  2931. stock GetVehicleModelIDFromName(vehname[])
  2932. {
  2933. for(new i = 0; i < 211; i++)
  2934. {
  2935. if (strfind(VehNames[i], vehname, true) != -1) return i + 400;
  2936. }
  2937. return -1;
  2938. }
  2939.  
  2940. stock GetWeaponModelIDFromName(weapname[])
  2941. {
  2942. for(new i = 0; i < 48; i++)
  2943. {
  2944. if (i == 19 || i == 20 || i == 21) continue;
  2945. if (strfind(WeapNames[i], weapname, true) != -1) return i;
  2946. }
  2947. return -1;
  2948. }
  2949.  
  2950. stock bigstrtok(const string[], &idx)
  2951. {
  2952. new length = strlen(string);
  2953. while ((idx < length) && (string[idx] <= ' '))
  2954. {
  2955. idx++;
  2956. }
  2957. new offset = idx;
  2958. new result[128];
  2959. while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  2960. {
  2961. result[idx - offset] = string[idx];
  2962. idx++;
  2963. }
  2964. result[idx - offset] = EOS;
  2965. return result;
  2966. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement