Advertisement
Guest User

Untitled

a guest
May 7th, 2017
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 143.72 KB | None | 0 0
  1. /*
  2.     #######                                    #     #
  3.     #       #####   ####  ###### ###### #    #  #   #  #    # #####  #
  4.     #       #    # #    #     #  #      ##   #   # #   #    # #    # #
  5.     #####   #    # #    #    #   #####  # #  #    #    #    # #    # #
  6.     #       #####  #    #   #    #      #  # #    #    #    # #####  #
  7.     #       #   #  #    #  #     #      #   ##    #    #    # #   #  #
  8.     #       #    #  ####  ###### ###### #    #    #     ####  #    # #
  9. */
  10.  
  11. #include <a_samp>
  12. #include <irc>
  13. #include "../include/gl_common.inc"
  14. #include <a_mysql>
  15.  
  16. #define yellow 0xFFFF00AA
  17. #define green 0x33AA33AA
  18. #define red 0xAA3333AA
  19. #define orange 0xFF8040FF
  20.  
  21. #define IrcServer "irc.blackbank.nl"              // IRC server.
  22. #define IrcPort 6667                              // IRC port.
  23. #define EchoChan "#ys"                            // The channel where will go out.
  24. #define AdminChan "#ys.admin"                     // If there is a channel, everything private will be seen there is. (Optional)
  25. #define AdminPass ""
  26. #define BotPass ""                                // The password for nickserv. (Optional)
  27. #define ChanPass ""                               // The password for chanserv. (Optional)
  28. #define BotRealName "frozenyuri"                  // Optional
  29. #define BotUserName "frozen.yuri"                 // Optional
  30. #define MAX_NAME 30
  31. #define MAX_ZONES 366
  32. #define Mode "+v"                                 // +v / +h / +o / +a / +q / - (off)
  33. #define IrcToServer "all"                         // admin (rcon) / all / off
  34. #define QuitMsg "12* Server offline"              // Sends a message when goes out of the channel. (Optional)
  35. #define irccmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (irccmd_%1(botid,recipient,user,"")))||(((%3)[(%2) + 1] == 32) && (irccmd_%1(botid,recipient,user,(%3)[(%2) + 2]))))) return 1
  36.  
  37. new MinQuestionMoney = 250;                       // 250 is ajustable to any number you want the minimal
  38. new MaxQuestionMoney = 750;                       // 750 is ajustable to any number you want the maximal to gether it will get a number beside the min and the max
  39. new RandomQuestionMoney;
  40.  
  41. new BotName1[256] = "FY-Bot1";                    // Name of the BOT 1
  42. new BotName2[256] = "FY-Bot2";                    // Name of the BOT 2 (Optional)
  43. new BotName3[256] = "";                           // Name of the BOT 3 (Optional)
  44. new BotName4[256] = "";                           // Name of the BOT 4 (Optional)
  45. new JoinMsg[][256] =
  46. {
  47.     {"server loaded"}
  48. };
  49. new EchoConnection[8];
  50. new GroupID[2];
  51. new Delay = 1000;
  52. new Total = 0;
  53. new SendMsg;
  54. new TimeAtConnect[500];
  55. new IsPlayerMuted[500];
  56. new IsPlayerJailed[500];
  57.  
  58. new QuestionStarted;
  59. new Question[32];
  60. new total_vehicles_from_files=0;
  61. //#pragma unused sztmp
  62. forward SendQuestionForMoney();
  63. forward IABot1();
  64. forward IABot2();
  65. forward IABot3();
  66. forward IABot4();
  67. forward IALoad();
  68. forward Spawn(playerid);
  69. forward MsgToTheAdmin(msg[]);
  70. forward Float:GetDistanceBetweenPlayers(p1,p2);
  71. forward AccessDenied(user[]);
  72. forward UnJailedDenied(playerid);
  73. forward PlayerUnJailed(playerid);
  74. forward BB3_PlayerName(playerid);
  75.  
  76. #define SQL_HOST "myhost.net"
  77. #define SQL_DB "database"
  78. #define SQL_USER "user"
  79. #define SQL_PASS "pass"
  80. #define SQL_TABLENAME "users"
  81. #define SQL_DEBUG_ON (1)
  82. #define MAX_STRING (255)
  83. enum pInfo
  84. {
  85.     gPassword,
  86.     gAdminLevel,
  87.     gMoney,
  88.     gScore,
  89.     gAccount,
  90.     gLogged,
  91. };
  92. new PlayerInfo[MAX_PLAYERS][pInfo];
  93.  
  94. //----------------------------------------------------------------------------//
  95. new VehicleNames[][] =
  96. {
  97.     "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
  98.     "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
  99.     "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
  100.     "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
  101.     "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
  102.     "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
  103.     "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",
  104.     "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",
  105.     "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",
  106.     "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
  107.     "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",
  108.     "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
  109.     "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",
  110.     "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",
  111.     "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",
  112.     "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
  113.     "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
  114. };
  115.  
  116. new aDisconnectNames[][20] =
  117. {
  118.     {"7Timeout2"},
  119.     {"3Leaving2"},
  120.     {"4Kicked/Banned2"}
  121. };
  122.  
  123. main()
  124. {
  125.     print("    ----------------");
  126.     print("   | By: BlackBoard |");
  127.     print("    ----------------");
  128.     print(" #####                                     ");
  129.     print("#     # ###### #####  #    # ###### #####  ");
  130.     print("#       #      #    # #    # #      #    # ");
  131.     print(" #####  #####  #    # #    # #####  #    # ");
  132.     print("      # #      #####  #    # #      #####  ");
  133.     print("#     # #      #   #   #  #  #      #   #  ");
  134.     print(" #####  ###### #    #   ##   ###### #    # ");
  135.     print("                                           ");
  136.     print("#       ####    ##   #####  ###### #####  ");
  137.     print("#      #    #  #  #  #    # #      #    # ");
  138.     print("#      #    # #    # #    # #####  #    # ");
  139.     print("#      #    # ###### #    # #      #    # ");
  140.     print("#      #    # #    # #    # #      #    # ");
  141.     print("######  ####  #    # #####  ###### #####");
  142. }
  143.  
  144.  
  145. public OnGameModeInit()
  146. {
  147. #undef MAX_PLAYERS
  148. #define MAX_PLAYERS (GetMaxPlayers())
  149.  
  150.     mysql_debug(SQL_DEBUG_ON);
  151.     new Connection = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
  152.     if(Connection) printf(">> MySQL Successfull Connected! <<");
  153.     SetGameModeText("New GM");
  154.     SetTimer("SendQuestionForMoney", 600000, true);
  155.     DisableInteriorEnterExits();
  156.                                                   // skinn113
  157.     AddPlayerClass(113,1733.3044,-1912.1366,13.5621,91.1281,0,0,0,0,0,0);
  158.                                                   // skinn112
  159.     AddPlayerClass(112,1733.3044,-1912.1366,13.5621,91.1281,0,0,0,0,0,0);
  160.                                                   // skinn111
  161.     AddPlayerClass(111,1733.3044,-1912.1366,13.5621,91.1281,0,0,0,0,0,0);
  162.                                                   // skinn12
  163.     AddPlayerClass(12,1733.2166,-1903.3141,13.5621,89.9391,0,0,0,0,0,0);
  164.                                                   // skinn55
  165.     AddPlayerClass(55,1733.2166,-1903.3141,13.5621,89.9391,0,0,0,0,0,0);
  166.                                                   // skinn56
  167.     AddPlayerClass(56,1733.2166,-1903.3141,13.5621,89.9391,0,0,0,0,0,0);
  168.  
  169.     SendMsg = 0;
  170.     GroupID[0] = IRC_CreateGroup();
  171.     GroupID[1] = IRC_CreateGroup();
  172.     IALoad();
  173.  
  174. // SPECIAL
  175.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt");
  176.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt");
  177. // LAS VENTURAS
  178.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt");
  179.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
  180.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
  181. // SAN FIERRO
  182.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt");
  183.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
  184.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
  185. // LOS SANTOS
  186.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
  187.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
  188.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
  189.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
  190. // OTHER AREAS
  191.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt");
  192.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt");
  193.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt");
  194.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt");
  195.     total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt");
  196.     printf("Total vehicles from files: %d",total_vehicles_from_files);
  197.     return 1;
  198. }
  199.  
  200.  
  201. public OnGameModeExit()
  202. {
  203.  
  204.     IRC_Quit(EchoConnection[0], QuitMsg);
  205.     IRC_Quit(EchoConnection[1], QuitMsg);
  206.     IRC_Quit(EchoConnection[2], QuitMsg);
  207.     IRC_Quit(EchoConnection[3], QuitMsg);
  208.     if(mysql_ping()) mysql_close();
  209.     return 1;
  210. }
  211.  
  212.  
  213. public OnPlayerRequestClass(playerid, classid)
  214. {
  215.     SetPlayerInterior(playerid,0);
  216.     SetPlayerPos(playerid,1411.3091,-1698.2535,39.5469);
  217.     SetPlayerFacingAngle(playerid,230.0);
  218.     SetPlayerCameraPos(playerid,1406.5480,-1694.6781,39.5469);
  219.     SetPlayerCameraLookAt(playerid,1411.3091,-1698.2535,39.5469);
  220.     SetPlayerColor(playerid,0xFFFFFFAA);
  221.     return 1;
  222. }
  223.  
  224.  
  225. public OnPlayerConnect(playerid)
  226. {
  227.     new joiner[128];
  228.     GetPlayerName(playerid,joiner,sizeof(joiner));
  229.     format(joiner,sizeof(joiner),"***    %s (ID: %d) has joined the Server ",joiner,playerid);
  230.     SendClientMessageToAll(0xB4B5B7AA,joiner);
  231.  
  232.     new JoinMsg1[128];
  233.     IsPlayerMuted[playerid] = 0;
  234.     format(JoinMsg1,128, "2** 4[%i]2 %s has joined the server.", playerid, PlayerName(playerid));
  235.     IRC_GroupSay(GroupID[0], EchoChan, JoinMsg1);
  236.     IsPlayerJailed[playerid] = false;
  237.     IsPlayerMuted[playerid] = false;
  238.     if(strlen(AdminChan) != 0) {
  239.         if(IsPlayerNPC(playerid)) {
  240.             new JoinMsg2[128];
  241.             format(JoinMsg2, 128, "2** 4[NPC] [%i]2 %s has joined the server.", playerid, PlayerName(playerid));
  242.             IRC_GroupSay(GroupID[1], AdminChan, JoinMsg2);
  243.         }
  244.         else {
  245.             new JoinMsg2[128];
  246.             new IP[256];
  247.             GetPlayerIp(playerid,IP,256);
  248.             format(JoinMsg2, 128, "2** 4[%i]2 %s has joined the server. (%s)", playerid, PlayerName(playerid), IP);
  249.             IRC_GroupSay(GroupID[1], AdminChan, JoinMsg2);
  250.             TimeAtConnect[playerid] = Now();
  251.         }
  252.     }
  253.     MySQLCheck();
  254.     new query[MAX_STRING+1];
  255.     format(query,sizeof(query), "SELECT * FROM `"SQL_TABLENAME"` WHERE Username = '%s'", BB3_PlayerName(playerid));
  256.     mysql_query(query);
  257.     mysql_store_result();
  258.  
  259.     if(mysql_num_rows() > 0) {
  260.         PlayerInfo[playerid][gAccount] = 1;
  261.     }
  262.     else {
  263.         PlayerInfo[playerid][gAccount] = 0;
  264.     }
  265.     mysql_free_result();
  266.     return 1;
  267. }
  268.  
  269.  
  270. public OnPlayerCommandText(playerid, cmdtext[])
  271. {
  272.     if(strcmp(cmdtext, "/register", true) == 0) {
  273.         if(PlayerInfo[playerid][gAccount] == 1) return SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: This nick is already registered!");
  274.         if(!cmdtext[9]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: /login [PASSWORD]");
  275.  
  276.         MySQLCheck();
  277.         mysql_real_escape_string(BB3_PlayerName(playerid), BB3_PlayerName(playerid));
  278.         mysql_real_escape_string(cmdtext[10], cmdtext[10]);
  279.  
  280.         new query[MAX_STRING+1];
  281.         format(query,sizeof(query), "INSERT INTO `"SQL_TABLENAME"` (Username,Password) VALUES ('%s','%s')", BB3_PlayerName(playerid), cmdtext[10]);
  282.         mysql_query(query);
  283.  
  284.         OnPlayerSave(playerid);
  285.         OnPlayerLogin(playerid, cmdtext[10]);
  286.         PlayerInfo[playerid][gAccount] = 1;
  287.  
  288.         SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: Nick succesfull registered!");
  289.         SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: You are automatically logged in!");
  290.         return 1;
  291.     }
  292.     if(strcmp(cmdtext, "/login", true) == 0) {
  293.         if(PlayerInfo[playerid][gLogged] == 1) return SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: You are already logged in!");
  294.         if(PlayerInfo[playerid][gAccount] == 0) return SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: You do not have an account yet! (/register)");
  295.         if(!cmdtext[6]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: /login [PASSWORD]");
  296.  
  297.         OnPlayerLogin(playerid, cmdtext[7]);
  298.         PlayerInfo[playerid][gLogged] = 1;
  299.         SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: You are succesfull logged in!");
  300.         return 1;
  301.     }
  302.     return 0;
  303. }
  304.  
  305.  
  306. public OnPlayerDisconnect(playerid, reason)
  307. {
  308.     new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
  309.     GetPlayerName(playerid, pname, sizeof(pname));
  310.     switch(reason) {
  311.         case 0: format(string, sizeof(string), "***  %s has left the server. (Lost Connection)", pname);
  312.         case 1: format(string, sizeof(string), "***  %s has left the server. (Leaving)", pname);
  313.         case 2: format(string, sizeof(string), "***  %s has left the server. (Kicked)", pname);
  314.     }
  315.     SendClientMessageToAll(0xAAAAAAAA, string);
  316.     new leaveMsg1[256];
  317.     IsPlayerMuted[playerid] = 0;
  318.     format(leaveMsg1, 256, "2** 4[%i]2 %s has left the server. (%s)", playerid, PlayerName(playerid), aDisconnectNames[reason]);
  319.     IRC_GroupSay(GroupID[0], EchoChan, leaveMsg1);
  320.     IsPlayerJailed[playerid] = false;
  321.     IsPlayerMuted[playerid] = false;
  322.     if(strlen(AdminChan) != 0) {
  323.         if(IsPlayerNPC(playerid)) {
  324.             new leaveMsg2[256];
  325.             format(leaveMsg2, 256, "2** 4[NPC] [%i]2 %s has left the server. (%s)", playerid, PlayerName(playerid), aDisconnectNames[reason]);
  326.             IRC_GroupSay(GroupID[1], AdminChan, leaveMsg2);
  327.         }
  328.         else {
  329.             new leaveMsg2[256];
  330.             new current = Now() - TimeAtConnect[playerid];
  331.             format(leaveMsg2, 256, "2** 4[%i]2 %s has left the server. (%s) (%s)", playerid, PlayerName(playerid), aDisconnectNames[reason], ConvertTime(current));
  332.             IRC_GroupSay(GroupID[1], AdminChan, leaveMsg2);
  333.         }
  334.     }
  335.     return 1;
  336. }
  337.  
  338.  
  339. public OnPlayerSpawn(playerid)
  340. {
  341.     if(strlen(AdminChan) != 0) {
  342.         if(IsPlayerJailed[playerid]) {
  343.             new lolz1[256];
  344.             new lolz2[256];
  345.             format(lolz1,sizeof(lolz1),"*** You don't have permission to leave the jail.");
  346.             format(lolz2,sizeof(lolz2),"4*** %s (ID:%d) it cannot leave the jail.",PlayerName(playerid),playerid);
  347.             SendClientMessage(playerid,red,lolz1);
  348.             IRC_GroupSay(GroupID[1], AdminChan,lolz2);
  349.             SetTimerEx("UnJailedDenied",500,0,"d",playerid);
  350.         }
  351.         else {
  352.                                                   // for load...
  353.             SetTimerEx("Spawn",3000,0,"d",playerid);
  354.         }
  355.     }
  356.     return 1;
  357. }
  358.  
  359.  
  360. public OnPlayerDeath(playerid, killerid, reason)
  361. {
  362.     new msg[128],killerName[MAX_PLAYER_NAME],reasonMsg[32],playerName[MAX_PLAYER_NAME];
  363.     GetPlayerName(killerid, killerName, sizeof(killerName));
  364.     GetPlayerName(playerid, playerName, sizeof(playerName));
  365.     if (killerid != INVALID_PLAYER_ID) {
  366.         switch (reason) {
  367.             case 0:
  368.             {
  369.                 reasonMsg = "Unarmed";
  370.             }
  371.             case 1:
  372.             {
  373.                 reasonMsg = "Brass Knuckles";
  374.             }
  375.             case 2:
  376.             {
  377.                 reasonMsg = "Golf Club";
  378.             }
  379.             case 3:
  380.             {
  381.                 reasonMsg = "Night Stick";
  382.             }
  383.             case 4:
  384.             {
  385.                 reasonMsg = "Knife";
  386.             }
  387.             case 5:
  388.             {
  389.                 reasonMsg = "Baseball Bat";
  390.             }
  391.             case 6:
  392.             {
  393.                 reasonMsg = "Shovel";
  394.             }
  395.             case 7:
  396.             {
  397.                 reasonMsg = "Pool Cue";
  398.             }
  399.             case 8:
  400.             {
  401.                 reasonMsg = "Katana";
  402.             }
  403.             case 9:
  404.             {
  405.                 reasonMsg = "Chainsaw";
  406.             }
  407.             case 10:
  408.             {
  409.                 reasonMsg = "Dildo";
  410.             }
  411.             case 11:
  412.             {
  413.                 reasonMsg = "Dildo";
  414.             }
  415.             case 12:
  416.             {
  417.                 reasonMsg = "Vibrator";
  418.             }
  419.             case 13:
  420.             {
  421.                 reasonMsg = "Vibrator";
  422.             }
  423.             case 14:
  424.             {
  425.                 reasonMsg = "Flowers";
  426.             }
  427.             case 15:
  428.             {
  429.                 reasonMsg = "Cane";
  430.             }
  431.             case 22:
  432.             {
  433.                 reasonMsg = "Pistol";
  434.             }
  435.             case 23:
  436.             {
  437.                 reasonMsg = "Silenced Pistol";
  438.             }
  439.             case 24:
  440.             {
  441.                 reasonMsg = "Desert Eagle";
  442.             }
  443.             case 25:
  444.             {
  445.                 reasonMsg = "Shotgun";
  446.             }
  447.             case 26:
  448.             {
  449.                 reasonMsg = "Sawn-off Shotgun";
  450.             }
  451.             case 27:
  452.             {
  453.                 reasonMsg = "Combat Shotgun";
  454.             }
  455.             case 28:
  456.             {
  457.                 if(IsPlayerInAnyVehicle(playerid)) {
  458.                     if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
  459.                         reasonMsg = "Drive By (MAC-10)";
  460.                     }
  461.                     else {
  462.                         reasonMsg = "MAC-10";
  463.                     }
  464.                 }
  465.                 else {
  466.                     reasonMsg = "MAC-10";
  467.                 }
  468.             }
  469.             case 29:
  470.             {
  471.                 if(IsPlayerInAnyVehicle(playerid)) {
  472.                     if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
  473.                         reasonMsg = "Drive By (MP5)";
  474.                     }
  475.                     else {
  476.                         reasonMsg = "MP5";
  477.                     }
  478.                 }
  479.                 else {
  480.                     reasonMsg = "MP5";
  481.                 }
  482.             }
  483.             case 30:
  484.             {
  485.                 reasonMsg = "AK-47";
  486.             }
  487.             case 31:
  488.             {
  489.                 if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
  490.                     switch (GetVehicleModel(GetPlayerVehicleID(killerid))) {
  491.                         case 447:
  492.                         {
  493.                             reasonMsg = "Sea Sparrow Machine Gun";
  494.                         }
  495.                         default:
  496.                         {
  497.                             reasonMsg = "M4";
  498.                         }
  499.                     }
  500.                 }
  501.                 else {
  502.                     reasonMsg = "M4";
  503.                 }
  504.             }
  505.             case 32:
  506.             {
  507.                 if(IsPlayerInAnyVehicle(playerid)) {
  508.                     if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
  509.                         reasonMsg = "Drive By (TEC-9)";
  510.                     }
  511.                     else {
  512.                         reasonMsg = "TEC-9";
  513.                     }
  514.                 }
  515.                 else {
  516.                     reasonMsg = "TEC-9";
  517.                 }
  518.             }
  519.             case 33:
  520.             {
  521.                 reasonMsg = "Rifle";
  522.             }
  523.             case 34:
  524.             {
  525.                 reasonMsg = "Sniper Rifle";
  526.             }
  527.             case 37:
  528.             {
  529.                 reasonMsg = "Fire";
  530.             }
  531.             case 38:
  532.             {
  533.                 if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
  534.                     switch(GetVehicleModel(GetPlayerVehicleID(killerid))) {
  535.                         case 425:
  536.                         {
  537.                             reasonMsg = "Hunter Machine Gun";
  538.                         }
  539.                         default:
  540.                         {
  541.                             reasonMsg = "Minigun";
  542.                         }
  543.                     }
  544.                 }
  545.                 else {
  546.                     reasonMsg = "Minigun";
  547.                 }
  548.             }
  549.             case 41:
  550.             {
  551.                 reasonMsg = "Spraycan";
  552.             }
  553.             case 42:
  554.             {
  555.                 reasonMsg = "Fire Extinguisher";
  556.             }
  557.             case 49:
  558.             {
  559.                 reasonMsg = "Vehicle Collision";
  560.             }
  561.             case 50:
  562.             {
  563.                 if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
  564.                     switch(GetVehicleModel(GetPlayerVehicleID(killerid))) {
  565.                         case 417, 425, 447, 465, 469, 487, 488, 497, 501, 548, 563:
  566.                         {
  567.                             reasonMsg = "Helicopter Blades";
  568.                         }
  569.                         default:
  570.                         {
  571.                             reasonMsg = "Vehicle Collision";
  572.                         }
  573.                     }
  574.                 }
  575.                 else {
  576.                     reasonMsg = "Vehicle Collision";
  577.                 }
  578.             }
  579.             case 51:
  580.             {
  581.                 if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
  582.                     switch(GetVehicleModel(GetPlayerVehicleID(killerid))) {
  583.                         case 425:
  584.                         {
  585.                             reasonMsg = "Hunter Rockets";
  586.                         }
  587.                         case 432:
  588.                         {
  589.                             reasonMsg = "Rhino Turret";
  590.                         }
  591.                         case 520:
  592.                         {
  593.                             reasonMsg = "Hydra Rockets";
  594.                         }
  595.                         default:
  596.                         {
  597.                             reasonMsg = "Explosion";
  598.                         }
  599.                     }
  600.                 }
  601.                 else {
  602.                     reasonMsg = "Explosion";
  603.                 }
  604.             }
  605.             default:
  606.             {
  607.                 reasonMsg = "Unknown";
  608.             }
  609.         }
  610.         format(msg, sizeof(msg), "04*** %s killed %s. (%s)", killerName, playerName, reasonMsg);
  611.     }
  612.     else {
  613.         switch (reason) {
  614.             case 53:
  615.             {
  616.                 format(msg, sizeof(msg), "04*** %s died. (Drowned)", playerName);
  617.             }
  618.             case 54:
  619.             {
  620.                 format(msg, sizeof(msg), "04*** %s died. (Collision)", playerName);
  621.             }
  622.             default:
  623.             {
  624.                 format(msg, sizeof(msg), "04*** %s died.", playerName);
  625.             }
  626.         }
  627.     }
  628.     IRC_GroupSay(GroupID[0], EchoChan, msg);
  629.     if(strlen(AdminChan) != 0) {
  630.         if (reason == 54 || killerid == 255) {
  631.             new Float:X, Float:Y, Float:Z, lolz1[256];
  632.             new currentzonename[256];
  633.             GetPlayerPos(playerid,X,Y,Z);
  634.             currentzonename = GetXYZZoneName(X,Y,Z);
  635.             format(lolz1,256,"%s 4(Location: %s)", msg, currentzonename);
  636.             IRC_GroupSay(GroupID[1],AdminChan,lolz1);
  637.         }
  638.         else if(killerid != 255) {
  639.             new Float:X, Float:Y, Float:Z, lolz1[256];
  640.             new currentzonename[256];
  641.             GetPlayerPos(playerid,X,Y,Z);
  642.             currentzonename = GetXYZZoneName(X,Y,Z);
  643.             format(lolz1,256,"%s 4(Distance: %.0f ft - Location: %s)", msg, GetDistanceBetweenPlayers(playerid,killerid), currentzonename);
  644.             IRC_GroupSay(GroupID[1],AdminChan,lolz1);
  645.         }
  646.         else {
  647.             new Float:X, Float:Y, Float:Z, lolz1[256];
  648.             new currentzonename[256];
  649.             GetPlayerPos(playerid,X,Y,Z);
  650.             currentzonename = GetXYZZoneName(X,Y,Z);
  651.             format(lolz1,256,"%s 4(Location: %s)", msg, currentzonename);
  652.             IRC_GroupSay(GroupID[1],AdminChan,lolz1);
  653.         }
  654.     }
  655.  
  656.     return 1;
  657. }
  658.  
  659.  
  660. public OnPlayerText(playerid, text[])
  661. {
  662.     if(QuestionStarted == 1 && strfind(text[0], Question, false) == 0) {
  663.         new pname[128];
  664.         GetPlayerName(playerid,pname,sizeof(pname));
  665.         new string[128];
  666.         format(string, sizeof(string), "***  %s has won $%d, by typing %s ",pname, RandomQuestionMoney, Question);
  667.         SendClientMessageToAll(green, string);
  668.         printf(string);
  669.         IRC_GroupSay(GroupID[0], EchoChan, string);
  670.         GivePlayerMoney(playerid, RandomQuestionMoney);
  671.         QuestionStarted = 0;
  672.         return 0;
  673.     }
  674.     new playertext[256];
  675.     if(IsPlayerAdmin(playerid)) {
  676.         new admintext[200];
  677.         format(admintext,200,"2** 4[%i]3 %s:1 %s",playerid,PlayerName(playerid),text);
  678.         IRC_GroupSay(GroupID[0], EchoChan, admintext);
  679.         if(strlen(AdminChan) != 0) {
  680.             IRC_GroupSay(GroupID[1], AdminChan, admintext);
  681.         }
  682.         return 1;
  683.     }
  684.     if(!IsPlayerMuted[playerid]) {
  685.         format(playertext,sizeof(playertext), "2** 4[%i]2 %s:1 %s",playerid,PlayerName(playerid),text);
  686.         IRC_GroupSay(GroupID[0], EchoChan, playertext);
  687.         return 1;
  688.     }
  689.     if(strlen(AdminChan) != 0) {
  690.         format(playertext,sizeof(playertext), "4** [%i] %s:1 %s",playerid,PlayerName(playerid),text);
  691.         IRC_GroupSay(GroupID[1], AdminChan, playertext);
  692.     }
  693.     SendClientMessage(playerid,red,"*** You are currently muted.");
  694.     return 1;
  695. }
  696.  
  697.  
  698. public SendQuestionForMoney()
  699. {
  700.     new string[128];
  701.     new qstring[32];
  702.     RandomQuestionMoney = MinQuestionMoney+random(MaxQuestionMoney-MinQuestionMoney);
  703.     format(qstring, sizeof(qstring), "%d%d%d%d%d%d%d%d", random(9), random(9), random(9), random(9), random(9), random(9), random(9), random(9));
  704.     strmid(Question, qstring, false, strlen(qstring), 32);
  705.     format(string, sizeof(string), "***   The fastest who types %s will earn $%d", qstring, RandomQuestionMoney);
  706.     printf(string);
  707.     IRC_GroupSay(GroupID[0], EchoChan, string);
  708.     SendClientMessageToAll(green, string);
  709.     QuestionStarted = 1;
  710.     return 1;
  711. }
  712.  
  713.  
  714. public IALoad()
  715. {
  716.     if(strlen(BotName1) != 0) {
  717.         SetTimer("IABot1",Delay,0);
  718.         if(Delay == 1000 && strlen(BotName2) != 0) {
  719.             Delay += 1000;
  720.         }
  721.         else {
  722.             Delay = 15000;
  723.         }
  724.         Total++;
  725.     }
  726.     else {
  727.         return 1;
  728.     }
  729.     if(strlen(BotName2) != 0) {
  730.         SetTimer("IABot2",Delay,0);
  731.         if(Delay == 2000 && strlen(BotName3) != 0) {
  732.             Delay += 1000;
  733.         }
  734.         else {
  735.             Delay = 15000;
  736.         }
  737.         Total++;
  738.     }
  739.     else {
  740.         return 1;
  741.     }
  742.     if(strlen(BotName3) != 0) {
  743.         SetTimer("IABot3",Delay,0);
  744.         if(Delay == 3000 && strlen(BotName4) != 0) {
  745.             Delay += 1000;
  746.         }
  747.         else {
  748.             Delay = 15000;
  749.         }
  750.         Total++;
  751.     }
  752.     else {
  753.         return 1;
  754.     }
  755.     if(strlen(BotName4) != 0) {
  756.         SetTimer("IABot4",Delay,0);
  757.         Delay = 15000;
  758.         Total++;
  759.     }
  760.     else {
  761.         return 1;
  762.     }
  763.     return 1;
  764. }
  765.  
  766.  
  767. public IABot1()
  768. {
  769.     if(strlen(BotName1) == 0) return 1;
  770.     if(strlen(BotRealName) != 0) {
  771.         if(strlen(BotUserName) != 0) {
  772.             EchoConnection[0] = IRC_Connect(IrcServer,IrcPort,BotName1,BotRealName,BotUserName);
  773.         }
  774.         else {
  775.             EchoConnection[0] = IRC_Connect(IrcServer,IrcPort,BotName1,BotRealName,"Bot");
  776.         }
  777.     }
  778.     else {
  779.         if(strlen(BotUserName) != 0) {
  780.             EchoConnection[0] = IRC_Connect(IrcServer,IrcPort,BotName1,"IAdministrator 1.0 by PlayerX",BotUserName);
  781.         }
  782.         else {
  783.             EchoConnection[0] = IRC_Connect(IrcServer,IrcPort,BotName1,"IAdministrator 1.0 by PlayerX","Bot");
  784.         }
  785.     }
  786.     return 1;
  787. }
  788.  
  789.  
  790. public IABot2()
  791. {
  792.     if(strlen(BotName2) == 0) return 1;
  793.     if(strlen(BotRealName) != 0) {
  794.         if(strlen(BotUserName) != 0) {
  795.             EchoConnection[1] = IRC_Connect(IrcServer,IrcPort,BotName2,BotRealName,BotUserName);
  796.         }
  797.         else {
  798.             EchoConnection[1] = IRC_Connect(IrcServer,IrcPort,BotName2,BotRealName,"Bot");
  799.         }
  800.     }
  801.     else {
  802.         if(strlen(BotUserName) != 0) {
  803.             EchoConnection[1] = IRC_Connect(IrcServer,IrcPort,BotName2,"IAdministrator 1.0 by PlayerX",BotUserName);
  804.         }
  805.         else {
  806.             EchoConnection[1] = IRC_Connect(IrcServer,IrcPort,BotName2,"IAdministrator 1.0 by PlayerX","Bot");
  807.         }
  808.     }
  809.     return 1;
  810. }
  811.  
  812.  
  813. public IABot3()
  814. {
  815.     if(strlen(BotName3) == 0) return 1;
  816.     if(strlen(BotRealName) != 0) {
  817.         if(strlen(BotUserName) != 0) {
  818.             EchoConnection[2] = IRC_Connect(IrcServer,IrcPort,BotName3,BotRealName,BotUserName);
  819.         }
  820.         else {
  821.             EchoConnection[2] = IRC_Connect(IrcServer,IrcPort,BotName3,BotRealName,"Bot");
  822.         }
  823.     }
  824.     else {
  825.         if(strlen(BotUserName) != 0) {
  826.             EchoConnection[2] = IRC_Connect(IrcServer,IrcPort,BotName3,"IAdministrator 1.0 by PlayerX",BotUserName);
  827.         }
  828.         else {
  829.             EchoConnection[2] = IRC_Connect(IrcServer,IrcPort,BotName3,"IAdministrator 1.0 by PlayerX","Bot");
  830.         }
  831.     }
  832.     return 1;
  833. }
  834.  
  835.  
  836. public IABot4()
  837. {
  838.     if(strlen(BotName4) == 0) return 1;
  839.     if(strlen(BotRealName) != 0) {
  840.         if(strlen(BotUserName) != 0) {
  841.             EchoConnection[3] = IRC_Connect(IrcServer,IrcPort,BotName4,BotRealName,BotUserName);
  842.         }
  843.         else {
  844.             EchoConnection[3] = IRC_Connect(IrcServer,IrcPort,BotName4,BotRealName,"Bot");
  845.         }
  846.     }
  847.     else {
  848.         if(strlen(BotUserName) != 0) {
  849.             EchoConnection[3] = IRC_Connect(IrcServer,IrcPort,BotName4,"IAdministrator 1.0 by PlayerX",BotUserName);
  850.         }
  851.         else {
  852.             EchoConnection[3] = IRC_Connect(IrcServer,IrcPort,BotName4,"IAdministrator 1.0 by PlayerX","Bot");
  853.         }
  854.     }
  855.     return 1;
  856. }
  857.  
  858.  
  859. //==========================//
  860. // Callbacks of the irc.inc //
  861. //==========================//
  862.  
  863. public IRC_OnConnect(botid)
  864. {
  865.     new mode[256];
  866.     IRC_JoinChannel(botid, EchoChan);
  867.     if(botid == EchoConnection[0]) {
  868.         format(mode,256,"mode %s +B",BotName1);
  869.         IRC_SendRaw(botid,mode);
  870.     }
  871.     else if(botid == EchoConnection[1]) {
  872.         format(mode,256,"mode %s +B",BotName2);
  873.         IRC_SendRaw(botid,mode);
  874.     }
  875.     else if(botid == EchoConnection[2]) {
  876.         format(mode,256,"mode %s +B",BotName3);
  877.         IRC_SendRaw(botid,mode);
  878.     }
  879.     else if(botid == EchoConnection[3]) {
  880.         format(mode,256,"mode %s +B",BotName4);
  881.         IRC_SendRaw(botid,mode);
  882.     }
  883.     if(strlen(AdminChan) != 0) {
  884.         IRC_JoinChannel(botid, AdminChan, AdminPass);
  885.     }
  886.     Delay = 15000;
  887.     if(strlen(BotPass) != 0) {
  888.         new ns[100];
  889.         format(ns,100,"privmsg nickserv identify %s",BotPass);
  890.         IRC_SendRaw(botid,ns);
  891.     }
  892.     if(strlen(ChanPass) != 0) {
  893.         new cs1[100];
  894.         new cs2[100];
  895.         format(cs1,100,"privmsg chanserv identify %s %s",EchoChan,BotPass);
  896.         format(cs2,100,"privmsg chanserv identify %s %s",AdminChan,BotPass);
  897.         IRC_SendRaw(botid,cs1);
  898.         IRC_SendRaw(botid,cs2);
  899.     }
  900.     return 1;
  901. }
  902.  
  903.  
  904. public IRC_OnDisconnect(botid)
  905. {
  906.     if(botid == EchoConnection[0] && strlen(BotName1) != 0) {
  907.         SetTimer("IABot1",Delay,0);
  908.         Total--;
  909.     }
  910.     else if(botid == EchoConnection[1] && strlen(BotName2) != 0) {
  911.         SetTimer("IABot2",Delay,0);
  912.         Total--;
  913.     }
  914.     else if(botid == EchoConnection[2] && strlen(BotName3) != 0) {
  915.         SetTimer("IABot3",Delay,0);
  916.         Total--;
  917.     }
  918.     else if(botid == EchoConnection[4] && strlen(BotName4) != 0) {
  919.         SetTimer("IABot4",Delay,0);
  920.         Total--;
  921.     }
  922.     IRC_RemoveFromGroup(GroupID[0], botid);
  923.     IRC_RemoveFromGroup(GroupID[1], botid);
  924.     return 1;
  925. }
  926.  
  927.  
  928. public IRC_OnJoinChannel(botid, channel[])
  929. {
  930.     if(SendMsg == 0 && botid == EchoConnection[0]) {
  931.         for(new i=0;i<5;i++) {
  932.             if(strlen(JoinMsg[i]) != 0) {
  933.                 IRC_Say(botid,channel,JoinMsg[i]);
  934.             }
  935.         }
  936.         SendMsg = 1;
  937.     }
  938.     IRC_AddToGroup(GroupID[0], botid);
  939.     if(strlen(AdminChan) != 0) {
  940.         IRC_AddToGroup(GroupID[1], botid);
  941.     }
  942.     if(strcmp(IrcToServer,"admin", true) == 0) {
  943.         new msg[256];
  944.         format(msg,256,"=[BOT]= has joined %s", channel);
  945.         MsgToTheAdmin(msg);
  946.     }
  947.     else if(strcmp(IrcToServer,"all", true) == 0) {
  948.         new msg[256];
  949.         format(msg,256,"=[BOT]= has joined %s", channel);
  950.         SendClientMessageToAll(green, msg);
  951.     }
  952.     else {
  953.         return 1;
  954.     }
  955.     return 1;
  956. }
  957.  
  958.  
  959. public IRC_OnLeaveChannel(botid, channel[], message[])
  960. {
  961.     if(strcmp(channel,EchoChan, true) == 0) {
  962.         IRC_RemoveFromGroup(GroupID[0], botid);
  963.         IRC_JoinChannel(botid, channel);
  964.     }
  965.     if(strcmp(channel,AdminChan, true) == 0 && strlen(AdminChan) != 0) {
  966.         IRC_RemoveFromGroup(GroupID[1], botid);
  967.         IRC_JoinChannel(botid, channel);
  968.     }
  969.     if(strcmp(IrcToServer,"admin", true) == 0 && botid == EchoConnection[0]) {
  970.         new msg[256];
  971.         format(msg,256,"=[BOT]= has left %s (%s)", channel, message);
  972.         MsgToTheAdmin(msg);
  973.     }
  974.     else if(strcmp(IrcToServer,"all", true) == 0 && botid == EchoConnection[0]) {
  975.         new msg[256];
  976.         format(msg,256,"=[BOT]= has left %s (%s)", channel, message);
  977.         SendClientMessageToAll(green, msg);
  978.     }
  979.     else {
  980.         return 1;
  981.     }
  982.     return 1;
  983. }
  984.  
  985.  
  986. public IRC_OnUserNotice(botid, recipient[], user[], host[], message[])
  987. {
  988.     if(strcmp(user,"NickServ", true) == 0 || strcmp(user,"ChanServ", true) == 0 || strcmp(user,"OperServ", true) == 0 || strcmp(user,"HostServ", true) == 0 || strcmp(user,"MemoServ", true) == 0 || strcmp(user,"BotServ", true) == 0) {
  989.         if(strlen(AdminChan) != 0) {
  990.             new notice[256];
  991.             format(notice,256,"2[%s]3 %s",user,message);
  992.             IRC_Say(botid, AdminChan, notice);
  993.         }
  994.     }
  995.     else if(strcmp(user,BotName1, true) == 0 || strcmp(user,BotName2, true) == 0 || strcmp(user,BotName3, true) == 0 || strcmp(user,BotName4, true) == 0) return 1;
  996.     else {
  997.         if(strlen(AdminChan) != 0) {
  998.             new notice[256];
  999.             format(notice,256,"12[%s]3 %s",user,message);
  1000.             IRC_Say(botid, AdminChan, notice);
  1001.         }
  1002.     }
  1003.     if(strcmp(IrcToServer,"admin", true) == 0) {
  1004.         new msg[256];
  1005.         format(msg,256,"-%s- %s",user, message);
  1006.         MsgToTheAdmin(msg);
  1007.     }
  1008.     else if(strcmp(IrcToServer,"all", true) == 0) {
  1009.         new msg[256];
  1010.         format(msg,256,"-%s- %s",user, message);
  1011.         SendClientMessageToAll(green, msg);
  1012.     }
  1013.     else {
  1014.         return 1;
  1015.     }
  1016.     return 1;
  1017. }
  1018.  
  1019.  
  1020. public IRC_OnReceiveRaw(botid, message[])
  1021. {
  1022.     if (strfind(message, ":PING") != -1) return 1;
  1023.     if (strfind(message, ":VERSION") != -1) return 1;
  1024.     if (strfind(message, ":TIME") != -1) return 1;
  1025.     return 1;
  1026. }
  1027.  
  1028.  
  1029. public IRC_OnUserJoinChannel(botid, channel[], user[], host[])
  1030. {
  1031.     if(strcmp(Mode,"+v", true) == 0 || strcmp(Mode,"+h", true) == 0 || strcmp(Mode,"+o", true) == 0 || strcmp(Mode,"+a", true) == 0 || strcmp(Mode,"+q", true) == 0) {
  1032.         new SetMode[100];
  1033.         format(SetMode,100,"mode %s %s %s",channel,Mode,user);
  1034.         IRC_SendRaw(EchoConnection[0],SetMode);
  1035.     }
  1036.     if(strcmp(IrcToServer,"admin", true) == 0 && strcmp(channel,EchoChan, true) == 0 && botid == EchoConnection[0]) {
  1037.         new msg[256];
  1038.         format(msg,256,"* %s (%s) has joined %s.",user, host, channel);
  1039.         MsgToTheAdmin(msg);
  1040.     }
  1041.     else if(strcmp(IrcToServer,"all", true) == 0 && strcmp(channel,EchoChan, true) == 0 && botid == EchoConnection[0]) {
  1042.         new msg[256];
  1043.         format(msg,256,"* %s (%s) has joined %s.",user, host, channel);
  1044.         SendClientMessageToAll(green, msg);
  1045.     }
  1046.     else {
  1047.         return 1;
  1048.     }
  1049.     return 1;
  1050. }
  1051.  
  1052.  
  1053. public IRC_OnUserLeaveChannel(botid, channel[], user[], host[], message[])
  1054. {
  1055.     if(strlen(message) != 0 && botid == EchoConnection[0] && strcmp(channel,EchoChan, true) == 0) {
  1056.         if(strcmp(IrcToServer,"admin", true) == 0) {
  1057.             new msg[256];
  1058.             format(msg,256,"* %s (%s) has left %s. (%s)",user, host, channel, message);
  1059.             MsgToTheAdmin(msg);
  1060.         }
  1061.         else if(strcmp(IrcToServer,"all", true) == 0) {
  1062.             new msg[256];
  1063.             format(msg,256,"* %s (%s) has left %s. (%s)",user, host, channel, message);
  1064.             SendClientMessageToAll(green, msg);
  1065.         }
  1066.         else {
  1067.             return 1;
  1068.         }
  1069.     }
  1070.     else if(strlen(message) == 0 && botid == EchoConnection[0] && strcmp(channel,EchoChan, true) == 0) {
  1071.         if(strcmp(IrcToServer,"admin", true) == 0) {
  1072.             new msg[256];
  1073.             format(msg,256,"* %s (%s) has left %s.",user, host, channel);
  1074.             MsgToTheAdmin(msg);
  1075.         }
  1076.         else if(strcmp(IrcToServer,"all", true) == 0) {
  1077.             new msg[256];
  1078.             format(msg,256,"* %s (%s) has left %s.",user, host, channel);
  1079.             SendClientMessageToAll(green, msg);
  1080.         }
  1081.         else {
  1082.             return 1;
  1083.         }
  1084.     }
  1085.     else {
  1086.         return 1;
  1087.     }
  1088.     return 1;
  1089. }
  1090.  
  1091.  
  1092. public IRC_OnUserDisconnect(botid, user[], host[], message[])
  1093. {
  1094.     if(strlen(message) != 0 && botid == EchoConnection[0]) {
  1095.         if(strcmp(IrcToServer,"admin", true) == 0) {
  1096.             new msg[256];
  1097.             format(msg,256,"* %s (%s) has quit. (%s)",user, host, message);
  1098.             MsgToTheAdmin(msg);
  1099.         }
  1100.         else if(strcmp(IrcToServer,"all", true) == 0) {
  1101.             new msg[256];
  1102.             format(msg,256,"* %s (%s) has quit. (%s)",user, host, message);
  1103.             SendClientMessageToAll(green, msg);
  1104.         }
  1105.         else {
  1106.             return 1;
  1107.         }
  1108.     }
  1109.     else if(strlen(message) == 0 && botid == EchoConnection[0]) {
  1110.         if(strcmp(IrcToServer,"admin", true) == 0) {
  1111.             new msg[256];
  1112.             format(msg,256,"* %s (%s) has quit.",user, host);
  1113.             MsgToTheAdmin(msg);
  1114.         }
  1115.         else if(strcmp(IrcToServer,"all", true) == 0) {
  1116.             new msg[256];
  1117.             format(msg,256,"* %s (%s) has quit.",user, host);
  1118.             SendClientMessageToAll(green, msg);
  1119.         }
  1120.         else {
  1121.             return 1;
  1122.         }
  1123.     }
  1124.     else {
  1125.         return 1;
  1126.     }
  1127.     return 1;
  1128. }
  1129.  
  1130.  
  1131. public IRC_OnUserNickChange(botid, oldnick[], newnick[], host[])
  1132. {
  1133.     if(strcmp(IrcToServer,"admin", true) == 0 && botid == EchoConnection[0]) {
  1134.         new msg[256];
  1135.         format(msg,256,"* %s is now known as %s.",oldnick, newnick);
  1136.         MsgToTheAdmin(msg);
  1137.     }
  1138.     else if(strcmp(IrcToServer,"all", true) == 0 && botid == EchoConnection[0]) {
  1139.         new msg[256];
  1140.         format(msg,256,"* %s is now known as %s.",oldnick, newnick);
  1141.         SendClientMessageToAll(green, msg);
  1142.     }
  1143.     else {
  1144.         return 1;
  1145.     }
  1146.     return 1;
  1147. }
  1148.  
  1149.  
  1150. public IRC_OnUserSay(botid, recipient[], user[], host[], message[])
  1151. {
  1152.     new GetEchoBotConnection = botid;
  1153.     if(GetEchoBotConnection == EchoConnection[0]) {
  1154.         if ((message[0] != '!')) return 1;
  1155.         new space = (strfind(message, " "));
  1156.         new cmdlen;
  1157.         if (space>=1) {
  1158.             new lenmsg = strlen(message);
  1159.             cmdlen = ((lenmsg-(lenmsg-space))-1);
  1160.         }
  1161.         else {
  1162.             cmdlen = (strlen(message)-1);
  1163.         }
  1164.         if (cmdlen == 2) {
  1165.             irccmd(me,2,botid,recipient,user,message);
  1166.             irccmd(pm,2,botid,recipient,user,message);
  1167.             irccmd(ip,2,botid,recipient,user,message);
  1168.         }
  1169.         else if (cmdlen == 3) {
  1170.             irccmd(raw,3,botid,recipient,user,message);
  1171.             irccmd(say,3,botid,recipient,user,message);
  1172.             irccmd(ban,3,botid,recipient,user,message);
  1173.             irccmd(ann,3,botid,recipient,user,message);
  1174.             irccmd(car,3,botid,recipient,user,message);
  1175.             irccmd(irc,3,botid,recipient,user,message);
  1176.             irccmd(xyz,3,botid,recipient,user,message);
  1177.             irccmd(gmx,3,botid,recipient,user,message);
  1178.             irccmd(loc,3,botid,recipient,user,message);
  1179.         }
  1180.         else if (cmdlen == 4) {
  1181.             irccmd(kick,4,botid,recipient,user,message);
  1182.             irccmd(kill,4,botid,recipient,user,message);
  1183.             irccmd(time,4,botid,recipient,user,message);
  1184.             irccmd(jail,4,botid,recipient,user,message);
  1185.             irccmd(name,4,botid,recipient,user,message);
  1186.             irccmd(slap,4,botid,recipient,user,message);
  1187.             irccmd(mute,4,botid,recipient,user,message);
  1188.         }
  1189.         else if (cmdlen == 5) {
  1190.             irccmd(score,5,botid,recipient,user,message);
  1191.             irccmd(money,5,botid,recipient,user,message);
  1192.             irccmd(getid,5,botid,recipient,user,message);
  1193.             irccmd(eject,5,botid,recipient,user,message);
  1194.             irccmd(banip,5,botid,recipient,user,message);
  1195.             irccmd(unban,5,botid,recipient,user,message);
  1196.         }
  1197.         else if (cmdlen == 6) {
  1198.             irccmd(addbot,6,botid,recipient,user,message);
  1199.             irccmd(rembot,6,botid,recipient,user,message);
  1200.             irccmd(ircraw,6,botid,recipient,user,message);
  1201.             irccmd(annall,6,botid,recipient,user,message);
  1202.             irccmd(health,6,botid,recipient,user,message);
  1203.             irccmd(armour,6,botid,recipient,user,message);
  1204.             irccmd(freeze,6,botid,recipient,user,message);
  1205.             irccmd(unmute,6,botid,recipient,user,message);
  1206.             irccmd(disarm,6,botid,recipient,user,message);
  1207.             irccmd(unjail,6,botid,recipient,user,message);
  1208.             irccmd(admins,6,botid,recipient,user,message);
  1209.             irccmd(script,6,botid,recipient,user,message);
  1210.             irccmd(upheal,6,botid,recipient,user,message);
  1211.         }
  1212.         else if (cmdlen == 7) {
  1213.             irccmd(players,7,botid,recipient,user,message);
  1214.             irccmd(fakemsg,7,botid,recipient,user,message);
  1215.             irccmd(settime,7,botid,recipient,user,message);
  1216.             irccmd(weather,7,botid,recipient,user,message);
  1217.             irccmd(setname,7,botid,recipient,user,message);
  1218.             irccmd(setskin,7,botid,recipient,user,message);
  1219.         }
  1220.         else if (cmdlen == 8) {
  1221.             irccmd(tempjail,8,botid,recipient,user,message);
  1222.             irccmd(unfreeze,8,botid,recipient,user,message);
  1223.         }
  1224.         else if (cmdlen == 9) {
  1225.             irccmd(setarmour,9,botid,recipient,user,message);
  1226.             irccmd(sethealth,9,botid,recipient,user,message);
  1227.             irccmd(givemoney,9,botid,recipient,user,message);
  1228.         }
  1229.         else if (cmdlen == 10) {
  1230.             irccmd(giveweapon,10,botid,recipient,user,message);
  1231.             irccmd(resetmoney,10,botid,recipient,user,message);
  1232.         }
  1233.     }
  1234.     return 1;
  1235. }
  1236.  
  1237.  
  1238. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  1239. {
  1240.     if(strlen(AdminChan) != 0) {
  1241.         new Float:X, Float:Y, Float:Z, lolz1[256], lolz2[50];
  1242.         new currentzonename[256];
  1243.         if(ispassenger == 0) {
  1244.             format(lolz2,50,"driver");
  1245.         }
  1246.         else {
  1247.             format(lolz2,50,"passenger");
  1248.         }
  1249.         GetPlayerPos(playerid,X,Y,Z);
  1250.         currentzonename = GetXYZZoneName(X,Y,Z);
  1251.         format(lolz1,256,"3** [%i] %s has entered the vehicle %s (ID:%d) like %s in %s.", playerid, PlayerName(playerid), VehicleNames[GetVehicleModel(vehicleid)-400], vehicleid, lolz2, currentzonename);
  1252.         IRC_GroupSay(GroupID[1], AdminChan, lolz1);
  1253.     }
  1254.     return 1;
  1255. }
  1256.  
  1257.  
  1258. public OnPlayerExitVehicle(playerid, vehicleid)
  1259. {
  1260.     if(strlen(AdminChan) != 0) {
  1261.         new Float:X, Float:Y, Float:Z, lolz1[256];
  1262.         new currentzonename[256];
  1263.         GetPlayerPos(playerid,X,Y,Z);
  1264.         currentzonename = GetXYZZoneName(X,Y,Z);
  1265.         format(lolz1,256,"3** [%i] %s has exited of the vehicle %s (ID:%d) in %s.", playerid, PlayerName(playerid), VehicleNames[GetVehicleModel(vehicleid)-400], vehicleid, currentzonename);
  1266.         IRC_GroupSay(GroupID[1], AdminChan, lolz1);
  1267.     }
  1268.     return 1;
  1269. }
  1270.  
  1271.  
  1272. public OnVehicleMod(playerid, vehicleid, componentid)
  1273. {
  1274.     if(strlen(AdminChan)) {
  1275.         new lolz1[256];
  1276.         format(lolz1,256,"2** %s (ID:%d) added %s (%d) to the vehicle %s. (ID:%d)", PlayerName(playerid), playerid, ComponentsNames(componentid), componentid, VehicleNames[GetVehicleModel(vehicleid)-400], vehicleid);
  1277.         IRC_GroupSay(GroupID[1],AdminChan,lolz1);
  1278.     }
  1279.     return 1;
  1280. }
  1281.  
  1282.  
  1283. irccmd_me(conn, channel[], user[], params[])
  1284. {
  1285.     new lolz1[256], lolz2[256];
  1286.     if(!strlen(params)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !me <message>");
  1287.     format(lolz1,sizeof(lolz1), "*** %s %s", user, params);
  1288.     SendClientMessageToAll(red, lolz1);
  1289.     format(lolz2,sizeof(lolz2),"4*** %s %s", user, params);
  1290.     IRC_GroupSay(GroupID[0], channel, lolz2);
  1291. #pragma unused conn
  1292.     return true;
  1293. }
  1294.  
  1295.  
  1296. irccmd_pm(conn, channel[], user[], params[])
  1297. {
  1298.     new giveid,msg[256],lolz1[256], lolz2[256], pon[100];
  1299.     if(sscanf(params,"ss",pon,msg)) return IRC_GroupSay(GroupID[0], channel,"3Usage:1 !pm <PartOfName/PlayerID> <Message>");
  1300.     giveid = ReturnUser(pon);
  1301.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0], channel,"4*** Error: Invalid player ID.");
  1302.     format(lolz1,256, "*** Pm from %s (IRC): %s",user, msg);
  1303.     format(lolz2,256, "5*** Pm to %s (ID:%d):1 %s",PlayerName(giveid),giveid,msg);
  1304.     SendClientMessage(giveid,green,lolz1);
  1305.     IRC_GroupSay(GroupID[0], channel, lolz2);
  1306. #pragma unused conn
  1307.     return true;
  1308. }
  1309.  
  1310.  
  1311. irccmd_ip(conn, channel[], user[], params[])
  1312. {
  1313.     new giveid, lolz1[256], Ip[256], pon[100];
  1314.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  1315.     if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0], channel,"3Usage:1 !ip <PartOfName/PlayerID>");
  1316.     giveid = ReturnUser(pon);
  1317.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0], channel,"4*** Error: Invalid player ID.");
  1318.     GetPlayerIp(giveid, Ip, 256);
  1319.     format(lolz1,256,"3* IP from %s (ID:%d):1 %s.",PlayerName(giveid),giveid,Ip);
  1320.     IRC_GroupNotice(GroupID[1],user,lolz1);
  1321. #pragma unused conn
  1322.     return true;
  1323. }
  1324.  
  1325.  
  1326. irccmd_raw(conn, channel[], user[], params[])
  1327. {
  1328.     new lolz1[256];
  1329.     if(!IsPlayerSop(conn,channel,user)) return AccessDenied(user);
  1330.     if(!strlen(params)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !raw <Command>");
  1331.     format(lolz1,256,"3*** Raw Command:1 %s",params);
  1332.     IRC_GroupSay(GroupID[0], channel, lolz1);
  1333.     SendRconCommand(params);
  1334. #pragma unused conn, user
  1335.     return true;
  1336. }
  1337.  
  1338.  
  1339. irccmd_say(conn, channel[], user[], params[])
  1340. {
  1341.     if(!strlen(params)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !say <Message>");
  1342.     new lolz1[256], lolz2[256];
  1343.     if(IsPlayerOwner(conn,channel,user)) {
  1344.         format(lolz1,256,"* Admin %s on irc: %s",user,params);
  1345.         SendClientMessageToAll(orange, lolz1);
  1346.         format(lolz2,256,"2* Admin %s on irc:1 %s",user,params);
  1347.         IRC_GroupSay(GroupID[0],channel,lolz2);
  1348.         return true;
  1349.     }
  1350.     else if(IsPlayerSop(conn,channel,user)) {
  1351.         format(lolz1,256,"* Admin %s on irc: %s",user,params);
  1352.         SendClientMessageToAll(orange, lolz1);
  1353.         format(lolz2,256,"2* Admin %s on irc:1 %s",user,params);
  1354.         IRC_GroupSay(GroupID[0],channel,lolz2);
  1355.         return true;
  1356.     }
  1357.     else if(IsPlayerOp(conn,channel,user)) {
  1358.         format(lolz1,256,"* Admin %s on irc: %s",user,params);
  1359.         SendClientMessageToAll(orange, lolz1);
  1360.         format(lolz2,256,"2* Admin %s on irc:1 %s",user,params);
  1361.         IRC_GroupSay(GroupID[0],channel,lolz2);
  1362.         return true;
  1363.     }
  1364.     else if(IsPlayerHop(conn,channel,user)) {
  1365.         format(lolz1,256,"* Mod %s on irc: %s",user,params);
  1366.         SendClientMessageToAll(orange, lolz1);
  1367.         format(lolz2,256,"2* Mod %s on irc:1 %s",user,params);
  1368.         IRC_GroupSay(GroupID[0],channel,lolz2);
  1369.         return true;
  1370.     }
  1371.     else if(IsPlayerVoi(conn,channel,user)) {
  1372.         format(lolz1,256,"* Guest %s on irc: %s",user,params);
  1373.         SendClientMessageToAll(orange, lolz1);
  1374.         format(lolz2,256,"2* Guest %s on irc:1 %s",user,params);
  1375.         IRC_GroupSay(GroupID[0],channel,lolz2);
  1376.         return true;
  1377.     }
  1378.     format(lolz1,256,"* Guest %s on irc: %s",user,params);
  1379.     SendClientMessageToAll(orange, lolz1);
  1380.     format(lolz2,256,"2* Guest %s on irc:1 %s",user,params);
  1381.     IRC_GroupSay(GroupID[0],channel,lolz2);
  1382. #pragma unused conn
  1383.     return true;
  1384. }
  1385.  
  1386.  
  1387. irccmd_ban(conn, channel[], user[], params[])
  1388. {
  1389.     new giveid,msg[255],sayban[255], bansay[256], pon[100];
  1390.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  1391.     if(sscanf(params, "sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !ban <PartOfName/PlayerID> <Reason [Optional]>");
  1392.     giveid = ReturnUser(pon);
  1393.     if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
  1394.     format(sayban,sizeof(sayban),"*** Admin %s (IRC) banned player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1395.     format(bansay,sizeof(bansay),"4*** Admin %s (IRC) banned player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1396.     SendClientMessageToAll(red,sayban);
  1397.     IRC_GroupSay(GroupID[0],channel,bansay);
  1398.     BanEx(giveid,msg);
  1399. #pragma unused conn
  1400.     return true;
  1401. }
  1402.  
  1403.  
  1404. irccmd_ann(conn, channel[], user[], params[])
  1405. {
  1406.     new imsg[256],giveid,ponoid[100],lolz1[256],lolz2[256];
  1407.     if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
  1408.     if(sscanf(params,"ss",ponoid,imsg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !ann <PartOfName/PlayerID> <Message>");
  1409.     giveid = ReturnUser(ponoid);
  1410.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1411.     format(lolz1,256,"3*** Announce from %s to %s (ID:%d):1 %s",user,PlayerName(giveid),giveid,imsg);
  1412.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1413.     format(lolz2,256,"~w~%s",imsg);
  1414.     GameTextForPlayer(giveid,lolz2,5000,3);
  1415. #pragma unused conn
  1416.     return true;
  1417. }
  1418.  
  1419.  
  1420. irccmd_car(conn, channel[], user[], params[])
  1421. {
  1422.     new giveid,lolz1[256],pon[100];
  1423.     if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !car <PartOfName/PlayerID>");
  1424.     giveid = ReturnUser(pon);
  1425.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1426.     if(!IsPlayerInAnyVehicle(giveid)) {
  1427.         format(lolz1,256,"4*** Error: %s is currently on foot,",PlayerName(giveid));
  1428.         IRC_GroupSay(GroupID[0],channel,lolz1);
  1429.     }
  1430.     if(IsPlayerInAnyVehicle(giveid)) {
  1431.         new Float:VHealth, carid = GetPlayerVehicleID(giveid); GetVehicleHealth(carid,VHealth);
  1432.         format(lolz1,256,"3*** Vehicle from %s (ID:%d): Vehicle id:1 %d 3- Model:1 %s 3- Health:1 %d",PlayerName(giveid),giveid,carid,VehicleNames[GetVehicleModel(GetPlayerVehicleID(giveid))-400],floatround(VHealth));
  1433.         IRC_GroupSay(GroupID[0],channel,lolz1);
  1434.     }
  1435. #pragma unused conn, user
  1436.     return true;
  1437. }
  1438.  
  1439.  
  1440. irccmd_irc(conn, channel[], user[], params[])
  1441. {
  1442.     new lolz1[256], lolz2[256];
  1443.     format(lolz1,256,"3*** IRC Server: %s:%d - Channel: %s",IrcServer,IrcPort,EchoChan);
  1444.     format(lolz2,256,"*** IRC Server: %s:%d - Channel: %s",IrcServer,IrcPort,EchoChan);
  1445.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1446.     SendClientMessageToAll(green,lolz2);
  1447. #pragma unused params,user,conn
  1448.     return true;
  1449. }
  1450.  
  1451.  
  1452. irccmd_xyz(conn, channel[], user[], params[])
  1453. {
  1454.     new giveid, lolz1[256], pon[100];
  1455.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  1456.     if (sscanf(params, "s", pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !xyz <PartOfName/PlayerID>");
  1457.     giveid = ReturnUser(pon);
  1458.     if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1459.     new Float:X,Float:Y,Float:Z;
  1460.     GetPlayerPos(giveid,X,Y,Z);
  1461.     format(lolz1,256,"3* Position from %s (ID:%d): X:1 %f 3, Y:1 %f 3, Z:1 %f",PlayerName(giveid),giveid,X,Y,Z);
  1462.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1463. #pragma unused conn, user
  1464.     return true;
  1465. }
  1466.  
  1467.  
  1468. irccmd_gmx(conn, channel[], user[], params[])
  1469. {
  1470.     new lolz1[256];
  1471.     if(!IsPlayerSop(conn,channel,user)) return AccessDenied(user);
  1472.     format(lolz1,256,"4*** Restarted the gamemode.");
  1473.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1474.     SendRconCommand("gmx");
  1475. #pragma unused conn,params
  1476.     return true;
  1477. }
  1478.  
  1479.  
  1480. irccmd_loc(conn, channel[], user[], params[])
  1481. {
  1482.     new giveid,lolz1[256],lolz2[256],pon[100];
  1483.     if (sscanf(params,"s", pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !loc <PartOfName/PlayerID>");
  1484.     giveid = ReturnUser(pon);
  1485.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1486.     new currentzonename[256];
  1487.     new Float:X,Float:Y,Float:Z;
  1488.     GetPlayerPos(giveid,X,Y,Z);
  1489.     currentzonename = GetXYZZoneName(X,Y,Z);
  1490.     format(lolz1,256,"3* Location from %s (ID:%d): 1%s",PlayerName(giveid),giveid,currentzonename);
  1491.     format(lolz2,256,"* Location from %s (ID:%d): %s",PlayerName(giveid),giveid,currentzonename);
  1492.     SendClientMessageToAll(orange,lolz2);
  1493.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1494. #pragma unused conn, user
  1495.     return true;
  1496. }
  1497.  
  1498.  
  1499. irccmd_kick(conn, channel[], user[], params[])
  1500. {
  1501.     new giveid,msg[255],saykick[255],kicksay[256],pon[100];
  1502.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  1503.     if(sscanf(params, "sz", pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !kick <PartOfName/PlayerID> <Reason [Optional]>");
  1504.     giveid = ReturnUser(pon);
  1505.     if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
  1506.     format(saykick,sizeof(saykick),"*** Admin %s (IRC) kicked player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1507.     format(kicksay,sizeof(kicksay),"4*** Admin %s (IRC) kicked player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1508.     SendClientMessageToAll(red,saykick);
  1509.     IRC_GroupSay(GroupID[0],channel,kicksay);
  1510.     Kick(giveid);
  1511. #pragma unused conn
  1512.     return true;
  1513. }
  1514.  
  1515.  
  1516. irccmd_kill(conn, channel[], user[], params[])
  1517. {
  1518.     new giveid,msg[255],lolz1[255],lolz2[256],pon[100];
  1519.     if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
  1520.     if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !kill <PartOfName/PlayerID> <Reason [Optional]>");
  1521.     giveid = ReturnUser(pon);
  1522.     if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
  1523.     SetPlayerHealth(giveid,0);
  1524.     SetPlayerArmour(giveid,0);
  1525.     format(lolz1,sizeof(lolz1),"*** Admin %s (IRC) killed player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1526.     format(lolz2,sizeof(lolz2),"4*** Admin %s (IRC) killed player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1527.     SendClientMessageToAll(red,lolz1);
  1528.     IRC_GroupSay(GroupID[0],channel,lolz2);
  1529. #pragma unused conn
  1530.     return true;
  1531. }
  1532.  
  1533.  
  1534. irccmd_time(conn, channel[], user[], params[])
  1535. {
  1536.     new lolz1[256],lolz2[256],hour,minute,second,year,month,day;
  1537.     gettime(hour,minute,second);
  1538.     getdate(year,month,day);
  1539.     format(lolz1,256,"3*** Day: %02d/%02d/%02d Hour: %02d:%02d:%02d",day,month,year,hour,minute,second);
  1540.     format(lolz2,256,"*** Day: %02d/%02d/%02d Hour: %02d:%02d:%02d",day,month,year,hour,minute,second);
  1541.     SendClientMessageToAll(green,lolz2);
  1542.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1543. #pragma unused conn,params,user
  1544.     return true;
  1545. }
  1546.  
  1547.  
  1548. irccmd_jail(conn, channel[], user[], params[])
  1549. {
  1550.     new giveid,msg[255],lolz1[255],lolz2[256],pon[100];
  1551.     if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
  1552.     if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !jail <PartOfName/PlayerID> <Reason [Optional]>");
  1553.     giveid = ReturnUser(pon);
  1554.     if(IsPlayerJailed[giveid]) return IRC_GroupSay(GroupID[0],channel,"4*** Error: The selected ID is already Jailed.");
  1555.     if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
  1556.     SetPlayerInterior(giveid,6);
  1557.     SetPlayerPos(giveid,264.785200,77.564040,1001.039000);
  1558.     format(lolz1,sizeof(lolz1),"*** Admin %s (IRC) jailed player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1559.     format(lolz2,sizeof(lolz2),"4*** Admin %s (IRC) jailed player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1560.     SendClientMessageToAll(red,lolz1);
  1561.     IRC_GroupSay(GroupID[0],channel,lolz2);
  1562.     IsPlayerJailed[giveid] = true;
  1563. #pragma unused conn
  1564.     return true;
  1565. }
  1566.  
  1567.  
  1568. irccmd_name(conn, channel[], user[], params[])
  1569. {
  1570.     new giveid,lolz1[256];
  1571.     if(sscanf(params,"d",giveid)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !name <PlayerID>");
  1572.     if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
  1573.     format(lolz1,256,"7*** ID: %d is %s.",giveid,PlayerName(giveid));
  1574.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1575. #pragma unused conn,user
  1576.     return true;
  1577. }
  1578.  
  1579.  
  1580. irccmd_slap(conn, channel[], user[], params[])
  1581. {
  1582.     new giveid,lolz1[256],lolz2[256],msg[256],pon[100];
  1583.     if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
  1584.     if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !slap <PartOfName/PlayerID> <Reason [Optional]>");
  1585.     giveid = ReturnUser(pon);
  1586.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1587.     new Float:slx, Float:sly, Float:slz;
  1588.     new Float:shealth;
  1589.     GetPlayerHealth(giveid, shealth);
  1590.     SetPlayerHealth(giveid, shealth-15);
  1591.     GetPlayerPos(giveid, slx, sly, slz);
  1592.     SetPlayerPos(giveid, slx+5, sly, slz);
  1593.     format(lolz1,256,"4*** Admin %s (IRC) slaps player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1594.     format(lolz2,256,"*** Admin %s (IRC) slaps player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1595.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1596.     SendClientMessageToAll(red,lolz2);
  1597. #pragma unused conn
  1598.     return true;
  1599. }
  1600.  
  1601.  
  1602. irccmd_mute(conn, channel[], user[], params[])
  1603. {
  1604.     new giveid,lolz1[256],lolz2[256],msg[256],pon[100];
  1605.     if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
  1606.     if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !mute <PartOfName/PlayerID> <Reason [Optional]>");
  1607.     giveid = ReturnUser(pon);
  1608.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1609.     if(IsPlayerMuted[giveid]) return IRC_GroupSay(GroupID[0],channel,"4*** Error: The selected id is already muted.");
  1610.     format(lolz1,256,"3*** Admin %s (IRC) i silence the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1611.     format(lolz2,256,"*** Admin %s (IRC) i silence the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1612.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1613.     SendClientMessageToAll(red,lolz2);
  1614.     IsPlayerMuted[giveid] = true;
  1615. #pragma unused conn, user
  1616.     return true;
  1617. }
  1618.  
  1619.  
  1620. irccmd_score(conn, channel[], user[], params[])
  1621. {
  1622.     new giveid,lolz1[256],lolz2[256],pon[100];
  1623.     if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !score <PartOfName/PlayerID>");
  1624.     giveid = ReturnUser(pon);
  1625.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1626.     format(lolz1,256,"3* Score from %s (ID:%d):1 %d",PlayerName(giveid),giveid,GetPlayerScore(giveid));
  1627.     format(lolz2,256,"* Score from %s (ID:%d): %d",PlayerName(giveid),giveid,GetPlayerScore(giveid));
  1628.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1629.     SendClientMessageToAll(green,lolz2);
  1630. #pragma unused conn, user
  1631.     return true;
  1632. }
  1633.  
  1634.  
  1635. irccmd_money(conn, channel[], user[], params[])
  1636. {
  1637.     new giveid,lolz1[256],lolz2[256],pon[100];
  1638.     if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !money <PartOfName/PlayerID>");
  1639.     giveid = ReturnUser(pon);
  1640.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1641.     format(lolz1,256,"3* Money from %s (ID:%d):1 $%d",PlayerName(giveid),giveid,GetPlayerMoney(giveid));
  1642.     format(lolz2,256,"* Money from %s (ID:%d): $%d",PlayerName(giveid),giveid,GetPlayerMoney(giveid));
  1643.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1644.     SendClientMessageToAll(green,lolz2);
  1645. #pragma unused conn, user
  1646.     return true;
  1647. }
  1648.  
  1649.  
  1650. irccmd_getid(conn,  channel[], user[],  params[])
  1651. {
  1652.     new GetPlayer[256],giveid,lolz1[256],lolz2[256];
  1653.     if(sscanf(params,"s",GetPlayer)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !getid <PartOfName>");
  1654.     for (giveid=0; giveid<=MAX_PLAYERS; giveid++) {
  1655.         if (IsPlayerConnected(giveid)) {
  1656.             GetPlayerName(giveid,GetPlayer,16);
  1657.             new space = (strfind(GetPlayer, params));
  1658.             if (space != -1) {
  1659.                 format(lolz1, sizeof(lolz1), "3*** Player whose name is %s has the ID: %d", GetPlayer, giveid);
  1660.                 IRC_GroupSay(GroupID[0],channel,lolz1);
  1661.                 return true;
  1662.             }
  1663.         }
  1664.     }
  1665.     format(lolz2, sizeof(lolz2),"4*** Error: Invalid Name", params[0]);
  1666.     IRC_GroupSay(GroupID[0],channel,lolz2);
  1667. #pragma unused conn,user
  1668.     return true;
  1669. }
  1670.  
  1671.  
  1672. irccmd_eject(conn, channel[], user[], params[])
  1673. {
  1674.     new giveid,lolz1[256],lolz2[256],msg[256],pon[100];
  1675.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  1676.     if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !eject <PartOfName/PlayerID> <Reason [Optional]>");
  1677.     giveid = ReturnUser(pon);
  1678.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1679.     if(!IsPlayerInAnyVehicle(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: The selected id is not in a vehicle.");
  1680.     format(lolz1,256,"4*** Admin %s (IRC) eject from the vehicle to the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1681.     format(lolz2,256,"*** Admin %s (IRC) eject from the vehicle to the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1682.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1683.     SendClientMessageToAll(red,lolz2);
  1684.     RemovePlayerFromVehicle(giveid);
  1685. #pragma unused conn
  1686.     return true;
  1687. }
  1688.  
  1689.  
  1690. irccmd_banip(conn, channel[], user[], params[])
  1691. {
  1692.     new giveip[256],lolz1[256],lolz2[256],lolz3[256],msg[256];
  1693.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  1694.     if(sscanf(params,"sz",giveip,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !banip <Ip> <Reason [Optional]>");
  1695.     format(lolz1,256,"4*** Admin %s (IRC) banned the ip %s , Reason: %s.",user,giveip,msg[0] ? msg: "None");
  1696.     format(lolz2,256,"*** Admin %s (IRC) banned the ip %s , Reason: %s.",user,giveip,msg[0] ? msg: "None");
  1697.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1698.     SendClientMessageToAll(red,lolz2);
  1699.     format(lolz3,256,"banip %s",giveip);
  1700.     SendRconCommand(lolz3);
  1701. #pragma unused conn
  1702.     return true;
  1703. }
  1704.  
  1705.  
  1706. irccmd_unban(conn, channel[], user[], params[])
  1707. {
  1708.     new giveip[256],msg[256],lolz1[256],lolz2[256],lolz3[256];
  1709.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  1710.     if(sscanf(params,"sz",giveip,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !unban <Ip> <Reason [Optional]>");
  1711.     if(!IsStringIP(giveip)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Thats not an IP!");
  1712.     format(lolz1,256,"3*** Admin %s (IRC) unbanned the ip %s , Reason: %s.",user,giveip,msg[0] ? msg: "None");
  1713.     format(lolz2,256,"*** Admin %s (IRC) unbanned the ip %s , Reason: %s.",user,giveip,msg[0] ? msg: "None");
  1714.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1715.     SendClientMessageToAll(red,lolz2);
  1716.     format(lolz3,256,"unbanip %s",giveip);
  1717.     SendRconCommand(lolz3);
  1718.     SendRconCommand("reloadbans");
  1719. #pragma unused conn
  1720.     return true;
  1721. }
  1722.  
  1723.  
  1724. irccmd_health(conn, channel[], user[], params[])
  1725. {
  1726.     new giveid,lolz1[256],lolz2[256],pon[100];
  1727.     if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !health <PartOfName/PlayerID>");
  1728.     giveid = ReturnUser(pon);
  1729.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1730.     new Float:Health;
  1731.     GetPlayerHealth(giveid,Health);
  1732.     format(lolz1,256,"3* Health from %s (ID:%d):1 %.0f",PlayerName(giveid),giveid,Health);
  1733.     format(lolz2,256,"* Health from %s (ID:%d): %.0f",PlayerName(giveid),giveid,Health);
  1734.     SendClientMessageToAll(green,lolz2);
  1735.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1736. #pragma unused conn, user
  1737.     return true;
  1738. }
  1739.  
  1740.  
  1741. irccmd_armour(conn, channel[], user[], params[])
  1742. {
  1743.     new giveid,lolz1[256],lolz2[256],pon[100];
  1744.     if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !armour <PartOfName/PlayerID>");
  1745.     giveid = ReturnUser(pon);
  1746.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1747.     new Float:Armour;
  1748.     GetPlayerHealth(giveid,Armour);
  1749.     format(lolz1,256,"3* Armour from %s (ID:%d):1 %.0f",PlayerName(giveid),giveid,Armour);
  1750.     format(lolz2,256,"* Armour from %s (ID:%d): %.0f",PlayerName(giveid),giveid,Armour);
  1751.     SendClientMessageToAll(green,lolz2);
  1752.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1753. #pragma unused conn, user
  1754.     return true;
  1755. }
  1756.  
  1757.  
  1758. irccmd_unmute(conn, channel[], user[], params[])
  1759. {
  1760.     new giveid,lolz1[256],lolz2[256],pon[100];
  1761.     if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
  1762.     if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !unmute <PartOfName/PlayerID>");
  1763.     giveid = ReturnUser(pon);
  1764.     if(!IsPlayerMuted[giveid]) return IRC_GroupSay(GroupID[0],channel,"4*** Error: The selected ID is not muted.");
  1765.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1766.     format(lolz1,256,"*** Admin %s (IRC) take out the silence to the player %s (ID:%d).",user,PlayerName(giveid),giveid);
  1767.     format(lolz2,256,"4*** Admin %s (IRC) take out the silence to the player %s (ID:%d).",user,PlayerName(giveid),giveid);
  1768.     SendClientMessageToAll(red,lolz1);
  1769.     IRC_GroupSay(GroupID[0],channel,lolz2);
  1770.     IsPlayerMuted[giveid] = false;
  1771. #pragma unused conn
  1772.     return true;
  1773. }
  1774.  
  1775.  
  1776. irccmd_freeze(conn, channel[], user[], params[])
  1777. {
  1778.     new giveid,msg[256],lolz1[256],lolz2[256],pon[100];
  1779.     if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
  1780.     if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !freeze <PartOfName/PlayerID> <Reason [Optional]>");
  1781.     giveid = ReturnUser(pon);
  1782.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1783.     format(lolz1,256,"4*** Admin %s (IRC) freeze the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1784.     format(lolz2,256,"*** Admin %s (IRC) freeze the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1785.     SendClientMessageToAll(red,lolz2);
  1786.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1787.     TogglePlayerControllable(giveid,0);
  1788. #pragma unused conn
  1789.     return true;
  1790. }
  1791.  
  1792.  
  1793. irccmd_disarm(conn, channel[], user[], params[])
  1794. {
  1795.     new giveid;
  1796.     new lolz1[256];
  1797.     new lolz2[256];
  1798.     new msg[256];
  1799.     new pon[100];
  1800.     if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
  1801.     if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !disarm <PartOfName/PlayerID> <Reason [Optional]>");
  1802.     giveid = ReturnUser(pon);
  1803.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1804.     format(lolz1,256,"*** Admin %s (IRC) removes the weapons of the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1805.     format(lolz2,256,"4*** Admin %s (IRC) removes the weapons of the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1806.     SendClientMessageToAll(red, lolz1);
  1807.     IRC_GroupSay(GroupID[0],channel,lolz2);
  1808.     ResetPlayerWeapons(giveid);
  1809. #pragma unused conn
  1810.     return true;
  1811. }
  1812.  
  1813.  
  1814. irccmd_unjail(conn, channel[], user[], params[])
  1815. {
  1816.     new giveid,lolz1[256],lolz2[256],pon[100];
  1817.     if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !unjail <PartOfName/PlayerID>");
  1818.     giveid = ReturnUser(pon);
  1819.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1820.     if(!IsPlayerJailed[giveid]) return IRC_GroupSay(GroupID[0],channel,"4*** Error: The selected ID is not jailed.");
  1821.     SetPlayerInterior(giveid,6);
  1822.     SetPlayerPos(giveid,267.785200,77.564040,1001.039000);
  1823.     format(lolz1,256,"4*** Admin %s (IRC) unjailed the player %s (ID:%d).",user,PlayerName(giveid),giveid);
  1824.     format(lolz2,256,"*** Admin %s (IRC) unjailed the player %s (ID:%d).",user,PlayerName(giveid),giveid);
  1825.     SendClientMessageToAll(red,lolz2);
  1826.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1827.     IsPlayerJailed[giveid] = false;
  1828. #pragma unused conn, user
  1829.     return true;
  1830. }
  1831.  
  1832.  
  1833. irccmd_script(conn,  channel[], user[], params[])
  1834. {
  1835.     new lolz1[256],lolz2[256];
  1836.     format(lolz1,256,"3*** IRC Administrator v1.1 by PlayerX ");
  1837.     format(lolz2,256,"*** IRC Administrator v1.1 by PlayerX");
  1838.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1839.     SendClientMessageToAll(green,lolz2);
  1840. #pragma unused params,user,conn
  1841.     return true;
  1842. }
  1843.  
  1844.  
  1845. irccmd_upheal(conn, channel[], user[], params[])
  1846. {
  1847.     new giveid,lolz1[256],lolz2[256],msg[256],pon[100];
  1848.     if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
  1849.     if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !upheal <PartOfName/PlayerID> <Reason [Optional]>");
  1850.     giveid = ReturnUser(pon);
  1851.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  1852.     SetPlayerHealth(giveid,100);
  1853.     SetPlayerArmour(giveid,100);
  1854.     format(lolz1,256,"4***Admin %s (IRC) It ascended to 100 HP and 100 armor to the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1855.     format(lolz2,256,"*** Admin %s (IRC) It ascended to 100 HP and 100 armor to the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  1856.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1857.     SendClientMessageToAll(red,lolz2);
  1858. #pragma unused conn, user
  1859.     return true;
  1860. }
  1861.  
  1862.  
  1863. irccmd_admins(conn, channel[], user[], params[])
  1864. {
  1865.     new count,lolz1[200];
  1866.     for (new giveid; giveid != GetMaxPlayers(); giveid ++) {
  1867.         if (!IsPlayerConnected(giveid)) continue;
  1868.         if (IsPlayerAdmin(giveid)) {
  1869.             if (count == 0) IRC_GroupSay(GroupID[0],channel,"3*** Rcon Administrators Online:1");
  1870.             GetPlayerName(giveid,lolz1,32);
  1871.             format(lolz1,200,"[%d] %s",giveid,lolz1);
  1872.             IRC_GroupSay(GroupID[0],channel,lolz1);
  1873.             count++;
  1874.         }
  1875.     }
  1876.     if (count == 0) return IRC_GroupSay(GroupID[0],channel,"4*** There are no rcon admins connected.");
  1877. #pragma unused params,user,conn
  1878.     return true;
  1879. }
  1880.  
  1881.  
  1882. irccmd_annall(conn, channel[], user[], params[])
  1883. {
  1884.     new imsg[256], lolz1[256], lolz2[256];
  1885.     if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
  1886.     if(sscanf(params,"s",imsg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !annall <Message>");
  1887.     format(lolz1,256,"3*** Announce from %s to ALL:1 %s",user,imsg);
  1888.     IRC_GroupSay(GroupID[0],channel,lolz1);
  1889.     format(lolz2,256,"~w~%s",imsg);
  1890.     GameTextForAll(lolz2,5000,3);
  1891. #pragma unused conn
  1892.     return true;
  1893. }
  1894.  
  1895.  
  1896. irccmd_addbot(conn, channel[], user[], params[])
  1897. {
  1898.     new name[30];
  1899.     new lolz1[256];
  1900.     if(sscanf(params,"s",name)) {
  1901.         format(lolz1, 256, "3Usage:1 !addbot <BotName> // Connections remaining: %d",4-Total);
  1902.         IRC_GroupSay(GroupID[0], channel, lolz1);
  1903.         return true;
  1904.     }
  1905.     if(strlen(BotName2) == 0) {
  1906.         BotName2 = name;
  1907.         Delay = 1000;
  1908.         IABot2();
  1909.         format(lolz1,256,"3* %s in creating... Bots remaining: 2",name);
  1910.         IRC_GroupSay(GroupID[0], channel, lolz1);
  1911.         Total++;
  1912.         return true;
  1913.     }
  1914.     else if(strlen(BotName3) == 0) {
  1915.         BotName3 = name;
  1916.         Delay = 1000;
  1917.         IABot3();
  1918.         format(lolz1,256,"3* %s in creating... Bots remaining: 1",name);
  1919.         IRC_GroupSay(GroupID[0], channel, lolz1);
  1920.         Total++;
  1921.         return true;
  1922.     }
  1923.     else if(strlen(BotName4) == 0) {
  1924.         BotName4 = name;
  1925.         Delay = 1000;
  1926.         IABot4();
  1927.         format(lolz1,256,"3* %s in creating... You cannot create any more bots.",name);
  1928.         IRC_GroupSay(GroupID[0], channel, lolz1);
  1929.         Total++;
  1930.         return true;
  1931.     }
  1932.     else {
  1933.         IRC_GroupSay(GroupID[0], channel, "4*** Error: You cannot create any more bots.");
  1934.         return true;
  1935.     }
  1936. #pragma unused conn, user
  1937. }
  1938.  
  1939.  
  1940. irccmd_rembot(conn, channel[], user[], params[])
  1941. {
  1942.     new name[30];
  1943. //new lolz1[256];//, lolz2[256];
  1944.     if(sscanf(params,"s",name)) return IRC_GroupSay(GroupID[0], channel, "3Usage:1 !rembot <BotName>");
  1945.     if(strlen(BotName2) != 0 && strcmp(name,BotName2, true) == 0) {
  1946.         BotName2 = "";
  1947.         IRC_RemoveFromGroup(GroupID[0],EchoConnection[1]);
  1948.         IRC_RemoveFromGroup(GroupID[1],EchoConnection[1]);
  1949.         IRC_Quit(EchoConnection[1],QuitMsg);
  1950.         EchoConnection[1] = false;
  1951.         Total--;
  1952.         return true;
  1953.     }
  1954.     else if(strlen(BotName3) != 0 && strcmp(name,BotName3, true) == 0) {
  1955.         BotName3 = "";
  1956.         IRC_RemoveFromGroup(GroupID[0],EchoConnection[2]);
  1957.         IRC_RemoveFromGroup(GroupID[1],EchoConnection[2]);
  1958.         IRC_Quit(EchoConnection[2],QuitMsg);
  1959.         EchoConnection[2] = false;
  1960.         Total--;
  1961.         return true;
  1962.     }
  1963.     else if(strlen(BotName4) != 0 && strcmp(name,BotName4, true) == 0) {
  1964.         BotName4 = "";
  1965.         IRC_RemoveFromGroup(GroupID[0],EchoConnection[3]);
  1966.         IRC_RemoveFromGroup(GroupID[1],EchoConnection[3]);
  1967.         IRC_Quit(EchoConnection[3],QuitMsg);
  1968.         EchoConnection[3] = false;
  1969.         Total--;
  1970.         return true;
  1971.     }
  1972.     else {
  1973.         IRC_GroupSay(GroupID[0], channel, "4*** Error: Max connections.");
  1974.         return true;
  1975.     }
  1976. #pragma unused conn, user
  1977. }
  1978.  
  1979.  
  1980. irccmd_ircraw(conn, channel[], user[], params[])
  1981. {
  1982.     new id;
  1983.     new lolz1[256],iparams[256];
  1984.     if(sscanf(params,"ds",id,iparams)) return IRC_GroupSay(GroupID[0], channel, "3Usage:1 !ircraw <BotID> <Params>");
  1985.     if(id < 1 || id > Total) return IRC_GroupSay(GroupID[0], channel, "4*** Error: invalid botid.");
  1986.     if(strlen(BotName1) != 0 && id == 1) {
  1987.         format(lolz1,256,"3** RAW command for IRC:1 %s", iparams);
  1988.         IRC_Say(EchoConnection[0], channel, lolz1);
  1989.         IRC_SendRaw(EchoConnection[0],iparams);
  1990.     }
  1991.     else if(strlen(BotName2) != 0 && id == 2) {
  1992.         format(lolz1,256,"3** RAW command for IRC:1 %s", iparams);
  1993.         IRC_Say(EchoConnection[1], channel, lolz1);
  1994.         IRC_SendRaw(EchoConnection[1],iparams);
  1995.     }
  1996.     else if(strlen(BotName3) != 0 && id == 3) {
  1997.         format(lolz1,256,"3** RAW command for IRC:1 %s", iparams);
  1998.         IRC_Say(EchoConnection[2], channel, lolz1);
  1999.         IRC_SendRaw(EchoConnection[2],iparams);
  2000.     }
  2001.     else if(strlen(BotName4) != 0 && id == 4) {
  2002.         format(lolz1,256,"3** RAW command for IRC:1 %s", iparams);
  2003.         IRC_Say(EchoConnection[3], channel, lolz1);
  2004.         IRC_SendRaw(EchoConnection[3],iparams);
  2005.     }
  2006.     else {
  2007.         IRC_GroupSay(GroupID[0], channel, "4*** Error: invalid botid.");
  2008.     }
  2009. #pragma unused conn, user
  2010.     return true;
  2011. }
  2012.  
  2013.  
  2014. irccmd_players(conn, channel[], user[], params[])
  2015. {
  2016.     new count1;
  2017.     new count2;
  2018.     new PlayerNames[512];
  2019.     new NPC[512];
  2020.     for(new i=0; i<=MAX_PLAYERS; i++) {
  2021.         if(IsPlayerConnected(i) && IsPlayerNPC(i) == 0) {
  2022.             if(count1 == 0) {
  2023.                 new PlayerName1[MAX_PLAYER_NAME];
  2024.                 GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
  2025.                 format(PlayerNames, sizeof(PlayerNames),"[%d] %s",i,PlayerName1);
  2026.                 count1++;
  2027.             }
  2028.             else {
  2029.                 new PlayerName1[MAX_PLAYER_NAME];
  2030.                 GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
  2031.                 format(PlayerNames, sizeof(PlayerNames),"%s, [%d] %s",PlayerNames,i,PlayerName1);
  2032.                 count1++;
  2033.             }
  2034.         }
  2035.         else { if(count1 == 0) format(PlayerNames, sizeof(PlayerNames),"No Players Online"); }
  2036.         if(IsPlayerNPC(i) && IsPlayerNPC(i) == 1) {
  2037.             if(count2 == 0) {
  2038.                 new NPC1[MAX_PLAYER_NAME];
  2039.                 GetPlayerName(i, NPC1, sizeof(NPC1));
  2040.                 format(NPC, sizeof(NPC),"[%d] %s",i,NPC1);
  2041.                 count2++;
  2042.             }
  2043.             else {
  2044.                 new NPC1[MAX_PLAYER_NAME];
  2045.                 GetPlayerName(i, NPC1, sizeof(NPC1));
  2046.                 format(NPC, sizeof(NPC),"%s, [%d] %s",NPC,i,NPC1);
  2047.                 count2++;
  2048.             }
  2049.         }
  2050.         else { if(count2 == 0) format(NPC, sizeof(NPC),"No NPC Online"); }
  2051.     }
  2052.     new counter1 = 0;
  2053.     new counter2 = 0;
  2054.     new lolz1[512],lolz2[512];
  2055.     new players = GetMaxPlayers();
  2056.     for(new i=0; i<=MAX_PLAYERS; i++) {
  2057.         if(IsPlayerNPC(i)) counter2++;
  2058.         else if(IsPlayerConnected(i)) counter1++;
  2059.     }
  2060.     format(lolz1,256,"3*** Players Online [%d/%d]:1 %s",counter1,players - counter2,PlayerNames);
  2061.     format(lolz2,256,"3*** NPC Online [%d/%d]:1 %s",counter2,players - counter2,NPC);
  2062.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2063.     IRC_GroupSay(GroupID[0],channel,lolz2);
  2064. #pragma unused params,user,conn
  2065.     return true;
  2066. }
  2067.  
  2068.  
  2069. irccmd_fakemsg(conn, channel[], user[], params[])
  2070. {
  2071.     new giveid,msg[256],lolz1[256],pon[100];
  2072.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  2073.     if(sscanf(params,"ss",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !fakemsg <PartOfName/PlayerID> <Message>");
  2074.     giveid = ReturnUser(pon);
  2075.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  2076.     format(lolz1,256,"2** 4[%i]3 %s:1 %s",giveid,PlayerName(giveid),msg);
  2077.     SendPlayerMessageToAll(giveid,msg);
  2078.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2079. #pragma unused user,conn
  2080.     return true;
  2081. }
  2082.  
  2083.  
  2084. irccmd_settime(conn, channel[], user[], params[])
  2085. {
  2086.     new hours,minutes,lolz1[256],lolz2[256];
  2087.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  2088.     if(sscanf(params,"dd",hours,minutes))return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !settime <Hour> <Minutes>");
  2089.     if(hours > 23 || hours < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Hours.");
  2090.     if(minutes > 59 || minutes < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Minutes.");
  2091.     format(lolz1,256,"4*** Admin %s (IRC) change the time to all to: %02d:%02d.",user,hours,minutes);
  2092.     format(lolz2,256,"*** Admin %s (IRC) change the time to all to: %02d:%02d.",user,hours,minutes);
  2093.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2094.     SendClientMessageToAll(red,lolz2);
  2095.     for(new giveid=0; giveid<=MAX_PLAYERS; giveid++) {
  2096.         SetPlayerTime(giveid,hours,minutes);
  2097.     }
  2098. #pragma unused conn
  2099.     return true;
  2100. }
  2101.  
  2102.  
  2103. irccmd_weather(conn, channel[], user[], params[])
  2104. {
  2105.     new weatherid,lolz1[256],lolz2[256];
  2106.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  2107.     if(sscanf(params,"d",weatherid)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !weather <WeatherID>");
  2108.     if(weatherid > 40 || weatherid < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Weather id.");
  2109.     format(lolz1,256,"4***Admin %s (IRC) change the weather to: %d.",user,weatherid);
  2110.     format(lolz2,256,"*** Admin %s (IRC) change the weather to: %d.",user,weatherid);
  2111.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2112.     SendClientMessageToAll(red,lolz2);
  2113.     SetWeather(weatherid);
  2114. #pragma unused conn,user
  2115.     return true;
  2116. }
  2117.  
  2118.  
  2119. irccmd_setname(conn, channel[], user[], params[])
  2120. {
  2121.     new giveid,newnick[256],lolz1[256],lolz2[256],pon[100];
  2122.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  2123.     if(sscanf(params,"ss",pon,newnick)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !setname <PartOfName/PlayerID> <New Name>");
  2124.     giveid = ReturnUser(pon);
  2125.     if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  2126.     format(lolz1,256,"4*** Admin %s (IRC) change the player's name %s (ID:%d) to: %s.",user,PlayerName(giveid),giveid,newnick);
  2127.     format(lolz2,256,"*** Admin %s (IRC) change the player's name %s (ID:%d) to: %s.",user,PlayerName(giveid),giveid,newnick);
  2128.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2129.     SendClientMessageToAll(red,lolz2);
  2130.     SetPlayerName(giveid,newnick);
  2131. #pragma unused conn
  2132.     return true;
  2133. }
  2134.  
  2135.  
  2136. irccmd_setskin(conn, channel[], user[], params[])
  2137. {
  2138.     new newskin,giveid,lolz1[256],lolz2[256],pon[100];
  2139.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  2140.     if(sscanf(params,"sd",pon,newskin))return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !setskin <PartOfName/PlayerID> <New Skin>");
  2141.     giveid = ReturnUser(pon);
  2142.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
  2143.     if(!IsValidSkin(newskin)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid skin ID.");
  2144.     SetPlayerSkin(giveid,newskin);
  2145.     format(lolz1,256,"4*** Admin %s (IRC) change the player's skin %s (ID:%d), Skin id: %d.",user,PlayerName(giveid),giveid,newskin);
  2146.     format(lolz2,256,"*** Admin %s (IRC) change the player's skin %s (ID:%d), Skin id: %d.",user,PlayerName(giveid),giveid,newskin);
  2147.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2148.     SendClientMessageToAll(red,lolz2);
  2149. #pragma unused conn
  2150.     return true;
  2151. }
  2152.  
  2153.  
  2154. irccmd_unfreeze(conn, channel[], user[], params[])
  2155. {
  2156.     new giveid,lolz1[256],lolz2[256],pon[100];
  2157.     if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
  2158.     if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !unfreeze <PartOfName/PlayerID>");
  2159.     giveid = ReturnUser(pon);
  2160.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
  2161.     format(lolz1,256,"4*** Admin %s (IRC) unfreeze the player %s (ID:%d).",user,PlayerName(giveid),giveid);
  2162.     format(lolz2,256,"*** Admin %s (IRC) unfreeze the player %s (ID:%d).",user,PlayerName(giveid),giveid);
  2163.     SendClientMessageToAll(red,lolz2);
  2164.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2165.     TogglePlayerControllable(giveid,1);
  2166. #pragma unused conn
  2167.     return true;
  2168. }
  2169.  
  2170.  
  2171. irccmd_tempjail(conn, channel[], user[], params[])
  2172. {
  2173.     new giveid,lolz1[256],lolz2[256],msg[256],timejail,pon[100];
  2174.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  2175.     if(sscanf(params,"sdz",pon,timejail,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !tempjail <PartOfName/PlayerID> <Time> <Reason [Optional]>");
  2176.     giveid = ReturnUser(pon);
  2177.     if(IsPlayerJailed[giveid]) return IRC_GroupSay(GroupID[0],channel,"4*** Error: already this in the jail");
  2178.     if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
  2179.     if(timejail >1440 || timejail <1) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Time (Max: 1440 minutes - 1 days / Min: 1 minutes)");
  2180.     SetPlayerInterior(giveid,6);
  2181.     SetPlayerPos(giveid,264.785200,77.564040,1001.039000);
  2182.     format(lolz1, 256, "*** Admin %s (IRC) jailed player %s (ID:%d), Time: %d Minutes, Reason: %s.",user,PlayerName(giveid),giveid,timejail,msg[0] ? msg: "None");
  2183.     format(lolz2,256,"4*** Admin %s (IRC) jailed player %s (ID:%d), Time: %d Minutes, Reason: %s.",user,PlayerName(giveid),giveid,timejail,msg[0] ? msg: "None");
  2184.     SetTimerEx("PlayerUnJailed",timejail*60*1000,0,"d",giveid);
  2185.     IsPlayerJailed[giveid] = true;
  2186.     SendClientMessageToAll(red,lolz1);
  2187.     IRC_GroupSay(GroupID[0],channel,lolz2);
  2188. #pragma unused conn
  2189.     return true;
  2190. }
  2191.  
  2192.  
  2193. irccmd_sethealth(conn, channel[], user[], params[])
  2194. {
  2195.     new giveid,health,msg[256],lolz1[256],lolz2[256],pon[100];
  2196.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  2197.     if(sscanf(params,"sdz",pon,health,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !sethealth <PartOfName/PlayerID> <Health> <Reason [Optional]>");
  2198.     giveid = ReturnUser(pon);
  2199.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
  2200.     if(health > 100 || health < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid health (Max: 100).");
  2201.     SetPlayerHealth(giveid,health);
  2202.     format(lolz1,256,"4*** Admin %s (IRC) modify the player's health %s (ID:%d) to %d, Reason: %s.",user,PlayerName(giveid),giveid,health,msg[0] ? msg: "None");
  2203.     format(lolz2,256,"*** Admin %s (IRC) modify the player's health %s (ID:%d) to %d, Reason: %s.",user,PlayerName(giveid),giveid,health,msg[0] ? msg: "None");
  2204.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2205.     SendClientMessageToAll(red,lolz2);
  2206.     return true;
  2207. }
  2208.  
  2209.  
  2210. irccmd_setarmour(conn, channel[], user[], params[])
  2211. {
  2212.     new giveid,armour,msg[256],lolz1[256],lolz2[256],pon[100];
  2213.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  2214.     if(sscanf(params,"sdz",pon,armour,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !setarmour <PartOfName/PlayerID> <Armour> <Reason [Optional]>");
  2215.     giveid = ReturnUser(pon);
  2216.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
  2217.     if(armour > 100 || armour < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Armour (Max: 100).");
  2218.     SetPlayerArmour(giveid,armour);
  2219.     format(lolz1,256,"4*** Admin %s (IRC) modify the player's armour %s (ID:%d) to %d, Reason: %s.",user,PlayerName(giveid),giveid,armour,msg[0] ? msg: "None");
  2220.     format(lolz2,256,"*** Admin %s (IRC) modify the player's armour %s (ID:%d) to %d, Reason: %s.",user,PlayerName(giveid),giveid,armour,msg[0] ? msg: "None");
  2221.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2222.     SendClientMessageToAll(red,lolz2);
  2223.     return true;
  2224. }
  2225.  
  2226.  
  2227. irccmd_givemoney(conn, channel[], user[], params[])
  2228. {
  2229.     new giveid,money,msg[256],lolz1[256],lolz2[256],pon[100];
  2230.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  2231.     if(sscanf(params,"sdz",pon,money,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !givemoney <PartOfName/PlayerID> <Money> <Reason [Optional]>");
  2232.     giveid = ReturnUser(pon);
  2233.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
  2234.     if(money > 5000000 || money < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Money (Max: $5000000).");
  2235.     GivePlayerMoney(giveid,money);
  2236.     format(lolz1,256,"4*** Admin %s (IRC) give money to the player %s (ID:%d) a total of: $%d, Reason: %s.",user,PlayerName(giveid),giveid,money,msg[0] ? msg: "None");
  2237.     format(lolz2,256,"*** Admin %s (IRC) give money to the player %s (ID:%d) a total of: $%d, Reason: %s.",user,PlayerName(giveid),giveid,money,msg[0] ? msg: "None");
  2238.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2239.     SendClientMessageToAll(red,lolz2);
  2240.     return true;
  2241. }
  2242.  
  2243.  
  2244. irccmd_resetmoney(conn, channel[], user[], params[])
  2245. {
  2246.     new giveid,msg[256],lolz1[256],lolz2[256],pon[100];
  2247.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  2248.     if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !resetmoney <PartOfName/PlayerID> <Reason [Optional]>");
  2249.     giveid = ReturnUser(pon);
  2250.     if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
  2251.     ResetPlayerMoney(giveid);
  2252.     format(lolz1,256,"4*** Admin %s (IRC) remove the money to the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  2253.     format(lolz2,256,"*** Admin %s (IRC) remove the money to the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
  2254.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2255.     SendClientMessageToAll(red,lolz2);
  2256. #pragma unused conn, user
  2257.     return true;
  2258. }
  2259.  
  2260.  
  2261. irccmd_giveweapon(conn, channel[], user[], params[])
  2262. {
  2263.     new ammo,giveid,weapon[256],msg[256],lolz1[256],lolz2[256],WeaponName[64],wID,pon[100];
  2264.     if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
  2265.     if(sscanf(params,"ssdz",pon,weapon,ammo,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !giveweapon <PartOfName/PlayerID> <WeaponID> <Ammo> <Reason [Optional]>");
  2266.     giveid = ReturnUser(pon);
  2267.     wID = GetWeaponIDFromName(weapon);
  2268.     if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
  2269.     if(wID > 46 || wID < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Weapon ID.");
  2270.     if(ammo > 10000 || ammo < 1) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Ammo. (Max: 10000)");
  2271.     GivePlayerWeapon(giveid,wID,ammo);
  2272.     GetWeaponName(wID, WeaponName, 64);
  2273.     format(lolz1,256,"4*** Admin %s (IRC) you give to the player %s (ID:%d) the weapon: %s, Ammo: %d, Reason: %s.",user,PlayerName(giveid),giveid,WeaponName,ammo,msg[0] ? msg: "None");
  2274.     format(lolz2,256,"*** Admin %s (IRC) you give to the player %s (ID:%d) the weapon: %s, Ammo: %d, Reason: %s.",user,PlayerName(giveid),giveid,WeaponName,ammo,msg[0] ? msg: "None");
  2275.     IRC_GroupSay(GroupID[0],channel,lolz1);
  2276.     SendClientMessageToAll(red,lolz2);
  2277. #pragma unused user,conn
  2278.     return true;
  2279. }
  2280.  
  2281.  
  2282. //=========================//
  2283. //======== Others =========//
  2284. //=========================//
  2285.  
  2286. stock IsPlayerVoi(conn,channel[],user[])
  2287. {
  2288.     new ircLevel[4];
  2289.     IRC_GetUserChannelMode(conn, channel, user, ircLevel);
  2290.     if(!strcmp(ircLevel, "~", true,1) || !strcmp(ircLevel, "&", true,1) || !strcmp(ircLevel, "@", true,1) || !strcmp(ircLevel, "%", true,1) || !strcmp(ircLevel, "+", true,1)) return true;
  2291.     return false;
  2292. }
  2293.  
  2294.  
  2295. stock IsPlayerHop(conn,channel[],user[])
  2296. {
  2297.     new ircLevel[4];
  2298.     IRC_GetUserChannelMode(conn, channel, user, ircLevel);
  2299.     if(!strcmp(ircLevel, "~", true,1) || !strcmp(ircLevel, "&", true,1) || !strcmp(ircLevel, "@", true,1) || !strcmp(ircLevel, "%", true,1)) return true;
  2300.     return false;
  2301. }
  2302.  
  2303.  
  2304. stock IsPlayerOp(conn,channel[],user[])
  2305. {
  2306.     new ircLevel[4];
  2307.     IRC_GetUserChannelMode(conn, channel, user, ircLevel);
  2308.     if(!strcmp(ircLevel, "~", true,1) || !strcmp(ircLevel, "&", true,1) || !strcmp(ircLevel, "@", true,1)) return true;
  2309.     return false;
  2310. }
  2311.  
  2312.  
  2313. stock IsPlayerSop(conn, channel[], user[])
  2314. {
  2315.     new playerlevel[4];
  2316.     IRC_GetUserChannelMode(conn, channel, user, playerlevel);
  2317.     if(!strcmp(playerlevel, "~", true,1) || !strcmp(playerlevel, "&", true,1)) return true;
  2318.     return false;
  2319. }
  2320.  
  2321.  
  2322. stock IsPlayerOwner(conn, channel[], user[])
  2323. {
  2324.     new playerlevel[4];
  2325.     IRC_GetUserChannelMode(conn, channel, user, playerlevel);
  2326.     if(!strcmp(playerlevel, "~", true,1)) return true;
  2327.     return false;
  2328. }
  2329.  
  2330.  
  2331. enum zoneinfo
  2332. {
  2333.     zone_name[MAX_NAME],
  2334.     Float:zone_minx,
  2335.     Float:zone_miny,
  2336.     Float:zone_minz,
  2337.     Float:zone_maxx,
  2338.     Float:zone_maxy,
  2339.     Float:zone_maxz
  2340. }
  2341.  
  2342.  
  2343. new Float:zones[MAX_ZONES][zoneinfo] =
  2344. {
  2345.  
  2346. // Indoor zones
  2347.     { "Caligula's Palace",            2087.30,  1543.20,   900.00,  2437.30,  1703.20,   1200.90},
  2348.     { "The Four Dragons Casino",      1817.30,   863.20,   900.00,  2027.30,  1083.20,   1200.90},
  2349.  
  2350. // Outdoor Zones list by mabako, from gta client files
  2351.     { "The Big Ear",                -410.00,  1403.30,    -3.00,  -137.90,  1681.20,   200.00},
  2352.     { "Aldea Malvada",               -1372.10,  2498.50,     0.00, -1277.50,  2615.30,   200.00},
  2353.     { "Angel Pine",                  -2324.90, -2584.20,    -6.10, -1964.20, -2212.10,   200.00},
  2354.     { "Arco del Oeste",               -901.10,  2221.80,     0.00,  -592.00,  2571.90,   200.00},
  2355.     { "Avispa Country Club",         -2646.40,  -355.40,     0.00, -2270.00,  -222.50,   200.00},
  2356.     { "Avispa Country Club",         -2831.80,  -430.20,    -6.10, -2646.40,  -222.50,   200.00},
  2357.     { "Avispa Country Club",         -2361.50,  -417.10,     0.00, -2270.00,  -355.40,   200.00},
  2358.     { "Avispa Country Club",         -2667.80,  -302.10,   -28.80, -2646.40,  -262.30,    71.10},
  2359.     { "Avispa Country Club",         -2470.00,  -355.40,     0.00, -2270.00,  -318.40,    46.10},
  2360.     { "Avispa Country Club",         -2550.00,  -355.40,     0.00, -2470.00,  -318.40,    39.70},
  2361.     { "Back o Beyond",               -1166.90, -2641.10,     0.00,  -321.70, -1856.00,   200.00},
  2362.     { "Battery Point",               -2741.00,  1268.40,    -4.50, -2533.00,  1490.40,   200.00},
  2363.     { "Bayside",                     -2741.00,  2175.10,     0.00, -2353.10,  2722.70,   200.00},
  2364.     { "Bayside Marina",              -2353.10,  2275.70,     0.00, -2153.10,  2475.70,   200.00},
  2365.     { "Beacon Hill",                  -399.60, -1075.50,    -1.40,  -319.00,  -977.50,   198.50},
  2366.     { "Blackfield",                    964.30,  1203.20,   -89.00,  1197.30,  1403.20,   110.90},
  2367.     { "Blackfield",                    964.30,  1403.20,   -89.00,  1197.30,  1726.20,   110.90},
  2368.     { "Blackfield Chapel",            1375.60,   596.30,   -89.00,  1558.00,   823.20,   110.90},
  2369.     { "Blackfield Chapel",            1325.60,   596.30,   -89.00,  1375.60,   795.00,   110.90},
  2370.     { "Blackfield Intersection",      1197.30,  1044.60,   -89.00,  1277.00,  1163.30,   110.90},
  2371.     { "Blackfield Intersection",      1166.50,   795.00,   -89.00,  1375.60,  1044.60,   110.90},
  2372.     { "Blackfield Intersection",      1277.00,  1044.60,   -89.00,  1315.30,  1087.60,   110.90},
  2373.     { "Blackfield Intersection",      1375.60,   823.20,   -89.00,  1457.30,   919.40,   110.90},
  2374.     { "Blueberry",                     104.50,  -220.10,     2.30,   349.60,   152.20,   200.00},
  2375.     { "Blueberry",                      19.60,  -404.10,     3.80,   349.60,  -220.10,   200.00},
  2376.     { "Blueberry Acres",              -319.60,  -220.10,     0.00,   104.50,   293.30,   200.00},
  2377.     { "Caligula's Palace",            2087.30,  1543.20,   -89.00,  2437.30,  1703.20,   110.90},
  2378.     { "Caligula's Palace",            2137.40,  1703.20,   -89.00,  2437.30,  1783.20,   110.90},
  2379.     { "Calton Heights",              -2274.10,   744.10,    -6.10, -1982.30,  1358.90,   200.00},
  2380.     { "Chinatown",                   -2274.10,   578.30,    -7.60, -2078.60,   744.10,   200.00},
  2381.     { "City Hall",                   -2867.80,   277.40,    -9.10, -2593.40,   458.40,   200.00},
  2382.     { "Come-A-Lot",                   2087.30,   943.20,   -89.00,  2623.10,  1203.20,   110.90},
  2383.     { "Commerce",                     1323.90, -1842.20,   -89.00,  1701.90, -1722.20,   110.90},
  2384.     { "Commerce",                     1323.90, -1722.20,   -89.00,  1440.90, -1577.50,   110.90},
  2385.     { "Commerce",                     1370.80, -1577.50,   -89.00,  1463.90, -1384.90,   110.90},
  2386.     { "Commerce",                     1463.90, -1577.50,   -89.00,  1667.90, -1430.80,   110.90},
  2387.     { "Commerce",                     1583.50, -1722.20,   -89.00,  1758.90, -1577.50,   110.90},
  2388.     { "Commerce",                     1667.90, -1577.50,   -89.00,  1812.60, -1430.80,   110.90},
  2389.     { "Conference Center",            1046.10, -1804.20,   -89.00,  1323.90, -1722.20,   110.90},
  2390.     { "Conference Center",            1073.20, -1842.20,   -89.00,  1323.90, -1804.20,   110.90},
  2391.     { "Cranberry Station",           -2007.80,    56.30,     0.00, -1922.00,   224.70,   100.00},
  2392.     { "Creek",                        2749.90,  1937.20,   -89.00,  2921.60,  2669.70,   110.90},
  2393.     { "Dillimore",                     580.70,  -674.80,    -9.50,   861.00,  -404.70,   200.00},
  2394.     { "Doherty",                     -2270.00,  -324.10,    -0.00, -1794.90,  -222.50,   200.00},
  2395.     { "Doherty",                     -2173.00,  -222.50,    -0.00, -1794.90,   265.20,   200.00},
  2396.     { "Downtown",                    -1982.30,   744.10,    -6.10, -1871.70,  1274.20,   200.00},
  2397.     { "Downtown",                    -1871.70,  1176.40,    -4.50, -1620.30,  1274.20,   200.00},
  2398.     { "Downtown",                    -1700.00,   744.20,    -6.10, -1580.00,  1176.50,   200.00},
  2399.     { "Downtown",                    -1580.00,   744.20,    -6.10, -1499.80,  1025.90,   200.00},
  2400.     { "Downtown",                    -2078.60,   578.30,    -7.60, -1499.80,   744.20,   200.00},
  2401.     { "Downtown",                    -1993.20,   265.20,    -9.10, -1794.90,   578.30,   200.00},
  2402.     { "Downtown Los Santos",          1463.90, -1430.80,   -89.00,  1724.70, -1290.80,   110.90},
  2403.     { "Downtown Los Santos",          1724.70, -1430.80,   -89.00,  1812.60, -1250.90,   110.90},
  2404.     { "Downtown Los Santos",          1463.90, -1290.80,   -89.00,  1724.70, -1150.80,   110.90},
  2405.     { "Downtown Los Santos",          1370.80, -1384.90,   -89.00,  1463.90, -1170.80,   110.90},
  2406.     { "Downtown Los Santos",          1724.70, -1250.90,   -89.00,  1812.60, -1150.80,   110.90},
  2407.     { "Downtown Los Santos",          1370.80, -1170.80,   -89.00,  1463.90, -1130.80,   110.90},
  2408.     { "Downtown Los Santos",          1378.30, -1130.80,   -89.00,  1463.90, -1026.30,   110.90},
  2409.     { "Downtown Los Santos",          1391.00, -1026.30,   -89.00,  1463.90,  -926.90,   110.90},
  2410.     { "Downtown Los Santos",          1507.50, -1385.20,   110.90,  1582.50, -1325.30,   335.90},
  2411.     { "East Beach",                   2632.80, -1852.80,   -89.00,  2959.30, -1668.10,   110.90},
  2412.     { "East Beach",                   2632.80, -1668.10,   -89.00,  2747.70, -1393.40,   110.90},
  2413.     { "East Beach",                   2747.70, -1668.10,   -89.00,  2959.30, -1498.60,   110.90},
  2414.     { "East Beach",                   2747.70, -1498.60,   -89.00,  2959.30, -1120.00,   110.90},
  2415.     { "East Los Santos",              2421.00, -1628.50,   -89.00,  2632.80, -1454.30,   110.90},
  2416.     { "East Los Santos",              2222.50, -1628.50,   -89.00,  2421.00, -1494.00,   110.90},
  2417.     { "East Los Santos",              2266.20, -1494.00,   -89.00,  2381.60, -1372.00,   110.90},
  2418.     { "East Los Santos",              2381.60, -1494.00,   -89.00,  2421.00, -1454.30,   110.90},
  2419.     { "East Los Santos",              2281.40, -1372.00,   -89.00,  2381.60, -1135.00,   110.90},
  2420.     { "East Los Santos",              2381.60, -1454.30,   -89.00,  2462.10, -1135.00,   110.90},
  2421.     { "East Los Santos",              2462.10, -1454.30,   -89.00,  2581.70, -1135.00,   110.90},
  2422.     { "Easter Basin",                -1794.90,   249.90,    -9.10, -1242.90,   578.30,   200.00},
  2423.     { "Easter Basin",                -1794.90,   -50.00,    -0.00, -1499.80,   249.90,   200.00},
  2424.     { "Easter Bay Airport",          -1499.80,   -50.00,    -0.00, -1242.90,   249.90,   200.00},
  2425.     { "Easter Bay Airport",          -1794.90,  -730.10,    -3.00, -1213.90,   -50.00,   200.00},
  2426.     { "Easter Bay Airport",          -1213.90,  -730.10,     0.00, -1132.80,   -50.00,   200.00},
  2427.     { "Easter Bay Airport",          -1242.90,   -50.00,     0.00, -1213.90,   578.30,   200.00},
  2428.     { "Easter Bay Airport",          -1213.90,   -50.00,    -4.50,  -947.90,   578.30,   200.00},
  2429.     { "Easter Bay Airport",          -1315.40,  -405.30,    15.40, -1264.40,  -209.50,    25.40},
  2430.     { "Easter Bay Airport",          -1354.30,  -287.30,    15.40, -1315.40,  -209.50,    25.40},
  2431.     { "Easter Bay Airport",          -1490.30,  -209.50,    15.40, -1264.40,  -148.30,    25.40},
  2432.     { "Easter Bay Chemicals",        -1132.80,  -768.00,     0.00,  -956.40,  -578.10,   200.00},
  2433.     { "Easter Bay Chemicals",        -1132.80,  -787.30,     0.00,  -956.40,  -768.00,   200.00},
  2434.     { "El Castillo del Diablo",       -464.50,  2217.60,     0.00,  -208.50,  2580.30,   200.00},
  2435.     { "El Castillo del Diablo",       -208.50,  2123.00,    -7.60,   114.00,  2337.10,   200.00},
  2436.     { "El Castillo del Diablo",       -208.50,  2337.10,     0.00,     8.40,  2487.10,   200.00},
  2437.     { "El Corona",                    1812.60, -2179.20,   -89.00,  1970.60, -1852.80,   110.90},
  2438.     { "El Corona",                    1692.60, -2179.20,   -89.00,  1812.60, -1842.20,   110.90},
  2439.     { "El Quebrados",                -1645.20,  2498.50,     0.00, -1372.10,  2777.80,   200.00},
  2440.     { "Esplanade East",              -1620.30,  1176.50,    -4.50, -1580.00,  1274.20,   200.00},
  2441.     { "Esplanade East",              -1580.00,  1025.90,    -6.10, -1499.80,  1274.20,   200.00},
  2442.     { "Esplanade East",              -1499.80,   578.30,   -79.60, -1339.80,  1274.20,    20.30},
  2443.     { "Esplanade North",             -2533.00,  1358.90,    -4.50, -1996.60,  1501.20,   200.00},
  2444.     { "Esplanade North",             -1996.60,  1358.90,    -4.50, -1524.20,  1592.50,   200.00},
  2445.     { "Esplanade North",             -1982.30,  1274.20,    -4.50, -1524.20,  1358.90,   200.00},
  2446.     { "Fallen Tree",                  -792.20,  -698.50,    -5.30,  -452.40,  -380.00,   200.00},
  2447.     { "Fallow Bridge",                 434.30,   366.50,     0.00,   603.00,   555.60,   200.00},
  2448.     { "Fern Ridge",                    508.10,  -139.20,     0.00,  1306.60,   119.50,   200.00},
  2449.     { "Financial",                   -1871.70,   744.10,    -6.10, -1701.30,  1176.40,   300.00},
  2450.     { "Fisher's Lagoon",              1916.90,  -233.30,  -100.00,  2131.70,    13.80,   200.00},
  2451.     { "Flint Intersection",           -187.70, -1596.70,   -89.00,    17.00, -1276.60,   110.90},
  2452.     { "Flint Range",                  -594.10, -1648.50,     0.00,  -187.70, -1276.60,   200.00},
  2453.     { "Fort Carson",                  -376.20,   826.30,    -3.00,   123.70,  1220.40,   200.00},
  2454.     { "Foster Valley",               -2270.00,  -430.20,    -0.00, -2178.60,  -324.10,   200.00},
  2455.     { "Foster Valley",               -2178.60,  -599.80,    -0.00, -1794.90,  -324.10,   200.00},
  2456.     { "Foster Valley",               -2178.60, -1115.50,     0.00, -1794.90,  -599.80,   200.00},
  2457.     { "Foster Valley",               -2178.60, -1250.90,     0.00, -1794.90, -1115.50,   200.00},
  2458.     { "Frederick Bridge",             2759.20,   296.50,     0.00,  2774.20,   594.70,   200.00},
  2459.     { "Gant Bridge",                 -2741.40,  1659.60,    -6.10, -2616.40,  2175.10,   200.00},
  2460.     { "Gant Bridge",                 -2741.00,  1490.40,    -6.10, -2616.40,  1659.60,   200.00},
  2461.     { "Ganton",                       2222.50, -1852.80,   -89.00,  2632.80, -1722.30,   110.90},
  2462.     { "Ganton",                       2222.50, -1722.30,   -89.00,  2632.80, -1628.50,   110.90},
  2463.     { "Garcia",                      -2411.20,  -222.50,    -0.00, -2173.00,   265.20,   200.00},
  2464.     { "Garcia",                      -2395.10,  -222.50,    -5.30, -2354.00,  -204.70,   200.00},
  2465.     { "Garver Bridge",               -1339.80,   828.10,   -89.00, -1213.90,  1057.00,   110.90},
  2466.     { "Garver Bridge",               -1213.90,   950.00,   -89.00, -1087.90,  1178.90,   110.90},
  2467.     { "Garver Bridge",               -1499.80,   696.40,  -179.60, -1339.80,   925.30,    20.30},
  2468.     { "Glen Park",                    1812.60, -1449.60,   -89.00,  1996.90, -1350.70,   110.90},
  2469.     { "Glen Park",                    1812.60, -1100.80,   -89.00,  1994.30,  -973.30,   110.90},
  2470.     { "Glen Park",                    1812.60, -1350.70,   -89.00,  2056.80, -1100.80,   110.90},
  2471.     { "Green Palms",                   176.50,  1305.40,    -3.00,   338.60,  1520.70,   200.00},
  2472.     { "Greenglass College",            964.30,  1044.60,   -89.00,  1197.30,  1203.20,   110.90},
  2473.     { "Greenglass College",            964.30,   930.80,   -89.00,  1166.50,  1044.60,   110.90},
  2474.     { "Hampton Barns",                 603.00,   264.30,     0.00,   761.90,   366.50,   200.00},
  2475.     { "Hankypanky Point",             2576.90,    62.10,     0.00,  2759.20,   385.50,   200.00},
  2476.     { "Harry Gold Parkway",           1777.30,   863.20,   -89.00,  1817.30,  2342.80,   110.90},
  2477.     { "Hashbury",                    -2593.40,  -222.50,    -0.00, -2411.20,    54.70,   200.00},
  2478.     { "Hilltop Farm",                  967.30,  -450.30,    -3.00,  1176.70,  -217.90,   200.00},
  2479.     { "Hunter Quarry",                 337.20,   710.80,  -115.20,   860.50,  1031.70,   203.70},
  2480.     { "Idlewood",                     1812.60, -1852.80,   -89.00,  1971.60, -1742.30,   110.90},
  2481.     { "Idlewood",                     1812.60, -1742.30,   -89.00,  1951.60, -1602.30,   110.90},
  2482.     { "Idlewood",                     1951.60, -1742.30,   -89.00,  2124.60, -1602.30,   110.90},
  2483.     { "Idlewood",                     1812.60, -1602.30,   -89.00,  2124.60, -1449.60,   110.90},
  2484.     { "Idlewood",                     2124.60, -1742.30,   -89.00,  2222.50, -1494.00,   110.90},
  2485.     { "Idlewood",                     1971.60, -1852.80,   -89.00,  2222.50, -1742.30,   110.90},
  2486.     { "Jefferson",                    1996.90, -1449.60,   -89.00,  2056.80, -1350.70,   110.90},
  2487.     { "Jefferson",                    2124.60, -1494.00,   -89.00,  2266.20, -1449.60,   110.90},
  2488.     { "Jefferson",                    2056.80, -1372.00,   -89.00,  2281.40, -1210.70,   110.90},
  2489.     { "Jefferson",                    2056.80, -1210.70,   -89.00,  2185.30, -1126.30,   110.90},
  2490.     { "Jefferson",                    2185.30, -1210.70,   -89.00,  2281.40, -1154.50,   110.90},
  2491.     { "Jefferson",                    2056.80, -1449.60,   -89.00,  2266.20, -1372.00,   110.90},
  2492.     { "Julius Thruway East",          2623.10,   943.20,   -89.00,  2749.90,  1055.90,   110.90},
  2493.     { "Julius Thruway East",          2685.10,  1055.90,   -89.00,  2749.90,  2626.50,   110.90},
  2494.     { "Julius Thruway East",          2536.40,  2442.50,   -89.00,  2685.10,  2542.50,   110.90},
  2495.     { "Julius Thruway East",          2625.10,  2202.70,   -89.00,  2685.10,  2442.50,   110.90},
  2496.     { "Julius Thruway North",         2498.20,  2542.50,   -89.00,  2685.10,  2626.50,   110.90},
  2497.     { "Julius Thruway North",         2237.40,  2542.50,   -89.00,  2498.20,  2663.10,   110.90},
  2498.     { "Julius Thruway North",         2121.40,  2508.20,   -89.00,  2237.40,  2663.10,   110.90},
  2499.     { "Julius Thruway North",         1938.80,  2508.20,   -89.00,  2121.40,  2624.20,   110.90},
  2500.     { "Julius Thruway North",         1534.50,  2433.20,   -89.00,  1848.40,  2583.20,   110.90},
  2501.     { "Julius Thruway North",         1848.40,  2478.40,   -89.00,  1938.80,  2553.40,   110.90},
  2502.     { "Julius Thruway North",         1704.50,  2342.80,   -89.00,  1848.40,  2433.20,   110.90},
  2503.     { "Julius Thruway North",         1377.30,  2433.20,   -89.00,  1534.50,  2507.20,   110.90},
  2504.     { "Julius Thruway South",         1457.30,   823.20,   -89.00,  2377.30,   863.20,   110.90},
  2505.     { "Julius Thruway South",         2377.30,   788.80,   -89.00,  2537.30,   897.90,   110.90},
  2506.     { "Julius Thruway West",          1197.30,  1163.30,   -89.00,  1236.60,  2243.20,   110.90},
  2507.     { "Julius Thruway West",          1236.60,  2142.80,   -89.00,  1297.40,  2243.20,   110.90},
  2508.     { "Juniper Hill",                -2533.00,   578.30,    -7.60, -2274.10,   968.30,   200.00},
  2509.     { "Juniper Hollow",              -2533.00,   968.30,    -6.10, -2274.10,  1358.90,   200.00},
  2510.     { "K.A.C.C. Military Fuels",      2498.20,  2626.50,   -89.00,  2749.90,  2861.50,   110.90},
  2511.     { "Kincaid Bridge",              -1339.80,   599.20,   -89.00, -1213.90,   828.10,   110.90},
  2512.     { "Kincaid Bridge",              -1213.90,   721.10,   -89.00, -1087.90,   950.00,   110.90},
  2513.     { "Kincaid Bridge",              -1087.90,   855.30,   -89.00,  -961.90,   986.20,   110.90},
  2514.     { "King's",                      -2329.30,   458.40,    -7.60, -1993.20,   578.30,   200.00},
  2515.     { "King's",                      -2411.20,   265.20,    -9.10, -1993.20,   373.50,   200.00},
  2516.     { "King's",                      -2253.50,   373.50,    -9.10, -1993.20,   458.40,   200.00},
  2517.     { "LVA Freight Depot",            1457.30,   863.20,   -89.00,  1777.40,  1143.20,   110.90},
  2518.     { "LVA Freight Depot",            1375.60,   919.40,   -89.00,  1457.30,  1203.20,   110.90},
  2519.     { "LVA Freight Depot",            1277.00,  1087.60,   -89.00,  1375.60,  1203.20,   110.90},
  2520.     { "LVA Freight Depot",            1315.30,  1044.60,   -89.00,  1375.60,  1087.60,   110.90},
  2521.     { "LVA Freight Depot",            1236.60,  1163.40,   -89.00,  1277.00,  1203.20,   110.90},
  2522.     { "Las Barrancas",                -926.10,  1398.70,    -3.00,  -719.20,  1634.60,   200.00},
  2523.     { "Las Brujas",                   -365.10,  2123.00,    -3.00,  -208.50,  2217.60,   200.00},
  2524.     { "Las Colinas",                  1994.30, -1100.80,   -89.00,  2056.80,  -920.80,   110.90},
  2525.     { "Las Colinas",                  2056.80, -1126.30,   -89.00,  2126.80,  -920.80,   110.90},
  2526.     { "Las Colinas",                  2185.30, -1154.50,   -89.00,  2281.40,  -934.40,   110.90},
  2527.     { "Las Colinas",                  2126.80, -1126.30,   -89.00,  2185.30,  -934.40,   110.90},
  2528.     { "Las Colinas",                  2747.70, -1120.00,   -89.00,  2959.30,  -945.00,   110.90},
  2529.     { "Las Colinas",                  2632.70, -1135.00,   -89.00,  2747.70,  -945.00,   110.90},
  2530.     { "Las Colinas",                  2281.40, -1135.00,   -89.00,  2632.70,  -945.00,   110.90},
  2531.     { "Las Payasadas",                -354.30,  2580.30,     2.00,  -133.60,  2816.80,   200.00},
  2532.     { "Las Venturas Airport",         1236.60,  1203.20,   -89.00,  1457.30,  1883.10,   110.90},
  2533.     { "Las Venturas Airport",         1457.30,  1203.20,   -89.00,  1777.30,  1883.10,   110.90},
  2534.     { "Las Venturas Airport",         1457.30,  1143.20,   -89.00,  1777.40,  1203.20,   110.90},
  2535.     { "Las Venturas Airport",         1515.80,  1586.40,   -12.50,  1729.90,  1714.50,    87.50},
  2536.     { "Last Dime Motel",              1823.00,   596.30,   -89.00,  1997.20,   823.20,   110.90},
  2537.     { "Leafy Hollow",                -1166.90, -1856.00,     0.00,  -815.60, -1602.00,   200.00},
  2538.     { "Lil' Probe Inn",                -90.20,  1286.80,    -3.00,   153.80,  1554.10,   200.00},
  2539.     { "Linden Side",                  2749.90,   943.20,   -89.00,  2923.30,  1198.90,   110.90},
  2540.     { "Linden Station",               2749.90,  1198.90,   -89.00,  2923.30,  1548.90,   110.90},
  2541.     { "Linden Station",               2811.20,  1229.50,   -39.50,  2861.20,  1407.50,    60.40},
  2542.     { "Little Mexico",                1701.90, -1842.20,   -89.00,  1812.60, -1722.20,   110.90},
  2543.     { "Little Mexico",                1758.90, -1722.20,   -89.00,  1812.60, -1577.50,   110.90},
  2544.     { "Los Flores",                   2581.70, -1454.30,   -89.00,  2632.80, -1393.40,   110.90},
  2545.     { "Los Flores",                   2581.70, -1393.40,   -89.00,  2747.70, -1135.00,   110.90},
  2546.     { "Los Santos International",     1249.60, -2394.30,   -89.00,  1852.00, -2179.20,   110.90},
  2547.     { "Los Santos International",     1852.00, -2394.30,   -89.00,  2089.00, -2179.20,   110.90},
  2548.     { "Los Santos International",     1382.70, -2730.80,   -89.00,  2201.80, -2394.30,   110.90},
  2549.     { "Los Santos International",     1974.60, -2394.30,   -39.00,  2089.00, -2256.50,    60.90},
  2550.     { "Los Santos International",     1400.90, -2669.20,   -39.00,  2189.80, -2597.20,    60.90},
  2551.     { "Los Santos International",     2051.60, -2597.20,   -39.00,  2152.40, -2394.30,    60.90},
  2552.     { "Marina",                        647.70, -1804.20,   -89.00,   851.40, -1577.50,   110.90},
  2553.     { "Marina",                        647.70, -1577.50,   -89.00,   807.90, -1416.20,   110.90},
  2554.     { "Marina",                        807.90, -1577.50,   -89.00,   926.90, -1416.20,   110.90},
  2555.     { "Market",                        787.40, -1416.20,   -89.00,  1072.60, -1310.20,   110.90},
  2556.     { "Market",                        952.60, -1310.20,   -89.00,  1072.60, -1130.80,   110.90},
  2557.     { "Market",                       1072.60, -1416.20,   -89.00,  1370.80, -1130.80,   110.90},
  2558.     { "Market",                        926.90, -1577.50,   -89.00,  1370.80, -1416.20,   110.90},
  2559.     { "Market Station",                787.40, -1410.90,   -34.10,   866.00, -1310.20,    65.80},
  2560.     { "Martin Bridge",                -222.10,   293.30,     0.00,  -122.10,   476.40,   200.00},
  2561.     { "Missionary Hill",             -2994.40,  -811.20,     0.00, -2178.60,  -430.20,   200.00},
  2562.     { "Montgomery",                   1119.50,   119.50,    -3.00,  1451.40,   493.30,   200.00},
  2563.     { "Montgomery",                   1451.40,   347.40,    -6.10,  1582.40,   420.80,   200.00},
  2564.     { "Montgomery Intersection",      1546.60,   208.10,     0.00,  1745.80,   347.40,   200.00},
  2565.     { "Montgomery Intersection",      1582.40,   347.40,     0.00,  1664.60,   401.70,   200.00},
  2566.     { "Mulholland",                   1414.00,  -768.00,   -89.00,  1667.60,  -452.40,   110.90},
  2567.     { "Mulholland",                   1281.10,  -452.40,   -89.00,  1641.10,  -290.90,   110.90},
  2568.     { "Mulholland",                   1269.10,  -768.00,   -89.00,  1414.00,  -452.40,   110.90},
  2569.     { "Mulholland",                   1357.00,  -926.90,   -89.00,  1463.90,  -768.00,   110.90},
  2570.     { "Mulholland",                   1318.10,  -910.10,   -89.00,  1357.00,  -768.00,   110.90},
  2571.     { "Mulholland",                   1169.10,  -910.10,   -89.00,  1318.10,  -768.00,   110.90},
  2572.     { "Mulholland",                    768.60,  -954.60,   -89.00,   952.60,  -860.60,   110.90},
  2573.     { "Mulholland",                    687.80,  -860.60,   -89.00,   911.80,  -768.00,   110.90},
  2574.     { "Mulholland",                    737.50,  -768.00,   -89.00,  1142.20,  -674.80,   110.90},
  2575.     { "Mulholland",                   1096.40,  -910.10,   -89.00,  1169.10,  -768.00,   110.90},
  2576.     { "Mulholland",                    952.60,  -937.10,   -89.00,  1096.40,  -860.60,   110.90},
  2577.     { "Mulholland",                    911.80,  -860.60,   -89.00,  1096.40,  -768.00,   110.90},
  2578.     { "Mulholland",                    861.00,  -674.80,   -89.00,  1156.50,  -600.80,   110.90},
  2579.     { "Mulholland Intersection",      1463.90, -1150.80,   -89.00,  1812.60,  -768.00,   110.90},
  2580.     { "North Rock",                   2285.30,  -768.00,     0.00,  2770.50,  -269.70,   200.00},
  2581.     { "Ocean Docks",                  2373.70, -2697.00,   -89.00,  2809.20, -2330.40,   110.90},
  2582.     { "Ocean Docks",                  2201.80, -2418.30,   -89.00,  2324.00, -2095.00,   110.90},
  2583.     { "Ocean Docks",                  2324.00, -2302.30,   -89.00,  2703.50, -2145.10,   110.90},
  2584.     { "Ocean Docks",                  2089.00, -2394.30,   -89.00,  2201.80, -2235.80,   110.90},
  2585.     { "Ocean Docks",                  2201.80, -2730.80,   -89.00,  2324.00, -2418.30,   110.90},
  2586.     { "Ocean Docks",                  2703.50, -2302.30,   -89.00,  2959.30, -2126.90,   110.90},
  2587.     { "Ocean Docks",                  2324.00, -2145.10,   -89.00,  2703.50, -2059.20,   110.90},
  2588.     { "Ocean Flats",                 -2994.40,   277.40,    -9.10, -2867.80,   458.40,   200.00},
  2589.     { "Ocean Flats",                 -2994.40,  -222.50,    -0.00, -2593.40,   277.40,   200.00},
  2590.     { "Ocean Flats",                 -2994.40,  -430.20,    -0.00, -2831.80,  -222.50,   200.00},
  2591.     { "Octane Springs",                338.60,  1228.50,     0.00,   664.30,  1655.00,   200.00},
  2592.     { "Old Venturas Strip",           2162.30,  2012.10,   -89.00,  2685.10,  2202.70,   110.90},
  2593.     { "Palisades",                   -2994.40,   458.40,    -6.10, -2741.00,  1339.60,   200.00},
  2594.     { "Palomino Creek",               2160.20,  -149.00,     0.00,  2576.90,   228.30,   200.00},
  2595.     { "Paradiso",                    -2741.00,   793.40,    -6.10, -2533.00,  1268.40,   200.00},
  2596.     { "Pershing Square",              1440.90, -1722.20,   -89.00,  1583.50, -1577.50,   110.90},
  2597.     { "Pilgrim",                      2437.30,  1383.20,   -89.00,  2624.40,  1783.20,   110.90},
  2598.     { "Pilgrim",                      2624.40,  1383.20,   -89.00,  2685.10,  1783.20,   110.90},
  2599.     { "Pilson Intersection",          1098.30,  2243.20,   -89.00,  1377.30,  2507.20,   110.90},
  2600.     { "Pirates in Men's Pants",       1817.30,  1469.20,   -89.00,  2027.40,  1703.20,   110.90},
  2601.     { "Playa del Seville",            2703.50, -2126.90,   -89.00,  2959.30, -1852.80,   110.90},
  2602.     { "Prickle Pine",                 1534.50,  2583.20,   -89.00,  1848.40,  2863.20,   110.90},
  2603.     { "Prickle Pine",                 1117.40,  2507.20,   -89.00,  1534.50,  2723.20,   110.90},
  2604.     { "Prickle Pine",                 1848.40,  2553.40,   -89.00,  1938.80,  2863.20,   110.90},
  2605.     { "Prickle Pine",                 1938.80,  2624.20,   -89.00,  2121.40,  2861.50,   110.90},
  2606.     { "Queens",                      -2533.00,   458.40,     0.00, -2329.30,   578.30,   200.00},
  2607.     { "Queens",                      -2593.40,    54.70,     0.00, -2411.20,   458.40,   200.00},
  2608.     { "Queens",                      -2411.20,   373.50,     0.00, -2253.50,   458.40,   200.00},
  2609.     { "Randolph Industrial Estate",   1558.00,   596.30,   -89.00,  1823.00,   823.20,   110.90},
  2610.     { "Redsands East",                1817.30,  2011.80,   -89.00,  2106.70,  2202.70,   110.90},
  2611.     { "Redsands East",                1817.30,  2202.70,   -89.00,  2011.90,  2342.80,   110.90},
  2612.     { "Redsands East",                1848.40,  2342.80,   -89.00,  2011.90,  2478.40,   110.90},
  2613.     { "Redsands West",                1236.60,  1883.10,   -89.00,  1777.30,  2142.80,   110.90},
  2614.     { "Redsands West",                1297.40,  2142.80,   -89.00,  1777.30,  2243.20,   110.90},
  2615.     { "Redsands West",                1377.30,  2243.20,   -89.00,  1704.50,  2433.20,   110.90},
  2616.     { "Redsands West",                1704.50,  2243.20,   -89.00,  1777.30,  2342.80,   110.90},
  2617.     { "Regular Tom",                  -405.70,  1712.80,    -3.00,  -276.70,  1892.70,   200.00},
  2618.     { "Richman",                       647.50, -1118.20,   -89.00,   787.40,  -954.60,   110.90},
  2619.     { "Richman",                       647.50,  -954.60,   -89.00,   768.60,  -860.60,   110.90},
  2620.     { "Richman",                       225.10, -1369.60,   -89.00,   334.50, -1292.00,   110.90},
  2621.     { "Richman",                       225.10, -1292.00,   -89.00,   466.20, -1235.00,   110.90},
  2622.     { "Richman",                        72.60, -1404.90,   -89.00,   225.10, -1235.00,   110.90},
  2623.     { "Richman",                        72.60, -1235.00,   -89.00,   321.30, -1008.10,   110.90},
  2624.     { "Richman",                       321.30, -1235.00,   -89.00,   647.50, -1044.00,   110.90},
  2625.     { "Richman",                       321.30, -1044.00,   -89.00,   647.50,  -860.60,   110.90},
  2626.     { "Richman",                       321.30,  -860.60,   -89.00,   687.80,  -768.00,   110.90},
  2627.     { "Richman",                       321.30,  -768.00,   -89.00,   700.70,  -674.80,   110.90},
  2628.     { "Robada Intersection",         -1119.00,  1178.90,   -89.00,  -862.00,  1351.40,   110.90},
  2629.     { "Roca Escalante",               2237.40,  2202.70,   -89.00,  2536.40,  2542.50,   110.90},
  2630.     { "Roca Escalante",               2536.40,  2202.70,   -89.00,  2625.10,  2442.50,   110.90},
  2631.     { "Rockshore East",               2537.30,   676.50,   -89.00,  2902.30,   943.20,   110.90},
  2632.     { "Rockshore West",               1997.20,   596.30,   -89.00,  2377.30,   823.20,   110.90},
  2633.     { "Rockshore West",               2377.30,   596.30,   -89.00,  2537.30,   788.80,   110.90},
  2634.     { "Rodeo",                          72.60, -1684.60,   -89.00,   225.10, -1544.10,   110.90},
  2635.     { "Rodeo",                          72.60, -1544.10,   -89.00,   225.10, -1404.90,   110.90},
  2636.     { "Rodeo",                         225.10, -1684.60,   -89.00,   312.80, -1501.90,   110.90},
  2637.     { "Rodeo",                         225.10, -1501.90,   -89.00,   334.50, -1369.60,   110.90},
  2638.     { "Rodeo",                         334.50, -1501.90,   -89.00,   422.60, -1406.00,   110.90},
  2639.     { "Rodeo",                         312.80, -1684.60,   -89.00,   422.60, -1501.90,   110.90},
  2640.     { "Rodeo",                         422.60, -1684.60,   -89.00,   558.00, -1570.20,   110.90},
  2641.     { "Rodeo",                         558.00, -1684.60,   -89.00,   647.50, -1384.90,   110.90},
  2642.     { "Rodeo",                         466.20, -1570.20,   -89.00,   558.00, -1385.00,   110.90},
  2643.     { "Rodeo",                         422.60, -1570.20,   -89.00,   466.20, -1406.00,   110.90},
  2644.     { "Rodeo",                         466.20, -1385.00,   -89.00,   647.50, -1235.00,   110.90},
  2645.     { "Rodeo",                         334.50, -1406.00,   -89.00,   466.20, -1292.00,   110.90},
  2646.     { "Royal Casino",                 2087.30,  1383.20,   -89.00,  2437.30,  1543.20,   110.90},
  2647.     { "San Andreas Sound",            2450.30,   385.50,  -100.00,  2759.20,   562.30,   200.00},
  2648.     { "Santa Flora",                 -2741.00,   458.40,    -7.60, -2533.00,   793.40,   200.00},
  2649.     { "Santa Maria Beach",             342.60, -2173.20,   -89.00,   647.70, -1684.60,   110.90},
  2650.     { "Santa Maria Beach",              72.60, -2173.20,   -89.00,   342.60, -1684.60,   110.90},
  2651.     { "Shady Cabin",                 -1632.80, -2263.40,    -3.00, -1601.30, -2231.70,   200.00},
  2652.     { "Shady Creeks",                -1820.60, -2643.60,    -8.00, -1226.70, -1771.60,   200.00},
  2653.     { "Shady Creeks",                -2030.10, -2174.80,    -6.10, -1820.60, -1771.60,   200.00},
  2654.     { "Sobell Rail Yards",            2749.90,  1548.90,   -89.00,  2923.30,  1937.20,   110.90},
  2655.     { "Spinybed",                     2121.40,  2663.10,   -89.00,  2498.20,  2861.50,   110.90},
  2656.     { "Starfish Casino",              2437.30,  1783.20,   -89.00,  2685.10,  2012.10,   110.90},
  2657.     { "Starfish Casino",              2437.30,  1858.10,   -39.00,  2495.00,  1970.80,    60.90},
  2658.     { "Starfish Casino",              2162.30,  1883.20,   -89.00,  2437.30,  2012.10,   110.90},
  2659.     { "Temple",                       1252.30, -1130.80,   -89.00,  1378.30, -1026.30,   110.90},
  2660.     { "Temple",                       1252.30, -1026.30,   -89.00,  1391.00,  -926.90,   110.90},
  2661.     { "Temple",                       1252.30,  -926.90,   -89.00,  1357.00,  -910.10,   110.90},
  2662.     { "Temple",                        952.60, -1130.80,   -89.00,  1096.40,  -937.10,   110.90},
  2663.     { "Temple",                       1096.40, -1130.80,   -89.00,  1252.30, -1026.30,   110.90},
  2664.     { "Temple",                       1096.40, -1026.30,   -89.00,  1252.30,  -910.10,   110.90},
  2665.     { "The Camel's Toe",              2087.30,  1203.20,   -89.00,  2640.40,  1383.20,   110.90},
  2666.     { "The Clown's Pocket",           2162.30,  1783.20,   -89.00,  2437.30,  1883.20,   110.90},
  2667.     { "The Emerald Isle",             2011.90,  2202.70,   -89.00,  2237.40,  2508.20,   110.90},
  2668.     { "The Farm",                    -1209.60, -1317.10,   114.90,  -908.10,  -787.30,   251.90},
  2669.     { "The Four Dragons Casino",      1817.30,   863.20,   -89.00,  2027.30,  1083.20,   110.90},
  2670.     { "The High Roller",              1817.30,  1283.20,   -89.00,  2027.30,  1469.20,   110.90},
  2671.     { "The Mako Span",                1664.60,   401.70,     0.00,  1785.10,   567.20,   200.00},
  2672.     { "The Panopticon",               -947.90,  -304.30,    -1.10,  -319.60,   327.00,   200.00},
  2673.     { "The Pink Swan",                1817.30,  1083.20,   -89.00,  2027.30,  1283.20,   110.90},
  2674.     { "The Sherman Dam",              -968.70,  1929.40,    -3.00,  -481.10,  2155.20,   200.00},
  2675.     { "The Strip",                    2027.40,   863.20,   -89.00,  2087.30,  1703.20,   110.90},
  2676.     { "The Strip",                    2106.70,  1863.20,   -89.00,  2162.30,  2202.70,   110.90},
  2677.     { "The Strip",                    2027.40,  1783.20,   -89.00,  2162.30,  1863.20,   110.90},
  2678.     { "The Strip",                    2027.40,  1703.20,   -89.00,  2137.40,  1783.20,   110.90},
  2679.     { "The Visage",                   1817.30,  1863.20,   -89.00,  2106.70,  2011.80,   110.90},
  2680.     { "The Visage",                   1817.30,  1703.20,   -89.00,  2027.40,  1863.20,   110.90},
  2681.     { "Unity Station",                1692.60, -1971.80,   -20.40,  1812.60, -1932.80,    79.50},
  2682.     { "Valle Ocultado",               -936.60,  2611.40,     2.00,  -715.90,  2847.90,   200.00},
  2683.     { "Verdant Bluffs",                930.20, -2488.40,   -89.00,  1249.60, -2006.70,   110.90},
  2684.     { "Verdant Bluffs",               1073.20, -2006.70,   -89.00,  1249.60, -1842.20,   110.90},
  2685.     { "Verdant Bluffs",               1249.60, -2179.20,   -89.00,  1692.60, -1842.20,   110.90},
  2686.     { "Verdant Meadows",                37.00,  2337.10,    -3.00,   435.90,  2677.90,   200.00},
  2687.     { "Verona Beach",                  647.70, -2173.20,   -89.00,   930.20, -1804.20,   110.90},
  2688.     { "Verona Beach",                  930.20, -2006.70,   -89.00,  1073.20, -1804.20,   110.90},
  2689.     { "Verona Beach",                  851.40, -1804.20,   -89.00,  1046.10, -1577.50,   110.90},
  2690.     { "Verona Beach",                 1161.50, -1722.20,   -89.00,  1323.90, -1577.50,   110.90},
  2691.     { "Verona Beach",                 1046.10, -1722.20,   -89.00,  1161.50, -1577.50,   110.90},
  2692.     { "Vinewood",                      787.40, -1310.20,   -89.00,   952.60, -1130.80,   110.90},
  2693.     { "Vinewood",                      787.40, -1130.80,   -89.00,   952.60,  -954.60,   110.90},
  2694.     { "Vinewood",                      647.50, -1227.20,   -89.00,   787.40, -1118.20,   110.90},
  2695.     { "Vinewood",                      647.70, -1416.20,   -89.00,   787.40, -1227.20,   110.90},
  2696.     { "Whitewood Estates",             883.30,  1726.20,   -89.00,  1098.30,  2507.20,   110.90},
  2697.     { "Whitewood Estates",            1098.30,  1726.20,   -89.00,  1197.30,  2243.20,   110.90},
  2698.     { "Willowfield",                  1970.60, -2179.20,   -89.00,  2089.00, -1852.80,   110.90},
  2699.     { "Willowfield",                  2089.00, -2235.80,   -89.00,  2201.80, -1989.90,   110.90},
  2700.     { "Willowfield",                  2089.00, -1989.90,   -89.00,  2324.00, -1852.80,   110.90},
  2701.     { "Willowfield",                  2201.80, -2095.00,   -89.00,  2324.00, -1989.90,   110.90},
  2702.     { "Willowfield",                  2541.70, -1941.40,   -89.00,  2703.50, -1852.80,   110.90},
  2703.     { "Willowfield",                  2324.00, -2059.20,   -89.00,  2541.70, -1852.80,   110.90},
  2704.     { "Willowfield",                  2541.70, -2059.20,   -89.00,  2703.50, -1941.40,   110.90},
  2705.     { "Yellow Bell Station",          1377.40,  2600.40,   -21.90,  1492.40,  2687.30,    78.00},
  2706. // Main Zones
  2707.     { "Los Santos",                     44.60, -2892.90,  -242.90,  2997.00,  -768.00,   900.00},
  2708.     { "Las Venturas",                  869.40,   596.30,  -242.90,  2997.00,  2993.80,   900.00},
  2709.     { "Bone County",                  -480.50,   596.30,  -242.90,   869.40,  2993.80,   900.00},
  2710.     { "Tierra Robada",               -2997.40,  1659.60,  -242.90,  -480.50,  2993.80,   900.00},
  2711.     { "Tierra Robada",               -1213.90,   596.30,  -242.90,  -480.50,  1659.60,   900.00},
  2712.     { "San Fierro",                  -2997.40, -1115.50,  -242.90, -1213.90,  1659.60,   900.00},
  2713.     { "Red County",                  -1213.90,  -768.00,  -242.90,  2997.00,   596.30,   900.00},
  2714.     { "Flint County",                -1213.90, -2892.90,  -242.90,    44.60,  -768.00,   900.00},
  2715.     { "Whetstone",                   -2997.40, -2892.90,  -242.90, -1213.90, -1115.50,   900.00}
  2716. };
  2717.  
  2718. native GetXYZZoneID(Float:x, Float:y, Float:z);
  2719.  
  2720. stock GetXYZZoneName(Float:x, Float:y, Float:z)
  2721. {
  2722.     new name[MAX_NAME] = "Unknown";
  2723.     if ((x == 0.0) && (y = 0.0)) return name;
  2724.     for (new zoneid = 0; zoneid < MAX_ZONES; zoneid++) {
  2725.         if (IsXYZInZone(x, y, z, zoneid)) {
  2726.             copyEx(name,zones[zoneid][zone_name],strlen(zones[zoneid][zone_name]));
  2727.             return name;
  2728.         }
  2729.     }
  2730.     return name;
  2731. }
  2732.  
  2733.  
  2734. stock copyEx(dest[],source[],count)
  2735. {
  2736.     dest[0]=0;
  2737.     if (count<0) return false;
  2738.     if (count>strlen(source)) count=strlen(source);
  2739.     new i=0;
  2740.     for (i=0;i<count;i++) {
  2741.         dest[i]=source[i];
  2742.         if (source[i]==0) return true;
  2743.     }
  2744.     dest[count]=0;
  2745.     return true;
  2746. }
  2747.  
  2748.  
  2749. stock IsXYZInZone(Float:x, Float:y, Float:z, zoneid)
  2750. {
  2751.     if(zoneid == -1) return 0;
  2752.     if(x >= zones[zoneid][zone_minx] && x < zones[zoneid][zone_maxx]
  2753.         && y >= zones[zoneid][zone_miny] && y < zones[zoneid][zone_maxy]
  2754.     && z >= zones[zoneid][zone_minz] && z < zones[zoneid][zone_maxz]) {
  2755.         return 1;
  2756.     }
  2757.     return 0;
  2758. }
  2759.  
  2760.  
  2761. stock IsPlayerInZone(playerid, zoneid)
  2762. {
  2763.     if(zoneid == -1) return 0;
  2764.     new Float:x, Float:y, Float:z;
  2765.     GetPlayerPos(playerid,x,y,z);
  2766.     return IsXYZInZone(x, y, z, zoneid);
  2767. }
  2768.  
  2769.  
  2770. stock IsPlayerInZoneName(playerid, zonename[])
  2771. {
  2772.     new Float:x, Float:y, Float:z;
  2773.     GetPlayerPos(playerid,x,y,z);
  2774.     for (new zoneid = 0; zoneid < MAX_ZONES; zoneid++) {
  2775.         if (strcompEx(zonename,zones[zoneid][zone_name],false)) {
  2776.             return IsPlayerInZone(playerid, zoneid);
  2777.         }
  2778.     }
  2779.     return 0;
  2780. }
  2781.  
  2782.  
  2783. stock strcompEx(str1[],str2[],bool:ignorecase)
  2784. {
  2785.     if ((!strlen(str1)) && (!strlen(str2))) return 1;
  2786.     if (!strlen(str1)) return 0;
  2787.     if (!strlen(str2)) return 0;
  2788.     if (strcmp(str1,str2,ignorecase) == 0) {
  2789.         return 1;
  2790.     }
  2791.     return 0;
  2792. }
  2793.  
  2794.  
  2795. stock PlayerName(playerid)
  2796. {
  2797.     new name[255];
  2798.     GetPlayerName(playerid, name, 255);
  2799.     return name;
  2800. }
  2801.  
  2802.  
  2803. stock ConvertTime(seconds)
  2804. {
  2805.     new hours,mins,secs,string[100];
  2806.     hours = floatround(seconds / 3600);
  2807.     mins = floatround((seconds / 60) - (hours * 60));
  2808.     secs = floatround(seconds - ((hours * 3600) + (mins * 60)));
  2809.     if(hours >= 1)format(string,sizeof(string),"%d Hrs %02d Mins %02d Secs",hours,mins,secs);
  2810.     else if(mins >= 1)format(string,sizeof(string),"%02d Mins %02d Secs",mins,secs);
  2811.     else format(string,sizeof(string),"%d Secs",secs);
  2812.     return string;
  2813. }
  2814.  
  2815.  
  2816. stock IsStringIP(string[])
  2817. {
  2818.     new icnt;
  2819.     new port;
  2820.     for(new i=0,j=strlen(string);i<j;i++) {
  2821.         if(string[i] == '.') icnt++;
  2822.         else if(string[i] ==':') port++;
  2823.     }
  2824.     if(icnt == 3) {
  2825.         if(port == 1) return 2;
  2826.         else if(port == 0) return 1;
  2827.     }
  2828.     return 0;
  2829. }
  2830.  
  2831.  
  2832. public MsgToTheAdmin(msg[])
  2833. {
  2834.     for(new giveid=0; giveid<GetMaxPlayers(); giveid++) {
  2835.         if(IsPlayerConnected(giveid)) {
  2836.             if(IsPlayerAdmin(giveid)) {
  2837.                 SendClientMessage(giveid,green,msg);
  2838.             }
  2839.         }
  2840.     }
  2841.     return true;
  2842. }
  2843.  
  2844.  
  2845. public Spawn(playerid)
  2846. {
  2847.     if(!IsPlayerConnected(playerid)) return true;
  2848.     new Float:X, Float:Y, Float:Z, lolz1[256], lolz2[256];
  2849.     new currentzonename[256];
  2850.     new Float:HP, Float:Armour;
  2851.     GetPlayerPos(playerid,X,Y,Z);
  2852.     GetPlayerHealth(playerid,HP);
  2853.     currentzonename = GetXYZZoneName(X,Y,Z);
  2854.     format(lolz1,256,"3** [%i] %s has spawned in %s.", playerid, PlayerName(playerid), currentzonename);
  2855.     IRC_GroupSay(GroupID[1], AdminChan, lolz1);
  2856.     if(HP > 100 || Armour > 100) {
  2857.         format(lolz2,256,"4** [WARNING] %s (ID:%d) it can be a cheater. HP: %.0f Armour: %.0f", PlayerName(playerid), playerid, HP, Armour);
  2858.         IRC_GroupSay(GroupID[1], AdminChan, lolz2);
  2859.     }
  2860.     return true;
  2861. }
  2862.  
  2863.  
  2864. stock sscanf(string[], format[], {Float,_}
  2865. :...)
  2866. {
  2867.     new
  2868.         formatPos = 0,
  2869.         stringPos = 0,
  2870.         paramPos = 2,
  2871.         paramCount = numargs();
  2872.     while (paramPos < paramCount && string[stringPos]) {
  2873.         switch (format[formatPos++]) {
  2874.             case '\0':
  2875.             {
  2876.                 return 0;
  2877.             }
  2878.             case 'i', 'd':
  2879.             {
  2880.                 new
  2881.                     neg = 1,
  2882.                     num = 0,
  2883.                     ch = string[stringPos];
  2884.                 if (ch == '-') {
  2885.                     neg = -1;
  2886.                     ch = string[++stringPos];
  2887.                 }
  2888.                 do {
  2889.                     stringPos++;
  2890.                     if (ch >= '0' && ch <= '9') {
  2891.                         num = (num * 10) + (ch - '0');
  2892.                     }
  2893.                     else {
  2894.                         return 1;
  2895.                     }
  2896.                 }
  2897.                 while ((ch = string[stringPos]) && ch != ' ');
  2898.                 setarg(paramPos, 0, num * neg);
  2899.             }
  2900.             case 'h', 'x':
  2901.             {
  2902.                 new
  2903.                     ch,
  2904.                     num = 0;
  2905.                 while ((ch = string[stringPos++])) {
  2906.                     switch (ch) {
  2907.                         case 'x', 'X':
  2908.                         {
  2909.                             num = 0;
  2910.                             continue;
  2911.                         }
  2912.                         case '0' .. '9':
  2913.                         {
  2914.                             num = (num << 4) | (ch - '0');
  2915.                         }
  2916.                         case 'a' .. 'f':
  2917.                         {
  2918.                             num = (num << 4) | (ch - ('a' - 10));
  2919.                         }
  2920.                         case 'A' .. 'F':
  2921.                         {
  2922.                             num = (num << 4) | (ch - ('A' - 10));
  2923.                         }
  2924.                         case ' ':
  2925.                         {
  2926.                             break;
  2927.                         }
  2928.                         default:
  2929.                         {
  2930.                             return 1;
  2931.                         }
  2932.                     }
  2933.                 }
  2934.                 setarg(paramPos, 0, num);
  2935.             }
  2936.             case 'c':
  2937.             {
  2938.                 setarg(paramPos, 0, string[stringPos++]);
  2939.             }
  2940.             case 'f':
  2941.             {
  2942.                 new tmp[25];
  2943.                 strmid(tmp, string, stringPos, stringPos+sizeof(tmp)-2);
  2944.                 setarg(paramPos, 0, _:floatstr(tmp));
  2945.             }
  2946.             case 's', 'z':
  2947.             {
  2948.                 new
  2949.                     i = 0,
  2950.                     ch;
  2951.                 if (format[formatPos]) {
  2952.                     while ((ch = string[stringPos++]) && ch != ' ') {
  2953.                         setarg(paramPos, i++, ch);
  2954.                     }
  2955.                     if (!i) return 1;
  2956.                 }
  2957.                 else {
  2958.                     while ((ch = string[stringPos++])) {
  2959.                         setarg(paramPos, i++, ch);
  2960.                     }
  2961.                 }
  2962.                 stringPos--;
  2963.                 setarg(paramPos, i, '\0');
  2964.             }
  2965.             default:
  2966.             {
  2967.                 continue;
  2968.             }
  2969.         }
  2970.         while (string[stringPos] && string[stringPos] != ' ') {
  2971.             stringPos++;
  2972.         }
  2973.         while (string[stringPos] == ' ') {
  2974.             stringPos++;
  2975.         }
  2976.         paramPos++;
  2977.     }
  2978.     while (format[formatPos] == 'z') formatPos++;
  2979.     return format[formatPos];
  2980. }
  2981.  
  2982.  
  2983. public UnJailedDenied(playerid)
  2984. {
  2985.     SetPlayerInterior(playerid,6);
  2986.     SetPlayerPos(playerid,264.785200,77.564040,1001.039000);
  2987. }
  2988.  
  2989.  
  2990. public Float:GetDistanceBetweenPlayers(p1,p2)
  2991. {
  2992.     new
  2993.         Float:Pos[6];
  2994.  
  2995.     if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2)) {
  2996.         return -1.00;
  2997.     }
  2998.  
  2999.     GetPlayerPos(p1,Pos[0],Pos[1],Pos[2]);
  3000.     GetPlayerPos(p2,Pos[3],Pos[4],Pos[5]);
  3001.     return floatsqroot(floatpower(floatabs(floatsub(Pos[3],Pos[0])),2)+floatpower(floatabs(floatsub(Pos[4],Pos[1])),2)+floatpower(floatabs(floatsub(Pos[5],Pos[2])),2));
  3002. }
  3003.  
  3004.  
  3005. /*
  3006. stock strtok(const string[], &index)
  3007. {
  3008.     new length = strlen(string);
  3009.     while ((index < length) && (string[index] <= ' '))
  3010.     {
  3011.         index++;
  3012.     }
  3013.  
  3014.     new offset = index;
  3015.     new result[20];
  3016. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  3017. {
  3018. result[index - offset] = string[index];
  3019. index++;
  3020. }
  3021. result[index - offset] = EOS;
  3022. return result;
  3023. }
  3024. */
  3025. stock ComponentsNames(id)
  3026. {
  3027.     new CName[50];
  3028.     if(id == 1009) CName = "2x Nitrous";
  3029.     else if(id == 1008) CName = "5x Nitrous";
  3030.     else if(id == 1010) CName = "10x Nitrous";
  3031.     else if(id == 1082) CName = "Import (Wheels)";
  3032.     else if(id == 1085) CName = "Atomic (Wheels)";
  3033.     else if(id == 1096) CName = "Ahab (Wheels)";
  3034.     else if(id == 1097) CName = "Virtual (Wheels)";
  3035.     else if(id == 1098) CName = "Access (Wheels)";
  3036.     else if(id == 1025) CName = "Off road (Wheels)";
  3037.     else if(id == 1013) CName = "Round Fog Lamp";
  3038.     else if(id == 1020) CName = "Large exhaust";
  3039.     else if(id == 1021) CName = "Medium exhaust";
  3040.     else if(id == 1022) CName = "Small exhaust";
  3041.     else if(id == 1019) CName = "Twin exhaust";
  3042.     else if(id == 1006) CName = "Roof Scoop";
  3043.     else if(id == 1001) CName = "Win (Spoiler)";
  3044.     else if(id == 1003) CName = "Alpha (Spoiler)";
  3045.     else if(id == 1007) CName = "Side Skirt";
  3046.     else if(id == 1086) CName = "Bass Boost";
  3047.     else if(id == 1087) CName = "Hydraulics";
  3048.     else if(id == 1002) CName = "Drag (Spoiler)";
  3049.     else if(id == 1016) CName = "Worx (Spoiler)";
  3050.     else if(id == 1023) CName = "Fury (Spoiler)";
  3051.     else if(id == 1018) CName = "Upswept exhaust";
  3052.     else if(id == 1143) CName = "Oval Hood Vent";
  3053.     else if(id == 1145) CName = "Square Hood Vent";
  3054.     else if(id == 1024) CName = "Square Fog Lamps";
  3055.     else if(id == 1004) CName = "Champ Scoop";
  3056.     else if(id == 1015) CName = "Race (Spoiler)";
  3057.     else if(id == 1000) CName = "Pro (Spoiler)";
  3058.     else if(id == 1011) CName = "Race Scoop";
  3059.     else if(id == 1014) CName = "Champ (Spoiler)";
  3060.     else CName = "Unknown";
  3061.     return CName;
  3062. }
  3063.  
  3064.  
  3065. IsNumeric(const string[])
  3066. {
  3067.     for (new i = 0, j = strlen(string); i < j; i++) {
  3068.         if (string[i] > '9' || string[i] < '0') return 0;
  3069.     }
  3070.     return 1;
  3071. }
  3072.  
  3073.  
  3074. ReturnUser(text[])
  3075. {
  3076.     new pos = 0;
  3077.     while (text[pos] < 0x21) {
  3078.         if (text[pos] == 0) return INVALID_PLAYER_ID;
  3079.         pos++;
  3080.     }
  3081.     new userid = INVALID_PLAYER_ID;
  3082.     if (IsNumeric(text[pos])) {
  3083.         userid = strval(text[pos]);
  3084.         if (userid >=0 && userid < MAX_PLAYERS) {
  3085.             if(!IsPlayerConnected(userid)) {
  3086.                 userid = INVALID_PLAYER_ID;
  3087.             }
  3088.             else {
  3089.                 return userid;
  3090.             }
  3091.         }
  3092.     }
  3093.     new giveid;
  3094.     new GetPlayer[256];
  3095.     for (giveid=0; giveid<=MAX_PLAYERS; giveid++) {
  3096.         if (IsPlayerConnected(giveid)) {
  3097.             GetPlayerName(giveid,GetPlayer,16);
  3098.             new space = (strfind(GetPlayer, text,true));
  3099.             if (space != -1) {
  3100.                 return giveid;
  3101.             }
  3102.         }
  3103.     }
  3104.     return userid;
  3105. }
  3106.  
  3107.  
  3108. IsValidSkin(skinid)
  3109. {
  3110. #define MAX_BAD_SKINS   22
  3111.  
  3112.     new badSkins[MAX_BAD_SKINS] = {
  3113.         3, 4, 5, 6, 8, 42, 65, 74, 86,
  3114.         119, 149, 208, 265, 266, 267,
  3115.         268, 269, 270, 271, 272, 273, 289
  3116.     };
  3117.  
  3118.     if  (skinid < 0 || skinid > 299) return false;
  3119.     for (new i = 0; i < MAX_BAD_SKINS; i++) {
  3120.         if (skinid == badSkins[i]) return false;
  3121.     }
  3122.  
  3123. #undef MAX_BAD_SKINS
  3124.     return true;
  3125. }
  3126.  
  3127.  
  3128. stock GetWeaponIDFromName(WeaponName[])
  3129. {
  3130.     new wid;
  3131.     if(IsNumeric(WeaponName)) {
  3132.         wid = strval(WeaponName);
  3133.         return wid;
  3134.     }
  3135.     if(strfind("molotov",WeaponName,true)!=-1) return 18;
  3136.     for(new i = 0; i <= 46; i++) {
  3137.         switch(i) {
  3138.             case 0,19,20,21,44,45: continue;
  3139.             default:
  3140.             {
  3141.                 new name[24];
  3142.                 GetWeaponName(i,name,24);
  3143.                 if(strfind(name,WeaponName,true)!=-1)
  3144.                     return i;
  3145.             }
  3146.         }
  3147.     }
  3148.     return -1;
  3149. }
  3150.  
  3151.  
  3152. public AccessDenied(user[])
  3153. {
  3154.     new Denied[256];
  3155.     format(Denied,sizeof(Denied),"Notice %s 4*** Error: You don't have the necessary level.",user);
  3156.     IRC_GroupNotice(GroupID[0],user,Denied);
  3157.     return true;
  3158. }
  3159.  
  3160.  
  3161. public PlayerUnJailed(playerid)
  3162. {
  3163.     if(IsPlayerJailed[playerid] == 0) return true;
  3164.     new lolz1[256],lolz2[256];
  3165.     SetPlayerInterior(playerid,6);
  3166.     SetPlayerPos(playerid,267.785200,77.564040,1001.039000);
  3167.     format(lolz1,256,"*** Auto-unjailed player: %s (ID:%d).",PlayerName(playerid),playerid);
  3168.     format(lolz2,256,"4*** Auto-unjailed player: %s (ID:%d).",PlayerName(playerid),playerid);
  3169.     SendClientMessageToAll(red,lolz1);
  3170.     IRC_GroupSay(GroupID[0],EchoChan,lolz2);
  3171.     IsPlayerJailed[playerid] = false;
  3172.     return true;
  3173.  
  3174. }
  3175.  
  3176.  
  3177. //========================//
  3178. //== Include dutils.inc ==//
  3179. //===== by DracoBlue =====//
  3180. //========================//
  3181.  
  3182. stock Now()
  3183. {
  3184.     new hour,minute,second;
  3185.     new year, month,day;
  3186.     gettime(hour, minute, second);
  3187.     getdate(year, month, day);
  3188.     return mktime(hour,minute,second,day,month,year);
  3189. }
  3190.  
  3191.  
  3192. stock mktime(hour,minute,second,day,month,year)
  3193. {
  3194.     new timestamp2;
  3195.  
  3196.     timestamp2 = second + (minute * 60) + (hour * 3600);
  3197.  
  3198.     new days_of_month[12];
  3199.  
  3200.     if ( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ) {
  3201.         days_of_month = {                         // Schaltjahr
  3202.             31,29,31,30,31,30,31,31,30,31,30,31
  3203.         };
  3204.     }
  3205.     else {
  3206.         days_of_month = {                         // keins
  3207.             31,28,31,30,31,30,31,31,30,31,30,31
  3208.         };
  3209.     }
  3210.     new days_this_year = 0;
  3211.     days_this_year = day;
  3212.     if(month > 1) {                               // No January Calculation, because its always the 0 past months
  3213.         for(new i=0; i<month-1;i++) {
  3214.             days_this_year += days_of_month[i];
  3215.         }
  3216.     }
  3217.     timestamp2 += days_this_year * 86400;
  3218.  
  3219.     for(new j=1970;j<year;j++) {
  3220.         timestamp2 += 31536000;
  3221.                                                   // Schaltjahr + 1 Tag
  3222.         if ( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) )  timestamp2 += 86400;
  3223.     }
  3224.  
  3225.     return timestamp2;
  3226. }
  3227.  
  3228.  
  3229. OnPlayerLogin(playerid, password[])
  3230. {
  3231.     new query[MAX_STRING+1],Row[1024],Field[MAX_STRING];
  3232.     MySQLCheck();
  3233.     mysql_real_escape_string(BB3_PlayerName(playerid), BB3_PlayerName(playerid));
  3234.     mysql_real_escape_string(password, password);
  3235.  
  3236.     format(query,sizeof(query), "SELECT * FROM `"SQL_TABLENAME"` WHERE Username = '%s' AND Password = '%s' LIMIT 1", BB3_PlayerName(playerid), password);
  3237.     mysql_query(query);
  3238.     mysql_store_result();
  3239.  
  3240.     if(mysql_num_rows() > 0) {
  3241.         mysql_fetch_row_format(Row, "|");
  3242.  
  3243.         mysql_fetch_field_row(Field, "Password"); strmid(PlayerInfo[playerid][gPassword], Field, 0, strlen(Field), 255);
  3244.         mysql_fetch_field_row(Field, "AdminLevel"); PlayerInfo[playerid][gAdminLevel] = strval(Field);
  3245.         mysql_fetch_field_row(Field, "Money"); PlayerInfo[playerid][gMoney] = strval(Field);
  3246.         mysql_fetch_field_row(Field, "Score"); PlayerInfo[playerid][gScore] = strval(Field);
  3247.     }
  3248.     mysql_free_result();
  3249.  
  3250.     ResetPlayerMoney(playerid);
  3251.     GivePlayerMoney(playerid, PlayerInfo[playerid][gMoney]);
  3252.     SetPlayerScore(playerid, PlayerInfo[playerid][gScore]);
  3253.     return 1;
  3254. }
  3255.  
  3256.  
  3257. OnPlayerSave(playerid)
  3258. {
  3259.     if(PlayerInfo[playerid][gLogged] != 0) {
  3260.         new query[MAX_STRING+1];
  3261.         MySQLCheck();
  3262.  
  3263.         format(query,sizeof(query),"UPDATE `"SQL_TABLENAME"` SET `Password`='%s' WHERE (`Username` = '%s')",PlayerInfo[playerid][gPassword], BB3_PlayerName(playerid));
  3264.         mysql_query(query);
  3265.         format(query,sizeof(query),"UPDATE `"SQL_TABLENAME"` SET `AdminLevel`='%s' WHERE (`Username` = %d)",PlayerInfo[playerid][gAdminLevel], BB3_PlayerName(playerid));
  3266.         mysql_query(query);
  3267.         format(query,sizeof(query),"UPDATE `"SQL_TABLENAME"` SET `Money`='%s' WHERE (`Username` = %d)",GetPlayerMoney(playerid), BB3_PlayerName(playerid));
  3268.         mysql_query(query);
  3269.         format(query,sizeof(query),"UPDATE `"SQL_TABLENAME"` SET `Score`='%s' WHERE (`Username` = %d)",GetPlayerScore(playerid), BB3_PlayerName(playerid));
  3270.         mysql_query(query);
  3271.     }
  3272.     return 1;
  3273. }
  3274.  
  3275.  
  3276. BB3_PlayerName(playerid)
  3277. {
  3278.     new PlayerName[MAX_PLAYER_NAME];
  3279.     GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
  3280.     return PlayerName;
  3281. }
  3282.  
  3283.  
  3284. MySQLCheck()
  3285. {
  3286.     if(mysql_ping() == -1) {
  3287.         mysql_connect(SQL_HOST, SQL_USER,SQL_DB, SQL_PASS);
  3288.     }
  3289.     return 1;
  3290. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement