Advertisement
Guest User

Seif

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