BulletRja

bR DeathMatch

Jan 26th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 58.68 KB | None | 0 0
  1. /*                                 CREDITS
  2.  *
  3.  *BBBBBBBBBBBBBBBBB           RRRRRRRRRRRRRR
  4.  *BB              BB          RR           RR
  5.  *BB             BB           RR          RR
  6.  *BB            BB            RR         RR
  7.  *BB           BB             RR        RR
  8.  *BBBBBBBBBBBBB               RRRRRRRRRR
  9.  *BB           BB             RR        RR
  10.  *BB            BB            RR         RR
  11.  *BB             BB           RR          RR
  12.  *BB              BB          RR           RR
  13.  *BBBBBBBBBBBBBBBBB           RR            RR
  14.  *BULLET RAJA               PRESENTS bR DeathMatch [v3]
  15.  */
  16. /*                                    ChangeLog
  17.  *=========> Version 1<==========
  18.  *=> Added Login/Register System,
  19.  *=> Added /login, /register commands
  20.  *=> Added Offline Ban System
  21.  *=> Added Online Ban System
  22.  *=> Added Kicking System
  23.  *
  24.  *=========> Version 1.5<==========
  25.  *=> Added Vehicle Spawning System
  26.  *=> Added Vehicle Giving System
  27.  *=> Added Stats System
  28.  *=> Added Player Commands
  29.  *=> Added Admin Commands
  30.  *
  31.  *=========> Version 2<==========
  32.  *=> Added GetIP & Ban IP & Unban IP System
  33.  *=> Added Top Killers & Top Deaths System
  34.  *=> Added RichList
  35.  *=> Added Spawning System
  36.  *=> Added Credits System
  37.  *
  38.  *=========> Version 2.5<==========
  39.  *=> Added Rules System
  40.  *=> Added AutoMatic Scores Giver
  41.  *=> Added AutoMatic HostName Changer
  42.  *=> Added AutoMatic Tips System
  43.  *=> Fixed Login/Register System
  44.  *=> Added Last Active [Year, Month. Day]
  45.  *
  46.  *=========> Version 3<==========
  47.  *=> Added Clan Member System
  48.  *=> Added
  49.  *=> Added
  50.  *=> Added
  51.  *=> Added
  52.  *=> Added
  53.  *=> Added
  54.  */
  55. #include <a_samp>
  56. #include <streamer>
  57. #include <sscanf2>
  58. #include <zcmd>
  59. #include <vehicles>
  60. #include <utils>
  61. #include <dutils>
  62. #include <YSI/y_ini>
  63.  
  64. /* Server Information */
  65. #define     SV_VER      "(0.3.7)"//here you can add your server version
  66. #define     SV_GM       "bR DeathMatch ["SCRIPT_V"]"//here add your gamemode text
  67. #define     SV_LANG     "English"//here add your server language
  68. #define     SV_RCON     "BulletR"//here add server rcon
  69. #define     SV_SNAME    "Check /rules, /updates"//here add your server second name
  70. #define     SV_NAME     "BulletRaja DeathMatch "SV_VER""//here add server name
  71. #define     SV_URL      "www.BulletRaja.Com"//here put server url
  72. #define     SV_MAP      "San Andreas"//here server map name
  73. #define     SCRIPT_V    "v3"
  74.  
  75. /* All Colours */
  76. #define COLOR_PURPLE2                 0xC2A2DAFF
  77. #define COLOR_DARKRED                 0xAA3333FF
  78. #define COLOR_GREY                    0xAFAFAFFF
  79. #define COLOR_ASAY                    0xFF0000FF
  80. #define COLOR_OSAY                    0x007700FF
  81. #define COLOR_HSAY                    0x1684CAFF
  82. #define COLOR_MSAY                    0x1684CAFF
  83. #define COLOR_WHITE                   0xFFFFFFFF
  84. #define COLOR_YELLOW                  0xFFFF00FF
  85. #define COLOR_LIGHTGREEN              0xFF0000A
  86. #define COLOR_RED                     0xFF0000FF
  87. #define RED                           0xFF0000FF
  88. #define COLOR_LRED                    0xFF4747FF
  89. #define COLOR_GREEN                   0x00FF00FF
  90. #define COLOR_DARKMAUVE               0x623778FF
  91. #define COLOR_MAUVE                   0x845F96FF
  92. #define COLOR_GREENYELLOW             0xADFF2FAA
  93. #define COLOR_BLUE                    0x0000FFFF
  94. #define COLOR_LBLUE                   0x99FFFFFF
  95. #define COLOR_LIGHTBLUE               0x99FFFFFF
  96. #define COLOR_ORANGE                  0xFF9900FF
  97. #define COLOR_PURPLE                  0xCC00DDFF
  98. #define COLOR_PEACH                   0xFFCC66FF
  99. #define COLOR_SILVER                  0xDDDDDDFF
  100. #define COLOR_WANTEDBLUE              0x0055CCFF
  101. #define COLOR_DARK_VIOLET             0x9400D3FF
  102. #define COLOR_VIP1                    0x9400D3FF
  103. #define COLOR_HELP                    0x00E5EEFF
  104. #define COLOR_ADMIN                   0x0066FFFF
  105. #define COLOR_ADMIN2                  0x008FD6FF
  106. #define COLOR_PLAYER                  0xFFCC33FF
  107. #define COLOR_RP                      0xFFFFFFFF
  108. #define COLOR_ULTRAADMIN              0x993300FF
  109. #define COLOR_EVENT                   0x00CC66FF
  110. #define COLOR_VIP2                    0xFF33CCFF
  111. #define COLOR_VIPCHAT                 0xCC66CCFF
  112. #define     COL_WHITE                 "{FFFFFF}"
  113. #define     COL_BLACK                 "{0E0101}"
  114. #define     COL_GREY                  "{C3C3C3}"
  115. #define     COL_GREEN                 "{6EF83C}"
  116. #define     COL_RED                   "{F81414}"
  117. #define     COL_YELLOW                "{F3FF02}"
  118. #define     COL_ORANGE                "{FFAF00}"
  119. #define     COL_LIME                  "{B7FF00}"
  120. #define     COL_CYAN                  "{00FFEE}"
  121. #define     COL_BLUE                  "{0049FF}"
  122. #define     COL_MAGENTA               "{F300FF}"
  123. #define     COL_VIOLET                "{B700FF}"
  124. #define     COL_PINK                  "{FF00EA}"
  125. #define     COL_MARONE                "{A90202}"
  126.  
  127. /* Dialogs */
  128. #define DIALOG_REGISTER    1
  129. #define DIALOG_LOGIN       2
  130. #define DIALOG_STATS       3
  131. #define DIALOG_CREDITS     4
  132. #define DIALOG_RULES       5
  133.  
  134. /* File Path */
  135. #define UserFiles          "/Accounts/%s.ini"
  136.  
  137. /* After Register */
  138. #define REGISTER_MONEY 10000
  139. #define REGISTER_SCORE 10
  140.  
  141. /* Max Entities */
  142. #define     CLAN_TAG                "[bR]"
  143. #define     MAX_CLIENT_MSG_LENGTH   144
  144. #define     MAX_MONEY               999999999
  145.  
  146. /* New Defines */
  147. new playerlogged[PLAYERS];
  148. new isconnected[PLAYERS];
  149. new pdialog[PLAYERS];
  150. new spectat[PLAYERS] = {-1, ...};
  151. new bool:svtd[VEHICLES + 1];
  152. new saccstats[PLAYERS];
  153.  
  154. /* Class Selection */
  155. #define CLASS_X 1088.1422
  156. #define CLASS_Y 1074.0307
  157. #define CLASS_Z 10.8382
  158.  
  159. #define M_C 0x4169E1FF
  160. #define M_T 400
  161. #define NOW_MSSG 100
  162.  
  163. main()
  164. {
  165.     print("\n|+++++++++++++++++++++++++++++++|");
  166.     print(" [BR]DeathMatch ("SCRIPT_V") By BulletRaja");
  167.     print("|+++++++++++++++++++++++++++++++|\n");
  168. }
  169.  
  170. enum pInfo
  171. {
  172.     PlayerPass,
  173.     PlayerName,
  174.     PlayerMoney,
  175.     PlayerLevel,
  176.     PlayerScore,
  177.     PlayerKills,
  178.     PlayerDeaths,
  179.     PlayerBanned,
  180.     PlayerIP[16],
  181.     LastActive_Y,
  182.     LastActive_M,
  183.     LastActive_D,
  184.     ClanMember
  185. }
  186. new PlayerInfo[PLAYERS][pInfo];
  187.            
  188. forward LoadPlayer_data(playerid,name[],value[]);
  189. public LoadPlayer_data(playerid,name[],value[])
  190. {
  191.     new year, month, day;
  192.     getdate(year, month, day);
  193.     INI_Int("password",PlayerInfo[playerid][PlayerPass]);
  194.     INI_Int("Player Name",PlayerInfo[playerid][PlayerName]);
  195.     INI_Int("money",PlayerInfo[playerid][PlayerMoney]);
  196.     INI_Int("adminlevel",PlayerInfo[playerid][PlayerLevel]);
  197.     INI_Int("scores",PlayerInfo[playerid][PlayerScore]);
  198.     INI_Int("kills",PlayerInfo[playerid][PlayerKills]);
  199.     INI_Int("deaths",PlayerInfo[playerid][PlayerDeaths]);
  200.     INI_Int("playerbanned",PlayerInfo[playerid][PlayerBanned]);
  201.     INI_String("playerip",PlayerInfo[playerid][PlayerIP], 16);
  202.     INI_Int("lactive_y", PlayerInfo[playerid][LastActive_Y],year);
  203.     INI_Int("lactive_m", PlayerInfo[playerid][LastActive_M],month);
  204.     INI_Int("lactive_d", PlayerInfo[playerid][LastActive_D],day);
  205.     INI_Int("ClanMember",PlayerInfo[playerid][ClanMember]);
  206.     return 1;
  207. }
  208.  
  209. /* Vehicles Name */
  210. new vehName[][] =
  211. {
  212.     "Landstalker",
  213.     "Bravura",
  214.     "Buffalo",
  215.     "Linerunner",
  216.     "Perennial",
  217.     "Sentinel",
  218.     "Dumper",
  219.     "Firetruck",
  220.     "Trashmaster",
  221.     "Stretch",
  222.     "Manana",
  223.     "Infernus",
  224.     "Voodoo",
  225.     "Pony",
  226.     "Mule",
  227.     "Cheetah",
  228.     "Ambulance",
  229.     "Leviathan",
  230.     "Moonbeam",
  231.     "Esperanto",
  232.     "Taxi",
  233.     "Washington",
  234.     "Bobcat",
  235.     "Whoopee",
  236.     "BF Injection",
  237.     "Hunter",
  238.     "Premier",
  239.     "Enforcer",
  240.     "Securicar",
  241.     "Banshee",
  242.     "Predator",
  243.     "Bus",
  244.     "Rhino",
  245.     "Barracks",
  246.     "Hotknife",
  247.     "Trailer",
  248.     "Previon",
  249.     "Coach",
  250.     "Cabbie",
  251.     "Stallion",
  252.     "Rumpo",
  253.     "RC Bandit",
  254.     "Romero",
  255.     "Packer",
  256.     "Monster",
  257.     "Admiral",
  258.     "Squalo",
  259.     "Seasparrow",
  260.     "Pizzaboy",
  261.     "Tram",
  262.     "Trailer",
  263.     "Turismo",
  264.     "Speeder",
  265.     "Reefer",
  266.     "Tropic",
  267.     "Flatbed",
  268.     "Yankee",
  269.     "Caddy",
  270.     "Solair",
  271.     "Berkley's RC Van",
  272.     "Skimmer",
  273.     "PCJ-600",
  274.     "Faggio",
  275.     "Freeway",
  276.     "RC Baron",
  277.     "RC Raider",
  278.     "Glendale",
  279.     "Oceanic",
  280.     "Sanchez",
  281.     "Sparrow",
  282.     "Patriot",
  283.     "Quad",
  284.     "Coastguard",
  285.     "Dinghy",
  286.     "Hermes",
  287.     "Sabre",
  288.     "Rustler",
  289.     "ZR-350",
  290.     "Walton",
  291.     "Regina",
  292.     "Comet",
  293.     "BMX",
  294.     "Burrito",
  295.     "Camper",
  296.     "Marquis",
  297.     "Baggage",
  298.     "Dozer",
  299.     "Maverick",
  300.     "News Chopper",
  301.     "Rancher",
  302.     "FBI Rancher",
  303.     "Virgo",
  304.     "Greenwood",
  305.     "Jetmax",
  306.     "Hotring",
  307.     "Sandking",
  308.     "Blista Compact",
  309.     "Police Maverick",
  310.     "Boxville",
  311.     "Benson",
  312.     "Mesa",
  313.     "RC Goblin",
  314.     "Hotring Racer A",
  315.     "Hotring Racer B",
  316.     "Bloodring Banger",
  317.     "Rancher",
  318.     "Super GT",
  319.     "Elegant",
  320.     "Journey",
  321.     "Bike",
  322.     "Mountain Bike",
  323.     "Beagle",
  324.     "Cropduster",
  325.     "Stunt",
  326.     "Tanker",
  327.     "Roadtrain",
  328.     "Nebula",
  329.     "Majestic",
  330.     "Buccaneer",
  331.     "Shamal",
  332.     "Hydra",
  333.     "FCR-900",
  334.     "NRG-500",
  335.     "HPV1000",
  336.     "Cement Truck",
  337.     "Tow Truck",
  338.     "Fortune",
  339.     "Cadrona",
  340.     "FBI Truck",
  341.     "Willard",
  342.     "Forklift",
  343.     "Tractor",
  344.     "Combine",
  345.     "Feltzer",
  346.     "Remington",
  347.     "Slamvan",
  348.     "Blade",
  349.     "Freight",
  350.     "Streak",
  351.     "Vortex",
  352.     "Vincent",
  353.     "Bullet",
  354.     "Clover",
  355.     "Sadler",
  356.     "Firetruck",
  357.     "Hustler",
  358.     "Intruder",
  359.     "Primo",
  360.     "Cargobob",
  361.     "Tampa",
  362.     "Sunrise",
  363.     "Merit",
  364.     "Utility",
  365.     "Nevada",
  366.     "Yosemite",
  367.     "Windsor",
  368.     "Monster",
  369.     "Monster",
  370.     "Uranus",
  371.     "Jester",
  372.     "Sultan",
  373.     "Stratium",
  374.     "Elegy",
  375.     "Raindance",
  376.     "RC Tiger",
  377.     "Flash",
  378.     "Tahoma",
  379.     "Savanna",
  380.     "Bandito",
  381.     "Freight Flat",
  382.     "Streak Carriage",
  383.     "Kart",
  384.     "Mower",
  385.     "Dune",
  386.     "Sweeper",
  387.     "Broadway",
  388.     "Tornado",
  389.     "AT-400",
  390.     "DFT-30",
  391.     "Huntley",
  392.     "Stafford",
  393.     "BF-400",
  394.     "News Van",
  395.     "Tug",
  396.     "Trailer",
  397.     "Emperor",
  398.     "Wayfarer",
  399.     "Euros",
  400.     "Hotdog",
  401.     "Club",
  402.     "Freight Box",
  403.     "Trailer",
  404.     "Andromada",
  405.     "Dodo",
  406.     "RC Cam",
  407.     "Launch",
  408.     "Police",
  409.     "Police",
  410.     "Police",
  411.     "Ranger",
  412.     "Picador",
  413.     "S.W.A.T",
  414.     "Alpha",
  415.     "Phoenix",
  416.     "Glendale Shit",
  417.     "Sadler Shit",
  418.     "Luggage",
  419.     "Luggage",
  420.     "Stairs",
  421.     "Boxville",
  422.     "Tiller",
  423.     "Utility Trailer"
  424. };
  425.  
  426. /* Stocks */
  427. stock AccountsPath(playerid)
  428. {
  429.     new string[128],playername[MAX_PLAYER_NAME];
  430.     GetPlayerName(playerid,playername,sizeof(playername));
  431.     format(string,sizeof(string),UserFiles,playername);
  432.     return string;
  433. }
  434.  
  435. stock udb_hash(buf[]) {
  436.     new length=strlen(buf);
  437.     new s1 = 1;
  438.     new s2 = 0;
  439.     new n;
  440.     for (n=0; n<length; n++)
  441.     {
  442.        s1 = (s1 + buf[n]) % 65521;
  443.        s2 = (s2 + s1)     % 65521;
  444.     }
  445.     return (s2 << 16) + s1;
  446. }
  447. stock RPN(playerid)
  448. {
  449.     new name[MAX_PLAYER_NAME];
  450.     GetPlayerName(playerid, name, sizeof(name));
  451.     return name;
  452. }
  453. stock PlayerNames(playerid)
  454. {
  455.     new pname[MAX_PLAYER_NAME];
  456.     GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
  457.     return pname;
  458. }
  459. stock GivePlayerScore(playerid, score)
  460. {
  461.     SetPlayerScore(playerid, GetPlayerScore(playerid)+score);
  462.     return 1;
  463. }
  464.  
  465. SendPlayerFormattedText(playerid, color, str[], define1[], define2[])
  466. {
  467.     new tstr[256];
  468.     format(tstr, 256, str, define1, define2);
  469.     SendClientMessage2(playerid, color, tstr);
  470.     return 1;
  471. }
  472.  
  473. SendAllFormattedText(color, str[], define1[], define2[])
  474. {
  475.     new tstr[256];
  476.     format(tstr, 256, str, define1, define2);
  477.     SendClientMessageToAll2(color, tstr);
  478.     return 1;
  479. }
  480. SendClientMessage2(playerid, color, message[])
  481. {
  482.     if (strlen(message) <= MAX_CLIENT_MSG_LENGTH)
  483.     {
  484.         SendClientMessage(playerid, color, message);
  485.     }
  486.     else
  487.     {
  488.         new string[MAX_CLIENT_MSG_LENGTH + 1];
  489.         strmid(string, message, 0, MAX_CLIENT_MSG_LENGTH);
  490.         SendClientMessage(playerid, color, string);
  491.     }
  492.     return 1;
  493. }
  494.  
  495. SendClientMessageToAll2(color, message[])
  496. {
  497.     for (new i = 0; i < PLAYERS; i++)
  498.     {
  499.         if (IsPlayerConnected2(i)) SendClientMessage2(i, color, message);
  500.     }
  501.     return 1;
  502. }
  503. ShowPlayerDialog2(playerid, dialogid, style, caption[], info[], button1[], button2[])
  504. {
  505.     ShowPlayerDialog(playerid, dialogid, style, caption, info, button1, button2);
  506.     pdialog[playerid] = dialogid;
  507. }
  508.  
  509. IsPlayerConnected2(playerid)
  510. {
  511.     return IsPlayerNPC(playerid) == 0 && playerid < sizeof(isconnected) ? isconnected[playerid] : 0;
  512. }
  513.  
  514. stock GetPlayerIpEx(playerid)
  515. {
  516.     new ip[16];
  517.     GetPlayerIp(playerid, ip, sizeof(ip));
  518.     return ip;
  519. }
  520. stock GetPlayerIDbyIP(const ip[])
  521. {
  522.         new pip[16];
  523.         for (new i = 0; i < GetMaxPlayers(); i ++)
  524.         {
  525.            if(!IsPlayerConnected(i)) continue;
  526.            GetPlayerIp(i, pip, 16);
  527.            if (!strcmp(ip, pip, true))
  528.            {
  529.                return i;
  530.            }
  531.         }
  532.         return -1;
  533. }
  534. SendMessageToAdmins(color, message[])
  535. {
  536.     for (new i = 0; i < PLAYERS; i++)
  537.     {
  538.         if (IsPlayerConnected2(i) && PlayerInfo[i][PlayerLevel] != 0) SendClientMessage2(i, color, message);
  539.     }
  540. }
  541. stock IsNumeric(const str[])
  542. {
  543.     for(new i, len = strlen(str); i < len; i++)
  544.     {
  545.         if(!('0' <= str[i] <= '9')) return false;
  546.     }
  547.     return true;
  548. }
  549.  
  550. GetPlayerFacingAngleFix(playerid, &Float:ang)
  551. {
  552.     if (IsPlayerInAnyVehicle(playerid))
  553.     {
  554.         GetVehicleZAngle(GetPlayerVehicleID(playerid), ang);
  555.     }
  556.     else
  557.     {
  558.         GetPlayerFacingAngle(playerid, ang);
  559.     }
  560. }
  561. SetPClassPosition(playerid, classid)
  562. {
  563.     new Float:angle = (360.0 / 50) * (50 - classid);
  564.     SetPlayerInterior(playerid, 0);
  565.     SetPlayerFacingAngle(playerid, angle);
  566.     SetPlayerPos(playerid, CLASS_X, CLASS_Y, CLASS_Z);
  567.     SetPlayerCameraPos(playerid, CLASS_X + floatsin(-angle, degrees) * 4.0, CLASS_Y + floatcos(-angle, degrees) * 4.0, CLASS_Z + 1.0);
  568.     SetPlayerCameraLookAt(playerid, CLASS_X, CLASS_Y, CLASS_Z);
  569. }
  570.  
  571. new autotips[NOW_MSSG][128];
  572. forward SendTipM();
  573. public SendTipM()
  574. {
  575.     static lm = 0;
  576.     new rand = random(NOW_MSSG);
  577.     while(rand == lm && NOW_MSSG != 1)  { rand = random(NOW_MSSG);  }
  578.     lm = rand;
  579.     SendClientMessageToAll(M_C, autotips[lm]);
  580. }
  581.  
  582. stock SendTip(text[])
  583. {
  584.     for(new m; m < NOW_MSSG; m++)
  585.     {
  586.         if(!strlen(autotips[m]))
  587.         {
  588.             strmid(autotips[m], text, 0, 127);
  589.             return 1;
  590.         }
  591.     }
  592.     return 0;
  593. }
  594.  
  595. //== Admins Ranks ==//
  596. stock AdminRanks(playerid)
  597. {
  598.     new strings[1000];
  599.     switch(PlayerInfo[playerid][PlayerLevel])
  600.     {
  601.         case 0: strings = "Normal Player";
  602.         case 1: strings = "Trial Moderator";
  603.         case 2: strings = "Global Moderator";
  604.         case 3: strings = "Moderator";
  605.         case 4: strings = "Head Administrator";
  606.         case 5: strings = "Server Manager";
  607.         case 6: strings = "Server Owner/Scripter";
  608.     }
  609.     return strings;
  610. }
  611.  
  612. public OnGameModeInit()
  613. {
  614.     SetGameModeText(""SV_GM"");
  615.     SendRconCommand("language "SV_LANG"");
  616.     SendRconCommand("rcon_password "SV_RCON"");
  617.     SendRconCommand("hostname "SV_NAME"");
  618.     SendRconCommand("weburl "SV_URL"");
  619.     SendRconCommand("mapname "SV_MAP"");
  620.     //AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
  621.     for (new classsel = 1; classsel < 300; classsel++)
  622.     {
  623.         if (classsel == 74) continue;
  624.         AddPlayerClass(classsel, CLASS_X, CLASS_Y, CLASS_Z, 0.0, 0, 0, 0, 0, 0, 0);
  625.     }
  626.     SetTimer("hostname",2000,true);
  627.     SetTimer("GiveScores", 120000, 1);
  628.     SetTimer("SendTipM", M_T * 1000, 1);
  629.    
  630.     SendTip(""COL_YELLOW"TIP"COL_WHITE": Type /cmds to see the server commands list.");
  631.     SendTip(""COL_YELLOW"TIP"COL_WHITE": Type /rules & /credits to read rules and credits of the server");
  632.     SendTip(""COL_YELLOW"TIP"COL_WHITE": Wanna be admin? then register on "SV_URL"");
  633.     SendTip(""COL_YELLOW"TIP"COL_WHITE": Wanna be helper? then register on "SV_URL"");
  634.     SendTip(""COL_YELLOW"TIP"COL_WHITE": 3");
  635.     SendTip(""COL_YELLOW"TIP"COL_WHITE": 4");
  636.     SendTip(""COL_YELLOW"TIP"COL_WHITE": 5");
  637.     SendTip(""COL_YELLOW"TIP"COL_WHITE": 6");
  638.     SendTip(""COL_YELLOW"TIP"COL_WHITE": 7");
  639.     return 1;
  640. }
  641. forward hostname();
  642. public hostname()
  643. {
  644.    new var = random(4);
  645.    switch (var)
  646.    {
  647.      case 0: SendRconCommand("hostname "SV_NAME"");
  648.      case 1: SendRconCommand("hostname "SV_SNAME"");
  649.    }
  650. }
  651.  
  652. forward GiveScores();
  653. public GiveScores()
  654. {
  655.     SendClientMessageToAll(-1, "[Scores]: {00FF00}Server Developers/Admins {FFFFFF}gave you 10 scores and 1000 money, aren't they good.");
  656.     for (new i=0; i<MAX_PLAYERS; i++)
  657.     {
  658.         if (IsPlayerConnected(i))
  659.         {
  660.             GivePlayerScore(i, 10);
  661.             PlayerInfo[i][PlayerScore]+=10;
  662.             GivePlayerMoney(i, 1000);
  663.             PlayerInfo[i][PlayerMoney]+=1000;
  664.         }
  665.     }
  666.     return 1;
  667. }
  668.  
  669. public OnGameModeExit()
  670. {
  671.     return 1;
  672. }
  673.  
  674. public OnPlayerRequestClass(playerid, classid)
  675. {
  676.     if (IsPlayerNPC(playerid)) return 1;
  677.     SetPClassPosition(playerid, classid);
  678.     return 1;
  679. }
  680.  
  681. public OnPlayerConnect(playerid)
  682. {
  683.     new playeridname[MAX_PLAYER_NAME], str[256];
  684.     GetPlayerName(playerid, playeridname, sizeof(playeridname));
  685.     if(strfind(playeridname,""CLAN_TAG"",true) != -1) {
  686.         if(PlayerInfo[playerid][ClanMember]==0)  {
  687.             format(str, sizeof(str), "You are not in the "CLAN_TAG" clan. If you want to wear the clan tag you can apply for it on "SV_URL"");
  688.             SendClientMessage(playerid, COLOR_RED, str);
  689.             SetTimerEx("Kicker", 50, 0, "dd", playerid, 1);
  690.             return 1;
  691.         }
  692.     }
  693.     else if(strfind(playeridname,""CLAN_TAG"",false) != 0) {
  694.         if(PlayerInfo[playerid][ClanMember]==1) {
  695.             format(str, sizeof(str), "You are from "CLAN_TAG" clan. you can put "CLAN_TAG" in your name if you want.");
  696.             SendClientMessage(playerid, COLOR_WHITE, str);
  697.             return 1;
  698.         }
  699.     }
  700.     if (isconnected[playerid] == 0)
  701.     {
  702.         isconnected[playerid] = 1;
  703.         SetPlayerColor(playerid, COLOR_PLAYER);
  704.         SetPlayerVirtualWorld(playerid, 1);
  705.         new playername[MAX_PLAYER_NAME];
  706.         GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  707.  
  708.         if(fexist(AccountsPath(playerid)))
  709.         {
  710.             INI_ParseFile(AccountsPath(playerid), "LoadPlayer_data", .bExtra = true, .extra = playerid);
  711.             format(str, sizeof(str), "Welcome to {00FFF3}%s.\n\n{FFFF00}Account:{FFFFFF} %s\n\nPlease enter your password below:", SV_NAME, RPN(playerid));
  712.             ShowPlayerDialog2(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""COL_RED"Login", str, "Login", "Cancel");
  713.             SendPlayerFormattedText(playerid, COLOR_LBLUE, "Welcome back %s to {FF33CC}"SV_NAME"{FFFFFF}.", playername, "");
  714.             playerlogged[playerid] = 1;
  715.         }
  716.         else
  717.         {
  718.             format(str, sizeof(str), "Welcome to {FFB900}%s.\n\n{FFFF00}Account:{FFFFFF} %s\n\nRegister an account to play.\n\nPlease put the password below:", SV_NAME, RPN(playerid));
  719.             ShowPlayerDialog2(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_GREEN"Register", str, "Continue", "Cancel");
  720.             SendPlayerFormattedText(playerid, COLOR_WHITE, "Welcome %s to {FF33CC}"SV_NAME"{FFFFFF}.", playername, "");
  721.             playerlogged[playerid] = 1;
  722.         }
  723.         return 0;
  724.     }
  725.     playerlogged[playerid] = 0;
  726.     return 1;
  727. }
  728.  
  729. public OnPlayerDisconnect(playerid, reason)
  730. {
  731.     new playernames[25];
  732.     if(playerlogged[playerid] == 1)
  733.     {
  734.      new INI:File = INI_Open(AccountsPath(playerid));
  735.      INI_SetTag(File,"Player Data");
  736.      INI_WriteInt(File,"Player Name",GetPlayerName(playerid, playernames, MAX_PLAYER_NAME));
  737.      INI_WriteInt(File,"money",GetPlayerMoney(playerid));
  738.      INI_WriteInt(File,"adminlevel",PlayerInfo[playerid][PlayerLevel]);
  739.      INI_WriteInt(File,"scores",GetPlayerScore(playerid));
  740.      INI_WriteInt(File,"kills",PlayerInfo[playerid][PlayerKills]);
  741.      INI_WriteInt(File,"deaths",PlayerInfo[playerid][PlayerDeaths]);
  742.      INI_WriteInt(File,"playerbanned",PlayerInfo[playerid][PlayerBanned]);
  743.      INI_WriteInt(File,"playerip",PlayerInfo[playerid][PlayerIP]);
  744.      INI_WriteInt(File,"lactive_y", PlayerInfo[playerid][LastActive_Y]);
  745.      INI_WriteInt(File,"lactive_m", PlayerInfo[playerid][LastActive_M]);
  746.      INI_WriteInt(File,"lactive_d", PlayerInfo[playerid][LastActive_D]);
  747.      INI_WriteInt(File,"ClanMember",PlayerInfo[playerid][ClanMember]);
  748.      INI_Close(File);
  749.     }
  750.     playerlogged[playerid] = 0;
  751.     return 1;
  752. }
  753.  
  754. public OnPlayerSpawn(playerid)
  755. {
  756.     if(IsPlayerNPC(playerid)) return 1;
  757.     new name[MAX_PLAYER_NAME];
  758.     GetPlayerName(playerid, name, sizeof(name));
  759.     SetPlayerVirtualWorld(playerid, 0);
  760.     SetPlayerInterior(playerid, 0);
  761.     return 1;
  762. }
  763.  
  764. public OnPlayerDeath(playerid, killerid, reason)
  765. {
  766.     PlayerInfo[killerid][PlayerKills]++;
  767.     PlayerInfo[playerid][PlayerDeaths]++;
  768.     return 1;
  769. }
  770.  
  771. public OnVehicleSpawn(vehicleid)
  772. {
  773.     return 1;
  774. }
  775.  
  776. public OnVehicleDeath(vehicleid, killerid)
  777. {
  778.     return 1;
  779. }
  780.  
  781. public OnPlayerText(playerid, text[])
  782. {
  783.     return 1;
  784. }
  785.  
  786. public OnPlayerCommandText(playerid, cmdtext[])
  787. {
  788.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  789.     {
  790.         // Do something here
  791.         return 1;
  792.     }
  793.     return 0;
  794. }
  795.  
  796. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  797. {
  798.     return 1;
  799. }
  800.  
  801. public OnPlayerExitVehicle(playerid, vehicleid)
  802. {
  803.     return 1;
  804. }
  805.  
  806. public OnPlayerStateChange(playerid, newstate, oldstate)
  807. {
  808.     return 1;
  809. }
  810.  
  811. public OnPlayerEnterCheckpoint(playerid)
  812. {
  813.     return 1;
  814. }
  815.  
  816. public OnPlayerLeaveCheckpoint(playerid)
  817. {
  818.     return 1;
  819. }
  820.  
  821. public OnPlayerEnterRaceCheckpoint(playerid)
  822. {
  823.     return 1;
  824. }
  825.  
  826. public OnPlayerLeaveRaceCheckpoint(playerid)
  827. {
  828.     return 1;
  829. }
  830.  
  831. public OnRconCommand(cmd[])
  832. {
  833.     return 1;
  834. }
  835.  
  836. public OnPlayerRequestSpawn(playerid)
  837. {
  838.     return 1;
  839. }
  840.  
  841. public OnObjectMoved(objectid)
  842. {
  843.     return 1;
  844. }
  845.  
  846. public OnPlayerObjectMoved(playerid, objectid)
  847. {
  848.     return 1;
  849. }
  850.  
  851. public OnPlayerPickUpPickup(playerid, pickupid)
  852. {
  853.     return 1;
  854. }
  855.  
  856. public OnVehicleMod(playerid, vehicleid, componentid)
  857. {
  858.     return 1;
  859. }
  860.  
  861. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  862. {
  863.     return 1;
  864. }
  865.  
  866. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  867. {
  868.     return 1;
  869. }
  870.  
  871. public OnPlayerSelectedMenuRow(playerid, row)
  872. {
  873.     return 1;
  874. }
  875.  
  876. public OnPlayerExitedMenu(playerid)
  877. {
  878.     return 1;
  879. }
  880.  
  881. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  882. {
  883.     return 1;
  884. }
  885.  
  886. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  887. {
  888.     return 1;
  889. }
  890.  
  891. public OnRconLoginAttempt(ip[], password[], success)
  892. {
  893.     return 1;
  894. }
  895.  
  896. public OnPlayerUpdate(playerid)
  897. {
  898.     return 1;
  899. }
  900.  
  901. public OnPlayerStreamIn(playerid, forplayerid)
  902. {
  903.     return 1;
  904. }
  905.  
  906. public OnPlayerStreamOut(playerid, forplayerid)
  907. {
  908.     return 1;
  909. }
  910.  
  911. public OnVehicleStreamIn(vehicleid, forplayerid)
  912. {
  913.     return 1;
  914. }
  915.  
  916. public OnVehicleStreamOut(vehicleid, forplayerid)
  917. {
  918.     return 1;
  919. }
  920.  
  921. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  922. {
  923.     new str[270], playername[25], playernames[25];
  924.     GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  925.     if(dialogid == DIALOG_REGISTER)
  926.     {
  927.       if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_GREEN"Register",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Cancel");
  928.       new pIP[16];
  929.       new year, month, day;
  930.       getdate(year, month, day);
  931.       GetPlayerIp(playerid, pIP, sizeof(pIP));
  932.       new INI:File = INI_Open(AccountsPath(playerid));
  933.       INI_SetTag(File,"Player Data");
  934.       INI_WriteInt(File,"password",udb_hash(inputtext));
  935.       INI_WriteInt(File,"Player Name", GetPlayerName(playerid, playernames, MAX_PLAYER_NAME));
  936.       INI_WriteInt(File,"money", REGISTER_MONEY);
  937.       INI_WriteInt(File,"adminlevel",0);
  938.       INI_WriteInt(File,"scores", REGISTER_SCORE);
  939.       INI_WriteInt(File,"kills",0);
  940.       INI_WriteInt(File,"deaths",0);
  941.       INI_WriteInt(File,"playerbanned",0);
  942.       INI_WriteString(File, "playerip", pIP);
  943.       INI_WriteInt(File, "lactive_y", year);
  944.       INI_WriteInt(File, "lactive_m", month);
  945.       INI_WriteInt(File, "lactive_d", day);
  946.       INI_WriteInt(File,"ClanMember",0);
  947.       INI_Close(File);
  948.       GivePlayerMoney(playerid, REGISTER_MONEY);
  949.       GivePlayerScore(playerid, REGISTER_SCORE);
  950.       playerlogged[playerid] = 1;
  951.       SendPlayerFormattedText(playerid, COLOR_YELLOW, "Account '%s' created, you have been logged in automatically!", playername, "");
  952.       SendAllFormattedText(COLOR_GREEN, "%s has registered a new account. Welcome to our server!", playername, "");
  953.       printf("[registered] %s (Id%d) has registered a new account.", playername, playerid);
  954.     }
  955.     else
  956.     {
  957.      SendClientMessage(playerid, COLOR_WHITE,"You must login/register to play here.");
  958.     }
  959.     if(dialogid == DIALOG_LOGIN)
  960.     {
  961.       if(udb_hash(inputtext) == PlayerInfo[playerid][PlayerPass])
  962.       {
  963.        //INI_ParseFile(AccountsPath(playerid), "LoadPlayer_%s", .bExtra = true, .extra = playerid);
  964.        SetPlayerScore(playerid,  PlayerInfo[playerid][PlayerScore]);
  965.        GivePlayerMoney(playerid, PlayerInfo[playerid][PlayerMoney]);
  966.  
  967.        playerlogged[playerid] = 1;
  968.        SendClientMessage(playerid, COLOR_GREEN,"Login successful, your status has been restored!");
  969.        printf("[logged] %s (Id%d) has logged in.", playername, playerid);
  970.         }
  971.         else
  972.         {
  973.             format(str, sizeof(str), "Welcome to {00FFF3}%s.\n\n{FFFF00}Account:{FFFFFF} %s\n\n"COL_RED"You have entered incorrrect password.\n"COL_WHITE"Please put correct password.", SV_NAME, RPN(playerid));
  974.             ShowPlayerDialog2(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""COL_RED"Login", str, "Login", "Cancel");
  975.         }
  976.      }
  977.     return 1;
  978. }
  979.  
  980. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  981. {
  982.     new string[128], strings[128];
  983.     format(string, sizeof(string), "%s Stats", RPN(clickedplayerid));
  984.     format(string, sizeof(string), "*Name: %s\n*ID: %d\n*Score: %d\n*Kills: %i\n**Deaths: %i\n*Money: %d\n*Adminlevel: %d", RPN(playerid), playerid, GetPlayerScore(playerid), PlayerInfo[playerid][PlayerKills], PlayerInfo[playerid][PlayerDeaths], GetPlayerMoney(playerid), PlayerInfo[playerid][PlayerLevel]);
  985.     ShowPlayerDialog2(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, strings, string, "Ok", "Cancel");
  986.     return 1;
  987. }
  988.  
  989. /* Server Commands */
  990. CMD:cmds(playerid, params[])
  991. {
  992.  SendClientMessage(playerid, COLOR_YELLOW, ""SV_NAME"'s Commands.");
  993.  SendClientMessage(playerid, COLOR_YELLOW, "/register, /login, /stats, /admins, /richlist, /topkills, /topdeaths");
  994.  SendClientMessage(playerid, COLOR_YELLOW, "/credits");
  995.  return 1;
  996. }
  997. CMD:admincmds(playerid, params[])
  998. {
  999.  if(PlayerInfo[playerid][PlayerLevel] == 1)
  1000.  {
  1001.   SendClientMessage(playerid, COLOR_YELLOW, "Admin Level 1 Commands.");
  1002.   SendClientMessage(playerid, COLOR_YELLOW, "Level 1: /ac, /asay");
  1003.   return 1;
  1004.  }
  1005.  else if(PlayerInfo[playerid][PlayerLevel] == 2)
  1006.  {
  1007.   SendClientMessage(playerid, COLOR_YELLOW, "Admin Level 1,2 Commands.");
  1008.   SendClientMessage(playerid, COLOR_YELLOW, "Level 1: /ac, /asay");
  1009.   SendClientMessage(playerid, COLOR_YELLOW, "Level 2: /getip, /resetcash");
  1010.   return 1;
  1011.  }
  1012.  else if(PlayerInfo[playerid][PlayerLevel] == 3)
  1013.  {
  1014.   SendClientMessage(playerid, COLOR_YELLOW, "Admin Level 1,2,3 Commands.");
  1015.   SendClientMessage(playerid, COLOR_YELLOW, "Level 1: /ac, /asay");
  1016.   SendClientMessage(playerid, COLOR_YELLOW, "Level 2: /getip, /resetcash");
  1017.   SendClientMessage(playerid, COLOR_YELLOW, "Level 3: /givemoney, /kick");
  1018.   return 1;
  1019.  }
  1020.  else if(PlayerInfo[playerid][PlayerLevel] == 4)
  1021.  {
  1022.   SendClientMessage(playerid, COLOR_YELLOW, "Admin Level 1,2,3,4 Commands.");
  1023.   SendClientMessage(playerid, COLOR_YELLOW, "Level 1: /ac, /asay");
  1024.   SendClientMessage(playerid, COLOR_YELLOW, "Level 2: /getip, /resetcash");
  1025.   SendClientMessage(playerid, COLOR_YELLOW, "Level 3: /givemoney, /kick");
  1026.   SendClientMessage(playerid, COLOR_YELLOW, "Level 4: /oban, /ounban, /banip, /unbanip, /givecar, /(v)ehicle");
  1027.   return 1;
  1028.  }
  1029.  else if(PlayerInfo[playerid][PlayerLevel] == 5)
  1030.  {
  1031.   SendClientMessage(playerid, COLOR_YELLOW, "Admin Level 1,2,3,4,5 Commands.");
  1032.   SendClientMessage(playerid, COLOR_YELLOW, "Level 1: /ac, /asay");
  1033.   SendClientMessage(playerid, COLOR_YELLOW, "Level 2: /getip, /resetcash");
  1034.   SendClientMessage(playerid, COLOR_YELLOW, "Level 3: /givemoney, /kick");
  1035.   SendClientMessage(playerid, COLOR_YELLOW, "Level 4: /oban, /ounban, /banip, /unbanip, /givecar, /(v)ehicle");
  1036.   SendClientMessage(playerid, COLOR_YELLOW, "Level 5: /setscore, /setmoney, /ban");
  1037.   return 1;
  1038.  }
  1039.  else if(PlayerInfo[playerid][PlayerLevel] == 6)
  1040.  {
  1041.   SendClientMessage(playerid, COLOR_YELLOW, "Admin Level 1,2,3,4,5,6 Commands.");
  1042.   SendClientMessage(playerid, COLOR_YELLOW, "Level 1: /ac, /asay");
  1043.   SendClientMessage(playerid, COLOR_YELLOW, "Level 2: /getip, /resetcash");
  1044.   SendClientMessage(playerid, COLOR_YELLOW, "Level 3: /givemoney, /kick");
  1045.   SendClientMessage(playerid, COLOR_YELLOW, "Level 4: /oban, /ounban, /banip, /unbanip, /givecar, /(v)ehicle");
  1046.   SendClientMessage(playerid, COLOR_YELLOW, "Level 5: /setscore, /setmoney, /ban");
  1047.   SendClientMessage(playerid, COLOR_YELLOW, "Level 6: /setadmin, /restart");
  1048.   return 1;
  1049.  }
  1050.  else SendClientMessage(playerid, COLOR_WHITE,"Unknown Command.");
  1051.  return 1;
  1052. }
  1053. CMD:register(playerid, params[])
  1054. {
  1055.     new playername[MAX_PLAYER_NAME];
  1056.     if (playerlogged[playerid] == 0)
  1057.     {
  1058.         GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  1059.         if(fexist(AccountsPath(playerid))) ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_GREEN"Register", "Type a password below to register an account.", "Continue", "Cancel");
  1060.         else SendClientMessage2(playerid, COLOR_WHITE, "Account already exists! Type /login to continue.");
  1061.     }
  1062.     else SendClientMessage2(playerid, COLOR_WHITE, "You are already registered!");
  1063.     return 1;
  1064. }
  1065.  
  1066. CMD:login(playerid, params[])
  1067. {
  1068.     new playername[MAX_PLAYER_NAME];
  1069.     if (playerlogged[playerid] == 0)
  1070.     {
  1071.         GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  1072.         if(fexist(AccountsPath(playerid)))
  1073.         {
  1074.           ShowPlayerDialog2(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, ""COL_RED"Login", "Type your password below to login to your account.", "Login", "Cancel");
  1075.         }
  1076.         else SendClientMessage2(playerid, COLOR_WHITE, "Account doesn't exist! Type /register to continue.");
  1077.     }
  1078.     else SendClientMessage2(playerid, COLOR_WHITE, "You are already logged in!");
  1079.     return 1;
  1080. }
  1081. CMD:admins(playerid, params[])
  1082. {
  1083.   new admins, strings[270];
  1084.   if(PlayerInfo[playerid][PlayerScore] < 100) return SendClientMessage(playerid, COLOR_WHITE,"[Server]: You must have 100 Scores to see online admins");
  1085.   SendClientMessage(playerid, COLOR_BLUE, "Online Admins");
  1086.   for(new i = 0; i < MAX_PLAYERS; i++)
  1087.   {
  1088.    if (IsPlayerConnected(i))
  1089.    {
  1090.     if(PlayerInfo[i][PlayerLevel] >= 1)
  1091.     {
  1092.        new string[128], pname[24];
  1093.        GetPlayerName(i, pname, sizeof(pname));
  1094.        admins++;
  1095.        format(string, sizeof(string), "%s {00FF00} Admin Level: {FF0000}%d [%s]", pname, PlayerInfo[i][PlayerLevel], AdminRanks(i));
  1096.        SendClientMessage(playerid, COLOR_RED, string);
  1097.     }
  1098.   }
  1099.   }
  1100.   if (admins == 0)
  1101.   {
  1102.    SendClientMessage(playerid, COLOR_RED, "[Server]: Their are no admins online.");
  1103.   }
  1104.   else
  1105.   {
  1106.    format(strings, sizeof(strings), "[Server]: There are currently %d Admins online.", admins);
  1107.    SendClientMessage(playerid, COLOR_GREEN, strings);
  1108.   }
  1109.   return 1;
  1110. }
  1111. /*CMD:admins(playerid, params[])
  1112. {
  1113.   SendClientMessage(playerid, COLOR_BLUE, "Online Admins");
  1114.   for(new i = 0; i < MAX_PLAYERS; i++)
  1115.   {
  1116.     if(PlayerInfo[i][PlayerLevel] >= 1)
  1117.     {
  1118.        new string[128], pname[24];
  1119.        GetPlayerName(i, pname, sizeof(pname));
  1120.        format(string, sizeof(string), "%s {00FF00} Admin Level: {FF0000}%d", pname, PlayerInfo[i][PlayerLevel]);
  1121.        SendClientMessage(playerid, COLOR_RED, string);
  1122.     }
  1123.   }
  1124.   return 1;
  1125. }*/
  1126.  
  1127. CMD:setadmin(playerid, params[])
  1128. {
  1129.     new giveplayerid, moneys1, giveplayer[25], playername[25], string[256];
  1130.     if (PlayerInfo[playerid][PlayerLevel] < 6 && !IsPlayerAdmin(playerid)) return 0;
  1131.     if (sscanf(params, "ud", giveplayerid, moneys1)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /setadmin [playerid] [level 1-6]");
  1132.     if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
  1133.     if (moneys1 < 0 || moneys1 > 6) return SendClientMessage2(playerid, COLOR_RED, "Error: Invalid admin level.");
  1134.     if (playerlogged[giveplayerid] == 0) return SendClientMessage2(playerid, COLOR_WHITE, "Error: Player isn't logged in.");
  1135.     GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
  1136.     if (PlayerInfo[giveplayerid][PlayerLevel] >= PlayerInfo[playerid][PlayerLevel] && PlayerInfo[playerid][PlayerLevel] < 6 && !IsPlayerAdmin(playerid)) return SendPlayerFormattedText(playerid, COLOR_RED, "Error: You cannot Make admin %s", giveplayer, "");
  1137.     GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
  1138.     if (moneys1 == PlayerInfo[giveplayerid][PlayerLevel])
  1139.     {
  1140.         format(string, 64, "%s is already admin level %d.", giveplayer, moneys1);
  1141.         SendClientMessage2(playerid, COLOR_WHITE, string);
  1142.         return 1;
  1143.     }
  1144.     GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  1145.     PlayerInfo[giveplayerid][PlayerLevel] = moneys1;
  1146.     format(string, 64, "You have been set as admin level %d.", moneys1);
  1147.     SendClientMessage2(giveplayerid, COLOR_YELLOW, string);
  1148.     format(string, 64, "You have set %s as admin level %d.", giveplayer, moneys1);
  1149.     SendClientMessage2(playerid, COLOR_YELLOW, string);
  1150.     return 1;
  1151. }
  1152.  
  1153. CMD:ac(playerid, params[])
  1154. {
  1155.     new string[172];
  1156.     if(PlayerInfo[playerid][PlayerLevel] < 1) return 0;
  1157.     if(isnull(params)) return SendClientMessage(playerid, -1, "Please use /ac [Message]");
  1158.     new PName[MAX_PLAYER_NAME+1];
  1159.     GetPlayerName(playerid, PName, sizeof(PName));
  1160.     format(string, sizeof(string), "[Admin Chat][%s] %s: %s", AdminRanks(playerid),PName, params);
  1161.     SendMessageToAdmins(COLOR_RED, string);
  1162.     return 1;
  1163. }
  1164.  
  1165. CMD:asay(playerid, params[])
  1166.   {
  1167.   if(PlayerInfo[playerid][PlayerLevel] < 1) return 0;
  1168.   new text[128];
  1169.   if(sscanf(params, "s[128]",text)) return SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /asay [text]");
  1170.   new string[128];
  1171.   new pName[128];
  1172.   GetPlayerName(playerid,pName,128);
  1173.   format(string,sizeof string,"[%s]%s: %s",AdminRanks(playerid),pName,text);
  1174.   SendClientMessageToAll(COLOR_GREEN,string);
  1175.   return 1;
  1176. }
  1177.  
  1178. CMD:setscore(playerid, params[])
  1179. {
  1180.     new giveplayerid, moneys1, giveplayer[25], string[256];
  1181.     if (PlayerInfo[playerid][PlayerLevel] < 5) return 0;
  1182.     if (sscanf(params, "ud", giveplayerid, moneys1)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /setscore [playerid] [score]");
  1183.     if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
  1184.     if (moneys1 < 0 || moneys1 > cellmax) return SendClientMessage2(playerid, COLOR_RED, "Invalid score! Select from 0 - 2147483647.");
  1185.     if (playerlogged[giveplayerid] == 0) return SendClientMessage2(playerid, COLOR_WHITE, "Error: Player isn't logged in.");
  1186.     GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
  1187.     if (PlayerInfo[giveplayerid][PlayerLevel] > PlayerInfo[playerid][PlayerLevel] || PlayerInfo[playerid][PlayerLevel] < 6) return SendPlayerFormattedText(playerid, COLOR_RED, "Error: You cannot Set score to %s", giveplayer, "");
  1188.     PlayerInfo[giveplayerid][PlayerScore] = moneys1;
  1189.     SetPlayerScore(giveplayerid, moneys1);
  1190.     GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
  1191.     if (giveplayerid != playerid)
  1192.     {
  1193.         format(string, 128, "An admin has set your score to %d.", moneys1);
  1194.         SendClientMessage2(giveplayerid, COLOR_YELLOW, string);
  1195.         format(string, 128, "You have set %s's score to %d.", giveplayer, moneys1);
  1196.         SendClientMessage2(playerid, COLOR_YELLOW, string);
  1197.     }
  1198.     else
  1199.     {
  1200.         format(string, 128, "You have set your score to %d.", moneys1);
  1201.         SendClientMessage2(playerid, COLOR_YELLOW, string);
  1202.     }
  1203.     return 1;
  1204. }
  1205.  
  1206. CMD:setmoney(playerid, params[])
  1207. {
  1208.     new giveplayerid, moneys1, playername[25], giveplayer[25], string[256];
  1209.     if (PlayerInfo[playerid][PlayerLevel] < 5) return 0;
  1210.     if (sscanf(params, "ud", giveplayerid, moneys1)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /setmoney [playerid] [amount]");
  1211.     if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
  1212.     if (moneys1 < 0 || moneys1 > MAX_MONEY) return SendClientMessage2(playerid, COLOR_RED, "Error: Invalid amount.");
  1213.     GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  1214.     GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
  1215.     SetPlayerMoney(giveplayerid, 0);
  1216.     GivePlayerMoney(giveplayerid, moneys1);
  1217.     PlayerInfo[giveplayerid][PlayerMoney] = moneys1;
  1218.     if (giveplayerid != playerid)
  1219.     {
  1220.         format(string, 128, "Your money has been set to $%d by an admin.", moneys1);
  1221.         SendClientMessage2(giveplayerid, COLOR_SILVER, string);
  1222.         format(string, 128, "You have set %s's money to $%d.", giveplayer, moneys1);
  1223.         SendClientMessage2(playerid, COLOR_SILVER, string);
  1224.     }
  1225.     else
  1226.     {
  1227.         format(string, 128, "You have set your money to $%d.", moneys1);
  1228.         SendClientMessage2(playerid, COLOR_SILVER, string);
  1229.     }
  1230.     printf("[setmoney] %s has set player %s's (Id%d) money to $%d.", playername, giveplayer, giveplayerid, moneys1);
  1231.     return 1;
  1232. }
  1233.  
  1234. CMD:givemoney(playerid, params[])
  1235. {
  1236.     new giveplayerid, moneys1, playername[25], giveplayer[25], string[256];
  1237.     if (PlayerInfo[playerid][PlayerLevel] < 3) return 0;
  1238.     if (sscanf(params, "ud", giveplayerid, moneys1)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /givemoney [playerid] [amount]");
  1239.     if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
  1240.     if (moneys1 < 1 || moneys1 > MAX_MONEY) return SendClientMessage2(playerid, COLOR_RED, "Error: Invalid amount.");
  1241.     GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  1242.     GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
  1243.     GivePlayerMoney(giveplayerid, moneys1);
  1244.     if (giveplayerid != playerid)
  1245.     {
  1246.         format(string, 128, "An admin has given you $%d.", moneys1);
  1247.         SendClientMessage2(giveplayerid, COLOR_SILVER, string);
  1248.         format(string, 128, "You have given %s $%d.", giveplayer, moneys1);
  1249.         SendClientMessage2(playerid, COLOR_SILVER, string);
  1250.     }
  1251.     else
  1252.     {
  1253.         format(string, 128, "You have gave yourself $%d.", moneys1);
  1254.         SendClientMessage2(playerid, COLOR_SILVER, string);
  1255.     }
  1256.     printf("[givemoney] %s has given player %s (Id%d) $%d.", playername, giveplayer, giveplayerid, moneys1);
  1257.     return 1;
  1258. }
  1259.  
  1260. CMD:resetcash(playerid, params[])
  1261. {
  1262.     new giveplayerid, giveplayer[25], playername[25];
  1263.     if (PlayerInfo[playerid][PlayerLevel] < 2) return 0;
  1264.     if (sscanf(params, "u", giveplayerid)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /resetcash [playerid]");
  1265.     if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
  1266.     GetPlayerName(playerid, playername, MAX_PLAYER_NAME);
  1267.     GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
  1268.     SetPlayerMoney(giveplayerid, 0);
  1269.     PlayerInfo[giveplayerid][PlayerMoney] = 0;
  1270.     if (giveplayerid != playerid)
  1271.     {
  1272.         SendClientMessage2(giveplayerid, COLOR_RED, "Your cash has been reset by an admin.");
  1273.         SendPlayerFormattedText(playerid, COLOR_RED, "You have reset %s's cash.", giveplayer, "");
  1274.     }
  1275.     else SendClientMessage2(playerid, COLOR_RED, "You have reset your cash.");
  1276.     printf("[resetcash] %s has reset player %s's (Id%d) cash.", playername, giveplayer, giveplayerid);
  1277.     return 1;
  1278. }
  1279. CMD:oban(playerid, params[])
  1280. {
  1281.     new targetname[24], filestring[79];
  1282.     if (PlayerInfo[playerid][PlayerLevel] < 4 && !IsPlayerAdmin(playerid)) return 0;
  1283.     if(sscanf(params, "s[24]", targetname)) return SendClientMessage(playerid, COLOR_WHITE, "Correct Usage: /oban [Name]");
  1284.     format(filestring, sizeof(filestring), "/Accounts/%s.ini", targetname);
  1285.     if(!fexist(filestring)) return SendClientMessage(playerid, -1, "Error: Account Doesn't Exist.");
  1286.     else
  1287.     {
  1288.         new INI:File = INI_Open(filestring);
  1289.         INI_SetTag(File, "Player Data");
  1290.         INI_WriteInt(File, "PlayerBanned", 1);
  1291.         INI_Close(File);
  1292.         new done[128];
  1293.         format(done, sizeof(done), "You have banned %s", targetname);
  1294.         SendClientMessage(playerid, COLOR_YELLOW, done);
  1295.     }
  1296.     return 1;
  1297. }
  1298.  
  1299. CMD:ounban(playerid, params[])
  1300. {
  1301.     new tname[24];
  1302.     if (PlayerInfo[playerid][PlayerLevel] < 4 && !IsPlayerAdmin(playerid)) return 0;
  1303.     if(sscanf(params, "s[24]", tname)) return SendClientMessage(playerid,-1,"Correct Usage: /ounban [Name] ");
  1304.     new filestring[79];
  1305.     format(filestring, sizeof(filestring), "/Accounts/%s.ini", tname);
  1306.     if(!fexist(filestring)) return SendClientMessage(playerid, COLOR_WHITE, "Error: Account Doesn't Exist.");
  1307.     else
  1308.     {
  1309.         new INI:File = INI_Open(filestring);
  1310.         INI_SetTag(File, "Player Data");
  1311.         INI_WriteInt(File, "PlayerBanned",0);
  1312.         INI_Close(File);
  1313.         SendRconCommand("reloadbans");
  1314.         new done[128];
  1315.         format(done, sizeof(done),"You have successfully unbanned %s", tname);
  1316.         SendClientMessage(playerid, COLOR_YELLOW,done);
  1317.     }
  1318.     return 1;
  1319. }
  1320.  
  1321. CMD:getip(playerid, params[])
  1322. {
  1323.     new giveplayerid, giveplayer[25], tmp2[256],options[128];
  1324.     if (PlayerInfo[playerid][PlayerLevel] < 2) return 0;
  1325.     if(sscanf(params, "s[128]u", options,giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /getip [playerid]");
  1326.     if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
  1327.     {
  1328.      GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
  1329.      GetPlayerIp(giveplayerid, tmp2, 16);
  1330.      SendPlayerFormattedText(playerid, COLOR_WHITE, "%s's ip address is %s", giveplayer, tmp2);
  1331.     }
  1332.     return 1;
  1333. }
  1334.  
  1335. CMD:banip(playerid, params[])
  1336. {
  1337.     new tmp[256], tmp2[256];
  1338.     if(PlayerInfo[playerid][PlayerLevel] < 4) return 0;
  1339.     if (sscanf(params, "s[128]", tmp)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /banip [ip address]");
  1340.     format(tmp2, 32, "banip %s", tmp);
  1341.     SendRconCommand(tmp2);
  1342.     SendRconCommand("reloadbans");
  1343.     SendPlayerFormattedText(playerid, COLOR_WHITE, "You have banned IP address %s.", tmp, "");
  1344.     return 1;
  1345. }
  1346.  
  1347. CMD:unbanip(playerid, params[])
  1348. {
  1349.     new tmp[256], tmp2[256];
  1350.     if(PlayerInfo[playerid][PlayerLevel] < 4) return 0;
  1351.     if (sscanf(params, "s[128]", tmp)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /unbanip [ip address]");
  1352.     format(tmp2, 32, "unbanip %s", tmp);
  1353.     SendRconCommand(tmp2);
  1354.     SendRconCommand("reloadbans");
  1355.     SendPlayerFormattedText(playerid, COLOR_WHITE, "You have unbanned IP address %s.", tmp, "");
  1356.     return 1;
  1357. }
  1358.  
  1359. CMD:ban(playerid, params[])
  1360.     {
  1361.         if(PlayerInfo[playerid][PlayerLevel] < 5) return 0;
  1362.         new player;
  1363.         new reason[64];
  1364.         new str[128];
  1365.         new giveplayerid, giveplayer[25];
  1366.         new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
  1367.         GetPlayerName(playerid, Adminname, sizeof(Adminname));
  1368.         GetPlayerName(player, Playername, sizeof(Playername));
  1369.         if (PlayerInfo[giveplayerid][PlayerLevel] > PlayerInfo[playerid][PlayerLevel] && PlayerInfo[playerid][PlayerLevel] < 6 && PlayerInfo[giveplayerid][PlayerLevel] > 6) return SendPlayerFormattedText(playerid, COLOR_RED, "Error: You cannot ban %s.", giveplayer, "");
  1370.         if(sscanf(params, "us[64]", player,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /kick [playerid] [reason]");
  1371.         if(!IsPlayerConnected(player))
  1372.         return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
  1373.         format(str, sizeof(str), "'%s' has been banned by administrator '%s'. Reason: %s ", Playername, Adminname, reason);
  1374.         SendClientMessageToAll(COLOR_RED, str);
  1375.         Ban(player);
  1376.         return 1;
  1377. }
  1378.  
  1379. CMD:kick(playerid,params[])
  1380. {
  1381.          new player,gname[MAX_PLAYER_NAME],string[125],reason[70], giveplayerid, giveplayer[25];
  1382.          if(PlayerInfo[playerid][PlayerLevel] < 3 || (playerid)) return 0;
  1383.          if (PlayerInfo[giveplayerid][PlayerLevel] > PlayerInfo[playerid][PlayerLevel] && PlayerInfo[playerid][PlayerLevel] < 6) return SendPlayerFormattedText(playerid, COLOR_RED, "Error: You cannot kick %s.", giveplayer, "");
  1384.          if(sscanf(params,"us[70]",player,reason)) return SendClientMessage(playerid,-1," (ERROR) : /kick [playerid] [reason]");
  1385.          GetPlayerName(player,gname,sizeof(gname));
  1386.          format(string, sizeof(string), "SERVER SYSTEM: %s has been kicked from the server Reason: %s", gname,reason);
  1387.          SendClientMessageToAll( -1, string);
  1388.          Kick(player);
  1389.          return 1;
  1390. }
  1391. CMD:v(playerid, params[])
  1392. {
  1393.     return cmd_vehicle(playerid, params);
  1394. }
  1395. CMD:vehicle(playerid, params[])
  1396. {
  1397.     new tmp[256], id, string[256], giveplayerid;
  1398.     if(PlayerInfo[playerid][PlayerLevel] < 4) return 0;
  1399.     if (vehiclemodels >= MAX_VEHICLE_MODELS) return SendClientMessage2(playerid, COLOR_RED, "Error: Vehicle model limit reached.");
  1400.     if (GetMaxVehicles() == VEHICLES-PLAYERS) return SendClientMessage2(playerid, COLOR_RED, "Error: Vehicle limit reached.");
  1401.     if(sscanf(params, "s[128]", tmp)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /v [model / name]");
  1402.     if(IsNumeric(tmp)) id = strval(tmp);
  1403.     else
  1404.     {
  1405.         new vcount = 0, ovtl[5];
  1406.         for (new d = 0; d < 212; d++)
  1407.         {
  1408.             if (strfind(vehName[d], tmp, true) != -1 || strval(tmp) == d+400)
  1409.             {
  1410.                 id = d+400;
  1411.                 if (vcount < 5) ovtl[vcount] = id;
  1412.                 else return SendClientMessage2(playerid, COLOR_RED, "Error: More than 5 results with that name were found.");
  1413.                 vcount ++;
  1414.             }
  1415.         }
  1416.         if (vcount > 1)
  1417.         {
  1418.             for (new e = 0; e < vcount; e++)
  1419.             {
  1420.                 if (e == 0) SendClientMessage2(playerid, COLOR_LBLUE, "Results..");
  1421.                 format(string, 64, " %s (Model - %d).", vehName[ovtl[e]-400], ovtl[e]);
  1422.                 SendClientMessage2(playerid, COLOR_WHITE, string);
  1423.                 if (e == vcount-1) SendClientMessage2(playerid, COLOR_WHITE, "");
  1424.             }
  1425.             return 1;
  1426.         }
  1427.     }
  1428.     if (id < 400 || id > 611) return SendClientMessage2(playerid, COLOR_ORANGE, "Usage: /changecar [model / name]");
  1429.     new Float:x, Float:y, Float:z, Float:a;
  1430.     if (spectat[playerid] != -1)
  1431.     {
  1432.         if (IsPlayerInAnyVehicle(spectat[playerid]))
  1433.         {
  1434.             GetVehiclePos(GetPlayerVehicleID(spectat[playerid]), x, y, z);
  1435.             GetVehicleZAngle(GetPlayerVehicleID(spectat[playerid]), a);
  1436.         }
  1437.         else
  1438.         {
  1439.             GetPlayerPos(spectat[playerid], x, y, z);
  1440.             GetPlayerFacingAngleFix(spectat[playerid], a);
  1441.         }
  1442.     }
  1443.     else
  1444.     {
  1445.         if (IsPlayerInAnyVehicle(playerid))
  1446.         {
  1447.             GetVehiclePos(GetPlayerVehicleID(playerid), x, y, z);
  1448.             GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
  1449.         }
  1450.         else
  1451.         {
  1452.             GetPlayerPos(playerid, x, y, z);
  1453.             GetPlayerFacingAngleFix(playerid, a);
  1454.         }
  1455.     }
  1456.     x += floatsin(-a, degrees) * 5.0;
  1457.     y += floatcos(-a, degrees) * 5.0;
  1458.     giveplayerid = CreateVehicle2(id, x, y, z, a+90.0, -1);
  1459.     LinkVehicleToInterior2(giveplayerid, GetPlayerInterior(playerid));
  1460.     SetVehicleVirtualWorld(giveplayerid, GetPlayerVirtualWorld(playerid));
  1461.     svtd[giveplayerid] = true;
  1462.     format(string, 128, "You have spawned a %s (Model - %d) (ID - %d).", vehName[id-400], id, giveplayerid);
  1463.     SendClientMessage2(playerid, COLOR_WHITE, string);
  1464.     return 1;
  1465. }
  1466. CMD:givecar(playerid, params[])
  1467. {
  1468.     new tmp[256], id, string[256], giveplayerid, uid;
  1469.     if(PlayerInfo[playerid][PlayerLevel] < 4) return 0;
  1470.     if (vehiclemodels >= MAX_VEHICLE_MODELS) return SendClientMessage2(playerid, COLOR_RED, "Error: Vehicle model limit reached.");
  1471.     if (GetMaxVehicles() == VEHICLES-PLAYERS) return SendClientMessage2(playerid, COLOR_RED, "Error: Vehicle limit reached.");
  1472.     if(sscanf(params, "us[128]", uid, tmp)) return SendClientMessage2(playerid, COLOR_WHITE, "Usage: /givecar [playerid] [model / name]");
  1473.     if(!IsPlayerConnected2(uid)) return SendClientMessage(playerid, COLOR_RED, "Inactive player id.");
  1474.     if(IsPlayerInAnyVehicle(uid)) return SendClientMessage(playerid, COLOR_RED, "That player is already in vehicle.");
  1475.     if(IsNumeric(tmp)) id = strval(tmp);
  1476.     else
  1477.     {
  1478.         new vcount = 0, ovtl[5];
  1479.         for (new d = 0; d < 212; d++)
  1480.         {
  1481.             if (strfind(vehName[d], tmp, true) != -1 || strval(tmp) == d+400)
  1482.             {
  1483.                 id = d+400;
  1484.                 if (vcount < 5) ovtl[vcount] = id;
  1485.                 else return SendClientMessage2(playerid, COLOR_RED, "Error: More than 5 results with that name were found.");
  1486.                 vcount ++;
  1487.             }
  1488.         }
  1489.         if (vcount > 1)
  1490.         {
  1491.             for (new e = 0; e < vcount; e++)
  1492.             {
  1493.                 if (e == 0) SendClientMessage2(playerid, COLOR_LBLUE, "Results..");
  1494.                 format(string, 64, " %s (Model - %d).", vehName[ovtl[e]-400], ovtl[e]);
  1495.                 SendClientMessage2(playerid, COLOR_WHITE, string);
  1496.                 if (e == vcount-1) SendClientMessage2(playerid, COLOR_WHITE, "");
  1497.             }
  1498.             return 1;
  1499.         }
  1500.     }
  1501.     if (id < 400 || id > 611) return SendClientMessage2(playerid, COLOR_ORANGE, "Usage: /changecar [model / name]");
  1502.     new Float:x, Float:y, Float:z, Float:a;
  1503.     GetPlayerPos(uid, x, y, z);
  1504.     GetPlayerFacingAngleFix(uid, a);
  1505.     x += floatsin(-a, degrees) * 5.0;
  1506.     y += floatcos(-a, degrees) * 5.0;
  1507.     giveplayerid = CreateVehicle2(id, x, y, z, a+90.0, -1);
  1508.     LinkVehicleToInterior2(giveplayerid, GetPlayerInterior(uid));
  1509.     SetVehicleVirtualWorld(giveplayerid, GetPlayerVirtualWorld(uid));
  1510.     svtd[giveplayerid] = true;
  1511.     PutPlayerInVehicle(uid, giveplayerid, 0);
  1512.     format(string, 128, "You have spawned a %s (Model - %d) (ID - %d) to %s.", vehName[id-400], id, giveplayerid, RPN(uid));
  1513.     SendClientMessage2(playerid, COLOR_WHITE, string);
  1514.     return 1;
  1515. }
  1516. CMD:stats(playerid, params[])
  1517. {
  1518.     new string[128], strings[128], player;
  1519.     if(PlayerInfo[playerid][PlayerScore] < 100)
  1520.     {
  1521.      if(sscanf(params,"u",player)) return SendClientMessage(playerid,-1," (ERROR) : /stats [playerid]");
  1522.      {
  1523.       format(string, sizeof(string), "%s Stats", RPN(playerid));
  1524.       format(string, sizeof(string), "*Name: %s\n*ID: %d\n*Score: %d\n*Kills: %i\n**Deaths: %i\n*Money: %d\n*Adminlevel: %d", RPN(playerid), playerid, GetPlayerScore(playerid), PlayerInfo[playerid][PlayerKills], PlayerInfo[playerid][PlayerDeaths], GetPlayerMoney(playerid), PlayerInfo[playerid][PlayerLevel]);
  1525.       ShowPlayerDialog2(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, strings, string, "Ok", "Cancel");
  1526.       return 1;
  1527.      }
  1528.      }
  1529.      else
  1530.      {
  1531.      format(string, sizeof(string), "%s Stats", RPN(playerid));
  1532.      format(string, sizeof(string), "*Name: %s\n*ID: %d\n*Score: %d\n*Kills: %i\n**Deaths: %i\n*Money: %d\n*Adminlevel: %d", RPN(playerid), playerid, GetPlayerScore(playerid), PlayerInfo[playerid][PlayerKills], PlayerInfo[playerid][PlayerDeaths], GetPlayerMoney(playerid), PlayerInfo[playerid][PlayerLevel]);
  1533.      ShowPlayerDialog2(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, strings, string, "Ok", "Cancel");
  1534.      return 1;
  1535.      }
  1536. }
  1537. CMD:richlist(playerid, params[])
  1538. {
  1539.     new string[128], Slot1 = -1, Slot2 = -1, Slot3 = -1, Slot4 = -1, HighestCash = -9999;
  1540.     SendClientMessage(playerid, COLOR_YELLOW, "Server Rich List:");
  1541.     for(new x=0; x<MAX_PLAYERS; x++)
  1542.     if(IsPlayerConnected(x))
  1543.     if(GetPlayerMoney(x) >= HighestCash)
  1544.     {
  1545.         HighestCash = GetPlayerMoney(x);
  1546.         Slot1 = x;
  1547.     }
  1548.     HighestCash = -9999;
  1549.     for(new x=0; x<MAX_PLAYERS; x++)
  1550.     if(IsPlayerConnected(x) && x != Slot1)
  1551.     if(GetPlayerMoney(x) >= HighestCash)
  1552.     {
  1553.         HighestCash = GetPlayerMoney(x);
  1554.         Slot2 = x;
  1555.     }
  1556.     HighestCash = -9999;
  1557.     for(new x=0; x<MAX_PLAYERS; x++)
  1558.     if(IsPlayerConnected(x) && x != Slot1 && x != Slot2)
  1559.     if(GetPlayerMoney(x) >= HighestCash)
  1560.     {
  1561.         HighestCash = GetPlayerMoney(x);
  1562.         Slot3 = x;
  1563.     }
  1564.     HighestCash = -9999;
  1565.     for(new x=0; x<MAX_PLAYERS; x++)
  1566.     if(IsPlayerConnected(x) && x != Slot1 && x != Slot2 && x != Slot3)
  1567.     if(GetPlayerMoney(x) >= HighestCash)
  1568.     {
  1569.         HighestCash = GetPlayerMoney(x);
  1570.         Slot4 = x;
  1571.     }
  1572.     format(string, sizeof(string), "[%d]: %s - $%d", Slot1, RPN(Slot1), GetPlayerMoney(Slot1));
  1573.     SendClientMessage(playerid, COLOR_WHITE, string);
  1574.     if(Slot2 != -1)
  1575.     {
  1576.         format(string, sizeof(string), "[%d]: %s - $%d", Slot2, RPN(Slot2), GetPlayerMoney(Slot2));
  1577.         SendClientMessage(playerid, COLOR_WHITE, string);
  1578.     }
  1579.     if(Slot3 != -1)
  1580.     {
  1581.         format(string, sizeof(string), "[%d]: %s - $%d", Slot3, RPN(Slot3), GetPlayerMoney(Slot3));
  1582.         SendClientMessage(playerid, COLOR_WHITE, string);
  1583.     }
  1584.     if(Slot4 != -1)
  1585.     {
  1586.         format(string, sizeof(string), "[%d]: %s - $%d", Slot4, RPN(Slot4), GetPlayerMoney(Slot4));
  1587.         SendClientMessage(playerid, COLOR_WHITE, string);
  1588.     }
  1589.     return 1;
  1590. }
  1591. CMD:topkillers(playerid, params[])
  1592. {
  1593.     new string[128], Slot1 = -1, Slot2 = -1, Slot3 = -1, Slot4 = -1, TopKill = -9999;
  1594.     SendClientMessage(playerid, COLOR_YELLOW, "Server Top Killers List:");
  1595.     for(new x=0; x<MAX_PLAYERS; x++)
  1596.     if(IsPlayerConnected(x))
  1597.     if(PlayerInfo[x][PlayerKills] >= TopKill)
  1598.     {
  1599.         TopKill = PlayerInfo[x][PlayerKills];
  1600.         Slot1 = x;
  1601.     }
  1602.     TopKill = -9999;
  1603.     for(new x=0; x<MAX_PLAYERS; x++)
  1604.     if(IsPlayerConnected(x) && x != Slot1)
  1605.     if(PlayerInfo[x][PlayerKills] >= TopKill)
  1606.     {
  1607.         TopKill = PlayerInfo[x][PlayerKills];
  1608.         Slot2 = x;
  1609.     }
  1610.     TopKill = -9999;
  1611.     for(new x=0; x<MAX_PLAYERS; x++)
  1612.     if(IsPlayerConnected(x) && x != Slot1 && x != Slot2)
  1613.     if(PlayerInfo[x][PlayerKills] >= TopKill)
  1614.     {
  1615.         TopKill = PlayerInfo[x][PlayerKills];
  1616.         Slot3 = x;
  1617.     }
  1618.     TopKill = -9999;
  1619.     for(new x=0; x<MAX_PLAYERS; x++)
  1620.     if(IsPlayerConnected(x) && x != Slot1 && x != Slot2 && x != Slot3)
  1621.     if(PlayerInfo[x][PlayerKills] >= TopKill)
  1622.     {
  1623.         TopKill = PlayerInfo[x][PlayerKills];
  1624.         Slot4 = x;
  1625.     }
  1626.     format(string, sizeof(string), "[%d]: %s - $%d", Slot1, RPN(Slot1), PlayerInfo[Slot1][PlayerKills]);
  1627.     SendClientMessage(playerid, COLOR_WHITE, string);
  1628.     if(Slot2 != -1)
  1629.     {
  1630.         format(string, sizeof(string), "[%d]: %s - $%d", Slot2, RPN(Slot2), PlayerInfo[Slot2][PlayerKills]);
  1631.         SendClientMessage(playerid, COLOR_WHITE, string);
  1632.     }
  1633.     if(Slot3 != -1)
  1634.     {
  1635.         format(string, sizeof(string), "[%d]: %s - $%d", Slot3, RPN(Slot3), PlayerInfo[Slot3][PlayerKills]);
  1636.         SendClientMessage(playerid, COLOR_WHITE, string);
  1637.     }
  1638.     if(Slot4 != -1)
  1639.     {
  1640.         format(string, sizeof(string), "[%d]: %s - $%d", Slot4, RPN(Slot4), PlayerInfo[Slot4][PlayerKills]);
  1641.         SendClientMessage(playerid, COLOR_WHITE, string);
  1642.     }
  1643.     return 1;
  1644. }
  1645. CMD:topdeaths(playerid, params[])
  1646. {
  1647.     new string[128], Slot1 = -1, Slot2 = -1, Slot3 = -1, Slot4 = -1, TopDeath = -9999;
  1648.     SendClientMessage(playerid, COLOR_YELLOW, "Server Top Killers List:");
  1649.     for(new x=0; x<MAX_PLAYERS; x++)
  1650.     if(IsPlayerConnected(x))
  1651.     if(PlayerInfo[x][PlayerDeaths] >= TopDeath)
  1652.     {
  1653.         TopDeath = PlayerInfo[x][PlayerDeaths];
  1654.         Slot1 = x;
  1655.     }
  1656.     TopDeath = -9999;
  1657.     for(new x=0; x<MAX_PLAYERS; x++)
  1658.     if(IsPlayerConnected(x) && x != Slot1)
  1659.     if(PlayerInfo[x][PlayerDeaths] >= TopDeath)
  1660.     {
  1661.         TopDeath = PlayerInfo[x][PlayerDeaths];
  1662.         Slot2 = x;
  1663.     }
  1664.     TopDeath = -9999;
  1665.     for(new x=0; x<MAX_PLAYERS; x++)
  1666.     if(IsPlayerConnected(x) && x != Slot1 && x != Slot2)
  1667.     if(PlayerInfo[x][PlayerDeaths] >= TopDeath)
  1668.     {
  1669.         TopDeath = PlayerInfo[x][PlayerDeaths];
  1670.         Slot3 = x;
  1671.     }
  1672.     TopDeath = -9999;
  1673.     for(new x=0; x<MAX_PLAYERS; x++)
  1674.     if(IsPlayerConnected(x) && x != Slot1 && x != Slot2 && x != Slot3)
  1675.     if(PlayerInfo[x][PlayerDeaths] >= TopDeath)
  1676.     {
  1677.         TopDeath = PlayerInfo[x][PlayerDeaths];
  1678.         Slot4 = x;
  1679.     }
  1680.     format(string, sizeof(string), "[%d]: %s - $%d", Slot1, RPN(Slot1), PlayerInfo[Slot1][PlayerDeaths]);
  1681.     SendClientMessage(playerid, COLOR_WHITE, string);
  1682.     if(Slot2 != -1)
  1683.     {
  1684.         format(string, sizeof(string), "[%d]: %s - $%d", Slot2, RPN(Slot2), PlayerInfo[Slot2][PlayerDeaths]);
  1685.         SendClientMessage(playerid, COLOR_WHITE, string);
  1686.     }
  1687.     if(Slot3 != -1)
  1688.     {
  1689.         format(string, sizeof(string), "[%d]: %s - $%d", Slot3, RPN(Slot3), PlayerInfo[Slot3][PlayerDeaths]);
  1690.         SendClientMessage(playerid, COLOR_WHITE, string);
  1691.     }
  1692.     if(Slot4 != -1)
  1693.     {
  1694.         format(string, sizeof(string), "[%d]: %s - $%d", Slot4, RPN(Slot4), PlayerInfo[Slot4][PlayerDeaths]);
  1695.         SendClientMessage(playerid, COLOR_WHITE, string);
  1696.     }
  1697.     return 1;
  1698. }
  1699.  
  1700. CMD:credits(playerid, params[])
  1701. {
  1702.  new strings[1000], string[1000];
  1703.  format(strings, sizeof(strings), ""COL_RED""SV_NAME" "COL_GREY"Credits");
  1704.  format(string, sizeof(string), ""COL_YELLOW"Server Owner/Developer/Scripter/Mapper : "COL_BLUE"[bR]BulletRaja\n"COL_YELLOW"Server Manager : "COL_BLUE"[bR]Soon\n"COL_YELLOW"%s(%d) : to play in our server\n\n"COL_RED"Includes Credits\n"COL_YELLOW"Streamer : "COL_BLUE"Incognito\n"COL_YELLOW"Sscanf2 : "COL_BLUE"Emmet_\n"COL_YELLOW"Zcmd : "COL_BLUE"Zeex\n"COL_YELLOW"YSI/y_ini : "COL_BLUE"Misiur\n\n", RPN(playerid), playerid);
  1705.  ShowPlayerDialog2(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, strings, string, "Ok", "");
  1706.  return 1;
  1707. }
  1708. CMD:rules(playerid, params[])
  1709. {
  1710.  new string[1000], strings[1000];
  1711.  format(string, sizeof(string), ""COL_GREEN"Server Rules");
  1712.  format(string, sizeof(string), ""COL_BLUE"%s(%d)"COL_WHITE"Thanks for reading rules.\n\n\
  1713. "COL_YELLOW"1> "COL_LIME"Soon\n\
  1714. "COL_YELLOW"2> "COL_LIME"Soon\n\
  1715. "COL_YELLOW"3> "COL_LIME"Soon\n\
  1716. "COL_YELLOW"4> "COL_LIME"Soon\n\
  1717. "COL_YELLOW"5> "COL_LIME"Soon\n\
  1718. "COL_YELLOW"6> "COL_LIME"Soon\n\
  1719. "COL_YELLOW"7> "COL_LIME"Soon\n\
  1720. "COL_YELLOW"8> "COL_LIME"Soon\n\
  1721. "COL_YELLOW"9> "COL_LIME"Soon\n\
  1722. "COL_YELLOW"10> "COL_LIME"Soon\n\
  1723. "COL_YELLOW"11> "COL_LIME"Soon\n\
  1724. "COL_YELLOW"12> "COL_LIME"Soon\n\
  1725. "COL_YELLOW"13> "COL_LIME"Soon\n\
  1726. \n\n", RPN(playerid), playerid);
  1727.  ShowPlayerDialog2(playerid, DIALOG_RULES, DIALOG_STYLE_MSGBOX, strings, string, "Ok", "");
  1728.  return 1;
  1729. }
  1730. CMD:restart(playerid, params[])
  1731. {
  1732.     if(PlayerInfo[playerid][PlayerLevel] < 6) return 0;
  1733.     new str[256], reson[1000];
  1734.     if (sscanf(params, "s[1000]", reson)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /restart [reason]");
  1735.     SetTimer("Restart", 500, 0);
  1736.     format(str, sizeof(str), "* The server will restart, Reason: %s.",  reson);
  1737.     SendClientMessageToAll(COLOR_OSAY, str);
  1738.     return 1;
  1739. }
  1740. CMD:setclanmember(playerid, params[])
  1741. {
  1742.     new string[1000], giveplayerid, giveplayer[60];
  1743.     if (PlayerInfo[playerid][PlayerLevel] < 5) return 0;
  1744.     if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
  1745.     if(sscanf(params,"u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /setclanmember [playerid]");
  1746.     GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
  1747.     if(PlayerInfo[playerid][ClanMember] == 1) return SendClientMessage(playerid, COLOR_RED, "Error: He is already clan member.");
  1748.     format(string,sizeof(string), "*You Have Successfuly Set %s As An Clan Member.",giveplayer);
  1749.     SendClientMessage(playerid,COLOR_RED, string);
  1750.     format(string,sizeof(string), "An admin has made you a "CLAN_TAG" clan member. Now you are allowed to add "CLAN_TAG" tag to your name.");
  1751.     SendClientMessage(giveplayerid,COLOR_GREEN, string);
  1752.     PlayerInfo[playerid][ClanMember] = 1;
  1753.     return 1;
  1754. }
  1755. CMD:kickclanmember(playerid, params[])
  1756. {
  1757.     new giveplayerid, string[200], giveplayer[60];
  1758.     if (PlayerInfo[playerid][PlayerLevel] < 5) return 0;
  1759.     if (!IsPlayerConnected2(giveplayerid)) return SendClientMessage2(playerid, COLOR_RED, "Error: Inactive player id!");
  1760.     if(sscanf(params,"u",giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /kickclanmember [playerid]");
  1761.     GetPlayerName(giveplayerid, giveplayer, MAX_PLAYER_NAME);
  1762.     if(!PlayerInfo[playerid][ClanMember]) return SendClientMessage(playerid, COLOR_RED, "Error: He is not a clan member.");
  1763.     PlayerInfo[playerid][ClanMember] = 0;
  1764.     format(string,sizeof(string), "An admin has kicked you from "CLAN_TAG" clan. Now use /working on the cmd and remove the "CLAN_TAG" tag from your name.");
  1765.     SendClientMessage(giveplayerid,COLOR_GREEN, string);
  1766.     return 1;
  1767. }
  1768.  
  1769. forward Restart();
  1770. public Restart()
  1771. {
  1772.     for (new i = 0, playercount=GetPlayerPoolSize(); i <= playercount; i++)
  1773.     {
  1774.         if(IsPlayerConnected(i))
  1775.         {
  1776.             Kick(i);
  1777.         }
  1778.     }
  1779.     SendRconCommand("gmx");
  1780.     return 1;
  1781. }
Add Comment
Please, Sign In to add comment