Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ####### # #
- # ##### #### ###### ###### # # # # # # ##### #
- # # # # # # # ## # # # # # # # #
- ##### # # # # # ##### # # # # # # # # #
- # ##### # # # # # # # # # # ##### #
- # # # # # # # # ## # # # # # #
- # # # #### ###### ###### # # # #### # # #
- */
- #include <a_samp>
- #include <irc>
- #include "../include/gl_common.inc"
- #include <a_mysql>
- #define yellow 0xFFFF00AA
- #define green 0x33AA33AA
- #define red 0xAA3333AA
- #define orange 0xFF8040FF
- #define IrcServer "irc.blackbank.nl" // IRC server.
- #define IrcPort 6667 // IRC port.
- #define EchoChan "#ys" // The channel where will go out.
- #define AdminChan "#ys.admin" // If there is a channel, everything private will be seen there is. (Optional)
- #define AdminPass ""
- #define BotPass "" // The password for nickserv. (Optional)
- #define ChanPass "" // The password for chanserv. (Optional)
- #define BotRealName "frozenyuri" // Optional
- #define BotUserName "frozen.yuri" // Optional
- #define MAX_NAME 30
- #define MAX_ZONES 366
- #define Mode "+v" // +v / +h / +o / +a / +q / - (off)
- #define IrcToServer "all" // admin (rcon) / all / off
- #define QuitMsg "12* Server offline" // Sends a message when goes out of the channel. (Optional)
- #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
- new MinQuestionMoney = 250; // 250 is ajustable to any number you want the minimal
- 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
- new RandomQuestionMoney;
- new BotName1[256] = "FY-Bot1"; // Name of the BOT 1
- new BotName2[256] = "FY-Bot2"; // Name of the BOT 2 (Optional)
- new BotName3[256] = ""; // Name of the BOT 3 (Optional)
- new BotName4[256] = ""; // Name of the BOT 4 (Optional)
- new JoinMsg[][256] =
- {
- {"server loaded"}
- };
- new EchoConnection[8];
- new GroupID[2];
- new Delay = 1000;
- new Total = 0;
- new SendMsg;
- new TimeAtConnect[500];
- new IsPlayerMuted[500];
- new IsPlayerJailed[500];
- new QuestionStarted;
- new Question[32];
- new total_vehicles_from_files=0;
- //#pragma unused sztmp
- forward SendQuestionForMoney();
- forward IABot1();
- forward IABot2();
- forward IABot3();
- forward IABot4();
- forward IALoad();
- forward Spawn(playerid);
- forward MsgToTheAdmin(msg[]);
- forward Float:GetDistanceBetweenPlayers(p1,p2);
- forward AccessDenied(user[]);
- forward UnJailedDenied(playerid);
- forward PlayerUnJailed(playerid);
- forward BB3_PlayerName(playerid);
- #define SQL_HOST "myhost.net"
- #define SQL_DB "database"
- #define SQL_USER "user"
- #define SQL_PASS "pass"
- #define SQL_TABLENAME "users"
- #define SQL_DEBUG_ON (1)
- #define MAX_STRING (255)
- enum pInfo
- {
- gPassword,
- gAdminLevel,
- gMoney,
- gScore,
- gAccount,
- gLogged,
- };
- new PlayerInfo[MAX_PLAYERS][pInfo];
- //----------------------------------------------------------------------------//
- new VehicleNames[][] =
- {
- "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus",
- "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
- "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie",
- "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
- "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider",
- "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
- "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood",
- "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",
- "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain",
- "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
- "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover",
- "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
- "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer",
- "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",
- "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)",
- "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
- "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
- };
- new aDisconnectNames[][20] =
- {
- {"7Timeout2"},
- {"3Leaving2"},
- {"4Kicked/Banned2"}
- };
- main()
- {
- print(" ----------------");
- print(" | By: BlackBoard |");
- print(" ----------------");
- print(" ##### ");
- print("# # ###### ##### # # ###### ##### ");
- print("# # # # # # # # # ");
- print(" ##### ##### # # # # ##### # # ");
- print(" # # ##### # # # ##### ");
- print("# # # # # # # # # # ");
- print(" ##### ###### # # ## ###### # # ");
- print(" ");
- print("# #### ## ##### ###### ##### ");
- print("# # # # # # # # # # ");
- print("# # # # # # # ##### # # ");
- print("# # # ###### # # # # # ");
- print("# # # # # # # # # # ");
- print("###### #### # # ##### ###### #####");
- }
- public OnGameModeInit()
- {
- #undef MAX_PLAYERS
- #define MAX_PLAYERS (GetMaxPlayers())
- mysql_debug(SQL_DEBUG_ON);
- new Connection = mysql_connect(SQL_HOST, SQL_USER, SQL_DB, SQL_PASS);
- if(Connection) printf(">> MySQL Successfull Connected! <<");
- SetGameModeText("New GM");
- SetTimer("SendQuestionForMoney", 600000, true);
- DisableInteriorEnterExits();
- // skinn113
- AddPlayerClass(113,1733.3044,-1912.1366,13.5621,91.1281,0,0,0,0,0,0);
- // skinn112
- AddPlayerClass(112,1733.3044,-1912.1366,13.5621,91.1281,0,0,0,0,0,0);
- // skinn111
- AddPlayerClass(111,1733.3044,-1912.1366,13.5621,91.1281,0,0,0,0,0,0);
- // skinn12
- AddPlayerClass(12,1733.2166,-1903.3141,13.5621,89.9391,0,0,0,0,0,0);
- // skinn55
- AddPlayerClass(55,1733.2166,-1903.3141,13.5621,89.9391,0,0,0,0,0,0);
- // skinn56
- AddPlayerClass(56,1733.2166,-1903.3141,13.5621,89.9391,0,0,0,0,0,0);
- SendMsg = 0;
- GroupID[0] = IRC_CreateGroup();
- GroupID[1] = IRC_CreateGroup();
- IALoad();
- // SPECIAL
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/trains.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/pilots.txt");
- // LAS VENTURAS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/lv_gen.txt");
- // SAN FIERRO
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/sf_gen.txt");
- // LOS SANTOS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_law.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_airport.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_inner.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/ls_gen_outer.txt");
- // OTHER AREAS
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/whetstone.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/bone.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/flint.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/tierra.txt");
- total_vehicles_from_files += LoadStaticVehiclesFromFile("vehicles/red_county.txt");
- printf("Total vehicles from files: %d",total_vehicles_from_files);
- return 1;
- }
- public OnGameModeExit()
- {
- IRC_Quit(EchoConnection[0], QuitMsg);
- IRC_Quit(EchoConnection[1], QuitMsg);
- IRC_Quit(EchoConnection[2], QuitMsg);
- IRC_Quit(EchoConnection[3], QuitMsg);
- if(mysql_ping()) mysql_close();
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- SetPlayerInterior(playerid,0);
- SetPlayerPos(playerid,1411.3091,-1698.2535,39.5469);
- SetPlayerFacingAngle(playerid,230.0);
- SetPlayerCameraPos(playerid,1406.5480,-1694.6781,39.5469);
- SetPlayerCameraLookAt(playerid,1411.3091,-1698.2535,39.5469);
- SetPlayerColor(playerid,0xFFFFFFAA);
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- new joiner[128];
- GetPlayerName(playerid,joiner,sizeof(joiner));
- format(joiner,sizeof(joiner),"*** %s (ID: %d) has joined the Server ",joiner,playerid);
- SendClientMessageToAll(0xB4B5B7AA,joiner);
- new JoinMsg1[128];
- IsPlayerMuted[playerid] = 0;
- format(JoinMsg1,128, "2** 4[%i]2 %s has joined the server.", playerid, PlayerName(playerid));
- IRC_GroupSay(GroupID[0], EchoChan, JoinMsg1);
- IsPlayerJailed[playerid] = false;
- IsPlayerMuted[playerid] = false;
- if(strlen(AdminChan) != 0) {
- if(IsPlayerNPC(playerid)) {
- new JoinMsg2[128];
- format(JoinMsg2, 128, "2** 4[NPC] [%i]2 %s has joined the server.", playerid, PlayerName(playerid));
- IRC_GroupSay(GroupID[1], AdminChan, JoinMsg2);
- }
- else {
- new JoinMsg2[128];
- new IP[256];
- GetPlayerIp(playerid,IP,256);
- format(JoinMsg2, 128, "2** 4[%i]2 %s has joined the server. (%s)", playerid, PlayerName(playerid), IP);
- IRC_GroupSay(GroupID[1], AdminChan, JoinMsg2);
- TimeAtConnect[playerid] = Now();
- }
- }
- MySQLCheck();
- new query[MAX_STRING+1];
- format(query,sizeof(query), "SELECT * FROM `"SQL_TABLENAME"` WHERE Username = '%s'", BB3_PlayerName(playerid));
- mysql_query(query);
- mysql_store_result();
- if(mysql_num_rows() > 0) {
- PlayerInfo[playerid][gAccount] = 1;
- }
- else {
- PlayerInfo[playerid][gAccount] = 0;
- }
- mysql_free_result();
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if(strcmp(cmdtext, "/register", true) == 0) {
- if(PlayerInfo[playerid][gAccount] == 1) return SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: This nick is already registered!");
- if(!cmdtext[9]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: /login [PASSWORD]");
- MySQLCheck();
- mysql_real_escape_string(BB3_PlayerName(playerid), BB3_PlayerName(playerid));
- mysql_real_escape_string(cmdtext[10], cmdtext[10]);
- new query[MAX_STRING+1];
- format(query,sizeof(query), "INSERT INTO `"SQL_TABLENAME"` (Username,Password) VALUES ('%s','%s')", BB3_PlayerName(playerid), cmdtext[10]);
- mysql_query(query);
- OnPlayerSave(playerid);
- OnPlayerLogin(playerid, cmdtext[10]);
- PlayerInfo[playerid][gAccount] = 1;
- SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: Nick succesfull registered!");
- SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: You are automatically logged in!");
- return 1;
- }
- if(strcmp(cmdtext, "/login", true) == 0) {
- if(PlayerInfo[playerid][gLogged] == 1) return SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: You are already logged in!");
- if(PlayerInfo[playerid][gAccount] == 0) return SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: You do not have an account yet! (/register)");
- if(!cmdtext[6]) return SendClientMessage(playerid, 0xFF0000AA, "ERROR: /login [PASSWORD]");
- OnPlayerLogin(playerid, cmdtext[7]);
- PlayerInfo[playerid][gLogged] = 1;
- SendClientMessage(playerid, 0x33CCFFAA, "ACCOUNT: You are succesfull logged in!");
- return 1;
- }
- return 0;
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
- GetPlayerName(playerid, pname, sizeof(pname));
- switch(reason) {
- case 0: format(string, sizeof(string), "*** %s has left the server. (Lost Connection)", pname);
- case 1: format(string, sizeof(string), "*** %s has left the server. (Leaving)", pname);
- case 2: format(string, sizeof(string), "*** %s has left the server. (Kicked)", pname);
- }
- SendClientMessageToAll(0xAAAAAAAA, string);
- new leaveMsg1[256];
- IsPlayerMuted[playerid] = 0;
- format(leaveMsg1, 256, "2** 4[%i]2 %s has left the server. (%s)", playerid, PlayerName(playerid), aDisconnectNames[reason]);
- IRC_GroupSay(GroupID[0], EchoChan, leaveMsg1);
- IsPlayerJailed[playerid] = false;
- IsPlayerMuted[playerid] = false;
- if(strlen(AdminChan) != 0) {
- if(IsPlayerNPC(playerid)) {
- new leaveMsg2[256];
- format(leaveMsg2, 256, "2** 4[NPC] [%i]2 %s has left the server. (%s)", playerid, PlayerName(playerid), aDisconnectNames[reason]);
- IRC_GroupSay(GroupID[1], AdminChan, leaveMsg2);
- }
- else {
- new leaveMsg2[256];
- new current = Now() - TimeAtConnect[playerid];
- format(leaveMsg2, 256, "2** 4[%i]2 %s has left the server. (%s) (%s)", playerid, PlayerName(playerid), aDisconnectNames[reason], ConvertTime(current));
- IRC_GroupSay(GroupID[1], AdminChan, leaveMsg2);
- }
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- if(strlen(AdminChan) != 0) {
- if(IsPlayerJailed[playerid]) {
- new lolz1[256];
- new lolz2[256];
- format(lolz1,sizeof(lolz1),"*** You don't have permission to leave the jail.");
- format(lolz2,sizeof(lolz2),"4*** %s (ID:%d) it cannot leave the jail.",PlayerName(playerid),playerid);
- SendClientMessage(playerid,red,lolz1);
- IRC_GroupSay(GroupID[1], AdminChan,lolz2);
- SetTimerEx("UnJailedDenied",500,0,"d",playerid);
- }
- else {
- // for load...
- SetTimerEx("Spawn",3000,0,"d",playerid);
- }
- }
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new msg[128],killerName[MAX_PLAYER_NAME],reasonMsg[32],playerName[MAX_PLAYER_NAME];
- GetPlayerName(killerid, killerName, sizeof(killerName));
- GetPlayerName(playerid, playerName, sizeof(playerName));
- if (killerid != INVALID_PLAYER_ID) {
- switch (reason) {
- case 0:
- {
- reasonMsg = "Unarmed";
- }
- case 1:
- {
- reasonMsg = "Brass Knuckles";
- }
- case 2:
- {
- reasonMsg = "Golf Club";
- }
- case 3:
- {
- reasonMsg = "Night Stick";
- }
- case 4:
- {
- reasonMsg = "Knife";
- }
- case 5:
- {
- reasonMsg = "Baseball Bat";
- }
- case 6:
- {
- reasonMsg = "Shovel";
- }
- case 7:
- {
- reasonMsg = "Pool Cue";
- }
- case 8:
- {
- reasonMsg = "Katana";
- }
- case 9:
- {
- reasonMsg = "Chainsaw";
- }
- case 10:
- {
- reasonMsg = "Dildo";
- }
- case 11:
- {
- reasonMsg = "Dildo";
- }
- case 12:
- {
- reasonMsg = "Vibrator";
- }
- case 13:
- {
- reasonMsg = "Vibrator";
- }
- case 14:
- {
- reasonMsg = "Flowers";
- }
- case 15:
- {
- reasonMsg = "Cane";
- }
- case 22:
- {
- reasonMsg = "Pistol";
- }
- case 23:
- {
- reasonMsg = "Silenced Pistol";
- }
- case 24:
- {
- reasonMsg = "Desert Eagle";
- }
- case 25:
- {
- reasonMsg = "Shotgun";
- }
- case 26:
- {
- reasonMsg = "Sawn-off Shotgun";
- }
- case 27:
- {
- reasonMsg = "Combat Shotgun";
- }
- case 28:
- {
- if(IsPlayerInAnyVehicle(playerid)) {
- if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
- reasonMsg = "Drive By (MAC-10)";
- }
- else {
- reasonMsg = "MAC-10";
- }
- }
- else {
- reasonMsg = "MAC-10";
- }
- }
- case 29:
- {
- if(IsPlayerInAnyVehicle(playerid)) {
- if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
- reasonMsg = "Drive By (MP5)";
- }
- else {
- reasonMsg = "MP5";
- }
- }
- else {
- reasonMsg = "MP5";
- }
- }
- case 30:
- {
- reasonMsg = "AK-47";
- }
- case 31:
- {
- if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
- switch (GetVehicleModel(GetPlayerVehicleID(killerid))) {
- case 447:
- {
- reasonMsg = "Sea Sparrow Machine Gun";
- }
- default:
- {
- reasonMsg = "M4";
- }
- }
- }
- else {
- reasonMsg = "M4";
- }
- }
- case 32:
- {
- if(IsPlayerInAnyVehicle(playerid)) {
- if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
- reasonMsg = "Drive By (TEC-9)";
- }
- else {
- reasonMsg = "TEC-9";
- }
- }
- else {
- reasonMsg = "TEC-9";
- }
- }
- case 33:
- {
- reasonMsg = "Rifle";
- }
- case 34:
- {
- reasonMsg = "Sniper Rifle";
- }
- case 37:
- {
- reasonMsg = "Fire";
- }
- case 38:
- {
- if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
- switch(GetVehicleModel(GetPlayerVehicleID(killerid))) {
- case 425:
- {
- reasonMsg = "Hunter Machine Gun";
- }
- default:
- {
- reasonMsg = "Minigun";
- }
- }
- }
- else {
- reasonMsg = "Minigun";
- }
- }
- case 41:
- {
- reasonMsg = "Spraycan";
- }
- case 42:
- {
- reasonMsg = "Fire Extinguisher";
- }
- case 49:
- {
- reasonMsg = "Vehicle Collision";
- }
- case 50:
- {
- if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
- switch(GetVehicleModel(GetPlayerVehicleID(killerid))) {
- case 417, 425, 447, 465, 469, 487, 488, 497, 501, 548, 563:
- {
- reasonMsg = "Helicopter Blades";
- }
- default:
- {
- reasonMsg = "Vehicle Collision";
- }
- }
- }
- else {
- reasonMsg = "Vehicle Collision";
- }
- }
- case 51:
- {
- if (GetPlayerState(killerid) == PLAYER_STATE_DRIVER) {
- switch(GetVehicleModel(GetPlayerVehicleID(killerid))) {
- case 425:
- {
- reasonMsg = "Hunter Rockets";
- }
- case 432:
- {
- reasonMsg = "Rhino Turret";
- }
- case 520:
- {
- reasonMsg = "Hydra Rockets";
- }
- default:
- {
- reasonMsg = "Explosion";
- }
- }
- }
- else {
- reasonMsg = "Explosion";
- }
- }
- default:
- {
- reasonMsg = "Unknown";
- }
- }
- format(msg, sizeof(msg), "04*** %s killed %s. (%s)", killerName, playerName, reasonMsg);
- }
- else {
- switch (reason) {
- case 53:
- {
- format(msg, sizeof(msg), "04*** %s died. (Drowned)", playerName);
- }
- case 54:
- {
- format(msg, sizeof(msg), "04*** %s died. (Collision)", playerName);
- }
- default:
- {
- format(msg, sizeof(msg), "04*** %s died.", playerName);
- }
- }
- }
- IRC_GroupSay(GroupID[0], EchoChan, msg);
- if(strlen(AdminChan) != 0) {
- if (reason == 54 || killerid == 255) {
- new Float:X, Float:Y, Float:Z, lolz1[256];
- new currentzonename[256];
- GetPlayerPos(playerid,X,Y,Z);
- currentzonename = GetXYZZoneName(X,Y,Z);
- format(lolz1,256,"%s 4(Location: %s)", msg, currentzonename);
- IRC_GroupSay(GroupID[1],AdminChan,lolz1);
- }
- else if(killerid != 255) {
- new Float:X, Float:Y, Float:Z, lolz1[256];
- new currentzonename[256];
- GetPlayerPos(playerid,X,Y,Z);
- currentzonename = GetXYZZoneName(X,Y,Z);
- format(lolz1,256,"%s 4(Distance: %.0f ft - Location: %s)", msg, GetDistanceBetweenPlayers(playerid,killerid), currentzonename);
- IRC_GroupSay(GroupID[1],AdminChan,lolz1);
- }
- else {
- new Float:X, Float:Y, Float:Z, lolz1[256];
- new currentzonename[256];
- GetPlayerPos(playerid,X,Y,Z);
- currentzonename = GetXYZZoneName(X,Y,Z);
- format(lolz1,256,"%s 4(Location: %s)", msg, currentzonename);
- IRC_GroupSay(GroupID[1],AdminChan,lolz1);
- }
- }
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(QuestionStarted == 1 && strfind(text[0], Question, false) == 0) {
- new pname[128];
- GetPlayerName(playerid,pname,sizeof(pname));
- new string[128];
- format(string, sizeof(string), "*** %s has won $%d, by typing %s ",pname, RandomQuestionMoney, Question);
- SendClientMessageToAll(green, string);
- printf(string);
- IRC_GroupSay(GroupID[0], EchoChan, string);
- GivePlayerMoney(playerid, RandomQuestionMoney);
- QuestionStarted = 0;
- return 0;
- }
- new playertext[256];
- if(IsPlayerAdmin(playerid)) {
- new admintext[200];
- format(admintext,200,"2** 4[%i]3 %s:1 %s",playerid,PlayerName(playerid),text);
- IRC_GroupSay(GroupID[0], EchoChan, admintext);
- if(strlen(AdminChan) != 0) {
- IRC_GroupSay(GroupID[1], AdminChan, admintext);
- }
- return 1;
- }
- if(!IsPlayerMuted[playerid]) {
- format(playertext,sizeof(playertext), "2** 4[%i]2 %s:1 %s",playerid,PlayerName(playerid),text);
- IRC_GroupSay(GroupID[0], EchoChan, playertext);
- return 1;
- }
- if(strlen(AdminChan) != 0) {
- format(playertext,sizeof(playertext), "4** [%i] %s:1 %s",playerid,PlayerName(playerid),text);
- IRC_GroupSay(GroupID[1], AdminChan, playertext);
- }
- SendClientMessage(playerid,red,"*** You are currently muted.");
- return 1;
- }
- public SendQuestionForMoney()
- {
- new string[128];
- new qstring[32];
- RandomQuestionMoney = MinQuestionMoney+random(MaxQuestionMoney-MinQuestionMoney);
- 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));
- strmid(Question, qstring, false, strlen(qstring), 32);
- format(string, sizeof(string), "*** The fastest who types %s will earn $%d", qstring, RandomQuestionMoney);
- printf(string);
- IRC_GroupSay(GroupID[0], EchoChan, string);
- SendClientMessageToAll(green, string);
- QuestionStarted = 1;
- return 1;
- }
- public IALoad()
- {
- if(strlen(BotName1) != 0) {
- SetTimer("IABot1",Delay,0);
- if(Delay == 1000 && strlen(BotName2) != 0) {
- Delay += 1000;
- }
- else {
- Delay = 15000;
- }
- Total++;
- }
- else {
- return 1;
- }
- if(strlen(BotName2) != 0) {
- SetTimer("IABot2",Delay,0);
- if(Delay == 2000 && strlen(BotName3) != 0) {
- Delay += 1000;
- }
- else {
- Delay = 15000;
- }
- Total++;
- }
- else {
- return 1;
- }
- if(strlen(BotName3) != 0) {
- SetTimer("IABot3",Delay,0);
- if(Delay == 3000 && strlen(BotName4) != 0) {
- Delay += 1000;
- }
- else {
- Delay = 15000;
- }
- Total++;
- }
- else {
- return 1;
- }
- if(strlen(BotName4) != 0) {
- SetTimer("IABot4",Delay,0);
- Delay = 15000;
- Total++;
- }
- else {
- return 1;
- }
- return 1;
- }
- public IABot1()
- {
- if(strlen(BotName1) == 0) return 1;
- if(strlen(BotRealName) != 0) {
- if(strlen(BotUserName) != 0) {
- EchoConnection[0] = IRC_Connect(IrcServer,IrcPort,BotName1,BotRealName,BotUserName);
- }
- else {
- EchoConnection[0] = IRC_Connect(IrcServer,IrcPort,BotName1,BotRealName,"Bot");
- }
- }
- else {
- if(strlen(BotUserName) != 0) {
- EchoConnection[0] = IRC_Connect(IrcServer,IrcPort,BotName1,"IAdministrator 1.0 by PlayerX",BotUserName);
- }
- else {
- EchoConnection[0] = IRC_Connect(IrcServer,IrcPort,BotName1,"IAdministrator 1.0 by PlayerX","Bot");
- }
- }
- return 1;
- }
- public IABot2()
- {
- if(strlen(BotName2) == 0) return 1;
- if(strlen(BotRealName) != 0) {
- if(strlen(BotUserName) != 0) {
- EchoConnection[1] = IRC_Connect(IrcServer,IrcPort,BotName2,BotRealName,BotUserName);
- }
- else {
- EchoConnection[1] = IRC_Connect(IrcServer,IrcPort,BotName2,BotRealName,"Bot");
- }
- }
- else {
- if(strlen(BotUserName) != 0) {
- EchoConnection[1] = IRC_Connect(IrcServer,IrcPort,BotName2,"IAdministrator 1.0 by PlayerX",BotUserName);
- }
- else {
- EchoConnection[1] = IRC_Connect(IrcServer,IrcPort,BotName2,"IAdministrator 1.0 by PlayerX","Bot");
- }
- }
- return 1;
- }
- public IABot3()
- {
- if(strlen(BotName3) == 0) return 1;
- if(strlen(BotRealName) != 0) {
- if(strlen(BotUserName) != 0) {
- EchoConnection[2] = IRC_Connect(IrcServer,IrcPort,BotName3,BotRealName,BotUserName);
- }
- else {
- EchoConnection[2] = IRC_Connect(IrcServer,IrcPort,BotName3,BotRealName,"Bot");
- }
- }
- else {
- if(strlen(BotUserName) != 0) {
- EchoConnection[2] = IRC_Connect(IrcServer,IrcPort,BotName3,"IAdministrator 1.0 by PlayerX",BotUserName);
- }
- else {
- EchoConnection[2] = IRC_Connect(IrcServer,IrcPort,BotName3,"IAdministrator 1.0 by PlayerX","Bot");
- }
- }
- return 1;
- }
- public IABot4()
- {
- if(strlen(BotName4) == 0) return 1;
- if(strlen(BotRealName) != 0) {
- if(strlen(BotUserName) != 0) {
- EchoConnection[3] = IRC_Connect(IrcServer,IrcPort,BotName4,BotRealName,BotUserName);
- }
- else {
- EchoConnection[3] = IRC_Connect(IrcServer,IrcPort,BotName4,BotRealName,"Bot");
- }
- }
- else {
- if(strlen(BotUserName) != 0) {
- EchoConnection[3] = IRC_Connect(IrcServer,IrcPort,BotName4,"IAdministrator 1.0 by PlayerX",BotUserName);
- }
- else {
- EchoConnection[3] = IRC_Connect(IrcServer,IrcPort,BotName4,"IAdministrator 1.0 by PlayerX","Bot");
- }
- }
- return 1;
- }
- //==========================//
- // Callbacks of the irc.inc //
- //==========================//
- public IRC_OnConnect(botid)
- {
- new mode[256];
- IRC_JoinChannel(botid, EchoChan);
- if(botid == EchoConnection[0]) {
- format(mode,256,"mode %s +B",BotName1);
- IRC_SendRaw(botid,mode);
- }
- else if(botid == EchoConnection[1]) {
- format(mode,256,"mode %s +B",BotName2);
- IRC_SendRaw(botid,mode);
- }
- else if(botid == EchoConnection[2]) {
- format(mode,256,"mode %s +B",BotName3);
- IRC_SendRaw(botid,mode);
- }
- else if(botid == EchoConnection[3]) {
- format(mode,256,"mode %s +B",BotName4);
- IRC_SendRaw(botid,mode);
- }
- if(strlen(AdminChan) != 0) {
- IRC_JoinChannel(botid, AdminChan, AdminPass);
- }
- Delay = 15000;
- if(strlen(BotPass) != 0) {
- new ns[100];
- format(ns,100,"privmsg nickserv identify %s",BotPass);
- IRC_SendRaw(botid,ns);
- }
- if(strlen(ChanPass) != 0) {
- new cs1[100];
- new cs2[100];
- format(cs1,100,"privmsg chanserv identify %s %s",EchoChan,BotPass);
- format(cs2,100,"privmsg chanserv identify %s %s",AdminChan,BotPass);
- IRC_SendRaw(botid,cs1);
- IRC_SendRaw(botid,cs2);
- }
- return 1;
- }
- public IRC_OnDisconnect(botid)
- {
- if(botid == EchoConnection[0] && strlen(BotName1) != 0) {
- SetTimer("IABot1",Delay,0);
- Total--;
- }
- else if(botid == EchoConnection[1] && strlen(BotName2) != 0) {
- SetTimer("IABot2",Delay,0);
- Total--;
- }
- else if(botid == EchoConnection[2] && strlen(BotName3) != 0) {
- SetTimer("IABot3",Delay,0);
- Total--;
- }
- else if(botid == EchoConnection[4] && strlen(BotName4) != 0) {
- SetTimer("IABot4",Delay,0);
- Total--;
- }
- IRC_RemoveFromGroup(GroupID[0], botid);
- IRC_RemoveFromGroup(GroupID[1], botid);
- return 1;
- }
- public IRC_OnJoinChannel(botid, channel[])
- {
- if(SendMsg == 0 && botid == EchoConnection[0]) {
- for(new i=0;i<5;i++) {
- if(strlen(JoinMsg[i]) != 0) {
- IRC_Say(botid,channel,JoinMsg[i]);
- }
- }
- SendMsg = 1;
- }
- IRC_AddToGroup(GroupID[0], botid);
- if(strlen(AdminChan) != 0) {
- IRC_AddToGroup(GroupID[1], botid);
- }
- if(strcmp(IrcToServer,"admin", true) == 0) {
- new msg[256];
- format(msg,256,"=[BOT]= has joined %s", channel);
- MsgToTheAdmin(msg);
- }
- else if(strcmp(IrcToServer,"all", true) == 0) {
- new msg[256];
- format(msg,256,"=[BOT]= has joined %s", channel);
- SendClientMessageToAll(green, msg);
- }
- else {
- return 1;
- }
- return 1;
- }
- public IRC_OnLeaveChannel(botid, channel[], message[])
- {
- if(strcmp(channel,EchoChan, true) == 0) {
- IRC_RemoveFromGroup(GroupID[0], botid);
- IRC_JoinChannel(botid, channel);
- }
- if(strcmp(channel,AdminChan, true) == 0 && strlen(AdminChan) != 0) {
- IRC_RemoveFromGroup(GroupID[1], botid);
- IRC_JoinChannel(botid, channel);
- }
- if(strcmp(IrcToServer,"admin", true) == 0 && botid == EchoConnection[0]) {
- new msg[256];
- format(msg,256,"=[BOT]= has left %s (%s)", channel, message);
- MsgToTheAdmin(msg);
- }
- else if(strcmp(IrcToServer,"all", true) == 0 && botid == EchoConnection[0]) {
- new msg[256];
- format(msg,256,"=[BOT]= has left %s (%s)", channel, message);
- SendClientMessageToAll(green, msg);
- }
- else {
- return 1;
- }
- return 1;
- }
- public IRC_OnUserNotice(botid, recipient[], user[], host[], message[])
- {
- 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) {
- if(strlen(AdminChan) != 0) {
- new notice[256];
- format(notice,256,"2[%s]3 %s",user,message);
- IRC_Say(botid, AdminChan, notice);
- }
- }
- else if(strcmp(user,BotName1, true) == 0 || strcmp(user,BotName2, true) == 0 || strcmp(user,BotName3, true) == 0 || strcmp(user,BotName4, true) == 0) return 1;
- else {
- if(strlen(AdminChan) != 0) {
- new notice[256];
- format(notice,256,"12[%s]3 %s",user,message);
- IRC_Say(botid, AdminChan, notice);
- }
- }
- if(strcmp(IrcToServer,"admin", true) == 0) {
- new msg[256];
- format(msg,256,"-%s- %s",user, message);
- MsgToTheAdmin(msg);
- }
- else if(strcmp(IrcToServer,"all", true) == 0) {
- new msg[256];
- format(msg,256,"-%s- %s",user, message);
- SendClientMessageToAll(green, msg);
- }
- else {
- return 1;
- }
- return 1;
- }
- public IRC_OnReceiveRaw(botid, message[])
- {
- if (strfind(message, ":PING") != -1) return 1;
- if (strfind(message, ":VERSION") != -1) return 1;
- if (strfind(message, ":TIME") != -1) return 1;
- return 1;
- }
- public IRC_OnUserJoinChannel(botid, channel[], user[], host[])
- {
- 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) {
- new SetMode[100];
- format(SetMode,100,"mode %s %s %s",channel,Mode,user);
- IRC_SendRaw(EchoConnection[0],SetMode);
- }
- if(strcmp(IrcToServer,"admin", true) == 0 && strcmp(channel,EchoChan, true) == 0 && botid == EchoConnection[0]) {
- new msg[256];
- format(msg,256,"* %s (%s) has joined %s.",user, host, channel);
- MsgToTheAdmin(msg);
- }
- else if(strcmp(IrcToServer,"all", true) == 0 && strcmp(channel,EchoChan, true) == 0 && botid == EchoConnection[0]) {
- new msg[256];
- format(msg,256,"* %s (%s) has joined %s.",user, host, channel);
- SendClientMessageToAll(green, msg);
- }
- else {
- return 1;
- }
- return 1;
- }
- public IRC_OnUserLeaveChannel(botid, channel[], user[], host[], message[])
- {
- if(strlen(message) != 0 && botid == EchoConnection[0] && strcmp(channel,EchoChan, true) == 0) {
- if(strcmp(IrcToServer,"admin", true) == 0) {
- new msg[256];
- format(msg,256,"* %s (%s) has left %s. (%s)",user, host, channel, message);
- MsgToTheAdmin(msg);
- }
- else if(strcmp(IrcToServer,"all", true) == 0) {
- new msg[256];
- format(msg,256,"* %s (%s) has left %s. (%s)",user, host, channel, message);
- SendClientMessageToAll(green, msg);
- }
- else {
- return 1;
- }
- }
- else if(strlen(message) == 0 && botid == EchoConnection[0] && strcmp(channel,EchoChan, true) == 0) {
- if(strcmp(IrcToServer,"admin", true) == 0) {
- new msg[256];
- format(msg,256,"* %s (%s) has left %s.",user, host, channel);
- MsgToTheAdmin(msg);
- }
- else if(strcmp(IrcToServer,"all", true) == 0) {
- new msg[256];
- format(msg,256,"* %s (%s) has left %s.",user, host, channel);
- SendClientMessageToAll(green, msg);
- }
- else {
- return 1;
- }
- }
- else {
- return 1;
- }
- return 1;
- }
- public IRC_OnUserDisconnect(botid, user[], host[], message[])
- {
- if(strlen(message) != 0 && botid == EchoConnection[0]) {
- if(strcmp(IrcToServer,"admin", true) == 0) {
- new msg[256];
- format(msg,256,"* %s (%s) has quit. (%s)",user, host, message);
- MsgToTheAdmin(msg);
- }
- else if(strcmp(IrcToServer,"all", true) == 0) {
- new msg[256];
- format(msg,256,"* %s (%s) has quit. (%s)",user, host, message);
- SendClientMessageToAll(green, msg);
- }
- else {
- return 1;
- }
- }
- else if(strlen(message) == 0 && botid == EchoConnection[0]) {
- if(strcmp(IrcToServer,"admin", true) == 0) {
- new msg[256];
- format(msg,256,"* %s (%s) has quit.",user, host);
- MsgToTheAdmin(msg);
- }
- else if(strcmp(IrcToServer,"all", true) == 0) {
- new msg[256];
- format(msg,256,"* %s (%s) has quit.",user, host);
- SendClientMessageToAll(green, msg);
- }
- else {
- return 1;
- }
- }
- else {
- return 1;
- }
- return 1;
- }
- public IRC_OnUserNickChange(botid, oldnick[], newnick[], host[])
- {
- if(strcmp(IrcToServer,"admin", true) == 0 && botid == EchoConnection[0]) {
- new msg[256];
- format(msg,256,"* %s is now known as %s.",oldnick, newnick);
- MsgToTheAdmin(msg);
- }
- else if(strcmp(IrcToServer,"all", true) == 0 && botid == EchoConnection[0]) {
- new msg[256];
- format(msg,256,"* %s is now known as %s.",oldnick, newnick);
- SendClientMessageToAll(green, msg);
- }
- else {
- return 1;
- }
- return 1;
- }
- public IRC_OnUserSay(botid, recipient[], user[], host[], message[])
- {
- new GetEchoBotConnection = botid;
- if(GetEchoBotConnection == EchoConnection[0]) {
- if ((message[0] != '!')) return 1;
- new space = (strfind(message, " "));
- new cmdlen;
- if (space>=1) {
- new lenmsg = strlen(message);
- cmdlen = ((lenmsg-(lenmsg-space))-1);
- }
- else {
- cmdlen = (strlen(message)-1);
- }
- if (cmdlen == 2) {
- irccmd(me,2,botid,recipient,user,message);
- irccmd(pm,2,botid,recipient,user,message);
- irccmd(ip,2,botid,recipient,user,message);
- }
- else if (cmdlen == 3) {
- irccmd(raw,3,botid,recipient,user,message);
- irccmd(say,3,botid,recipient,user,message);
- irccmd(ban,3,botid,recipient,user,message);
- irccmd(ann,3,botid,recipient,user,message);
- irccmd(car,3,botid,recipient,user,message);
- irccmd(irc,3,botid,recipient,user,message);
- irccmd(xyz,3,botid,recipient,user,message);
- irccmd(gmx,3,botid,recipient,user,message);
- irccmd(loc,3,botid,recipient,user,message);
- }
- else if (cmdlen == 4) {
- irccmd(kick,4,botid,recipient,user,message);
- irccmd(kill,4,botid,recipient,user,message);
- irccmd(time,4,botid,recipient,user,message);
- irccmd(jail,4,botid,recipient,user,message);
- irccmd(name,4,botid,recipient,user,message);
- irccmd(slap,4,botid,recipient,user,message);
- irccmd(mute,4,botid,recipient,user,message);
- }
- else if (cmdlen == 5) {
- irccmd(score,5,botid,recipient,user,message);
- irccmd(money,5,botid,recipient,user,message);
- irccmd(getid,5,botid,recipient,user,message);
- irccmd(eject,5,botid,recipient,user,message);
- irccmd(banip,5,botid,recipient,user,message);
- irccmd(unban,5,botid,recipient,user,message);
- }
- else if (cmdlen == 6) {
- irccmd(addbot,6,botid,recipient,user,message);
- irccmd(rembot,6,botid,recipient,user,message);
- irccmd(ircraw,6,botid,recipient,user,message);
- irccmd(annall,6,botid,recipient,user,message);
- irccmd(health,6,botid,recipient,user,message);
- irccmd(armour,6,botid,recipient,user,message);
- irccmd(freeze,6,botid,recipient,user,message);
- irccmd(unmute,6,botid,recipient,user,message);
- irccmd(disarm,6,botid,recipient,user,message);
- irccmd(unjail,6,botid,recipient,user,message);
- irccmd(admins,6,botid,recipient,user,message);
- irccmd(script,6,botid,recipient,user,message);
- irccmd(upheal,6,botid,recipient,user,message);
- }
- else if (cmdlen == 7) {
- irccmd(players,7,botid,recipient,user,message);
- irccmd(fakemsg,7,botid,recipient,user,message);
- irccmd(settime,7,botid,recipient,user,message);
- irccmd(weather,7,botid,recipient,user,message);
- irccmd(setname,7,botid,recipient,user,message);
- irccmd(setskin,7,botid,recipient,user,message);
- }
- else if (cmdlen == 8) {
- irccmd(tempjail,8,botid,recipient,user,message);
- irccmd(unfreeze,8,botid,recipient,user,message);
- }
- else if (cmdlen == 9) {
- irccmd(setarmour,9,botid,recipient,user,message);
- irccmd(sethealth,9,botid,recipient,user,message);
- irccmd(givemoney,9,botid,recipient,user,message);
- }
- else if (cmdlen == 10) {
- irccmd(giveweapon,10,botid,recipient,user,message);
- irccmd(resetmoney,10,botid,recipient,user,message);
- }
- }
- return 1;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- if(strlen(AdminChan) != 0) {
- new Float:X, Float:Y, Float:Z, lolz1[256], lolz2[50];
- new currentzonename[256];
- if(ispassenger == 0) {
- format(lolz2,50,"driver");
- }
- else {
- format(lolz2,50,"passenger");
- }
- GetPlayerPos(playerid,X,Y,Z);
- currentzonename = GetXYZZoneName(X,Y,Z);
- 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);
- IRC_GroupSay(GroupID[1], AdminChan, lolz1);
- }
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- if(strlen(AdminChan) != 0) {
- new Float:X, Float:Y, Float:Z, lolz1[256];
- new currentzonename[256];
- GetPlayerPos(playerid,X,Y,Z);
- currentzonename = GetXYZZoneName(X,Y,Z);
- 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);
- IRC_GroupSay(GroupID[1], AdminChan, lolz1);
- }
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- if(strlen(AdminChan)) {
- new lolz1[256];
- 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);
- IRC_GroupSay(GroupID[1],AdminChan,lolz1);
- }
- return 1;
- }
- irccmd_me(conn, channel[], user[], params[])
- {
- new lolz1[256], lolz2[256];
- if(!strlen(params)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !me <message>");
- format(lolz1,sizeof(lolz1), "*** %s %s", user, params);
- SendClientMessageToAll(red, lolz1);
- format(lolz2,sizeof(lolz2),"4*** %s %s", user, params);
- IRC_GroupSay(GroupID[0], channel, lolz2);
- #pragma unused conn
- return true;
- }
- irccmd_pm(conn, channel[], user[], params[])
- {
- new giveid,msg[256],lolz1[256], lolz2[256], pon[100];
- if(sscanf(params,"ss",pon,msg)) return IRC_GroupSay(GroupID[0], channel,"3Usage:1 !pm <PartOfName/PlayerID> <Message>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0], channel,"4*** Error: Invalid player ID.");
- format(lolz1,256, "*** Pm from %s (IRC): %s",user, msg);
- format(lolz2,256, "5*** Pm to %s (ID:%d):1 %s",PlayerName(giveid),giveid,msg);
- SendClientMessage(giveid,green,lolz1);
- IRC_GroupSay(GroupID[0], channel, lolz2);
- #pragma unused conn
- return true;
- }
- irccmd_ip(conn, channel[], user[], params[])
- {
- new giveid, lolz1[256], Ip[256], pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0], channel,"3Usage:1 !ip <PartOfName/PlayerID>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0], channel,"4*** Error: Invalid player ID.");
- GetPlayerIp(giveid, Ip, 256);
- format(lolz1,256,"3* IP from %s (ID:%d):1 %s.",PlayerName(giveid),giveid,Ip);
- IRC_GroupNotice(GroupID[1],user,lolz1);
- #pragma unused conn
- return true;
- }
- irccmd_raw(conn, channel[], user[], params[])
- {
- new lolz1[256];
- if(!IsPlayerSop(conn,channel,user)) return AccessDenied(user);
- if(!strlen(params)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !raw <Command>");
- format(lolz1,256,"3*** Raw Command:1 %s",params);
- IRC_GroupSay(GroupID[0], channel, lolz1);
- SendRconCommand(params);
- #pragma unused conn, user
- return true;
- }
- irccmd_say(conn, channel[], user[], params[])
- {
- if(!strlen(params)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !say <Message>");
- new lolz1[256], lolz2[256];
- if(IsPlayerOwner(conn,channel,user)) {
- format(lolz1,256,"* Admin %s on irc: %s",user,params);
- SendClientMessageToAll(orange, lolz1);
- format(lolz2,256,"2* Admin %s on irc:1 %s",user,params);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- return true;
- }
- else if(IsPlayerSop(conn,channel,user)) {
- format(lolz1,256,"* Admin %s on irc: %s",user,params);
- SendClientMessageToAll(orange, lolz1);
- format(lolz2,256,"2* Admin %s on irc:1 %s",user,params);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- return true;
- }
- else if(IsPlayerOp(conn,channel,user)) {
- format(lolz1,256,"* Admin %s on irc: %s",user,params);
- SendClientMessageToAll(orange, lolz1);
- format(lolz2,256,"2* Admin %s on irc:1 %s",user,params);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- return true;
- }
- else if(IsPlayerHop(conn,channel,user)) {
- format(lolz1,256,"* Mod %s on irc: %s",user,params);
- SendClientMessageToAll(orange, lolz1);
- format(lolz2,256,"2* Mod %s on irc:1 %s",user,params);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- return true;
- }
- else if(IsPlayerVoi(conn,channel,user)) {
- format(lolz1,256,"* Guest %s on irc: %s",user,params);
- SendClientMessageToAll(orange, lolz1);
- format(lolz2,256,"2* Guest %s on irc:1 %s",user,params);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- return true;
- }
- format(lolz1,256,"* Guest %s on irc: %s",user,params);
- SendClientMessageToAll(orange, lolz1);
- format(lolz2,256,"2* Guest %s on irc:1 %s",user,params);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- #pragma unused conn
- return true;
- }
- irccmd_ban(conn, channel[], user[], params[])
- {
- new giveid,msg[255],sayban[255], bansay[256], pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params, "sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !ban <PartOfName/PlayerID> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
- format(sayban,sizeof(sayban),"*** Admin %s (IRC) banned player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- format(bansay,sizeof(bansay),"4*** Admin %s (IRC) banned player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- SendClientMessageToAll(red,sayban);
- IRC_GroupSay(GroupID[0],channel,bansay);
- BanEx(giveid,msg);
- #pragma unused conn
- return true;
- }
- irccmd_ann(conn, channel[], user[], params[])
- {
- new imsg[256],giveid,ponoid[100],lolz1[256],lolz2[256];
- if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"ss",ponoid,imsg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !ann <PartOfName/PlayerID> <Message>");
- giveid = ReturnUser(ponoid);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- format(lolz1,256,"3*** Announce from %s to %s (ID:%d):1 %s",user,PlayerName(giveid),giveid,imsg);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- format(lolz2,256,"~w~%s",imsg);
- GameTextForPlayer(giveid,lolz2,5000,3);
- #pragma unused conn
- return true;
- }
- irccmd_car(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],pon[100];
- if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !car <PartOfName/PlayerID>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- if(!IsPlayerInAnyVehicle(giveid)) {
- format(lolz1,256,"4*** Error: %s is currently on foot,",PlayerName(giveid));
- IRC_GroupSay(GroupID[0],channel,lolz1);
- }
- if(IsPlayerInAnyVehicle(giveid)) {
- new Float:VHealth, carid = GetPlayerVehicleID(giveid); GetVehicleHealth(carid,VHealth);
- 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));
- IRC_GroupSay(GroupID[0],channel,lolz1);
- }
- #pragma unused conn, user
- return true;
- }
- irccmd_irc(conn, channel[], user[], params[])
- {
- new lolz1[256], lolz2[256];
- format(lolz1,256,"3*** IRC Server: %s:%d - Channel: %s",IrcServer,IrcPort,EchoChan);
- format(lolz2,256,"*** IRC Server: %s:%d - Channel: %s",IrcServer,IrcPort,EchoChan);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(green,lolz2);
- #pragma unused params,user,conn
- return true;
- }
- irccmd_xyz(conn, channel[], user[], params[])
- {
- new giveid, lolz1[256], pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if (sscanf(params, "s", pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !xyz <PartOfName/PlayerID>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(giveid,X,Y,Z);
- 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);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- #pragma unused conn, user
- return true;
- }
- irccmd_gmx(conn, channel[], user[], params[])
- {
- new lolz1[256];
- if(!IsPlayerSop(conn,channel,user)) return AccessDenied(user);
- format(lolz1,256,"4*** Restarted the gamemode.");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendRconCommand("gmx");
- #pragma unused conn,params
- return true;
- }
- irccmd_loc(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],pon[100];
- if (sscanf(params,"s", pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !loc <PartOfName/PlayerID>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- new currentzonename[256];
- new Float:X,Float:Y,Float:Z;
- GetPlayerPos(giveid,X,Y,Z);
- currentzonename = GetXYZZoneName(X,Y,Z);
- format(lolz1,256,"3* Location from %s (ID:%d): 1%s",PlayerName(giveid),giveid,currentzonename);
- format(lolz2,256,"* Location from %s (ID:%d): %s",PlayerName(giveid),giveid,currentzonename);
- SendClientMessageToAll(orange,lolz2);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- #pragma unused conn, user
- return true;
- }
- irccmd_kick(conn, channel[], user[], params[])
- {
- new giveid,msg[255],saykick[255],kicksay[256],pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params, "sz", pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !kick <PartOfName/PlayerID> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
- format(saykick,sizeof(saykick),"*** Admin %s (IRC) kicked player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- format(kicksay,sizeof(kicksay),"4*** Admin %s (IRC) kicked player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- SendClientMessageToAll(red,saykick);
- IRC_GroupSay(GroupID[0],channel,kicksay);
- Kick(giveid);
- #pragma unused conn
- return true;
- }
- irccmd_kill(conn, channel[], user[], params[])
- {
- new giveid,msg[255],lolz1[255],lolz2[256],pon[100];
- if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !kill <PartOfName/PlayerID> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
- SetPlayerHealth(giveid,0);
- SetPlayerArmour(giveid,0);
- format(lolz1,sizeof(lolz1),"*** Admin %s (IRC) killed player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- format(lolz2,sizeof(lolz2),"4*** Admin %s (IRC) killed player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- SendClientMessageToAll(red,lolz1);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- #pragma unused conn
- return true;
- }
- irccmd_time(conn, channel[], user[], params[])
- {
- new lolz1[256],lolz2[256],hour,minute,second,year,month,day;
- gettime(hour,minute,second);
- getdate(year,month,day);
- format(lolz1,256,"3*** Day: %02d/%02d/%02d Hour: %02d:%02d:%02d",day,month,year,hour,minute,second);
- format(lolz2,256,"*** Day: %02d/%02d/%02d Hour: %02d:%02d:%02d",day,month,year,hour,minute,second);
- SendClientMessageToAll(green,lolz2);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- #pragma unused conn,params,user
- return true;
- }
- irccmd_jail(conn, channel[], user[], params[])
- {
- new giveid,msg[255],lolz1[255],lolz2[256],pon[100];
- if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !jail <PartOfName/PlayerID> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(IsPlayerJailed[giveid]) return IRC_GroupSay(GroupID[0],channel,"4*** Error: The selected ID is already Jailed.");
- if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
- SetPlayerInterior(giveid,6);
- SetPlayerPos(giveid,264.785200,77.564040,1001.039000);
- format(lolz1,sizeof(lolz1),"*** Admin %s (IRC) jailed player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- format(lolz2,sizeof(lolz2),"4*** Admin %s (IRC) jailed player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- SendClientMessageToAll(red,lolz1);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- IsPlayerJailed[giveid] = true;
- #pragma unused conn
- return true;
- }
- irccmd_name(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256];
- if(sscanf(params,"d",giveid)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !name <PlayerID>");
- if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
- format(lolz1,256,"7*** ID: %d is %s.",giveid,PlayerName(giveid));
- IRC_GroupSay(GroupID[0],channel,lolz1);
- #pragma unused conn,user
- return true;
- }
- irccmd_slap(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],msg[256],pon[100];
- if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !slap <PartOfName/PlayerID> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- new Float:slx, Float:sly, Float:slz;
- new Float:shealth;
- GetPlayerHealth(giveid, shealth);
- SetPlayerHealth(giveid, shealth-15);
- GetPlayerPos(giveid, slx, sly, slz);
- SetPlayerPos(giveid, slx+5, sly, slz);
- format(lolz1,256,"4*** Admin %s (IRC) slaps player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- format(lolz2,256,"*** Admin %s (IRC) slaps player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- #pragma unused conn
- return true;
- }
- irccmd_mute(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],msg[256],pon[100];
- if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !mute <PartOfName/PlayerID> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- if(IsPlayerMuted[giveid]) return IRC_GroupSay(GroupID[0],channel,"4*** Error: The selected id is already muted.");
- format(lolz1,256,"3*** Admin %s (IRC) i silence the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- format(lolz2,256,"*** Admin %s (IRC) i silence the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- IsPlayerMuted[giveid] = true;
- #pragma unused conn, user
- return true;
- }
- irccmd_score(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],pon[100];
- if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !score <PartOfName/PlayerID>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- format(lolz1,256,"3* Score from %s (ID:%d):1 %d",PlayerName(giveid),giveid,GetPlayerScore(giveid));
- format(lolz2,256,"* Score from %s (ID:%d): %d",PlayerName(giveid),giveid,GetPlayerScore(giveid));
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(green,lolz2);
- #pragma unused conn, user
- return true;
- }
- irccmd_money(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],pon[100];
- if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !money <PartOfName/PlayerID>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- format(lolz1,256,"3* Money from %s (ID:%d):1 $%d",PlayerName(giveid),giveid,GetPlayerMoney(giveid));
- format(lolz2,256,"* Money from %s (ID:%d): $%d",PlayerName(giveid),giveid,GetPlayerMoney(giveid));
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(green,lolz2);
- #pragma unused conn, user
- return true;
- }
- irccmd_getid(conn, channel[], user[], params[])
- {
- new GetPlayer[256],giveid,lolz1[256],lolz2[256];
- if(sscanf(params,"s",GetPlayer)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !getid <PartOfName>");
- for (giveid=0; giveid<=MAX_PLAYERS; giveid++) {
- if (IsPlayerConnected(giveid)) {
- GetPlayerName(giveid,GetPlayer,16);
- new space = (strfind(GetPlayer, params));
- if (space != -1) {
- format(lolz1, sizeof(lolz1), "3*** Player whose name is %s has the ID: %d", GetPlayer, giveid);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- return true;
- }
- }
- }
- format(lolz2, sizeof(lolz2),"4*** Error: Invalid Name", params[0]);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- #pragma unused conn,user
- return true;
- }
- irccmd_eject(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],msg[256],pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !eject <PartOfName/PlayerID> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- if(!IsPlayerInAnyVehicle(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: The selected id is not in a vehicle.");
- 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");
- 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");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- RemovePlayerFromVehicle(giveid);
- #pragma unused conn
- return true;
- }
- irccmd_banip(conn, channel[], user[], params[])
- {
- new giveip[256],lolz1[256],lolz2[256],lolz3[256],msg[256];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sz",giveip,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !banip <Ip> <Reason [Optional]>");
- format(lolz1,256,"4*** Admin %s (IRC) banned the ip %s , Reason: %s.",user,giveip,msg[0] ? msg: "None");
- format(lolz2,256,"*** Admin %s (IRC) banned the ip %s , Reason: %s.",user,giveip,msg[0] ? msg: "None");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- format(lolz3,256,"banip %s",giveip);
- SendRconCommand(lolz3);
- #pragma unused conn
- return true;
- }
- irccmd_unban(conn, channel[], user[], params[])
- {
- new giveip[256],msg[256],lolz1[256],lolz2[256],lolz3[256];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sz",giveip,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !unban <Ip> <Reason [Optional]>");
- if(!IsStringIP(giveip)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Thats not an IP!");
- format(lolz1,256,"3*** Admin %s (IRC) unbanned the ip %s , Reason: %s.",user,giveip,msg[0] ? msg: "None");
- format(lolz2,256,"*** Admin %s (IRC) unbanned the ip %s , Reason: %s.",user,giveip,msg[0] ? msg: "None");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- format(lolz3,256,"unbanip %s",giveip);
- SendRconCommand(lolz3);
- SendRconCommand("reloadbans");
- #pragma unused conn
- return true;
- }
- irccmd_health(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],pon[100];
- if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !health <PartOfName/PlayerID>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- new Float:Health;
- GetPlayerHealth(giveid,Health);
- format(lolz1,256,"3* Health from %s (ID:%d):1 %.0f",PlayerName(giveid),giveid,Health);
- format(lolz2,256,"* Health from %s (ID:%d): %.0f",PlayerName(giveid),giveid,Health);
- SendClientMessageToAll(green,lolz2);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- #pragma unused conn, user
- return true;
- }
- irccmd_armour(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],pon[100];
- if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !armour <PartOfName/PlayerID>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- new Float:Armour;
- GetPlayerHealth(giveid,Armour);
- format(lolz1,256,"3* Armour from %s (ID:%d):1 %.0f",PlayerName(giveid),giveid,Armour);
- format(lolz2,256,"* Armour from %s (ID:%d): %.0f",PlayerName(giveid),giveid,Armour);
- SendClientMessageToAll(green,lolz2);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- #pragma unused conn, user
- return true;
- }
- irccmd_unmute(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],pon[100];
- if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !unmute <PartOfName/PlayerID>");
- giveid = ReturnUser(pon);
- if(!IsPlayerMuted[giveid]) return IRC_GroupSay(GroupID[0],channel,"4*** Error: The selected ID is not muted.");
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- format(lolz1,256,"*** Admin %s (IRC) take out the silence to the player %s (ID:%d).",user,PlayerName(giveid),giveid);
- format(lolz2,256,"4*** Admin %s (IRC) take out the silence to the player %s (ID:%d).",user,PlayerName(giveid),giveid);
- SendClientMessageToAll(red,lolz1);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- IsPlayerMuted[giveid] = false;
- #pragma unused conn
- return true;
- }
- irccmd_freeze(conn, channel[], user[], params[])
- {
- new giveid,msg[256],lolz1[256],lolz2[256],pon[100];
- if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !freeze <PartOfName/PlayerID> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- format(lolz1,256,"4*** Admin %s (IRC) freeze the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- format(lolz2,256,"*** Admin %s (IRC) freeze the player %s (ID:%d), Reason: %s.",user,PlayerName(giveid),giveid,msg[0] ? msg: "None");
- SendClientMessageToAll(red,lolz2);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- TogglePlayerControllable(giveid,0);
- #pragma unused conn
- return true;
- }
- irccmd_disarm(conn, channel[], user[], params[])
- {
- new giveid;
- new lolz1[256];
- new lolz2[256];
- new msg[256];
- new pon[100];
- if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !disarm <PartOfName/PlayerID> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- 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");
- 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");
- SendClientMessageToAll(red, lolz1);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- ResetPlayerWeapons(giveid);
- #pragma unused conn
- return true;
- }
- irccmd_unjail(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],pon[100];
- if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !unjail <PartOfName/PlayerID>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- if(!IsPlayerJailed[giveid]) return IRC_GroupSay(GroupID[0],channel,"4*** Error: The selected ID is not jailed.");
- SetPlayerInterior(giveid,6);
- SetPlayerPos(giveid,267.785200,77.564040,1001.039000);
- format(lolz1,256,"4*** Admin %s (IRC) unjailed the player %s (ID:%d).",user,PlayerName(giveid),giveid);
- format(lolz2,256,"*** Admin %s (IRC) unjailed the player %s (ID:%d).",user,PlayerName(giveid),giveid);
- SendClientMessageToAll(red,lolz2);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- IsPlayerJailed[giveid] = false;
- #pragma unused conn, user
- return true;
- }
- irccmd_script(conn, channel[], user[], params[])
- {
- new lolz1[256],lolz2[256];
- format(lolz1,256,"3*** IRC Administrator v1.1 by PlayerX ");
- format(lolz2,256,"*** IRC Administrator v1.1 by PlayerX");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(green,lolz2);
- #pragma unused params,user,conn
- return true;
- }
- irccmd_upheal(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],msg[256],pon[100];
- if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !upheal <PartOfName/PlayerID> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- SetPlayerHealth(giveid,100);
- SetPlayerArmour(giveid,100);
- 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");
- 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");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- #pragma unused conn, user
- return true;
- }
- irccmd_admins(conn, channel[], user[], params[])
- {
- new count,lolz1[200];
- for (new giveid; giveid != GetMaxPlayers(); giveid ++) {
- if (!IsPlayerConnected(giveid)) continue;
- if (IsPlayerAdmin(giveid)) {
- if (count == 0) IRC_GroupSay(GroupID[0],channel,"3*** Rcon Administrators Online:1");
- GetPlayerName(giveid,lolz1,32);
- format(lolz1,200,"[%d] %s",giveid,lolz1);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- count++;
- }
- }
- if (count == 0) return IRC_GroupSay(GroupID[0],channel,"4*** There are no rcon admins connected.");
- #pragma unused params,user,conn
- return true;
- }
- irccmd_annall(conn, channel[], user[], params[])
- {
- new imsg[256], lolz1[256], lolz2[256];
- if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"s",imsg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !annall <Message>");
- format(lolz1,256,"3*** Announce from %s to ALL:1 %s",user,imsg);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- format(lolz2,256,"~w~%s",imsg);
- GameTextForAll(lolz2,5000,3);
- #pragma unused conn
- return true;
- }
- irccmd_addbot(conn, channel[], user[], params[])
- {
- new name[30];
- new lolz1[256];
- if(sscanf(params,"s",name)) {
- format(lolz1, 256, "3Usage:1 !addbot <BotName> // Connections remaining: %d",4-Total);
- IRC_GroupSay(GroupID[0], channel, lolz1);
- return true;
- }
- if(strlen(BotName2) == 0) {
- BotName2 = name;
- Delay = 1000;
- IABot2();
- format(lolz1,256,"3* %s in creating... Bots remaining: 2",name);
- IRC_GroupSay(GroupID[0], channel, lolz1);
- Total++;
- return true;
- }
- else if(strlen(BotName3) == 0) {
- BotName3 = name;
- Delay = 1000;
- IABot3();
- format(lolz1,256,"3* %s in creating... Bots remaining: 1",name);
- IRC_GroupSay(GroupID[0], channel, lolz1);
- Total++;
- return true;
- }
- else if(strlen(BotName4) == 0) {
- BotName4 = name;
- Delay = 1000;
- IABot4();
- format(lolz1,256,"3* %s in creating... You cannot create any more bots.",name);
- IRC_GroupSay(GroupID[0], channel, lolz1);
- Total++;
- return true;
- }
- else {
- IRC_GroupSay(GroupID[0], channel, "4*** Error: You cannot create any more bots.");
- return true;
- }
- #pragma unused conn, user
- }
- irccmd_rembot(conn, channel[], user[], params[])
- {
- new name[30];
- //new lolz1[256];//, lolz2[256];
- if(sscanf(params,"s",name)) return IRC_GroupSay(GroupID[0], channel, "3Usage:1 !rembot <BotName>");
- if(strlen(BotName2) != 0 && strcmp(name,BotName2, true) == 0) {
- BotName2 = "";
- IRC_RemoveFromGroup(GroupID[0],EchoConnection[1]);
- IRC_RemoveFromGroup(GroupID[1],EchoConnection[1]);
- IRC_Quit(EchoConnection[1],QuitMsg);
- EchoConnection[1] = false;
- Total--;
- return true;
- }
- else if(strlen(BotName3) != 0 && strcmp(name,BotName3, true) == 0) {
- BotName3 = "";
- IRC_RemoveFromGroup(GroupID[0],EchoConnection[2]);
- IRC_RemoveFromGroup(GroupID[1],EchoConnection[2]);
- IRC_Quit(EchoConnection[2],QuitMsg);
- EchoConnection[2] = false;
- Total--;
- return true;
- }
- else if(strlen(BotName4) != 0 && strcmp(name,BotName4, true) == 0) {
- BotName4 = "";
- IRC_RemoveFromGroup(GroupID[0],EchoConnection[3]);
- IRC_RemoveFromGroup(GroupID[1],EchoConnection[3]);
- IRC_Quit(EchoConnection[3],QuitMsg);
- EchoConnection[3] = false;
- Total--;
- return true;
- }
- else {
- IRC_GroupSay(GroupID[0], channel, "4*** Error: Max connections.");
- return true;
- }
- #pragma unused conn, user
- }
- irccmd_ircraw(conn, channel[], user[], params[])
- {
- new id;
- new lolz1[256],iparams[256];
- if(sscanf(params,"ds",id,iparams)) return IRC_GroupSay(GroupID[0], channel, "3Usage:1 !ircraw <BotID> <Params>");
- if(id < 1 || id > Total) return IRC_GroupSay(GroupID[0], channel, "4*** Error: invalid botid.");
- if(strlen(BotName1) != 0 && id == 1) {
- format(lolz1,256,"3** RAW command for IRC:1 %s", iparams);
- IRC_Say(EchoConnection[0], channel, lolz1);
- IRC_SendRaw(EchoConnection[0],iparams);
- }
- else if(strlen(BotName2) != 0 && id == 2) {
- format(lolz1,256,"3** RAW command for IRC:1 %s", iparams);
- IRC_Say(EchoConnection[1], channel, lolz1);
- IRC_SendRaw(EchoConnection[1],iparams);
- }
- else if(strlen(BotName3) != 0 && id == 3) {
- format(lolz1,256,"3** RAW command for IRC:1 %s", iparams);
- IRC_Say(EchoConnection[2], channel, lolz1);
- IRC_SendRaw(EchoConnection[2],iparams);
- }
- else if(strlen(BotName4) != 0 && id == 4) {
- format(lolz1,256,"3** RAW command for IRC:1 %s", iparams);
- IRC_Say(EchoConnection[3], channel, lolz1);
- IRC_SendRaw(EchoConnection[3],iparams);
- }
- else {
- IRC_GroupSay(GroupID[0], channel, "4*** Error: invalid botid.");
- }
- #pragma unused conn, user
- return true;
- }
- irccmd_players(conn, channel[], user[], params[])
- {
- new count1;
- new count2;
- new PlayerNames[512];
- new NPC[512];
- for(new i=0; i<=MAX_PLAYERS; i++) {
- if(IsPlayerConnected(i) && IsPlayerNPC(i) == 0) {
- if(count1 == 0) {
- new PlayerName1[MAX_PLAYER_NAME];
- GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
- format(PlayerNames, sizeof(PlayerNames),"[%d] %s",i,PlayerName1);
- count1++;
- }
- else {
- new PlayerName1[MAX_PLAYER_NAME];
- GetPlayerName(i, PlayerName1, sizeof(PlayerName1));
- format(PlayerNames, sizeof(PlayerNames),"%s, [%d] %s",PlayerNames,i,PlayerName1);
- count1++;
- }
- }
- else { if(count1 == 0) format(PlayerNames, sizeof(PlayerNames),"No Players Online"); }
- if(IsPlayerNPC(i) && IsPlayerNPC(i) == 1) {
- if(count2 == 0) {
- new NPC1[MAX_PLAYER_NAME];
- GetPlayerName(i, NPC1, sizeof(NPC1));
- format(NPC, sizeof(NPC),"[%d] %s",i,NPC1);
- count2++;
- }
- else {
- new NPC1[MAX_PLAYER_NAME];
- GetPlayerName(i, NPC1, sizeof(NPC1));
- format(NPC, sizeof(NPC),"%s, [%d] %s",NPC,i,NPC1);
- count2++;
- }
- }
- else { if(count2 == 0) format(NPC, sizeof(NPC),"No NPC Online"); }
- }
- new counter1 = 0;
- new counter2 = 0;
- new lolz1[512],lolz2[512];
- new players = GetMaxPlayers();
- for(new i=0; i<=MAX_PLAYERS; i++) {
- if(IsPlayerNPC(i)) counter2++;
- else if(IsPlayerConnected(i)) counter1++;
- }
- format(lolz1,256,"3*** Players Online [%d/%d]:1 %s",counter1,players - counter2,PlayerNames);
- format(lolz2,256,"3*** NPC Online [%d/%d]:1 %s",counter2,players - counter2,NPC);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- #pragma unused params,user,conn
- return true;
- }
- irccmd_fakemsg(conn, channel[], user[], params[])
- {
- new giveid,msg[256],lolz1[256],pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"ss",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !fakemsg <PartOfName/PlayerID> <Message>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- format(lolz1,256,"2** 4[%i]3 %s:1 %s",giveid,PlayerName(giveid),msg);
- SendPlayerMessageToAll(giveid,msg);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- #pragma unused user,conn
- return true;
- }
- irccmd_settime(conn, channel[], user[], params[])
- {
- new hours,minutes,lolz1[256],lolz2[256];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"dd",hours,minutes))return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !settime <Hour> <Minutes>");
- if(hours > 23 || hours < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Hours.");
- if(minutes > 59 || minutes < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Minutes.");
- format(lolz1,256,"4*** Admin %s (IRC) change the time to all to: %02d:%02d.",user,hours,minutes);
- format(lolz2,256,"*** Admin %s (IRC) change the time to all to: %02d:%02d.",user,hours,minutes);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- for(new giveid=0; giveid<=MAX_PLAYERS; giveid++) {
- SetPlayerTime(giveid,hours,minutes);
- }
- #pragma unused conn
- return true;
- }
- irccmd_weather(conn, channel[], user[], params[])
- {
- new weatherid,lolz1[256],lolz2[256];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"d",weatherid)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !weather <WeatherID>");
- if(weatherid > 40 || weatherid < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Weather id.");
- format(lolz1,256,"4***Admin %s (IRC) change the weather to: %d.",user,weatherid);
- format(lolz2,256,"*** Admin %s (IRC) change the weather to: %d.",user,weatherid);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- SetWeather(weatherid);
- #pragma unused conn,user
- return true;
- }
- irccmd_setname(conn, channel[], user[], params[])
- {
- new giveid,newnick[256],lolz1[256],lolz2[256],pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"ss",pon,newnick)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !setname <PartOfName/PlayerID> <New Name>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- format(lolz1,256,"4*** Admin %s (IRC) change the player's name %s (ID:%d) to: %s.",user,PlayerName(giveid),giveid,newnick);
- format(lolz2,256,"*** Admin %s (IRC) change the player's name %s (ID:%d) to: %s.",user,PlayerName(giveid),giveid,newnick);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- SetPlayerName(giveid,newnick);
- #pragma unused conn
- return true;
- }
- irccmd_setskin(conn, channel[], user[], params[])
- {
- new newskin,giveid,lolz1[256],lolz2[256],pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sd",pon,newskin))return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !setskin <PartOfName/PlayerID> <New Skin>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
- if(!IsValidSkin(newskin)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid skin ID.");
- SetPlayerSkin(giveid,newskin);
- format(lolz1,256,"4*** Admin %s (IRC) change the player's skin %s (ID:%d), Skin id: %d.",user,PlayerName(giveid),giveid,newskin);
- format(lolz2,256,"*** Admin %s (IRC) change the player's skin %s (ID:%d), Skin id: %d.",user,PlayerName(giveid),giveid,newskin);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- #pragma unused conn
- return true;
- }
- irccmd_unfreeze(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],pon[100];
- if(!IsPlayerHop(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"s",pon)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !unfreeze <PartOfName/PlayerID>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid player ID.");
- format(lolz1,256,"4*** Admin %s (IRC) unfreeze the player %s (ID:%d).",user,PlayerName(giveid),giveid);
- format(lolz2,256,"*** Admin %s (IRC) unfreeze the player %s (ID:%d).",user,PlayerName(giveid),giveid);
- SendClientMessageToAll(red,lolz2);
- IRC_GroupSay(GroupID[0],channel,lolz1);
- TogglePlayerControllable(giveid,1);
- #pragma unused conn
- return true;
- }
- irccmd_tempjail(conn, channel[], user[], params[])
- {
- new giveid,lolz1[256],lolz2[256],msg[256],timejail,pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sdz",pon,timejail,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !tempjail <PartOfName/PlayerID> <Time> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(IsPlayerJailed[giveid]) return IRC_GroupSay(GroupID[0],channel,"4*** Error: already this in the jail");
- if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID");
- if(timejail >1440 || timejail <1) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Time (Max: 1440 minutes - 1 days / Min: 1 minutes)");
- SetPlayerInterior(giveid,6);
- SetPlayerPos(giveid,264.785200,77.564040,1001.039000);
- 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");
- 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");
- SetTimerEx("PlayerUnJailed",timejail*60*1000,0,"d",giveid);
- IsPlayerJailed[giveid] = true;
- SendClientMessageToAll(red,lolz1);
- IRC_GroupSay(GroupID[0],channel,lolz2);
- #pragma unused conn
- return true;
- }
- irccmd_sethealth(conn, channel[], user[], params[])
- {
- new giveid,health,msg[256],lolz1[256],lolz2[256],pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sdz",pon,health,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !sethealth <PartOfName/PlayerID> <Health> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
- if(health > 100 || health < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid health (Max: 100).");
- SetPlayerHealth(giveid,health);
- 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");
- 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");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- return true;
- }
- irccmd_setarmour(conn, channel[], user[], params[])
- {
- new giveid,armour,msg[256],lolz1[256],lolz2[256],pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sdz",pon,armour,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !setarmour <PartOfName/PlayerID> <Armour> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
- if(armour > 100 || armour < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Armour (Max: 100).");
- SetPlayerArmour(giveid,armour);
- 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");
- 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");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- return true;
- }
- irccmd_givemoney(conn, channel[], user[], params[])
- {
- new giveid,money,msg[256],lolz1[256],lolz2[256],pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sdz",pon,money,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !givemoney <PartOfName/PlayerID> <Money> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
- if(money > 5000000 || money < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Money (Max: $5000000).");
- GivePlayerMoney(giveid,money);
- 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");
- 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");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- return true;
- }
- irccmd_resetmoney(conn, channel[], user[], params[])
- {
- new giveid,msg[256],lolz1[256],lolz2[256],pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"sz",pon,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !resetmoney <PartOfName/PlayerID> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- if(!IsPlayerConnected(giveid))return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
- ResetPlayerMoney(giveid);
- 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");
- 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");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- #pragma unused conn, user
- return true;
- }
- irccmd_giveweapon(conn, channel[], user[], params[])
- {
- new ammo,giveid,weapon[256],msg[256],lolz1[256],lolz2[256],WeaponName[64],wID,pon[100];
- if(!IsPlayerOp(conn,channel,user)) return AccessDenied(user);
- if(sscanf(params,"ssdz",pon,weapon,ammo,msg)) return IRC_GroupSay(GroupID[0],channel,"3Usage:1 !giveweapon <PartOfName/PlayerID> <WeaponID> <Ammo> <Reason [Optional]>");
- giveid = ReturnUser(pon);
- wID = GetWeaponIDFromName(weapon);
- if(!IsPlayerConnected(giveid)) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Player ID.");
- if(wID > 46 || wID < 0) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Weapon ID.");
- if(ammo > 10000 || ammo < 1) return IRC_GroupSay(GroupID[0],channel,"4*** Error: Invalid Ammo. (Max: 10000)");
- GivePlayerWeapon(giveid,wID,ammo);
- GetWeaponName(wID, WeaponName, 64);
- 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");
- 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");
- IRC_GroupSay(GroupID[0],channel,lolz1);
- SendClientMessageToAll(red,lolz2);
- #pragma unused user,conn
- return true;
- }
- //=========================//
- //======== Others =========//
- //=========================//
- stock IsPlayerVoi(conn,channel[],user[])
- {
- new ircLevel[4];
- IRC_GetUserChannelMode(conn, channel, user, ircLevel);
- if(!strcmp(ircLevel, "~", true,1) || !strcmp(ircLevel, "&", true,1) || !strcmp(ircLevel, "@", true,1) || !strcmp(ircLevel, "%", true,1) || !strcmp(ircLevel, "+", true,1)) return true;
- return false;
- }
- stock IsPlayerHop(conn,channel[],user[])
- {
- new ircLevel[4];
- IRC_GetUserChannelMode(conn, channel, user, ircLevel);
- if(!strcmp(ircLevel, "~", true,1) || !strcmp(ircLevel, "&", true,1) || !strcmp(ircLevel, "@", true,1) || !strcmp(ircLevel, "%", true,1)) return true;
- return false;
- }
- stock IsPlayerOp(conn,channel[],user[])
- {
- new ircLevel[4];
- IRC_GetUserChannelMode(conn, channel, user, ircLevel);
- if(!strcmp(ircLevel, "~", true,1) || !strcmp(ircLevel, "&", true,1) || !strcmp(ircLevel, "@", true,1)) return true;
- return false;
- }
- stock IsPlayerSop(conn, channel[], user[])
- {
- new playerlevel[4];
- IRC_GetUserChannelMode(conn, channel, user, playerlevel);
- if(!strcmp(playerlevel, "~", true,1) || !strcmp(playerlevel, "&", true,1)) return true;
- return false;
- }
- stock IsPlayerOwner(conn, channel[], user[])
- {
- new playerlevel[4];
- IRC_GetUserChannelMode(conn, channel, user, playerlevel);
- if(!strcmp(playerlevel, "~", true,1)) return true;
- return false;
- }
- enum zoneinfo
- {
- zone_name[MAX_NAME],
- Float:zone_minx,
- Float:zone_miny,
- Float:zone_minz,
- Float:zone_maxx,
- Float:zone_maxy,
- Float:zone_maxz
- }
- new Float:zones[MAX_ZONES][zoneinfo] =
- {
- // Indoor zones
- { "Caligula's Palace", 2087.30, 1543.20, 900.00, 2437.30, 1703.20, 1200.90},
- { "The Four Dragons Casino", 1817.30, 863.20, 900.00, 2027.30, 1083.20, 1200.90},
- // Outdoor Zones list by mabako, from gta client files
- { "The Big Ear", -410.00, 1403.30, -3.00, -137.90, 1681.20, 200.00},
- { "Aldea Malvada", -1372.10, 2498.50, 0.00, -1277.50, 2615.30, 200.00},
- { "Angel Pine", -2324.90, -2584.20, -6.10, -1964.20, -2212.10, 200.00},
- { "Arco del Oeste", -901.10, 2221.80, 0.00, -592.00, 2571.90, 200.00},
- { "Avispa Country Club", -2646.40, -355.40, 0.00, -2270.00, -222.50, 200.00},
- { "Avispa Country Club", -2831.80, -430.20, -6.10, -2646.40, -222.50, 200.00},
- { "Avispa Country Club", -2361.50, -417.10, 0.00, -2270.00, -355.40, 200.00},
- { "Avispa Country Club", -2667.80, -302.10, -28.80, -2646.40, -262.30, 71.10},
- { "Avispa Country Club", -2470.00, -355.40, 0.00, -2270.00, -318.40, 46.10},
- { "Avispa Country Club", -2550.00, -355.40, 0.00, -2470.00, -318.40, 39.70},
- { "Back o Beyond", -1166.90, -2641.10, 0.00, -321.70, -1856.00, 200.00},
- { "Battery Point", -2741.00, 1268.40, -4.50, -2533.00, 1490.40, 200.00},
- { "Bayside", -2741.00, 2175.10, 0.00, -2353.10, 2722.70, 200.00},
- { "Bayside Marina", -2353.10, 2275.70, 0.00, -2153.10, 2475.70, 200.00},
- { "Beacon Hill", -399.60, -1075.50, -1.40, -319.00, -977.50, 198.50},
- { "Blackfield", 964.30, 1203.20, -89.00, 1197.30, 1403.20, 110.90},
- { "Blackfield", 964.30, 1403.20, -89.00, 1197.30, 1726.20, 110.90},
- { "Blackfield Chapel", 1375.60, 596.30, -89.00, 1558.00, 823.20, 110.90},
- { "Blackfield Chapel", 1325.60, 596.30, -89.00, 1375.60, 795.00, 110.90},
- { "Blackfield Intersection", 1197.30, 1044.60, -89.00, 1277.00, 1163.30, 110.90},
- { "Blackfield Intersection", 1166.50, 795.00, -89.00, 1375.60, 1044.60, 110.90},
- { "Blackfield Intersection", 1277.00, 1044.60, -89.00, 1315.30, 1087.60, 110.90},
- { "Blackfield Intersection", 1375.60, 823.20, -89.00, 1457.30, 919.40, 110.90},
- { "Blueberry", 104.50, -220.10, 2.30, 349.60, 152.20, 200.00},
- { "Blueberry", 19.60, -404.10, 3.80, 349.60, -220.10, 200.00},
- { "Blueberry Acres", -319.60, -220.10, 0.00, 104.50, 293.30, 200.00},
- { "Caligula's Palace", 2087.30, 1543.20, -89.00, 2437.30, 1703.20, 110.90},
- { "Caligula's Palace", 2137.40, 1703.20, -89.00, 2437.30, 1783.20, 110.90},
- { "Calton Heights", -2274.10, 744.10, -6.10, -1982.30, 1358.90, 200.00},
- { "Chinatown", -2274.10, 578.30, -7.60, -2078.60, 744.10, 200.00},
- { "City Hall", -2867.80, 277.40, -9.10, -2593.40, 458.40, 200.00},
- { "Come-A-Lot", 2087.30, 943.20, -89.00, 2623.10, 1203.20, 110.90},
- { "Commerce", 1323.90, -1842.20, -89.00, 1701.90, -1722.20, 110.90},
- { "Commerce", 1323.90, -1722.20, -89.00, 1440.90, -1577.50, 110.90},
- { "Commerce", 1370.80, -1577.50, -89.00, 1463.90, -1384.90, 110.90},
- { "Commerce", 1463.90, -1577.50, -89.00, 1667.90, -1430.80, 110.90},
- { "Commerce", 1583.50, -1722.20, -89.00, 1758.90, -1577.50, 110.90},
- { "Commerce", 1667.90, -1577.50, -89.00, 1812.60, -1430.80, 110.90},
- { "Conference Center", 1046.10, -1804.20, -89.00, 1323.90, -1722.20, 110.90},
- { "Conference Center", 1073.20, -1842.20, -89.00, 1323.90, -1804.20, 110.90},
- { "Cranberry Station", -2007.80, 56.30, 0.00, -1922.00, 224.70, 100.00},
- { "Creek", 2749.90, 1937.20, -89.00, 2921.60, 2669.70, 110.90},
- { "Dillimore", 580.70, -674.80, -9.50, 861.00, -404.70, 200.00},
- { "Doherty", -2270.00, -324.10, -0.00, -1794.90, -222.50, 200.00},
- { "Doherty", -2173.00, -222.50, -0.00, -1794.90, 265.20, 200.00},
- { "Downtown", -1982.30, 744.10, -6.10, -1871.70, 1274.20, 200.00},
- { "Downtown", -1871.70, 1176.40, -4.50, -1620.30, 1274.20, 200.00},
- { "Downtown", -1700.00, 744.20, -6.10, -1580.00, 1176.50, 200.00},
- { "Downtown", -1580.00, 744.20, -6.10, -1499.80, 1025.90, 200.00},
- { "Downtown", -2078.60, 578.30, -7.60, -1499.80, 744.20, 200.00},
- { "Downtown", -1993.20, 265.20, -9.10, -1794.90, 578.30, 200.00},
- { "Downtown Los Santos", 1463.90, -1430.80, -89.00, 1724.70, -1290.80, 110.90},
- { "Downtown Los Santos", 1724.70, -1430.80, -89.00, 1812.60, -1250.90, 110.90},
- { "Downtown Los Santos", 1463.90, -1290.80, -89.00, 1724.70, -1150.80, 110.90},
- { "Downtown Los Santos", 1370.80, -1384.90, -89.00, 1463.90, -1170.80, 110.90},
- { "Downtown Los Santos", 1724.70, -1250.90, -89.00, 1812.60, -1150.80, 110.90},
- { "Downtown Los Santos", 1370.80, -1170.80, -89.00, 1463.90, -1130.80, 110.90},
- { "Downtown Los Santos", 1378.30, -1130.80, -89.00, 1463.90, -1026.30, 110.90},
- { "Downtown Los Santos", 1391.00, -1026.30, -89.00, 1463.90, -926.90, 110.90},
- { "Downtown Los Santos", 1507.50, -1385.20, 110.90, 1582.50, -1325.30, 335.90},
- { "East Beach", 2632.80, -1852.80, -89.00, 2959.30, -1668.10, 110.90},
- { "East Beach", 2632.80, -1668.10, -89.00, 2747.70, -1393.40, 110.90},
- { "East Beach", 2747.70, -1668.10, -89.00, 2959.30, -1498.60, 110.90},
- { "East Beach", 2747.70, -1498.60, -89.00, 2959.30, -1120.00, 110.90},
- { "East Los Santos", 2421.00, -1628.50, -89.00, 2632.80, -1454.30, 110.90},
- { "East Los Santos", 2222.50, -1628.50, -89.00, 2421.00, -1494.00, 110.90},
- { "East Los Santos", 2266.20, -1494.00, -89.00, 2381.60, -1372.00, 110.90},
- { "East Los Santos", 2381.60, -1494.00, -89.00, 2421.00, -1454.30, 110.90},
- { "East Los Santos", 2281.40, -1372.00, -89.00, 2381.60, -1135.00, 110.90},
- { "East Los Santos", 2381.60, -1454.30, -89.00, 2462.10, -1135.00, 110.90},
- { "East Los Santos", 2462.10, -1454.30, -89.00, 2581.70, -1135.00, 110.90},
- { "Easter Basin", -1794.90, 249.90, -9.10, -1242.90, 578.30, 200.00},
- { "Easter Basin", -1794.90, -50.00, -0.00, -1499.80, 249.90, 200.00},
- { "Easter Bay Airport", -1499.80, -50.00, -0.00, -1242.90, 249.90, 200.00},
- { "Easter Bay Airport", -1794.90, -730.10, -3.00, -1213.90, -50.00, 200.00},
- { "Easter Bay Airport", -1213.90, -730.10, 0.00, -1132.80, -50.00, 200.00},
- { "Easter Bay Airport", -1242.90, -50.00, 0.00, -1213.90, 578.30, 200.00},
- { "Easter Bay Airport", -1213.90, -50.00, -4.50, -947.90, 578.30, 200.00},
- { "Easter Bay Airport", -1315.40, -405.30, 15.40, -1264.40, -209.50, 25.40},
- { "Easter Bay Airport", -1354.30, -287.30, 15.40, -1315.40, -209.50, 25.40},
- { "Easter Bay Airport", -1490.30, -209.50, 15.40, -1264.40, -148.30, 25.40},
- { "Easter Bay Chemicals", -1132.80, -768.00, 0.00, -956.40, -578.10, 200.00},
- { "Easter Bay Chemicals", -1132.80, -787.30, 0.00, -956.40, -768.00, 200.00},
- { "El Castillo del Diablo", -464.50, 2217.60, 0.00, -208.50, 2580.30, 200.00},
- { "El Castillo del Diablo", -208.50, 2123.00, -7.60, 114.00, 2337.10, 200.00},
- { "El Castillo del Diablo", -208.50, 2337.10, 0.00, 8.40, 2487.10, 200.00},
- { "El Corona", 1812.60, -2179.20, -89.00, 1970.60, -1852.80, 110.90},
- { "El Corona", 1692.60, -2179.20, -89.00, 1812.60, -1842.20, 110.90},
- { "El Quebrados", -1645.20, 2498.50, 0.00, -1372.10, 2777.80, 200.00},
- { "Esplanade East", -1620.30, 1176.50, -4.50, -1580.00, 1274.20, 200.00},
- { "Esplanade East", -1580.00, 1025.90, -6.10, -1499.80, 1274.20, 200.00},
- { "Esplanade East", -1499.80, 578.30, -79.60, -1339.80, 1274.20, 20.30},
- { "Esplanade North", -2533.00, 1358.90, -4.50, -1996.60, 1501.20, 200.00},
- { "Esplanade North", -1996.60, 1358.90, -4.50, -1524.20, 1592.50, 200.00},
- { "Esplanade North", -1982.30, 1274.20, -4.50, -1524.20, 1358.90, 200.00},
- { "Fallen Tree", -792.20, -698.50, -5.30, -452.40, -380.00, 200.00},
- { "Fallow Bridge", 434.30, 366.50, 0.00, 603.00, 555.60, 200.00},
- { "Fern Ridge", 508.10, -139.20, 0.00, 1306.60, 119.50, 200.00},
- { "Financial", -1871.70, 744.10, -6.10, -1701.30, 1176.40, 300.00},
- { "Fisher's Lagoon", 1916.90, -233.30, -100.00, 2131.70, 13.80, 200.00},
- { "Flint Intersection", -187.70, -1596.70, -89.00, 17.00, -1276.60, 110.90},
- { "Flint Range", -594.10, -1648.50, 0.00, -187.70, -1276.60, 200.00},
- { "Fort Carson", -376.20, 826.30, -3.00, 123.70, 1220.40, 200.00},
- { "Foster Valley", -2270.00, -430.20, -0.00, -2178.60, -324.10, 200.00},
- { "Foster Valley", -2178.60, -599.80, -0.00, -1794.90, -324.10, 200.00},
- { "Foster Valley", -2178.60, -1115.50, 0.00, -1794.90, -599.80, 200.00},
- { "Foster Valley", -2178.60, -1250.90, 0.00, -1794.90, -1115.50, 200.00},
- { "Frederick Bridge", 2759.20, 296.50, 0.00, 2774.20, 594.70, 200.00},
- { "Gant Bridge", -2741.40, 1659.60, -6.10, -2616.40, 2175.10, 200.00},
- { "Gant Bridge", -2741.00, 1490.40, -6.10, -2616.40, 1659.60, 200.00},
- { "Ganton", 2222.50, -1852.80, -89.00, 2632.80, -1722.30, 110.90},
- { "Ganton", 2222.50, -1722.30, -89.00, 2632.80, -1628.50, 110.90},
- { "Garcia", -2411.20, -222.50, -0.00, -2173.00, 265.20, 200.00},
- { "Garcia", -2395.10, -222.50, -5.30, -2354.00, -204.70, 200.00},
- { "Garver Bridge", -1339.80, 828.10, -89.00, -1213.90, 1057.00, 110.90},
- { "Garver Bridge", -1213.90, 950.00, -89.00, -1087.90, 1178.90, 110.90},
- { "Garver Bridge", -1499.80, 696.40, -179.60, -1339.80, 925.30, 20.30},
- { "Glen Park", 1812.60, -1449.60, -89.00, 1996.90, -1350.70, 110.90},
- { "Glen Park", 1812.60, -1100.80, -89.00, 1994.30, -973.30, 110.90},
- { "Glen Park", 1812.60, -1350.70, -89.00, 2056.80, -1100.80, 110.90},
- { "Green Palms", 176.50, 1305.40, -3.00, 338.60, 1520.70, 200.00},
- { "Greenglass College", 964.30, 1044.60, -89.00, 1197.30, 1203.20, 110.90},
- { "Greenglass College", 964.30, 930.80, -89.00, 1166.50, 1044.60, 110.90},
- { "Hampton Barns", 603.00, 264.30, 0.00, 761.90, 366.50, 200.00},
- { "Hankypanky Point", 2576.90, 62.10, 0.00, 2759.20, 385.50, 200.00},
- { "Harry Gold Parkway", 1777.30, 863.20, -89.00, 1817.30, 2342.80, 110.90},
- { "Hashbury", -2593.40, -222.50, -0.00, -2411.20, 54.70, 200.00},
- { "Hilltop Farm", 967.30, -450.30, -3.00, 1176.70, -217.90, 200.00},
- { "Hunter Quarry", 337.20, 710.80, -115.20, 860.50, 1031.70, 203.70},
- { "Idlewood", 1812.60, -1852.80, -89.00, 1971.60, -1742.30, 110.90},
- { "Idlewood", 1812.60, -1742.30, -89.00, 1951.60, -1602.30, 110.90},
- { "Idlewood", 1951.60, -1742.30, -89.00, 2124.60, -1602.30, 110.90},
- { "Idlewood", 1812.60, -1602.30, -89.00, 2124.60, -1449.60, 110.90},
- { "Idlewood", 2124.60, -1742.30, -89.00, 2222.50, -1494.00, 110.90},
- { "Idlewood", 1971.60, -1852.80, -89.00, 2222.50, -1742.30, 110.90},
- { "Jefferson", 1996.90, -1449.60, -89.00, 2056.80, -1350.70, 110.90},
- { "Jefferson", 2124.60, -1494.00, -89.00, 2266.20, -1449.60, 110.90},
- { "Jefferson", 2056.80, -1372.00, -89.00, 2281.40, -1210.70, 110.90},
- { "Jefferson", 2056.80, -1210.70, -89.00, 2185.30, -1126.30, 110.90},
- { "Jefferson", 2185.30, -1210.70, -89.00, 2281.40, -1154.50, 110.90},
- { "Jefferson", 2056.80, -1449.60, -89.00, 2266.20, -1372.00, 110.90},
- { "Julius Thruway East", 2623.10, 943.20, -89.00, 2749.90, 1055.90, 110.90},
- { "Julius Thruway East", 2685.10, 1055.90, -89.00, 2749.90, 2626.50, 110.90},
- { "Julius Thruway East", 2536.40, 2442.50, -89.00, 2685.10, 2542.50, 110.90},
- { "Julius Thruway East", 2625.10, 2202.70, -89.00, 2685.10, 2442.50, 110.90},
- { "Julius Thruway North", 2498.20, 2542.50, -89.00, 2685.10, 2626.50, 110.90},
- { "Julius Thruway North", 2237.40, 2542.50, -89.00, 2498.20, 2663.10, 110.90},
- { "Julius Thruway North", 2121.40, 2508.20, -89.00, 2237.40, 2663.10, 110.90},
- { "Julius Thruway North", 1938.80, 2508.20, -89.00, 2121.40, 2624.20, 110.90},
- { "Julius Thruway North", 1534.50, 2433.20, -89.00, 1848.40, 2583.20, 110.90},
- { "Julius Thruway North", 1848.40, 2478.40, -89.00, 1938.80, 2553.40, 110.90},
- { "Julius Thruway North", 1704.50, 2342.80, -89.00, 1848.40, 2433.20, 110.90},
- { "Julius Thruway North", 1377.30, 2433.20, -89.00, 1534.50, 2507.20, 110.90},
- { "Julius Thruway South", 1457.30, 823.20, -89.00, 2377.30, 863.20, 110.90},
- { "Julius Thruway South", 2377.30, 788.80, -89.00, 2537.30, 897.90, 110.90},
- { "Julius Thruway West", 1197.30, 1163.30, -89.00, 1236.60, 2243.20, 110.90},
- { "Julius Thruway West", 1236.60, 2142.80, -89.00, 1297.40, 2243.20, 110.90},
- { "Juniper Hill", -2533.00, 578.30, -7.60, -2274.10, 968.30, 200.00},
- { "Juniper Hollow", -2533.00, 968.30, -6.10, -2274.10, 1358.90, 200.00},
- { "K.A.C.C. Military Fuels", 2498.20, 2626.50, -89.00, 2749.90, 2861.50, 110.90},
- { "Kincaid Bridge", -1339.80, 599.20, -89.00, -1213.90, 828.10, 110.90},
- { "Kincaid Bridge", -1213.90, 721.10, -89.00, -1087.90, 950.00, 110.90},
- { "Kincaid Bridge", -1087.90, 855.30, -89.00, -961.90, 986.20, 110.90},
- { "King's", -2329.30, 458.40, -7.60, -1993.20, 578.30, 200.00},
- { "King's", -2411.20, 265.20, -9.10, -1993.20, 373.50, 200.00},
- { "King's", -2253.50, 373.50, -9.10, -1993.20, 458.40, 200.00},
- { "LVA Freight Depot", 1457.30, 863.20, -89.00, 1777.40, 1143.20, 110.90},
- { "LVA Freight Depot", 1375.60, 919.40, -89.00, 1457.30, 1203.20, 110.90},
- { "LVA Freight Depot", 1277.00, 1087.60, -89.00, 1375.60, 1203.20, 110.90},
- { "LVA Freight Depot", 1315.30, 1044.60, -89.00, 1375.60, 1087.60, 110.90},
- { "LVA Freight Depot", 1236.60, 1163.40, -89.00, 1277.00, 1203.20, 110.90},
- { "Las Barrancas", -926.10, 1398.70, -3.00, -719.20, 1634.60, 200.00},
- { "Las Brujas", -365.10, 2123.00, -3.00, -208.50, 2217.60, 200.00},
- { "Las Colinas", 1994.30, -1100.80, -89.00, 2056.80, -920.80, 110.90},
- { "Las Colinas", 2056.80, -1126.30, -89.00, 2126.80, -920.80, 110.90},
- { "Las Colinas", 2185.30, -1154.50, -89.00, 2281.40, -934.40, 110.90},
- { "Las Colinas", 2126.80, -1126.30, -89.00, 2185.30, -934.40, 110.90},
- { "Las Colinas", 2747.70, -1120.00, -89.00, 2959.30, -945.00, 110.90},
- { "Las Colinas", 2632.70, -1135.00, -89.00, 2747.70, -945.00, 110.90},
- { "Las Colinas", 2281.40, -1135.00, -89.00, 2632.70, -945.00, 110.90},
- { "Las Payasadas", -354.30, 2580.30, 2.00, -133.60, 2816.80, 200.00},
- { "Las Venturas Airport", 1236.60, 1203.20, -89.00, 1457.30, 1883.10, 110.90},
- { "Las Venturas Airport", 1457.30, 1203.20, -89.00, 1777.30, 1883.10, 110.90},
- { "Las Venturas Airport", 1457.30, 1143.20, -89.00, 1777.40, 1203.20, 110.90},
- { "Las Venturas Airport", 1515.80, 1586.40, -12.50, 1729.90, 1714.50, 87.50},
- { "Last Dime Motel", 1823.00, 596.30, -89.00, 1997.20, 823.20, 110.90},
- { "Leafy Hollow", -1166.90, -1856.00, 0.00, -815.60, -1602.00, 200.00},
- { "Lil' Probe Inn", -90.20, 1286.80, -3.00, 153.80, 1554.10, 200.00},
- { "Linden Side", 2749.90, 943.20, -89.00, 2923.30, 1198.90, 110.90},
- { "Linden Station", 2749.90, 1198.90, -89.00, 2923.30, 1548.90, 110.90},
- { "Linden Station", 2811.20, 1229.50, -39.50, 2861.20, 1407.50, 60.40},
- { "Little Mexico", 1701.90, -1842.20, -89.00, 1812.60, -1722.20, 110.90},
- { "Little Mexico", 1758.90, -1722.20, -89.00, 1812.60, -1577.50, 110.90},
- { "Los Flores", 2581.70, -1454.30, -89.00, 2632.80, -1393.40, 110.90},
- { "Los Flores", 2581.70, -1393.40, -89.00, 2747.70, -1135.00, 110.90},
- { "Los Santos International", 1249.60, -2394.30, -89.00, 1852.00, -2179.20, 110.90},
- { "Los Santos International", 1852.00, -2394.30, -89.00, 2089.00, -2179.20, 110.90},
- { "Los Santos International", 1382.70, -2730.80, -89.00, 2201.80, -2394.30, 110.90},
- { "Los Santos International", 1974.60, -2394.30, -39.00, 2089.00, -2256.50, 60.90},
- { "Los Santos International", 1400.90, -2669.20, -39.00, 2189.80, -2597.20, 60.90},
- { "Los Santos International", 2051.60, -2597.20, -39.00, 2152.40, -2394.30, 60.90},
- { "Marina", 647.70, -1804.20, -89.00, 851.40, -1577.50, 110.90},
- { "Marina", 647.70, -1577.50, -89.00, 807.90, -1416.20, 110.90},
- { "Marina", 807.90, -1577.50, -89.00, 926.90, -1416.20, 110.90},
- { "Market", 787.40, -1416.20, -89.00, 1072.60, -1310.20, 110.90},
- { "Market", 952.60, -1310.20, -89.00, 1072.60, -1130.80, 110.90},
- { "Market", 1072.60, -1416.20, -89.00, 1370.80, -1130.80, 110.90},
- { "Market", 926.90, -1577.50, -89.00, 1370.80, -1416.20, 110.90},
- { "Market Station", 787.40, -1410.90, -34.10, 866.00, -1310.20, 65.80},
- { "Martin Bridge", -222.10, 293.30, 0.00, -122.10, 476.40, 200.00},
- { "Missionary Hill", -2994.40, -811.20, 0.00, -2178.60, -430.20, 200.00},
- { "Montgomery", 1119.50, 119.50, -3.00, 1451.40, 493.30, 200.00},
- { "Montgomery", 1451.40, 347.40, -6.10, 1582.40, 420.80, 200.00},
- { "Montgomery Intersection", 1546.60, 208.10, 0.00, 1745.80, 347.40, 200.00},
- { "Montgomery Intersection", 1582.40, 347.40, 0.00, 1664.60, 401.70, 200.00},
- { "Mulholland", 1414.00, -768.00, -89.00, 1667.60, -452.40, 110.90},
- { "Mulholland", 1281.10, -452.40, -89.00, 1641.10, -290.90, 110.90},
- { "Mulholland", 1269.10, -768.00, -89.00, 1414.00, -452.40, 110.90},
- { "Mulholland", 1357.00, -926.90, -89.00, 1463.90, -768.00, 110.90},
- { "Mulholland", 1318.10, -910.10, -89.00, 1357.00, -768.00, 110.90},
- { "Mulholland", 1169.10, -910.10, -89.00, 1318.10, -768.00, 110.90},
- { "Mulholland", 768.60, -954.60, -89.00, 952.60, -860.60, 110.90},
- { "Mulholland", 687.80, -860.60, -89.00, 911.80, -768.00, 110.90},
- { "Mulholland", 737.50, -768.00, -89.00, 1142.20, -674.80, 110.90},
- { "Mulholland", 1096.40, -910.10, -89.00, 1169.10, -768.00, 110.90},
- { "Mulholland", 952.60, -937.10, -89.00, 1096.40, -860.60, 110.90},
- { "Mulholland", 911.80, -860.60, -89.00, 1096.40, -768.00, 110.90},
- { "Mulholland", 861.00, -674.80, -89.00, 1156.50, -600.80, 110.90},
- { "Mulholland Intersection", 1463.90, -1150.80, -89.00, 1812.60, -768.00, 110.90},
- { "North Rock", 2285.30, -768.00, 0.00, 2770.50, -269.70, 200.00},
- { "Ocean Docks", 2373.70, -2697.00, -89.00, 2809.20, -2330.40, 110.90},
- { "Ocean Docks", 2201.80, -2418.30, -89.00, 2324.00, -2095.00, 110.90},
- { "Ocean Docks", 2324.00, -2302.30, -89.00, 2703.50, -2145.10, 110.90},
- { "Ocean Docks", 2089.00, -2394.30, -89.00, 2201.80, -2235.80, 110.90},
- { "Ocean Docks", 2201.80, -2730.80, -89.00, 2324.00, -2418.30, 110.90},
- { "Ocean Docks", 2703.50, -2302.30, -89.00, 2959.30, -2126.90, 110.90},
- { "Ocean Docks", 2324.00, -2145.10, -89.00, 2703.50, -2059.20, 110.90},
- { "Ocean Flats", -2994.40, 277.40, -9.10, -2867.80, 458.40, 200.00},
- { "Ocean Flats", -2994.40, -222.50, -0.00, -2593.40, 277.40, 200.00},
- { "Ocean Flats", -2994.40, -430.20, -0.00, -2831.80, -222.50, 200.00},
- { "Octane Springs", 338.60, 1228.50, 0.00, 664.30, 1655.00, 200.00},
- { "Old Venturas Strip", 2162.30, 2012.10, -89.00, 2685.10, 2202.70, 110.90},
- { "Palisades", -2994.40, 458.40, -6.10, -2741.00, 1339.60, 200.00},
- { "Palomino Creek", 2160.20, -149.00, 0.00, 2576.90, 228.30, 200.00},
- { "Paradiso", -2741.00, 793.40, -6.10, -2533.00, 1268.40, 200.00},
- { "Pershing Square", 1440.90, -1722.20, -89.00, 1583.50, -1577.50, 110.90},
- { "Pilgrim", 2437.30, 1383.20, -89.00, 2624.40, 1783.20, 110.90},
- { "Pilgrim", 2624.40, 1383.20, -89.00, 2685.10, 1783.20, 110.90},
- { "Pilson Intersection", 1098.30, 2243.20, -89.00, 1377.30, 2507.20, 110.90},
- { "Pirates in Men's Pants", 1817.30, 1469.20, -89.00, 2027.40, 1703.20, 110.90},
- { "Playa del Seville", 2703.50, -2126.90, -89.00, 2959.30, -1852.80, 110.90},
- { "Prickle Pine", 1534.50, 2583.20, -89.00, 1848.40, 2863.20, 110.90},
- { "Prickle Pine", 1117.40, 2507.20, -89.00, 1534.50, 2723.20, 110.90},
- { "Prickle Pine", 1848.40, 2553.40, -89.00, 1938.80, 2863.20, 110.90},
- { "Prickle Pine", 1938.80, 2624.20, -89.00, 2121.40, 2861.50, 110.90},
- { "Queens", -2533.00, 458.40, 0.00, -2329.30, 578.30, 200.00},
- { "Queens", -2593.40, 54.70, 0.00, -2411.20, 458.40, 200.00},
- { "Queens", -2411.20, 373.50, 0.00, -2253.50, 458.40, 200.00},
- { "Randolph Industrial Estate", 1558.00, 596.30, -89.00, 1823.00, 823.20, 110.90},
- { "Redsands East", 1817.30, 2011.80, -89.00, 2106.70, 2202.70, 110.90},
- { "Redsands East", 1817.30, 2202.70, -89.00, 2011.90, 2342.80, 110.90},
- { "Redsands East", 1848.40, 2342.80, -89.00, 2011.90, 2478.40, 110.90},
- { "Redsands West", 1236.60, 1883.10, -89.00, 1777.30, 2142.80, 110.90},
- { "Redsands West", 1297.40, 2142.80, -89.00, 1777.30, 2243.20, 110.90},
- { "Redsands West", 1377.30, 2243.20, -89.00, 1704.50, 2433.20, 110.90},
- { "Redsands West", 1704.50, 2243.20, -89.00, 1777.30, 2342.80, 110.90},
- { "Regular Tom", -405.70, 1712.80, -3.00, -276.70, 1892.70, 200.00},
- { "Richman", 647.50, -1118.20, -89.00, 787.40, -954.60, 110.90},
- { "Richman", 647.50, -954.60, -89.00, 768.60, -860.60, 110.90},
- { "Richman", 225.10, -1369.60, -89.00, 334.50, -1292.00, 110.90},
- { "Richman", 225.10, -1292.00, -89.00, 466.20, -1235.00, 110.90},
- { "Richman", 72.60, -1404.90, -89.00, 225.10, -1235.00, 110.90},
- { "Richman", 72.60, -1235.00, -89.00, 321.30, -1008.10, 110.90},
- { "Richman", 321.30, -1235.00, -89.00, 647.50, -1044.00, 110.90},
- { "Richman", 321.30, -1044.00, -89.00, 647.50, -860.60, 110.90},
- { "Richman", 321.30, -860.60, -89.00, 687.80, -768.00, 110.90},
- { "Richman", 321.30, -768.00, -89.00, 700.70, -674.80, 110.90},
- { "Robada Intersection", -1119.00, 1178.90, -89.00, -862.00, 1351.40, 110.90},
- { "Roca Escalante", 2237.40, 2202.70, -89.00, 2536.40, 2542.50, 110.90},
- { "Roca Escalante", 2536.40, 2202.70, -89.00, 2625.10, 2442.50, 110.90},
- { "Rockshore East", 2537.30, 676.50, -89.00, 2902.30, 943.20, 110.90},
- { "Rockshore West", 1997.20, 596.30, -89.00, 2377.30, 823.20, 110.90},
- { "Rockshore West", 2377.30, 596.30, -89.00, 2537.30, 788.80, 110.90},
- { "Rodeo", 72.60, -1684.60, -89.00, 225.10, -1544.10, 110.90},
- { "Rodeo", 72.60, -1544.10, -89.00, 225.10, -1404.90, 110.90},
- { "Rodeo", 225.10, -1684.60, -89.00, 312.80, -1501.90, 110.90},
- { "Rodeo", 225.10, -1501.90, -89.00, 334.50, -1369.60, 110.90},
- { "Rodeo", 334.50, -1501.90, -89.00, 422.60, -1406.00, 110.90},
- { "Rodeo", 312.80, -1684.60, -89.00, 422.60, -1501.90, 110.90},
- { "Rodeo", 422.60, -1684.60, -89.00, 558.00, -1570.20, 110.90},
- { "Rodeo", 558.00, -1684.60, -89.00, 647.50, -1384.90, 110.90},
- { "Rodeo", 466.20, -1570.20, -89.00, 558.00, -1385.00, 110.90},
- { "Rodeo", 422.60, -1570.20, -89.00, 466.20, -1406.00, 110.90},
- { "Rodeo", 466.20, -1385.00, -89.00, 647.50, -1235.00, 110.90},
- { "Rodeo", 334.50, -1406.00, -89.00, 466.20, -1292.00, 110.90},
- { "Royal Casino", 2087.30, 1383.20, -89.00, 2437.30, 1543.20, 110.90},
- { "San Andreas Sound", 2450.30, 385.50, -100.00, 2759.20, 562.30, 200.00},
- { "Santa Flora", -2741.00, 458.40, -7.60, -2533.00, 793.40, 200.00},
- { "Santa Maria Beach", 342.60, -2173.20, -89.00, 647.70, -1684.60, 110.90},
- { "Santa Maria Beach", 72.60, -2173.20, -89.00, 342.60, -1684.60, 110.90},
- { "Shady Cabin", -1632.80, -2263.40, -3.00, -1601.30, -2231.70, 200.00},
- { "Shady Creeks", -1820.60, -2643.60, -8.00, -1226.70, -1771.60, 200.00},
- { "Shady Creeks", -2030.10, -2174.80, -6.10, -1820.60, -1771.60, 200.00},
- { "Sobell Rail Yards", 2749.90, 1548.90, -89.00, 2923.30, 1937.20, 110.90},
- { "Spinybed", 2121.40, 2663.10, -89.00, 2498.20, 2861.50, 110.90},
- { "Starfish Casino", 2437.30, 1783.20, -89.00, 2685.10, 2012.10, 110.90},
- { "Starfish Casino", 2437.30, 1858.10, -39.00, 2495.00, 1970.80, 60.90},
- { "Starfish Casino", 2162.30, 1883.20, -89.00, 2437.30, 2012.10, 110.90},
- { "Temple", 1252.30, -1130.80, -89.00, 1378.30, -1026.30, 110.90},
- { "Temple", 1252.30, -1026.30, -89.00, 1391.00, -926.90, 110.90},
- { "Temple", 1252.30, -926.90, -89.00, 1357.00, -910.10, 110.90},
- { "Temple", 952.60, -1130.80, -89.00, 1096.40, -937.10, 110.90},
- { "Temple", 1096.40, -1130.80, -89.00, 1252.30, -1026.30, 110.90},
- { "Temple", 1096.40, -1026.30, -89.00, 1252.30, -910.10, 110.90},
- { "The Camel's Toe", 2087.30, 1203.20, -89.00, 2640.40, 1383.20, 110.90},
- { "The Clown's Pocket", 2162.30, 1783.20, -89.00, 2437.30, 1883.20, 110.90},
- { "The Emerald Isle", 2011.90, 2202.70, -89.00, 2237.40, 2508.20, 110.90},
- { "The Farm", -1209.60, -1317.10, 114.90, -908.10, -787.30, 251.90},
- { "The Four Dragons Casino", 1817.30, 863.20, -89.00, 2027.30, 1083.20, 110.90},
- { "The High Roller", 1817.30, 1283.20, -89.00, 2027.30, 1469.20, 110.90},
- { "The Mako Span", 1664.60, 401.70, 0.00, 1785.10, 567.20, 200.00},
- { "The Panopticon", -947.90, -304.30, -1.10, -319.60, 327.00, 200.00},
- { "The Pink Swan", 1817.30, 1083.20, -89.00, 2027.30, 1283.20, 110.90},
- { "The Sherman Dam", -968.70, 1929.40, -3.00, -481.10, 2155.20, 200.00},
- { "The Strip", 2027.40, 863.20, -89.00, 2087.30, 1703.20, 110.90},
- { "The Strip", 2106.70, 1863.20, -89.00, 2162.30, 2202.70, 110.90},
- { "The Strip", 2027.40, 1783.20, -89.00, 2162.30, 1863.20, 110.90},
- { "The Strip", 2027.40, 1703.20, -89.00, 2137.40, 1783.20, 110.90},
- { "The Visage", 1817.30, 1863.20, -89.00, 2106.70, 2011.80, 110.90},
- { "The Visage", 1817.30, 1703.20, -89.00, 2027.40, 1863.20, 110.90},
- { "Unity Station", 1692.60, -1971.80, -20.40, 1812.60, -1932.80, 79.50},
- { "Valle Ocultado", -936.60, 2611.40, 2.00, -715.90, 2847.90, 200.00},
- { "Verdant Bluffs", 930.20, -2488.40, -89.00, 1249.60, -2006.70, 110.90},
- { "Verdant Bluffs", 1073.20, -2006.70, -89.00, 1249.60, -1842.20, 110.90},
- { "Verdant Bluffs", 1249.60, -2179.20, -89.00, 1692.60, -1842.20, 110.90},
- { "Verdant Meadows", 37.00, 2337.10, -3.00, 435.90, 2677.90, 200.00},
- { "Verona Beach", 647.70, -2173.20, -89.00, 930.20, -1804.20, 110.90},
- { "Verona Beach", 930.20, -2006.70, -89.00, 1073.20, -1804.20, 110.90},
- { "Verona Beach", 851.40, -1804.20, -89.00, 1046.10, -1577.50, 110.90},
- { "Verona Beach", 1161.50, -1722.20, -89.00, 1323.90, -1577.50, 110.90},
- { "Verona Beach", 1046.10, -1722.20, -89.00, 1161.50, -1577.50, 110.90},
- { "Vinewood", 787.40, -1310.20, -89.00, 952.60, -1130.80, 110.90},
- { "Vinewood", 787.40, -1130.80, -89.00, 952.60, -954.60, 110.90},
- { "Vinewood", 647.50, -1227.20, -89.00, 787.40, -1118.20, 110.90},
- { "Vinewood", 647.70, -1416.20, -89.00, 787.40, -1227.20, 110.90},
- { "Whitewood Estates", 883.30, 1726.20, -89.00, 1098.30, 2507.20, 110.90},
- { "Whitewood Estates", 1098.30, 1726.20, -89.00, 1197.30, 2243.20, 110.90},
- { "Willowfield", 1970.60, -2179.20, -89.00, 2089.00, -1852.80, 110.90},
- { "Willowfield", 2089.00, -2235.80, -89.00, 2201.80, -1989.90, 110.90},
- { "Willowfield", 2089.00, -1989.90, -89.00, 2324.00, -1852.80, 110.90},
- { "Willowfield", 2201.80, -2095.00, -89.00, 2324.00, -1989.90, 110.90},
- { "Willowfield", 2541.70, -1941.40, -89.00, 2703.50, -1852.80, 110.90},
- { "Willowfield", 2324.00, -2059.20, -89.00, 2541.70, -1852.80, 110.90},
- { "Willowfield", 2541.70, -2059.20, -89.00, 2703.50, -1941.40, 110.90},
- { "Yellow Bell Station", 1377.40, 2600.40, -21.90, 1492.40, 2687.30, 78.00},
- // Main Zones
- { "Los Santos", 44.60, -2892.90, -242.90, 2997.00, -768.00, 900.00},
- { "Las Venturas", 869.40, 596.30, -242.90, 2997.00, 2993.80, 900.00},
- { "Bone County", -480.50, 596.30, -242.90, 869.40, 2993.80, 900.00},
- { "Tierra Robada", -2997.40, 1659.60, -242.90, -480.50, 2993.80, 900.00},
- { "Tierra Robada", -1213.90, 596.30, -242.90, -480.50, 1659.60, 900.00},
- { "San Fierro", -2997.40, -1115.50, -242.90, -1213.90, 1659.60, 900.00},
- { "Red County", -1213.90, -768.00, -242.90, 2997.00, 596.30, 900.00},
- { "Flint County", -1213.90, -2892.90, -242.90, 44.60, -768.00, 900.00},
- { "Whetstone", -2997.40, -2892.90, -242.90, -1213.90, -1115.50, 900.00}
- };
- native GetXYZZoneID(Float:x, Float:y, Float:z);
- stock GetXYZZoneName(Float:x, Float:y, Float:z)
- {
- new name[MAX_NAME] = "Unknown";
- if ((x == 0.0) && (y = 0.0)) return name;
- for (new zoneid = 0; zoneid < MAX_ZONES; zoneid++) {
- if (IsXYZInZone(x, y, z, zoneid)) {
- copyEx(name,zones[zoneid][zone_name],strlen(zones[zoneid][zone_name]));
- return name;
- }
- }
- return name;
- }
- stock copyEx(dest[],source[],count)
- {
- dest[0]=0;
- if (count<0) return false;
- if (count>strlen(source)) count=strlen(source);
- new i=0;
- for (i=0;i<count;i++) {
- dest[i]=source[i];
- if (source[i]==0) return true;
- }
- dest[count]=0;
- return true;
- }
- stock IsXYZInZone(Float:x, Float:y, Float:z, zoneid)
- {
- if(zoneid == -1) return 0;
- if(x >= zones[zoneid][zone_minx] && x < zones[zoneid][zone_maxx]
- && y >= zones[zoneid][zone_miny] && y < zones[zoneid][zone_maxy]
- && z >= zones[zoneid][zone_minz] && z < zones[zoneid][zone_maxz]) {
- return 1;
- }
- return 0;
- }
- stock IsPlayerInZone(playerid, zoneid)
- {
- if(zoneid == -1) return 0;
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid,x,y,z);
- return IsXYZInZone(x, y, z, zoneid);
- }
- stock IsPlayerInZoneName(playerid, zonename[])
- {
- new Float:x, Float:y, Float:z;
- GetPlayerPos(playerid,x,y,z);
- for (new zoneid = 0; zoneid < MAX_ZONES; zoneid++) {
- if (strcompEx(zonename,zones[zoneid][zone_name],false)) {
- return IsPlayerInZone(playerid, zoneid);
- }
- }
- return 0;
- }
- stock strcompEx(str1[],str2[],bool:ignorecase)
- {
- if ((!strlen(str1)) && (!strlen(str2))) return 1;
- if (!strlen(str1)) return 0;
- if (!strlen(str2)) return 0;
- if (strcmp(str1,str2,ignorecase) == 0) {
- return 1;
- }
- return 0;
- }
- stock PlayerName(playerid)
- {
- new name[255];
- GetPlayerName(playerid, name, 255);
- return name;
- }
- stock ConvertTime(seconds)
- {
- new hours,mins,secs,string[100];
- hours = floatround(seconds / 3600);
- mins = floatround((seconds / 60) - (hours * 60));
- secs = floatround(seconds - ((hours * 3600) + (mins * 60)));
- if(hours >= 1)format(string,sizeof(string),"%d Hrs %02d Mins %02d Secs",hours,mins,secs);
- else if(mins >= 1)format(string,sizeof(string),"%02d Mins %02d Secs",mins,secs);
- else format(string,sizeof(string),"%d Secs",secs);
- return string;
- }
- stock IsStringIP(string[])
- {
- new icnt;
- new port;
- for(new i=0,j=strlen(string);i<j;i++) {
- if(string[i] == '.') icnt++;
- else if(string[i] ==':') port++;
- }
- if(icnt == 3) {
- if(port == 1) return 2;
- else if(port == 0) return 1;
- }
- return 0;
- }
- public MsgToTheAdmin(msg[])
- {
- for(new giveid=0; giveid<GetMaxPlayers(); giveid++) {
- if(IsPlayerConnected(giveid)) {
- if(IsPlayerAdmin(giveid)) {
- SendClientMessage(giveid,green,msg);
- }
- }
- }
- return true;
- }
- public Spawn(playerid)
- {
- if(!IsPlayerConnected(playerid)) return true;
- new Float:X, Float:Y, Float:Z, lolz1[256], lolz2[256];
- new currentzonename[256];
- new Float:HP, Float:Armour;
- GetPlayerPos(playerid,X,Y,Z);
- GetPlayerHealth(playerid,HP);
- currentzonename = GetXYZZoneName(X,Y,Z);
- format(lolz1,256,"3** [%i] %s has spawned in %s.", playerid, PlayerName(playerid), currentzonename);
- IRC_GroupSay(GroupID[1], AdminChan, lolz1);
- if(HP > 100 || Armour > 100) {
- format(lolz2,256,"4** [WARNING] %s (ID:%d) it can be a cheater. HP: %.0f Armour: %.0f", PlayerName(playerid), playerid, HP, Armour);
- IRC_GroupSay(GroupID[1], AdminChan, lolz2);
- }
- return true;
- }
- stock sscanf(string[], format[], {Float,_}
- :...)
- {
- new
- formatPos = 0,
- stringPos = 0,
- paramPos = 2,
- paramCount = numargs();
- while (paramPos < paramCount && string[stringPos]) {
- switch (format[formatPos++]) {
- case '\0':
- {
- return 0;
- }
- case 'i', 'd':
- {
- new
- neg = 1,
- num = 0,
- ch = string[stringPos];
- if (ch == '-') {
- neg = -1;
- ch = string[++stringPos];
- }
- do {
- stringPos++;
- if (ch >= '0' && ch <= '9') {
- num = (num * 10) + (ch - '0');
- }
- else {
- return 1;
- }
- }
- while ((ch = string[stringPos]) && ch != ' ');
- setarg(paramPos, 0, num * neg);
- }
- case 'h', 'x':
- {
- new
- ch,
- num = 0;
- while ((ch = string[stringPos++])) {
- switch (ch) {
- case 'x', 'X':
- {
- num = 0;
- continue;
- }
- case '0' .. '9':
- {
- num = (num << 4) | (ch - '0');
- }
- case 'a' .. 'f':
- {
- num = (num << 4) | (ch - ('a' - 10));
- }
- case 'A' .. 'F':
- {
- num = (num << 4) | (ch - ('A' - 10));
- }
- case ' ':
- {
- break;
- }
- default:
- {
- return 1;
- }
- }
- }
- setarg(paramPos, 0, num);
- }
- case 'c':
- {
- setarg(paramPos, 0, string[stringPos++]);
- }
- case 'f':
- {
- new tmp[25];
- strmid(tmp, string, stringPos, stringPos+sizeof(tmp)-2);
- setarg(paramPos, 0, _:floatstr(tmp));
- }
- case 's', 'z':
- {
- new
- i = 0,
- ch;
- if (format[formatPos]) {
- while ((ch = string[stringPos++]) && ch != ' ') {
- setarg(paramPos, i++, ch);
- }
- if (!i) return 1;
- }
- else {
- while ((ch = string[stringPos++])) {
- setarg(paramPos, i++, ch);
- }
- }
- stringPos--;
- setarg(paramPos, i, '\0');
- }
- default:
- {
- continue;
- }
- }
- while (string[stringPos] && string[stringPos] != ' ') {
- stringPos++;
- }
- while (string[stringPos] == ' ') {
- stringPos++;
- }
- paramPos++;
- }
- while (format[formatPos] == 'z') formatPos++;
- return format[formatPos];
- }
- public UnJailedDenied(playerid)
- {
- SetPlayerInterior(playerid,6);
- SetPlayerPos(playerid,264.785200,77.564040,1001.039000);
- }
- public Float:GetDistanceBetweenPlayers(p1,p2)
- {
- new
- Float:Pos[6];
- if(!IsPlayerConnected(p1) || !IsPlayerConnected(p2)) {
- return -1.00;
- }
- GetPlayerPos(p1,Pos[0],Pos[1],Pos[2]);
- GetPlayerPos(p2,Pos[3],Pos[4],Pos[5]);
- 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));
- }
- /*
- stock strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }
- */
- stock ComponentsNames(id)
- {
- new CName[50];
- if(id == 1009) CName = "2x Nitrous";
- else if(id == 1008) CName = "5x Nitrous";
- else if(id == 1010) CName = "10x Nitrous";
- else if(id == 1082) CName = "Import (Wheels)";
- else if(id == 1085) CName = "Atomic (Wheels)";
- else if(id == 1096) CName = "Ahab (Wheels)";
- else if(id == 1097) CName = "Virtual (Wheels)";
- else if(id == 1098) CName = "Access (Wheels)";
- else if(id == 1025) CName = "Off road (Wheels)";
- else if(id == 1013) CName = "Round Fog Lamp";
- else if(id == 1020) CName = "Large exhaust";
- else if(id == 1021) CName = "Medium exhaust";
- else if(id == 1022) CName = "Small exhaust";
- else if(id == 1019) CName = "Twin exhaust";
- else if(id == 1006) CName = "Roof Scoop";
- else if(id == 1001) CName = "Win (Spoiler)";
- else if(id == 1003) CName = "Alpha (Spoiler)";
- else if(id == 1007) CName = "Side Skirt";
- else if(id == 1086) CName = "Bass Boost";
- else if(id == 1087) CName = "Hydraulics";
- else if(id == 1002) CName = "Drag (Spoiler)";
- else if(id == 1016) CName = "Worx (Spoiler)";
- else if(id == 1023) CName = "Fury (Spoiler)";
- else if(id == 1018) CName = "Upswept exhaust";
- else if(id == 1143) CName = "Oval Hood Vent";
- else if(id == 1145) CName = "Square Hood Vent";
- else if(id == 1024) CName = "Square Fog Lamps";
- else if(id == 1004) CName = "Champ Scoop";
- else if(id == 1015) CName = "Race (Spoiler)";
- else if(id == 1000) CName = "Pro (Spoiler)";
- else if(id == 1011) CName = "Race Scoop";
- else if(id == 1014) CName = "Champ (Spoiler)";
- else CName = "Unknown";
- return CName;
- }
- IsNumeric(const string[])
- {
- for (new i = 0, j = strlen(string); i < j; i++) {
- if (string[i] > '9' || string[i] < '0') return 0;
- }
- return 1;
- }
- ReturnUser(text[])
- {
- new pos = 0;
- while (text[pos] < 0x21) {
- if (text[pos] == 0) return INVALID_PLAYER_ID;
- pos++;
- }
- new userid = INVALID_PLAYER_ID;
- if (IsNumeric(text[pos])) {
- userid = strval(text[pos]);
- if (userid >=0 && userid < MAX_PLAYERS) {
- if(!IsPlayerConnected(userid)) {
- userid = INVALID_PLAYER_ID;
- }
- else {
- return userid;
- }
- }
- }
- new giveid;
- new GetPlayer[256];
- for (giveid=0; giveid<=MAX_PLAYERS; giveid++) {
- if (IsPlayerConnected(giveid)) {
- GetPlayerName(giveid,GetPlayer,16);
- new space = (strfind(GetPlayer, text,true));
- if (space != -1) {
- return giveid;
- }
- }
- }
- return userid;
- }
- IsValidSkin(skinid)
- {
- #define MAX_BAD_SKINS 22
- new badSkins[MAX_BAD_SKINS] = {
- 3, 4, 5, 6, 8, 42, 65, 74, 86,
- 119, 149, 208, 265, 266, 267,
- 268, 269, 270, 271, 272, 273, 289
- };
- if (skinid < 0 || skinid > 299) return false;
- for (new i = 0; i < MAX_BAD_SKINS; i++) {
- if (skinid == badSkins[i]) return false;
- }
- #undef MAX_BAD_SKINS
- return true;
- }
- stock GetWeaponIDFromName(WeaponName[])
- {
- new wid;
- if(IsNumeric(WeaponName)) {
- wid = strval(WeaponName);
- return wid;
- }
- if(strfind("molotov",WeaponName,true)!=-1) return 18;
- for(new i = 0; i <= 46; i++) {
- switch(i) {
- case 0,19,20,21,44,45: continue;
- default:
- {
- new name[24];
- GetWeaponName(i,name,24);
- if(strfind(name,WeaponName,true)!=-1)
- return i;
- }
- }
- }
- return -1;
- }
- public AccessDenied(user[])
- {
- new Denied[256];
- format(Denied,sizeof(Denied),"Notice %s 4*** Error: You don't have the necessary level.",user);
- IRC_GroupNotice(GroupID[0],user,Denied);
- return true;
- }
- public PlayerUnJailed(playerid)
- {
- if(IsPlayerJailed[playerid] == 0) return true;
- new lolz1[256],lolz2[256];
- SetPlayerInterior(playerid,6);
- SetPlayerPos(playerid,267.785200,77.564040,1001.039000);
- format(lolz1,256,"*** Auto-unjailed player: %s (ID:%d).",PlayerName(playerid),playerid);
- format(lolz2,256,"4*** Auto-unjailed player: %s (ID:%d).",PlayerName(playerid),playerid);
- SendClientMessageToAll(red,lolz1);
- IRC_GroupSay(GroupID[0],EchoChan,lolz2);
- IsPlayerJailed[playerid] = false;
- return true;
- }
- //========================//
- //== Include dutils.inc ==//
- //===== by DracoBlue =====//
- //========================//
- stock Now()
- {
- new hour,minute,second;
- new year, month,day;
- gettime(hour, minute, second);
- getdate(year, month, day);
- return mktime(hour,minute,second,day,month,year);
- }
- stock mktime(hour,minute,second,day,month,year)
- {
- new timestamp2;
- timestamp2 = second + (minute * 60) + (hour * 3600);
- new days_of_month[12];
- if ( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ) {
- days_of_month = { // Schaltjahr
- 31,29,31,30,31,30,31,31,30,31,30,31
- };
- }
- else {
- days_of_month = { // keins
- 31,28,31,30,31,30,31,31,30,31,30,31
- };
- }
- new days_this_year = 0;
- days_this_year = day;
- if(month > 1) { // No January Calculation, because its always the 0 past months
- for(new i=0; i<month-1;i++) {
- days_this_year += days_of_month[i];
- }
- }
- timestamp2 += days_this_year * 86400;
- for(new j=1970;j<year;j++) {
- timestamp2 += 31536000;
- // Schaltjahr + 1 Tag
- if ( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ) timestamp2 += 86400;
- }
- return timestamp2;
- }
- OnPlayerLogin(playerid, password[])
- {
- new query[MAX_STRING+1],Row[1024],Field[MAX_STRING];
- MySQLCheck();
- mysql_real_escape_string(BB3_PlayerName(playerid), BB3_PlayerName(playerid));
- mysql_real_escape_string(password, password);
- format(query,sizeof(query), "SELECT * FROM `"SQL_TABLENAME"` WHERE Username = '%s' AND Password = '%s' LIMIT 1", BB3_PlayerName(playerid), password);
- mysql_query(query);
- mysql_store_result();
- if(mysql_num_rows() > 0) {
- mysql_fetch_row_format(Row, "|");
- mysql_fetch_field_row(Field, "Password"); strmid(PlayerInfo[playerid][gPassword], Field, 0, strlen(Field), 255);
- mysql_fetch_field_row(Field, "AdminLevel"); PlayerInfo[playerid][gAdminLevel] = strval(Field);
- mysql_fetch_field_row(Field, "Money"); PlayerInfo[playerid][gMoney] = strval(Field);
- mysql_fetch_field_row(Field, "Score"); PlayerInfo[playerid][gScore] = strval(Field);
- }
- mysql_free_result();
- ResetPlayerMoney(playerid);
- GivePlayerMoney(playerid, PlayerInfo[playerid][gMoney]);
- SetPlayerScore(playerid, PlayerInfo[playerid][gScore]);
- return 1;
- }
- OnPlayerSave(playerid)
- {
- if(PlayerInfo[playerid][gLogged] != 0) {
- new query[MAX_STRING+1];
- MySQLCheck();
- format(query,sizeof(query),"UPDATE `"SQL_TABLENAME"` SET `Password`='%s' WHERE (`Username` = '%s')",PlayerInfo[playerid][gPassword], BB3_PlayerName(playerid));
- mysql_query(query);
- format(query,sizeof(query),"UPDATE `"SQL_TABLENAME"` SET `AdminLevel`='%s' WHERE (`Username` = %d)",PlayerInfo[playerid][gAdminLevel], BB3_PlayerName(playerid));
- mysql_query(query);
- format(query,sizeof(query),"UPDATE `"SQL_TABLENAME"` SET `Money`='%s' WHERE (`Username` = %d)",GetPlayerMoney(playerid), BB3_PlayerName(playerid));
- mysql_query(query);
- format(query,sizeof(query),"UPDATE `"SQL_TABLENAME"` SET `Score`='%s' WHERE (`Username` = %d)",GetPlayerScore(playerid), BB3_PlayerName(playerid));
- mysql_query(query);
- }
- return 1;
- }
- BB3_PlayerName(playerid)
- {
- new PlayerName[MAX_PLAYER_NAME];
- GetPlayerName(playerid, PlayerName, MAX_PLAYER_NAME);
- return PlayerName;
- }
- MySQLCheck()
- {
- if(mysql_ping() == -1) {
- mysql_connect(SQL_HOST, SQL_USER,SQL_DB, SQL_PASS);
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement