Advertisement
Guest User

Untitled

a guest
Apr 3rd, 2020
528
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 54.08 KB | None | 0 0
  1. /*
  2. MeanAdmin filterscript made by:
  3.                                          _________
  4.                  |\              /|     |                  /\       |\      |
  5.                  | \            / |     |                 /  \      | \     |
  6.                  |  \          /  |     |                /    \     |  \    |
  7.                  |   \        /   |     |_________      /______\    |   \   |
  8.                  |    \      /    |     |              /        \   |    \  |
  9.                  |     \   /      |     |             /          \  |     \ |
  10.                  |      \/        |     |_________   /            \ |      \|
  11.                  
  12.                  
  13. Sorry for using the slowest methods, you can also optimize the code if you like
  14. */
  15.  
  16. //Includes
  17. #include <a_samp>
  18. #include <dudb>
  19. #include <streamer>
  20. #include <zcmd>
  21. #include <foreach>
  22. #include <YSI/Y_Ini>
  23.  
  24.  
  25. //Forwards
  26. forward ServerBot();
  27. forward God(playerid);
  28. forward SetPlayerPosTravelTimer(playerid, Float:x, Float:y, Float:z);
  29. forward unfreezetimer(playerid);
  30. forward SaveIn(filename[],text[]);
  31. forward ParsePlayerPass( playerid, name[ ], value[ ] );
  32. forward VehRes(vehicleid);
  33. forward LoadStats(playerid, name[], value[]);
  34.  
  35. public VehRes(vehicleid)
  36. {
  37.     DestroyVehicle(vehicleid);
  38. }
  39.  
  40.  
  41.  
  42. //Defines
  43. //#define dcmd(%1,%2,%3) if (!strcmp((%3)[1], #%1, true, (%2)) && ((((%3)[(%2) + 1] == '\0') && (dcmd_%1(playerid, ""))) || (((%3)[(%2) + 1] == ' ') && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  44. #undef MAX_PLAYERS
  45. #define MAX_PLAYERS 50
  46. /*#define Loop(%1,%2) \
  47.         for(new %1=0; %1<%2; %1++)*/
  48. #define GREY 0xAFAFAFAA
  49. #define GREEN 0x33AA33AA
  50. #define YELLOW 0xFFFF00AA
  51. #define LIGHTBLUE 0x33CCFFAA
  52. #define ORANGE 0xFF9900AA
  53. #define WHITE 0xFFFFFFAA
  54. #define MAX_STRING 255
  55.  
  56.  
  57. #define TRAVEL_TIME 20 // seconds
  58.  
  59. public unfreezetimer(playerid)
  60. {
  61.     TogglePlayerControllable(playerid, 1);
  62.     GameTextForPlayer(playerid, "Objects loaded", 1000, 6);
  63.     return true;
  64. }
  65.  
  66. new VehicleNames[][] =
  67. {
  68.    "Landstalker",
  69.    "Bravura",
  70.    "Buffalo",
  71.    "Linerunner",
  72.    "Pereniel",
  73.    "Sentinel",
  74.    "Dumper",
  75.    "Firetruck",
  76.    "Trashmaster",
  77.    "Stretch",
  78.    "Manana",
  79.    "Infernus",
  80.    "Voodoo",
  81.    "Pony",
  82.    "Mule",
  83.    "Cheetah",
  84.    "Ambulance",
  85.    "Leviathan",
  86.    "Moonbeam",
  87.    "Esperanto",
  88.    "Taxi",
  89.    "Washington",
  90.    "Bobcat",
  91.    "Mr Whoopee",
  92.    "BF Injection",
  93.    "Hunter",
  94.    "Premier",
  95.    "Enforcer",
  96.    "Securicar",
  97.    "Banshee",
  98.    "Predator",
  99.    "Bus",
  100.    "Rhino",
  101.    "Barracks",
  102.    "Hotknife",
  103.    "Trailer",
  104.    "Previon",
  105.    "Coach",
  106.    "Cabbie",
  107.    "Stallion",
  108.    "Rumpo",
  109.    "RC Bandit",
  110.    "Romero",
  111.    "Packer",
  112.    "Monster Truck",
  113.    "Admiral",
  114.    "Squalo",
  115.    "Seasparrow",
  116.    "Pizzaboy",
  117.    "Tram",
  118.    "Trailer",
  119.    "Turismo",
  120.    "Speeder",
  121.    "Reefer",
  122.    "Tropic",
  123.    "Flatbed",
  124.    "Yankee",
  125.    "Caddy",
  126.    "Solair",
  127.    "Berkley's RC Van",
  128.    "Skimmer",
  129.    "PCJ-600",
  130.    "Faggio",
  131.    "Freeway",
  132.    "RC Baron",
  133.    "RC Raider",
  134.    "Glendale",
  135.    "Oceanic",
  136.    "Sanchez",
  137.    "Sparrow",
  138.    "Patriot",
  139.    "Quad",
  140.    "Coastguard",
  141.    "Dinghy",
  142.    "Hermes",
  143.    "Sabre",
  144.    "Rustler",
  145.    "ZR-350",
  146.    "Walton",
  147.    "Regina",
  148.    "Comet",
  149.    "BMX",
  150.    "Burrito",
  151.    "Camper",
  152.    "Marquis",
  153.    "Baggage",
  154.    "Dozer",
  155.    "Maverick",
  156.    "News Chopper",
  157.    "Rancher",
  158.    "FBI Rancher",
  159.    "Virgo",
  160.    "Greenwood",
  161.    "Jetmax",
  162.    "Hotring",
  163.    "Sandking",
  164.    "Blista Compact",
  165.    "Police Maverick",
  166.    "Boxville",
  167.    "Benson",
  168.    "Mesa",
  169.    "RC Goblin",
  170.    "Hotring Racer",
  171.    "Hotring Racer",
  172.    "Bloodring Banger",
  173.    "Rancher",
  174.    "Super GT",
  175.    "Elegant",
  176.    "Journey",
  177.    "Bike",
  178.    "Mountain Bike",
  179.    "Beagle",
  180.    "Cropdust",
  181.    "Stunt",
  182.    "Tanker",
  183.    "RoadTrain",
  184.    "Nebula",
  185.    "Majestic",
  186.    "Buccaneer",
  187.    "Shamal",
  188.    "Hydra",
  189.    "FCR-900",
  190.    "NRG-500",
  191.    "HPV1000",
  192.    "Cement Truck",
  193.    "Tow Truck",
  194.    "Fortune",
  195.    "Cadrona",
  196.    "FBI Truck",
  197.    "Willard",
  198.    "Forklift",
  199.    "Tractor",
  200.    "Combine",
  201.    "Feltzer",
  202.    "Remington",
  203.    "Slamvan",
  204.    "Blade",
  205.    "Freight",
  206.    "Streak",
  207.    "Vortex",
  208.    "Vincent",
  209.    "Bullet",
  210.    "Clover",
  211.    "Sadler",
  212.    "Firetruck",
  213.    "Hustler",
  214.    "Intruder",
  215.    "Primo",
  216.    "Cargobob",
  217.    "Tampa",
  218.    "Sunrise",
  219.    "Merit",
  220.    "Utility",
  221.    "Nevada",
  222.    "Yosemite",
  223.    "Windsor",
  224.    "Monster Truck",
  225.    "Monster Truck",
  226.    "Uranus",
  227.    "Jester",
  228.    "Sultan",
  229.    "Stratum",
  230.    "Elegy",
  231.    "Raindance",
  232.    "RC Tiger",
  233.    "Flash",
  234.    "Tahoma",
  235.    "Savanna",
  236.    "Bandito",
  237.    "Freight",
  238.    "Trailer",
  239.    "Kart",
  240.    "Mower",
  241.    "Duneride",
  242.    "Sweeper",
  243.    "Broadway",
  244.    "Tornado",
  245.    "AT-400",
  246.    "DFT-30",
  247.    "Huntley",
  248.    "Stafford",
  249.    "BF-400",
  250.    "Newsvan",
  251.    "Tug",
  252.    "Trailer",
  253.    "Emperor",
  254.    "Wayfarer",
  255.    "Euros",
  256.    "Hotdog",
  257.    "Club",
  258.    "Trailer",
  259.    "Trailer",
  260.    "Andromada",
  261.    "Dodo",
  262.    "RC Cam",
  263.    "Launch",
  264.    "Police Car (LSPD)",
  265.    "Police Car (SFPD)",
  266.    "Police Car (LVPD)",
  267.    "Police Ranger",
  268.    "Picador",
  269.    "S.W.A.T. Van",
  270.    "Alpha",
  271.    "Phoenix",
  272.    "Glendale",
  273.    "Sadler",
  274.    "Luggage Trailer",
  275.    "Luggage Trailer",
  276.    "Stair Trailer",
  277.    "Boxville",
  278.    "Farm Plow",
  279.    "Utility Trailer"
  280. };
  281.  
  282. public ParsePlayerPass( playerid, name[ ], value[ ] )
  283. {
  284.     if ( !strcmp( name, "Password" ) )
  285.     {
  286.         SetPVarString( playerid, "pPass", value );
  287.     }
  288. }
  289.  
  290. public SaveIn(filename[],text[])
  291. {
  292.     new File:Lfile;
  293.     new filepath[256];
  294.     new string[256];
  295.     new year,month,day;
  296.     new hour,minute,second;
  297.  
  298.     getdate(year,month,day);
  299.     gettime(hour,minute,second);
  300.     format(filepath,sizeof(filepath),"mAdmin/Logs/%s.txt",filename);
  301.     Lfile = fopen(filepath,io_append);
  302.     format(string,sizeof(string),"[%02d/%02d/%02d | %02d:%02d:%02d] %s\r\n",day,month,year,hour,minute,second,text);
  303.     fwrite(Lfile,string);
  304.     fclose(Lfile);
  305.     return 1;
  306. }
  307.  
  308. public SetPlayerPosTravelTimer(playerid, Float:x, Float:y, Float:z)
  309. {
  310.     TogglePlayerControllable(playerid, false);
  311.     GameTextForPlayer(playerid, "Loading ~r~objects", 3000, 6);
  312.     SetTimerEx("unfreezetimer",3000,0,"d",playerid);
  313.     SetPlayerInterior(playerid, 0);
  314.     SetPlayerPos(playerid, x, y, z);
  315.     GameTextForPlayer(playerid, "Traveling over", 3000, 1);
  316.     return true;
  317. }
  318.  
  319. stock SetPlayerPosTravel(playerid, Float:x, Float:y, Float:z)
  320. {
  321.     TogglePlayerControllable(playerid, false);
  322.     GameTextForPlayer(playerid, "Traveling", 3000, 1);
  323.     SetPlayerInterior(playerid, 1);
  324.     SetPlayerPos(playerid, 1.7313,27.1232,1199.5938);
  325.     SetTimerEx("SetPlayerPosTravelTimer", TRAVEL_TIME*1000, 0, "ifff", playerid, x, y, z);
  326.     return 1;
  327. }
  328.  
  329. public OnFilterScriptInit()
  330. {
  331.     SetTimer("ServerBot", 15*1000, 1);
  332.     CreateDynamicObject(9931, 369.681640625, 2339.9267578125, 1904.9915771484, 0, 0, 0);
  333.     CreateDynamicObject(9931, 369.7060546875, 2308.431640625, 1904.9920654297, 0, 0, 0);
  334.     CreateDynamicObject(6959, 380.3193359375, 2327.4951171875, 1888.5981445313, 0, 0, 0);
  335.     CreateDynamicObject(6959, 378.1806640625, 2333.775390625, 1897.5466308594, 296.47705078125, 0, 0);
  336.     CreateDynamicObject(6959, 378.0703125, 2314.8393554688, 1897.5084228516, 63.740020751953, 0, 0);
  337.     CreateDynamicObject(6959, 363.0498046875, 2326.4736328125, 1902.5007324219, 0, 270.18676757813, 0);
  338.     CreateDynamicObject(9931, 409.28952026367, 2325.361328125, 1903.9514160156, 0, 0, 182.88500976563);
  339.     CreateDynamicObject(6959, 349.35693359375, 2328.1083984375, 1889.6359863281, 0, 0, 0);
  340.     CreateDynamicObject(14394, 370.83624267578, 2320.2700195313, 1888.7946777344, 0, 0, 179.43994140625);
  341.     CreateDynamicObject(14394, 370.92697143555, 2328.2631835938, 1888.7946777344, 0, 0, 179.43969726563);
  342.     CreateDynamicObject(3657, 373.32641601563, 2328.6003417969, 1889.0850830078, 0, 0, 269.96997070313);
  343.     CreateDynamicObject(3657, 375.27359008789, 2328.5871582031, 1889.0850830078, 0, 0, 269.96704101563);
  344.     CreateDynamicObject(3657, 377.10638427734, 2328.55078125, 1889.0850830078, 0, 0, 269.96704101563);
  345.     CreateDynamicObject(3657, 379.10192871094, 2328.5529785156, 1889.0850830078, 0, 0, 269.96704101563);
  346.     CreateDynamicObject(3657, 381.24136352539, 2328.552734375, 1889.0850830078, 0, 0, 269.96704101563);
  347.     CreateDynamicObject(3657, 383.30206298828, 2328.5458984375, 1889.0850830078, 0, 0, 269.96704101563);
  348.     CreateDynamicObject(3657, 373.34204101563, 2320.0771484375, 1889.0850830078, 0, 0, 269.96154785156);
  349.     CreateDynamicObject(3657, 375.22265625, 2320.0434570313, 1889.0850830078, 0, 0, 269.96154785156);
  350.     CreateDynamicObject(3657, 377.12313842773, 2320.0419921875, 1889.0850830078, 0, 0, 269.96154785156);
  351.     CreateDynamicObject(3657, 379.14074707031, 2320.0615234375, 1889.0850830078, 0, 0, 269.96154785156);
  352.     CreateDynamicObject(3657, 381.31060791016, 2320.05859375, 1889.0850830078, 0, 0, 269.96154785156);
  353.     CreateDynamicObject(3657, 383.32202148438, 2320.029296875, 1889.0850830078, 0, 0, 269.96154785156);
  354.     CreateDynamicObject(8131, 359.04635620117, 2324.1560058594, 1890.9467773438, 334.75, 0, 270.44000244141);
  355.     CreateDynamicObject(14705, 367.74389648438, 2322.6496582031, 1890.7045898438, 0, 0, 0);
  356.     CreateDynamicObject(2208, 367.70974731445, 2325.3110351563, 1889.6047363281, 0, 0, 269.95498657227);
  357.     CreateDynamicObject(2868, 367.74664306641, 2325.3173828125, 1890.4699707031, 0, 0, 0);
  358.     CreateDynamicObject(2894, 367.60568237305, 2324.0219726563, 1890.4699707031, 0, 0, 269.39514160156);
  359.     CreateDynamicObject(2869, 368.66561889648, 2331.6791992188, 1889.6047363281, 0, 0, 320.9599609375);
  360.     CreateDynamicObject(2869, 365.07345581055, 2331.7023925781, 1889.6047363281, 0, 0, 322.20654296875);
  361.     CreateDynamicObject(2869, 365.21087646484, 2316.7504882813, 1889.6047363281, 0, 0, 320.95458984375);
  362.     CreateDynamicObject(2869, 368.77743530273, 2316.8020019531, 1889.6047363281, 0, 0, 320.95458984375);
  363.     CreateDynamicObject(2896, 367.05938720703, 2318.2067871094, 1890.2440185547, 0, 0, 0);
  364.     CreateDynamicObject(1664, 367.76473999023, 2323.0808105469, 1890.63671875, 0, 0, 0);
  365.     CreateDynamicObject(1667, 367.53042602539, 2323.2294921875, 1890.55859375, 0, 0, 0);
  366.     CreateDynamicObject(2869, 375.79760742188, 2316.7111816406, 1888.5668945313, 0, 0, 320.95458984375);
  367.     CreateDynamicObject(2869, 382.89117431641, 2316.5712890625, 1888.5668945313, 0, 0, 320.95458984375);
  368.     CreateDynamicObject(2869, 375.69821166992, 2331.720703125, 1888.5668945313, 0, 0, 320.95458984375);
  369.     CreateDynamicObject(2869, 382.8698425293, 2331.7434082031, 1888.5668945313, 0, 0, 320.95458984375);
  370.     CreateDynamicObject(6959, 375.40222167969, 2326.0595703125, 1915.3721923828, 0, 0, 0);
  371.     CreateDynamicObject(6959, 387.21533203125, 2323.322265625, 1924.6811523438, 0, 269.68676757813, 2.75);
  372.     CreateDynamicObject(3462, 364.39996337891, 2328.1259765625, 1890.3927001953, 0, 0, 179.65002441406);
  373.     CreateDynamicObject(3462, 364.37484741211, 2320.1662597656, 1890.3676757813, 0, 0, 180.3984375);
  374.     return 1;
  375. }
  376.  
  377. new MAX_PING = 1000;
  378.  
  379. enum gPInfo
  380. {
  381.     Logged,
  382.     Regged,
  383.     Level,
  384.     Muted,
  385.     Kills,
  386.     Deaths,
  387.     AdminDuty,
  388.     Spectate,
  389.     Jail,
  390.     Vehicle,
  391.     Cash,
  392.     Score,
  393.     Kills1,
  394.     Deaths1,
  395.     Level1
  396. };
  397. new PInfo[MAX_PLAYERS][gPInfo];
  398.  
  399. new Text3D:label[MAX_PLAYERS];
  400.  
  401. new Godtimer;
  402.  
  403. public LoadStats(playerid, name[], value[])
  404. {
  405.     if(!strcmp(name, "Cash"))
  406.         PInfo[playerid][Cash] = strval(value);
  407.     if(!strcmp(name, "Score"))
  408.         PInfo[playerid][Score] = strval(value);
  409.     if(!strcmp(name, "Level"))
  410.         PInfo[playerid][Level1] = strval(value);
  411.     if(!strcmp(name, "Kills"))
  412.         PInfo[playerid][Kills1] = strval(value);
  413.     if(!strcmp(name, "Deaths"))
  414.         PInfo[playerid][Deaths1] = strval(value);
  415.     if(!strcmp(name, "Password"))
  416.     {
  417.         SetPVarString(playerid, "pPass", value);
  418.     }
  419.     return 1;
  420. }
  421.  
  422. stock IsValidSkin(SkinID)
  423. {
  424.     if((SkinID == 0)||(SkinID == 7)||(SkinID >= 9 && SkinID <= 41)||(SkinID >= 43 && SkinID <= 64)||(SkinID >= 66 && SkinID <= 73)||(SkinID >= 75 && SkinID <= 85)||(SkinID >= 87 && SkinID <= 118)||(SkinID >= 120 && SkinID <= 148)||(SkinID >= 150 && SkinID <= 207)||(SkinID >= 209 && SkinID <= 264)||(SkinID >= 274 && SkinID <= 288)||(SkinID >= 290 && SkinID <= 299)) return true;
  425.     else return false;
  426. }
  427.  
  428. stock IsNumeric(string[])
  429. {
  430.     for (new i = 0, j = strlen(string);
  431.     i < j; i++)
  432.     {
  433.     if (string[i] > '9' || string[i] < '0')
  434.     return 0;
  435.     }
  436.     return 1;
  437. }
  438.  
  439. stock EraseVeh(vehicleid)
  440. {
  441.     for(new i=0;i<MAX_PLAYERS;i++)
  442.     {
  443.         new Float:X,Float:Y,Float:Z;
  444.         if(IsPlayerInVehicle(i, vehicleid))
  445.         {
  446.             RemovePlayerFromVehicle(i);
  447.             GetPlayerPos(i,X,Y,Z);
  448.             SetPlayerPos(i,X,Y+3,Z);
  449.         }
  450.         SetVehicleParamsForPlayer(vehicleid,i,0,1);
  451.     }
  452.     SetTimerEx("VehRes",1500,0,"i",vehicleid);
  453. }
  454.  
  455.  
  456.  
  457.  
  458. stock SetAllHealth(Float:health)
  459. {
  460.     foreach(Player, i)
  461.     {
  462.         if(IsPlayerConnected(i))
  463.         {
  464.             SetPlayerHealth(i, health);
  465.         }
  466.     }
  467.     return 1;
  468. }
  469.  
  470. /*INI:PlayerStats(name[], value[])
  471. {
  472.     if(!strcmp(name, "Cash"))
  473.     {
  474.         ResetPlayerMoney(playerid);
  475.         GivePlayerMoney(playerid, value);
  476.     }
  477.     if(!strcmp(name, "Score"))
  478.     {
  479.         SetPlayerScore(playerid, value);
  480.     }
  481.     if(!strcmp(name, "Level"))
  482.     {
  483.         PInfo[playerid][Level] = value;
  484.     }
  485.     if(!strcmp(name, "Kills"))
  486.     {
  487.         PInfo[playerid][Kills] = value;
  488.     }
  489.     if(!strcmp(name, "Deaths"))
  490.     {
  491.         PInfo[playerid][Deaths] = value;
  492.     }
  493. }*/
  494.  
  495.  
  496. stock SetAllArmor(Float:armor)
  497. {
  498.     foreach(Player, i)
  499.     {
  500.         if(IsPlayerConnected(i))
  501.         {
  502.             SetPlayerArmour(i, armor);
  503.         }
  504.     }
  505.     return 1;
  506. }
  507.  
  508. stock GivePlayerScore(playerid, score)
  509. {
  510.     SetPlayerScore(playerid, GetPlayerScore(playerid) + (score) );
  511.     return 1;
  512. }
  513.  
  514.  
  515. GetVehicleModelIDFromName(vname[])
  516. {
  517.     for(new i = 0; i < 211; i++)
  518.     {
  519.     if ( strfind(VehicleNames[i], vname, true) != -1 )
  520.     return i + 400;
  521.     }
  522.     return -1;
  523. }
  524.  
  525.  
  526. stock AdminCommand(playerid,command[])
  527. {
  528.  
  529.     new string[128];
  530.     GetPlayerName(playerid,string,128);
  531.     format(string,sizeof(string),"[ADMIN] %s || Level: %d || Command used: %s", string, PInfo[playerid][Level], command);
  532.     foreach(Player, i)
  533.     {
  534.         if(PInfo[i][Level] >= 1)
  535.         {
  536.             SendClientMessage(i, WHITE, string);
  537.         }
  538.     }
  539. }
  540.  
  541. stock PlayerName(playerid)
  542. {
  543.     new name[MAX_PLAYER_NAME];
  544.     GetPlayerName(playerid, name, sizeof(name));
  545.     return name;
  546. }
  547.  
  548. //Other
  549. #pragma unused ret_memcpy
  550.  
  551.  
  552. public OnPlayerConnect(playerid)
  553. {
  554.     PInfo[playerid][Logged] = 0;
  555.     PInfo[playerid][Regged] = 0;
  556.     PInfo[playerid][Level] = 0;
  557.     PInfo[playerid][Jail] = 0;
  558.     PInfo[playerid][Kills] = 0;
  559.     PInfo[playerid][Deaths] = 0;
  560.     PInfo[playerid][AdminDuty] = 0;
  561.     PInfo[playerid][Muted] = 0;
  562.     new n[MAX_PLAYER_NAME], file[256];
  563.     GetPlayerName(playerid,n,sizeof(n));
  564.     format(file,sizeof(file),"mAdmin/Users/%s.ini",n);
  565.     if(fexist(file))
  566.     {
  567.         SendClientMessage(playerid,LIGHTBLUE,"You are registered, Please /login!");
  568.         PInfo[playerid][Regged] = 1;
  569.         PInfo[playerid][Logged] = 0;
  570.         return 1;
  571.     }
  572.     if(!fexist(file))
  573.     {
  574.         SendClientMessage(playerid,LIGHTBLUE,"You are not register, Please /register!");
  575.         PInfo[playerid][Regged] = 0;
  576.         PInfo[playerid][Logged] = 0;
  577.         return 1;
  578.     }
  579.     return 1;
  580. }
  581.  
  582. public OnPlayerDisconnect(playerid, reason)
  583. {
  584.     new n[MAX_PLAYER_NAME], file[256];
  585.     GetPlayerName(playerid,n,sizeof(n));
  586.     format(file,sizeof(file),"mAdmin/Users/%s.ini",n);
  587.     PInfo[playerid][Logged] = 0;
  588.     new INI:PlayerAcc = INI_Open(file);
  589.     switch(reason)
  590.     {
  591.         case 0:
  592.         {
  593.             if(fexist(file))
  594.             {
  595.                 INI_WriteInt(PlayerAcc,"Score",GetPlayerScore(playerid));
  596.                 INI_WriteInt(PlayerAcc,"Cash",GetPlayerMoney(playerid));
  597.                 INI_WriteInt(PlayerAcc,"Logged",0);
  598.                 INI_WriteInt(PlayerAcc,"Deaths",PInfo[playerid][Deaths]);
  599.                 INI_WriteInt(PlayerAcc,"Kills",PInfo[playerid][Kills]);
  600.                 return 1;
  601.             }
  602.         }
  603.         case 1:
  604.         {
  605.             if(fexist(file))
  606.             {
  607.                 INI_WriteInt(PlayerAcc,"Score",GetPlayerScore(playerid));
  608.                 INI_WriteInt(PlayerAcc,"Cash",GetPlayerMoney(playerid));
  609.                 INI_WriteInt(PlayerAcc,"Logged",0);
  610.                 INI_WriteInt(PlayerAcc,"Deaths",PInfo[playerid][Deaths]);
  611.                 INI_WriteInt(PlayerAcc,"Kills",PInfo[playerid][Kills]);
  612.                 return 1;
  613.             }
  614.         }
  615.         case 2:
  616.         {
  617.             if(fexist(file))
  618.             {
  619.                 INI_WriteInt(PlayerAcc,"Score",GetPlayerScore(playerid));
  620.                 INI_WriteInt(PlayerAcc,"Cash",GetPlayerMoney(playerid));
  621.                 INI_WriteInt(PlayerAcc,"Logged",0);
  622.                 INI_WriteInt(PlayerAcc,"Deaths",PInfo[playerid][Deaths]);
  623.                 INI_WriteInt(PlayerAcc,"Kills",PInfo[playerid][Kills]);
  624.                 return 1;
  625.             }
  626.         }
  627.     }
  628.     INI_Close(PlayerAcc);
  629.     Delete3DTextLabel(label[playerid]);
  630.     return 1;
  631. }
  632.  
  633. /*public OnPlayerCommandText(playerid, cmdtext[])
  634. {
  635.     new cmd[256], idx;
  636.     cmd = strtok(cmdtext, idx);
  637.     dcmd(register,8,cmdtext);
  638.     dcmd(login,5,cmdtext);
  639.     dcmd(setlevel,8,cmdtext);
  640.     dcmd(kick,4,cmdtext);
  641.     dcmd(ban,3,cmdtext);
  642.     dcmd(mute,4,cmdtext);
  643.     dcmd(looptest,8,cmdtext);
  644.     dcmd(healall,7,cmdtext);
  645.     dcmd(armorall,8,cmdtext);
  646.     dcmd(setscore,8,cmdtext);
  647.     dcmd(setmoney,8,cmdtext);
  648.     dcmd(richestplayers,14,cmdtext);
  649.     dcmd(stats,5,cmdtext);
  650.     dcmd(admins,6,cmdtext);
  651.     dcmd(get,3,cmdtext);
  652.     dcmd(goto,4,cmdtext);
  653.     dcmd(explode,7,cmdtext);
  654.     dcmd(slap,4,cmdtext);
  655.     dcmd(givescore,9,cmdtext);
  656.     dcmd(setskin,7,cmdtext);
  657.     dcmd(report,6,cmdtext);
  658.     dcmd(adminduty,9,cmdtext);
  659.     dcmd(kill,4,cmdtext);
  660.     dcmd(asay,4,cmdtext);
  661.     dcmd(spec,4,cmdtext);
  662.     dcmd(endspec,7,cmdtext);
  663.     dcmd(adminarea,9,cmdtext);
  664.     dcmd(jail,4,cmdtext);
  665.     dcmd(unjail,6,cmdtext);
  666.     dcmd(spawn,5,cmdtext);
  667.     dcmd(gmx,3,cmdtext);
  668.     dcmd(ahelp,5,cmdtext);
  669.     return 0;
  670. }*/
  671.  
  672. CMD:register(playerid, params[])
  673. {
  674.     new file[256],n[MAX_PLAYER_NAME];
  675.     GetPlayerName(playerid,n,MAX_PLAYER_NAME);
  676.     format(file,sizeof(file),"mAdmin/Users/%s.ini",n);
  677.     if(fexist(file))
  678.         return SendClientMessage(playerid,YELLOW,"You are already registered!");
  679.     if(PInfo[playerid][Regged] == 1)
  680.         return SendClientMessage(playerid,LIGHTBLUE,"You are already registered!");
  681.     if(PInfo[playerid][Logged] == 1)
  682.         return SendClientMessage(playerid,ORANGE,"You are already registered, and logged in!");
  683.     new INI:PlayerAcc = INI_Open(file);
  684.     if(!isnull(params))
  685.     {
  686.         if(!fexist(file))
  687.         {
  688.             INI_WriteString(PlayerAcc,"Password",params);
  689.             INI_WriteInt(PlayerAcc,"Regged",1);
  690.             INI_WriteInt(PlayerAcc,"Logged",0);
  691.             INI_WriteInt(PlayerAcc,"Level",0);
  692.             INI_WriteInt(PlayerAcc,"Score",GetPlayerScore(playerid));
  693.             INI_WriteInt(PlayerAcc,"Cash",GetPlayerMoney(playerid));
  694.             INI_WriteInt(PlayerAcc,"Deaths",0);
  695.             INI_WriteInt(PlayerAcc,"Kills",0);
  696.             INI_Close(PlayerAcc);
  697.             SendClientMessage(playerid,ORANGE,"You have just registered, Please use /login [password] to login!");
  698.             PInfo[playerid][Regged] = 1;
  699.             return 1;
  700.         }
  701.     }
  702.     else
  703.     {
  704.         SendClientMessage(playerid,GREY,"USAGE: /register <Password>");
  705.         return 1;
  706.     }
  707.     return 1;
  708. }
  709.  
  710. /*
  711.     if(!strcmp(name, "Cash"))
  712.         PInfo[playerid][Cash] = strval(value);
  713.     if(!strcmp(name, "Score"))
  714.         PInfo[playerid][Score] = strval(value);
  715.     if(!strcmp(name, "Level"))
  716.         PInfo[playerid][Level] = strval(value);
  717.     if(!strcmp(name, "Kills"))
  718.         PInfo[playerid][Kills] = strval(value);
  719.     if(!strcmp(name, "Deaths"))
  720.         PInfo[playerid][Deaths] = strval(value);*/
  721.  
  722. CMD:login(playerid,params[])
  723. {
  724.     new file[256],n[MAX_PLAYER_NAME];
  725.     GetPlayerName(playerid,n,MAX_PLAYER_NAME);
  726.     format(file,sizeof(file),"mAdmin/Users/%s.ini",n);
  727.     if(!fexist(file))
  728.         return SendClientMessage(playerid,YELLOW,"You are not registered! Please /register");
  729.     if(PInfo[playerid][Logged] == 1)
  730.         return SendClientMessage(playerid,LIGHTBLUE,"You are already logged in!");
  731.     if(PInfo[playerid][Regged] == 0)
  732.         return SendClientMessage(playerid,ORANGE,"You are not registered! Please /register");
  733.     if(!isnull(params))
  734.     {
  735.         new pass[256];
  736.         if(fexist(file))
  737.         {
  738.             INI_ParseFile(file, "LoadStats", false, true, playerid, true, false);
  739.             GetPVarString(playerid, "pPass", pass, sizeof(pass));
  740.             if(!strcmp(params, pass, false))
  741.             {
  742.                 SetPlayerScore(playerid, PInfo[playerid][Score]);
  743.                 ResetPlayerMoney(playerid);
  744.                 SetPlayerMoney(playerid, PInfo[playerid][Cash]);
  745.                 PInfo[playerid][Level] = PInfo[playerid][Level1];
  746.                 PInfo[playerid][Kills] = PInfo[playerid][Kills1];
  747.                 PInfo[playerid][Deaths] = PInfo[playerid][Deaths1];
  748.                
  749.                 new INI:PlayerAcc = INI_Open(file);
  750.                 INI_WriteInt(PlayerAcc,"Logged",1);
  751.                 INI_Close(PlayerAcc);
  752.                 PInfo[playerid][Logged] = 1;
  753.  
  754.                 if(PInfo[playerid][Level] == 0) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Normal player");
  755.                 if(PInfo[playerid][Level] == 1) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 1 admin (Test admin)");
  756.                 if(PInfo[playerid][Level] == 2) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 2 admin (Standard admin)");
  757.                 if(PInfo[playerid][Level] == 3) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 3 admin (Pro admin)");
  758.                 if(PInfo[playerid][Level] == 4) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 4 admin (Leading admin)");
  759.                 if(PInfo[playerid][Level] == 5) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 5 admin (Head admin)");
  760.                 if(PInfo[playerid][Level] > 5) SendClientMessage(playerid,YELLOW,"You have now logged in! Status: Level 5+ admin (Master admin)");
  761.                
  762.             }
  763.             else
  764.             {
  765.                 SendClientMessage(playerid,YELLOW,"Wrong Password!");
  766.             }
  767.         }
  768.     }
  769.     else
  770.     {
  771.         SendClientMessage(playerid,GREY,"USAGE: /login <Password>");
  772.     }
  773.     return 1;
  774. }
  775.  
  776. CMD:setlevel(playerid,params[])
  777. {
  778.     new level,id,file[256],n[MAX_PLAYER_NAME];//creating the new variabls
  779.     new tmp[MAX_STRING], tmp2[MAX_STRING], Index,str[51];// creating the new variables
  780.     tmp = strtok(params,Index), tmp2 = strtok(params,Index),id = strval(tmp),level = strval(tmp2);// setting them to strtok so we can use them as parameters of our command
  781.     GetPlayerName(id,n,MAX_PLAYER_NAME);//getting the players name
  782.     format(file,sizeof(file),"mAdmin/Users/%s.ini",n);//formatting the file
  783.     if(IsPlayerAdmin(playerid) || PInfo[playerid][Level] >= 5)
  784.     {
  785.         if(isnull(params))
  786.             return SendClientMessage(playerid,GREY,"USAGE: /setlevel <ID> <Level>");// if the string is empty
  787.         if(!IsPlayerConnected(id))
  788.             return SendClientMessage(playerid,GREY,"You have entered an incorrect ID"); //if the id is not connected
  789.         PInfo[id][Level] = level;//sets the level of the player
  790.         new INI:PlayerAcc = INI_Open(file);
  791.         INI_WriteInt(PlayerAcc,"Level",level);
  792.         INI_Close(PlayerAcc);
  793.         format(str,sizeof(str),"You have set %s's level to %d",n,level);//creates the string
  794.         return SendClientMessage(playerid,LIGHTBLUE,str);
  795.     }
  796.     else return SendClientMessage(playerid,GREY,"You need to be RCON admin or level 5+!");
  797. }
  798.  
  799. CMD:kick(playerid,params[])
  800. {
  801.     new id,n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
  802.     new tmp[MAX_STRING], tmp2[MAX_STRING], Index, str[128];
  803.     tmp = strtok(params,Index);
  804.     tmp2 = strtok(params,Index);
  805.     id = strval(tmp);
  806.     GetPlayerName(id,on,sizeof(on));
  807.     GetPlayerName(playerid,n,sizeof(n));
  808.     if(PInfo[playerid][Level] < 1)
  809.         return SendClientMessage(playerid,ORANGE,"You need to be level 1 to use this command!");
  810.     if(isnull(tmp))
  811.         return SendClientMessage(playerid,GREY,"USAGE: /kick <ID> <Reason> ");
  812.     if(isnull(tmp2))
  813.     {
  814.         format(str,sizeof(str),"Administrator %s has kicked %s || Reason: Not given",n,on);
  815.         return SendClientMessageToAll(YELLOW, str);
  816.     }
  817.     if(!IsPlayerConnected(id))
  818.         return SendClientMessage(playerid,GREY,"Invalid ID");
  819.     format(str,sizeof(str),"Administrator %s has kicked %s || Reason: %s",n,on,params[strlen(tmp)+1]);
  820.     SendClientMessageToAll(YELLOW, str);
  821.     Kick(id);
  822.     return 1;
  823. }
  824.  
  825. CMD:ban(playerid,params[])
  826. {
  827.     new id, n[MAX_PLAYER_NAME],on[MAX_PLAYER_NAME];
  828.     new tmp[MAX_STRING], tmp2[MAX_STRING], Index, str[128];
  829.     tmp = strtok(params,Index), id = strval(tmp);
  830.     tmp2 = strtok(params, Index);
  831.     GetPlayerName(id,on,sizeof(on));
  832.     GetPlayerName(playerid,n,sizeof(n));
  833.     if(PInfo[playerid][Level] < 3)
  834.         return SendClientMessage(playerid,ORANGE,"You need to be level 3 to use this command!");
  835.     if(isnull(params))
  836.         return SendClientMessage(playerid,GREY,"USAGE: /ban <ID> <Reason> ");
  837.     if(!IsPlayerConnected(id))
  838.         return SendClientMessage(playerid,GREY,"Invalid ID");
  839.     if(isnull(tmp2))
  840.     {
  841.         format(str,sizeof(str),"Administrator %s has banned %s || Reason: Not given",n,on);
  842.         return SendClientMessageToAll(YELLOW, str);
  843.     }
  844.     format(str,sizeof(str),"Administrator %s has banned %s || Reason: %s",n,on,params[strlen(tmp)+1]);
  845.     SaveIn("BanLog", str);
  846.     SendClientMessageToAll(ORANGE,str);
  847.     BanEx(id, params[strlen(tmp)+1]);
  848.     return 1;
  849. }
  850.  
  851. CMD:mute(playerid, params[])
  852. {
  853.     if(PInfo[playerid][Level] < 2)
  854.         return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
  855.     new tmp[MAX_STRING], Index, id;
  856.     tmp = strtok(params, Index);
  857.     id = strval(tmp);
  858.     if(isnull(tmp))
  859.         return SendClientMessage(playerid,GREY,"USAGE: /mute <ID>");
  860.     if(!IsPlayerConnected(id))
  861.         return SendClientMessage(playerid,GREY,"Invalid ID");
  862.     new string[65];
  863.     new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
  864.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  865.     GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
  866.     if(PInfo[id][Muted] == 1)
  867.     {
  868.         PInfo[id][Muted] = 0;
  869.         format(string, 65, "You have unmuted %s", pName);
  870.         SendClientMessage(playerid, YELLOW, string);
  871.         format(string, 65, "You have been unmuted by administrator %s", aName);
  872.         SendClientMessage(id, YELLOW, string);
  873.     }
  874.     else
  875.     {
  876.         PInfo[id][Muted] = 1;
  877.         format(string, 65, "You have muted %s", pName);
  878.         SendClientMessage(playerid, YELLOW, string);
  879.         format(string, 65, "You have been muted by administrator %s", aName);
  880.         SendClientMessage(id, YELLOW, string);
  881.     }
  882.     return 1;
  883. }
  884.  
  885. CMD:looptest(playerid, params[])
  886. {
  887.     #pragma unused params
  888.     if(IsPlayerAdmin(playerid))
  889.     {
  890.         foreach(Player, i) // Loop through your defined MAX_PLAYERS ^^
  891.         {
  892.             if(IsPlayerConnected(i))
  893.             {
  894.                 SendClientMessage(i, YELLOW, "Looping");
  895.                 return Kick(i);
  896.             }
  897.         }
  898.     }
  899.     else return 0;
  900.     return 1;
  901. }
  902.  
  903. CMD:healall(playerid, params[])
  904. {
  905.     #pragma unused params
  906.     if(PInfo[playerid][Level] < 4)
  907.         return SendClientMessage(playerid, ORANGE, "You need to be level 4+ to use this command");
  908.     new string[71];
  909.     GetPlayerName(playerid, string, 128);
  910.     format(string, 71, "Administrator %s has restored everyone's health!", string);
  911.     SendClientMessageToAll(YELLOW, string);
  912.     SetAllHealth(100.0);
  913.     AdminCommand(playerid, "HEALALL");
  914.     return 1;
  915. }
  916.  
  917. CMD:armorall(playerid, params[])
  918. {
  919.     #pragma unused params
  920.     if(PInfo[playerid][Level] < 4)
  921.         return SendClientMessage(playerid, ORANGE, "You need to be level 4+ to use this command");
  922.     new string[71];
  923.     GetPlayerName(playerid, string, 128);
  924.     format(string, 71, "Administrator %s has restored everyone's armor!", string);
  925.     SendClientMessageToAll(YELLOW, string);
  926.     SetAllArmor(100.0);
  927.     AdminCommand(playerid, "ARMORALL");
  928.     return 1;
  929. }
  930.  
  931. CMD:setscore(playerid, params[])
  932. {
  933.     if(PInfo[playerid][Level] < 4)
  934.         return SendClientMessage(playerid, ORANGE, "You need to be level 4+ to use this command");
  935.     new tmp[MAX_STRING], tmp2[MAX_STRING];
  936.     new Index;
  937.     tmp = strtok(params, Index);
  938.     tmp2 = strtok(params, Index);
  939.     new id = strval(tmp);
  940.     new score = strval(tmp2);
  941.     if(isnull(tmp))
  942.         return SendClientMessage(playerid,GREY,"USAGE: /setscore <ID> <Score> ");
  943.     if(isnull(tmp2))
  944.         return SendClientMessage(playerid,GREY,"USAGE: /setscore <ID> <Score> ");
  945.     if(!IsPlayerConnected(id))
  946.         return SendClientMessage(playerid,GREY,"Invalid ID");
  947.     new string[72];
  948.     new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
  949.     GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
  950.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  951.     format(string, 72, "Administrator %s has set your score to %d", aName, score);
  952.     SendClientMessage(id, YELLOW, string);
  953.     format(string, 72, "You have set %s's score to %d", pName, score);
  954.     SendClientMessage(playerid, YELLOW, string);
  955.     SetPlayerScore(id, score);
  956.     AdminCommand(playerid, "SETSCORE");
  957.     return 1;
  958. }
  959.  
  960. CMD:setmoney(playerid, params[])
  961. {
  962.     if(PInfo[playerid][Level] < 2)
  963.         return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
  964.     new tmp[MAX_STRING], tmp2[MAX_STRING];
  965.     new Index;
  966.     tmp = strtok(params, Index);
  967.     tmp2 = strtok(params, Index);
  968.     new id = strval(tmp);
  969.     new money = strval(tmp2);
  970.     if(isnull(tmp))
  971.         return SendClientMessage(playerid,GREY,"USAGE: /setmoney <ID> <Money> ");
  972.     if(isnull(tmp2))
  973.         return SendClientMessage(playerid,GREY,"USAGE: /setmoney <ID> <Money> ");
  974.     if(!IsPlayerConnected(id))
  975.         return SendClientMessage(playerid,GREY,"Invalid ID");
  976.     new string[72];
  977.     new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
  978.     GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
  979.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  980.     format(string, 72, "Administrator %s has set your money to $%d", aName, money);
  981.     SendClientMessage(id, YELLOW, string);
  982.     format(string, 72, "You have set %s's money to $%d", pName, money);
  983.     SendClientMessage(playerid, YELLOW, string);
  984.     SetPlayerMoney(id, money);
  985.     AdminCommand(playerid, "SETMONEY");
  986.     return 1;
  987. }
  988.  
  989. CMD:richestplayers(playerid, params[])
  990. {
  991.     #pragma unused params
  992.     new string[71], Slot1 = -1, Slot2 = -1, Slot3 = -1, Slot4 = -1;
  993.     new HighestCash = -9999;
  994.     SendClientMessage(playerid,GREEN,"Richest Players Online:");
  995.  
  996.     for(new x=0; x<MAX_PLAYERS; x++)
  997.     if(IsPlayerConnected(x))
  998.     if(GetPlayerMoney(x) >= HighestCash)
  999.     {
  1000.         HighestCash = GetPlayerMoney(x);
  1001.         Slot1 = x;
  1002.     }
  1003.     HighestCash = -9999;
  1004.     for(new x=0; x<MAX_PLAYERS; x++)
  1005.     if(IsPlayerConnected(x) && x != Slot1)
  1006.     if(GetPlayerMoney(x) >= HighestCash)
  1007.     {
  1008.         HighestCash = GetPlayerMoney(x);
  1009.         Slot2 = x;
  1010.     }
  1011.     HighestCash = -9999;
  1012.     for(new x=0; x<MAX_PLAYERS; x++)
  1013.     if(IsPlayerConnected(x) && x != Slot1 && x != Slot2)
  1014.     if(GetPlayerMoney(x) >= HighestCash)
  1015.     {
  1016.         HighestCash = GetPlayerMoney(x);
  1017.         Slot3 = x;
  1018.     }
  1019.     HighestCash = -9999;
  1020.     for(new x=0; x<MAX_PLAYERS; x++)
  1021.     if(IsPlayerConnected(x) && x != Slot1 && x != Slot2 && x != Slot3)
  1022.     if(GetPlayerMoney(x) >= HighestCash)
  1023.     {
  1024.         HighestCash = GetPlayerMoney(x);
  1025.         Slot4 = x;
  1026.     }
  1027.     format(string, sizeof(string), "(%d) Player %s - $%d", Slot1,PlayerName(Slot1),GetPlayerMoney(Slot1));
  1028.     SendClientMessage(playerid,WHITE,string);
  1029.     if(Slot2 != -1){
  1030.         format(string, sizeof(string), "(%d) Player %s - $%d", Slot2,PlayerName(Slot2),GetPlayerMoney(Slot2));
  1031.         SendClientMessage(playerid,WHITE,string);
  1032.     }
  1033.     if(Slot3 != -1){
  1034.         format(string, sizeof(string), "(%d) Player %s - $%d", Slot3,PlayerName(Slot3),GetPlayerMoney(Slot3));
  1035.         SendClientMessage(playerid,WHITE,string);
  1036.     }
  1037.     if(Slot4 != -1){
  1038.         format(string, sizeof(string), "(%d) Player %s - $%d", Slot4,PlayerName(Slot4),GetPlayerMoney(Slot4));
  1039.         SendClientMessage(playerid,WHITE,string);
  1040.     }
  1041.     return 1;
  1042. }
  1043.  
  1044. CMD:stats(playerid, params[])
  1045. {
  1046.     #pragma unused params
  1047.     if(PInfo[playerid][Logged] == 0)
  1048.         return SendClientMessage(playerid, ORANGE, "You need to be logged in to use this command");
  1049.     new string[128];
  1050.     new pName[MAX_PLAYER_NAME];
  1051.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  1052.     format(string, 128, "[STATS]: Name: %s, Score: %d, Money: $%d, Current level: %d, Kills: %d, Deaths: %d", pName, GetPlayerScore(playerid), GetPlayerMoney(playerid), PInfo[playerid][Level], PInfo[playerid][Kills], PInfo[playerid][Deaths]);
  1053.     SendClientMessage(playerid, GREEN, string);
  1054.     return 1;
  1055. }
  1056.  
  1057. CMD:admins(playerid, params[])
  1058. {
  1059.     new string[128];
  1060.     #pragma unused params
  1061.     SendClientMessage(playerid, WHITE, "Admins online:");
  1062.     foreach(Player, i)
  1063.     {
  1064.         new aName[MAX_PLAYER_NAME];
  1065.         if(PInfo[i][Level] >= 1)
  1066.         {
  1067.             GetPlayerName(i, aName, MAX_PLAYER_NAME);
  1068.             if(PInfo[i][Level] == 1)
  1069.                 format(string, 128, "[LEVEL]: 1 [RANK]: Test admin [ID]: %d [NAME]: %s", i, aName);
  1070.             if(PInfo[i][Level] == 2)
  1071.                 format(string, 128, "[LEVEL]: 2 [RANK]: Standard admin [ID]: %d [NAME]: %s", i, aName);
  1072.             if(PInfo[i][Level] == 3)
  1073.                 format(string, 128, "[LEVEL]: 3 [RANK]: Pro admin [ID]: %d [NAME]: %s", i, aName);
  1074.             if(PInfo[i][Level] == 4)
  1075.                 format(string, 128, "[LEVEL]: 4 [RANK]: Leading admin [ID]: %d [NAME]: %s", i, aName);
  1076.             if(PInfo[i][Level] == 5)
  1077.                 format(string, 128, "[LEVEL]: 5 [RANK]: Head admin [ID]: %d [NAME]: %s", i, aName);
  1078.             if(PInfo[i][Level] > 5)
  1079.                 format(string, 128, "[LEVEL]: %d [RANK]: Master admin [ID]: %d [NAME]: %s", PInfo[i][Level], i, aName);
  1080.         }
  1081.     }
  1082.     SendClientMessage(playerid, WHITE, string);
  1083.     return 1;
  1084. }
  1085.  
  1086. CMD:get(playerid, params[])
  1087. {
  1088.     if(PInfo[playerid][Level] < 1)
  1089.         return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
  1090.     new tmp[MAX_STRING];
  1091.     new Index;
  1092.     tmp = strtok(params, Index);
  1093.     new id = strval(tmp);
  1094.     if(isnull(tmp))
  1095.         return SendClientMessage(playerid,GREY,"USAGE: /get <ID>");
  1096.     if(!IsPlayerConnected(id))
  1097.         return SendClientMessage(playerid,GREY,"Invalid ID");
  1098.     new string[78];
  1099.     new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
  1100.     GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
  1101.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  1102.     format(string, 78, "You have teleported %s to your position", pName);
  1103.     SendClientMessage(playerid, YELLOW, string);
  1104.     format(string, 78, "You have been teleported to administrator %s's position", aName);
  1105.     SendClientMessage(id, YELLOW, string);
  1106.     new Float:x, Float:y, Float:z;
  1107.     GetPlayerPos(playerid, x, y, z);
  1108.     SetPlayerPos(id, x, y, z);
  1109.     AdminCommand(playerid, "GET");
  1110.     return 1;
  1111. }
  1112.  
  1113. CMD:goto(playerid, params[])
  1114. {
  1115.     if(PInfo[playerid][Level] < 1)
  1116.         return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
  1117.     new tmp[MAX_STRING];
  1118.     new Index;
  1119.     tmp = strtok(params, Index);
  1120.     new id = strval(tmp);
  1121.     if(isnull(tmp))
  1122.         return SendClientMessage(playerid,GREY,"USAGE: /goto <ID>");
  1123.     if(!IsPlayerConnected(id))
  1124.         return SendClientMessage(playerid,GREY,"Invalid ID");
  1125.     new string[128];
  1126.     new pName[MAX_PLAYER_NAME];
  1127.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  1128.     format(string, 128, "You have teleported to %s's position", pName);
  1129.     SendClientMessage(playerid, YELLOW, string);
  1130.     new Float:x, Float:y, Float:z;
  1131.     GetPlayerPos(id, x, y, z);
  1132.     SetPlayerPos(playerid, x, y, z);
  1133.     AdminCommand(playerid, "GOTO");
  1134.     return 1;
  1135. }
  1136.  
  1137. CMD:explode(playerid, params[])
  1138. {
  1139.     if(PInfo[playerid][Level] < 2)
  1140.         return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
  1141.     new tmp[MAX_STRING];
  1142.     new Index;
  1143.     tmp = strtok(params, Index);
  1144.     new id = strval(tmp);
  1145.     if(isnull(tmp))
  1146.         return SendClientMessage(playerid,GREY,"USAGE: /explode <ID>");
  1147.     if(!IsPlayerConnected(id))
  1148.         return SendClientMessage(playerid,GREY,"Invalid ID");
  1149.     new string[128];
  1150.     new pName[MAX_PLAYER_NAME];
  1151.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  1152.     format(string, 128, "You have exploded %s", pName);
  1153.     SendClientMessage(playerid, YELLOW, string);
  1154.     new Float:x, Float:y, Float:z;
  1155.     GetPlayerPos(id, x, y, z);
  1156.     CreateExplosion(x, y, z, 7, 10.0);
  1157.     AdminCommand(playerid, "EXPLODE");
  1158.     return 1;
  1159. }
  1160.  
  1161. CMD:slap(playerid, params[])
  1162. {
  1163.     if(PInfo[playerid][Level] < 1)
  1164.         return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this command");
  1165.     new tmp[MAX_STRING];
  1166.     new Index;
  1167.     tmp = strtok(params, Index);
  1168.     new id = strval(tmp);
  1169.     if(isnull(tmp))
  1170.         return SendClientMessage(playerid,GREY,"USAGE: /slap <ID>");
  1171.     if(!IsPlayerConnected(id))
  1172.         return SendClientMessage(playerid,GREY,"Invalid ID");
  1173.     new string[128];
  1174.     new pName[MAX_PLAYER_NAME];
  1175.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  1176.     format(string, 128, "You have slapped %s", pName);
  1177.     SendClientMessage(playerid, YELLOW, string);
  1178.     new Float:x, Float:y, Float:z;
  1179.     GetPlayerPos(id, x, y, z);
  1180.     SetPlayerPos(id, x, y, z+5);
  1181.     PlayerPlaySound(playerid,1190,0.0,0.0,0.0);
  1182.     PlayerPlaySound(id,1190,0.0,0.0,0.0);
  1183.     new Float:health;
  1184.     GetPlayerHealth(id, health);
  1185.     SetPlayerHealth(id, health-15);
  1186.     AdminCommand(playerid, "SLAP");
  1187.     return 1;
  1188. }
  1189.  
  1190. CMD:givescore(playerid, params[])
  1191. {
  1192.  
  1193.     if(PInfo[playerid][Level] < 4)
  1194.         return SendClientMessage(playerid, ORANGE, "You need to be level 4+ to use this command");
  1195.     new tmp[MAX_STRING];
  1196.     new tmp2[MAX_STRING];
  1197.     new Index;
  1198.     tmp = strtok(params, Index);
  1199.     tmp2 = strtok(params, Index);
  1200.     new id = strval(tmp);
  1201.     new score = strval(tmp2);
  1202.     if(isnull(tmp))
  1203.         return SendClientMessage(playerid,GREY,"USAGE: /givescore <ID> <Score>");
  1204.     if(isnull(tmp2))
  1205.         return SendClientMessage(playerid,GREY,"USAGE: /givescore <ID> <Score>");
  1206.     if(!IsPlayerConnected(id))
  1207.         return SendClientMessage(playerid,GREY,"Invalid ID");
  1208.     new string[128];
  1209.     new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
  1210.     GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
  1211.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  1212.     format(string, 128, "You gave %s score to %s", params[strlen(tmp)+1], pName);
  1213.     SendClientMessage(playerid, YELLOW, string);
  1214.     format(string, 128, "Administrator %s gave you %s score", aName, params[strlen(tmp)+1]);
  1215.     SendClientMessage(id, YELLOW, string);
  1216.     GivePlayerScore(id, score);
  1217.     AdminCommand(playerid, "GIVESCORE");
  1218.     return 1;
  1219. }
  1220.  
  1221. CMD:setskin(playerid,params[])
  1222. {
  1223.     if(PInfo[playerid][Level] < 4)
  1224.         return SendClientMessage(playerid, ORANGE, "You need to be level 4+ to use this command");
  1225.     new Index;
  1226.     new tmp[MAX_STRING];
  1227.     new tmp2[MAX_STRING];
  1228.     tmp  = strtok(params,Index);
  1229.     tmp2 = strtok(params,Index);
  1230.     if(isnull(tmp) || isnull(tmp2) || !IsNumeric(tmp2))
  1231.         return SendClientMessage(playerid, GREY, "USAGE: /setskin <ID> <Skin>");
  1232.     new id = strval(tmp);
  1233.     new skin = strval(tmp2);
  1234.     new string[128];
  1235.     if(!IsValidSkin(skin))
  1236.         return SendClientMessage(playerid, GREY, "ERROR: Invaild Skin ID!");
  1237.     if(!IsPlayerConnected(id) && id == INVALID_PLAYER_ID)
  1238.         return SendClientMessage(playerid,GREY,"Invalid ID");
  1239.     new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
  1240.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  1241.     GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
  1242.     format(string, 128, "You have set %s's skin to %d", pName, skin);
  1243.     SendClientMessage(playerid, YELLOW, string);
  1244.     format(string,sizeof(string),"Administrator %s has set your skin to %d", aName, skin);
  1245.     SendClientMessage(id, YELLOW, string);
  1246.     SetPlayerSkin(id, skin);
  1247.     AdminCommand(playerid, "SETSKIN");
  1248.     return 1;
  1249. }
  1250.  
  1251. CMD:report(playerid, params[])
  1252. {
  1253.     new tmp[MAX_STRING];
  1254.     new tmp2[MAX_STRING];
  1255.     new Index;
  1256.     tmp = strtok(params, Index);
  1257.     tmp2 = strtok(params, Index);
  1258.     new id = strval(tmp);
  1259.     if(isnull(tmp) || isnull(tmp2))
  1260.         return SendClientMessage(playerid, GREY, "USAGE: /report <ID> <Reason>");
  1261.     if(!IsPlayerConnected(id))
  1262.         return SendClientMessage(playerid,GREY,"Invalid ID");
  1263.     new string[128];
  1264.     new pName[MAX_PLAYER_NAME];
  1265.     new reported[MAX_PLAYER_NAME];
  1266.     GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  1267.     GetPlayerName(id, reported, MAX_PLAYER_NAME);
  1268.     SendClientMessage(playerid, YELLOW, "Your report has been sent to all online administrators and has been saved to file");
  1269.     foreach(Player, i)
  1270.     {
  1271.         if(PInfo[i][Level] >= 1)
  1272.         {
  1273.             format(string, 128, "[REPORT] %s reported %s || Reason: %s", pName, reported, params[strlen(tmp)+1]);
  1274.             SendClientMessage(i, WHITE, string);
  1275.         }
  1276.     }
  1277.     SaveIn("ReportLog",string);
  1278.     return 1;
  1279. }
  1280.  
  1281. CMD:adminduty(playerid, params[])
  1282. {
  1283.     #pragma unused params
  1284.     if(PInfo[playerid][Level] < 1)
  1285.         return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
  1286.     if(PInfo[playerid][AdminDuty] == 0)
  1287.     {
  1288.         PInfo[playerid][AdminDuty] = 1;
  1289.         new string[128];
  1290.         GetPlayerName(playerid, string, 128);
  1291.         format(string, 128, "Administrator %s is now On-Duty!", string);
  1292.         SendClientMessageToAll(LIGHTBLUE, string);
  1293.         Godtimer = SetTimerEx("God", 500, 1, "i", playerid);
  1294.         SetPlayerHealth(playerid, 10000);
  1295.         GivePlayerWeapon(playerid, WEAPON_MINIGUN, 100000);
  1296.         label[playerid] = Create3DTextLabel("On-Duty admin, do not attack",0x008080FF,30.0,40.0,50.0,40.0,0);
  1297.         Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
  1298.         SetPlayerSkin(playerid, 217);
  1299.         SetPlayerColor(playerid, LIGHTBLUE);
  1300.     }
  1301.     else
  1302.     {
  1303.         PInfo[playerid][AdminDuty] = 0;
  1304.         new string[128];
  1305.         GetPlayerName(playerid, string, 128);
  1306.         format(string, 128, "Administrator %s is now Off-Duty!", string);
  1307.         SendClientMessageToAll(LIGHTBLUE, string);
  1308.         KillTimer(Godtimer);
  1309.         SetPlayerHealth(playerid, 100.0);
  1310.         Delete3DTextLabel(label[playerid]);
  1311.         SetPlayerHealth(playerid, 0.0);
  1312.     }
  1313.     return 1;
  1314. }
  1315.  
  1316. CMD:kill(playerid, params[])
  1317. {
  1318.     #pragma unused params
  1319.     SetPlayerHealth(playerid, 0.0);
  1320.     return 1;
  1321. }
  1322.  
  1323. CMD:asay(playerid, params[])
  1324. {
  1325.     if(PInfo[playerid][Level] < 1)
  1326.         return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
  1327.     new string[128];
  1328.     GetPlayerName(playerid, string, 128);
  1329.     format(string, 128, "Admin %s: %s", string, params);
  1330.     SendClientMessageToAll(LIGHTBLUE, string);
  1331.     return 1;
  1332. }
  1333.  
  1334. CMD:spec(playerid, params[])
  1335. {
  1336.     if(PInfo[playerid][Level] < 1)
  1337.         return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
  1338.     new tmp[MAX_STRING];
  1339.     new Index;
  1340.     tmp = strtok(params, Index);
  1341.     new id = strval(tmp);
  1342.     if(isnull(tmp))
  1343.         return SendClientMessage(playerid, GREY, "USAGE: /spec <ID>");
  1344.     if(!IsPlayerConnected(id))
  1345.         return SendClientMessage(playerid,GREY,"Invalid ID");
  1346.     new string[128];
  1347.     new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
  1348.     GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
  1349.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  1350.     format(string, 128, "Now spectating %s", pName);
  1351.     SendClientMessage(playerid, YELLOW, string);
  1352.     format(string, 128, "Administrator %s is now spectating [%d]%s", aName, id, pName);
  1353.     TogglePlayerSpectating(playerid, 1);
  1354.     PlayerSpectatePlayer(playerid, id);
  1355.     PInfo[playerid][Spectate] = 1;
  1356.     foreach(Player, i)
  1357.     {
  1358.         if(PInfo[i][Level] >= 1)
  1359.         {
  1360.             SendClientMessage(i, WHITE, string);
  1361.         }
  1362.     }
  1363.     return 1;
  1364. }
  1365.  
  1366. CMD:endspec(playerid, params[])
  1367. {
  1368.     #pragma unused params
  1369.     if(PInfo[playerid][Level] < 1)
  1370.         return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
  1371.     if(PInfo[playerid][Spectate] == 0)
  1372.         return SendClientMessage(playerid, ORANGE, "You aren't spectating");
  1373.     TogglePlayerSpectating(playerid, 0);
  1374.     PInfo[playerid][Spectate] = 0;
  1375.     SendClientMessage(playerid, YELLOW, "Spectate ended");
  1376.     return 1;
  1377. }
  1378.  
  1379. CMD:adminarea(playerid, params[])
  1380. {
  1381.     #pragma unused params
  1382.     if(PInfo[playerid][Level] < 1)
  1383.         return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this");
  1384.     SetPlayerInterior(playerid, 10);
  1385.     Streamer_UpdateEx(playerid, 382.7088,2324.7488,1889.5669);
  1386.     SetPlayerPos(playerid, 382.7088,2324.7488,1889.5669);
  1387.     return 1;
  1388. }
  1389.  
  1390. CMD:jail(playerid, params[])
  1391. {
  1392.     if(PInfo[playerid][Level] < 2)
  1393.         return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
  1394.     new tmp[MAX_STRING], tmp2[MAX_STRING];
  1395.     new Index;
  1396.     tmp = strtok(params, Index);
  1397.     tmp2 = strtok(params, Index);
  1398.     new id = strval(tmp);
  1399.     if(isnull(tmp) || isnull(tmp2))
  1400.         return SendClientMessage(playerid, GREY, "USAGE: /jail <ID> <Reason>");
  1401.     if(!IsPlayerConnected(id))
  1402.         return SendClientMessage(playerid,GREY,"Invalid ID");
  1403.     new string[128];
  1404.     new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
  1405.     GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
  1406.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  1407.     if(PInfo[id][Jail] == 0)
  1408.     {
  1409.         SetPlayerPos(id,197.6661,173.8179,1003.0234);
  1410.         SetPlayerInterior(id,3);
  1411.         format(string, 128, "You have jailed %s", pName);
  1412.         SendClientMessage(playerid, YELLOW, string);
  1413.         format(string, 128, "Administrator %s has jailed you || Reason: %s", aName, params[strlen(tmp)+1]);
  1414.         SendClientMessage(id, YELLOW, string);
  1415.         PInfo[id][Jail] = 1;
  1416.         format(string, 128, "%s has been jailed by administrator %s || Reason: %s", pName, aName, params[strlen(tmp)+1]);
  1417.         SendClientMessageToAll(YELLOW, string);
  1418.     }
  1419.     else
  1420.         return SendClientMessage(playerid, ORANGE, "Player is in jail already");
  1421.     AdminCommand(playerid, "JAIL");
  1422.     return 1;
  1423. }
  1424.  
  1425. CMD:unjail(playerid, params[])
  1426. {
  1427.     if(PInfo[playerid][Level] < 2)
  1428.         return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
  1429.     new tmp[MAX_STRING];
  1430.     new Index;
  1431.     tmp = strtok(params, Index);
  1432.     new id = strval(tmp);
  1433.     new pName[MAX_PLAYER_NAME], aName[MAX_PLAYER_NAME];
  1434.     GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
  1435.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  1436.     new string[128];
  1437.     if(PInfo[id][Jail] == 1)
  1438.     {
  1439.         SpawnPlayer(id);
  1440.         format(string, 128, "You have unjailed %s", pName);
  1441.         SendClientMessage(playerid, YELLOW, string);
  1442.         format(string, 128, "Administrator %s has unjailed you", aName);
  1443.         SendClientMessage(id, YELLOW, string);
  1444.         format(string, 128, "%s has been unjailed by administrator %s", pName, aName);
  1445.         SendClientMessageToAll(YELLOW, string);
  1446.         AdminCommand(playerid, "UNJAIL");
  1447.     }
  1448.     else if(PInfo[id][Jail] == 0)
  1449.         SendClientMessage(playerid, ORANGE, "Player is not in jail");
  1450.     return 1;
  1451. }
  1452.  
  1453. CMD:spawn(playerid, params[])
  1454. {
  1455.     if(PInfo[playerid][Level] < 1)
  1456.         return SendClientMessage(playerid, ORANGE, "You need to be administrator to use this command");
  1457.     new tmp[MAX_STRING];
  1458.     new Index;
  1459.     tmp = strtok(params, Index);
  1460.     new id = strval(tmp);
  1461.     new string[128];
  1462.     if(!IsPlayerConnected(id))
  1463.         return SendClientMessage(playerid,GREY,"Invalid ID");
  1464.     if(isnull(tmp))
  1465.         return SendClientMessage(playerid, GREY, "USAGE: /spawn <ID>");
  1466.     new pName[MAX_PLAYER_NAME];
  1467.     GetPlayerName(id, pName, MAX_PLAYER_NAME);
  1468.     SpawnPlayer(id);
  1469.     format(string, 128, "You have spawned %s", pName);
  1470.     SendClientMessage(playerid, YELLOW, string);
  1471.     AdminCommand(playerid, "SPAWN");
  1472.     return 1;
  1473. }
  1474.  
  1475. CMD:gmx(playerid, params[])
  1476. {
  1477.     #pragma unused params
  1478.     if(PInfo[playerid][Level] >= 5 || IsPlayerAdmin(playerid))
  1479.     {
  1480.         new string[128];
  1481.         new playername[MAX_PLAYER_NAME];
  1482.         GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  1483.         if(isnull(params))
  1484.         {
  1485.             format(string,sizeof(string), "Administrator %s has restarted the server || Reason: Not given", playername);
  1486.         }
  1487.         else
  1488.         {
  1489.             format(string,sizeof(string), "Administrator %s has restarted the server || Reason: %s", playername, params);
  1490.         }
  1491.         for(new i=0; i<MAX_PLAYERS; i++) if(IsPlayerConnected(i)) PlayerPlaySound(i,1057,0.0,0.0,0.0);
  1492.         SendClientMessageToAll(YELLOW, string);
  1493.         SendRconCommand("gmx");
  1494.     }
  1495.     else return 0;
  1496.     return 1;
  1497. }
  1498.  
  1499. CMD:v(playerid, params[])
  1500. {
  1501.     if(PInfo[playerid][Level] < 3)
  1502.         return SendClientMessage(playerid, ORANGE, "You need to be level 3+ to use this command");
  1503.     new Index;
  1504.     new tmp[256];
  1505.     new tmp2[256];
  1506.     new tmp3[256];
  1507.     tmp = strtok(params, Index);
  1508.     tmp2 = strtok(params, Index);
  1509.     tmp3 = strtok(params, Index);
  1510.     if(isnull(tmp))
  1511.         return SendClientMessage(playerid, GREY, "USAGE: /v <Vehicle ID/Model> <Color 1> <Color 2>");
  1512.     new car;
  1513.     new string[128];
  1514.     new color1, color2;
  1515.     if(!IsNumeric(tmp))
  1516.         car = GetVehicleModelIDFromName(tmp);
  1517.     else car = strval(tmp);
  1518.     if(car < 400 || car > 611)
  1519.         return SendClientMessage(playerid, GREY, "Invalid car ID/Name");
  1520.     if(!strlen(tmp2))
  1521.         color1 = random(126);
  1522.     else color1 = strval(tmp2);
  1523.    
  1524.     if(!strlen(tmp3))
  1525.         color2 = random(126);
  1526.     else color2 = strval(tmp3);
  1527.    
  1528.     new vID;
  1529.     new Float:x, Float:y, Float:z, Float:angle;
  1530.     GetPlayerPos(playerid, x, y, z);
  1531.     GetPlayerFacingAngle(playerid, angle);
  1532.     new interior = GetPlayerInterior(playerid);
  1533.     vID = CreateVehicle(car, x+3,y,z, angle, color1, color2, -1);
  1534.     LinkVehicleToInterior(vID, interior);
  1535.     format(string, 128, "[VEHICLE SPAWNED] %s || MODEL: %d || COLORS: %d, %d -|", VehicleNames[car-400], car, color1, color2);
  1536.     SendClientMessage(playerid, YELLOW, string);
  1537.     AdminCommand(playerid, "V");
  1538.     return 1;
  1539. }
  1540.  
  1541.  
  1542. CMD:spawnvehicle(playerid, params[])
  1543. {
  1544.     if(PInfo[playerid][Level] < 2)
  1545.         return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
  1546.     new tmp[256];
  1547.     new Index;
  1548.     tmp = strtok(params, Index);
  1549.     new car = strval(tmp);
  1550.     SetVehicleToRespawn(car);
  1551.     SendClientMessage(playerid, YELLOW, "Vehicle spawned!");
  1552.     AdminCommand(playerid, "SPAWNVEHICLE");
  1553.     return 1;
  1554. }
  1555.  
  1556. CMD:deletevehicle(playerid, params[])
  1557. {
  1558.     if(PInfo[playerid][Level] < 2)
  1559.         return SendClientMessage(playerid, ORANGE, "You need to be level 2+ to use this command");
  1560.     new tmp[256];
  1561.     new Index;
  1562.     tmp = strtok(params, Index);
  1563.     new car = strval(tmp);
  1564.     EraseVeh(car);
  1565.     SendClientMessage(playerid, YELLOW, "Vehicle deleted!");
  1566.     AdminCommand(playerid, "DELETEVEHICLE");
  1567.     return 1;
  1568. }
  1569.  
  1570. CMD:sv(playerid, params[])
  1571. {
  1572.     return cmd_spawnvehicle(playerid, params);
  1573. }
  1574.  
  1575. CMD:dv(playerid, params[])
  1576. {
  1577.     return cmd_deletevehicle(playerid, params);
  1578. }
  1579.  
  1580. CMD:skinall(playerid, params[])
  1581. {
  1582.     if(PInfo[playerid][Level] < 5)
  1583.         return SendClientMessage(playerid, ORANGE, "You need to be level 5+ to use this command");
  1584.     new tmp[256];
  1585.     new Index;
  1586.     tmp = strtok(params, Index);
  1587.     new skin = strval(tmp);
  1588.     if(isnull(tmp))
  1589.         return SendClientMessage(playerid, GREY, "USAGE: /skinall <Skin>");
  1590.     if(!IsValidSkin(skin))
  1591.         return SendClientMessage(playerid, GREY, "ERROR: Invaild Skin ID!");
  1592.     new string[128];
  1593.     new aName[MAX_PLAYER_NAME];
  1594.     GetPlayerName(playerid, aName, MAX_PLAYER_NAME);
  1595.     format(string, 128, "Administrator %s has set everyone's skin to %d", aName, skin);
  1596.     SendClientMessageToAll(YELLOW, string);
  1597.     foreach(Player, i)
  1598.     {
  1599.         if(IsPlayerConnected(i))
  1600.         {
  1601.             SetPlayerSkin(i, skin);
  1602.         }
  1603.     }
  1604.     AdminCommand(playerid, "SKINALL");
  1605.     return 1;
  1606. }
  1607.    
  1608.  
  1609. CMD:ahelp(playerid, params[])
  1610. {
  1611.     #pragma unused params
  1612.     if(PInfo[playerid][Level] == 1)
  1613.     {
  1614.         SendClientMessage(playerid, WHITE, "Level 1 commands: kick, get, goto, slap, adminduty, asay, spec, endspec, adminarea, spawn");
  1615.     }
  1616.     else if(PInfo[playerid][Level] == 2)
  1617.     {
  1618.         SendClientMessage(playerid, WHITE, "Level 1 commands: kick, get, goto, slap, adminduty, asay, spec, endspec, adminarea, spawn");
  1619.         SendClientMessage(playerid, WHITE, "Level 2 commands: mute, setmoney, explode, jail, unjail, spawnvehicle, deletevehicle");
  1620.     }
  1621.     else if(PInfo[playerid][Level] == 3)
  1622.     {
  1623.         SendClientMessage(playerid, WHITE, "Level 1 commands: kick, get, goto, slap, adminduty, asay, spec, endspec, adminarea, spawn");
  1624.         SendClientMessage(playerid, WHITE, "Level 2 commands: mute, setmoney, explode, jail, unjail, spawnvehicle, deletevehicle");
  1625.         SendClientMessage(playerid, WHITE, "Level 3 commands: ban, v");
  1626.     }
  1627.     else if(PInfo[playerid][Level] == 4)
  1628.     {
  1629.         SendClientMessage(playerid, WHITE, "Level 1 commands: kick, get, goto, slap, adminduty, asay, spec, endspec, adminarea, spawn");
  1630.         SendClientMessage(playerid, WHITE, "Level 2 commands: mute, setmoney, explode, jail, unjail, spawnvehicle, deletevehicle");
  1631.         SendClientMessage(playerid, WHITE, "Level 3 commands: ban, v");
  1632.         SendClientMessage(playerid, WHITE, "Level 4 commands: healall, armorall, setscore, givescore, setskin");
  1633.     }
  1634.     else if(PInfo[playerid][Level] >= 5)
  1635.     {
  1636.         SendClientMessage(playerid, WHITE, "Level 1 commands: kick, get, goto, slap, adminduty, asay, spec, endspec, adminarea, spawn");
  1637.         SendClientMessage(playerid, WHITE, "Level 2 commands: mute, setmoney, explode, jail, unjail, spawnvehicle, deletevehicle");
  1638.         SendClientMessage(playerid, WHITE, "Level 3 commands: ban, v");
  1639.         SendClientMessage(playerid, WHITE, "Level 4 commands: healall, armorall, setscore, givescore, setskin");
  1640.         SendClientMessage(playerid, WHITE, "Level 5+ commands: setlevel, gmx, skinall");
  1641.     }
  1642.     return 1;
  1643. }
  1644.  
  1645.  
  1646.  
  1647.        
  1648.    
  1649.    
  1650.  
  1651.  
  1652.  
  1653. public OnPlayerSpawn(playerid)
  1654. {
  1655.     if(PInfo[playerid][AdminDuty] == 1)
  1656.     {
  1657.         label[playerid] = Create3DTextLabel("On-Duty admin, do not attack",0x008080FF,30.0,40.0,50.0,40.0,0);
  1658.         Attach3DTextLabelToPlayer(label[playerid], playerid, 0.0, 0.0, 0.7);
  1659.         SetPlayerSkin(playerid, 217);
  1660.         SetPlayerHealth(playerid, 10000);
  1661.         GivePlayerWeapon(playerid, WEAPON_MINIGUN, 100000);
  1662.     }
  1663.     return 1;
  1664. }
  1665.    
  1666.    
  1667. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1668. {
  1669.     if(newkeys == KEY_CROUCH)
  1670.     {
  1671.         if(PInfo[playerid][Spectate] == 1)
  1672.         {
  1673.             TogglePlayerSpectating(playerid, 0);
  1674.             PInfo[playerid][Spectate] = 0;
  1675.         }
  1676.     }
  1677.     return 1;
  1678. }
  1679.  
  1680.    
  1681.  
  1682.    
  1683.    
  1684.    
  1685.    
  1686.  
  1687.  
  1688.  
  1689.    
  1690.        
  1691.  
  1692. public OnPlayerText(playerid, text[])
  1693. {
  1694.     if(text[0] == '#' || text[0] == '.' && PInfo[playerid][Level] >= 1)
  1695.     {
  1696.         new string[128];
  1697.         GetPlayerName(playerid, string, 128);
  1698.         format(string,sizeof(string),"[ADMIN CHAT] %s: %s",string,text[1]);
  1699.         foreach(Player, i)
  1700.         {
  1701.             if(PInfo[i][Level] >= 1)
  1702.                 SendClientMessage(playerid, WHITE, string);
  1703.         }
  1704.         return 0;
  1705.     }
  1706.     if(PInfo[playerid][Muted] == 1)
  1707.     {
  1708.         SendClientMessage(playerid, GREY, "You cannot talk while muted!");
  1709.         return 0;
  1710.     }
  1711.     if(PInfo[playerid][AdminDuty] == 1)
  1712.     {
  1713.         new string[128];
  1714.         GetPlayerName(playerid, string, 128);
  1715.         format(string, 128, "Admin %s: %s", string, text);
  1716.         SendClientMessageToAll(LIGHTBLUE, string);
  1717.         return 0;
  1718.     }
  1719.     return 1;
  1720. }
  1721.  
  1722. public OnPlayerRequestSpawn(playerid)
  1723. {
  1724.     if(PInfo[playerid][Logged] == 0)
  1725.     {
  1726.         SendClientMessage(playerid, ORANGE, "You need to be logged in before spawning");
  1727.         return 0;
  1728.     }
  1729.     return 1;
  1730. }
  1731.  
  1732. public OnPlayerDeath(playerid, killerid, reason)
  1733. {
  1734.     PInfo[playerid][Deaths]++;
  1735.     PInfo[killerid][Kills]++;
  1736.     return 1;
  1737. }
  1738.  
  1739. public ServerBot()
  1740. {
  1741.     new string[128];
  1742.     foreach(Player, i)
  1743.     {
  1744.         new pName[MAX_PLAYER_NAME];
  1745.         GetPlayerName(i, pName, MAX_PLAYER_NAME);
  1746.         if(GetPlayerPing(i) > MAX_PING && GetPlayerPing(i) < 2500)
  1747.         {
  1748.             format(string, 128, "[SERVER BOT] %s has been kicked from the server || Reason: High Ping (%d), Max allowed (%d)",pName, GetPlayerPing(i), MAX_PING);
  1749.             SendClientMessageToAll(GREY, string);
  1750.             Kick(i);
  1751.         }
  1752.         if(GetPlayerWeapon(i) == WEAPON_MINIGUN && PInfo[i][Level] < 1)
  1753.         {
  1754.             format(string, 128, "[SERVER BOT] %s has been banned from the server || Reason: Weapon hack", pName);
  1755.             SendClientMessageToAll(GREY, string);
  1756.             BanEx(i, "Weapon hack");
  1757.         }
  1758.     }
  1759.     return 1;
  1760. }
  1761.  
  1762. public God(playerid)
  1763. {
  1764.     SetPlayerHealth(playerid, 10000);
  1765.     if(IsPlayerInAnyVehicle(playerid))
  1766.     {
  1767.         new vehicleid = GetPlayerVehicleID(playerid);
  1768.         RepairVehicle(vehicleid);
  1769.     }
  1770.     return 1;
  1771. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement