#pragma disablerecursion // --------------------------------------- #pragma dynamic 64000 // --------------------------------------- #include #include #include #include #include // R39-4 #include #include #include #include #include #include #include #include #include // -------------------------------------- //#include // -------------------------------------- #define MYSQL_STATUS 1 // 0 = local host, 1 = server #if MYSQL_STATUS == 0 #define MYSQL_HOSTNAME "127.0.0.1" #define MYSQL_USERNAME "localhost" #define MYSQL_PASSWORD "" #define MYSQL_DATABASE "localhost" #else #define MYSQL_HOSTNAME "127.0.0.1" // PLUX. #define MYSQL_DATABASE "ecrp-dev" #define MYSQL_USERNAME "ecrp-dev" #define MYSQL_PASSWORD "tvpn8AyPuLNP" #endif //---------------------------------------- #undef MAX_PLAYERS #define MAX_PLAYERS 100 // --------------------------------------- #define SERVER_REVISION "V1.0" // Change this every commit. #define SERVER_ANTICHEAT "The Anticheat" // -----------[ ANTI FLOOD] ------------ #define MAX_CONNECT 3 new UserMaxConnect[MAX_PLAYERS]; new ipa[30]; //#define SERVER_INTRO // Comment this line to disable the intro for unregistered users. // --------------------------------------- #define COLOR_WHITE 0xFFFFFFFF #define COLOR_YELLOW 0xFFD200FF #define COLOR_YELLOW2 0xF5DEB3FF #define COLOR_YELLOW3 0xFFFF90FF #define COLOR_LIGHTORANGE 0xF7A763FF #define COLOR_AQUA 0x0087FFFF #define COLOR_GREEN 0x32CD32FF //#define COLOR_GREEN 0x008000FF #define COLOR_LIMEGREEN 0x06FF00FF #define COLOR_GREY 0xAFAFAFFF #define COLOR_GREY1 0xE6E6E6FF #define COLOR_GREY2 0xC8C8C8FF #define COLOR_GREY3 0xAAAAAAFF #define COLOR_GREY4 0x8C8C8CFF #define COLOR_GREY5 0x6E6E6EFF #define COLOR_LIGHTRED 0xFF6347FF #define COLOR_ORANGE 0xFF9900FF #define COLOR_RED 0xAA3333FF #define COLOR_EAT 0xD70000FF #define COLOR_PURPLE 0xC2A2DAFF #define COLOR_NEWBIE 0x7DAEFFFF #define COLOR_BLUE 0x233EFAFF #define COLOR_ROYALBLUE 0x9999FFFF #define COLOR_DOCTOR 0xFF8282FF #define COLOR_DARKGREEN 0x00AA00FF #define COLOR_VIP 0xD909D9FF #define COLOR_WALKIETALKIE 0xB2EBE0FF #define COLOR_NAVYBLUE 0x089DCEFF #define COLOR_LIGHTGREEN 0x9ACD32FF #define COLOR_GLOBAL 0xFFA500FF #define COLOR_ADMINCHAT 0x089DCEFF //#define COLOR_FACTIONCHAT 0xBDF38BFF #define COLOR_FACTIONCHAT 0xFF8C00FF #define COLOR_SYNTAX 0xAFAFAFFF #define COLOR_RETIRED 0xFF69B5FF // --------------------------------------- #define MAX_LISTED_NUMBERS 50 #define MAX_LISTED_OBJECTS 50 #define MAX_LISTED_STATIONS 50 #define MAX_SPLIT_LENGTH 70 // --------------------------------------- #define MAX_REPORTS 50 #define MAX_HOUSES 1000 #define MAX_GARAGES 1000 #define MAX_BUSINESSES 500 #define MAX_ENTRANCES 500 #define MAX_PLAYER_CLOTHING 10 #define MAX_SPAWNED_VEHICLES 20 #define MAX_ANTICHEAT_WARNINGS 8 #define MAX_FACTIONS 10 #define MAX_FACTION_RANKS 20 #define MAX_FACTION_SKINS 10 #define MAX_FACTION_DIVISIONS 5 #define MAX_GANG_CREWS 5 #define MAX_DEPLOYABLES 50 #define MAX_FIRES 100 #define MAX_LANDS 50 #define MAX_LOCKERS 20 #define MAX_GANGS 15 #define MAX_GANG_SKINS 10 #define MAX_POINTS 10 #define MAX_TURFS 30 #define MAX_BANK_ROBBERS 5 #define MAX_LOCATIONS 30 #define MAX_ATMS 50 #define MAX_GRAFFITI_POINTS 200 #define MAX_WEAPON_RACKS 500 #define MAX_SPEED_CAMERAS 100 // --------------------------------------- //-- Iterator for huge/freq arrays----- new Iterator:House, Iterator:Garage, Iterator:Entrance, Iterator:Business, //Iterator:Faction, //Iterator:Fire, Iterator:Land, //Iterator:Locker, //Iterator:Gang, //Iterator:Point, Iterator:Turf; //Iterator:LandObjects<(MAX_LANDS*300)>, // --------------------------------------- #define THREAD_LOOKUP_BANS 1 #define THREAD_LOOKUP_ACCOUNT 2 #define THREAD_ACCOUNT_REGISTER 3 #define THREAD_PROCESS_LOGIN 4 #define THREAD_COUNT_FLAGS 5 #define THREAD_TRACE_IP 6 #define THREAD_LOGIN_UPDATE 7 #define THREAD_LIST_CHANGES 8 #define THREAD_LIST_HELPERS 9 #define THREAD_LOAD_HOUSES 10 #define THREAD_LIST_TENANTS 11 #define THREAD_LOAD_FURNITURE 12 #define THREAD_LOAD_GARAGES 13 #define THREAD_LOAD_BUSINESSES 14 #define THREAD_LOAD_ENTRANCES 15 #define THREAD_LOAD_CLOTHING 16 #define THREAD_LOAD_FACTIONS 17 #define THREAD_LOAD_FACTIONRANKS 18 #define THREAD_LOAD_FACTIONSKINS 19 #define THREAD_LOAD_FACTIONPAY 20 #define THREAD_LOAD_DIVISIONS 21 #define THREAD_LOAD_LANDS 22 #define THREAD_LOAD_LANDOBJECTS 23 #define THREAD_LOAD_GANGS 24 #define THREAD_LOAD_GANGRANKS 25 #define THREAD_LOAD_GANGSKINS 26 #define THREAD_LOAD_POINTS 27 #define THREAD_LOAD_TURFS 28 #define THREAD_LOAD_LOCKERS 29 #define THREAD_HOUSE_INFORMATION 30 #define THREAD_COUNT_FURNITURE 31 #define THREAD_SELL_FURNITURE 32 #define THREAD_CLEAR_FURNITURE 33 #define THREAD_DUPLICATE_FURNITURE 34 #define THREAD_DUPLICATED_FURNITURE 35 #define THREAD_COUNT_TEXTS 36 #define THREAD_VIEW_TEXTS 37 #define THREAD_LIST_VEHICLES 38 #define THREAD_CAR_STORAGE 39 #define THREAD_FACTION_ROSTER 40 #define THREAD_GANG_ROSTER 41 #define THREAD_VIEW_PHONEBOOK 42 #define THREAD_COUNT_LANDOBJECTS 43 #define THREAD_SELL_LANDOBJECT 44 #define THREAD_DUPLICATE_LANDOBJECT 45 #define THREAD_DUPLICATED_OBJECT 46 #define THREAD_CLEAR_LANDOBJECTS 47 #define THREAD_LIST_LANDOBJECTS 48 #define THREAD_LAND_MAINMENU 49 #define THREAD_LAND_INFORMATION 50 #define THREAD_LOAD_VEHICLES 51 #define THREAD_GANG_INFORMATION 52 #define THREAD_OFFLINE_IP 53 #define THREAD_CHECK_REFERRAL 54 #define THREAD_REWARD_REFERRER 55 #define THREAD_LIST_FLAGGED 56 #define THREAD_LIST_ACHIEVEMENTS 57 #define THREAD_LIST_ADMINS 58 #define THREAD_DUPLICATE_LANDOBJ 59 #define THREAD_CHECKDUPE_FURNITURE 60 #define THREAD_LOAD_LOCATIONS 61 #define THREAD_UPDATE_LANDLABELS 62 #define THREAD_LOAD_CREWS 63 #define THREAD_LIST_VIPS 64 #define THREAD_LOAD_ATMS 65 #define THREAD_REMOVE_VIP 66 #define THREAD_LOAD_PLAYERBACKPACK 67 // --------------------------------------- #define MODEL_SELECTION_CLOTHES 1 #define MODEL_SELECTION_FURNITURE 2 #define MODEL_SELECTION_LANDOBJECTS 3 #define MODEL_SELECTION_CLOTHING 4 #define MODEL_SELECTION_COPCLOTHING 5 #define MODEL_SELECTION_VIPCLOTHES 6 // --------------------------------------- #define RED_TEAM 0 #define BLUE_TEAM 1 // --------------------------------------- #define strcpy(%0,%1) strcat(((%0[0] = 0), %0), %1) #define percent(%0,%1) floatround((float((%0)) / 100) * (%1)) #define Random(%0,%1) (random((%1) - (%0)) + (%0)) // --------------------------------------- #define HOLDING(%0) \ ((newkeys & (%0)) == (%0)) #define RELEASED(%0) \ (((newkeys & (%0)) != (%0)) && ((oldkeys & (%0)) == (%0))) #define PRESSED(%0) \ (((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0))) new IsPlayerSteppingInVehicle[MAX_PLAYERS] = -1; new Text:Textdraw0; new Text:Textdraw1; new Text:Textdraw2; new Text:Textdraw3; new Text:Textdraw4; new Text:Textdraw5; new Text:Textdraw6; new Text:Textdraw7; new Text:Textdraw8; new PlayerText:TDEditor_PTD[MAX_PLAYERS][12]; // --------------------------------------- #define SERVER_MUSIC_URL "music.ecrp.h0v1n8.nl" #define SERVER_FETCH_URL "music.ecrp.h0v1n8.nl" #define VIP_MUSIC_URL "ucp.ecrp.h0v1n8.nl/music" // --------------------------------------- #undef SSCANF_Join #undef SSCANF_Leave // --------------------------------------- new tsstring[2048]; // faking too many turfs // Elevator Defines #define ELEVATOR_SPEED (5.0) // Movement speed of the elevator. #define DOORS_SPEED (5.0) // Movement speed of the doors. #define ELEVATOR_WAIT_TIME (5000) // Time in ms that the elevator will wait in each floor before continuing with the queue. #define DIALOG_ID DIALOG_LSELEVATOR #define Y_DOOR_CLOSED (1854.9738) #define Y_DOOR_R_OPENED (1853.3738) #define Y_DOOR_L_OPENED (1856.7821) #define GROUND_Z_COORD (43.3501) #define ELEVATOR_OFFSET (0.059523) new Obj_Elevator, Obj_ElevatorDoors[2], Obj_FloorDoors[21][2]; new Text3D:Label_Elevator, Text3D:Label_Floors[21]; #define ELEVATOR_STATE_IDLE (0) #define ELEVATOR_STATE_WAITING (1) #define ELEVATOR_STATE_MOVING (2) new Text:houseLights; new mysteryegg; new Text3D:mysteryegg3DText; new GiftAllowed; //////////////welcome back pm / //////////////////////////// new ElevatorState, ElevatorFloor; // If Idle or Waiting, this is the current floor. If Moving, the floor it's moving to. #define INVALID_FLOOR (-1) new ElevatorQueue[21], // Floors in queue. FloorRequestedBy[21]; // FloorRequestedBy[floor_id] = playerid; - Points out who requested which floor. new ElevatorBoostTimer; // Timer that makes the elevator move faster after players start surfing the object. //============================================================== //----- VEH ITERATOR------------- // ============================================================================ new Iterator:Vehicle; // ============================================================================ stock VIH_AddStaticVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2) { new vehicleid = AddStaticVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2); Iter_Add(Vehicle, vehicleid); return vehicleid; } #if defined _ALS_AddStaticVehicle #undef AddStaticVehicle #else #define _ALS_AddStaticVehicle #endif #define AddStaticVehicle VIH_AddStaticVehicle // ============================================================================ stock VIH_AddStaticVehicleEx(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, addsiren = 0) { new vehicleid = AddStaticVehicleEx(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, addsiren); Iter_Add(Vehicle, vehicleid); return vehicleid; } #if defined _ALS_AddStaticVehicleEx #undef AddStaticVehicleEx #else #define _ALS_AddStaticVehicleEx #endif #define AddStaticVehicleEx VIH_AddStaticVehicleEx // ============================================================================ stock VIH_CreateVehicle(modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, color1, color2, respawn_delay, siren = 0) { new vehicleid = CreateVehicle(modelid, spawn_x, spawn_y, spawn_z, z_angle, color1, color2, respawn_delay, siren); Iter_Add(Vehicle, vehicleid); return vehicleid; } #if defined _ALS_CreateVehicle #undef CreateVehicle #else #define _ALS_CreateVehicle #endif #define CreateVehicle VIH_CreateVehicle // ============================================================================ stock VIH_DestroyVehicle(vehicleid) { Iter_Remove(Vehicle, vehicleid); return DestroyVehicle(vehicleid); } #if defined _ALS_DestroyVehicle #undef DestroyVehicle #else #define _ALS_DestroyVehicle #endif #define DestroyVehicle VIH_DestroyVehicle // Hooking for youtube links stock PlayAudioStream_Ex(playerid, url[], Float:posX = 0.0, Float:posY = 0.0, Float:posZ = 0.0, Float:distance = 50.0, usepos = 0) { if(IsValidYoutubeUrl(url)) { PlayYoutubeStreamForPlayer(playerid, url, posX, posY, posZ, distance, usepos); } else { PlayAudioStreamForPlayer(playerid, url, posX, posY, posZ, distance, usepos); } } #if defined _ALS_PlayAudioStreamForPlayer #undef PlayAudioStreamForPlayer #else #define _ALS_PlayAudioStreamForPlayer #endif #define PlayAudioStreamForPlayer PlayAudioStream_Ex // Elevator statics static FloorNames[21][] = { "Ground Floor", "First Floor", "Second Floor", "Third Floor", "Fourth Floor", "Fifth Floor", "Sixth Floor", "Seventh Floor", "Eighth Floor", "Ninth Floor", "Tenth Floor", "Eleventh Floor", "Twelfth Floor", "Thirteenth Floor", "Fourteenth Floor", "Fifteenth Floor", "Sixteenth Floor", "Seventeenth Floor", "Eighteenth Floor", "Nineteenth Floor", "Penthouse" }; static Float:FloorZOffsets[21] = { 0.0, // 0.0, 43.3501, // 43.3501, 48.80165, // 43.3501 + (5.45155 * 1.0), 54.2532, // 43.3501 + (5.45155 * 2.0), 59.70475, // 43.3501 + (5.45155 * 3.0), 65.1563, // 43.3501 + (5.45155 * 4.0), 70.60785, // 43.3501 + (5.45155 * 5.0), 76.0594, // 43.3501 + (5.45155 * 6.0), 81.51095, // 43.3501 + (5.45155 * 7.0), 86.9625, // 43.3501 + (5.45155 * 8.0), 92.41405, // 43.3501 + (5.45155 * 9.0), 97.8656, // 43.3501 + (5.45155 * 10.0), 103.31715, // 43.3501 + (5.45155 * 11.0), 108.7687, // 43.3501 + (5.45155 * 12.0), 114.22025, // 43.3501 + (5.45155 * 13.0), 119.6718, // 43.3501 + (5.45155 * 14.0), 125.12335, // 43.3501 + (5.45155 * 15.0), 130.5749, // 43.3501 + (5.45155 * 16.0), 136.02645, // 43.3501 + (5.45155 * 17.0), 141.478, // 43.3501 + (5.45155 * 18.0), 146.92955 // 43.3501 + (5.45155 * 19.0) }; //----------------------------------------- // Dynamic Dealership, dealership vehicles: #define MAX_DEALERSHIPS 15 // You can change it if you wish, make sure you check dealerships count before creating a new one. #define TYPE_NONE -1 #define TYPE_CAR 0 #define TYPE_BIKE 1 #define TYPE_PLANE 2 #define TYPE_BOAT 3 new Iterator:DealerVeh, Iterator:DealerShip, dships, vehs ; enum { REASON_THIRST, REASON_HUNGER, REASON_ALL } new PlayerText:pHungerTD[MAX_PLAYERS]; // numbers new PlayerText:pThirstTD[MAX_PLAYERS]; new PlayerText:HungerTD[MAX_PLAYERS]; // burger new PlayerText:ThirstTD[MAX_PLAYERS]; // drink forward FlasherFunc(); new obj[MAX_VEHICLES] = { INVALID_OBJECT_ID, ... }; new obj2[MAX_VEHICLES] = { INVALID_OBJECT_ID, ... }; new LightPwr[MAX_VEHICLES]; new Flasher[MAX_VEHICLES] = 0; new FlasherState[MAX_VEHICLES]; new FlashTimer; enum dsinfo { dID, // mysql id dName[40], dType, Float: dX, Float: dY, Float: dZ, Float: dRange, Float: dspawnX, Float: dspawnY, Float: dspawnZ, Float: dspawnfA, dPickUp, Text3D:dLabel, dMapIcon } new dsData[MAX_DEALERSHIPS][dsinfo]; enum vinfo { vID, // mysql id Float: posx, Float: posy, Float: posz, Float: vfA, vModel, vModelID, vPrice, Text3D:vLabel } new vehData[MAX_VEHICLES][vinfo]; enum { DIALOG_FINDDEALERSHIP, DIALOG_NONE = 1, DIALOG_REGISTER, DIALOG_AHELP, DIALOG_ACMDS, DIALOG_CONFIRMPASS, DIALOG_LOGIN, DIALOG_GENDER, DIALOG_RACKWEAPONS, DIALOG_AGE, DIALOG_REFERRAL, DIALOG_INTERIORS, DIALOG_GRAFFITICOLOR, DIALOG_GRAFFITITEXT, DIALOG_BUYFURNITURETYPE, DIALOG_BUYFURNITURE1, DIALOG_BUYFURNITURE2, DIALOG_BUY, DIALOG_BUYCLOTHES, DIALOG_PICKLOAD, DIALOG_UNREADTEXTS, DIALOG_ATM, DIALOG_ATMDEPOSIT, DIALOG_ATMWITHDRAW, DIALOG_CHANGEPASS, DIALOG_BUYCLOTHINGTYPE, DIALOG_BUYCLOTHING, DIALOG_CLOTHING, DIALOG_CLOTHINGMENU, DIALOG_CLOTHINGEDIT, DIALOG_CLOTHINGBONE, DIALOG_BUYVEHICLE, DIALOG_BUYVEHICLE2, DIALOG_BUYBOAT, DIALOG_BUYAIRCRAFT, DIALOG_SPAWNCAR, DIALOG_DESPAWNCAR, DIALOG_CARSTORAGE, DIALOG_FINDCAR, DIALOG_BIZINTERIOR, DIALOG_FACTIONLOCKER, DIALOG_FACTIONEQUIPMENT, DIALOG_FACTIONSKINS, DIALOG_HITMANCLOTHES, DIALOG_MDC, DIALOG_MDCWANTED, DIALOG_MDCPLAYER1, DIALOG_MDCPLAYER2, DIALOG_MDCCHARGES, DIALOG_PLAYERLOOKUP, DIALOG_VEHICLELOOKUP1, DIALOG_VEHICLELOOKUP2, DIALOG_FACTIONPAY1, DIALOG_FACTIONPAY2, DIALOG_PHONEBOOK, DIALOG_CREATEZONE, DIALOG_CONFIRMZONE, DIALOG_LANDBUILDTYPE, DIALOG_LANDBUILD1, DIALOG_LANDBUILD2, DIALOG_LANDMENU, DIALOG_LANDUPGRADE, DIALOG_LANDEDITOBJECT, DIALOG_LANDOBJECTMENU, DIALOG_LANDOBJECTS, DIALOG_LANDSELLALL, DIALOG_LANDPERMS, DIALOG_MP3PLAYER, DIALOG_MP3MUSIC, DIALOG_MP3RADIO, DIALOG_MP3URL, DIALOG_MP3RADIOGENRES, DIALOG_MP3RADIOSUBGENRES, DIALOG_MP3RADIORESULTS, DIALOG_MP3RADIOSEARCH, DIALOG_USECOOKIES, DIALOG_COOKIESHOUTOUT, DIALOG_COOKIEWEATHER, DIALOG_COOKIENUMBER, DIALOG_COOKIEJOB, DIALOG_GANGSTASH, DIALOG_GANGSTASHVEST, DIALOG_GANGSTASHVESTRANK, DIALOG_GANGSTASHWEAPONS1, DIALOG_GANGSTASHWEAPONS2, DIALOG_GANGSTASHWEAPONRANK, DIALOG_GANGSTASHDRUGS1, DIALOG_GANGSTASHDRUGS2, DIALOG_GANGSTASHCRAFT, DIALOG_GANGSTASHMATS, DIALOG_GANGSTASHCASH, DIALOG_GANGDEPOSIT, DIALOG_GANGWITHDRAW, DIALOG_GANGSKINS, DIALOG_GANGFINDCAR, DIALOG_GANGPOINTSHOP, DIALOG_GANGARMSDEALER, DIALOG_GANGARMSWEAPONS, DIALOG_GANGARMSEDIT, DIALOG_GANGARMSPRICES, DIALOG_GANGARMSPRICE, DIALOG_GANGARMSDEPOSITMATS, DIALOG_GANGARMSWITHDRAWMATS, DIALOG_GANGDRUGDEALER, DIALOG_GANGDRUGSHOP, DIALOG_GANGDRUGEDIT, DIALOG_GANGDRUGPRICES, DIALOG_GANGDRUGPRICE, DIALOG_GANGDRUGBUY, DIALOG_GANGDRUGDEPOSITS, DIALOG_GANGDRUGDEPOSIT, DIALOG_GANGDRUGWITHDRAWS, DIALOG_GANGDRUGWITHDRAW, DIALOG_FREENAMECHANGE, DIALOG_REMOVEFLAG, DIALOG_NEWBIEUNMUTE, DIALOG_REPORTUNMUTE, DIALOG_GLOBALUNMUTE, DIALOG_REMOVEPVEH, DIALOG_CRACKTRUNK, DIALOG_HOUSEINTERIORS, DIALOG_VIPMUSIC, DIALOG_NEWBWELCOME, DIALOG_HELP, DIALOG_STATS, DIALOG_LSELEVATOR, DIALOG_TUTORIAL, DIALOG_USERIMKIT, DIALOG_TURFLIST, DIALOG_TURFLIST2, DIALOG_LOCATE, DIALOG_LOCATELIST1, DIALOG_LOCATELIST2, DIALOG_LOCATELIST3, DIALOG_LOCATELISTC, DIALOG_LOCATETURFS, DIALOG_LOCATEPOINTS, DIALOG_RULES, DIALOG_PAYCHECK, DIALOG_CREATEPOLL, DIALOG_POLLANSWER, DIALOG_POLLVIEW, DIALOG_CREATEQUIZ, DIALOG_DELETEOBJECT, DIALOG_ADDSTATION, DIALOG_TYPE_MAIN, DIALOG_TYPE_EXHAUSTS, DIALOG_TYPE_FBUMPS, DIALOG_TYPE_RBUMPS, DIALOG_TYPE_ROOFS, DIALOG_TYPE_SPOILERS, DIALOG_TYPE_SIDESKIRTS, DIALOG_TYPE_BULLBARS, DIALOG_TYPE_WHEELS, DIALOG_TYPE_CSTEREO, DIALOG_TYPE_HYDRAULICS, DIALOG_TYPE_NITRO, DIALOG_TYPE_LIGHTS, DIALOG_TYPE_HOODS, DIALOG_TYPE_VENTS } enum { VEHICLE_ENGINE, VEHICLE_LIGHTS, VEHICLE_ALARM, VEHICLE_DOORS, VEHICLE_BONNET, VEHICLE_BOOT, VEHICLE_OBJECTIVE }; enum { STASH_CAPACITY_CASH, STASH_CAPACITY_MATERIALS, STASH_CAPACITY_WEED, STASH_CAPACITY_COCAINE, STASH_CAPACITY_METH, STASH_CAPACITY_PAINKILLERS, STASH_CAPACITY_WEAPONS }; enum { E_OBJECT_TYPE, E_OBJECT_INDEX_ID, E_OBJECT_EXTRA_ID, E_OBJECT_3DTEXT_ID, E_OBJECT_OPENED, E_OBJECT_WEAPONID, E_OBJECT_FACTION, E_OBJECT_X, E_OBJECT_Y, E_OBJECT_Z }; enum { E_OBJECT_FURNITURE, E_OBJECT_WEAPON, E_OBJECT_LAND }; enum { EDIT_FURNITURE_PREVIEW = 1, EDIT_FURNITURE, EDIT_CLOTHING_PREVIEW, EDIT_CLOTHING, EDIT_LAND_OBJECT_PREVIEW, EDIT_LAND_OBJECT, EDIT_LAND_GATE_MOVE, EDIT_COP_CLOTHING }; enum { DEPLOY_SPIKESTRIP, DEPLOY_CONE, DEPLOY_ROADBLOCK, DEPLOY_BARREL, DEPLOY_FLARE }; enum { BUSINESS_STORE, BUSINESS_Ammunation, BUSINESS_CLOTHES, BUSINESS_GYM, BUSINESS_RESTAURANT, BUSINESS_AGENCY, BUSINESS_BARCLUB, BUSINESS_TOOLSHOP }; enum { FACTION_NONE, FACTION_POLICE, FACTION_MEDIC, FACTION_NEWS, FACTION_GOVERNMENT, FACTION_HITMAN, FACTION_FEDERAL, FACTION_ARMY, FACTION_TERRORIST }; enum { JOB_NONE = -1, JOB_PIZZAMAN, JOB_COURIER, JOB_FISHERMAN, JOB_BODYGUARD, JOB_WEAPONDEALER, JOB_MECHANIC, JOB_MINER, JOB_SWEEPER, JOB_TAXIDRIVER, JOB_DRUGDEALER, JOB_LAWYER, JOB_DETECTIVE, JOB_THIEF, JOB_GARBAGEMAN, JOB_FARMER, JOB_PILOT, JOB_OILGATHER, JOB_OILREFINE }; enum { CHECKPOINT_NONE = 0, CHECKPOINT_PIZZA, CHECKPOINT_TEST, CHECKPOINT_MINING, CHECKPOINT_MATS, CHECKPOINT_DRUGS, CHECKPOINT_HOUSE, CHECKPOINT_ROBBERY, CHECKPOINT_DROPCAR, CHECKPOINT_MISC, CHECKPOINT_GARBAGE, CHECKPOINT_FARMER }; enum { HANGUP_DROPPED, HANGUP_USER }; enum { MUSIC_NONE, MUSIC_MP3PLAYER, MUSIC_BOOMBOX, MUSIC_VEHICLE }; enum { ITEM_WEAPON, ITEM_SELLGUN, ITEM_MATERIALS, ITEM_WEED, ITEM_COCAINE, ITEM_METH, ITEM_PAINKILLERS, ITEM_SEEDS, ITEM_EPHEDRINE, ITEM_CASH }; enum { CAPACITY_MATERIALS, CAPACITY_WEED, CAPACITY_COCAINE, CAPACITY_METH, CAPACITY_PAINKILLERS, CAPACITY_SEEDS, CAPACITY_EPHEDRINE, CAPACITY_OIL }; enum { LIMIT_HOUSES, LIMIT_BUSINESSES, LIMIT_GARAGES, LIMIT_VEHICLES }; enum { POINT_DRUGFACTORY = 1, POINT_DRUGDEN, POINT_CRACKHOUSE, POINT_AUTOEXPORT, POINT_FUEL, POINT_MATPICKUP1, POINT_MATPICKUP2, POINT_MATFACTORY1, POINT_MATFACTORY2 }; enum { GANGWEAPON_9MM, GANGWEAPON_SDPISTOL, GANGWEAPON_DEAGLE, GANGWEAPON_SHOTGUN, GANGWEAPON_SAWNOFF, GANGWEAPON_TEC9, GANGWEAPON_UZI, GANGWEAPON_MP5, GANGWEAPON_AK47, GANGWEAPON_M4, GANGWEAPON_RIFLE, GANGWEAPON_SNIPER, GANGWEAPON_MOLOTOV }; enum { TAG_NONE, TAG_ADMIN, TAG_HELPER, TAG_VIP }; enum { GRAPHICRANK_NONE = 0, GRAPHICRANK_REGULAR, GRAPHICRANK_SENIOR, GRAPHICRANK_MANAGER }; enum { ZONETYPE_LAND = 1, ZONETYPE_TURF, ZONETYPE_POINT }; enum { DOOR_DRIVER, DOOR_PASSENGER }; enum { HOSPITAL_COUNTY = 1, }; enum pEnum { bool:pHasTimer, pTimer[2], pLoseHealth, pLoseReason, bool:pInformed, pHunger, pThirst, PlayerText:pText[10], pPassword[129], pUsername[MAX_PLAYER_NAME], pID, pLogged, pKicked, pLoginTries, pSetup, pGender, pAge, pSkin, Float:pCameraX, Float:pCameraY, Float:pCameraZ, Float:pPosX, Float:pPosY, Float:pPosZ, Float:pPosA, pInterior, pWorld, pCash, pBank, pPaycheck, pvLock, pLevel, pEXP, pGraphic, pMinutes, pHours, pAdmin, pGraffiti, pGraffitiTime, pGraffitiColor, pGraffitiText[64 char], pEditGraffiti, pEditRack, pAdminName[MAX_PLAYER_NAME], pHelper, Float:pHealth, Float:pArmor, pUpgradePoints, pWarnings, pInjured, pHospital, Float:pSpawnHealth, Float:pSpawnArmor, pJailType, pJailTime, pNewbieMuted, pHelpMuted, pAdMuted, pLiveMuted, pGlobalMuted, pReportMuted, pReportWarns, pFightStyle, pAccent[16], pCookies, pPhone, pSpeakerPhone, pJob, pSecondJob, pCrimes, pArrested, pWantedLevel, pMaterials, pWeed, pCocaine, pMeth, pPainkillers, pSeeds, pEphedrine, pMuriaticAcid, pBakingSoda, pCigars, pWalkieTalkie, pChannel, pRentingHouse, pSpraycans, pBoombox, pMP3Player, pPhonebook, pFishingRod, pFishingBait, pFishWeight, pComponents, pCourierSkill, pFishingSkill, pGuardSkill, pWeaponSkill, pMechanicSkill, pLawyerSkill, pSmugglerSkill, pDetectiveSkill, pThiefSkill, pDealerSkill, pToggleTextdraws, pToggleTP, pToggleOOC, pTogglePhone, pToggleAdmin, pToggleHelper, pToggleNewbie, pToggleWT, pToggleRadio, pToggleVIP, pToggleMusic, pToggleFaction, pToggleGang, pToggleNews, pToggleGlobal, pToggleCam, pToggleHUD, pToggleReports, pToggleWhisper, pToggleBug, pCarLicense, pVIPPackage, pVIPTime, pVIPCooldown, pWeapons[13], pTempWeapons[13], pFaction, pFactionRank, pFactionLeader, pGang, pWebDev, pGangRank, pDivision, pCrew, pContracted, pContractBy[MAX_PLAYER_NAME], pBombs, pCompletedHits, pFailedHits, pReports, pNewbies, pHelpRequests, pSpeedometer, // (1) KM/H (2) MPH pFactionMod, pGangMod, pBanAppealer, pFormerAdmin, pDeveloper, pAdminPersonnel, pDynamicAdmin, pHelperManager, pHumanResources, pComplaintMod, pGameAffairs, pWeedPlanted, pWeedTime, pWeedGrams, Float:pWeedX, Float:pWeedY, Float:pWeedZ, Float:pWeedA, pInventoryUpgrade, pAddictUpgrade, pTraderUpgrade, pAssetUpgrade, pLaborUpgrade, pDMWarnings, pWeaponRestricted, pReferralUID, pWatch, pGPS, pPrisonedBy[MAX_PLAYER_NAME], pPrisonReason[128], pClothes, pShowLands, pShowTurfs, pWatchOn, pGPSOn, pDoubleXP, pCourierCooldown, pPizzaCooldown, pDetectiveCooldown, pGunLicense, pThiefCooldown, pCocaineCooldown, pGasCan, pPassport, pPassportName[MAX_PLAYER_NAME], pPassportLevel, pPassportSkin, pPassportPhone, pNewbieMuteTime, pReportMuteTime, pGlobalMuteTime, pAdminHide, pInsurance, pRope, pTotalPatients, pTotalFires, pFirstAid, pPoliceScanner, pBodykits, pRimkits, pScannerOn, pCurrentAmmo, pACAmmo, pLastReport, pLastNewbie, pLastRequest, pLastPay, pLastRepair, pLastRefuel, pLastDrug, pLastDefend, pLastSell, pLastEnter, pLastPress, pLastDeath, pLastDesync, pLastGlobal, pLastPizza, pLastStuck, pLastUpdate, pLastLoad, pLastBet, pLastShot, pLastFire, pFPS, pDrunkLevel, pSpectating, pAdminDuty, pActiveReport, pHospitalTime, pHospitalType, pListen, pJoinedEvent, //pPaintball, //pPaintballTeam, //pDueling, pEventTeam, pAwaitingClothing, pTutorial, pTutorialTimer, pFreezeTimer, pHelpRequest[128], pAcceptedHelp, pHouseOffer, pHouseOffered, pHousePrice, pGarageOffer, pGarageOffered, pGaragePrice, pBizOffer, pBizOffered, pBizPrice, pVestOffer, pVestPrice, pCarOffer, pCarOffered, pCarPrice, pFactionOffer, pFactionOffered, pGangOffer, pGangOffered, pFriskOffer, pTicketOffer, pTicketPrice, pLiveOffer, pLiveBroadcast, pShakeOffer, pShakeType, pLandOffer, pLandOffered, pLandPrice, pSellOffer, pAllianceOffer, pWarOffer, pSellType, pSellExtra, pSellPrice, pDefendOffer, pDefendPrice, pDiceOffer, pDiceBet, pDiceRigged, pInviteOffer, pInviteHouse, pRobberyOffer, //pDuelOffer, pFurnitureIndex, pFurnitureHouse, pObjectLand, pClothingIndex, pEditType, pEditObject, pCategory, pSelected, pFactionEdit, pPrice, pFurniturePerms, pLandPerms, pPizzas, pPizzaTime, Float:pDistance, pCP, pShipment, pFishTime, pUsedBait, pSmuggleMats, pSmuggleDrugs, pRefuel, pRefuelAmount, pCallLine, pCallStage, Float:pAFKPos[6], pAFK, pAFKTime, pLoopAnim, pDrivingTest, pTestVehicle, pTestCP, pMiningTime, pMiningRock, pSweeping, pSweepTime, pSweepEarnings, Text3D:pSpecialTag, pTagType, pVIPColor, pTaxiFare, pTaxiPassenger, pTaxiBill, pTaxiTime, pSkinSelected, pDuty, pBackup, pTazer, pTazedTime, pCuffed, pTied, pDraggedBy, pReceivingAid, pDelivered, pPlantedBomb, Float:pBombX, Float:pBombY, Float:pBombZ, pBombObject, pContractTaken, pPage, pSpamTime, pMuted, Text3D:pBoomboxText, pBoomboxPlaced, // BOOMBOX pBoomboxObject, pBoomboxListen, pBoomboxURL[128], Float:pMinX, // LAND CREATION Float:pMinY, Float:pMaxX, Float:pMaxY, pZoneType, pZonePickups[4], pZoneID, pZoneCreation, // pLandCost, pTurfType, pTurfName[32], pGenre[32], pSubgenre[32], pSearch, pMusicType, pStreamType, pNameChange[MAX_PLAYER_NAME], pFreeNamechange, pChosenLevel, pChosenSkin, pVehicleKeys, pCurrentWeapon, pCurrentVehicle, pVehicleCount, pACWarns, pACTime, pACFired, pArmorTime, pWeedObject, pPickPlant, pPickTime, pCookMeth, pCookTime, pCookGrams, pDrugsUsed, pDrugsTime, pBandana, pGangCar, pCapturingPoint, pCaptureTime, Float:pPointX, Float:pPointY, Float:pPointZ, pWatchingIntro, // server intro pLoginCamera, pSmuggleTime, pDealerGang, pPoisonTime, pJetpack, pTextFrom, pWhisperFrom, pMechanicCall, pTaxiCall, pEmergencyCall, pEmergencyType, pEmergency[128], pClip, pReloading, pFindTime, pFindPlayer, pRobCash, pLootTime, pRemoveFrom, pCBug, pMenuType, pSniper, Text3D:pLockText, Float:pLockHealth, pLockBreak, pLockTimer, pAnimation, pDropTime, pCocaineTrunk, pCocaineTime, pCocaineFrom, pRapidFire, pNoDamage, pGodmode, Float:pGodmodeHP, Float:pGodmodeAP, pNOPTime, pPreviewHouse, pPreviewType, pPreviewTime, pDedication, pPasswordChanged, pGarbage, pDamageTimer, pHHCheck, pHHTime, pHHRounded, pHHCount, pCustomTitle[64], pCustomTColor, pGovTimer, pGodshand, pUndercover[2], Float:pUndercoverHP, Float:pUndercoverAR, pHurt, pBugged, pSkates, pSkateObj, bool:pSkating, bool:pSkateAct, pOil, pCreatingPoll, pAnsweredPoll, pRareTime, pAcceptedEMS, pHunted, pHuntKilled, pDiamonds, pDeleteMode, pAdvertWarnings, pNoKnife, pExecute, pMarriedTo, pMarriedName[MAX_PLAYER_NAME], pMarriageOffer, pStationEdit, pEngine, pCrash, pRobbingBiz, Text3D:pMaskLabel,//Mask system begins pMaskTime, // waiting time pMaskID, // the maskID pMaskOn, // determines if the mask is on or not pMask // if a player purchases a mask }; enum rEnum { rExists, rReporter, rAccepted, rHandledBy, rText[128], rTime }; enum eventEnum { eReady, eStarted, eLocked, eType, // (1) DM (2) TDM (3) Race eJoinText[128], Float:eHealth, Float:eArmor, Float:ePosX[2], Float:ePosY[2], Float:ePosZ[2], Float:ePosA[2], eInterior, eWorld, eWeapons[5], eSkin[2], eCS, eQS, eHeal, eNext }; enum robberyEnum { rTime, rPlanning, rStarted, rStolen, rRobbers[MAX_BANK_ROBBERS], rObjects[2], Text3D:rText[5] }; enum mEnum { Float:mPosX, Float:mPosY, Float:mPosZ, Float:mPosA, mInterior, mWorld }; enum speedData { speedID, speedExists, Float:speedPos[4], Float:speedRange, Float:speedLimit, speedObject, Text3D:speedText3D }; new SpeedData[MAX_SPEED_CAMERAS][speedData]; enum graffitiData { graffitiID, graffitiExists, Float:graffitiPos[4], graffitiIcon, graffitiObject, graffitiColor, graffitiText[64] }; new GraffitiData[MAX_GRAFFITI_POINTS][graffitiData]; enum rackData { rackID, rackExists, rackHouse, Float:rackPos[4], rackInterior, rackWorld, rackWeapons[4], rackObjects[5], Text3D:rackText3D }; new RackData[MAX_WEAPON_RACKS][rackData]; enum hEnum { hExists, hID, hOwnerID, hOwner[MAX_PLAYER_NAME], // hMapIcon, hType, hPrice, hRentPrice, hLevel, hLocked, hTimestamp, Float:hPosX, Float:hPosY, Float:hPosZ, Float:hPosA, Float:hIntX, Float:hIntY, Float:hIntZ, Float:hIntA, hInterior, hWorld, hOutsideInt, hOutsideVW, hCash, hMaterials, hWeed, hCocaine, hMeth, hPainkillers, hWeapons[10], hLabels, hPickup, Text3D:hText, hDelivery, hLights }; enum gEnum { gExists, gID, gOwnerID, gOwner[MAX_PLAYER_NAME], gType, gPrice, gLocked, gTimestamp, gFreeze, Float:gPosX, Float:gPosY, Float:gPosZ, Float:gPosA, Float:gExitX, Float:gExitY, Float:gExitZ, Float:gExitA, gWorld, gPickup, Text3D:gText }; enum bEnum { bExists, bID, bOwnerID, bOwner[MAX_PLAYER_NAME], bType, bPrice, bEntryFee, bLocked, bTimestamp, Float:bPosX, Float:bPosY, Float:bPosZ, Float:bPosA, Float:bIntX, Float:bIntY, Float:bIntZ, Float:bIntA, bInterior, bWorld, bOutsideInt, bOutsideVW, bCash, bProducts, bMaterials, bPickup, bMapIcon, Text3D:bText }; enum eEnum { eExists, eID, eOwnerID, eOwner[MAX_PLAYER_NAME], eName[40], eIcon, eLocked, Float:eRadius, Float:ePosX, Float:ePosY, Float:ePosZ, Float:ePosA, Float:eIntX, Float:eIntY, Float:eIntZ, Float:eIntA, eInterior, eWorld, eOutsideInt, eOutsideVW, eAdminLevel, eFactionType, eGang, eVIP, eVehicles, eFreeze, ePassword[64], eLabel, eType, eMapIcon, ePickup, eMapIconID, Text3D:eText, eColor }; enum cEnum { cExists, cID, cName[32], cModel, cBone, cAttached, Float:cPosX, Float:cPosY, Float:cPosZ, Float:cRotX, Float:cRotY, Float:cRotZ, Float:cScaleX, Float:cScaleY, Float:cScaleZ, cAttachedIndex }; enum vEnum { vID, vOwnerID, vOwner[MAX_PLAYER_NAME], vModel, vPrice, vTickets, vLocked, vPlate[32], Float:vHealth, Float:vPosX, Float:vPosY, Float:vPosZ, Float:vPosA, vColor1, vColor2, vPaintjob, vInterior, vWorld, vNeon, vNeonEnabled, vTrunk, vAlarm, vMods[14], vCash, vMaterials, vWeed, vCocaine, vMeth, vPainkillers, vWeapons[5], vGang, vFactionType, vVIP, vJob, vRespawnDelay, vObjects[2], vTimer, bool:vForSale, vForSalePrice, Text3D:vForSaleLabel, vRank }; enum fEnum { fName[48], fShortName[24], fMOTD[128], fLeader[MAX_PLAYER_NAME], fType, fColor, fRankCount, fBudget, fSkins[MAX_FACTION_SKINS], fPaycheck[MAX_FACTION_RANKS], fTurfcookies, Text3D:fText, fPickup, }; enum lkEnum { lID, lExists, lFaction, Float:lPosX, Float:lPosY, Float:lPosZ, lInterior, lWorld, lLabel, lIcon, locKevlar[2], locMedKit[2], locNitestick[2], locMace[2], locDeagle[2], locShotgun[2], locMP5[2], locM4[2], locSniper[2], locCamera[2], locFireExt[2], locPainKillers[2], Text3D:lText, lPickup }; enum dEnum { dExists, dType, Float:dPosX, Float:dPosY, Float:dPosZ, Float:dPosA, dObject }; enum lEnum { lExists, lID, lOwnerID, lOwner[MAX_PLAYER_NAME], lLevel, lPrice, Float:lMinX, Float:lMinY, Float:lMaxX, Float:lMaxY, Float:lHeight, lGangZone, lArea, Text3D:lTextdraw, lLabels }; enum gaEnum { gSetup, gName[32], gMOTD[128], gLeader[MAX_PLAYER_NAME], gColor, gStrikes, gLevel, gPoints, gTurfcookies, Float:gStashX, Float:gStashY, Float:gStashZ, gStashInterior, gStashWorld, gCash, gMaterials, gWeed, gCocaine, gMeth, gPainkillers, gSkins[MAX_GANG_SKINS], gWeapons[14], gWeaponRanks[14], gVestRank, gArmsDealer, gDrugDealer, Float:gArmsX, Float:gArmsY, Float:gArmsZ, Float:gArmsA, Float:gDrugX, Float:gDrugY, Float:gDrugZ, Float:gDrugA, gArmsWorld, gDrugWorld, gDrugWeed, gDrugCocaine, gDrugMeth, gArmsMaterials, gArmsPrices[12], gDrugPrices[3], Text3D:gText[3], gPickup, gActors[2], gAlliance, gMatLevel, gGunLevel, gInvCooldown, }; enum ptEnum { pExists, pName[32], pCapturedBy[MAX_PLAYER_NAME], pCapturedGang, pType, pProfits, pTime, Float:pPointX, Float:pPointY, Float:pPointZ, Float:pMinX, Float:pMinY, Float:pMaxX, Float:pMaxY, pGangZone, pArea, pPointInterior, pPointWorld, pCaptureTime, pCapturer, Text3D:pText, pPickup }; enum tEnum { tExists, tName[32], tCapturedBy[MAX_PLAYER_NAME], tCapturedGang, tType, tTime, Float:tMinX, Float:tMinY, Float:tMaxX, Float:tMaxY, Float:tHeight, tGangZone, tArea, tCaptureTime, tCapturer }; // --------------------------------------- #if defined SERVER_INTRO new Text:introTextdraws[26]; #endif new connectionID; new radioConnectionID; new queryBuffer[1024]; new Text:WebsiteTD; new Text:AnimationTD; new Text:TimeTD; new Text:LoginScreen[11]; new enabledOOC; new enabledNewbie = 1; new enabledGlobal = 1; new enabledReports = 1; new pizzaVehicles[6]; new courierVehicles[4]; new sweeperVehicles[4]; new taxiVehicles[4]; new testVehicles[5]; new garbageVehicles[6]; new Text:Tutorial[4]; new Text:Damage[MAX_PLAYERS]; new gHour, gWorldTime, gWeather = 13; new gCharity, gCharityHealth, gCharityArmor; new gPlayerRecord, gRecordDate[24], gServerMOTD[128], gTax, gVault, gNewsVault, gAnticheatBans; new adminMOTD[128], helperMOTD[128]; new MaxCapCount[2] = { 2 , 1 }; // index: 0 = turfs, 1 = points new gacooldown; new gConnections, gTotalRegistered, gTotalKills, gTotalDeaths, gTotalHours; new gDoubleXP, gDisabledVPN = 1, antiNT = 1; new gLastAd; new gLastMusic; new gGMX; new gAnticheat = 1; new gPaycheck; new gVIPHealth, gVIPArmor; new gParachutes[2]; new gSeedsStock = 200, gCocaineStock = 100, gEphedrineStock = 50; new Text3D:gSeedsStockText, Text3D:gCocaineText, Text3D:gEphedrineStockText; new gPrisonCells[24], gPDDoors[8], gPDGates[4], gFBIGates[2], gHIKGates[1], gHIKDoors[2]; new gFires, gFireObjects[MAX_FIRES] = {INVALID_OBJECT_ID, ...}, Float:gFireHealth[MAX_FIRES]; new gScriptObject[MAX_OBJECTS char]; //new zone_paintball[2], area_paintball[2]; //new pbNext; new FarmerVehicles[19]; new Harvesting[MAX_PLAYERS]; new aimWarnings[MAX_PLAYERS]; new quizQuestion[72]; new quizAnswer[32]; new CreateQuiz = -1; new pollQuestion[72]; new pollAnswers[2][32]; new pollAnswerCount[2]; //new BobTheBuilder[MAX_PLAYERS] = 0; new EventInfo[eventEnum]; new RobberyInfo[robberyEnum]; new MarkedPositions[MAX_PLAYERS][3][mEnum]; new PlayerInfo[MAX_PLAYERS+1][pEnum]; new ReportInfo[MAX_REPORTS][rEnum]; new HouseInfo[MAX_HOUSES][hEnum]; new GarageInfo[MAX_GARAGES][gEnum]; new BusinessInfo[MAX_BUSINESSES][bEnum]; new EntranceInfo[MAX_ENTRANCES][eEnum]; new ClothingInfo[MAX_PLAYERS][MAX_PLAYER_CLOTHING][cEnum]; new VehicleInfo[MAX_VEHICLES][vEnum]; new FactionInfo[MAX_FACTIONS][fEnum]; new FactionRanks[MAX_FACTIONS][MAX_FACTION_RANKS][32]; new FactionDivisions[MAX_FACTIONS][MAX_FACTION_DIVISIONS][32]; new GangCrews[MAX_GANGS][MAX_GANG_CREWS][32]; /*enum crEnum { cID, cName[32], cfamID, cType, cLeader[MAX_PLAYER_NAME], cMembers }; new DivisionInfo[MAX_FACTION_DIVISIONS][crEnum]; new CrewInfo[MAX_FACTION_DIVISIONS][crEnum];*/ new LockerInfo[MAX_LOCKERS][lkEnum]; new DeployInfo[MAX_DEPLOYABLES][dEnum]; new LandInfo[MAX_LANDS][lEnum]; new GangInfo[MAX_GANGS][gaEnum]; new GangRanks[MAX_GANGS][7][32]; new PointInfo[MAX_POINTS][ptEnum]; new TurfInfo[MAX_TURFS][tEnum]; new adminVehicle[MAX_VEHICLES char]; new vehicleFuel[MAX_VEHICLES] = {100, ...}; new vehicleSiren[MAX_VEHICLES] = {INVALID_OBJECT_ID, ...}; new vehicleStream[MAX_VEHICLES][128]; new vehicleColors[MAX_VEHICLES][2]; new bool:chattingWith[MAX_PLAYERS][MAX_PLAYERS char]; new Text3D:vehicleCallsign[MAX_VEHICLES] = {Text3D:INVALID_3DTEXT_ID, ...}; new PayCheckCode[MAX_PLAYERS]; // --------------------------------------- new const vehicleNames[212][] = { "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel", "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus", "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam", "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection", "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus", "Rhino", "Barracks", "Hotknife", "Article Trailer", "Previon", "Coach", "Cabbie", "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral", "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Article Trailer 2", "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", "ZR-350", "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", "Cropduster", "Stuntplane", "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra", "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune", "Cadrona", "SWAT Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer", "Remington", "Slamvan", "Blade", "Streak", "Freight", "Vortex", "Vincent", "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo", "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite", "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratum", "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito", "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper", "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400", "News Van", "Tug", "Petrol Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "Freight Box", "Article Trailer 3", "Andromada", "Dodo", "RC Cam", "Launch", "LSPD Car", "SFPD Car", "LVPD Car", "Police Rancher", "Picador", "S.W.A.T", "Alpha", "Phoenix", "Glendale", "Sadler", "Luggage", "Luggage", "Stairs", "Boxville", "Tiller", "Utility Trailer" }; new const weaponSlotIDs[] = { 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 10, 10, 10, 10, 10, 10, 8, 8, 8, 0, 0, 0, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 4, 6, 6, 7, 7, 7, 7, 8, 12, 9, 9, 9, 11, 11, 11 }; new const weaponModelIDs[] = { 0, 331, 333, 334, 335, 336, 337, 338, 339, 341, 321, 322, 323, 324, 325, 326, 342, 343, 344, 0, 0, 0, 346, 347, 348, 349, 350, 351, 352, 353, 355, 356, 372, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 368, 371 }; new const clothesShopSkins[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311 }; enum houseInt { intClass[16], intPrice, intID, Float:intX, Float:intY, Float:intZ, Float:intA }; new const houseInteriors[][houseInt] = { {"Room", 25000, 1, 1439.4312,1471.5541,-9.8237, 270.4707}, {"Appartment", 35000, 1, 2434.9004,-1622.6023,1568.9280, 359.6805}, //{"Appartment", 60000, 1, 357.2822,2031.9022,-14.6329, 354.9103}, {"Appartment", 70000, 1, 429.2064,2505.5627,-14.3614, 88.5978}, {"Medium", 125000, 2, 1571.8921,1800.4998,-19.6785, 87.8066}, {"Medium", 150000, 1, 1327.3125,-1071.0536,3458.9060, 83.6312}, {"Large", 300000, 10, 1697.2710,-1417.4613,37.3089, 177.2721} //{"Large", 525000, 10, 1651.5103,1559.8696,-19.8156, 270.0000} }; enum garageInt { intName[16], intPrice, intID, Float:intPX, Float:intPY, Float:intPZ, Float:intPA, Float:intVX, Float:intVY, Float:intVZ, Float:intVA }; new const garageInteriors[][garageInt] = { {"Small", 100000, 1, 1521.2797, -1639.7163, 1124.5045, 180.0000, 1516.8326, -1643.9105, 1124.3364, 180.0000}, {"Medium", 125000, 2, 1520.6278, -1639.7173, 1374.5045, 180.0000, 1514.9481, -1644.1083, 1374.3365, 180.0000}, {"Large", 250000, 3, 1672.8816, -2363.5818, 1535.4829, 90.0000, 1660.5437, -2362.9001, 1535.2944, 0.0000} }; enum bizInt { intType[24], intPrice, intID, Float:intX, Float:intY, Float:intZ, Float:intA }; new const bizInteriors[][bizInt] = { {"24/7", 600000, 6, -27.4377, -57.6114, 1003.5469, 0.0000}, {"Gun Shop", 800000, 6, 316.2873, -169.6470, 999.6010, 0.0000}, {"Clothes Shop", 750000, 14, 204.3860, -168.4586, 1000.5234, 0.0000}, {"Gym", 600000, 7, 773.7802, -78.2581, 1000.6619, 0.0000}, {"Restaurant", 500000, 10, 363.3276, -74.6505, 1001.5078, 315.0000}, {"Advertisement Agency", 675000, 3, 834.1517, 7.4096, 1004.1870, 90.0000}, {"Club/Bar", 475000, 11, 501.8694, -68.0046, 998.7578, 179.6117}, {"Tool Shop", 525000, 6, -2240.6992, 128.3009, 1035.4141, 270.0000} }; enum furnitureEnum { fCategory[24], fName[32], fModel, fPrice }; new const furnitureCategories[][] = { {"Appliances"}, {"Bathroom"}, {"Bedroom"}, {"Carpets"}, {"Kitchen"}, {"Tables"}, {"Chairs"}, {"Posters/Frames"}, {"Storage"}, {"Plants"}, {"Trash"}, {"Doors & Gates"}, {"Walls"}, {"Decor"} }; new const furnitureArray[][furnitureEnum] = { {"Appliances", "Blender", 19830, 500}, {"Appliances", "Coffee machine", 11743, 500}, {"Appliances", "Grill", 19831, 500}, {"Appliances", "Electrical outlet", 19813, 50}, {"Appliances", "Light switch", 19829, 50}, {"Appliances", "Keyboard", 19808, 50}, {"Appliances", "White telephone", 19807, 50}, {"Appliances", "Black telephone", 11705, 50}, {"Appliances", "Large LCD television", 19786, 1000}, {"Appliances", "Small LCD television", 19787, 750}, {"Appliances", "Round gold TV", 2224, 1500}, {"Appliances", "TV on wheels", 14532, 250}, {"Appliances", "Flat screen TV", 1792, 400}, {"Appliances", "Wide screen TV", 1786, 400}, {"Appliances", "Surveillance TV", 1749, 400}, {"Appliances", "Regular TV", 1518, 250}, {"Appliances", "Grey sided TV", 2322, 200}, {"Appliances", "Wood sided TV", 1429, 200}, {"Appliances", "Microwave", 2149, 100}, {"Appliances", "Pizza rack", 2453, 50}, {"Appliances", "Wide sprunk fridge", 2452, 100}, {"Appliances", "Small sprunk fridge", 2533, 50}, {"Appliances", "Duality game", 2779, 500}, {"Appliances", "Bee Bee Gone game", 2778, 500}, {"Appliances", "Space Monkeys game", 2681, 500}, {"Appliances", "Sprunk machine", 1775, 1000}, {"Appliances", "Candy machine", 1776, 1000}, {"Appliances", "Water machine", 1808, 100}, {"Appliances", "Radiator", 1738, 50}, {"Appliances", "Metal fridge", 1780, 100}, {"Appliances", "Pizza cooker", 2426, 50}, {"Appliances", "Deep fryer", 2415, 100}, {"Appliances", "Soda dispenser", 2427, 100}, {"Appliances", "Aluminum stove", 2417, 100}, {"Appliances", "Lamp", 2105, 50}, {"Appliances", "Diagnostic machine", 19903, 4000}, {"Appliances", "VHS player", 1785, 200}, {"Appliances", "Playstation console", 2028, 500}, {"Appliances", "Retro gaming console", 1718, 500}, {"Appliances", "Hi-Fi speaker", 1839, 250}, {"Appliances", "Black subwoofer", 2232, 250}, {"Appliances", "Subwoofer", 1840, 250}, {"Appliances", "Small black speaker", 2229, 250}, {"Appliances", "Speaker on a stand", 2233, 100}, {"Appliances", "Speaker & stereo system", 2099, 500}, {"Appliances", "Surveillance camera", 1886, 50}, {"Appliances", "Security camera", 1622, 50}, {"Appliances", "Exercise bike", 2630, 500}, {"Appliances", "Treadmill", 2627, 500}, {"Appliances", "Lift bench", 2629, 250}, {"Appliances", "Pull up machine", 2628, 500}, {"Appliances", "White turntable", 1954, 500}, {"Appliances", "Open laptop", 19893, 1000}, {"Appliances", "Closed laptop", 19894, 500}, {"Appliances", "Drum Kit", 19609, 1000}, {"Appliances", "Microphone", 19610, 500}, {"Appliances", "Microphone Stand", 19611, 250}, {"Appliances", "Guitar amp 1", 19612, 500}, {"Appliances", "Guitar amp 2", 19613, 500}, {"Appliances", "Guitar amp 3", 19614, 500}, {"Appliances", "Guitar amp 4", 19615, 500}, {"Appliances", "Guitar amp 5", 19616, 500}, {"Bathroom", "Toilet", 2514, 250}, {"Bathroom", "Bathtub", 2519, 500}, {"Bathroom", "Toilet paper", 19873, 50}, {"Bathroom", "Towel rack", 11707, 100}, {"Bathroom", "Toilet with rug", 2528, 500}, {"Bathroom", "Toilet with rolls", 2525, 500}, {"Bathroom", "Sink top", 2515, 100}, {"Bathroom", "Dual sink top", 2150, 200}, {"Bathroom", "Wood sided bathtub", 2526, 500}, {"Bathroom", "Sprunk bathtub", 2097, 1000}, {"Bathroom", "Shower curtains", 14481, 100}, {"Bathroom", "Metal shower cabin", 2520, 500}, {"Bathroom", "Glass shower cabin", 2517, 500}, {"Bathroom", "Shower with curtains", 2527, 500}, {"Bathroom", "Wall sink", 2518, 250}, {"Bathroom", "Plain sink", 2739, 250}, {"Bathroom", "Sink with extra soap", 2524, 250}, {"Bathroom", "Sink with rug", 2523, 250}, {"Bathroom", "Industrial sink", 11709, 500}, {"Bedroom", "Prison bed", 1800, 100}, {"Bedroom", "Folding bed", 1812, 100}, {"Bedroom", "Red double bed", 11720, 500}, {"Bedroom", "Wood double bed", 14866, 500}, {"Bedroom", "Double plaid bed", 1794, 500}, {"Bedroom", "Brown bed", 2299, 500}, {"Bedroom", "Blue striped bed", 2302, 500}, {"Bedroom", "Dark blue striped bed", 2298, 500}, {"Bedroom", "White striped bed", 2090, 500}, {"Bedroom", "Bed with cabinet", 2300, 500}, {"Bedroom", "Pink & blue striped bed", 2301, 500}, {"Bedroom", "Zebra print bed", 14446, 500}, {"Bedroom", "Low striped bed", 1795, 500}, {"Bedroom", "Low dark striped bed", 1798, 500}, {"Bedroom", "Single plaid bed", 1796, 500}, {"Bedroom", "Plain striped mattress", 1793, 500}, {"Bedroom", "Silk sheeted bed", 1701, 500}, {"Bedroom", "Framed striped bed", 1801, 500}, {"Bedroom", "Framed brown bed", 1802, 500}, {"Bedroom", "Wooden cabinet", 2330, 250}, {"Bedroom", "Cabinet with TV", 2296, 500}, {"Bedroom", "Dresser", 1416, 250}, {"Bedroom", "Small dresser", 2095, 250}, {"Bedroom", "Medium dresser", 1743, 250}, {"Bedroom", "Wide dresser", 2087, 250}, {"Bedroom", "Small wardrobe", 2307, 250}, {"Bedroom", "Huge open wardrobe", 14556, 500}, {"Bedroom", "Busted cabinet", 913, 500}, {"Bedroom", "Busted dresser", 911, 250}, {"Bedroom", "Dresser with no drawers", 912, 100}, {"Carpets", "Rockstar carpet", 11737, 250}, {"Carpets", "Plain red carpet", 2631, 250}, {"Carpets", "Plain green carpet", 2632, 250}, {"Carpets", "Patterned carpet", 2842, 250}, {"Carpets", "Zig-zag patterned carpet", 2836, 250}, {"Carpets", "Brown red striped carpet", 2847, 250}, {"Carpets", "Old timer's carpet", 2833, 250}, {"Carpets", "Red checkered carpet", 2818, 250}, {"Carpets", "Green circled carpet", 2817, 250}, {"Carpets", "Plain polkadot carpet", 2834, 250}, {"Carpets", "Tiger rug", 1828, 1000}, {"Carpets", "Plain round rug", 2835, 250}, {"Carpets", "Round green rug", 2841, 250}, {"Kitchen", "CJ's kitchen", 14384, 3000}, {"Kitchen", "Whole kitchen", 14720, 3000}, {"Kitchen", "White kitchen sink", 2132, 500}, {"Kitchen", "White kitchen counter", 2134, 500}, {"Kitchen", "White kitchen fridge", 2131, 500}, {"Kitchen", "White kitchen drawers", 2133, 500}, {"Kitchen", "White kitchen corner", 2341, 500}, {"Kitchen", "White kitchen cupboard", 2141, 500}, {"Kitchen", "Green kitchen sink", 2336, 500}, {"Kitchen", "Green kitchen counter", 2334, 500}, {"Kitchen", "Green kitchen fridge", 2147, 500}, {"Kitchen", "Green kitchen corner", 2338, 500}, {"Kitchen", "Green kitchen washer", 2337, 500}, {"Kitchen", "Green kitchen cupboard", 2158, 500}, {"Kitchen", "Green kitchen stove", 2170, 500}, {"Kitchen", "Red kitchen sink", 2130, 500}, {"Kitchen", "Red kitchen fridge", 2127, 500}, {"Kitchen", "Red kitchen cupboard", 2128, 500}, {"Kitchen", "Red kitchen corner", 2304, 500}, {"Kitchen", "Red kitchen counter", 2129, 500}, {"Kitchen", "Wood kitchen sink", 2136, 500}, {"Kitchen", "Wood kitchen counter", 2139, 500}, {"Kitchen", "Wood kitchen cupboard", 2140, 500}, {"Kitchen", "Wood kitchen washer", 2303, 500}, {"Kitchen", "Wood kitchen unit", 2138, 500}, {"Kitchen", "Wood kitchen corner", 2305, 500}, {"Kitchen", "Wood kitchen stove", 2135, 500}, {"Kitchen", "Modern stove", 19923, 1000}, {"Kitchen", "Old timer's stove", 19915, 1000}, {"Kitchen", "Fork", 11715, 50}, {"Kitchen", "Butter knife", 11716, 50}, {"Kitchen", "Steak knife", 19583, 50}, {"Kitchen", "Spatula", 19586, 50}, {"Kitchen", "Double handled pan", 19585, 100}, {"Kitchen", "Single handled pan", 19584, 100}, {"Kitchen", "Frying pan", 19581, 100}, {"Kitchen", "Tall striped saucepan", 11719, 100}, {"Kitchen", "Striped saucepan", 11718, 100}, {"Kitchen", "Cooked steak", 19882, 50}, {"Kitchen", "Raw steak", 19582, 50}, {"Kitchen", "Green apple", 19576, 50}, {"Kitchen", "Red apple", 19575, 50}, {"Kitchen", "Orange", 19574, 50}, {"Kitchen", "Banana", 19578, 50}, {"Kitchen", "Tomato", 19577, 50}, {"Tables", "Lab table", 3383, 2000}, {"Tables", "Pool table", 2964, 2000}, {"Tables", "Blackjack table", 2188, 2000}, {"Tables", "Betting table", 1824, 2000}, {"Tables", "Roulette table", 1896, 2000}, {"Tables", "Poker table", 19474, 1000}, {"Tables", "Burger shot table", 2644, 500}, {"Tables", "Cluckin' bell table", 2763, 500}, {"Tables", "Wide cluckin' bell table", 2762, 500}, {"Tables", "Square coffee table", 2370, 500}, {"Tables", "Donut shop table", 2747, 500}, {"Tables", "Pizza table", 2764, 500}, {"Tables", "Wide coffee table", 2319, 500}, {"Tables", "Rectangular green table", 11691, 500}, {"Tables", "Squared green table", 11690, 500}, {"Tables", "Round glass table", 1827, 500}, {"Tables", "Round wooden table", 2111, 500}, {"Tables", "Wide dining table", 2357, 500}, {"Tables", "Plain wooden table", 2115, 500}, {"Tables", "Plain brown wooden table", 1516, 500}, {"Tables", "White polkadot table", 1770, 500}, {"Tables", "Brown dining table", 1737, 500}, {"Tables", "Round stone table", 2030, 500}, {"Tables", "Wooden table with rim", 2699, 500}, {"Tables", "Low coffee table", 1814, 500}, {"Tables", "Low brown wooden table", 1433, 500}, {"Tables", "Bedroom table", 2333, 500}, {"Tables", "Round table with chairs", 1432, 500}, {"Tables", "Table with benches", 1281, 500}, {"Tables", "Checkered table & chairs", 1594, 500}, {"Tables", "Wooden workshop table", 19922, 500}, {"Tables", "Hexagon shaped table", 2725, 500}, {"Tables", "Table with VCR", 2313, 500}, {"Tables", "Low wooden TV stand", 2314, 500}, {"Tables", "Low brown TV stand", 2315, 500}, {"Tables", "Plain brown office desk", 2206, 500}, {"Tables", "Office desk with computer", 2181, 1000}, {"Tables", "Plain wooden office desk", 2185, 1000}, {"Tables", "Computer desk", 2008, 1000}, {"Chairs", "Blue swivel chair", 2356, 250}, {"Chairs", "Brown dining chair", 1811, 250}, {"Chairs", "Red folding chair", 2121, 250}, {"Chairs", "Upholstered chair", 2748, 1000}, {"Chairs", "Folding office chair", 1721, 250}, {"Chairs", "Round black chair", 2776, 250}, {"Chairs", "Black stool", 1716, 250}, {"Chairs", "Brown stool", 2350, 250}, {"Chairs", "Red stool", 2125, 250}, {"Chairs", "Tall wooden dining chair", 2124, 250}, {"Chairs", "Tall brown dining chair", 1739, 250}, {"Chairs", "Checkered dining chair", 2807, 250}, {"Chairs", "Plain office chair", 1671, 250}, {"Chairs", "Brown folding chair", 19996, 250}, {"Chairs", "Light brown chair", 19994, 250}, {"Chairs", "Black lounge chair", 1704, 500}, {"Chairs", "Beige lounge chair", 1705, 500}, {"Chairs", "Dark blue reclining chair", 1708, 500}, {"Chairs", "Brown corner chair", 11682, 500}, {"Chairs", "Old timer's lounge chair", 1711, 500}, {"Chairs", "Old timer's rocking chair", 1735, 500}, {"Chairs", "Two chairs and a table", 2571, 500}, {"Chairs", "Dark brown foot stool", 2293, 500}, {"Chairs", "Rocking chair", 11734, 250}, {"Chairs", "Plaid sofa", 1764, 750}, {"Chairs", "Long black sofa", 1723, 750}, {"Chairs", "Beige sofa", 1702, 750}, {"Chairs", "Brown couch", 1757, 750}, {"Chairs", "Old timer's sofa", 1728, 750}, {"Chairs", "Brown corner couch piece", 2292, 500}, {"Chairs", "White & grey couch", 1761, 750}, {"Chairs", "Patterned couch", 1760, 750}, {"Chairs", "Plaid couch", 1764, 750}, {"Chairs", "Dark blue couch", 1768, 750}, {"Chairs", "Wide brown couch", 2290, 750}, {"Chairs", "Green couch", 1766, 750}, {"Chairs", "Patterned armrest couch", 1763, 750}, {"Chairs", "Red couch", 11717, 750}, {"Chairs", "Very wide beige couch", 1710, 1500}, {"Chairs", "Ultra wide beige couch", 1709, 2000}, {"Chairs", "Red and white couch", 1707, 750}, {"Posters/Frames", "Burger shot poster", 2641, 50}, {"Posters/Frames", "Cluckin' bell poster", 2766, 50}, {"Posters/Frames", "Wash wands poster", 2685, 50}, {"Posters/Frames", "For lease poster", 11289, 50}, {"Posters/Frames", "Monkey juice poster", 19328, 50}, {"Posters/Frames", "Ring donuts poster", 2715, 50}, {"Posters/Frames", "Battered ring posterr", 2716, 50}, {"Posters/Frames", "Pizza poster", 2668, 50}, {"Posters/Frames", "T-Shirt poster", 2729, 50}, {"Posters/Frames", "Suburban poster", 2658, 50}, {"Posters/Frames", "Zip poster", 2736, 50}, {"Posters/Frames", "Binco poster", 2722, 50}, {"Posters/Frames", "99c binco poster", 2719, 50}, {"Posters/Frames", "Binco sale poster", 2721, 50}, {"Posters/Frames", "Heat poster", 2661, 50}, {"Posters/Frames", "Eris poster", 2655, 50}, {"Posters/Frames", "Bobo poster", 2662, 50}, {"Posters/Frames", "Base 5 poster", 2691, 50}, {"Posters/Frames", "Base 5 cutout #1", 2693, 50}, {"Posters/Frames", "Base 5 cutout #2", 2692, 50}, {"Posters/Frames", "Long base 5 poster #1", 2695, 50}, {"Posters/Frames", "Long base 5 poster #2", 2696, 50}, {"Posters/Frames", "White prolaps poster", 2697, 50}, {"Posters/Frames", "Black prolaps poster", 2656, 50}, {"Posters/Frames", "San Fierro frame", 19175, 100}, {"Posters/Frames", "Flint County frame", 19174, 100}, {"Posters/Frames", "Gant Bridge frame", 19173, 100}, {"Posters/Frames", "Los Santos frame", 19172, 100}, {"Posters/Frames", "City View frame", 2289, 100}, {"Posters/Frames", "Los Angeles frame", 2258, 100}, {"Posters/Frames", "Wooden frame", 2288, 100}, {"Posters/Frames", "Sail Boat frame", 2287, 100}, {"Posters/Frames", "Ship frame", 2286, 100}, {"Posters/Frames", "Water frame", 2285, 100}, {"Posters/Frames", "Church frame", 2284, 100}, {"Posters/Frames", "Rural frame", 2282, 100}, {"Posters/Frames", "Sunset frame", 2281, 100}, {"Posters/Frames", "Coast frame", 2280, 100}, {"Posters/Frames", "Mount chiliad frame", 2279, 100}, {"Posters/Frames", "Cargo ship frame", 2278, 100}, {"Posters/Frames", "Cat frame", 2277, 100}, {"Posters/Frames", "Bridge frame", 2276, 100}, {"Posters/Frames", "Fruit Bowl frame", 2275, 100}, {"Posters/Frames", "Flower frame", 2274, 100}, {"Posters/Frames", "Bouquet frame", 2273, 100}, {"Posters/Frames", "Landscape frame", 2272, 100}, {"Posters/Frames", "Paper frame", 2271, 100}, {"Posters/Frames", "Leaves frame", 2270, 100}, {"Posters/Frames", "Lake frame", 2269, 100}, {"Posters/Frames", "Black cat frame", 2268, 100}, {"Posters/Frames", "Cruise ship frame", 2267, 100}, {"Posters/Frames", "Night downtown frame", 2266, 100}, {"Posters/Frames", "Dseert rocks frame", 2265, 100}, {"Posters/Frames", "Beach frame", 2264, 100}, {"Posters/Frames", "Dock frame", 2263, 100}, {"Posters/Frames", "Downtown frame", 2262, 100}, {"Posters/Frames", "Golden gate frame", 2261, 100}, {"Posters/Frames", "Old Boat frame", 2260, 100}, {"Posters/Frames", "Bowling frame", 2259, 100}, {"Posters/Frames", "Pattern frame", 2283, 100}, {"Posters/Frames", "Squares frame", 2257, 100}, {"Posters/Frames", "Palm trees frame", 2256, 100}, {"Posters/Frames", "Erotic frame", 2255, 100}, {"Posters/Frames", "Yellow car frame", 2254, 10}, {"Storage", "Book shelf", 1742, 500}, {"Storage", "Wardrobe", 2307, 400}, {"Storage", "Wooden crate", 1217, 150}, {"Storage", "Metal crate", 964, 150}, {"Storage", "Wide office cabinet", 2200, 150}, {"Storage", "Yellow cabinet", 1730, 150}, {"Storage", "Open gym locker", 11730, 250}, {"Storage", "Closed gym locker", 11729, 250}, {"Storage", "Toolbox", 19921, 500}, {"Storage", "Chest", 19918, 100}, {"Storage", "Dresser", 2094, 250}, {"Storage", "Warehouse rack", 3761, 150}, {"Storage", "Barrel rack", 925, 250}, {"Storage", "Sex toy rack", 2581, 250}, {"Storage", "Sex magazine rack #1", 2578, 250}, {"Storage", "Sex magazine rack #2", 2579, 250}, {"Storage", "Rack with no shelves", 2509, 250}, {"Storage", "Rack with 3 shelves", 2482, 250}, {"Storage", "Rack with 4 shelves", 2475, 250}, {"Storage", "Small rack", 2463, 250}, {"Storage", "Wide rack", 2462, 250}, {"Storage", "Dresser with drawers", 1743, 250}, {"Storage", "Wide dresser", 2087, 250}, {"Storage", "Tall dresser", 2088, 250}, {"Storage", "Brown dresser", 2089, 250}, {"Storage", "Single dresser", 2095, 250}, {"Storage", "White filing cabinet", 2197, 250}, {"Storage", "Green filing cabinet", 2610, 250}, {"Storage", "Dual filing cabinets", 2007, 250}, {"Storage", "Black shelf", 2078, 250}, {"Storage", "Brown shelf", 2204, 250}, {"Storage", "Tool shelf", 19899, 250}, {"Storage", "Tool cabinet", 19900, 250}, {"Storage", "Wall mounted shelf", 19940, 250}, {"Storage", "Clothes shelf", 2708, 250}, {"Storage", "Gun rack", 2046, 250}, {"Storage", "Shop shelf", 19640, 250}, {"Storage", "Blue office shelf", 2191, 250}, {"Storage", "Wooden office shelf", 2199, 250}, {"Storage", "Office book shelf", 2161, 250}, {"Storage", "Tall office cabinet", 2167, 100}, {"Storage", "Wide office cabinet", 2163, 100}, {"Plants", "Palm plant #1", 625, 100}, {"Plants", "Palm plant #2", 626, 100}, {"Plants", "Palm plant #3", 627, 100}, {"Plants", "Palm plant #4", 628, 100}, {"Plants", "Palm plant #5", 630, 100}, {"Plants", "Palm plant #6", 631, 100}, {"Plants", "Palm plant #7", 632, 100}, {"Plants", "Palm plant #8", 633, 100}, {"Plants", "Palm plant #9", 646, 100}, {"Plants", "Palm plant #10", 644, 100}, {"Plants", "Palm plant #11", 2001, 100}, {"Plants", "Palm plant #12", 2010, 100}, {"Plants", "Palm plant #13", 2011, 150}, {"Plants", "Potted plant #1", 948, 150}, {"Plants", "Potted plant #2", 949, 150}, {"Plants", "Potted plant #3", 950, 150}, {"Plants", "Potted plant #4", 2194, 150}, {"Plants", "Potted plant #5", 2195, 150}, {"Plants", "Potted plant #6", 2203, 150}, {"Plants", "Potted plant #7", 2240, 150}, {"Plants", "Potted plant #8", 2241, 150}, {"Plants", "Potted plant #9", 2242, 150}, {"Plants", "Potted plant #10", 2244, 150}, {"Plants", "Potted plant #11", 2245, 150}, {"Plants", "Potted plant #12", 2246, 150}, {"Plants", "Potted plant #13", 2248, 150}, {"Plants", "Potted plant #14", 2252, 150}, {"Plants", "Potted plant #15", 2253, 150}, {"Plants", "Potted plant #16", 2811, 150}, {"Plants", "Wide plant", 638, 250}, {"Plants", "Single bush plant", 1361, 250}, {"Plants", "Wide bush plant", 1360, 250}, {"Plants", "Bush plant and bench", 1364, 500}, {"Plants", "Window plant #1", 3802, 200}, {"Plants", "Window plant #2", 3810, 200}, {"Trash", "Wastebin", 11706, 50}, {"Trash", "Blue trashcan on wheels", 1339, 50}, {"Trash", "Blue trashcan", 1430, 50}, {"Trash", "Trashcan with holes", 1359, 50}, {"Trash", "Cluckin' bell trashcan", 2770, 50}, {"Trash", "Burger shot trashcan", 2420, 50}, {"Trash", "Round bagged trashcan", 1330, 50}, {"Trash", "Round white trashcan", 1329, 50}, {"Trash", "Metal trashcan", 1328, 50}, {"Trash", "Full dumpster", 1415, 50}, {"Trash", "Closed dumpster", 1227, 50}, {"Trash", "Bottle disposal unit", 1336, 50}, {"Trash", "Blue dumpster", 1334, 50}, {"Trash", "Red dumpster", 1333, 50}, {"Trash", "Hippo trashcan", 1371, 50}, {"Trash", "Poor trashcan", 1347, 50}, {"Trash", "Cement trashcan", 1300, 50}, {"Trash", "Trashcan filled with wood", 1442, 50}, {"Trash", "Two pallets & trash", 1450, 50}, {"Trash", "Single pallet", 1448, 50}, {"Trash", "Garbage bag", 1265, 50}, {"Trash", "Burger shot bag", 2663, 50}, {"Trash", "Pile of boxes", 1440, 50}, {"Trash", "Cardboard box", 1221, 50}, {"Trash", "Open pizza box", 2860, 50}, {"Trash", "Takeaway trash", 2866, 50}, {"Trash", "Burger shot trash", 2840, 50}, {"Trash", "Dirty dishes #1", 2812, 50}, {"Trash", "Dirty dishes #2", 2822, 50}, {"Trash", "Dirty dishes #3", 2829, 50}, {"Trash", "Dirty dishes #4", 2830, 50}, {"Trash", "Dirty dishes #5", 2831, 50}, {"Trash", "Dirty dishes #6", 2832, 50}, {"Trash", "Clean dishes #1", 2862, 50}, {"Trash", "Clean dishes #2", 2863, 50}, {"Trash", "Clean dishes #3", 2864, 50}, {"Trash", "Clean dishes #4", 2865, 50}, {"Trash", "Assorted trash #1", 2672, 50}, {"Trash", "Assorted trash #2", 2677, 50}, {"Trash", "Assorted trash #3", 2675, 50}, {"Trash", "Assorted trash #4", 2676, 50}, {"Trash", "Assorted trash #5", 2674, 50}, {"Trash", "Assorted trash #6", 2673, 50}, {"Trash", "Assorted trash #7", 2670, 50}, {"Doors & Gates", "Door with bars", 2930, 100}, {"Doors & Gates", "Petrol door", 2911, 100}, {"Doors & Gates", "Flat door", 3061, 100}, {"Doors & Gates", "Wardrobe door", 1567, 100}, {"Doors & Gates", "Green push door", 1492, 100}, {"Doors & Gates", "Red windowed door", 1493, 100}, {"Doors & Gates", "Black wooden door", 1494, 100}, {"Doors & Gates", "Brown windowed door", 3089, 100}, {"Doors & Gates", "Wooden farm door", 1497, 100}, {"Doors & Gates", "White wooden door", 1498, 100}, {"Doors & Gates", "Warehouse door", 1499, 100}, {"Doors & Gates", "Red door", 1504, 100}, {"Doors & Gates", "Blue door", 1505, 100}, {"Doors & Gates", "White door", 1506, 100}, {"Doors & Gates", "Yellow door", 1507, 100}, {"Doors & Gates", "Kitchen door", 1523, 100}, {"Doors & Gates", "Motel door", 1535, 100}, {"Doors & Gates", "Blue motel door", 2970, 100}, {"Doors & Gates", "24/7 door", 1560, 100}, {"Doors & Gates", "Barred door", 3061, 100}, {"Doors & Gates", "Red motel door", 3029, 100}, {"Doors & Gates", "Security door", 2949, 100}, {"Doors & Gates", "Tall white door", 2948, 100}, {"Doors & Gates", "Bank door", 2946, 100}, {"Doors & Gates", "Ship door", 2944, 100}, {"Doors & Gates", "Tower door", 977, 100}, {"Doors & Gates", "Maintenance doors", 11714, 100}, {"Doors & Gates", "Dual office door", 19176, 100}, {"Doors & Gates", "Screen door #1", 1495, 100}, {"Doors & Gates", "Screen door #2", 1500, 100}, {"Doors & Gates", "Screen door #3", 1501, 100}, {"Doors & Gates", "Shop door #1", 1532, 100}, {"Doors & Gates", "Shop door #2", 1496, 100}, {"Doors & Gates", "Shop door #3", 1533, 100}, {"Doors & Gates", "Shop door #4", 1537, 100}, {"Doors & Gates", "Shop door #5", 1538, 100}, {"Doors & Gates", "Office door #1", 1566, 100}, {"Doors & Gates", "Office door #2", 1569, 100}, {"Doors & Gates", "Office door #3", 1536, 100}, {"Doors & Gates", "Office door #4", 1557, 100}, {"Doors & Gates", "Office door #5", 1556, 100}, {"Doors & Gates", "Wooden push door #1", 1491, 100}, {"Doors & Gates", "Wooden push door #2", 1502, 100}, {"Doors & Gates", "Garage door #1", 8957, 100}, {"Doors & Gates", "Garage door #2", 7891, 100}, {"Doors & Gates", "Garage door #3", 3037, 100}, {"Doors & Gates", "Garage door #4", 19861, 100}, {"Doors & Gates", "Garage door #5", 19864, 100}, {"Doors & Gates", "Plain metal bar gate", 19912, 1000}, {"Doors & Gates", "Tall metal bar gate", 971, 1000}, {"Doors & Gates", "Long metal bar gate", 975, 1000}, {"Doors & Gates", "Los Santos Airport gate", 980, 1000}, {"Doors & Gates", "Fenced gate", 985, 1000}, {"Doors & Gates", "No parking gate", 19870, 1000}, {"Doors & Gates", "Fenced gate on wheels", 988, 1000}, {"Walls", "wall001", 19353, 100}, {"Walls", "wall002", 19354, 100}, {"Walls", "wall003", 19355, 100}, {"Walls", "wall004", 19356, 100}, {"Walls", "wall005", 19357, 100}, {"Walls", "wall006", 19358, 100}, {"Walls", "wall007", 19359, 100}, {"Walls", "wall008", 19360, 100}, {"Walls", "wall009", 19361, 100}, {"Walls", "wall010", 19362, 100}, {"Walls", "wall011", 19363, 100}, {"Walls", "wall012", 19364, 100}, {"Walls", "wall013", 19365, 100}, {"Walls", "wall014", 19366, 100}, {"Walls", "wall015", 19367, 100}, {"Walls", "wall016", 19368, 100}, {"Walls", "wall017", 19369, 100}, {"Walls", "wall018", 19370, 100}, {"Walls", "wall019", 19371, 100}, {"Walls", "wall020", 19372, 100}, {"Walls", "wall021", 19373, 100}, //{"Walls", "wall022", 19374, 100}, {"Walls", "wall023", 19375, 100}, {"Walls", "wall024", 19376, 100}, {"Walls", "wall025", 19377, 100}, {"Walls", "wall026", 19378, 100}, {"Walls", "wall027", 19379, 100}, {"Walls", "wall028", 19380, 100}, {"Walls", "wall029", 19381, 100}, //{"Walls", "wall030", 19382, 100}, {"Walls", "wall031", 19383, 100}, {"Walls", "wall032", 19384, 100}, {"Walls", "wall033", 19385, 100}, {"Walls", "wall034", 19386, 100}, {"Walls", "wall035", 19387, 100}, {"Walls", "wall036", 19388, 100}, {"Walls", "wall037", 19389, 100}, {"Walls", "wall038", 19390, 100}, {"Walls", "wall039", 19391, 100}, {"Walls", "wall040", 19392, 100}, {"Walls", "wall041", 19393, 100}, {"Walls", "wall042", 19394, 100}, {"Walls", "wall043", 19395, 100}, {"Walls", "wall044", 19396, 100}, {"Walls", "wall045", 19397, 100}, {"Walls", "wall046", 19398, 100}, {"Walls", "wall047", 19399, 100}, {"Walls", "wall048", 19400, 100}, {"Walls", "wall049", 19401, 100}, {"Walls", "wall050", 19402, 100}, {"Walls", "wall051", 19403, 100}, {"Walls", "wall052", 19404, 100}, {"Walls", "wall053", 19405, 100}, {"Walls", "wall054", 19406, 100}, {"Walls", "wall055", 19407, 100}, {"Walls", "wall056", 19408, 100}, {"Walls", "wall057", 19409, 100}, {"Walls", "wall058", 19410, 100}, {"Walls", "wall059", 19411, 100}, {"Walls", "wall060", 19412, 100}, {"Walls", "wall061", 19413, 100}, {"Walls", "wall062", 19414, 100}, {"Walls", "wall063", 19415, 100}, {"Walls", "wall064", 19416, 100}, {"Walls", "wall065", 19417, 100}, {"Walls", "wall066", 19426, 100}, {"Walls", "wall067", 19427, 100}, {"Walls", "wall068", 19428, 100}, {"Walls", "wall069", 19429, 100}, {"Walls", "wall070", 19430, 100}, {"Walls", "wall071", 19431, 100}, {"Walls", "wall072", 19432, 100}, {"Walls", "wall073", 19433, 100}, {"Walls", "wall074", 19434, 100}, {"Walls", "wall075", 19435, 100}, {"Walls", "wall076", 19436, 100}, {"Walls", "wall077", 19437, 100}, {"Walls", "wall078", 19438, 100}, {"Walls", "wall079", 19439, 100}, {"Walls", "wall080", 19440, 100}, {"Walls", "wall081", 19441, 100}, {"Walls", "wall082", 19442, 100}, {"Walls", "wall083", 19443, 100}, {"Walls", "wall084", 19444, 100}, {"Walls", "wall085", 19445, 100}, {"Walls", "wall086", 19446, 100}, {"Walls", "wall087", 19447, 100}, {"Walls", "wall088", 19448, 100}, {"Walls", "wall089", 19449, 100}, {"Walls", "wall090", 19450, 100}, {"Walls", "wall091", 19451, 100}, {"Walls", "wall092", 19452, 100}, {"Walls", "wall093", 19453, 100}, {"Walls", "wall094", 19454, 100}, {"Walls", "wall095", 19455, 100}, {"Walls", "wall096", 19456, 100}, {"Walls", "wall097", 19457, 100}, {"Walls", "wall098", 19458, 100}, {"Walls", "wall099", 19459, 100}, {"Walls", "wall100", 19460, 100}, {"Walls", "wall101", 19461, 100}, {"Walls", "wall102", 19462, 100}, {"Walls", "wall103", 19463, 100}, {"Walls", "wall104", 19464, 100}, {"Walls", "wall105", 19465, 100}, {"Decor", "Guard tower", 3279, 5000}, {"Decor", "Dance floor", 19128, 1000}, {"Decor", "Tool board", 19815, 50}, {"Decor", "Mailbox", 19867, 50}, {"Decor", "Single key", 11746, 50}, {"Decor", "Oxygen cylinder", 19816, 50}, {"Decor", "Cauldron", 19527, 50}, {"Decor", "Valve", 2983, 50}, {"Decor", "Writing board", 19805, 50}, {"Decor", "Punching bag", 1985, 50}, {"Decor", "Desk fan", 2192, 50}, {"Decor", "Satellite dish", 3031, 50}, {"Decor", "Shopping cart", 1349, 50}, {"Decor", "Fireplace logs", 19632, 50}, {"Decor", "Telescope", 2600, 50}, {"Decor", "Ladder", 1428, 50}, {"Decor", "Plank", 2937, 50}, {"Decor", "Blue curtains", 2558, 50}, {"Decor", "Old curtains", 14443, 50}, {"Decor", "Blinds", 18084, 50}, {"Decor", "United states flag", 11245, 50}, {"Decor", "Double US flag", 2614, 50}, {"Decor", "Confederate flag", 2048, 50}, {"Decor", "Basketball court", 946, 50}, {"Decor", "Basketball", 2114, 50}, {"Decor", "Fire exit sign", 11710, 50}, {"Decor", "Fire extinguisher", 2690, 50}, {"Decor", "Fire extinguisher panel", 11713, 50}, {"Decor", "Fire alarm", 11713, 50}, {"Decor", "Fire hydrant", 1211, 50}, {"Decor", "Cocaine packet", 2891, 50}, {"Decor", "Drug bundle", 1279, 50}, {"Decor", "White package", 1575, 50}, {"Decor", "Orange package", 1576, 50}, {"Decor", "Yellow package", 1577, 50}, {"Decor", "Green package", 1578, 50}, {"Decor", "Blue package", 1579, 50}, {"Decor", "Red package", 1580, 50}, {"Decor", "Marijuana bundle", 2901, 50}, {"Decor", "Marijuana plant", 3409, 50}, {"Decor", "Ashtray", 1510, 50}, {"Decor", "Ashtray with cigar", 1665, 50}, {"Decor", "Pumpkin", 19320, 50}, {"Decor", "Christmas tree", 19076, 50}, {"Decor", "Stage", 19608, 250}, {"Decor", "Gold record", 19617, 100}, {"Decor", "Moose head", 1736, 300}, {"Decor", "Cow", 19833, 500}, {"Decor", "Rocking horse", 11733, 50}, {"Decor", "Deer", 19315, 50}, {"Decor", "Boot", 11735, 50}, {"Decor", "Old radiator", 1738, 50}, {"Decor", "Radiator", 11721, 50}, {"Decor", "Round light", 11727, 50}, {"Decor", "Mop & pail", 1778, 50}, {"Decor", "Chambermaid", 1789, 50}, {"Decor", "Bucket", 2713, 50}, {"Decor", "Trolley", 2994, 50}, {"Decor", "Body bags", 16444, 50}, {"Decor", "Beach ball", 1598, 50}, {"Decor", "Blackboard", 3077, 50}, {"Decor", "Dumbell", 3072, 50}, {"Decor", "Sports bag", 11745, 50}, {"Decor", "Portable toilet", 2984, 50}, {"Decor", "Round burger shot sign", 2643, 50}, {"Decor", "Stretcher", 1997, 50}, {"Decor", "Hospital bed", 2146, 50}, {"Decor", "Work lamp", 2196, 50}, {"Decor", "Fire bell", 1613, 50}, {"Decor", "Sword", 19590, 50}, {"Decor", "Wooden bat", 19914, 50}, {"Decor", "Hand fan", 19591, 50}, {"Decor", "Shop basket", 19592, 50}, {"Decor", "Safe door", 19619, 50}, {"Decor", "Safe enclosure", 19618, 50}, {"Decor", "Bag of money", 1550, 50}, {"Decor", "Oil can", 19621, 50}, {"Decor", "Wrench", 19627, 50}, {"Decor", "Engine", 19917, 50}, {"Decor", "Broom", 19622, 50}, {"Decor", "Briefcase", 19624, 50}, {"Decor", "Cigarette", 19625, 50}, {"Decor", "Rolled joint", 3027, 50}, {"Decor", "Fire wood", 19632, 50}, {"Decor", "Compacted trash", 19772, 50}, {"Decor", "Medic kit", 11738, 50}, {"Decor", "Clip", 19995, 50}, {"Decor", "Dippo lighter", 19998, 50}, {"Decor", "Briquettes", 19573, 50}, {"Decor", "Meat Sack", 2805, 50}, {"Decor", "Small meat sack", 2803, 50}, {"Decor", "Stack of magazines", 2855, 50}, {"Decor", "Scattered magazines", 2852, 50}, {"Decor", "Scattered books", 2854, 50}, {"Decor", "Wooden stairs", 3361, 50}, {"Decor", "Long concrete stairs", 14410, 50}, {"Decor", "Short concrete stairs", 14416, 50}, {"Decor", "Short stairs", 14877, 50}, {"Decor", "Big window", 19325, 100}, {"Decor", "Small window", 19466, 50}, {"Decor", "Breakable window", 1649, 75}, {"Decor", "Red neon tube", 18647, 100}, {"Decor", "Blue neon tune", 18648, 100}, {"Decor", "Green neon tube", 18649, 100}, {"Decor", "Yellow neon tube", 18650, 100}, {"Decor", "Pink neon tube", 18651, 100}, {"Decor", "White neon tube", 18652, 100}, {"Decor", "Beer bottle", 1543, 10}, {"Decor", "Yellow beer bottle", 1544, 10}, {"Decor", "Medicine bottle", 1950, 10}, {"Decor", "Green beer bottle", 19818, 10}, {"Decor", "Whiskey bottle", 19823, 10}, {"Decor", "Wine bottle", 19820, 10}, {"Decor", "Red wine bottle", 19822, 10}, {"Decor", "Champagne bottle", 19824, 10}, {"Decor", "Beer", 19821, 10}, {"Decor", "Target #1", 2056, 50}, {"Decor", "Target #2", 2055, 50}, {"Decor", "Target #3", 2051, 50}, {"Decor", "Target #4", 2050, 50}, {"Decor", "Target #5", 2049, 50}, {"Decor", "Clothes pile #1", 2819, 50}, {"Decor", "Clothes pile #2", 2843, 50}, {"Decor", "Clothes pile #3", 2844, 50}, {"Decor", "Clothes pile #4", 2845, 50}, {"Decor", "Clothes pile #5", 2846, 50}, {"Decor", "Light #0", 3877, 50}, {"Decor", "Light #1", 3524, 50}, {"Decor", "Light #2", 3461, 50}, {"Decor", "Dragon Head", 3528, 150}, {"Decor", "Fountain", 9833, 150}, {"Decor", "Military RPG", 3267, 150}, {"Decor", "Light", 1231, 150}, {"Decor", "Blue Light", 19122, 150}, {"Decor", "Green Light", 19123, 150}, {"Decor", "Red Light", 19124, 150}, {"Decor", "HeliPad", 3928, 200} }; enum entranceEnum { eName[32], eInterior, eWorld, eMapIcon, eFreeze, Float:ePosX, Float:ePosY, Float:ePosZ, Float:ePosA, Float:eIntX, Float:eIntY, Float:eIntZ, Float:eIntA }; new const staticEntrances[][entranceEnum] = { {"Bone County\nMedical Center", 1, 1, 22, true, -318.8501,1048.7548,20.3403,351.8533, -45.3173, 157.9171, 999.0613, 180.0000}, {"Bone County\nBank", 5, 3, 52, true, -179.6446,1133.1356,19.7422, 87.3193, -184.3539,1132.9502,-19.6455, 260.8408}, {"City Hall", 3, 4, 0, true, -207.4847,1119.3324,20.4297,272.4539, 0.0875,1520.7997,1501.8143, 0.0000}, {"Bone County\nSheriff's Office", 2, 5, 30, true, -214.6215,976.8874,20.7703, 266.6736, 1430.3047,1472.2262,-29.6540, 270.0000}, {"DMV", 3, 6, 55, false, -206.8947,1217.3893,19.8906, 272.5792, -2029.7135, -119.2240, 1035.1719, 0.0000}, //{"VIP Casino", 3, 7, 59, true, -93.9010,1188.9028,19.7422, 270.0000, 1821.6951, -1309.9364, 1131.7552, 0.0000}, //{"Drug den", 5, 8, 23, false, -284.7038,2655.8013,62.7411, 358.6262, 318.6025, 1114.9443, 1083.8828, 0.0000}, //{"Crack house", 5, 9, 23, false, -1322.3568,2497.9365,87.0469, 180.0000, 2352.3337, -1180.9257, 1027.9766, 90.0000}, //{"Heisenberg's trailer", 2, 10, 37, false, 26.6317,1362.1039,9.1719,47.1453, 1.6362, -3.0563, 999.4284, 90.0000}, {"Court House", 1, 11, 30, true, -553.8293,2593.7417,53.9348,258.9624, 1219.5431,-1792.8041,2431.3369, 266.9198}, {"Bone County Casino", 5, 12, 25, true, -311.2303,1303.5144,53.6643, 263.4686, 1095.5776, 33.3495, 1000.6797, 180.0000}, //{"Rodeo Bank", 5, 13, 52, true, 593.5599, -1250.8365, 18.2484, 20.0000, 1667.3536, -995.3700, 683.6913, 0.0000}, {"Prison", 0, 0, 0, true, 225.6095,1872.3793,13.7421, 88.2042, -119.4959,2066.2253,-29.5697, 266.6639}, {"HI-K69", 0, 0, 0, true, -99.1454,1083.2914,19.7422,7.9306, -94.5494,1081.3684,-34.6388,90.7734}, {"Yard", 0, 0, 0, true, -72.7049,2064.5046,-26.1246,355.5310, 137.7959,1835.8306,17.6406,90.3251} }; enum locEnum { locID, locName[32], bool:locExists, Float:locPosX, Float:locPosY, Float:locPosZ }; new LocationInfo[MAX_LOCATIONS][locEnum]; enum aEnum { aID, bool:aExists, Float:aPosX, Float:aPosY, Float:aPosZ, Float:aPosA, Text3D:aText, aObject }; new AtmInfo[MAX_ATMS][aEnum]; enum jobEnum { jobName[32], Float:jobX, Float:jobY, Float:jobZ }; new const jobLocations[][jobEnum] = { {"Pizzaman", -41.7680,1178.2327,19.4059}, {"Courier", 583.8135,1221.1338,11.7113}, {"Fisherman", -395.1790,1172.2659,15.6621}, {"Bodyguard", -203.8107,1150.9900,19.7422}, {"Weapons Dealer", -328.6335,835.5726,14.2422}, {"Mechanic", -90.0148,1123.0770,19.7422}, {"Miner", -708.9689,2364.3916,127.7176}, {"Street Sweeper", 325.1593,860.9982,20.4063}, {"Taxi Driver", -254.7592,2603.1975,62.8582}, {"Drug Dealer", -281.3244,2655.3328,62.7125}, {"Lawyer", -220.2667,1124.3993,19.7422}, {"Detective", -212.1769,972.6411,19.1981}, {"Thief", -1.8061,1395.6776,9.1719}, {"Garbage Man", 319.8657,874.8818,20.3990}, {"Farmer", -366.3515, -1412.8286, 25.7266} }; CMD:gotojob(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command."); new jobid; if(sscanf(params, "i", jobid)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /gotojob "); if( 0 <= jobid <= 14 ) { SetPlayerPos(playerid, jobLocations[jobid][jobX], jobLocations[jobid][jobY], jobLocations[jobid][jobZ]); SendClientMessageEx(playerid, COLOR_GREY, "You have teleported to %s job.", jobLocations[jobid][jobName]); } else SendClientMessage(playerid, COLOR_GREY, "Invalid job id. [0-14]"); return 1; } enum atmEnum { Float:atmX, Float:atmY, Float:atmZ, Float:atmA }; new const atmMachines[][atmEnum] = { {2228.394775, -1714.255126, 13.158315, 270.000000}, {1928.599975, -1779.941650, 13.136871, 90.000000}, {1493.294677, -1772.306640, 18.385747, 180.000000}, {1102.299438, -1438.380981, 15.396868, 90.000000}, {563.902526, -1293.948730, 16.858232, 180.000000}, {2233.269042, -1158.040527, 25.540679, 270.000000}, {827.125183, -1345.751220, 13.182147, 270.000000}, {827.125183, -1346.811157, 13.182147, 270.000000}, {1093.036621, 29.262479, 1000.309509, 0.000000}, {-14.377381, -180.600250, 1003.186889, 180.000000}, {9.334012, -31.044189, 1003.159179, 270.000000}, {-24.413511, -91.806381, 1003.126708, 180.000000}, {-21.125793, -140.438766, 1003.166564, 180.000000}, {-24.290849, -57.946674, 1003.176574, 180.000000} }; enum fireEnum { fireIndex, Float:fireX, Float:fireY, Float:fireZ, Float:fireA, }; new const randomFireSpawns[][fireEnum] = { {0, 1720.231079, -1740.936889, 11.432815, 180.922180}, {0, 1723.581298, -1740.882934, 11.432815, 180.922180}, {0, 1726.050537, -1740.842773, 11.432815, 180.922180}, {0, 1716.479858, -1740.926757, 11.432815, 180.922180}, {0, 1713.465332, -1740.676391, 11.432815, 180.922180}, {0, 1723.581298, -1740.882934, 13.742803, 180.922180}, {0, 1726.050537, -1740.842773, 14.072817, 180.922180}, {0, 1720.231079, -1740.936889, 14.142808, 180.922180}, {0, 1716.479858, -1740.926757, 14.642818, 180.922180}, {0, 1713.465332, -1740.676391, 14.992820, 180.922180}, {0, 1729.405151, -1742.339111, 11.432815, 180.922180}, {0, 1729.405883, -1742.379028, 14.632813, 180.922180}, {0, 1729.453002, -1745.278564, 11.432815, 180.922180}, {0, 1729.452514, -1745.258789, 14.632813, 180.922180}, {0, 1729.500610, -1748.218139, 11.432815, 180.922180}, {0, 1729.497314, -1748.038085, 14.632813, 180.922180}, {0, 1729.548095, -1751.127929, 11.432815, 180.922180}, {0, 1729.547485, -1751.098022, 14.632813, 180.922180}, {0, 1729.587524, -1753.567871, 11.432815, 180.922180}, {0, 1729.587280, -1753.588500, 14.632813, 180.922180}, {0, 1710.109741, -1740.329467, 11.432815, 180.922180}, {0, 1707.230224, -1740.376220, 11.432815, 180.922180}, {0, 1704.329956, -1740.422607, 11.432815, 180.922180}, {0, 1710.109741, -1740.329467, 14.922813, 180.922180}, {0, 1707.150390, -1740.377075, 14.922813, 180.922180}, {0, 1704.710327, -1740.416137, 14.922813, 180.922180}, {1, 1972.983886, -1923.633544, 11.286870, 358.727569}, {1, 1975.173583, -1923.682617, 11.286870, 358.727569}, {1, 1977.542724, -1923.735229, 11.286870, 358.727569}, {1, 1979.951782, -1923.788696, 11.286870, 358.727569}, {1, 1982.091552, -1923.836547, 11.286870, 358.727569}, {1, 1984.420532, -1923.887817, 11.286870, 358.727569}, {1, 1986.800292, -1923.941040, 11.286870, 358.727569}, {1, 1989.079589, -1923.991821, 11.286870, 358.727569}, {1, 1991.318847, -1924.041625, 11.286870, 358.727569}, {1, 1993.569335, -1924.091918, 11.286870, 358.727569}, {1, 1995.939086, -1924.143676, 11.286870, 358.727569}, {1, 1998.008422, -1924.189697, 11.286870, 358.727569}, {1, 1998.008422, -1924.189697, 14.286870, 358.727569}, {1, 1995.939086, -1924.143676, 14.286870, 358.727569}, {1, 1993.569335, -1924.091918, 14.286870, 358.727569}, {1, 1991.318847, -1924.041625, 14.286870, 358.727569}, {1, 1989.079589, -1923.991821, 14.286870, 358.727569}, {1, 1986.800292, -1923.941040, 14.286870, 358.727569}, {1, 1984.420532, -1923.887817, 14.286870, 358.727569}, {1, 1982.091552, -1923.836547, 14.286870, 358.727569}, {1, 1979.951782, -1923.788696, 14.286870, 358.727569}, {1, 1977.542724, -1923.735229, 14.286870, 358.727569}, {1, 1975.173583, -1923.682617, 14.286870, 358.727569}, {1, 1972.983886, -1923.633544, 14.286870, 358.727569}, {2, 2422.197753, -1963.760864, 11.329407, 270.000000}, {2, 2422.197753, -1965.961059, 11.329407, 270.000000}, {2, 2422.538085, -1968.141479, 11.329407, 270.000000}, {2, 2422.437988, -1970.161865, 11.329407, 270.000000}, {2, 2422.488037, -1972.322143, 11.329407, 270.000000}, {2, 2422.488037, -1974.422363, 11.329407, 270.000000}, {2, 2422.488037, -1976.602905, 11.329407, 270.000000}, {2, 2422.568115, -1978.533569, 11.329407, 270.000000}, {2, 2422.678222, -1980.704101, 11.329407, 270.000000}, {2, 2422.197753, -1963.760864, 13.829407, 270.000000}, {2, 2422.197753, -1965.961059, 13.829407, 270.000000}, {2, 2422.538085, -1968.141479, 13.829407, 270.000000}, {2, 2422.437988, -1970.161865, 13.829407, 270.000000}, {2, 2422.488037, -1972.322143, 13.829407, 270.000000}, {2, 2422.488037, -1974.422363, 13.829407, 270.000000}, {2, 2422.488037, -1976.602905, 13.829407, 270.000000}, {2, 2422.568115, -1978.533569, 13.829407, 270.000000}, {2, 2422.678222, -1980.704101, 13.829407, 270.000000}, {3, 855.264770, -1038.802124, 23.446907, 215.000000}, {3, 853.698852, -1040.191894, 23.446907, 215.000000}, {3, 851.837646, -1041.666137, 23.446907, 215.000000}, {3, 850.262207, -1042.989501, 23.446907, 215.000000}, {3, 848.620910, -1044.236816, 23.446907, 215.000000}, {3, 846.878112, -1045.530883, 23.446907, 215.000000}, {3, 844.986694, -1046.648193, 23.446907, 215.000000}, {3, 843.184570, -1048.032226, 23.446907, 215.000000}, {3, 841.548889, -1049.287597, 23.446907, 215.000000}, {3, 839.740478, -1050.627563, 23.446907, 215.000000}, {4, 512.298522, -1522.487792, 12.252450, 90.000000}, {4, 512.298522, -1520.456787, 12.252450, 90.000000}, {4, 512.298522, -1518.425903, 12.252450, 90.000000}, {4, 512.298522, -1516.165405, 12.252450, 90.000000}, {4, 512.298522, -1514.245239, 12.252450, 90.000000}, {4, 512.068359, -1511.944091, 12.252450, 90.000000}, {4, 512.068359, -1509.814208, 12.252450, 90.000000}, {4, 512.298522, -1507.425292, 12.252450, 90.000000}, {4, 512.298522, -1505.304931, 12.252450, 90.000000}, {4, 512.298522, -1503.384521, 12.252450, 90.000000}, {4, 512.298522, -1501.624389, 12.252450, 90.000000}, {4, 512.298522, -1499.298339, 12.252450, 90.000000}, {4, 512.298522, -1522.487792, 13.752450, 90.000000}, {4, 512.298522, -1520.456787, 13.752450, 90.000000}, {4, 512.298522, -1518.425903, 13.752450, 90.000000}, {4, 512.298522, -1516.165405, 13.752450, 90.000000}, {4, 512.298522, -1514.245239, 13.752450, 90.000000}, {4, 512.068359, -1511.944091, 13.752450, 90.000000}, {4, 512.068359, -1509.814208, 13.752450, 90.000000}, {4, 512.298522, -1507.425292, 13.752450, 90.000000}, {4, 512.298522, -1505.304931, 13.752450, 90.000000}, {4, 512.298522, -1503.384521, 13.752450, 90.000000}, {4, 512.298522, -1501.624389, 13.752450, 90.000000}, {4, 512.298522, -1499.298339, 13.752450, 90.000000}, {5, 2012.939208, -1282.796264, 21.760301, 179.226959}, {5, 2010.718627, -1282.766845, 21.760301, 179.226959}, {5, 2008.219238, -1282.732910, 21.760301, 179.226959}, {5, 2005.989379, -1282.702880, 21.760301, 179.226959}, {5, 2003.889770, -1282.674316, 21.760301, 179.226959}, {5, 2001.719848, -1282.645507, 21.760301, 179.226959}, {5, 1999.509765, -1282.615966, 21.760301, 179.226959}, {5, 1997.539794, -1282.589599, 21.760301, 179.226959}, {5, 1995.449462, -1282.561889, 21.760301, 179.226959}, {5, 1993.546508, -1282.786621, 21.760301, 179.226959}, {5, 1991.387695, -1282.647827, 21.760301, 179.226959}, {5, 1989.187133, -1282.638427, 21.760301, 179.226959}, {5, 1987.196044, -1282.701660, 21.760301, 179.226959}, {5, 1985.255126, -1282.785278, 21.760301, 179.226959}, {5, 1983.203491, -1282.928100, 21.760301, 179.226959}, {5, 1981.183105, -1282.901489, 21.760301, 179.226959}, {5, 1979.322875, -1282.876708, 21.760301, 179.226959}, {5, 1977.321655, -1282.920288, 21.760301, 179.226959}, {5, 1975.070434, -1282.950805, 21.760301, 179.226959}, {5, 1973.359741, -1282.997802, 21.760301, 179.226959}, {6, 2520.653076, -1268.459106, 32.786579, 268.202911}, {6, 2520.595947, -1270.278076, 32.786579, 268.202911}, {6, 2520.631347, -1272.040527, 32.786579, 268.202911}, {6, 2520.779785, -1273.676757, 32.786579, 268.202911}, {6, 2520.882080, -1275.182128, 32.786579, 268.202911}, {6, 2520.826904, -1276.951538, 32.786579, 268.202911}, {6, 2520.767822, -1278.821655, 32.786579, 268.202911}, {6, 2520.811035, -1280.303833, 32.786579, 268.202911}, {6, 2520.782958, -1281.844604, 32.786579, 268.202911}, {6, 2520.734863, -1283.715209, 32.786579, 268.202911}, {6, 2521.593261, -1265.743408, 32.543724, 178.275573}, {6, 2520.653076, -1268.459106, 34.286579, 268.202911}, {6, 2520.595947, -1270.278076, 34.286579, 268.202911}, {6, 2520.631347, -1272.040527, 34.286579, 268.202911}, {6, 2520.779785, -1273.676757, 34.286579, 268.202911}, {6, 2520.882080, -1275.182128, 34.286579, 268.202911}, {6, 2520.826904, -1276.951538, 34.286579, 268.202911}, {6, 2520.767822, -1278.821655, 34.286579, 268.202911}, {6, 2520.811035, -1280.303833, 34.286579, 268.202911}, {6, 2520.782958, -1281.844604, 34.286579, 268.202911}, {6, 2520.734863, -1283.715209, 34.286579, 268.202911}, {6, 2521.593261, -1265.743408, 34.043724, 178.275573}, {7, 2420.582031, -1510.028320, 22.002197, 87.980613}, {7, 2420.656494, -1507.899536, 22.002197, 87.980613}, {7, 2420.729248, -1505.820434, 22.002197, 87.980613}, {7, 2420.797607, -1503.861328, 22.002197, 87.980613}, {7, 2420.706298, -1501.856079, 22.002197, 87.980613}, {7, 2420.772460, -1499.967163, 22.002197, 87.980613}, {7, 2420.558349, -1498.327880, 22.002197, 87.980613}, {7, 2420.629638, -1496.288818, 22.002197, 87.980613}, {7, 2420.637451, -1494.617797, 22.002197, 87.980613}, {7, 2418.689453, -1511.844482, 21.619995, 0.000000}, {7, 2416.989501, -1511.844482, 21.619995, 0.000000}, {7, 2415.138427, -1511.844482, 21.619995, 0.000000}, {7, 2413.137939, -1511.844482, 21.619995, 0.000000}, {7, 2411.336914, -1511.844482, 21.619995, 0.000000}, {7, 2409.695800, -1511.844482, 21.619995, 0.000000}, {7, 2408.024169, -1511.844482, 21.619995, 0.000000}, {7, 2406.803466, -1511.844482, 21.619995, 0.000000}, {7, 2405.712890, -1511.844482, 21.619995, 0.000000}, {8, 1769.756469, -1721.183105, 11.426870, 0.000000}, {8, 1771.825805, -1721.219238, 11.426870, 0.000000}, {8, 1774.065917, -1721.219238, 11.426870, 0.000000}, {8, 1776.336303, -1721.219238, 11.426870, 0.000000}, {8, 1778.396972, -1721.219238, 11.426870, 0.000000}, {8, 1780.507202, -1721.219238, 11.426870, 0.000000}, {8, 1782.597290, -1721.219238, 11.426870, 0.000000}, {8, 1784.728027, -1721.219238, 11.426870, 0.000000}, {8, 1786.797851, -1721.219238, 11.426870, 0.000000}, {8, 1788.677001, -1721.219238, 11.426870, 0.000000}, {8, 1790.987304, -1721.219238, 11.426870, 0.000000}, {8, 1792.916625, -1721.219238, 11.426870, 0.000000}, {8, 1794.967285, -1721.219238, 11.426870, 0.000000}, {8, 1796.447021, -1721.219238, 11.426870, 0.000000}, {8, 1798.347534, -1721.219238, 11.426870, 0.000000}, {9, 2723.256591, -2020.687255, 11.477196, 0.000000}, {9, 2723.196289, -2022.766357, 11.477196, 0.000000}, {9, 2723.316894, -2024.821044, 11.477196, 0.000000}, {9, 2723.316894, -2026.461547, 11.477196, 0.000000}, {9, 2723.316894, -2028.431030, 11.477196, 0.000000}, {9, 2723.316894, -2030.141479, 11.477196, 0.000000}, {9, 2723.316894, -2031.961547, 11.477196, 0.000000}, {9, 2723.316894, -2033.631713, 11.477196, 0.000000}, {9, 2723.316894, -2035.612060, 11.477196, 0.000000}, {9, 2723.316894, -2037.552978, 11.477196, 0.000000}, {9, 2723.316894, -2038.973632, 11.477196, 0.000000} }; new const Float:minerPositions[][] = { {-699.5278,2379.5137,129.7882}, {1264.3618, -1240.3776, 16.0091}, {1255.6558, -1242.5010, 17.6045}, {1255.5265, -1251.3208, 13.8461} }; new const Float:drivingTestCPs[][] = { {-207.8272,1200.9546,19.5899}, {-278.2252,1171.2898,19.6012}, {-277.9881,1109.1178,19.5943}, {-268.5748,1016.4135,19.5938}, {-197.6766,1000.8668,19.5657}, {-287.3105,816.3147,14.3309}, {-220.1431,793.4171,19.3572}, {-122.2661,815.1378,20.6415}, {-116.6023,535.0344,7.1719}, {97.4621,664.6869,5.6095}, {335.2957,735.2612,9.9773}, {181.0120,1148.3496,14.2782}, {-5.6422,1200.9657,19.2109}, {-199.5931,1211.6106,19.7422} }; new const Float:cellPositions[][] = { {1205.69995117, -1328.09997559, 797.00000000, 1205.699951, -1326.500000, 797.000000}, {1205.69995117, -1331.30004883, 797.00000000, 1205.699951, -1329.700073, 797.000000}, {1205.69995117, -1331.30004883, 800.50000000, 1205.699951, -1329.700073, 800.500000}, {1205.69995117, -1328.09997559, 800.50000000, 1205.699951, -1326.500000, 800.500000}, {1215.30004883, -1328.09997559, 797.00000000, 1215.300048, -1326.500000, 797.000000}, {1215.30004883, -1331.30004883, 797.00000000, 1215.300048, -1329.700073, 797.000000}, {1215.30004883, -1331.30004883, 800.50000000, 1215.300048, -1329.700073, 800.500000}, {1215.30004883, -1328.09997559, 800.50000000, 1215.300048, -1326.500000, 800.500000}, {1215.30004883, -1334.50000000, 797.00000000, 1215.300048, -1332.900024, 797.000000}, {1215.29980469, -1337.69921875, 797.00000000, 1215.299804, -1336.099243, 797.000000}, {1215.30004883, -1340.90002441, 797.00000000, 1215.300048, -1339.300048, 797.000000}, {1215.30004883, -1340.90002441, 800.50000000, 1215.300048, -1339.300048, 800.500000}, {1215.30004883, -1337.69995117, 800.50000000, 1215.300048, -1336.099975, 800.500000}, {1215.30004883, -1334.50000000, 800.50000000, 1215.300048, -1332.900024, 800.500000}, {1205.69995117, -1334.50000000, 800.50000000, 1205.699951, -1332.900024, 800.500000}, {1205.69995117, -1337.69995117, 800.50000000, 1205.699951, -1336.099975, 800.500000}, {1205.69995117, -1340.90002441, 800.50000000, 1205.699951, -1339.300048, 800.500000}, {1205.69995117, -1334.50000000, 797.00000000, 1205.699951, -1332.900024, 797.000000}, {1205.69995117, -1337.69995117, 797.00000000, 1205.699951, -1336.099975, 797.000000}, {1205.69995117, -1340.90002441, 797.00000000, 1205.699951, -1339.300048, 797.000000}, {1215.30004883, -1344.09997559, 800.50000000, 1215.300048, -1342.500000, 800.500000}, {1215.30004883, -1344.09997559, 797.00000000, 1215.300048, -1342.500000, 797.000000}, {1205.69995117, -1344.09997559, 800.50000000, 1205.699951, -1342.500000, 800.500000}, {1205.69995117, -1344.09997559, 797.00000000, 1205.699951, -1342.500000, 797.000000} }; new const Float:cellSpawns[][] = { {-81.6413,2085.0508,-29.5697,177.6997} }; new const Float:arrestPoints[][] = { {-81.7273,2081.5276,-29.5697} // PD interior //{1564.6931, -1662.1338, 28.3956}, // PD roof //{310.3752, -1515.3691, 24.9219}, // FBI garage //{1382.0898, -1393.6364, -33.7034} // army garage }; new const factionTypes[][] = { {"Civilian"}, {"Law enforcement"}, {"Medical & fire"}, {"News agency"}, {"Government"}, {"Hitman agency"}, {"Federal police"}, {"Armed Forces"} }; new const deployableItems[][] = { {"Spikestrip"}, {"Traffic cone"}, {"Roadblock"}, {"Barrel"}, {"Smoke flare"} }; new const clothingTypes[][] = { {"Glasses"}, {"Bandanas & masks"}, {"Hats & caps"}, {"Misc clothing"} }; enum clothingEnum { clothingType[20], clothingName[32], clothingModel, clothingBone, clothingPrice }; new const clothingArray[][clothingEnum] = { {"Glasses", "Red tinted shades", 19006, 2, 500}, {"Glasses", "Brown tinted shades", 19007, 2, 500}, {"Glasses", "Green tinted shades", 19008, 2, 500}, {"Glasses", "Blue tinted shades", 19009, 2, 500}, {"Glasses", "Pink tinted shades", 19010, 2, 500}, {"Glasses", "Spiralled shades", 19011, 2, 500}, {"Glasses", "Black tinted shades", 19012, 2, 500}, {"Glasses", "Gag glasses", 19013, 2, 500}, {"Glasses", "Checkered shades", 19014, 2, 500}, {"Glasses", "Reading glasses", 19015, 2, 500}, {"Glasses", "X-Ray glasses", 19016, 2, 500}, {"Glasses", "Plastic black shades", 19017, 2, 500}, {"Glasses", "Plastic orange shades", 19018, 2, 500}, {"Glasses", "Plastic red shades", 19019, 2, 500}, {"Glasses", "Plastic blue shades", 19020, 2, 500}, {"Glasses", "Plastic green shades", 19021, 2, 500}, {"Glasses", "Clear sunglasses", 19022, 2, 500}, {"Glasses", "Blue sunglasses", 19023, 2, 500}, {"Glasses", "Purple sunglasses", 19024, 2, 500}, {"Glasses", "Pink sunglasses", 19025, 2, 500}, {"Glasses", "Red sunglasses", 19026, 2, 500}, {"Glasses", "Brown sunglasses", 19027, 2, 500}, {"Glasses", "Yellow sunglasses", 19028, 2, 500}, {"Glasses", "Green sunglasses", 19029, 2, 500}, {"Glasses", "Plain brown shades", 19030, 2, 500}, {"Glasses", "Plain yellow shades", 19031, 2, 500}, {"Glasses", "Plain red shades", 19032, 2, 500}, {"Glasses", "Plain black shades", 19033, 2, 500}, {"Glasses", "Checkered glasses", 19034, 2, 500}, {"Glasses", "Wavy glasses", 19035, 2, 500}, {"Bandanas & masks", "Balaclava", 19801, 2, 375}, {"Bandanas & masks", "Dark blue bandana", 18891, 2, 375}, {"Bandanas & masks", "Red bandana", 18892, 2, 375}, {"Bandanas & masks", "Red & white bandana", 18893, 2, 375}, {"Bandanas & masks", "Orange star bandana", 18894, 2, 375}, {"Bandanas & masks", "Skull bandana", 18895, 2, 375}, {"Bandanas & masks", "Black bandana", 18896, 2, 375}, {"Bandanas & masks", "Blue bandana", 18897, 2, 375}, {"Bandanas & masks", "Green bandana", 18898, 2, 375}, {"Bandanas & masks", "Pink bandana", 18899, 2, 375}, {"Bandanas & masks", "Hippie bandana", 18900, 2, 375}, {"Bandanas & masks", "Tiger bandana", 18901, 2, 375}, {"Bandanas & masks", "Yellow bandana", 18902, 2, 375}, {"Bandanas & masks", "Purple bandana", 18903, 2, 375}, {"Bandanas & masks", "Cool blue bandana", 18904, 2, 375}, {"Bandanas & masks", "Brown bandana", 18905, 2, 375}, {"Bandanas & masks", "Skull bandana mask", 18911, 2, 375}, {"Bandanas & masks", "Black bandana mask", 18912, 2, 375}, {"Bandanas & masks", "Grove bandana mask", 18913, 2, 375}, {"Bandanas & masks", "Camo bandana mask", 18914, 2, 375}, {"Bandanas & masks", "Hippie bandana mask", 18915, 2, 375}, {"Bandanas & masks", "Yellow bandana mask", 18916, 2, 375}, {"Bandanas & masks", "Blue bandana mask", 18917, 2, 375}, {"Bandanas & masks", "Green bandana mask", 18918, 2, 375}, {"Bandanas & masks", "White bandana mask", 18919, 2, 375}, {"Bandanas & masks", "Flower bandana mask", 18920, 2, 375}, {"Bandanas & masks", "White hockey mask", 19036, 2, 375}, {"Bandanas & masks", "Red hockey mask", 19037, 2, 375}, {"Bandanas & masks", "Green hockey mask", 19038, 2, 375}, {"Bandanas & masks", "Sexy mask", 19557, 2, 375}, {"Bandanas & masks", "Devil mask", 11704, 2, 375}, {"Bandanas & masks", "Gas mask", 19472, 2, 375}, {"Bandanas & masks", "Zorro mask", 18974, 2, 375}, {"Bandanas & masks", "Gimp mask", 19163, 2, 375}, {"Hats & caps", "Santa hat", 19064, 2, 240}, {"Hats & caps", "Dude hat", 19160, 2, 240}, {"Hats & caps", "Top hat", 19352, 2, 240}, {"Hats & caps", "Witch hat", 19528, 2, 240}, {"Hats & caps", "Yellow fire hat", 19330, 2, 240}, {"Hats & caps", "Black fire hat", 19331, 2, 240}, {"Hats & caps", "Black beret", 18921, 2, 240}, {"Hats & caps", "Brown beret", 18922, 2, 240}, {"Hats & caps", "Blue beret", 18923, 2, 240}, {"Hats & caps", "Camo beret", 18924, 2, 240}, {"Hats & caps", "Red beret", 18925, 2, 240}, {"Hats & caps", "Camo cap", 18926, 2, 240}, {"Hats & caps", "Wave cap", 18927, 2, 240}, {"Hats & caps", "Hippy cap", 18928, 2, 240}, {"Hats & caps", "Green cap", 18929, 2, 240}, {"Hats & caps", "Red cap", 18930, 2, 240}, {"Hats & caps", "Blue cap", 18931, 2, 240}, {"Hats & caps", "Orange cap", 18932, 2, 240}, {"Hats & caps", "White cap", 18933, 2, 240}, {"Hats & caps", "Plain pink cap", 18934, 2, 240}, {"Hats & caps", "Plain yellow cap", 18935, 2, 240}, {"Hats & caps", "Blue back cap", 18939, 2, 240}, {"Hats & caps", "Wave back cap", 18940, 2, 240}, {"Hats & caps", "Black back cap", 18941, 2, 240}, {"Hats & caps", "White back cap", 18942, 2, 240}, {"Hats & caps", "Green back cap", 18943, 2, 240}, {"Hats & caps", "Red boater hat", 18944, 2, 240}, {"Hats & caps", "Green boater hat", 18945, 2, 240}, {"Hats & caps", "Striped boater hat", 18946, 2, 240}, {"Hats & caps", "Black bowler hat", 18947, 2, 240}, {"Hats & caps", "White bowler hat", 19488, 2, 240}, {"Hats & caps", "Blue bowler hat", 18948, 2, 240}, {"Hats & caps", "Green bowler hat", 18949, 2, 240}, {"Hats & caps", "Red bowler hat", 18950, 2, 240}, {"Hats & caps", "Yellow bowler hat", 18951, 2, 240}, {"Hats & caps", "Black knit cap", 18953, 2, 240}, {"Hats & caps", "White knit cap", 18954, 2, 240}, {"Hats & caps", "Hippie hat", 18960, 2, 240}, {"Hats & caps", "Born 2 truck hat", 18961, 2, 240}, {"Hats & caps", "Brown cowboy hat", 19098, 2, 240}, {"Hats & caps", "Black cowboy hat", 19096, 2, 240}, {"Hats & caps", "Skully cap", 18964, 2, 240}, {"Hats & caps", "Black bucket hat", 18967, 2, 240}, {"Hats & caps", "Plaid bucket hat", 18968, 2, 240}, {"Hats & caps", "Zig-Zag bucket hat", 18969, 2, 240}, {"Hats & caps", "Camo bucket hat", 19106, 2, 240}, {"Hats & caps", "Hippy hat", 19113, 2, 240}, {"Hats & caps", "Don't shoot me hat", 19114, 2, 240}, {"Hats & caps", "Skull hat", 19115, 2, 240}, {"Hats & caps", "Tiger hat", 18970, 2, 240}, {"Hats & caps", "Hard hat", 18638, 2, 240}, {"Hats & caps", "Straw hat", 19553, 2, 240}, {"Hats & caps", "Pizza hat", 19558, 2, 240}, {"Hats & caps", "Beanie hat", 19554, 2, 240}, {"Hats & caps", "Checkered fedora", 18971, 2, 240}, {"Hats & caps", "Orange fedora", 18972, 2, 240}, {"Hats & caps", "Yellow fedora", 18973, 2, 240}, {"Hats & caps", "Camoflauge helmet", 19101, 2, 240}, {"Hats & caps", "Black helmet", 19116, 2, 240}, {"Hats & caps", "Red helmet", 19117, 2, 240}, {"Hats & caps", "Green helmet", 19118, 2, 240}, {"Hats & caps", "Blue helmet", 19119, 2, 240}, {"Hats & caps", "Yellow helmet", 19120, 2, 240}, {"Hats & caps", "Boxing helmet", 18952, 2, 240}, {"Hats & caps", "Motorcycle helmet", 18645, 2, 240}, {"Misc clothing", "Gold watch", 19039, 6, 500}, {"Misc clothing", "Silver watch", 19040, 6, 500}, {"Misc clothing", "Bronze watch", 19041, 6, 500}, {"Misc clothing", "Yellow watch", 19042, 6, 500}, {"Misc clothing", "White watch", 19043, 6, 500}, {"Misc clothing", "Purple watch", 19044, 6, 500}, {"Misc clothing", "Pink watch", 19045, 6, 500}, {"Misc clothing", "Green watch", 19046, 6, 500}, {"Misc clothing", "Blue watch", 19047, 6, 500}, {"Misc clothing", "Camo watch", 19053, 6, 500}, {"Misc clothing", "White headphones", 19421, 2, 500}, {"Misc clothing", "Black headphones", 19422, 2, 500}, {"Misc clothing", "Orange headphones", 19423, 2, 500}, {"Misc clothing", "Blue headphones", 19424, 2, 500}, {"Misc clothing", "Red clown hair", 19274, 2, 500}, {"Misc clothing", "Grey clown hair", 19518, 2, 500}, {"Misc clothing", "Black hair", 19077, 2, 500}, {"Misc clothing", "Grey hair", 19517, 2, 500}, {"Misc clothing", "Bass guitar", 19317, 1, 500}, {"Misc clothing", "White guitar", 19318, 1, 500}, {"Misc clothing", "Black guitar", 19319, 1, 500}, {"Misc clothing", "Pilot hat", 19520, 2, 500}, {"Misc clothing", "Bag of money", 1550, 1, 500}, {"Misc clothing", "Shop basket", 19592, 6, 500}, {"Misc clothing", "Oil can", 19621, 6, 500}, {"Misc clothing", "Broom", 19622, 1, 500}, {"Misc clothing", "Camera", 19623, 6, 500}, {"Misc clothing", "Briefcase", 19624, 6, 500}, {"Misc clothing", "Cigarette", 19625, 2, 500}, {"Misc clothing", "Spade", 19626, 1, 500}, {"Misc clothing", "Left boxing glove", 19555, 5, 500}, {"Misc clothing", "Right boxing glove", 19556, 6, 500}, {"Misc clothing", "Scarf", 19469, 2, 500}, {"Misc clothing", "Eye patch", 19085, 2, 500}, {"Misc clothing", "Hiker backpack", 19559, 1, 500}, {"Misc clothing", "Construction vest", 19904, 1, 500}, {"Misc clothing", "Police radio", 19942, 1, 500}, {"Misc clothing", "Bodybag", 19944, 1, 500}, {"Misc clothing", "Sports bag", 11745, 1, 500}, {"Misc clothing", "Holster", 19773, 8, 500}, {"Misc clothing", "Fedora", 18639, 2, 500}, {"Misc clothing", "Afro", 18640, 2, 500}, {"Misc clothing", "Flashlight", 18641, 6, 500}, {"Misc clothing", "Hammer", 18635, 6, 500}, {"Misc clothing", "Wrench", 18633, 2, 500}, {"Misc clothing", "Backpack", 3026, 2, 500} }; enum copEnum { cModel, cBone, cName[24] }; new const copClothing[][copEnum] = { {18636, 2, "Police cap"}, {19521, 2, "Police hat"}, {19099, 2, "Black rim hat"}, {19100, 2, "Brown rim hat"}, {19139, 2, "Red shades"}, {19140, 2, "Blue shades"}, {19138, 2, "Black shades"}, {19774, 1, "Badge"}, {19942, 1, "Radio"}, {19162, 2, "Blue cap"}, {19161, 2, "Black cap"}, {19200, 2, "Bike helmet"}, {18637, 1, "Riot shield"}, {19141, 2, "SWAT helmet"}, {19142, 1, "SWAT armor"}, {19515, 1, "Grey armor"}, {19514, 2, "Grey helmet"}, {19777, 1, "FBI insignia"}, {19776, 1, "FBI ID card"}, {18642, 1, "Taser"}, {18641, 1, "Flashlight"}, {11749, 1, "Handcuffs"}, {11750, 1, "Closed cuff"}, {19783, 1, "Police badge"}, {19784, 1, "Police badge 2"}, {19785, 1, "Senior Ld. badge"}, {19778, 1, "Detective badge"}, {19779, 1, "Detective badge 2"}, {19780, 1, "Detective badge 3"}, {19781, 1, "Sergeant badge"}, {19782, 1, "Sergeant badge 2"} }; enum achievementEnum { aName[24], aDescription[64] }; new const achievementInfo[][achievementEnum] = { {"First wheels", "Purchase a vehicle for the first time."}, {"Working class", "Earn $20,000 on your paycheck."}, {"Legal driver", "Acquire your drivers license at the DMV."}, {"Meeting people", "Shake a hand for the first time."}, {"Regular", "Play a total of 20 playing hours."}, {"Addicted", "Play a total of 40 playing hours."}, {"Five stars", "Achieve level 5 on your account."}, {"Top tier", "Achieve level 10 on your account."}, {"Dress up", "Attach up to 5 clothing items at once."}, {"Dirty deeds", "Complete a drug deal with someone."}, {"Dedication", "Complete an entire matrun onfoot."}, {"Obamacare", "Spawn at a hospital while insured."}, {"High roller", "Earn $500,000 in total money."}, {"I'm rich!", "Spend $500,000 in total money."}, {"Benefits", "Fully - a perk for the first time."}, {"Experienced", "Fully maximize your skill level for any job."}, {"High times", "Get stoned for the first time."}, {"Party hard", "Buy alcohol at a bar and get drunk."}, {"Flash mob", "Dance with five other people at once."}, {"Cookie jar", "Earn a total of five cookies."}, {"Diamond!", "Mine a diamond."} }; enum dealerEnum { carCategory[16], carModel, carPrice }; /* =============================================== [START]Backpack Player System by ToiletDuck =============================================== */ /* ------------------ Defines ---------------- */ #define MAX_BACKPACKS 2000 #define MAX_STOREGUN 5 /* Array starts on 0 */ #define DIALOG_EDITMAINBACKPACK 6000 #define DIALOG_EDITITEMS 6001 #define DIALOG_BACKPACKMENU 6005 // For Player Dialog /backpack #define DIALOG_ACTIONBACKPACKMENU 6006 #define DIALOG_PUTAKEITEMS 6007 /* Limit Item Types */ #define LIMIT_CASH 0 #define LIMIT_POT 1 #define LIMIT_CRACK 2 #define LIMIT_MATS 3 #define LIMIT_GUN 4 #define LIMIT_AMMO 5 /* Item Types */ #define ITEM_CASH 1 #define ITEM_POT 2 #define ITEM_CRACK 3 #define ITEM_MATS 4 #define ITEM_GUNS 5 /* Edit Types */ #define TYPE_CASH 1 #define TYPE_POT 2 #define TYPE_CRACK 3 #define TYPE_MATS 4 #define TYPE_GUN1 5 #define TYPE_GUN2 6 #define TYPE_GUN3 7 #define TYPE_GUN4 8 #define TYPE_GUN5 9 enum backpackinfo { bBackpackOwner, bBackpackSize, bHouseStored, bVehicleStored, bCash, bPot, bCrack, bMats, bGun[MAX_STOREGUN] }; /* ----------------- Variables --------------- */ //new itemtype[][] = {"Nothing", "Cash", "Pot", "Crack", "Material","Weapon"}; new storagetype[][] = { "None", "Small Backpack", "Medium Backpack", "Large Backpack"}; // For Backpack System should move to defines later //Cash, Pot, Crack, Mats, Weapons new sbackpacklimit[] = { 3000000, 70, 70, 100000, 3}; new mbackpacklimit[] = { 5000000, 100, 100, 200000, 5}; new lbackpacklimit[] = { 8000000, 150, 150, 300000, 8}; new BackpackInfo[MAX_BACKPACKS][backpackinfo]; new backpackid[MAX_PLAYERS]; /* =============================================== [END]Backpack Player System by ToiletDuck =============================================== */ new const vehicleArray[][dealerEnum] = { {"Bikes", 481, 5000}, {"Bikes", 509, 5000}, {"Bikes", 510, 10000}, {"Bikes", 462, 15000}, {"Bikes", 471, 17500}, {"Bikes", 448, 20000}, {"Bikes", 468, 30000}, {"Bikes", 586, 37500}, {"Bikes", 463, 50000}, {"Bikes", 521, 75000}, {"Bikes", 461, 80000}, {"Saloons", 549, 23000}, {"Saloons", 542, 24500}, {"Saloons", 546, 27500}, {"Saloons", 517, 29000}, {"Saloons", 419, 30000}, {"Saloons", 466, 32500}, {"Saloons", 467, 33000}, {"Saloons", 475, 34500}, {"Saloons", 492, 37500}, {"Saloons", 445, 42500}, {"Saloons", 529, 45000}, {"Saloons", 540, 47500}, {"Saloons", 550, 52500}, {"Saloons", 421, 55000}, {"Saloons", 551, 65000}, {"Saloons", 547, 70000}, {"Saloons", 426, 87500}, {"Saloons", 409, 90000}, {"Saloons", 580, 125000}, {"Off-Road", 500, 57500}, {"Off-Road", 400, 65000}, {"Off-Road", 489, 67500}, {"Off-Road", 495, 75000}, {"Off-Road", 579, 80000}, {"Station wagons", 418, 27500}, {"Station wagons", 404, 35000}, {"Station wagons", 479, 37500}, {"Station wagons", 458, 40000}, {"Station wagons", 561, 55000}, {"Sports cars", 496, 40000}, {"Sports cars", 402, 80000}, {"Sports cars", 477, 50000}, {"Sports cars", 565, 55000}, {"Sports cars", 589, 60000}, {"Sports cars", 558, 75000}, {"Sports cars", 559, 80000}, {"Sports cars", 587, 85000}, {"Sports cars", 562, 100000}, {"Sports cars", 603, 125000}, {"Sports cars", 494, 175000}, {"Sports cars", 560, 200000}, {"Sports cars", 429, 325000}, {"Sports cars", 541, 425000}, {"Sports cars", 415, 475000}, {"Sports cars", 451, 575000}, {"Sports cars", 411, 600000}, {"Lowriders", 412, 35000}, {"Lowriders", 576, 40000}, {"Lowriders", 534, 47500}, {"Lowriders", 566, 50000}, {"Lowriders", 535, 52500}, {"Lowriders", 536, 57500}, {"Lowriders", 567, 60000}, {"Lowriders", 575, 75000}, {"Industrial", 478, 20000}, {"Industrial", 543, 27500}, {"Industrial", 600, 30000}, {"Industrial", 422, 35000}, {"Industrial", 413, 40000}, {"Industrial", 440, 45000}, {"Industrial", 525, 57500}, {"Industrial", 554, 62500}, {"Industrial", 482, 65000}, {"Industrial", 552, 70000}, {"Industrial", 414, 75000}, {"Industrial", 498, 80000}, {"Industrial", 578, 105000}, {"Public service", 420, 30000}, {"Public service", 438, 32500}, {"Public service", 437, 75000}, {"Public service", 431, 75000}, {"Boats", 473, 20000}, {"Boats", 472, 100000}, {"Boats", 446, 150000}, {"Boats", 493, 175000}, {"Boats", 452, 200000}, {"Boats", 484, 225000}, {"Boats", 595, 225000}, {"Boats", 453, 250000}, {"Boats", 454, 300000}, {"Aircraft", 487, 250000}, {"Aircraft", 469, 300000}, {"Aircraft", 593, 325000}, {"Aircraft", 512, 350000}, {"Aircraft", 513, 375000}, {"Aircraft", 417, 400000}, {"Aircraft", 460, 425000}, {"Aircraft", 548, 500000}, {"Aircraft", 519, 600000}, {"Aircraft", 511, 750000}, {"Aircraft", 553, 1000000} }; enum bizInts { intName[32], intID, Float:intX, Float:intY, Float:intZ, Float:intA }; new const bizInteriorArray[][bizInts] = { {"24/7 (version 1)", 17, -25.9733, -187.8952, 1003.5468, 0.0000}, {"24/7 (version 2)", 10, 6.0159, -31.0345, 1003.5493, 0.0000}, {"24/7 (version 3)", 18, -30.9967, -91.4492, 1003.5468, 0.0000}, {"24/7 (version 4)", 16, -25.9416, -140.6656, 1003.5468, 0.0000}, {"24/7 (version 5)", 4, -27.3069, -30.8341, 1003.5573, 0.0000}, {"24/7 (version 6)", 6, -27.4368, -57.4361, 1003.5468, 0.0000}, {"24/7 (Custom int)", 6, 2841.4885, 2444.7773, 1786.4811, 87.9534}, {"Ammunation (version 1)", 7, 315.7398, -143.1958, 999.6016, 0.0000}, {"Ammunation (version 2)", 1, 285.3190, -41.1576, 1001.5156, 0.0000}, {"Ammunation (version 3)", 4, 285.7825, -85.9860, 1001.5228, 0.0000}, {"Ammunation (version 4)", 6, 296.7723, -111.6399, 1001.5156, 0.0000}, {"Ammunation (version 5)", 6, 316.2890, -169.7619, 999.6010, 0.0000}, {"Binco", 15, 207.6329, -110.7673, 1005.1328, 0.0000}, {"Pro-Laps", 3, 206.9459, -139.5319, 1003.5078, 0.0000}, {"Didier Sachs", 14, 204.2969, -168.3488, 1000.5233, 0.0000}, {"Victim", 5, 226.7738, -8.2257, 1002.2108, 90.0000}, {"Zip", 18, 161.3670, -96.4953, 1001.8046, 0.0000}, {"SubUrban", 1, 203.7149, -50.2200, 1001.8046, 0.0000}, {"Betting (version 1)", 3, 834.1848, 7.3453, 1004.1870, 90.0000}, {"Betting (version 2)", 1, -2170.3428, 640.7771, 1052.3817, 0.0000}, {"Donut Shop", 17, 377.0733, -193.0574, 1000.6400, 0.0000}, {"Burger Shot", 10, 363.1346, -74.8441, 1001.5078, 315.0000}, {"Pizza Stack", 5, 372.3019, -133.1221, 1001.4921, 0.0000}, {"Cluckin' Bell", 9, 364.8536, -11.1400, 1001.8516, 0.0000}, {"Marco's Bistro", 1, -795.0334, 489.8574, 1376.1953, 0.0000}, {"Cafeteria", 4, 459.7685, -88.6637, 999.5547, 90.0000}, {"Barber Shop", 3, 418.5545, -83.9392, 1001.8046, 0.0000}, {"Tattoo Shop", 3, -204.4362, -43.8119, 1002.2733, 0.0000}, {"Ganton Gym", 5, 772.2800, -4.7154, 1000.7288, 0.0000}, {"Las Venturas Gym", 7, 773.8508, -78.3952, 1000.6621, 0.0000}, {"San Fierro Gym", 6, 774.1206, -49.9538, 1000.5858, 0.0000}, {"Sex Shop", 3, -100.3628, -24.4456, 1000.7188, 0.0000}, {"RC Shop", 6, -2240.3610, 128.2816, 1035.4210, 270.0000}, {"Four Dragons Casino", 10, 2018.2132, 1017.7788, 996.8750, 90.0000}, {"Caligulas Casino", 1, 2234.0485, 1714.1568, 1012.3596, 180.0000}, {"Red Sands Casino", 12, 1133.1075, -15.3114, 1000.6796, 0.0000}, {"Alhambra", 17, 493.3728, -23.9953, 1000.6796, 0.0000}, {"Pig Pen", 2, 1204.7922, -13.2587, 1000.9218, 0.0000}, {"Big Spread Ranch", 3, 1212.1400, -26.3005, 1000.9531, 180.0000}, {"Ten Green Bottles", 11, 501.9559, -67.9867, 998.7578, 180.0000}, {"Lil' Probe Inn", 18, -228.7570, 1401.2421, 27.7656, 270.0000}, {"Warehouse", 18, 1307.0178, 4.1193, 1001.0289, 90.0000} }; enum intEnum { intName[32], intID, Float:intX, Float:intY, Float:intZ, Float:intA } new const interiorArray[][intEnum] = { {"24/7 (version 1)", 17, -25.7220, -187.8215, 1003.5468, 5.0760}, {"24/7 (version 2)", 10, 6.0854, -28.8966, 1003.5493, 5.0363}, {"24/7 (version 3)", 18, -30.9874, -89.6806, 1003.5468, 359.8399}, {"24/7 (version 4)", 16, -26.1856, -140.9163, 1003.5468, 2.9086}, {"24/7 (version 5)", 4, -27.8439, -26.6737, 1003.5573, 184.3117}, {"24/7 (version 6)", 6, -26.8339, -55.5844, 1003.5468, 3.9528}, {"8-Track Stadium", 7, -1403.0114, -250.4526, 1043.5340, 355.8576}, {"Abandoned AC Tower", 10, 419.8934, 2537.1154, 10.0000, 67.6537}, {"Ammunation (version 1)", 7, 315.2438, -140.8858, 999.6016, 7.4225}, {"Ammunation (version 2)", 1, 285.8359, -39.0166, 1001.5156, 0.7529}, {"Ammunation (version 3)", 4, 291.7626, -80.1305, 1001.5156, 290.2195}, {"Ammunation (version 4)", 6, 297.1440, -109.8702, 1001.5156, 20.2254}, {"Ammunation (version 5)", 6, 316.5025, -167.6271, 999.5938, 10.3030}, {"Andromada", 9, 315.4544, 976.5972, 1960.8509, 359.6368}, {"Angel Pine Trailer", 2, 1.1851, -3.2386, 999.4284, 87.5718}, {"Area 69", 0, 215.1515, 1874.0577, 13.1406, 177.5538}, {"Atrium", 18, 1727.2851, -1642.9449, 20.2254, 172.4192}, {"B Dup's Apartment", 3, 1527.0467, -12.0235, 1002.0971, 350.0013}, {"B Dup's Crack Palace", 2, 1523.5096, -47.8209, 1002.2697, 262.7037}, {"Bar", 11, 501.9577, -70.5646, 998.7578, 171.5706}, {"Barbara's Love nest", 5, 322.5014, 303.6906, 999.1483, 8.1745}, {"Barber Shop (version 1)", 3, 418.4666, -80.4595, 1001.8046, 343.2358}, {"Barber Shop (version 2)", 12, 411.9707, -51.9216, 1001.8983, 173.3448}, {"Barber Shop (version 3)", 2, 414.2987, -18.8043, 1001.8046, 41.4263}, {"Big Smoke's Crack Palace", 2, 2536.5322, -1294.8425, 1044.1250, 254.9548}, {"Bike School (version 1)", 3, 1494.8587, 1306.4798, 1093.2951, 196.0650}, {"Bike School (version 2)", 0, 1168.5118, 1360.1145, 10.9293, 196.5933}, {"Binco", 15, 207.5218, -109.7446, 1005.1328, 358.6199}, {"Blastin' Fools Records", 3, 1037.8276, 0.3970, 1001.2844, 353.9335}, {"Blood Bowl Stadium", 15, -1417.8927, 932.4481, 1041.5312, 0.7013}, {"Blueberry Liquor Store", 0, 255.2082, -59.6753, 1.5701, 1.4644}, {"Brothel 1", 3, 974.0177, -9.5937, 1001.1483, 22.6044}, {"Brothel 2", 3, 961.9307, -51.9071, 1001.1171, 95.5381}, {"Budget Inn Motel Room", 12, 446.3247, 509.9660, 1001.4193, 330.5671}, {"Burger Shot", 10, 366.0248, -73.3478, 1001.5078, 292.0083}, {"Burglary House 1", 15, 295.1390, 1473.3719, 1080.2578, 352.9526}, {"Burglary House 2", 3, 234.6087, 1187.8194, 1080.2578, 349.4844}, {"Burglary House 3", 5, 227.7559, 1114.3842, 1080.9920, 266.2622}, {"Burglary House 4", 4, 261.1163, 1287.2197, 1080.2578, 178.9149}, {"Burglary House 5", 4, 221.6766, 1142.4962, 1082.6092, 184.9618}, {"Burglary House 6", 10, 24.3768, 1341.1827, 1084.3750, 8.3304}, {"Burglary House 7", 4, -262.1759, 1456.6158, 1084.3670, 82.4589}, {"Burglary House 8", 5, 22.8610, 1404.9165, 1084.4295, 349.6158}, {"Burglary House 9", 5, 140.3679, 1367.8835, 1083.8620, 349.2372}, {"Burglary House 10", 6, 234.2825, 1065.2290, 1084.2099, 4.3864}, {"Burglary House 11", 6, -68.5145, 1353.8485, 1080.2109, 3.5741}, {"Burglary House 12", 2, 225.5706, 1240.0643, 1082.1406, 96.2852}, {"Burglary House 13", 15, -285.2510, 1471.1970, 1084.3750, 85.6547}, {"Burglary House 14", 8, -42.5265, 1408.2298, 1084.4295, 172.0679}, {"Burglary House 15", 9, 84.9244, 1324.2983, 1083.8592, 159.5581}, {"Burglary House 16", 9, 260.7420, 1238.2259, 1084.2578, 84.3084}, {"Burglary House 17", 1, 224.2879, 1289.1905, 1082.1406, 359.8680}, {"Burglary House 18", 5, 239.2819, 1114.1989, 1080.9920, 270.2654}, {"Burglary House 19", 2, 446.6260, 1397.7380, 1084.3045, 343.9645}, {"Burning Desire Building", 5, 2350.1596, -1181.0656, 1027.9764, 99.1864}, {"Caligula's Casino", 1, 2233.9362, 1711.8038, 1011.6312, 184.3890}, {"Caligula's Roof", 1, 2268.5156, 1647.7680, 1084.2342, 99.7331}, {"Casino (Redsands West)", 12, 1133.3498, -7.8460, 1000.6796, 165.8482}, {"Cemetary", 0, 818.7714, -1102.8687, 25.7940, 91.1437}, {"Club", 17, 493.1441, -24.2607, 1000.6796, 356.9862}, {"Cluckin' Bell", 9, 366.0002, -9.4336, 1001.8516, 160.5278}, {"Cobra Gym", 6, 773.8886, -47.7696, 1000.5858, 10.7159}, {"Colonel Furhberger's", 8, 2807.3603, -1171.7048, 1025.5703, 193.7117}, {"Crack Den", 5, 227.3921, 1114.6572, 1080.9985, 267.4590}, {"Denise's Bedroom", 1, 245.2306, 304.7632, 999.1483, 273.4364}, {"Didier Sachs", 14, 204.1658, -165.7678, 1000.5233, 181.7583}, {"Dillimore Gas Station", 0, 663.0587, -573.6273, 16.3358, 264.9829}, {"Diner 1", 5, 454.9851, -107.2546, 999.4376, 309.0195}, {"Dirtbike Stadium", 4, -1421.5616, -663.8261, 1059.5567, 170.9340}, {"Driving School", 3, -2031.1196, -115.8285, 1035.1717, 190.1876}, {"Fanny Batter's Whore House", 6, 748.4622, 1438.2376, 1102.9531, 0.6068}, {"Four Dragons", 10, 2016.1156, 1017.1541, 996.8750, 88.0055}, {"Francis International Airport", 14, -1813.2130, -58.0120, 1058.9641, 335.3197}, {"Ganton Gym", 5, 770.8032, -0.7031, 1000.7266, 22.8598}, {"Helena's Barn", 3, 290.6228, 309.0621, 999.1483, 89.9162}, {"Inside Track Betting", 3, 830.6016, 5.9404, 1004.1796, 125.8149}, {"Jay's Diner", 4, 449.0172, -88.9894, 999.5546, 89.6606}, {"Jefferson Motel", 15, 2217.2810, -1150.5349, 1025.7967, 273.7326}, {"Jet Interior", 1, 1.5491, 23.3183, 1199.5937, 359.9053}, {"K.A.C.C. Military Fuels Depot", 0, 2548.4807, 2823.7429, 10.8203, 270.6003}, {"Katie's Lovenest", 2, 269.6405, 305.9512, 999.1483, 215.6625}, {"Kickstart Stadium", 14, -1420.4277, 1616.9221, 1052.5312, 159.1255}, {"Las Venturas Gym", 7, 773.7318, -74.6957, 1000.6541, 5.2304}, {"Las Venturas Police Department", 3, 288.4721, 170.0646, 1007.1793, 22.0477}, {"Las Venturas Tattoo parlor", 3, -201.2236, -43.2463, 1002.2733, 45.8613}, {"Liberty City", 1, -741.8494, 493.0036, 1371.9764, 71.7780}, {"Lil' Probe Inn", 18, -227.5702, 1401.5544, 27.7656, 269.2976}, {"Loco Low Co", 2, 611.3535, -77.5574, 997.9995, 320.9263}, {"Los Santos Airport", 14, -1864.9433, 55.7323, 1055.5274, 85.8541}, {"Los Santos Police Department", 6, 246.6694, 65.8039, 1003.6406, 7.9562}, {"Los Santos Tattoo Parlor", 16, -202.8419, -24.0324, 1002.2733, 252.8153}, {"Lost San Fierro Tattoo parlor", 17, -202.9380, -6.7006, 1002.2733, 204.2693}, {"Madd Dogg's Mansion", 5, 1267.8405, -776.9586, 1091.9062, 231.3417}, {"Michelle's Love Nest", 4, 306.1965, 307.8190, 1003.3046, 203.1354}, {"Millie's Bedroom", 6, 344.9984, 307.1824, 999.1557, 193.6430}, {"OG Loc's House", 3, 512.9290, -11.6927, 1001.5653, 198.7669}, {"Old Venturas Strip Casino", 2, 2236.6997, -1078.9477, 1049.0234, 2.5706}, {"Otto's Autos", 0, -1658.1656, 1215.0002, 7.2500, 103.9074}, {"Oval Stadium", 1, -1402.6612, 106.3897, 1032.2734, 105.1354}, {"Palamino Bank", 0, 2306.3825, -15.2363, 26.7495, 274.4898}, {"Palamino Diner", 0, 2331.8984, 6.7814, 26.5032, 100.2357}, {"Pizza Stack", 5, 372.5563, -131.3607, 1001.4921, 354.2283}, {"Planning Department", 3, 386.5259, 173.6381, 1008.3828, 63.7397}, {"Pro-Laps", 3, 206.4627, -137.7075, 1003.0938, 10.9347}, {"RC Battlefield", 10, -1129.8907, 1057.5423, 1346.4139, 274.5267}, {"Rosenberg's Office", 2, 2182.2016, 1628.5848, 1043.8723, 224.8601}, {"Rusty Brown's Donuts", 17, 378.0260, -190.5155, 1000.6328, 141.0245}, {"Ryder's House", 2, 2447.8703, -1704.4509, 1013.5078, 314.5252}, {"Safe House (version 1)", 5, 2233.6918, -1112.8105, 1050.8828, 8.6483}, {"Safe House (version 2)", 9, 2319.1271, -1023.9561, 1050.2109, 167.3959}, {"Safe House (version 3)", 10, 2261.0976, -1137.8833, 1050.6328, 266.8800}, {"San Fierro Garage", 1, -2041.2332, 178.3968, 28.8465, 156.2153}, {"San Fierro Police Department", 10, 246.0688, 108.9701, 1003.2188, 0.2921}, {"Secret Valley Diner", 6, 442.1293, -52.4780, 999.7166, 177.9394}, {"Sex Shop", 3, -100.2674, -22.9375, 1000.7188, 17.2849}, {"Sherman Dam", 17, -944.2401, 1886.1534, 5.0050, 179.8547}, {"Sindacco Abatoir", 1, 963.0584, 2159.7563, 1011.0302, 175.3130}, {"SubUrban", 1, 204.1174, -46.8045, 1001.8046, 357.5776}, {"Sweet's House", 1, 2527.0175, -1679.2076, 1015.4984, 260.9707}, {"The Big Spread Ranch", 3, 1212.1489, -28.5387, 1000.9531, 170.5691}, {"The Camel's Toe Safehouse", 1, 2216.1281, -1076.3050, 1050.4842, 86.4280}, {"The Johnson House", 3, 2496.0549, -1695.1749, 1014.7421, 179.2174}, {"The Pig Pen (strip club 2)", 2, 1204.6689, -13.5429, 1000.9218, 350.0202}, {"The Pleasure Domes", 3, -2638.8232, 1407.3393, 906.4608, 94.6792}, {"The Welcome Pump", 1, 681.6215, -451.8933, -25.6172, 166.1660}, {"Torreno's Ranch", 0, -688.1494, 942.0825, 13.6328, 177.6573}, {"Transfenders", 1, 621.4528, -23.7289, 1000.9218, 15.6787}, {"Unused Safe House", 12, 2323.7062, -1147.6507, 1050.7099, 206.5352}, {"Verdant Bluffs Safehouse", 8, 2365.1088, -1133.0793, 1050.8750, 177.3946}, {"Vice Stadium", 16, -1401.0670, 1265.3706, 1039.8670, 178.6483}, {"Victim", 5, 225.0305, -9.1836, 1002.2180, 85.5322}, {"Wang Cars", 0, -1961.6280, 295.2377, 35.4687, 264.4891}, {"Wardrobe/Changing room", 14, 256.9046, -41.6537, 1002.0233, 85.8774}, {"Warehouse 1", 18, 1290.4106, 1.9512, 1001.0200, 179.9418}, {"Warehouse 2", 1, 1412.1472, -2.2836, 1000.9240, 114.6610}, {"Warehouse 3", 0, 2135.2004, -2276.2814, 20.6718, 318.5899}, {"Wheel Arch Angels", 3, 612.2191, -123.9028, 997.9921, 266.5704}, {"Willowfield Safehouse", 11, 2283.3117, 1139.3070, 1050.8984, 19.7031}, {"World of Coq", 1, 445.6003, -6.9822, 1000.7343, 172.2104}, {"Wu-Zi Mu's", 1, -2158.6730, 642.0900, 1052.3750, 86.5401}, {"Zero's RC Shop", 6, -2240.1027, 136.9730, 1035.4139, 269.0953}, {"Zip", 18, 161.4048, -94.2416, 1001.8046, 0.7936}, {"Zombotech", 0, -1916.1268, 714.8615, 46.5625, 152.2839} }; enum radioEnum { rGenre[32], rSubgenre[32] }; new const radioGenreList[][radioEnum] = { {"Alternative", "Alternative"}, {"Alternative", "Adult Alternative"}, {"Alternative", "Britpop"}, {"Alternative", "Classic Alternative"}, {"Alternative", "College"}, {"Alternative", "Dancepunk"}, {"Alternative", "Dream Pop"}, {"Alternative", "Emo"}, {"Alternative", "Goth"}, {"Alternative", "Grunge"}, {"Alternative", "Hardcore"}, {"Alternative", "Indie Pop"}, {"Alternative", "Indie Rock"}, {"Alternative", "Industrial"}, {"Alternative", "LoFi"}, {"Alternative", "Modern Rock"}, {"Alternative", "New Wave"}, {"Alternative", "Noise Pop"}, {"Alternative", "Post Punk"}, {"Alternative", "Power Pop"}, {"Alternative", "Punk"}, {"Alternative", "Ska"}, {"Alternative", "Xtreme"}, {"Blues", "Blues"}, {"Blues", "Acoustic Blues"}, {"Blues", "Cajun and Zydeco"}, {"Blues", "Chicago Blues"}, {"Blues", "Contemporary Blues"}, {"Blues", "Country Blues"}, {"Blues", "Delta Blues"}, {"Blues", "Electric Blues"}, {"Classical", "Classical"}, {"Classical", "Baroque"}, {"Classical", "Chamber"}, {"Classical", "Choral"}, {"Classical", "Classical Period"}, {"Classical", "Early Classical"}, {"Classical", "Impressionist"}, {"Classical", "Modern"}, {"Classical", "Opera"}, {"Classical", "Piano"}, {"Classical", "Romantic"}, {"Classical", "Symphony"}, {"Country", "Country"}, {"Country", "Alt Country"}, {"Country", "Americana"}, {"Country", "Bluegrass"}, {"Country", "Classic Country"}, {"Country", "Contemporary Country"}, {"Country", "Honky Tonk"}, {"Country", "Hot Country Hits"}, {"Country", "Western"}, {"Decades", "Decades"}, {"Decades", "00s"}, {"Decades", "30s"}, {"Decades", "40s"}, {"Decades", "50s"}, {"Decades", "60s"}, {"Decades", "70s"}, {"Decades", "80s"}, {"Decades", "90s"}, {"Easy Listening", "Easy Listening"}, {"Easy Listening", "Exotica"}, {"Easy Listening", "Light Rock"}, {"Easy Listening", "Lounge"}, {"Easy Listening", "Orchestral Pop"}, {"Easy Listening", "Polka"}, {"Easy Listening", "Space Age Pop"}, {"Electronic", "Electronic"}, {"Electronic", "Acid House"}, {"Electronic", "Ambient"}, {"Electronic", "Big Beat"}, {"Electronic", "Breakbeat"}, {"Electronic", "Dance"}, {"Electronic", "Demo"}, {"Electronic", "Disco"}, {"Electronic", "Downtempo"}, {"Electronic", "Drum and Bass"}, {"Electronic", "Dubstep"}, {"Electronic", "Electro"}, {"Electronic", "Garage"}, {"Electronic", "Hard House"}, {"Electronic", "House"}, {"Electronic", "IDM"}, {"Electronic", "Jungle"}, {"Electronic", "Progressive"}, {"Electronic", "Techno"}, {"Electronic", "Trance"}, {"Electronic", "Tribal"}, {"Electronic", "Trip Hop"}, {"Folk", "Folk"}, {"Folk", "Alternative Folk"}, {"Folk", "Contemporary Folk"}, {"Folk", "Folk Rock"}, {"Folk", "New Acoustic"}, {"Folk", "Old Time"}, {"Folk", "Traditional Folk"}, {"Folk", "World Folk"}, {"Inspirational", "Inspirational"}, {"Inspirational", "Christian"}, {"Inspirational", "Christian Metal"}, {"Inspirational", "Christian Rap"}, {"Inspirational", "Christian Rock"}, {"Inspirational", "Classic Christian"}, {"Inspirational", "Contemporary Gospel"}, {"Inspirational", "Gospel"}, {"Inspirational", "Praise and Worship"}, {"Inspirational", "Sermon and Services"}, {"Inspirational", "Southern Gospel"}, {"Inspirational", "Traditional Gospel"}, {"International", "International"}, {"International", "African"}, {"International", "Afrikaans"}, {"International", "Arabic"}, {"International", "Asian"}, {"International", "Bollywood"}, {"International", "Brazilian"}, {"International", "Caribbean"}, {"International", "Celtic"}, {"International", "Chinese"}, {"International", "Creole"}, {"International", "European"}, {"International", "Filipino"}, {"International", "French"}, {"International", "German"}, {"International", "Greek"}, {"International", "Hawaiian & Pacific"}, {"International", "Hebrew"}, {"International", "Hindi"}, {"International", "Indian"}, {"International", "Islamic"}, {"International", "Japanese"}, {"International", "Korean"}, {"International", "Mediterranean"}, {"International", "Middle Eastern"}, {"International", "North American"}, {"International", "Russian"}, {"International", "Soca"}, {"International", "South American"}, {"International", "Tamil"}, {"International", "Turkish"}, {"International", "Worldbeat"}, {"International", "Zouk"}, {"Jazz", "Jazz"}, {"Jazz", "Acid Jazz"}, {"Jazz", "Avant Garde"}, {"Jazz", "Big Band"}, {"Jazz", "Bop"}, {"Jazz", "Classic Jazz"}, {"Jazz", "Cool Jazz"}, {"Jazz", "Fusion"}, {"Jazz", "Hard Bop"}, {"Jazz", "Latin Jazz"}, {"Jazz", "Smooth Jazz"}, {"Jazz", "Swing"}, {"Jazz", "Vocal Jazz"}, {"Jazz", "World Fusion"}, {"Latin", "Latin"}, {"Latin", "Bachata"}, {"Latin", "Banda"}, {"Latin", "Bossa Nova"}, {"Latin", "Cumbia"}, {"Latin", "Flamenco"}, {"Latin", "Latin Dance"}, {"Latin", "Latin Pop"}, {"Latin", "Latin Rap"}, {"Latin", "Latin Rock"}, {"Latin", "Mariachi"}, {"Latin", "Merengue"}, {"Latin", "Ranchera"}, {"Latin", "Reggaeton"}, {"Latin", "Regional Mexican"}, {"Latin", "Salsa"}, {"Latin", "Samba"}, {"Latin", "Tango"}, {"Latin", "Tejano"}, {"Latin", "Tropicalia"}, {"Metal", "Metal"}, {"Metal", "Black Metal"}, {"Metal", "Classic Metal"}, {"Metal", "Death Metal"}, {"Metal", "Extreme Metal"}, {"Metal", "Grindcore"}, {"Metal", "Hair Metal"}, {"Metal", "Heavy Metal"}, {"Metal", "Metalcore"}, {"Metal", "Power Metal"}, {"Metal", "Progressive Metal"}, {"Metal", "Thrash Metal"}, {"Misc", "Misc"}, {"New Age", "New Age"}, {"New Age", "Environmental"}, {"New Age", "Ethnic Fusion"}, {"New Age", "Healing"}, {"New Age", "Meditation"}, {"New Age", "Spiritual"}, {"Pop", "Pop"}, {"Pop", "Adult Contemporary"}, {"Pop", "Barbershop"}, {"Pop", "Bubblegum Pop"}, {"Pop", "Dance Pop"}, {"Pop", "Idols"}, {"Pop", "JPOP"}, {"Pop", "KPOP"}, {"Pop", "Oldies"}, {"Pop", "Soft Rock"}, {"Pop", "Teen Pop"}, {"Pop", "Top 40"}, {"Pop", "World Pop"}, {"Public Radio", "Public Radio"}, {"Public Radio", "College"}, {"Public Radio", "News"}, {"Public Radio", "Sports"}, {"Public Radio", "Talk"}, {"Public Radio", "Weather"}, {"R&B and Urban", "R&B and Urban"}, {"R&B and Urban", "Classic R&B"}, {"R&B and Urban", "Contemporary R&B"}, {"R&B and Urban", "Funk"}, {"R&B and Urban", "Motown"}, {"R&B and Urban", "Neo Soul"}, {"R&B and Urban", "Quiet Storm"}, {"R&B and Urban", "Soul"}, {"R&B and Urban", "Urban Contemporary"}, {"Rap", "Rap"}, {"Rap", "Alternative Rap"}, {"Rap", "Dirty South"}, {"Rap", "East Coast Rap"}, {"Rap", "Freestyle"}, {"Rap", "Gangsta Rap"}, {"Rap", "Hip Hop"}, {"Rap", "Mixtapes"}, {"Rap", "Old School"}, {"Rap", "Turntablism"}, {"Rap", "Underground Hip Hop"}, {"Rap", "West Coast Rap"}, {"Reggae", "Reggae"}, {"Reggae", "Contemporary Reggae"}, {"Reggae", "Dancehall"}, {"Reggae", "Dub"}, {"Reggae", "Pop Reggae"}, {"Reggae", "Ragga"}, {"Reggae", "Reggae Roots"}, {"Reggae", "Rock Steady"}, {"Rock", "Rock"}, {"Rock", "Adult Alternative"}, {"Rock", "Celtic Rock"}, {"Rock", "Classic Rock"}, {"Rock", "Garage Rock"}, {"Rock", "Glam"}, {"Rock", "Hard Rock"}, {"Rock", "Jam Bands"}, {"Rock", "JROCK"}, {"Rock", "Progressive Rock"}, {"Rock", "Psychedelic"}, {"Rock", "Rock & Roll"}, {"Rock", "Rockabilly"}, {"Rock", "Singer & Songwriter"}, {"Rock", "Surf"}, {"Seasonal and Holiday", "Seasonal and Holiday"}, {"Seasonal and Holiday", "Birthday"}, {"Seasonal and Holiday", "Christmas"}, {"Seasonal and Holiday", "Halloween"}, {"Seasonal and Holiday", "Kwanzaa"}, {"Seasonal and Holiday", "Valentine"}, {"Seasonal and Holiday", "Winter"}, {"Soundtracks", "Soundtracks"}, {"Soundtracks", "Anime"}, {"Soundtracks", "Kids"}, {"Soundtracks", "Original Score"}, {"Soundtracks", "Showtunes"}, {"Soundtracks", "Video Game Music"}, {"Talk", "Talk"}, {"Talk", "BlogTalk"}, {"Talk", "Comedy"}, {"Talk", "Community"}, {"Talk", "Educational"}, {"Talk", "Government"}, {"Talk", "News"}, {"Talk", "Old Time Radio"}, {"Talk", "Other Talk"}, {"Talk", "Political"}, {"Talk", "Scanner"}, {"Talk", "Spoken Word"}, {"Talk", "Sports"}, {"Talk", "Technology"}, {"Themes", "Themes"}, {"Themes", "Adult"}, {"Themes", "Best Of"}, {"Themes", "Chill"}, {"Themes", "Eclectic"}, {"Themes", "Experimental"}, {"Themes", "Female"}, {"Themes", "Heartache"}, {"Themes", "Instrumental"}, {"Themes", "LGBT"}, {"Themes", "Love and Romance"}, {"Themes", "Party Mix"}, {"Themes", "Patriotic"}, {"Themes", "Rainy Day Mix"}, {"Themes", "Reality"}, {"Themes", "Sexy"}, {"Themes", "Shuffle"}, {"Themes", "Travel Mix"}, {"Themes", "Trippy"}, {"Themes", "Work Mix"} }; enum zoneEnum { zoneName[32], Float:zoneMinX, Float:zoneMinY, Float:zoneMinZ, Float:zoneMaxX, Float:zoneMaxY, Float:zoneMaxZ }; new const zoneArray[][zoneEnum] = { {"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}, {"Liberty City", -1000.00, 400.00, 1300.00, -700.00, 600.00, 1400.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}, {"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 WP_Hash(buffer[], len, const str[]); native IsValidVehicle(vehicleid); // --------------------------------------- main(){} AntiDeAMX() { new a[][] = { "Unarmed (Fist)", "Brass K" }; #pragma unused a print("Get shit on by Anti-DeAMX"); } GetDate() { new date[5], string[24]; getdate(date[0], date[1], date[2]); gettime(date[3], date[4]); format(string, sizeof(string), "%i-%02d-%02d %02d:%02d", date[0], date[1], date[2], date[3], date[4]); return string; } GetDateFromTimestamp(timestamp, _form=0) { new year=1970, day=0, month=0, hourt=0, mins=0, sec=0; new days_of_month[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 }; new names_of_month[12][10] = {"January","February","March","April","May","June","July","August","September","October","November","December"}; new returnstring[32]; while(timestamp>31622400){ timestamp -= 31536000; if ( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ) timestamp -= 86400; year++; } if ( ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0) ) days_of_month[1] = 29; else days_of_month[1] = 28; while(timestamp>86400){ timestamp -= 86400, day++; if(day==days_of_month[month]) day=0, month++; } while(timestamp>60){ timestamp -= 60, mins++; if( mins == 60) mins=0, hourt++; } sec=timestamp; switch( _form ){ case 1: format(returnstring, 31, "%02d/%02d/%d %02d:%02d:%02d", day+1, month+1, year, hourt, mins, sec); case 2: format(returnstring, 31, "%s %02d, %d, %02d:%02d:%02d", names_of_month[month],day+1,year, hourt, mins, sec); case 3: format(returnstring, 31, "%d %c%c%c %d, %02d:%02d", day+1,names_of_month[month][0],names_of_month[month][1],names_of_month[month][2], year,hourt,mins); case 4: format(returnstring, 31, "%s %02d, %d", names_of_month[month],day+1,year); default: format(returnstring, 31, "%02d.%02d.%d-%02d:%02d:%02d", day+1, month+1, year, hourt, mins, sec); } return returnstring; } FormatNumber(number, money = 1) { new length, value[32]; format(value, sizeof(value), "%i", (number < 0) ? (-number) : (number)); length = strlen(value); if(length > 3) { for(new l = 0, i = length; --i >= 0; l ++) { if((l % 3 == 0) && l > 0) { strins(value, ",", i + 1); } } } if(money) strins(value, "$", 0); if(number < 0) strins(value, "-", 0); return value; } //CMD:mmhelp(playerid, params[]) return callcmd::graphichelp(playerid, params); CMD:graphichelp(playerid, params[]) { if(PlayerInfo[playerid][pGraphic] > 0) { SendClientMessage(playerid, COLOR_YELLOW, "____________________________________________"); if(PlayerInfo[playerid][pGraphic] == GRAPHICRANK_REGULAR) { SendClientMessage(playerid, COLOR_WHITE, "*1* Graphics Designer: /(g)raphic(c)hat /designers"); } else if(PlayerInfo[playerid][pGraphic] == GRAPHICRANK_SENIOR) { SendClientMessage(playerid, COLOR_WHITE, "*2* Video Editor: /(g)raphic(c)hat /designers"); } else if(PlayerInfo[playerid][pGraphic] == GRAPHICRANK_MANAGER) { SendClientMessage(playerid, COLOR_WHITE, "*3* Graphic Manager: /(g)raphic(c)hat /designers /makedesigner"); } } else { SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this commands"); } return 1; } CMD:graphicchat(playerid, params[]) { if(PlayerInfo[playerid][pGraphic] >= 1) { new msg[128]; new str[128]; if(!sscanf(params, "s[128]", msg)) { if(PlayerInfo[playerid][pGraphic] == GRAPHICRANK_REGULAR) str = "Graphics Designer"; else if(PlayerInfo[playerid][pGraphic] == GRAPHICRANK_SENIOR) str = "Video Editor"; else if(PlayerInfo[playerid][pGraphic] == GRAPHICRANK_MANAGER) str = "Graphic Manager"; format(str, sizeof(str), "** %s %s: %s **", str, GetPlayerRPName(playerid), msg); SendGraphicMessage(0xFA58ACFF, str); } else { SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /(g)raphic(c)hat [message]"); } } else { SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this chat."); } return 1; } CMD:makedesigner(playerid, params[]) { if(PlayerInfo[playerid][pGraphic] < GRAPHICRANK_MANAGER && PlayerInfo[playerid][pAdmin] < 8) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); new id, rank[24], str[128]; if(sscanf(params, "us[24]", id, rank)) { SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /makedesigner [playerid] [rank]"); SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} 'None' 'Regular' 'Editor' or 'Manager'"); } else { if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY, "{FF0000}Error:{FFFFFF} That player isn't connected."); if(strcmp(rank, "none", true) == 0 || strcmp(rank, "regular", true) == 0 || strcmp(rank, "editor", true) == 0 || strcmp(rank, "manager", true) == 0) { if(strcmp(rank, "none", true) == 0) { SendAdminMessage(COLOR_YELLOW, "{FF0000}AdmWarning{FFFFFF}: %s has removed %s's status as a Designer.", GetPlayerRPName(playerid), GetPlayerRPName(id)); SendClientMessage(id, COLOR_AQUA, "You are no longer a Designer."); PlayerInfo[id][pGraphic] = GRAPHICRANK_NONE; format(str, sizeof(str), "You removed %s from the Designer team.", GetPlayerRPName(id)); SendClientMessage(playerid, COLOR_AQUA, str); // if(PlayerInfo[playerid][pLevel] >= 2)PlayerInfo[id][pTag] = NTAG_PLAYER; // else PlayerInfo[id][pTag] = NTAG_NEWBIE; return 1; } if(strcmp(rank, "regular", true) == 0) { // PlayerInfo[id][pTag] = NTAG_GRAPHIC; PlayerInfo[id][pGraphic] = GRAPHICRANK_REGULAR; format(str, sizeof(str), "You have been given the status of a %s Designer.", rank); SendClientMessage(id, COLOR_AQUA, str); SendAdminMessage(COLOR_YELLOW, "{FF0000}AdmWarning{FFFFFF}: %s has been given the status of a %s Designer by %s", GetPlayerRPName(id), rank, GetPlayerRPName(playerid)); format(str, sizeof(str), "You gave %s the status of a %s Designer.", GetPlayerRPName(id), rank); SendClientMessage(playerid, COLOR_AQUA, str); } if(strcmp(rank, "editor", true) == 0) { // PlayerInfo[id][pTag] = NTAG_GRAPHIC; PlayerInfo[id][pGraphic] = GRAPHICRANK_SENIOR; format(str, sizeof(str), "You have been given the status of a %s Designer.", rank); SendClientMessage(id, COLOR_AQUA, str); SendAdminMessage(COLOR_YELLOW, "{FF0000}AdmWarning{FFFFFF}: %s has been given the status of a %s Designer by %s", GetPlayerRPName(id), rank, GetPlayerRPName(playerid)); format(str, sizeof(str), "You gave %s the status of a %s Designer.", GetPlayerRPName(id), rank); SendClientMessage(playerid, COLOR_AQUA, str); } if(strcmp(rank, "manager", true) == 0) { // PlayerInfo[id][pTag] = NTAG_MANAGERGRAPHIC; PlayerInfo[id][pGraphic] = GRAPHICRANK_MANAGER; format(str, sizeof(str), "You have been given the status of a %s Designer.", rank); SendClientMessage(id, COLOR_AQUA, str); SendAdminMessage(COLOR_YELLOW, "{FF0000}AdmWarning{FFFFFF}: %s has been given the status of a %s Designer by %s", GetPlayerRPName(id), rank, GetPlayerRPName(playerid)); format(str, sizeof(str), "You gave %s the status of a %s Designer.", GetPlayerRPName(id), rank); SendClientMessage(playerid, COLOR_AQUA, str); } } else return SendClientMessage(playerid, COLOR_GREY, "Invalid rank specified."); } return 1; } CMD:ap(playerid, params[]) { if(PlayerInfo[playerid][pAdminPersonnel] || PlayerInfo[playerid][pAdmin] >= 8) { new msg[128]; new str[128]; if(!sscanf(params, "s[128]", msg)) { format(str, sizeof(str), "** [AP]{FFFFFF} %s: %s **", GetPlayerRPName(playerid), msg); SendAPMessage(COLOR_AQUA, str); } else { SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /(a)dmin(p)ersonnel [message]"); } } else { SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this chat."); } return 1; } CMD:dga(playerid, params[]) { if(PlayerInfo[playerid][pGameAffairs] >= 1 || PlayerInfo[playerid][pAdmin] >= 7) { new msg[128]; new str[128]; if(!sscanf(params, "s[128]", msg)) { format(str, sizeof(str), "** [DGA]{FFFFFF} %s: %s **", GetPlayerRPName(playerid), msg); SendDGAMessage(COLOR_GLOBAL, str); } else { SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /dga [message]"); } } else { SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this chat."); } return 1; } CMD:wd(playerid, params[]) { if(PlayerInfo[playerid][pWebDev] >= 1 || PlayerInfo[playerid][pAdmin] >= 7) { new msg[128]; new str[128]; if(!sscanf(params, "s[128]", msg)) { format(str, sizeof(str), "** [DGA]{FFFFFF} %s: %s **", GetPlayerRPName(playerid), msg); SendWDMessage(COLOR_GLOBAL, str); } else { SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /dga [message]"); } } else { SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this chat."); } return 1; } CMD:fm(playerid, params[]) { if(PlayerInfo[playerid][pFactionMod] || PlayerInfo[playerid][pGameAffairs] || PlayerInfo[playerid][pAdmin] >= 7) { new msg[128]; new str[128]; if(!sscanf(params, "s[128]", msg)) { format(str, sizeof(str), "** [FM]{FFFFFF} %s: %s **", GetPlayerRPName(playerid), msg); SendFMMessage(COLOR_BLUE, str); } else { SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /(f)action(m)managment [message]"); } } else { SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this chat."); } return 1; } CMD:gm(playerid, params[]) { if(PlayerInfo[playerid][pGangMod] || PlayerInfo[playerid][pGameAffairs] || PlayerInfo[playerid][pAdmin] >= 7) { new msg[128]; new str[128]; if(!sscanf(params, "s[128]", msg)) { format(str, sizeof(str), "** [GM]{FFFFFF} %s: %s **", GetPlayerRPName(playerid), msg); SendGMMessage(COLOR_GREEN, str); } else { SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /(g)ang (m)managment [message]"); } } else { SendClientMessageEx(playerid, COLOR_GREY, "You are not authorized to use this chat."); } return 1; } /* CHAT FOR DIVISIONS CMD:ap(playerid, params[]) { if(PlayerInfo[playerid][pAdminPersonnel] || PlayerInfo[playerid][pAdmin] >= 8) { foreach(new i : Player) { if(PlayerInfo[i][pAdminPersonnel] || PlayerInfo[i][pAdmin] >= 8) { } } } return 1; } CMD:dga(playerid, params[]) { if(PlayerInfo[playerid][pGameAffairs] || PlayerInfo[playerid][pAdmin] >= 7) { } return 1; } CMD:fm(playerid, params[]) { if(PlayerInfo[playerid][pFactionMod] || PlayerInfo[playerid][pGameAffairs] || PlayerInfo[playerid][pAdmin] >= 7) { } return 1; } CMD:gm(playerid, params[]) { if(PlayerInfo[playerid][pGangMod] || PlayerInfo[playerid][pGameAffairs] || PlayerInfo[playerid][pAdmin] >= 7) { } return 1; } CMD:ba(playerid, params[]) { if(PlayerInfo[playerid][pBanAppealer] || PlayerInfo[playerid][pAdmin] >= 7) { } return 1; } CMD:pr(playerid, params[]) { if(PlayerInfo[playerid][pHelperManager] || PlayerInfo[playerid][pAdmin] >= 7) { } return 1; } CMD:da(playerid, params[]) { if(PlayerInfo[playerid][pDynamicAdmin] || PlayerInfo[playerid][pAdmin] >= 7) { } return 1; } CMD:dev(playerid, params[]) { if(PlayerInfo[playerid][pDeveloper] || PlayerInfo[playerid][pAdmin] >= 7) { } return 1; }*/ GetAdminDivision(playerid) { new division[4]; if(PlayerInfo[playerid][pAdminPersonnel]) { division = "AP"; } else if(PlayerInfo[playerid][pHumanResources]) { division = "HR"; } else if(PlayerInfo[playerid][pGameAffairs]) { division = "DGA"; } else if(PlayerInfo[playerid][pWebDev]) { division = "WD"; } else if(PlayerInfo[playerid][pFactionMod]) { division = "FM"; } else if(PlayerInfo[playerid][pGangMod]) { division = "GM"; } else if(PlayerInfo[playerid][pBanAppealer]) { division = "BA"; } else if(PlayerInfo[playerid][pComplaintMod]) { division = "CM"; } else if(PlayerInfo[playerid][pHelperManager]) { division = "PR"; } else if(PlayerInfo[playerid][pDynamicAdmin]) { division = "DA"; } else if(PlayerInfo[playerid][pDeveloper]) { division = "DEV"; } else { division = ""; } return division; } GetAdminDivisionFull(playerid) { new division[32]; if(PlayerInfo[playerid][pAdminPersonnel]) { division = "Admin Personnel"; } else if(PlayerInfo[playerid][pHumanResources]) { division = "Human Resources"; } else if(PlayerInfo[playerid][pGameAffairs]) { division = "Game Affairs"; } else if(PlayerInfo[playerid][pWebDev]) { division = "Web Developer"; } else if(PlayerInfo[playerid][pFactionMod]) { division = "Faction Moderator"; } else if(PlayerInfo[playerid][pGangMod]) { division = "Gang Moderator"; } else if(PlayerInfo[playerid][pBanAppealer]) { division = "Ban Appealer"; } else if(PlayerInfo[playerid][pComplaintMod]) { division = "Complaint Mod"; } else if(PlayerInfo[playerid][pHelperManager]) { division = "Public Relations"; } else if(PlayerInfo[playerid][pDynamicAdmin]) { division = "Refund Manager"; } else if(PlayerInfo[playerid][pDeveloper]) { division = "Developer"; } else { division = ""; } return division; } GetStaffRank(playerid) { new string[24]; if(PlayerInfo[playerid][pAdmin] > 1 && !PlayerInfo[playerid][pAdminHide]) { switch(PlayerInfo[playerid][pAdmin]) { case 2: string = "Junior Admin"; case 3: string = "General Admin"; case 4: string = "Senior Admin"; case 5: string = "Head Admin"; case 6: string = "General Manager"; case 7: string = "Assistant Management"; case 8: string = "Management"; case 9: string = "Owner"; } return string; } if(PlayerInfo[playerid][pHelper] > 0) { switch(PlayerInfo[playerid][pHelper]) { case 1: string = "Junior Helper"; case 2: string = "Senior Helper"; case 3: string = "Ast. Head Helper"; case 4: string = "Head Helper"; } } else if(PlayerInfo[playerid][pFormerAdmin]) { string = "Former Admin"; } else { string = "Undercover Admin"; } return string; } GetAdminRank(playerid) { new string[24]; switch(PlayerInfo[playerid][pAdmin]) { case 0: { if(PlayerInfo[playerid][pFormerAdmin]) string = "Former Admin"; else string = "None"; } case 1: string = "Secret Admin"; case 2: string = "Junior Admin"; case 3: string = "General Admin"; case 4: string = "Senior Admin"; case 5: string = "Head Admin"; case 6: string = "General Manager"; case 7: string = "Assistant Management"; case 8: string = "Management"; case 9: string = "Owner"; } return string; } GetAdminRank1(playerid) { new string[24]; switch(PlayerInfo[playerid][pAdmin]) { case 0: { if(PlayerInfo[playerid][pFormerAdmin]) string = "Former Admin"; else if(PlayerInfo[playerid][pDeveloper]) string = "Developer"; else string = "None"; } case 1: string = "Secret Admin"; case 2: string = "{00FF00}Junior Admin"; case 3: string = "{00AA00}General Admin"; case 4: string = "{FFA500}Senior Admin"; case 5: string = "{FF0000}Head Admin"; case 6: string = "{00c3ff}General Manager"; case 7: string = "{a30404}Ast. Management"; case 8: string = "{d400ff}Management"; case 9: string = "{2dfbf6}Owner"; } return string; } GetHelperRank(playerid) { new string[24]; switch(PlayerInfo[playerid][pHelper]) { case 0: string = "None"; case 1: string = "Junior Helper"; case 2: string = "Senior Helper"; case 3: string = "Ast Head Helper"; case 4: string = "Head Helper"; } return string; } GetPlayerIP(playerid) { new ip[16]; GetPlayerIp(playerid, ip, sizeof(ip)); return ip; } GetPlayerIPRange(playerid, ch = '*') { new string[16], part[2]; if(!sscanf(GetPlayerIP(playerid), "p<.>ii{ii}", part[0], part[1])) { format(string, sizeof(string), "%i.%i.%c.%c", part[0], part[1], ch, ch); } return string; } /*GetBoneName(boneid) { new string[16]; switch(boneid) { case 1: string = "Spine"; case 2: string = "Head"; case 3: string = "Left upper arm"; case 4: string = "Right upper arm"; case 5: string = "Left hand"; case 6: string = "Right hand"; case 7: string = "Left thigh"; case 8: string = "Right thigh"; case 9: string = "Left foot"; case 10: string = "Right foot"; case 11: string = "Right calf"; case 12: string = "Left calf"; case 13: string = "Left forearm"; case 14: string = "Right forearm"; case 15: string = "Left shoulder"; case 16: string = "Right shoulder"; case 17: string = "Neck"; case 18: string = "Jaw"; } return string; }*/ GetDeathReason(reason) { new string[24]; switch(reason) { case 0: string = "Fists"; case 18: string = "Molotov Cocktail"; case 44: string = "Nightvision Goggles"; case 45: string = "Infrared Goggles"; case 49: string = "Vehicle"; case 50: string = "Helicopter Blades"; case 51: string = "Explosion"; case 53: string = "Drowned"; case 54: string = "Splat"; default: GetWeaponName(reason, string, sizeof(string)); } return string; } GetWeaponNameEx(weaponid) { new weapon[24]; GetWeaponName(weaponid, weapon, sizeof(weapon)); switch(weaponid) { case 0: weapon = "None"; case 18: weapon = "Molotov Cocktail"; case 44: weapon = "Nightvision Goggles"; case 45: weapon = "Infrared Goggles"; } return weapon; } GetVIPRank(level) { new string[16]; switch(level) { case 0: string = "None"; case 1: string = "VIP 1"; case 2: string = "VIP 2"; case 3: string = "VIP 3"; } return string; } GetJobName(jobid) { new name[32]; if(jobid == JOB_NONE) name = "None"; else strcat(name, jobLocations[jobid][jobName]); return name; } IncreaseJobSkill(playerid, jobid) { if((gDoubleXP) || PlayerInfo[playerid][pDoubleXP] > 0) { GiveJobSkill(playerid, jobid); } GiveJobSkill(playerid, jobid); } GiveJobSkill(playerid, jobid) { new level = GetJobLevel(playerid, jobid); switch(jobid) { case JOB_COURIER: { PlayerInfo[playerid][pCourierSkill]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET courierskill = courierskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(GetJobLevel(playerid, jobid) != level) { SendClientMessageEx(playerid, COLOR_GREEN, "Your courier skill level is now %i/5. You will deliver more products and earn more money now.", level + 1); } } case JOB_FISHERMAN: { PlayerInfo[playerid][pFishingSkill]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fishingskill = fishingskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(GetJobLevel(playerid, jobid) != level) { SendClientMessageEx(playerid, COLOR_GREEN, "Your fishing skill level is now %i/5. You will catch bigger fish and your cooldowns are reduced.", level + 1); } } case JOB_BODYGUARD: { PlayerInfo[playerid][pGuardSkill]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET guardskill = guardskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(GetJobLevel(playerid, jobid) != level) { SendClientMessageEx(playerid, COLOR_GREEN, "Your bodyguard skill level is now %i/5. Vests that you sell will now contain extra armor.", level + 1); } } case JOB_WEAPONDEALER: { PlayerInfo[playerid][pWeaponSkill]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weaponskill = weaponskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(GetJobLevel(playerid, jobid) != level) { SendClientMessageEx(playerid, COLOR_GREEN, "Your weapons dealer skill level is now %i/5. You have unlocked more weapons.", level + 1); } } case JOB_MECHANIC: { PlayerInfo[playerid][pMechanicSkill]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET mechanicskill = mechanicskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(GetJobLevel(playerid, jobid) != level) { SendClientMessageEx(playerid, COLOR_GREEN, "Your mechanic skill level is now %i/5. You will now pay less for components.", level + 1); } } case JOB_DRUGDEALER: { PlayerInfo[playerid][pSmugglerSkill]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET smugglerskill = smugglerskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(GetJobLevel(playerid, jobid) != level) { SendClientMessageEx(playerid, COLOR_GREEN, "Your drug dealer skill level is now %i/5. You will now earn more cash for smuggling.", level + 1); } } case JOB_LAWYER: { PlayerInfo[playerid][pLawyerSkill]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET lawyerskill = lawyerskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(GetJobLevel(playerid, jobid) != level) { SendClientMessageEx(playerid, COLOR_GREEN, "Your lawyer skill level is now %i/5. Your cooldown times are reduced and you can free people for more time.", level + 1); } } case JOB_DETECTIVE: { PlayerInfo[playerid][pDetectiveSkill]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET detectiveskill = detectiveskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(GetJobLevel(playerid, jobid) != level) { SendClientMessageEx(playerid, COLOR_GREEN, "Your detective skill level is now %i/5. Your cooldown times are now reduced.", level + 1); } } case JOB_THIEF: { PlayerInfo[playerid][pThiefSkill]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET thiefskill = thiefskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(GetJobLevel(playerid, jobid) != level) { SendClientMessageEx(playerid, COLOR_GREEN, "Your thief skill level is now %i/5. Your cooldown times are now reduced and it takes less time to crack trunks.", level + 1); } } /*case JOB_FARMER: { PlayerInfo[playerid][pThiefSkill]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET thiefskill = thiefskill + 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(GetJobLevel(playerid, jobid) != level) { SendClientMessageEx(playerid, COLOR_GREEN, "Your thief skill level is now %i/5. Your cooldown times are now reduced and it takes less time to crack trunks.", level + 1); } }*/ } if(GetJobLevel(playerid, jobid) != level && GetJobLevel(playerid, jobid) == 5) { AwardAchievement(playerid, "Experienced"); } } GetJobLevel(playerid, jobid) { if(jobid == JOB_COURIER) { if(0 <= PlayerInfo[playerid][pCourierSkill] <= 49) { return 1; } else if(50 <= PlayerInfo[playerid][pCourierSkill] <= 99) { return 2; } else if(100 <= PlayerInfo[playerid][pCourierSkill] <= 199) { return 3; } else if(200 <= PlayerInfo[playerid][pCourierSkill] <= 349) { return 4; } else if(PlayerInfo[playerid][pCourierSkill] >= 350) { return 5; } } else if(jobid == JOB_FISHERMAN) { if(0 <= PlayerInfo[playerid][pFishingSkill] <= 49) { return 1; } else if(50 <= PlayerInfo[playerid][pFishingSkill] <= 99) { return 2; } else if(100 <= PlayerInfo[playerid][pFishingSkill] <= 199) { return 3; } else if(200 <= PlayerInfo[playerid][pFishingSkill] <= 349) { return 4; } else if(PlayerInfo[playerid][pFishingSkill] >= 350) { return 5; } } else if(jobid == JOB_BODYGUARD) { if(0 <= PlayerInfo[playerid][pGuardSkill] <= 24) { return 1; } else if(25 <= PlayerInfo[playerid][pGuardSkill] <= 49) { return 2; } else if(50 <= PlayerInfo[playerid][pGuardSkill] <= 99) { return 3; } else if(100 <= PlayerInfo[playerid][pGuardSkill] <= 199) { return 4; } else if(PlayerInfo[playerid][pGuardSkill] >= 200) { return 5; } } else if(jobid == JOB_WEAPONDEALER) { if(0 <= PlayerInfo[playerid][pWeaponSkill] <= 49) { return 1; } else if(50 <= PlayerInfo[playerid][pWeaponSkill] <= 99) { return 2; } else if(100 <= PlayerInfo[playerid][pWeaponSkill] <= 199) { return 3; } else if(200 <= PlayerInfo[playerid][pWeaponSkill] <= 499) { return 4; } else if(PlayerInfo[playerid][pWeaponSkill] >= 500) { return 5; } } else if(jobid == JOB_MECHANIC) { if(0 <= PlayerInfo[playerid][pMechanicSkill] <= 24) { return 1; } else if(25 <= PlayerInfo[playerid][pMechanicSkill] <= 49) { return 2; } else if(50 <= PlayerInfo[playerid][pMechanicSkill] <= 99) { return 3; } else if(100 <= PlayerInfo[playerid][pMechanicSkill] <= 199) { return 4; } else if(PlayerInfo[playerid][pMechanicSkill] >= 200) { return 5; } } else if(jobid == JOB_DRUGDEALER) { if(0 <= PlayerInfo[playerid][pSmugglerSkill] <= 99) { return 1; } else if(100 <= PlayerInfo[playerid][pSmugglerSkill] <= 199) { return 2; } else if(200 <= PlayerInfo[playerid][pSmugglerSkill] <= 299) { return 3; } else if(300 <= PlayerInfo[playerid][pSmugglerSkill] <= 399) { return 4; } else if(PlayerInfo[playerid][pSmugglerSkill] >= 500) { return 5; } } else if(jobid == JOB_LAWYER) { if(0 <= PlayerInfo[playerid][pLawyerSkill] <= 24) { return 1; } else if(25 <= PlayerInfo[playerid][pLawyerSkill] <= 49) { return 2; } else if(50 <= PlayerInfo[playerid][pLawyerSkill] <= 99) { return 3; } else if(100 <= PlayerInfo[playerid][pLawyerSkill] <= 199) { return 4; } else if(PlayerInfo[playerid][pLawyerSkill] >= 200) { return 5; } } else if(jobid == JOB_DETECTIVE) { if(0 <= PlayerInfo[playerid][pDetectiveSkill] <= 49) { return 1; } else if(50 <= PlayerInfo[playerid][pDetectiveSkill] <= 99) { return 2; } else if(100 <= PlayerInfo[playerid][pDetectiveSkill] <= 199) { return 3; } else if(200 <= PlayerInfo[playerid][pDetectiveSkill] <= 399) { return 4; } else if(PlayerInfo[playerid][pDetectiveSkill] >= 400) { return 5; } } else if(jobid == JOB_THIEF) { if(0 <= PlayerInfo[playerid][pThiefSkill] <= 49) { return 1; } else if(50 <= PlayerInfo[playerid][pThiefSkill] <= 99) { return 2; } else if(100 <= PlayerInfo[playerid][pThiefSkill] <= 199) { return 3; } else if(200 <= PlayerInfo[playerid][pThiefSkill] <= 499) { return 4; } else if(PlayerInfo[playerid][pThiefSkill] >= 500) { return 5; } } return 0; } GetPlayerCapacity(playerid, item) { switch(item) { case CAPACITY_MATERIALS: { return 50000 + (PlayerInfo[playerid][pInventoryUpgrade] * 10000); } case CAPACITY_WEED: { switch(PlayerInfo[playerid][pInventoryUpgrade]) { case 0: return 50; case 1: return 75; case 2: return 100; case 3: return 125; case 4: return 150; case 5: return 200; } } case CAPACITY_COCAINE: { switch(PlayerInfo[playerid][pInventoryUpgrade]) { case 0: return 25; case 1: return 50; case 2: return 75; case 3: return 100; case 4: return 125; case 5: return 150; } } case CAPACITY_METH: { switch(PlayerInfo[playerid][pInventoryUpgrade]) { case 0: return 20; case 1: return 40; case 2: return 60; case 3: return 80; case 4: return 100; case 5: return 150; } } case CAPACITY_PAINKILLERS: { switch(PlayerInfo[playerid][pInventoryUpgrade]) { case 0: return 5; case 1: return 10; case 2: return 15; case 3: return 20; case 4: return 25; case 5: return 30; } } case CAPACITY_SEEDS: { switch(PlayerInfo[playerid][pInventoryUpgrade]) { case 0: return 10; case 1: return 20; case 2: return 30; case 3: return 40; case 4: return 50; case 5: return 60; } } case CAPACITY_EPHEDRINE: { switch(PlayerInfo[playerid][pInventoryUpgrade]) { case 0: return 10; case 1: return 15; case 2: return 20; case 3: return 25; case 4: return 30; case 5: return 40; } } case CAPACITY_OIL: { switch(PlayerInfo[playerid][pInventoryUpgrade]) { case 0: return 25; case 1: return 50; case 2: return 75; case 3: return 100; case 4: return 150; case 5: return 200; } } } return 0; } GetPlayerAssetCount(playerid, type) { new count; switch(type) { case LIMIT_HOUSES: { foreach(new i : House) { if(HouseInfo[i][hExists] && PlayerInfo[playerid][pID] == HouseInfo[i][hOwnerID]) { count++; } } } case LIMIT_BUSINESSES: { foreach(new i : Business) { if(BusinessInfo[i][bExists] && PlayerInfo[playerid][pID] == BusinessInfo[i][bOwnerID]) { count++; } } } case LIMIT_GARAGES: { foreach(new i : Garage) { if(GarageInfo[i][gExists] && PlayerInfo[playerid][pID] == GarageInfo[i][gOwnerID]) { count++; } } } } return count; } GetPlayerAssetLimit(playerid, type) { switch(type) { case LIMIT_HOUSES: { switch(PlayerInfo[playerid][pVIPPackage]) { case 2: return 4; case 3: return 6; } switch(PlayerInfo[playerid][pAssetUpgrade]) { case 0, 1: return 1; case 2, 3: return 2; case 4: return 3; } } case LIMIT_BUSINESSES: { switch(PlayerInfo[playerid][pAssetUpgrade]) { case 0, 1: return 1; case 2, 3: return 2; case 4: return 3; } } case LIMIT_GARAGES: { switch(PlayerInfo[playerid][pAssetUpgrade]) { case 0, 1: return 1; case 2, 3: return 2; case 4: return 3; } } case LIMIT_VEHICLES: { switch(PlayerInfo[playerid][pVIPPackage]) { case 1: return 10; case 2: return 15; case 3: return 20; } switch(PlayerInfo[playerid][pAssetUpgrade]) { case 0: return 3; case 1: return 4; case 2: return 5; case 3: return 7; case 4: return 10; } } } return 0; } DeployObject(type, Float:x, Float:y, Float:z, Float:angle) { for(new i = 0; i < MAX_DEPLOYABLES; i ++) { if(!DeployInfo[i][dExists]) { DeployInfo[i][dExists] = 1; DeployInfo[i][dType] = type; DeployInfo[i][dPosX] = x; DeployInfo[i][dPosY] = y; DeployInfo[i][dPosZ] = z; DeployInfo[i][dPosA] = angle; if(type == DEPLOY_SPIKESTRIP) { DeployInfo[i][dObject] = CreateDynamicObject(2899, x + 1.0 * floatsin(-angle, degrees), y + 1.0 * floatcos(-angle, degrees), z - 0.9, 0.0, 0.0, angle + 90.0); } else if(type == DEPLOY_CONE) { DeployInfo[i][dObject] = CreateDynamicObject(1238, x + 1.0 * floatsin(-angle, degrees), y + 1.0 * floatcos(-angle, degrees), z - 0.7, 0.0, 0.0, angle); } else if(type == DEPLOY_ROADBLOCK) { DeployInfo[i][dObject] = CreateDynamicObject(981, x + 3.0 * floatsin(-angle, degrees), y + 3.0 * floatcos(-angle, degrees), z, 0.0, 0.0, angle); } else if(type == DEPLOY_BARREL) { DeployInfo[i][dObject] = CreateDynamicObject(1237, x + 1.0 * floatsin(-angle, degrees), y + 1.0 * floatcos(-angle, degrees), z - 1.0, 0.0, 0.0, angle); } else if(type == DEPLOY_FLARE) { DeployInfo[i][dObject] = CreateDynamicObject(18728, x, y, z - 1.4, 0.0, 0.0, angle); } return i; } } return -1; } IsAFarmerCar(carid) { for(new v = 0; v < sizeof(FarmerVehicles); v++) { if(carid == FarmerVehicles[v]) return 1; } if(VehicleInfo[carid][vJob] == JOB_FARMER) return 1; return 0; } IsFireActive() { for(new i = 0; i < MAX_FIRES; i ++) { if(IsValidDynamicObject(gFireObjects[i])) { return 1; } } return 0; } HandleContract(playerid, killerid) { if(GetFactionType(killerid) == FACTION_HITMAN && PlayerInfo[killerid][pContractTaken] == playerid) { new price = PlayerInfo[playerid][pContracted] / 2; SendClientMessageEx(killerid, COLOR_YELLOW, "You have completed your contract on %s and received %s.", GetPlayerRPName(playerid), FormatNumber(price)); SendClientMessageEx(playerid, COLOR_YELLOW, "You have been killed by a hitman and lost %s.", FormatNumber(price)); SendFactionMessage(PlayerInfo[killerid][pFaction], COLOR_YELLOW, "Contract: %s has successfully completed the contract on %s and gained %s.", GetPlayerRPName(killerid), GetPlayerRPName(playerid), FormatNumber(price)); GivePlayerCash(playerid, -price); GivePlayerCash(killerid, price); PlayerInfo[killerid][pContractTaken] = INVALID_PLAYER_ID; PlayerInfo[killerid][pCompletedHits]++; PlayerInfo[playerid][pContracted] = 0; PlayerInfo[playerid][pContractBy] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET contracted = 0, contractby = 'Nobody' WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET completedhits = %i WHERE uid = %i", PlayerInfo[killerid][pCompletedHits], PlayerInfo[killerid][pID]); mysql_tquery(connectionID, queryBuffer); foreach(new i : Player) { if(PlayerInfo[i][pContractTaken] == playerid) { PlayerInfo[i][pContractTaken] = INVALID_PLAYER_ID; } } Log_Write("log_contracts", "%s (uid: %i) successfully completed their hit on %s (uid: %i) for $%i.", GetPlayerRPName(killerid), PlayerInfo[killerid][pID], GetPlayerRPName(playerid), PlayerInfo[playerid][pID], price); } else if(PlayerInfo[playerid][pContractTaken] == killerid) { new price = PlayerInfo[killerid][pContracted]; SendClientMessageEx(playerid, COLOR_YELLOW, "You have failed your contract on %s and lost %s.", GetPlayerRPName(playerid), FormatNumber(price)); SendClientMessageEx(killerid, COLOR_YELLOW, "You have killed a hitman chasing after you and received %s. The contract on your head has been removed.", FormatNumber(price)); SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_YELLOW, "Contract: %s has failed the contract on %s and lost %s.", GetPlayerRPName(playerid), GetPlayerRPName(killerid), FormatNumber(price)); GivePlayerCash(playerid, -price); GivePlayerCash(killerid, price); PlayerInfo[playerid][pContractTaken] = INVALID_PLAYER_ID; PlayerInfo[playerid][pFailedHits]++; PlayerInfo[killerid][pContracted] = 0; PlayerInfo[killerid][pContractBy] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET contracted = 0, contractby = 'Nobody' WHERE uid = %i", PlayerInfo[killerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET failedhits = %i WHERE uid = %i", PlayerInfo[playerid][pFailedHits], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); foreach(new i : Player) { if(PlayerInfo[i][pContractTaken] == killerid) { PlayerInfo[i][pContractTaken] = INVALID_PLAYER_ID; } } Log_Write("log_contracts", "%s (uid: %i) failed their hit on %s (uid: %i) and lost $%i.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], GetPlayerRPName(killerid), PlayerInfo[killerid][pID], price); } } GetPlayerNameEx(playerid) { new name[24]; if(PlayerInfo[playerid][pMaskOn]) format(name, sizeof(name), "Stranger_%d", PlayerInfo[playerid][pMaskID]); else GetPlayerName(playerid, name, sizeof(name)); return name; } GetPlayerRPName(playerid) { new name[MAX_PLAYER_NAME]; GetPlayerName(playerid, name, sizeof(name)); for(new i = 0, l = strlen(name); i < l; i ++) { if(name[i] == '_') { name[i] = ' '; } } return name; } GetPlayerZoneName(playerid) { new zone[32], Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); if(GetInsideHouse(playerid) >= 0) zone = "House"; else if(GetInsideBusiness(playerid) >= 0) zone = "Business"; else if(GetInsideGarage(playerid) >= 0) zone = "Garage"; else if(GetPlayerInterior(playerid)) zone = "Interior"; else strcpy(zone, GetZoneName(x, y, z)); return zone; } GetPlayerPosEx(playerid, &Float:x, &Float:y, &Float:z) { new id; if(GetPlayerInterior(playerid)) { if((id = GetInsideHouse(playerid)) >= 0) { x = HouseInfo[id][hPosX]; y = HouseInfo[id][hPosY]; z = HouseInfo[id][hPosZ]; return 1; } else if((id = GetInsideBusiness(playerid)) >= 0) { x = BusinessInfo[id][bPosX]; y = BusinessInfo[id][bPosY]; z = BusinessInfo[id][bPosZ]; return 1; } else if((id = GetInsideGarage(playerid)) >= 0) { x = GarageInfo[id][gPosX]; y = GarageInfo[id][gPosY]; z = GarageInfo[id][gPosZ]; return 1; } else if((id = GetInsideEntrance(playerid)) >= 0) { x = EntranceInfo[id][ePosX]; y = EntranceInfo[id][ePosY]; z = EntranceInfo[id][ePosZ]; return 1; } else if(GetPlayerInterior(playerid)) { for(new i = 0; i < sizeof(staticEntrances); i ++) { if(IsPlayerInRangeOfPoint(playerid, 100.0, staticEntrances[i][eIntX], staticEntrances[i][eIntY], staticEntrances[i][eIntZ])) { x = staticEntrances[i][ePosX]; y = staticEntrances[i][ePosY]; z = staticEntrances[i][ePosZ]; return 1; } } } } GetPlayerPos(playerid, x, y, z); return 1; } GetVehicleCranePrice(vehicleid, bool:extras = true) { new amount; if((pizzaVehicles[0] <= vehicleid <= pizzaVehicles[5]) || (courierVehicles[0] <= vehicleid <= courierVehicles[3]) || (sweeperVehicles[0] <= vehicleid <= sweeperVehicles[3]) || (taxiVehicles[0] <= vehicleid <= taxiVehicles[3]) || (testVehicles[0] <= vehicleid <= testVehicles[4])) { return 0; } if((VehicleInfo[vehicleid][vID] > 0) && (VehicleInfo[vehicleid][vFactionType] > 0 || VehicleInfo[vehicleid][vGang] >= 0 && VehicleInfo[vehicleid][vJob] >= 0)) { return 0; } switch(GetVehicleModel(vehicleid)) { case 481, 509, 510: // Bicycles. amount = 400; case 448, 462, 463, 468, 471: // Mid bikes. amount = 750; case 461, 521, 522, 581: // High bikes. amount = 1000; case 402, 429, 475, 477, 494, 496, 502..504, 558..562, 565, 587, 589, 602, 603: // Muscle cars and mid sports cars. amount = 1500; case 411, 415, 451, 506, 541: // High sports cars. amount = 2000; case 403, 408, 414, 443, 455, 456, 498, 499, 514, 515, 524, 578, 609: // Boxed trucks and trucks. amount = 1750; case 413, 418, 422, 440, 459, 478, 482, 543, 552, 554, 582, 600, 605: // Pickup trucks and vans. amount = 1250; case 400, 424, 444, 470, 489, 495, 500, 505, 556, 557, 568, 573, 579: // Offroad vehicles amount = 1325; case 412, 534..536, 566, 567, 575, 576: // Lowriders amount = 1500; case 401, 404, 405, 410, 419, 421, 426, 436, 445, 458, 466, 467, 474, 479, 491, 492, 516..518, 526, 527, 529, 540, 542, 546, 547, 549..551, 580, 585, 604: // Saloon cars & station wagons. amount = 1000; } if((extras && amount > 0) && VehicleInfo[vehicleid][vOwnerID] > 0) { if(VehicleInfo[vehicleid][vNeon] != 0) amount += 300; // $300 extra for neon. if(VehicleInfo[vehicleid][vAlarm] != 0) amount += VehicleInfo[vehicleid][vAlarm] * 150; // Extra $150 per alarm level. if(VehicleInfo[vehicleid][vTrunk] != 0) amount += VehicleInfo[vehicleid][vTrunk] * 100; // Extra $100 per trunk level. if(strcmp(VehicleInfo[vehicleid][vPlate], "None") != 0) amount += 250; // Extra $250 for a custom plate. } return amount; } GetVehicleValue(vehicleid) { new price = VehicleInfo[vehicleid][vPrice]; switch(VehicleInfo[vehicleid][vAlarm]) { case 1: price += 15000; case 2: price += 30000; case 3: price += 60000; } if(VehicleInfo[vehicleid][vNeon]) { price += 30000; } if(VehicleInfo[vehicleid][vTrunk]) { price += VehicleInfo[vehicleid][vTrunk] * 10000; } if(strcmp(VehicleInfo[vehicleid][vPlate], "None", true) != 0) { price += 20000; } return price; } GetVehicleLinkedID(id) { foreach(new i: Vehicle) { if(VehicleInfo[i][vID] == id) { return i; } } return INVALID_VEHICLE_ID; } GetVehicleZoneName(vehicleid) { new zone[32], Float:x, Float:y, Float:z; GetVehiclePos(vehicleid, x, y, z); if(GetVehicleVirtualWorld(vehicleid)) zone = "Garage"; else strcpy(zone, GetZoneName(x, y, z)); return zone; } GetZoneName(Float:x, Float:y, Float:z) { new zone[32]; for(new i = 0; i < sizeof(zoneArray); i ++) { if((zoneArray[i][zoneMinX] <= x <= zoneArray[i][zoneMaxX]) && (zoneArray[i][zoneMinY] <= y <= zoneArray[i][zoneMaxY]) && (zoneArray[i][zoneMinZ] <= z <= zoneArray[i][zoneMaxZ])) { strcpy(zone, zoneArray[i][zoneName]); return zone; } } return zone; } PreviewClothing(playerid, index) { if(PlayerInfo[playerid][pCash] < clothingArray[index][clothingPrice]) { SendClientMessage(playerid, COLOR_GREY, "You can't purchase this. You don't have enough money for it."); } else { SetPlayerAttachedObject(playerid, 9, clothingArray[index][clothingModel], clothingArray[index][clothingBone]); PlayerInfo[playerid][pEditType] = EDIT_CLOTHING_PREVIEW; PlayerInfo[playerid][pSelected] = index; SendClientMessageEx(playerid, COLOR_AQUA, "You are now previewing {FF6347}%s{33CCFF}. This clothing item costs {00AA00}%s{33CCFF} to purchase.", clothingArray[index][clothingName], FormatNumber(clothingArray[index][clothingPrice])); SendClientMessageEx(playerid, COLOR_AQUA, "Use your cursor to control the editor interface. Click the floppy disk to save changes."); EditAttachedObject(playerid, 9); } } ShowClothingSelectionMenu(playerid) { new models[MAX_SELECTION_MENU_ITEMS] = {-1, ...}, index; PlayerInfo[playerid][pClothingIndex] = -1; for(new i = 0; i < sizeof(clothingArray); i ++) { if(!strcmp(clothingArray[i][clothingType], clothingTypes[PlayerInfo[playerid][pCategory]])) { if(PlayerInfo[playerid][pClothingIndex] == -1) { PlayerInfo[playerid][pClothingIndex] = i; } models[index++] = clothingArray[i][clothingModel]; } } ShowPlayerSelectionMenu(playerid, MODEL_SELECTION_CLOTHING, clothingTypes[PlayerInfo[playerid][pCategory]], models, index); } PurchaseLandObject(playerid, landid, index) { if(PlayerInfo[playerid][pCash] < furnitureArray[index][fPrice]) { SendClientMessage(playerid, COLOR_GREY, "You can't purchase this. You don't have enough money for it."); } else { new Float:x, Float:y, Float:z, Float:a; if(PlayerInfo[playerid][pEditType] == EDIT_LAND_OBJECT_PREVIEW && IsValidDynamicObject(PlayerInfo[playerid][pEditObject])) // Bug fix where if you did '/furniture buy' again while editing your object gets stuck. (12/28/2016) { DestroyDynamicObject(PlayerInfo[playerid][pEditObject]); PlayerInfo[playerid][pEditObject] = INVALID_OBJECT_ID; } GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); PlayerInfo[playerid][pEditType] = EDIT_LAND_OBJECT_PREVIEW; PlayerInfo[playerid][pEditObject] = CreateDynamicObject(furnitureArray[index][fModel], x + 2.0 * floatsin(-a, degrees), y + 2.0 * floatcos(-a, degrees), z + 1.0, 0.0, 0.0, ((19353 <= furnitureArray[index][fModel] <= 19417) || (19426 <= furnitureArray[index][fModel] <= 19465)) ? (a + 90.0) : (a), GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); PlayerInfo[playerid][pObjectLand] = landid; PlayerInfo[playerid][pSelected] = index; SendClientMessageEx(playerid, COLOR_AQUA, "You are now previewing {FF6347}%s{33CCFF}. This object costs {00AA00}%s{33CCFF} to purchase.", furnitureArray[index][fName], FormatNumber(furnitureArray[index][fPrice])); SendClientMessageEx(playerid, COLOR_AQUA, "Use your cursor to control the editor interface. Click the floppy disk to save changes."); EditDynamicObject(playerid, PlayerInfo[playerid][pEditObject]); } } ShowObjectSelectionMenu(playerid, type) { new models[MAX_SELECTION_MENU_ITEMS] = {-1, ...}, index; PlayerInfo[playerid][pFurnitureIndex] = -1; for(new i = 0; i < sizeof(furnitureArray); i ++) { if(!strcmp(furnitureArray[i][fCategory], furnitureCategories[PlayerInfo[playerid][pCategory]])) { if(PlayerInfo[playerid][pFurnitureIndex] == -1) { PlayerInfo[playerid][pFurnitureIndex] = i; } models[index++] = furnitureArray[i][fModel]; } } ShowPlayerSelectionMenu(playerid, type, furnitureCategories[PlayerInfo[playerid][pCategory]], models, index); } PurchaseFurniture(playerid, index) { if(PlayerInfo[playerid][pCash] < furnitureArray[index][fPrice]) { SendClientMessage(playerid, COLOR_GREY, "You can't purchase this. You don't have enough money for it."); } else { new Float:x, Float:y, Float:z, Float:a; if(PlayerInfo[playerid][pEditType] == EDIT_FURNITURE_PREVIEW && IsValidDynamicObject(PlayerInfo[playerid][pEditObject])) // Bug fix where if you did '/furniture buy' again while editing your object gets stuck. (12/28/2016) { DestroyDynamicObject(PlayerInfo[playerid][pEditObject]); PlayerInfo[playerid][pEditObject] = INVALID_OBJECT_ID; } GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); PlayerInfo[playerid][pEditType] = EDIT_FURNITURE_PREVIEW; PlayerInfo[playerid][pEditObject] = CreateDynamicObject(furnitureArray[index][fModel], x + 2.0 * floatsin(-a, degrees), y + 2.0 * floatcos(-a, degrees), z + 1.0, 0.0, 0.0, ((19353 <= furnitureArray[index][fModel] <= 19417) || (19426 <= furnitureArray[index][fModel] <= 19465)) ? (a + 90.0) : (a), GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); PlayerInfo[playerid][pSelected] = index; SendClientMessageEx(playerid, COLOR_AQUA, "You are now previewing {FF6347}%s{33CCFF}. This furniture item costs {00AA00}%s{33CCFF} to purchase.", furnitureArray[index][fName], FormatNumber(furnitureArray[index][fPrice])); SendClientMessageEx(playerid, COLOR_AQUA, "Use your cursor to control the editor interface. Click the floppy disk to save changes."); EditDynamicObject(playerid, PlayerInfo[playerid][pEditObject]); } } ClearChat(playerid) { for(new i = 0; i < 30; i ++) { SendClientMessage(playerid, -1, " "); } } Float:Streamer_GetExtraFloat(objectid, type) { new string[24]; getproperty(.id = objectid, .value = type, .string = string); strunpack(string, string); return floatstr(string); } Streamer_SetExtraFloat(objectid, type, Float:value) { new string[24]; format(string, sizeof(string), "%f", value); setproperty(.id = objectid, .value = type, .string = string); return 1; } Streamer_GetExtraInt(objectid, type) { new extra[11]; if(Streamer_GetArrayData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_EXTRA_ID, extra, sizeof(extra))) { return extra[type]; } return 0; } Streamer_SetExtraInt(objectid, type, value) { new extra[11]; if(Streamer_GetArrayData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_EXTRA_ID, extra, sizeof(extra))) { extra[type] = value; return Streamer_SetArrayData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_EXTRA_ID, extra, sizeof(extra)); } return 0; } SetDoubleXP(enable) { new hostname[128]; GetServerVarAsString("hostname", hostname, sizeof(hostname)); if(enable) { if(strfind(hostname, "") == -1) { format(hostname, sizeof(hostname), "hostname %s ", hostname); SendRconCommand(hostname); } } else { new pos = strfind(hostname, ""); if(pos != -1) { hostname[pos] = 0; format(hostname, sizeof(hostname), "hostname %s", hostname); SendRconCommand(hostname); } } gDoubleXP = enable; } CreateObjectEx(modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, Float:drawdistance = 0.0) { new objectid = CreateObject(modelid, x, y, z, rx, ry, rz, drawdistance); if(objectid != INVALID_OBJECT_ID) { gScriptObject{objectid} = 1; } return objectid; } GetStaticEntranceWorld(name[]) { for(new i = 0; i < sizeof(staticEntrances); i ++) { if(!strcmp(staticEntrances[i][eName], name)) { return staticEntrances[i][eWorld]; } } return 0; } Float:DistanceCameraTargetToLocation(Float:cx, Float:cy, Float:cz, Float:ox, Float:oy, Float:oz, Float:vx, Float:vy, Float:vz) { new Float:x, Float:y, Float:z, Float:distance; distance = floatround(floatsqroot(((cx - ox) * (cx - ox)) + ((cy - oy) * (cy - oy)) + ((cz - oz) * (cz - oz)))); x = vx * distance + cx; y = vy * distance + cy; z = vz * distance + cz; return floatsqroot((x - ox) * (x - ox) + (y - oy) * (y - oy) + (z - oz) * (z - oz)); } GateCheck(playerid) { new id; if(IsPlayerInRangeOfPoint(playerid, 10.0, -215.35271, 1008.38037, 19.44760)) // PD barrier { if(GetFactionType(playerid) != FACTION_POLICE && GetFactionType(playerid) != FACTION_FEDERAL) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to open this gate."); } if(!Streamer_GetExtraInt(gPDGates[0], E_OBJECT_OPENED)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to open the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gPDGates[0], -215.35271, 1008.38037, 19.44760,0.2, 0.00000, 0.00000, 0.00000); Streamer_SetExtraInt(gPDGates[0], E_OBJECT_OPENED, 1); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to close the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gPDGates[0], -215.35271, 1008.38037, 19.44760,0.2, 0.00000, -90.00000, 0.00000); Streamer_SetExtraInt(gPDGates[0], E_OBJECT_OPENED, 0); } return 1; } else if(IsPlayerInRangeOfPoint(playerid, 10.0, -87.38560, 1088.34741, 19.38790)) // HIK gate { if(GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to open this gate."); } if(!Streamer_GetExtraInt(gHIKGates[0], E_OBJECT_OPENED)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to open the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gHIKGates[0], -87.38560, 1088.34741, 19.38790,0.2, 0.00000, 0.00000, 180.00000); Streamer_SetExtraInt(gHIKGates[0], E_OBJECT_OPENED, 1); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to close the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gHIKGates[0], -87.38560, 1088.34741, 19.38790,0.2, 0.00000, -90.00000, 180.00000); Streamer_SetExtraInt(gHIKGates[0], E_OBJECT_OPENED, 0); } return 1; } else if(IsPlayerInRangeOfPoint(playerid, 10.0, 135.11079, 1941.44495, 21.60590)) // PD garage gate { if(GetFactionType(playerid) != FACTION_POLICE && GetFactionType(playerid) != FACTION_FEDERAL) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to open this gate."); } if(!Streamer_GetExtraInt(gPDGates[1], E_OBJECT_OPENED)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to open the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gPDGates[1], 121.43080, 1941.44495, 21.60590, 3.0); Streamer_SetExtraInt(gPDGates[1], E_OBJECT_OPENED, 1); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to close the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gPDGates[1], 135.11079, 1941.44495, 21.60590, 3.0); Streamer_SetExtraInt(gPDGates[1], E_OBJECT_OPENED, 0); } return 1; } else if(IsPlayerInRangeOfPoint(playerid, 10.0, 221.09976, 1875.75842, 13.14620)) // Prison gate { if(GetFactionType(playerid) != FACTION_POLICE) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to open this gate."); } if(!Streamer_GetExtraInt(gPDGates[2], E_OBJECT_OPENED)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to open the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gPDGates[2], 229.09979, 1875.75842, 13.14620, 3.0); Streamer_SetExtraInt(gPDGates[2], E_OBJECT_OPENED, 1); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to close the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gPDGates[2], 220.93980, 1875.75842, 13.14620, 3.0); Streamer_SetExtraInt(gPDGates[2], E_OBJECT_OPENED, 0); } return 1; } else if(IsPlayerInRangeOfPoint(playerid, 10.0, 321.255279, -1488.601318, 25.281988)) // FBI garage gate { if(GetFactionType(playerid) != FACTION_FEDERAL) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to open this gate."); } if(!Streamer_GetExtraInt(gFBIGates[0], E_OBJECT_OPENED)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to open the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gFBIGates[0], 327.033508, -1492.691650, 25.281988, 3.0); Streamer_SetExtraInt(gFBIGates[0], E_OBJECT_OPENED, 1); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to close the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gFBIGates[0], 321.255279, -1488.601318, 25.281988, 3.0); Streamer_SetExtraInt(gFBIGates[0], E_OBJECT_OPENED, 0); } return 1; } else if(IsPlayerInRangeOfPoint(playerid, 10.0, 283.590423, -1542.835083, 25.281988)) // FBI garage gate { if(GetFactionType(playerid) != FACTION_FEDERAL) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to open this gate."); } if(!Streamer_GetExtraInt(gFBIGates[1], E_OBJECT_OPENED)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to open the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gFBIGates[1], 289.593841, -1547.023071, 25.281988, 3.0); Streamer_SetExtraInt(gFBIGates[1], E_OBJECT_OPENED, 1); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to close the gate.", GetPlayerRPName(playerid)); MoveDynamicObject(gFBIGates[1], 283.590423, -1542.835083, 25.281988, 3.0); Streamer_SetExtraInt(gFBIGates[1], E_OBJECT_OPENED, 0); } return 1; } if((id = GetNearbyLand(playerid)) >= 0 && (IsLandOwner(playerid, id) || PlayerInfo[playerid][pLandPerms] == id)) { for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && IsGateObject(i) && IsPlayerInRangeOfPoint(playerid, 10.0, Streamer_GetExtraFloat(i, E_OBJECT_X), Streamer_GetExtraFloat(i, E_OBJECT_Y), Streamer_GetExtraFloat(i, E_OBJECT_Z)) && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_LAND && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == LandInfo[id][lID]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM landobjects WHERE id = %i", Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnPlayerUseLandGate", "ii", playerid, i); return 1; } } } return 0; } DoorCheck(playerid) { new Float:angle, houseid = GetInsideHouse(playerid), landid = GetNearbyLand(playerid); for(new i = 0; i < sizeof(gPDDoors); i ++) { if(IsPlayerInRangeOfDynamicObject(playerid, gPDDoors[i], 3.0)) { if(GetFactionType(playerid) != FACTION_POLICE && GetFactionType(playerid) != FACTION_FEDERAL) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to open this door."); } Streamer_GetFloatData(STREAMER_TYPE_OBJECT, gPDDoors[i], E_STREAMER_R_Z, angle); if(!Streamer_GetExtraInt(gPDDoors[i], E_OBJECT_OPENED)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their card to open the door.", GetPlayerRPName(playerid)); SetDynamicObjectRot(gPDDoors[i], 0.0000, 0.0000, angle + 90.0); Streamer_SetExtraInt(gPDDoors[i], E_OBJECT_OPENED, 1); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their card to close the door.", GetPlayerRPName(playerid)); SetDynamicObjectRot(gPDDoors[i], 0.0000, 0.0000, angle - 90.0); Streamer_SetExtraInt(gPDDoors[i], E_OBJECT_OPENED, 0); } return 1; } } for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && IsPlayerInRangeOfDynamicObject(playerid, i, 2.5) && IsDoorObject(i)) { if(houseid >= 0 && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_FURNITURE && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == HouseInfo[houseid][hID]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT door_opened, door_locked FROM furniture WHERE id = %i", Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnPlayerUseFurnitureDoor", "iii", playerid, i, Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); return 1; } else if(landid >= 0 && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_LAND && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == LandInfo[landid][lID]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT door_opened, door_locked FROM landobjects WHERE id = %i", Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnPlayerUseLandDoor", "iii", playerid, i, Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); return 1; } } } for(new i = 0; i < sizeof(gHIKDoors); i ++) { if(IsPlayerInRangeOfDynamicObject(playerid, gHIKDoors[i], 3.0)) { if(GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to open this door."); } Streamer_GetFloatData(STREAMER_TYPE_OBJECT, gHIKDoors[i], E_STREAMER_R_Z, angle); if(!Streamer_GetExtraInt(gHIKDoors[i], E_OBJECT_OPENED)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their card to open the door.", GetPlayerRPName(playerid)); SetDynamicObjectRot(gHIKDoors[i], 0.0000, 0.0000, angle + 90.0); Streamer_SetExtraInt(gHIKDoors[i], E_OBJECT_OPENED, 1); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their card to close the door.", GetPlayerRPName(playerid)); SetDynamicObjectRot(gHIKDoors[i], 0.0000, 0.0000, angle - 90.0); Streamer_SetExtraInt(gHIKDoors[i], E_OBJECT_OPENED, 0); } return 1; } } return 0; } EnterCheck(playerid) { new id, string[40]; if((gettime() - PlayerInfo[playerid][pLastEnter]) < 3 && PlayerInfo[playerid][pAdminDuty] == 0) { return SendClientMessage(playerid, COLOR_GREY, "Please wait a moment before entering or exiting again."); } if((id = GetNearbyHouse(playerid)) >= 0) { if(HouseInfo[id][hLocked]) { GameTextForPlayer(playerid, "~r~Locked", 5000, 1); return 0; } if(IsHouseOwner(playerid, id)) { HouseInfo[id][hTimestamp] = gettime(); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET timestamp = %i WHERE id = %i", gettime(), HouseInfo[id][hID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has entered their house.", GetPlayerRPName(playerid)); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has entered the house.", GetPlayerRPName(playerid)); } PlayerInfo[playerid][pLastEnter] = gettime(); SetPlayerPos(playerid, HouseInfo[id][hIntX], HouseInfo[id][hIntY], HouseInfo[id][hIntZ]); SetPlayerFacingAngle(playerid, HouseInfo[id][hIntA]); SetPlayerInterior(playerid, HouseInfo[id][hInterior]); SetPlayerVirtualWorld(playerid, HouseInfo[id][hWorld]); SetCameraBehindPlayer(playerid); if(HouseInfo[id][hLights] == 1) { TextDrawHideForPlayer(playerid, houseLights); } else { TextDrawShowForPlayer(playerid, houseLights); } return 1; } else if((id = GetNearbyGarage(playerid)) >= 0) { if(GarageInfo[id][gLocked]) { GameTextForPlayer(playerid, "~r~Locked", 5000, 1); return 0; } if(IsGarageOwner(playerid, id)) { GarageInfo[id][gTimestamp] = gettime(); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET timestamp = %i WHERE id = %i", gettime(), GarageInfo[id][gID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has entered their garage.", GetPlayerRPName(playerid)); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has entered the garage.", GetPlayerRPName(playerid)); } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { TeleportToCoords(playerid, garageInteriors[GarageInfo[id][gType]][intVX], garageInteriors[GarageInfo[id][gType]][intVY], garageInteriors[GarageInfo[id][gType]][intVZ], garageInteriors[GarageInfo[id][gType]][intVA], garageInteriors[GarageInfo[id][gType]][intID], GarageInfo[id][gWorld]); } else { PlayerInfo[playerid][pLastEnter] = gettime(); SetPlayerPos(playerid, garageInteriors[GarageInfo[id][gType]][intPX], garageInteriors[GarageInfo[id][gType]][intPY], garageInteriors[GarageInfo[id][gType]][intPZ]); SetPlayerFacingAngle(playerid, garageInteriors[GarageInfo[id][gType]][intPA]); SetPlayerInterior(playerid, garageInteriors[GarageInfo[id][gType]][intID]); SetPlayerVirtualWorld(playerid, GarageInfo[id][gWorld]); SetCameraBehindPlayer(playerid); } return 1; } else if((id = GetNearbyBusiness(playerid)) >= 0) { if(BusinessInfo[id][bLocked]) { GameTextForPlayer(playerid, "~r~Closed", 5000, 1); return 0; } if(IsBusinessOwner(playerid, id)) { BusinessInfo[id][bTimestamp] = gettime(); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET timestamp = %i WHERE id = %i", gettime(), BusinessInfo[id][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has entered their business.", GetPlayerRPName(playerid)); } else { if(BusinessInfo[id][bEntryFee] > 0) { if(PlayerInfo[playerid][pCash] < BusinessInfo[id][bEntryFee]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to pay the entry fee. You may not enter."); } format(string, sizeof(string), "~r~-$%i", BusinessInfo[id][bEntryFee]); GameTextForPlayer(playerid, string, 5000, 1); BusinessInfo[id][bCash] += BusinessInfo[id][bEntryFee]; GivePlayerCash(playerid, -BusinessInfo[id][bEntryFee]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i WHERE id = %i", BusinessInfo[id][bCash], BusinessInfo[id][bID]); mysql_tquery(connectionID, queryBuffer); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has entered the business.", GetPlayerRPName(playerid)); switch(BusinessInfo[id][bType]) { case BUSINESS_STORE, BUSINESS_Ammunation, BUSINESS_CLOTHES, BUSINESS_RESTAURANT, BUSINESS_BARCLUB: SendClientMessageEx(playerid, COLOR_GREEN, "Welcome to %s's %s [%i products]. /buy to purchase from this business.", BusinessInfo[id][bOwner], bizInteriors[BusinessInfo[id][bType]][intType], BusinessInfo[id][bProducts]); case BUSINESS_GYM: SendClientMessageEx(playerid, COLOR_GREEN, "Welcome to %s's %s. /buy to purchase a fighting style.", BusinessInfo[id][bOwner], bizInteriors[BusinessInfo[id][bType]][intType]); case BUSINESS_AGENCY: SendClientMessageEx(playerid, COLOR_GREEN, "Welcome to %s's %s. /(ad)vertise to make an advertisement.", BusinessInfo[id][bOwner], bizInteriors[BusinessInfo[id][bType]][intType]); } } PlayerInfo[playerid][pLastEnter] = gettime(); SetPlayerPos(playerid, BusinessInfo[id][bIntX], BusinessInfo[id][bIntY], BusinessInfo[id][bIntZ]); SetPlayerFacingAngle(playerid, BusinessInfo[id][bIntA]); SetPlayerInterior(playerid, BusinessInfo[id][bInterior]); SetPlayerVirtualWorld(playerid, BusinessInfo[id][bWorld]); SetCameraBehindPlayer(playerid); return 1; } else if((id = GetNearbyEntrance(playerid)) >= 0) { if(EntranceInfo[id][eLocked]) { GameTextForPlayer(playerid, "~r~Locked", 5000, 1); return 0; } if(EntranceInfo[id][eIntX] == 0.0 && EntranceInfo[id][eIntY] == 0.0 && EntranceInfo[id][eIntZ] == 0.0) { SendClientMessage(playerid, COLOR_GREY, "This entrance has no interior and therefore cannot be entered."); return 0; } if(EntranceInfo[id][eType] == 2) { SendClientMessage(playerid, COLOR_GREY, "You cannot enter this type of entrance!"); return 0; } if(!PlayerInfo[playerid][pAdminDuty]) { if(EntranceInfo[id][eAdminLevel] && PlayerInfo[playerid][pAdmin] < EntranceInfo[id][eAdminLevel]) { SendClientMessage(playerid, COLOR_GREY, "Your administrator level is too low. You may not enter."); return 0; } if(EntranceInfo[id][eFactionType] > 0 && GetFactionType(playerid) != EntranceInfo[id][eFactionType]) { SendClientMessage(playerid, COLOR_GREY, "This entrance is only accesible to a specific faction type. You may not enter."); return 0; } if(EntranceInfo[id][eGang] >= 0 && EntranceInfo[id][eGang] != PlayerInfo[playerid][pGang]) { SendClientMessage(playerid, COLOR_GREY, "This entrance is only accesible to a specific gang. You may not enter."); return 0; } if(EntranceInfo[id][eVIP] && PlayerInfo[playerid][pVIPPackage] < EntranceInfo[id][eVIP]) { SendClientMessage(playerid, COLOR_GREY, "Your VIP rank is too low. You may not enter."); return 0; } } PlayerInfo[playerid][pLastEnter] = gettime(); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has entered the building.", GetPlayerRPName(playerid)); /*if(EntranceInfo[id][eType] == 1) { SendClientMessage(playerid, COLOR_WHITE, "This entrance can be used for OOC duels. Use /offerduel to initiate one!"); }*/ if(EntranceInfo[id][eType] == 2) { SendClientMessage(playerid, COLOR_WHITE, "This entrance can be used to repair vehicles, use /repaircar."); } if(EntranceInfo[id][eVehicles] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(EntranceInfo[id][eFreeze]) { TeleportToCoords(playerid, EntranceInfo[id][eIntX], EntranceInfo[id][eIntY], EntranceInfo[id][eIntZ], EntranceInfo[id][eIntA], EntranceInfo[id][eInterior], EntranceInfo[id][eWorld], true); } else { TeleportToCoords(playerid, EntranceInfo[id][eIntX], EntranceInfo[id][eIntY], EntranceInfo[id][eIntZ], EntranceInfo[id][eIntA], EntranceInfo[id][eInterior], EntranceInfo[id][eWorld]); } } else { if(EntranceInfo[id][eFreeze]) { SetFreezePos(playerid, EntranceInfo[id][eIntX], EntranceInfo[id][eIntY], EntranceInfo[id][eIntZ]); } else { SetPlayerPos(playerid, EntranceInfo[id][eIntX], EntranceInfo[id][eIntY], EntranceInfo[id][eIntZ]); } SetPlayerFacingAngle(playerid, EntranceInfo[id][eIntA]); SetPlayerInterior(playerid, EntranceInfo[id][eInterior]); SetPlayerVirtualWorld(playerid, EntranceInfo[id][eWorld]); SetCameraBehindPlayer(playerid); } if(!EntranceInfo[id][eFreeze]) { format(string, sizeof(string), "~w~%s", EntranceInfo[id][eName]); GameTextForPlayer(playerid, string, 5000, 1); } return 1; } else { for(new i = 0; i < sizeof(staticEntrances); i ++) { if(IsPlayerInRangeOfPoint(playerid, 3.0, staticEntrances[i][ePosX], staticEntrances[i][ePosY], staticEntrances[i][ePosZ])) { if(!strcmp(staticEntrances[i][eName], "VIP Casino") && PlayerInfo[playerid][pVIPPackage] == 0) { SendClientMessage(playerid, COLOR_GREY, "You are not VIP"); return 0; } if(staticEntrances[i][eFreeze]) { SetFreezePos(playerid, staticEntrances[i][eIntX], staticEntrances[i][eIntY], staticEntrances[i][eIntZ]); } else { SetPlayerPos(playerid, staticEntrances[i][eIntX], staticEntrances[i][eIntY], staticEntrances[i][eIntZ]); format(string, sizeof(string), "~w~%s", staticEntrances[i][eName]); GameTextForPlayer(playerid, string, 5000, 1); } PlayerInfo[playerid][pLastEnter] = gettime(); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has entered the building.", GetPlayerRPName(playerid)); SetPlayerFacingAngle(playerid, staticEntrances[i][eIntA]); SetPlayerInterior(playerid, staticEntrances[i][eInterior]); SetPlayerVirtualWorld(playerid, staticEntrances[i][eWorld]); SetCameraBehindPlayer(playerid); return 1; } } } return 0; } ExitCheck(playerid) { new id; if((gettime() - PlayerInfo[playerid][pLastEnter]) < 3 && PlayerInfo[playerid][pAdminDuty] == 0) { return SendClientMessage(playerid, COLOR_GREY, "Please wait a moment before entering or exiting again."); } if((id = GetInsideHouse(playerid)) >= 0 && IsPlayerInRangeOfPoint(playerid, 3.0, HouseInfo[id][hIntX], HouseInfo[id][hIntY], HouseInfo[id][hIntZ])) { PlayerInfo[playerid][pLastEnter] = gettime(); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has exited the house.", GetPlayerRPName(playerid)); SetPlayerPos(playerid, HouseInfo[id][hPosX], HouseInfo[id][hPosY], HouseInfo[id][hPosZ]); SetPlayerFacingAngle(playerid, HouseInfo[id][hPosA]); SetPlayerInterior(playerid, HouseInfo[id][hOutsideInt]); SetPlayerVirtualWorld(playerid, HouseInfo[id][hOutsideVW]); SetCameraBehindPlayer(playerid); TextDrawHideForPlayer(playerid, houseLights); return 1; } else if((id = GetInsideGarage(playerid)) >= 0) { if( (GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsPlayerInRangeOfPoint(playerid, 6.0, garageInteriors[GarageInfo[id][gType]][intVX], garageInteriors[GarageInfo[id][gType]][intVY], garageInteriors[GarageInfo[id][gType]][intVZ])) || ((GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) && (IsPlayerInRangeOfPoint(playerid, 2.0, garageInteriors[GarageInfo[id][gType]][intPX], garageInteriors[GarageInfo[id][gType]][intPY], garageInteriors[GarageInfo[id][gType]][intPZ]) || IsPlayerInRangeOfPoint(playerid, 4.0, garageInteriors[GarageInfo[id][gType]][intVX], garageInteriors[GarageInfo[id][gType]][intVY], garageInteriors[GarageInfo[id][gType]][intVZ])))) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has exited the garage.", GetPlayerRPName(playerid)); if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { TeleportToCoords(playerid, GarageInfo[id][gExitX], GarageInfo[id][gExitY], GarageInfo[id][gExitZ], GarageInfo[id][gExitA], 0, 0); } else { SetPlayerPos(playerid, GarageInfo[id][gPosX], GarageInfo[id][gPosY], GarageInfo[id][gPosZ]); SetPlayerFacingAngle(playerid, GarageInfo[id][gPosA]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetCameraBehindPlayer(playerid); } } PlayerInfo[playerid][pLastEnter] = gettime(); return 1; } else if((id = GetInsideBusiness(playerid)) >= 0 && IsPlayerInRangeOfPoint(playerid, 3.0, BusinessInfo[id][bIntX], BusinessInfo[id][bIntY], BusinessInfo[id][bIntZ])) { PlayerInfo[playerid][pLastEnter] = gettime(); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has exited the business.", GetPlayerRPName(playerid)); SetPlayerPos(playerid, BusinessInfo[id][bPosX], BusinessInfo[id][bPosY], BusinessInfo[id][bPosZ]); SetPlayerFacingAngle(playerid, BusinessInfo[id][bPosA]); SetPlayerInterior(playerid, BusinessInfo[id][bOutsideInt]); SetPlayerVirtualWorld(playerid, BusinessInfo[id][bOutsideVW]); SetCameraBehindPlayer(playerid); return 1; } else if((id = GetInsideEntrance(playerid)) >= 0 && IsPlayerInRangeOfPoint(playerid, (IsPlayerInAnyVehicle(playerid)) ? (7.0) : (3.0), EntranceInfo[id][eIntX], EntranceInfo[id][eIntY], EntranceInfo[id][eIntZ])) { if(EntranceInfo[id][eType] == 1) { SetPlayerWeapons(playerid); } PlayerInfo[playerid][pLastEnter] = gettime(); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has exited the building.", GetPlayerRPName(playerid)); if(EntranceInfo[id][eVehicles] && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { if(EntranceInfo[id][eFreeze]) { TeleportToCoords(playerid, EntranceInfo[id][ePosX], EntranceInfo[id][ePosY], EntranceInfo[id][ePosZ], EntranceInfo[id][ePosA], EntranceInfo[id][eOutsideInt], EntranceInfo[id][eOutsideVW], true); } else { TeleportToCoords(playerid, EntranceInfo[id][ePosX], EntranceInfo[id][ePosY], EntranceInfo[id][ePosZ], EntranceInfo[id][ePosA], EntranceInfo[id][eOutsideInt], EntranceInfo[id][eOutsideVW]); } } else { if(EntranceInfo[id][eFreeze]) { SetFreezePos(playerid, EntranceInfo[id][ePosX], EntranceInfo[id][ePosY], EntranceInfo[id][ePosZ]); } else { SetPlayerPos(playerid, EntranceInfo[id][ePosX], EntranceInfo[id][ePosY], EntranceInfo[id][ePosZ]); } SetPlayerFacingAngle(playerid, EntranceInfo[id][ePosA]); SetPlayerInterior(playerid, EntranceInfo[id][eOutsideInt]); SetPlayerVirtualWorld(playerid, EntranceInfo[id][eOutsideVW]); SetCameraBehindPlayer(playerid); } return 1; } else { for(new i = 0; i < sizeof(staticEntrances); i ++) { if(IsPlayerInRangeOfPoint(playerid, 3.0, staticEntrances[i][eIntX], staticEntrances[i][eIntY], staticEntrances[i][eIntZ]) && GetPlayerVirtualWorld(playerid) == staticEntrances[i][eWorld]) { if(staticEntrances[i][eFreeze]) { SetFreezePos(playerid, staticEntrances[i][ePosX], staticEntrances[i][ePosY], staticEntrances[i][ePosZ]); } else { SetPlayerPos(playerid, staticEntrances[i][ePosX], staticEntrances[i][ePosY], staticEntrances[i][ePosZ]); } PlayerInfo[playerid][pLastEnter] = gettime(); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has exited the building.", GetPlayerRPName(playerid)); SetPlayerFacingAngle(playerid, staticEntrances[i][ePosA]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetCameraBehindPlayer(playerid); return 1; } } } return 0; } AddReportToQueue(playerid, text[]) { for(new x = 0; x < MAX_REPORTS; x ++) { if(!ReportInfo[x][rExists]) { strcpy(ReportInfo[x][rText], text, 128); ReportInfo[x][rExists] = 1; ReportInfo[x][rAccepted] = 0; ReportInfo[x][rReporter] = playerid; ReportInfo[x][rHandledBy] = INVALID_PLAYER_ID; ReportInfo[x][rTime] = 5; PlayerInfo[playerid][pLastReport] = gettime(); foreach(new i : Player) { if(PlayerInfo[i][pAdmin] > 0 && !PlayerInfo[i][pToggleReports]) { SendClientMessageEx(i, COLOR_YELLOW2, "Report from [%i]%s (RID: %i): %s", playerid, GetPlayerRPName(playerid), x, text); } } return 1; } } return 0; } AddBan(username[], ip[], from[], reason[], permanent = 0) { if(!isnull(username) && !isnull(ip)) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT id FROM bans WHERE username = '%s' OR ip = '%s'", username, ip); mysql_tquery(connectionID, queryBuffer, "OnBanAttempt", "ssssi", username, ip, from, reason, permanent); } } UpdateLandText(landid) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM landobjects WHERE landid = %i", LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_UPDATE_LANDLABELS, landid); } BanPlayer(playerid, from[], reason[], permanent = 0) { if(IsPlayerConnected(playerid)) { if(!strcmp(from, SERVER_ANTICHEAT)) { gAnticheatBans++; SaveServerInfo(); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO log_bans VALUES(null, %i, NOW(), '%s (IP: %s) was banned by %s, reason: %e')", PlayerInfo[playerid][pID], GetPlayerNameEx(playerid), GetPlayerIP(playerid), from, reason); mysql_tquery(connectionID, queryBuffer); AddBan(GetPlayerNameEx(playerid), GetPlayerIP(playerid), from, reason, permanent); KickIP(GetPlayerIP(playerid)); } } Rangeban(playerid, from[], reason[]) { if(IsPlayerConnected(playerid)) { AddBan(GetPlayerNameEx(playerid), GetPlayerIPRange(playerid), from, reason); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO log_bans VALUES(null, %i, NOW(), '%s (IP: %s) was rangebanned by %s, reason: %e')", PlayerInfo[playerid][pID], GetPlayerNameEx(playerid), GetPlayerIP(playerid), from, reason); mysql_tquery(connectionID, queryBuffer); KickIP(GetPlayerIP(playerid)); } } KickIP(ip[]) { foreach(new i : Player) { if(!strcmp(GetPlayerIP(i), ip)) { KickPlayer(i); } } } GetPlayerHealthEx(playerid) { new Float:health; GetPlayerHealth(playerid, health); return floatround(health); } GetPlayerArmourEx(playerid) { new Float:armor; GetPlayerArmour(playerid, armor); return floatround(armor); } GivePlayerHealth(playerid, Float:amount) { new Float:health; GetPlayerHealth(playerid, health); SetPlayerHealth(playerid, (health + amount > 100.0) ? (100.0) : (health + amount)); } GivePlayerArmour(playerid, Float:amount) { new Float:armor; GetPlayerArmour(playerid, armor); SetScriptArmour(playerid, (armor + amount > 100.0) ? (100.0) : (armor + amount)); } // --------------------------------------- // These functions are forwarded so they can be called by filterscripts using CallRemoteFunction. //ANTI FLOOD forward CheckIfFlood(playerid); public CheckIfFlood(playerid) { new ips[MAX_PLAYERS]; for(new i = 0; i < MAX_PLAYERS; i++) { GetPlayerIp(playerid, ips, sizeof(ips)); if(!strcmp(ipa, ips, false)) { UserMaxConnect[playerid]++; } } /* if(UserMaxConnect[playerid] > MAX_CONNECT) { Ban(playerid); }*/ return 1; } //LS ELEVATOR // Public: forward CallElevator(playerid, floorid); // You can use INVALID_PLAYER_ID too. forward ShowElevatorDialog(playerid); //---------------------------------------- forward SetScriptPos(playerid, Float:x, Float:y, Float:z); public SetScriptPos(playerid, Float:x, Float:y, Float:z) { SetPlayerPos(playerid, x, y, z); } forward SetScriptArmour(playerid, Float:amount); public SetScriptArmour(playerid, Float:amount) { PlayerInfo[playerid][pACTime] = gettime() + 5; PlayerInfo[playerid][pArmorTime] = gettime() + 5; PlayerInfo[playerid][pArmor] = amount; return SetPlayerArmour(playerid, amount); } forward SetScriptSkin(playerid, skinid); public SetScriptSkin(playerid, skinid) { SetPlayerSkin(playerid, skinid); PlayerInfo[playerid][pSkin] = skinid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET skin = %i WHERE uid = %i", PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } forward DestroyDamageTD(playerid); public DestroyDamageTD(playerid) { if(PlayerInfo[playerid][pDamageTimer] >= 0) { TextDrawHideForPlayer(playerid, Damage[playerid]); PlayerInfo[playerid][pDamageTimer] = -1; } } forward AddToPaycheck(playerid, amount); public AddToPaycheck(playerid, amount) { if(PlayerInfo[playerid][pLogged]) { PlayerInfo[playerid][pPaycheck] = PlayerInfo[playerid][pPaycheck] + amount; if(PlayerInfo[playerid][pPaycheck] >= 5000) { AwardAchievement(playerid, "Working class"); } if(!PlayerInfo[playerid][pAdminDuty]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET paycheck = paycheck + %i WHERE uid = %i", amount, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } } } stock GetPlayerSQLId(playerid) { if(PlayerInfo[playerid][pLogged]) { return PlayerInfo[playerid][pID]; } return -1; } forward GetPlayerCash(playerid); public GetPlayerCash(playerid) { return PlayerInfo[playerid][pCash]; } stock CheckServerAd(szInput[]) { new iCount, iPeriod, iDash, iPos, iChar, iColon; while((iChar = szInput[iPos++])) { if('0' <= iChar <= '9') iCount++; else if(iChar == '.') iPeriod++; else if(iChar == '-') iDash++; else if(iChar == ':') iColon++; } if(iCount >= 7 && iPeriod >= 3 && iColon >= 1 || strfind(szInput, "samp.") > -1 || strfind(szInput, ":7777") > -1) { return 1; } return 0; } forward OnGraffitiCreated(id); public OnGraffitiCreated(id) { GraffitiData[id][graffitiID] = cache_insert_id(connectionID); Graffiti_Save(id); return 1; } forward GivePlayerCash(playerid, amount); public GivePlayerCash(playerid, amount) { if(PlayerInfo[playerid][pLogged]) { PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] + amount; if(amount < 0) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET money_spent = money_spent + %i WHERE uid = %i", -amount, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE uid = %i AND money_spent >= 500000", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer, "OnPlayerCheckMoney", "is", playerid, "I'm rich!"); } else if(amount > 0) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET money_earned = money_earned + %i WHERE uid = %i", amount, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE uid = %i AND money_earned >= 500000", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer, "OnPlayerCheckMoney", "is", playerid, "High roller"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cash = cash + %i WHERE uid = %i", amount, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } return 1; } forward GiveWeaponToPlayer(playerid, weaponid, bool:temp); public GiveWeaponToPlayer(playerid, weaponid, bool:temp) { GivePlayerWeaponEx(playerid, weaponid, temp); } forward AddBanForPlayer(playerid, from[], reason[], permanent); public AddBanForPlayer(playerid, from[], reason[], permanent) { BanPlayer(playerid, from, reason, permanent); } forward IsPlayerLoggedIn(playerid); public IsPlayerLoggedIn(playerid) { return PlayerInfo[playerid][pLogged]; } forward IsPlayerScripter(playerid); public IsPlayerScripter(playerid) { return PlayerInfo[playerid][pDeveloper]; } forward IsPlayerFormerAdmin(playerid); public IsPlayerFormerAdmin(playerid) { return PlayerInfo[playerid][pFormerAdmin]; } forward IsPlayerAdminLevel(playerid, level); public IsPlayerAdminLevel(playerid, level) { return PlayerInfo[playerid][pAdmin] >= level; } forward IsPlayerInFaction(playerid, type); public IsPlayerInFaction(playerid, type) { return GetFactionType(playerid) == type; } forward GetPlayerInfo(playerid, pEnum:var); public GetPlayerInfo(playerid, pEnum:var) { return PlayerInfo[playerid][var]; } forward SetPlayerInfo(playerid, pEnum:var, amount); public SetPlayerInfo(playerid, pEnum:var, amount) { PlayerInfo[playerid][var] = amount; } forward GetPlayerUID(playerid); public GetPlayerUID(playerid) { return PlayerInfo[playerid][pID]; } forward mysql_connection_handle(type); public mysql_connection_handle(type) { if(type == 0) return connectionID; else if(type == 1) return radioConnectionID; return 0; } // --------------------------------------- // --------------------------------------- FriskPlayer(playerid, targetid) { SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_____ %s's Items _____", GetPlayerRPName(targetid)); if(PlayerInfo[targetid][pCash] < 10000000000) { SendClientMessageEx(playerid, COLOR_GREY2, "Cash: $%i", PlayerInfo[targetid][pCash]); } else { SendClientMessage(playerid, COLOR_GREY2, "Cash: $5000+"); } if(PlayerInfo[targetid][pPhone]) { SendClientMessage(playerid, COLOR_GREY2, "Mobile phone"); } if(PlayerInfo[targetid][pWalkieTalkie]) { SendClientMessage(playerid, COLOR_GREY2, "Walkie talkie"); } if(PlayerInfo[targetid][pSpraycans]) { SendClientMessageEx(playerid, COLOR_GREY2, "Spraycans (%i)", PlayerInfo[targetid][pSpraycans]); } if(PlayerInfo[targetid][pBoombox]) { SendClientMessage(playerid, COLOR_GREY2, "Boombox"); } if(PlayerInfo[targetid][pMP3Player]) { SendClientMessage(playerid, COLOR_GREY2, "MP3 player"); } if(PlayerInfo[targetid][pPhonebook]) { SendClientMessage(playerid, COLOR_GREY2, "Phonebook"); } if(PlayerInfo[targetid][pPoliceScanner]) { SendClientMessage(playerid, COLOR_GREY2, "Police scanner"); } if(PlayerInfo[targetid][pMaterials] > 0) { SendClientMessageEx(playerid, COLOR_GREY2, "Materials (%i)", PlayerInfo[targetid][pMaterials]); } if(PlayerInfo[targetid][pFirstAid] > 0) { SendClientMessageEx(playerid, COLOR_GREY2, "First aid (%i)", PlayerInfo[targetid][pFirstAid]); } if(PlayerInfo[targetid][pBodykits] > 0) { SendClientMessageEx(playerid, COLOR_GREY2, "Bodywork kits (%i)", PlayerInfo[targetid][pBodykits]); } if(PlayerInfo[targetid][pRimkits] > 0) { SendClientMessageEx(playerid, COLOR_GREY2, "Rimkits (%i)", PlayerInfo[targetid][pRimkits]); } if(PlayerInfo[targetid][pWeed]) { SendClientMessageEx(playerid, COLOR_RED, "Weed (%ig)", PlayerInfo[targetid][pWeed]); } if(PlayerInfo[targetid][pCocaine]) { SendClientMessageEx(playerid, COLOR_RED, "Cocaine (%ig)", PlayerInfo[targetid][pCocaine]); } if(PlayerInfo[targetid][pMeth]) { SendClientMessageEx(playerid, COLOR_RED, "Meth (%ig)", PlayerInfo[targetid][pMeth]); } if(PlayerInfo[targetid][pPainkillers]) { SendClientMessageEx(playerid, COLOR_RED, "Painkillers (%i)", PlayerInfo[targetid][pPainkillers]); } if(PlayerInfo[targetid][pSeeds]) { SendClientMessageEx(playerid, COLOR_RED, "Marijuana seeds (%i)", PlayerInfo[targetid][pSeeds]); } if(PlayerInfo[targetid][pEphedrine]) { SendClientMessageEx(playerid, COLOR_RED, "Raw ephedrine (%i)", PlayerInfo[targetid][pEphedrine]); } switch(PlayerInfo[targetid][pSmuggleDrugs]) { case 1: SendClientMessageEx(playerid, COLOR_RED, "Seeds package"); case 2: SendClientMessageEx(playerid, COLOR_RED, "Cocaine package"); case 3: SendClientMessageEx(playerid, COLOR_RED, "Raw ephedrine package"); } for(new i = 0; i < 13; i ++) { if(PlayerInfo[targetid][pWeapons][i] > 0) { SendClientMessageEx(playerid, COLOR_RED, "%s", GetWeaponNameEx(PlayerInfo[targetid][pWeapons][i])); } } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s searches for illegal items on %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); } DisplayInventory(playerid, targetid = INVALID_PLAYER_ID) { if(targetid == INVALID_PLAYER_ID) targetid = playerid; //SendClientMessage(targetid, COLOR_GREEN, "______________________________________________________________________"); SendClientMessageEx(targetid, 0x7514F6FF, "____________________ %s [%s] ____________________", GetPlayerNameEx(playerid), GetDate()); SendClientMessageEx(targetid, COLOR_WHITE, "Weed: %i/%ig - Cocaine: %i/%ig - Meth: %i/%ig - Painkillers: %i/%i - Seeds: %i/%i", PlayerInfo[playerid][pWeed], GetPlayerCapacity(playerid, CAPACITY_WEED), PlayerInfo[playerid][pCocaine], GetPlayerCapacity(playerid, CAPACITY_COCAINE), PlayerInfo[playerid][pMeth], GetPlayerCapacity(playerid, CAPACITY_METH), PlayerInfo[playerid][pPainkillers], GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS), PlayerInfo[playerid][pSeeds], GetPlayerCapacity(playerid, CAPACITY_SEEDS)); SendClientMessageEx(targetid, COLOR_NAVYBLUE, "Materials: %s/%s - Ephedrine: %i/%ig - Muriatic acid: %i/10 - Baking soda: %i/3", FormatNumber(PlayerInfo[playerid][pMaterials], 0), FormatNumber(GetPlayerCapacity(playerid, CAPACITY_MATERIALS), 0), PlayerInfo[playerid][pEphedrine], GetPlayerCapacity(playerid, CAPACITY_EPHEDRINE), PlayerInfo[playerid][pMuriaticAcid], PlayerInfo[playerid][pBakingSoda]); SendClientMessageEx(targetid, COLOR_WHITE, "Fishing rod: %s - Fish bait: %i/20 - Boombox: %s - MP3 player: %s - Phonebook: %s", (PlayerInfo[playerid][pFishingRod]) ? ("Yes") : ("No"), PlayerInfo[playerid][pFishingBait], (PlayerInfo[playerid][pBoombox]) ? ("Yes") : ("No"), (PlayerInfo[playerid][pMP3Player]) ? ("Yes") : ("No"), (PlayerInfo[playerid][pPhonebook]) ? ("Yes") : ("No")); SendClientMessageEx(targetid, COLOR_NAVYBLUE, "Drivers license: %s - Components: %s - Cigars: %s - Bombs: %i/3", (PlayerInfo[playerid][pCarLicense]) ? ("Yes") : ("No"), FormatNumber(PlayerInfo[playerid][pComponents], 0), FormatNumber(PlayerInfo[playerid][pCigars], 0), PlayerInfo[playerid][pBombs]); SendClientMessageEx(targetid, COLOR_WHITE, "Walkie talkie: %s - Mobile phone: %s - Mask : %s - First aid kits: %i/20 - Police scanner: %s", (PlayerInfo[playerid][pWalkieTalkie]) ? ("Yes") : ("No"), (PlayerInfo[playerid][pPhone]) ? ("Yes") : ("No"), (PlayerInfo[playerid][pMask]) ? ("Yes") : ("No"), PlayerInfo[playerid][pFirstAid], (PlayerInfo[playerid][pPoliceScanner]) ? ("Yes") : ("No")); SendClientMessageEx(targetid, COLOR_NAVYBLUE, "Gasoline: %i/20L - Bodykits: %i/10 - Rimkits: %i/5 - Rope: %i/10 - Watch: %s - GPS: %s", PlayerInfo[playerid][pGasCan], PlayerInfo[playerid][pBodykits], PlayerInfo[playerid][pRimkits], PlayerInfo[playerid][pRope], (PlayerInfo[playerid][pWatch]) ? ("Yes") : ("No"), (PlayerInfo[playerid][pGPS]) ? ("Yes") : ("No")); SendClientMessageEx(targetid, COLOR_WHITE, "Diamond: %s - Oil: %i/%iL - Skates: %s", FormatNumber(PlayerInfo[playerid][pDiamonds], 0), PlayerInfo[playerid][pOil], GetPlayerCapacity(playerid, CAPACITY_OIL), (PlayerInfo[playerid][pSkates]) ? ("Yes") : ("No")); } DisplayStats(playerid, targetid = INVALID_PLAYER_ID) { if(targetid == INVALID_PLAYER_ID) targetid = playerid; new name[24], gender[8], faction[48], facrank[32], gang[32], gangrank[32], gangcrew[32], division[32], insurance[24], Float:health, Float:armor; new job[32], secondjob[32], jailtype[32]; new hungerlvl, thirstlvl; if(playerid == MAX_PLAYERS) { strcpy(name, PlayerInfo[playerid][pUsername]); } else { strcat(name, GetPlayerRPName(playerid)); } if(PlayerInfo[playerid][pGender] == 1) gender = "Male"; else if(PlayerInfo[playerid][pGender] == 2) gender = "Female"; else if(PlayerInfo[playerid][pGender] == 3) gender = "Shemale"; switch(PlayerInfo[playerid][pInsurance]) { case HOSPITAL_COUNTY: insurance = "Fort Carson"; default: insurance = "None"; } if(PlayerInfo[playerid][pFaction] >= 0) { if(!strcmp(FactionInfo[PlayerInfo[playerid][pFaction]][fShortName], "None", true)) { strcpy(faction, FactionInfo[PlayerInfo[playerid][pFaction]][fName]); } else { strcpy(faction, FactionInfo[PlayerInfo[playerid][pFaction]][fShortName]); } format(facrank, sizeof(facrank), "%s (%i)", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], PlayerInfo[playerid][pFactionRank]); if(PlayerInfo[playerid][pDivision] >= 0) { strcpy(division, FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pDivision]]); } else { division = "None"; } } else { faction = "None"; facrank = "N/A (0)"; division = "None"; } if(PlayerInfo[playerid][pGang] >= 0) { strcpy(gang, GangInfo[PlayerInfo[playerid][pGang]][gName]); format(gangrank, sizeof(gangrank), "%s (%i)", GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], PlayerInfo[playerid][pGangRank]); if(PlayerInfo[playerid][pCrew] >= 0) { strcpy(gangcrew, GangCrews[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pCrew]]); } } else { gang = "None"; gangrank = "N/A (0)"; gangcrew = "None"; } /*switch(PlayerInfo[playerid][pVIPPackage]) { case 0: maxarmor = 100.0; case 1, 2: maxarmor = 125.0; case 3: maxarmor = 150.0; }*/ if(playerid == MAX_PLAYERS) { health = PlayerInfo[playerid][pHealth]; armor = PlayerInfo[playerid][pArmor]; } else { GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armor); } hungerlvl = PlayerInfo[playerid][pHunger]; thirstlvl = PlayerInfo[playerid][pThirst]; if(PlayerInfo[playerid][pJob] != JOB_NONE) { format(job, sizeof(job), "%s (%i)", GetJobName(PlayerInfo[playerid][pJob]), GetJobLevel(playerid, PlayerInfo[playerid][pJob])); } else { job = "None"; } if(PlayerInfo[playerid][pSecondJob] != JOB_NONE) { format(secondjob, sizeof(secondjob), "%s (%i)", GetJobName(PlayerInfo[playerid][pSecondJob]), GetJobLevel(playerid, PlayerInfo[playerid][pSecondJob])); } else { secondjob = "None"; } new totalwealth = PlayerInfo[playerid][pCash] + PlayerInfo[playerid][pBank]; foreach(new i : House) { if(HouseInfo[i][hExists] && PlayerInfo[playerid][pID] == HouseInfo[i][hOwnerID]) { totalwealth += HouseInfo[i][hCash]; } } foreach(new i : Business) { if(BusinessInfo[i][bExists] && PlayerInfo[playerid][pID] == BusinessInfo[i][bOwnerID]) { totalwealth += BusinessInfo[i][bCash]; } } switch(PlayerInfo[playerid][pJailType]) { case 0: jailtype = "None"; case 1: jailtype = "OOC jail"; case 2: jailtype = "OOC prison"; case 3: jailtype = "IC prison"; } /* SendClientMessageEx(targetid, 0x7514F6FF, "____________________ %s [%s] ____________________", name, GetDate()); SendClientMessageEx(targetid, COLOR_WHITE, "Level: %i - Gender: %s - Age: %i - Cash: %s - Bank: %s - Hours: %s - Ph: %i", ); SendClientMessageEx(targetid, COLOR_NAVYBLUE, "Total Wealth: %s - Experience: %s/%s - Next Level: %s - Upgrade Points: %i", ); SendClientMessageEx(targetid, COLOR_WHITE, "Inventory Skill: %i/5 - Addict Skill: %i/3 - Trader Skill: %i/3 - Asset Skill: %i/4 - Labor Skill: %i/5", ); SendClientMessageEx(targetid, COLOR_NAVYBLUE, "Job: %s - Job 2: %s - Crimes Commited: %s - Times Arrested: %s - Wanted Level: %i", job, secondjob, FormatNumber(PlayerInfo[playerid][pCrimes], 0), FormatNumber(PlayerInfo[playerid][pArrested], 0), PlayerInfo[playerid][pWantedLevel]); SendClientMessageEx(targetid, COLOR_WHITE, "Warnings: %i - DM Warnings: %i/3 - Report Warnings: %i/3 - Weapon Restriction: %i hours", ); SendClientMessageEx(targetid, COLOR_NAVYBLUE, "Faction: %s - Rank: %s - Division: %s - Gang: %s - Rank: %s - Crew: %s", faction, facrank, division, gang, gangrank, gangcrew); SendClientMessageEx(targetid, COLOR_WHITE, "Paycheck: %s - Insurance: %s - Channel: %i - cookies: %s - VIP Package: %s", FormatNumber(PlayerInfo[playerid][pPaycheck]), insurance, PlayerInfo[playerid][pChannel], FormatNumber(PlayerInfo[playerid][pCookies], 0), GetVIPRank(PlayerInfo[playerid][pVIPPackage])); SendClientMessageEx(targetid, COLOR_NAVYBLUE, "Playing Time: %i/60 mins - Jail Type: %s - Jail Time: %s sec - Double XP: %i hours", PlayerInfo[playerid][pMinutes], jailtype, FormatNumber(PlayerInfo[playerid][pJailTime], 0), PlayerInfo[playerid][pDoubleXP]); SendClientMessageEx(targetid, COLOR_WHITE, "Married To: %s", PlayerInfo[playerid][pMarriedName]); if(PlayerInfo[targetid][pAdmin] > 0) { SendClientMessageEx(targetid, COLOR_LIGHTRED, "Interior: %i - Virtual: %i - FPS: %i - AFK: %s - Reports: %s - Help Requests: %s - Newbie Replies: %s", (playerid == MAX_PLAYERS) ? (PlayerInfo[playerid][pInterior]) : (GetPlayerInterior(playerid)), (playerid == MAX_PLAYERS) ? (PlayerInfo[playerid][pWorld]) : (GetPlayerVirtualWorld(playerid)), (playerid == MAX_PLAYERS) ? (0) : (PlayerInfo[playerid][pFPS]), (playerid == MAX_PLAYERS) ? ("No") : ((PlayerInfo[playerid][pAFK]) ? ("Yes") : ("No")), FormatNumber(PlayerInfo[playerid][pReports], 0), FormatNumber(PlayerInfo[playerid][pHelpRequests], 0), FormatNumber(PlayerInfo[playerid][pNewbies], 0)); } */ new str[2000]; format(str, sizeof(str), "%s{FFFFFF}Name: %s\n", str, name); format(str, sizeof(str), "%s{378AC8}\n_________________________________________________________________________________\n\n", str); format(str, sizeof(str), "%s{FFFFFF}Total Wealth: %s{378AC8}|{FFFFFF}Experience: %s / %s {378AC8}|{FFFFFF} Upgrade Points: %i\n", str,FormatNumber(totalwealth), FormatNumber(PlayerInfo[playerid][pEXP], 0), FormatNumber((PlayerInfo[playerid][pLevel] * 4), 0), FormatNumber((PlayerInfo[playerid][pLevel] + 1) * 5000), PlayerInfo[playerid][pUpgradePoints]); format(str, sizeof(str), "%s{FFFFFF}Level: %i {378AC8}|{FFFFFF} Gender: %s {378AC8}|{FFFFFF} Age: %i {378AC8}|{FFFFFF} Cash: %s {378AC8}|{FFFFFF} Bank: %s {378AC8}|{FFFFFF} Hours: %s {378AC8}|{FFFFFF} Ph: %i\n", str,PlayerInfo[playerid][pLevel], gender, PlayerInfo[playerid][pAge], FormatNumber(PlayerInfo[playerid][pCash]), FormatNumber(PlayerInfo[playerid][pBank]), FormatNumber(PlayerInfo[playerid][pHours], 0), PlayerInfo[playerid][pPhone]); format(str, sizeof(str), "%s{FFFFFF}Inventory Skill: %i/5 {378AC8}|{FFFFFF} Addict Skill: %i/3 {378AC8}|{FFFFFF} Trader Skill: %i/3 {378AC8}|{FFFFFF} Asset Skill: %i/4 {378AC8}|{FFFFFF} Labor Skill: %i/5\n", str,PlayerInfo[playerid][pInventoryUpgrade], PlayerInfo[playerid][pAddictUpgrade], PlayerInfo[playerid][pTraderUpgrade], PlayerInfo[playerid][pAssetUpgrade], PlayerInfo[playerid][pLaborUpgrade]); format(str, sizeof(str), "%s{378AC8}\n_________________________________________________________________________________\n\n", str); format(str, sizeof(str), "%s{FFFFFF}Job: %s {378AC8}|{FFFFFF} Job 2: %s {378AC8}|{FFFFFF} Crimes Commited: %s {378AC8}|{FFFFFF} Times Arrested: %s {378AC8}|{FFFFFF} Wanted Level: %i\n", str,job, secondjob, FormatNumber(PlayerInfo[playerid][pCrimes], 0), FormatNumber(PlayerInfo[playerid][pArrested], 0), PlayerInfo[playerid][pWantedLevel]); format(str, sizeof(str), "%s{FFFFFF}Warnings: %i {378AC8}|{FFFFFF} DM Warnings: %i/3 {378AC8}|{FFFFFF} Report Warnings: %i/3 {378AC8}|{FFFFFF} Weapon Restriction: %i hours\n", str,PlayerInfo[playerid][pWarnings], PlayerInfo[playerid][pDMWarnings], PlayerInfo[playerid][pReportWarns], PlayerInfo[playerid][pWeaponRestricted] ); format(str, sizeof(str), "%s{378AC8}\n_________________________________________________________________________________\n\n", str); format(str, sizeof(str), "%s{FFFFFF}Faction: %s {378AC8}|{FFFFFF} Rank: %s {378AC8}|{FFFFFF} Division: %s {378AC8}|{FFFFFF} Gang: %s {378AC8}|{FFFFFF} Rank: %s {378AC8}|{FFFFFF} Crew: %s\n", str,faction, facrank, division, gang, gangrank, gangcrew); format(str, sizeof(str), "%s{FFFFFF}Paycheck: %s {378AC8}|{FFFFFF} Insurance: %s {378AC8}|{FFFFFF} Channel: %i {378AC8}|{FFFFFF} cookies: %s {378AC8}|{FFFFFF} VIP Package: %s\n", str,FormatNumber(PlayerInfo[playerid][pPaycheck]), insurance, PlayerInfo[playerid][pChannel], FormatNumber(PlayerInfo[playerid][pCookies], 0), GetVIPRank(PlayerInfo[playerid][pVIPPackage]) ); format(str, sizeof(str), "%s{378AC8}\n_________________________________________________________________________________\n\n", str); format(str, sizeof(str), "%s{FFFFFF}Playing Time: %i/60 mins {378AC8}|{FFFFFF} Jail Type: %s {378AC8}|{FFFFFF} Jail Time: %s sec {378AC8}|{FFFFFF} Double XP: %i hours\n", str,PlayerInfo[playerid][pMinutes], jailtype, FormatNumber(PlayerInfo[playerid][pJailTime], 0), PlayerInfo[playerid][pDoubleXP] ); format(str, sizeof(str), "%s{FFFFFF}Hunger: %i | Thirst: %i | %s Marriage: %s\n", str, hungerlvl, thirstlvl, PlayerInfo[playerid][pMarriedName] ); format(str, sizeof(str), "%s{378AC8}\n_________________________________________________________________________________\n\n", str); if(PlayerInfo[targetid][pAdmin] > 0) { format(str, sizeof(str), "%s{FFFFFF}Interior: %i - Virtual: %i - FPS: %i - AFK: %s - Reports: %s - Help Requests: %s - Newbie Replies: %s", str,(playerid == MAX_PLAYERS) ? (PlayerInfo[playerid][pInterior]) : (GetPlayerInterior(playerid)), (playerid == MAX_PLAYERS) ? (PlayerInfo[playerid][pWorld]) : (GetPlayerVirtualWorld(playerid)), (playerid == MAX_PLAYERS) ? (0) : (PlayerInfo[playerid][pFPS]), (playerid == MAX_PLAYERS) ? ("No") : ((PlayerInfo[playerid][pAFK]) ? ("Yes") : ("No")), FormatNumber(PlayerInfo[playerid][pReports], 0), FormatNumber(PlayerInfo[playerid][pHelpRequests], 0), FormatNumber(PlayerInfo[playerid][pNewbies], 0) ); } ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{FCCE3C}Emerald City{FFFFFF} Stats:",str, "Close",""); } ShowDialogToPlayer(playerid, dialogid) { new string[4096]; switch(dialogid) { case DIALOG_REGISTER: { ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "{F07B0F}Emerald City Rolepaly{FFFFFF} Register", "{FFFFFF}Welcome to {F07B0F}Emerald City Rolepaly{FFFFFF}.\n\nEnter your password of choice below to register:\n{910000}Do not share your password with others", "Register", ""); } case DIALOG_LOGIN: { ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "{F07B0F}Emerald City Rolepaly{FFFFFF} Login", "{FFFFFF}Welcome to {F07B0F}Emerald City Rolepaly{FFFFFF}.\n\nEnter your account password below to login:\n{910000}Do not share your password with others", "Login", ""); } case DIALOG_GENDER: { ShowPlayerDialog(playerid, DIALOG_GENDER, DIALOG_STYLE_LIST, "Please choose your character's gender.", "Male\nFemale\nShemale", "Select", ""); } case DIALOG_AGE: { ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Please enter your character's age.", "Please input the age of your character below (10-99):", "Submit", "Back"); } case DIALOG_REFERRAL: { ShowPlayerDialog(playerid, DIALOG_REFERRAL, DIALOG_STYLE_INPUT, "Have you been referred here by anyone?", "Please enter the name of the player who referred you here:\n(You can click on 'Skip' if you haven't been referred by anyone.)", "Submit", "Skip"); } case DIALOG_BUYFURNITURETYPE: { ShowPlayerDialog(playerid, DIALOG_BUYFURNITURETYPE, DIALOG_STYLE_LIST, "Choose your browsing method.", "Browse by Model\nBrowse by List", "Select", "Cancel"); } case DIALOG_BUYFURNITURE1: { for(new i = 0; i < sizeof(furnitureCategories); i ++) { format(string, sizeof(string), "%s\n%s", string, furnitureCategories[i]); } ShowPlayerDialog(playerid, DIALOG_BUYFURNITURE1, DIALOG_STYLE_LIST, "Choose a category to browse.", string, "Select", "Back"); } case DIALOG_BUYFURNITURE2: { new index = -1; for(new i = 0; i < sizeof(furnitureArray); i ++) { if(!strcmp(furnitureArray[i][fCategory], furnitureCategories[PlayerInfo[playerid][pCategory]])) { if(index == -1) { index = i; } format(string, sizeof(string), "%s\n%s (%s)", string, furnitureArray[i][fName], FormatNumber(furnitureArray[i][fPrice])); } } PlayerInfo[playerid][pFurnitureIndex] = index; ShowPlayerDialog(playerid, DIALOG_BUYFURNITURE2, DIALOG_STYLE_LIST, "Choose an item in order to preview it.", string, "Select", "Back"); } case DIALOG_ATM: { format(string, sizeof(string), "What would you like to do today? (Your account balance is %s.)", FormatNumber(PlayerInfo[playerid][pBank])); ShowPlayerDialog(playerid, DIALOG_ATM, DIALOG_STYLE_LIST, string, "Cash deposit\nCash withdraw", "Select", "Cancel"); } case DIALOG_ATMDEPOSIT: { format(string, sizeof(string), "How much would you like to deposit? (Your account balance is %s.)", FormatNumber(PlayerInfo[playerid][pBank])); ShowPlayerDialog(playerid, DIALOG_ATMDEPOSIT, DIALOG_STYLE_INPUT, "ATM Deposit", string, "Select", "Cancel"); } case DIALOG_ATMWITHDRAW: { format(string, sizeof(string), "How much would you like to withdraw? (Your account balance is %s.)", FormatNumber(PlayerInfo[playerid][pBank])); ShowPlayerDialog(playerid, DIALOG_ATMWITHDRAW, DIALOG_STYLE_INPUT, "ATM Withdraw", string, "Select", "Cancel"); } case DIALOG_BUYCLOTHINGTYPE: { ShowPlayerDialog(playerid, DIALOG_BUYCLOTHINGTYPE, DIALOG_STYLE_LIST, "Choose a browsing method.", "Browse by Model\nBrowse by List", "Select", "Back"); } case DIALOG_BUYCLOTHING: { new index = -1; for(new i = 0; i < sizeof(clothingArray); i ++) { if(!strcmp(clothingArray[i][clothingType], clothingTypes[PlayerInfo[playerid][pCategory]])) { if(index == -1) { index = i; } format(string, sizeof(string), "%s\n%s", string, clothingArray[i][clothingName]); } } PlayerInfo[playerid][pClothingIndex] = index; ShowPlayerDialog(playerid, DIALOG_BUYCLOTHING, DIALOG_STYLE_LIST, "Choose an item in order to preview it.", string, "Select", "Back"); } case DIALOG_BUYCLOTHES: { new businessid = GetInsideBusiness(playerid); if(businessid >= 0 && BusinessInfo[businessid][bType] == BUSINESS_CLOTHES) { format(string, sizeof(string), "%s's %s [%i products]", BusinessInfo[businessid][bOwner], bizInteriors[BusinessInfo[businessid][bType]][intType], BusinessInfo[businessid][bProducts]); if(PlayerInfo[playerid][pVIPPackage] > 0) { ShowPlayerDialog(playerid, DIALOG_BUYCLOTHES, DIALOG_STYLE_INPUT, string, "NOTE: New clothes are free for VIP members.\n\nPlease input the ID of the skin you wish to purchase.\n(( List of skins: http://wiki.sa-mp.com/wiki/Skins:All ))", "Submit", "Cancel"); } else { ShowPlayerDialog(playerid, DIALOG_BUYCLOTHES, DIALOG_STYLE_INPUT, string, "NOTE: New clothes costs $2,000.\n\nPlease input the ID of the skin you wish to purchase.\n(( List of skins: http://wiki.sa-mp.com/wiki/Skins:All ))", "Submit", "Cancel"); } } } case DIALOG_FACTIONPAY1: { string = "#\tRank\tPaycheck"; for(new i = 0; i < FactionInfo[PlayerInfo[playerid][pFactionEdit]][fRankCount]; i ++) { format(string, sizeof(string), "%s\n%i\t%s\t{00AA00}%s{FFFFFF}", string, i, FactionRanks[PlayerInfo[playerid][pFactionEdit]][i], FormatNumber(FactionInfo[PlayerInfo[playerid][pFactionEdit]][fPaycheck][i])); } new header[128]; format(header, sizeof(header), "%s - {FFD700}$%i available/$%i budget", FactionInfo[PlayerInfo[playerid][pFactionEdit]][fName], FormatNumber(FactionInfo[PlayerInfo[playerid][pFactionEdit]][fBudget] - GetTotalFactionPay(PlayerInfo[playerid][pFactionEdit])), FormatNumber(FactionInfo[PlayerInfo[playerid][pFactionEdit]][fBudget])); ShowPlayerDialog(playerid, DIALOG_FACTIONPAY1, DIALOG_STYLE_TABLIST_HEADERS, header, string, "Change", "Cancel"); } case DIALOG_PHONEBOOK: { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM phonebook ORDER BY name ASC LIMIT %i, %i", (PlayerInfo[playerid][pPage] - 1) * MAX_LISTED_NUMBERS, MAX_LISTED_NUMBERS); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_VIEW_PHONEBOOK, playerid); } case DIALOG_LANDBUILDTYPE: { ShowPlayerDialog(playerid, DIALOG_LANDBUILDTYPE, DIALOG_STYLE_LIST, "Choose your browsing method.", "Browse by Model\nBrowse by List", "Select", "Back"); } case DIALOG_LANDBUILD1: { for(new i = 0; i < sizeof(furnitureCategories); i ++) { format(string, sizeof(string), "%s\n%s", string, furnitureCategories[i]); } ShowPlayerDialog(playerid, DIALOG_LANDBUILD1, DIALOG_STYLE_LIST, "Choose a category to browse.", string, "Select", "Back"); } case DIALOG_LANDBUILD2: { new index = -1; for(new i = 0; i < sizeof(furnitureArray); i ++) { if(!strcmp(furnitureArray[i][fCategory], furnitureCategories[PlayerInfo[playerid][pCategory]])) { if(index == -1) { index = i; } format(string, sizeof(string), "%s\n%s (%s)", string, furnitureArray[i][fName], FormatNumber(furnitureArray[i][fPrice])); } } PlayerInfo[playerid][pFurnitureIndex] = index; ShowPlayerDialog(playerid, DIALOG_LANDBUILD2, DIALOG_STYLE_LIST, "Choose an item in order to preview it.", string, "Select", "Back"); } case DIALOG_LANDMENU: { new landid = GetNearbyLand(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM landobjects WHERE landid = %i", LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LAND_MAINMENU, playerid); } case DIALOG_LANDOBJECTMENU: { if(IsGateObject(PlayerInfo[playerid][pSelected])) { ShowPlayerDialog(playerid, DIALOG_LANDOBJECTMENU, DIALOG_STYLE_LIST, "Choose how you want to edit this object.", "Edit object\nEdit gate destination\nDuplicate object\nSell object", "Select", "Back"); } else { ShowPlayerDialog(playerid, DIALOG_LANDOBJECTMENU, DIALOG_STYLE_LIST, "Choose how you want to edit this object.", "Edit object\nDuplicate object\nSell object", "Select", "Back"); } } case DIALOG_LANDOBJECTS: { new landid = GetNearbyLand(playerid); if(landid >= 0 && HasLandPerms(playerid, landid)) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM landobjects WHERE landid = %i ORDER BY id DESC LIMIT %i, %i", LandInfo[landid][lID], (PlayerInfo[playerid][pPage] - 1) * MAX_LISTED_OBJECTS, MAX_LISTED_OBJECTS); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LIST_LANDOBJECTS, playerid); } } case DIALOG_MP3PLAYER: { ShowPlayerDialog(playerid, DIALOG_MP3PLAYER, DIALOG_STYLE_LIST, "MP3 player", "Custom URL\nUploaded Music\nRadio Stations\nStop Music\nVIP Music", "Select", "Cancel"); } case DIALOG_MP3RADIO: { ShowPlayerDialog(playerid, DIALOG_MP3RADIO, DIALOG_STYLE_LIST, "Radio Stations", "Browse Genres\nSearch by Name", "Select", "Back"); } case DIALOG_MP3RADIOGENRES: { new genre[32] = "n/a"; for(new i = 0; i < sizeof(radioGenreList); i ++) { if(strcmp(radioGenreList[i][rGenre], genre) != 0) { strcpy(genre, radioGenreList[i][rGenre]); strcat(string, genre); strcat(string, "\n"); } } ShowPlayerDialog(playerid, DIALOG_MP3RADIOGENRES, DIALOG_STYLE_LIST, "Choose a genre to browse stations in.", string, "Select", "Back"); } case DIALOG_MP3RADIOSUBGENRES: { for(new i = 0; i < sizeof(radioGenreList); i ++) { if(!strcmp(radioGenreList[i][rGenre], PlayerInfo[playerid][pGenre])) { format(string, sizeof(string), "%s\n%s", string, radioGenreList[i][rSubgenre]); } } ShowPlayerDialog(playerid, DIALOG_MP3RADIOSUBGENRES, DIALOG_STYLE_LIST, "Choose a subgenre to browse stations in.", string, "Select", "Back"); } case DIALOG_MP3RADIORESULTS: { if(PlayerInfo[playerid][pSearch]) { mysql_format(radioConnectionID, queryBuffer, sizeof(queryBuffer), "SELECT name FROM radiostations WHERE name LIKE '%%%e%%' OR subgenre LIKE '%%%e%%' ORDER BY name LIMIT %i, %i", PlayerInfo[playerid][pGenre], PlayerInfo[playerid][pGenre], (PlayerInfo[playerid][pPage] - 1) * MAX_LISTED_STATIONS, MAX_LISTED_STATIONS); mysql_tquery(radioConnectionID, queryBuffer, "Radio_ListStations", "i", playerid); } else { mysql_format(radioConnectionID, queryBuffer, sizeof(queryBuffer), "SELECT name FROM radiostations WHERE genre = '%e' AND subgenre = '%e' ORDER BY name LIMIT %i, %i", PlayerInfo[playerid][pGenre], PlayerInfo[playerid][pSubgenre], (PlayerInfo[playerid][pPage] - 1) * MAX_LISTED_STATIONS, MAX_LISTED_STATIONS); mysql_tquery(radioConnectionID, queryBuffer, "Radio_ListStations", "i", playerid); } } case DIALOG_MP3RADIOSEARCH: { ShowPlayerDialog(playerid, DIALOG_MP3RADIOSEARCH, DIALOG_STYLE_INPUT, "Search by Name", "Enter the full or partial name of the radio station:", "Submit", "Back"); } /*case DIALOG_MP3APISEARCH: { ShowPlayerDialog(playerid, DIALOG_MP3APISEARCH, DIALOG_STYLE_INPUT, "Search by Name", "Enter the full or partial name of the radio station:", "Submit", "Back"); }*/ case DIALOG_GANGSTASH: { format(string, sizeof(string), "Gang stash ($%i/$%i) (Materials: %i/%i)", GangInfo[PlayerInfo[playerid][pGang]][gCash], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_CASH), GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_MATERIALS)); ShowPlayerDialog(playerid, DIALOG_GANGSTASH, DIALOG_STYLE_LIST, string, "Weapons\nKevlar Vest\nDrugs\nClothes\nCrafting\nMaterials\nCash", "Select", "Cancel"); } case DIALOG_GANGSTASHVEST: { format(string, sizeof(string), "Withdraw (R%i+)\nChange Rank", GangInfo[PlayerInfo[playerid][pGang]][gVestRank]); ShowPlayerDialog(playerid, DIALOG_GANGSTASHVEST, DIALOG_STYLE_LIST, "Gang stash | Kevlar Vest (Costs 200 materials.)", string, "Select", "Back"); } case DIALOG_GANGSTASHWEAPONS1: { format(string, sizeof(string), "[%i] 9mm (R%i+)\n[%i] Sdpistol (R%i+)\n[%i] Deagle (R%i+)\n[%i] Shotgun (R%i+)\n[%i] Sawn-off (R%i+)\n[%i] Tec-9 (R%i+)\n[%i] Micro Uzi (R%i+)\n[%i] MP5 (R%i+)\n[%i] AK-47 (R%i+)\n[%i] M4 (R%i+)\n[%i] Rifle (R%i+)\n[%i] Sniper (R%i+)\n[%i] Molotov (R%i+)", GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_9MM], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_9MM], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SDPISTOL], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SDPISTOL], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_DEAGLE], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_DEAGLE], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SHOTGUN], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SHOTGUN], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SAWNOFF], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SAWNOFF], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_TEC9], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_TEC9], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_UZI], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_UZI], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MP5], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_MP5], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_AK47], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_AK47], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_M4], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_M4], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_RIFLE], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_RIFLE], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SNIPER], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SNIPER], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MOLOTOV], GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_MOLOTOV]); ShowPlayerDialog(playerid, DIALOG_GANGSTASHWEAPONS1, DIALOG_STYLE_LIST, "Gang stash | Weapons", string, "Select", "Back"); } case DIALOG_GANGSTASHDRUGS1: { format(string, sizeof(string), "Weed (%i/%ig)\nCocaine (%i/%ig)\nMeth (%i/%ig)\nPainkillers (%i/%i)", GangInfo[PlayerInfo[playerid][pGang]][gWeed], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_WEED), GangInfo[PlayerInfo[playerid][pGang]][gCocaine], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_COCAINE), GangInfo[PlayerInfo[playerid][pGang]][gMeth], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_METH), GangInfo[PlayerInfo[playerid][pGang]][gPainkillers], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_PAINKILLERS)); ShowPlayerDialog(playerid, DIALOG_GANGSTASHDRUGS1, DIALOG_STYLE_LIST, "Gang stash | Drugs", string, "Select", "Back"); } case DIALOG_GANGSTASHDRUGS2: { if(PlayerInfo[playerid][pSelected] == ITEM_WEED) { ShowPlayerDialog(playerid, DIALOG_GANGSTASHDRUGS2, DIALOG_STYLE_LIST, "Gang stash | Weed", "Withdraw\nDeposit", "Select", "Back"); } else if(PlayerInfo[playerid][pSelected] == ITEM_COCAINE) { ShowPlayerDialog(playerid, DIALOG_GANGSTASHDRUGS2, DIALOG_STYLE_LIST, "Gang stash | Cocaine", "Withdraw\nDeposit", "Select", "Back"); } else if(PlayerInfo[playerid][pSelected] == ITEM_METH) { ShowPlayerDialog(playerid, DIALOG_GANGSTASHDRUGS2, DIALOG_STYLE_LIST, "Gang stash | Meth", "Withdraw\nDeposit", "Select", "Back"); } else if(PlayerInfo[playerid][pSelected] == ITEM_PAINKILLERS) { ShowPlayerDialog(playerid, DIALOG_GANGSTASHDRUGS2, DIALOG_STYLE_LIST, "Gang stash | Painkillers", "Withdraw\nDeposit", "Select", "Back"); } } case DIALOG_GANGSTASHCRAFT: { format(string, sizeof(string), "Gang stash | Crafting (Your safe has %i materials.)", GangInfo[PlayerInfo[playerid][pGang]][gMaterials]); ShowPlayerDialog(playerid, DIALOG_GANGSTASHCRAFT, DIALOG_STYLE_TABLIST_HEADERS, string, "#\tWeapon\tCost\n1\t9mm\t100 materials\n2\tSdpistol\t150 materials\n3\tShotgun\t200 materials\n4\tMicro SMG\t500 materials\n5\tTec-9\t500 materials\n6\tMP5\t1000 materials\n7\tRifle\t1000 materials\n8\tDesert Eagle\t2000 materials\n9\tMolotov\t5000 materials\n10\tAK-47\t3000 materials\n11\tSawed-off Shotgun\t3000 materials", "Craft", "Back"); } case DIALOG_GANGSTASHMATS: { format(string, sizeof(string), "Withdraw (%i/%i)\nDeposit", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_MATERIALS)); ShowPlayerDialog(playerid, DIALOG_GANGSTASHMATS, DIALOG_STYLE_LIST, "Gang stash | Materials", string, "Select", "Back"); } case DIALOG_GANGSTASHCASH: { format(string, sizeof(string), "Withdraw ($%i/$%i)\nDeposit", GangInfo[PlayerInfo[playerid][pGang]][gCash], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_CASH)); ShowPlayerDialog(playerid, DIALOG_GANGSTASHCASH, DIALOG_STYLE_LIST, "Gang stash | Cash", string, "Select", "Back"); } case DIALOG_GANGWITHDRAW: { if(PlayerInfo[playerid][pSelected] == ITEM_WEED) { format(string, sizeof(string), "How much weed would you like to withdraw? (The safe contains %i/%i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gWeed], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_WEED)); } else if(PlayerInfo[playerid][pSelected] == ITEM_COCAINE) { format(string, sizeof(string), "How much cocaine would you like to withdraw? (The safe contains %i/%i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gCocaine], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_COCAINE)); } else if(PlayerInfo[playerid][pSelected] == ITEM_METH) { format(string, sizeof(string), "How much meth would you like to withdraw? (The safe contains %i/%i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gMeth], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_METH)); } else if(PlayerInfo[playerid][pSelected] == ITEM_PAINKILLERS) { format(string, sizeof(string), "How much painkillers would you like to withdraw? (The safe contains %i/%i.)", GangInfo[PlayerInfo[playerid][pGang]][gPainkillers], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_PAINKILLERS)); } else if(PlayerInfo[playerid][pSelected] == ITEM_MATERIALS) { format(string, sizeof(string), "How much materials would you like to withdraw? (The safe contains %i/%i.)", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_MATERIALS)); } else if(PlayerInfo[playerid][pSelected] == ITEM_CASH) { format(string, sizeof(string), "How much cash would you like to withdraw? (The safe contains $%i/$%i.)", GangInfo[PlayerInfo[playerid][pGang]][gCash], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_CASH)); } ShowPlayerDialog(playerid, DIALOG_GANGWITHDRAW, DIALOG_STYLE_INPUT, "Gang stash | Withdraw", string, "Submit", "Back"); } case DIALOG_GANGDEPOSIT: { if(PlayerInfo[playerid][pSelected] == ITEM_WEED) { format(string, sizeof(string), "How much weed would you like to deposit? (The safe contains %i/%i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gWeed], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_WEED)); } else if(PlayerInfo[playerid][pSelected] == ITEM_COCAINE) { format(string, sizeof(string), "How much cocaine would you like to deposit? (The safe contains %i/%i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gCocaine], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_COCAINE)); } else if(PlayerInfo[playerid][pSelected] == ITEM_METH) { format(string, sizeof(string), "How much meth would you like to deposit? (The safe contains %i/%i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gMeth], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_METH)); } else if(PlayerInfo[playerid][pSelected] == ITEM_PAINKILLERS) { format(string, sizeof(string), "How much painkillers would you like to deposit? (The safe contains %i/%i.)", GangInfo[PlayerInfo[playerid][pGang]][gPainkillers], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_PAINKILLERS)); } else if(PlayerInfo[playerid][pSelected] == ITEM_MATERIALS) { format(string, sizeof(string), "How much materials would you like to deposit? (The safe contains %i/%i.)", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_MATERIALS)); } else if(PlayerInfo[playerid][pSelected] == ITEM_CASH) { format(string, sizeof(string), "How much cash would you like to deposit? (The safe contains $%i/$%i.)", GangInfo[PlayerInfo[playerid][pGang]][gCash], GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_CASH)); } ShowPlayerDialog(playerid, DIALOG_GANGDEPOSIT, DIALOG_STYLE_INPUT, "Gang stash | Deposit", string, "Submit", "Back"); } case DIALOG_GANGARMSPRICES: { format(string, sizeof(string), "#\tWeapon\tPrice\tCost\n1\tMicro Uzi\t$%i\t500 materials\n2\tTec-9\t$%i\t500 materials\n3\tMP5\t$%i\t1000 materials\n4\tDesert Eagle\t$%i\t2000 materials\n5\tMolotov\t$%i\t5000 materials\n6\tAK-47\t$%i\t3000 materials\n7\tM4\t$%i\t4000 materials\n8\tSniper\t$%i\t6500 materials\n9\tSawnoff Shotgun\t$%i\t3000 materials", GangInfo[PlayerInfo[playerid][pGang]][gArmsPrices][0], GangInfo[PlayerInfo[playerid][pGang]][gArmsPrices][1], GangInfo[PlayerInfo[playerid][pGang]][gArmsPrices][2], GangInfo[PlayerInfo[playerid][pGang]][gArmsPrices][3], GangInfo[PlayerInfo[playerid][pGang]][gArmsPrices][4], GangInfo[PlayerInfo[playerid][pGang]][gArmsPrices][5], GangInfo[PlayerInfo[playerid][pGang]][gArmsPrices][6], GangInfo[PlayerInfo[playerid][pGang]][gArmsPrices][7], GangInfo[PlayerInfo[playerid][pGang]][gArmsPrices][8]); ShowPlayerDialog(playerid, DIALOG_GANGARMSPRICES, DIALOG_STYLE_TABLIST_HEADERS, "Choose a weapon price to edit.", string, "Change", "Back"); } case DIALOG_GANGARMSDEALER: { ShowPlayerDialog(playerid, DIALOG_GANGARMSDEALER, DIALOG_STYLE_LIST, "Arms dealer", "Buy Guns\nEdit", "Select", "Cancel"); } case DIALOG_GANGARMSWEAPONS: { new title[48]; format(title, sizeof(title), "Gang arms dealer (Materials available: %i.)", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials]); format(string, sizeof(string), "#\tWeapon\tPrice\tCost\n1\tMicro Uzi\t$%i\t500 materials\n2\tTec-9\t$%i\t500 materials\n3\tMP5\t$%i\t1000 materials\n4\tDesert Eagle\t$%i\t2000 materials\n5\tMolotov\t$%i\t5000 materials\n6\tAK-47\t$%i\t3000 materials\n7\tM4\t$%i\t4000 materials\n8\tSniper\t$%i\t6500 materials\n9\tSawnoff Shotgun\t$%i\t3000 materials", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][0], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][1], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][2], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][3], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][4], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][5], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][6], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][7], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][8]); ShowPlayerDialog(playerid, DIALOG_GANGARMSWEAPONS, DIALOG_STYLE_TABLIST_HEADERS, title, string, "Buy", "Back"); } case DIALOG_GANGARMSEDIT: { format(string, sizeof(string), "Arms dealer (Materials available: %i.)", GangInfo[PlayerInfo[playerid][pGang]][gArmsMaterials]); ShowPlayerDialog(playerid, DIALOG_GANGARMSEDIT, DIALOG_STYLE_LIST, string, "Edit prices\nDeposit mats\nWithdraw mats", "Select", "Back"); } case DIALOG_GANGARMSDEPOSITMATS: { format(string, sizeof(string), "How much materials would you like to deposit? (This arms dealer contains %i materials.)", GangInfo[PlayerInfo[playerid][pGang]][gArmsMaterials]); ShowPlayerDialog(playerid, DIALOG_GANGARMSDEPOSITMATS, DIALOG_STYLE_INPUT, "Arms dealer | Deposit", string, "Submit", "Back"); } case DIALOG_GANGARMSWITHDRAWMATS: { format(string, sizeof(string), "How much materials would you like to withdraw? (This arms dealer contains %i materials.)", GangInfo[PlayerInfo[playerid][pGang]][gArmsMaterials]); ShowPlayerDialog(playerid, DIALOG_GANGARMSWITHDRAWMATS, DIALOG_STYLE_INPUT, "Arms dealer | Withdraw", string, "Submit", "Back"); } case DIALOG_GANGDRUGDEALER: { ShowPlayerDialog(playerid, DIALOG_GANGDRUGDEALER, DIALOG_STYLE_LIST, "Drug dealer", "Buy Drugs\nEdit", "Select", "Cancel"); } case DIALOG_GANGDRUGSHOP: { format(string, sizeof(string), "Drug\tPrice\tStock\nWeed\t$%i\t%i grams\nCocaine\t$%i\t%i grams\nMeth\t$%i\t%i grams", GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][0], GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugWeed], GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][1], GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugCocaine], GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][2], GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugMeth]); ShowPlayerDialog(playerid, DIALOG_GANGDRUGSHOP, DIALOG_STYLE_TABLIST_HEADERS, "Drug dealer", string, "Buy", "Back"); } case DIALOG_GANGDRUGBUY: { if(PlayerInfo[playerid][pSelected] == 0) { format(string, sizeof(string), "How much weed would you like to buy? (%s per gram. %i grams available.)", FormatNumber(GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][0]), GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugWeed]); } else if(PlayerInfo[playerid][pSelected] == 1) { format(string, sizeof(string), "How much cocaine would you like to buy? (%s per gram. %i grams available.)", FormatNumber(GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][1]), GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugCocaine]); } else if(PlayerInfo[playerid][pSelected] == 2) { format(string, sizeof(string), "How much meth would you like to buy? (%s per gram. %i grams available.)", FormatNumber(GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][2]), GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugMeth]); } ShowPlayerDialog(playerid, DIALOG_GANGDRUGBUY, DIALOG_STYLE_INPUT, "Drug dealer | Buy", string, "Submit", "Back"); } case DIALOG_GANGDRUGEDIT: { format(string, sizeof(string), "Drug dealer (Weed: %i) (Cocaine: %i) (Meth: %i)", GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed], GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine], GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth]); ShowPlayerDialog(playerid, DIALOG_GANGDRUGEDIT, DIALOG_STYLE_LIST, string, "Edit prices\nDeposit drugs\nWithdraw drugs", "Select", "Back"); } case DIALOG_GANGDRUGPRICES: { format(string, sizeof(string), "Drug\tPrice\tStock\nWeed\t$%i\t%i grams\nCocaine\t$%i\t%i grams\nMeth\t$%i\t%i grams", GangInfo[PlayerInfo[playerid][pGang]][gDrugPrices][0], GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed], GangInfo[PlayerInfo[playerid][pGang]][gDrugPrices][1], GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine], GangInfo[PlayerInfo[playerid][pGang]][gDrugPrices][2], GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth]); ShowPlayerDialog(playerid, DIALOG_GANGDRUGPRICES, DIALOG_STYLE_TABLIST_HEADERS, "Choose a drug price to edit.", string, "Change", "Back"); } case DIALOG_GANGDRUGDEPOSITS: { format(string, sizeof(string), "Weed (%ig)\nCocaine (%ig)\nMeth (%ig)", GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed], GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine], GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth]); ShowPlayerDialog(playerid, DIALOG_GANGDRUGDEPOSITS, DIALOG_STYLE_LIST, "Drug dealer | Deposit", string, "Select", "Back"); } case DIALOG_GANGDRUGDEPOSIT: { if(PlayerInfo[playerid][pSelected] == 0) { format(string, sizeof(string), "How much weed would you like to deposit? (This drug dealer contains %i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed]); } else if(PlayerInfo[playerid][pSelected] == 1) { format(string, sizeof(string), "How much cocaine would you like to deposit? (This drug dealer contains %i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine]); } else if(PlayerInfo[playerid][pSelected] == 2) { format(string, sizeof(string), "How much meth would you like to deposit? (This drug dealer contains %i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth]); } ShowPlayerDialog(playerid, DIALOG_GANGDRUGDEPOSIT, DIALOG_STYLE_INPUT, "Drug dealer | Deposit", string, "Submit", "Back"); } case DIALOG_GANGDRUGWITHDRAWS: { format(string, sizeof(string), "Weed (%ig)\nCocaine (%ig)\nMeth (%ig)", GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed], GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine], GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth]); ShowPlayerDialog(playerid, DIALOG_GANGDRUGWITHDRAWS, DIALOG_STYLE_LIST, "Drug dealer | Withdraw", string, "Select", "Back"); } case DIALOG_GANGDRUGWITHDRAW: { if(PlayerInfo[playerid][pSelected] == 0) { format(string, sizeof(string), "How much weed would you like to withdraw? (This drug dealer contains %i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed]); } else if(PlayerInfo[playerid][pSelected] == 1) { format(string, sizeof(string), "How much cocaine would you like to withdraw? (This drug dealer contains %i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine]); } else if(PlayerInfo[playerid][pSelected] == 2) { format(string, sizeof(string), "How much meth would you like to withdraw? (This drug dealer contains %i grams.)", GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth]); } ShowPlayerDialog(playerid, DIALOG_GANGDRUGWITHDRAW, DIALOG_STYLE_INPUT, "Drug dealer | Withdraw", string, "Submit", "Back"); } case DIALOG_CRACKTRUNK: { if(VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vWeed]/20 > 0) format(string, sizeof(string), "%s\nWeed (%ig)", string, VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vWeed]/20); if(VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vCocaine]/20 > 0) format(string, sizeof(string), "%s\nCocaine (%ig)", string, VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vCocaine]/20); if(VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vMeth]/20 > 0) format(string, sizeof(string), "%s\nMeth (%ig)", string, VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vMeth]/20); if(VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vPainkillers]/20 > 0) format(string, sizeof(string), "%s\nPainkillers (%ig)", string, VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vPainkillers]/20); if(VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vMaterials]/20 > 0) format(string, sizeof(string), "%s\nMaterials (%i)", string, VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vMaterials]/20); if(VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vCash]/20 > 0) format(string, sizeof(string), "%s\nCash ($%i)", string, VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vCash]/20); for(new x = 0; x < 5; x ++) { if(VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vWeapons][x] != 0) { format(string, sizeof(string), "%s\n%s", string, GetWeaponNameEx(VehicleInfo[PlayerInfo[playerid][pCocaineFrom]][vWeapons][x])); } } ShowPlayerDialog(playerid, DIALOG_CRACKTRUNK, DIALOG_STYLE_LIST, "Choose ONE item to take from the trunk.", string, "Take", "Cancel"); } case DIALOG_RULES: { ShowPlayerDialog(playerid, DIALOG_RULES, DIALOG_STYLE_LIST, "List of Server Rules", "No third-party modifications such as cheats\nNo exploiting\nNo non-RP advertisements\nNo death-match\nNo spawn-killing\nNo revenge-killing\nNo non-RP car raming.\nNo heli-blading\nNo meta-gaming\nNo money farming\nNo lying to administrators\nRobbery Policy\nScamming Policy\nList of all rules may be available at theroleplay.com", "Close", ""); } case DIALOG_LOCATE: { ShowPlayerDialog(playerid, DIALOG_LOCATE, DIALOG_STYLE_LIST, "GPS - Select Destination", "Job Locations\nNearest Businesses\nGeneral Locations\nFind Turfs\nMore Locations", "Select", "Close"); } case DIALOG_FACTIONEQUIPMENT: { new lockerid = GetNearbyLocker(playerid); string = "Weapon\tPrice\n"; if(LockerInfo[lockerid][locKevlar][0]) { format(string, sizeof(string), "%sKevlar Vest\t$%i\n", string, LockerInfo[lockerid][locKevlar][1]); } if(LockerInfo[lockerid][locMedKit][0]) { format(string, sizeof(string), "%sMedkit\t$%i\n", string, LockerInfo[lockerid][locMedKit][1]); } if(LockerInfo[lockerid][locNitestick][0]) { format(string, sizeof(string), "%sNitestick\t$%i\n", string, LockerInfo[lockerid][locNitestick][1]); } if(LockerInfo[lockerid][locMace][0]) { format(string, sizeof(string), "%sMace\t$%i\n", string, LockerInfo[lockerid][locMace][1]); } if(LockerInfo[lockerid][locDeagle][0]) { format(string, sizeof(string), "%sDeagle\t$%i\n", string, LockerInfo[lockerid][locDeagle][1]); } if(LockerInfo[lockerid][locShotgun][0]) { format(string, sizeof(string), "%sShotgun\t$%i\n", string, LockerInfo[lockerid][locShotgun][1]); } if(LockerInfo[lockerid][locMP5][0]) { format(string, sizeof(string), "%sMP5\t$%i\n", string, LockerInfo[lockerid][locMP5][1]); } if(LockerInfo[lockerid][locM4][0]) { format(string, sizeof(string), "%sM4\t$%i\n", string, LockerInfo[lockerid][locM4][1]); } if(LockerInfo[lockerid][locSniper][0]) { format(string, sizeof(string), "%sSniper\t$%i\n", string, LockerInfo[lockerid][locSniper][1]); } if(LockerInfo[lockerid][locCamera][0]) { format(string, sizeof(string), "%sCamera\t$%i\n", string, LockerInfo[lockerid][locCamera][1]); } if(LockerInfo[lockerid][locFireExt][0]) { format(string, sizeof(string), "%sFire Extinguisher\t$%i\n", string, LockerInfo[lockerid][locFireExt][1]); } if(LockerInfo[lockerid][locPainKillers][0]) { format(string, sizeof(string), "%sPainkillers\t$%i\n", string, LockerInfo[lockerid][locPainKillers][1]); } ShowPlayerDialog(playerid, DIALOG_FACTIONEQUIPMENT, DIALOG_STYLE_TABLIST_HEADERS, "Locker", string, "Select", "Cancel"); } case DIALOG_CREATEQUIZ: { if(CreateQuiz == -1) { CreateQuiz = 0; ShowPlayerDialog(playerid, DIALOG_CREATEQUIZ, DIALOG_STYLE_INPUT, "Create A Quiz - Enter Question", "What should the question be? (displayed globally)", "Submit", "Back"); } if(CreateQuiz == 1) { ShowPlayerDialog(playerid, DIALOG_CREATEQUIZ, DIALOG_STYLE_INPUT, "Create A Quiz - Enter Answer", "What should the answer be? (displayed once answered)", "Submit", "Back"); } } case DIALOG_DELETEOBJECT: { format(string, sizeof(string), "Object %i selected\n{FFFFFF}Would you really like to {FF0000}delete{FFFFFF} it?", PlayerInfo[playerid][pSelected]); ShowPlayerDialog(playerid, DIALOG_DELETEOBJECT, DIALOG_STYLE_MSGBOX, "Delete Mode - Dynamic Object Selected", string, "Yes", "No"); } case DIALOG_ADDSTATION: { ShowPlayerDialog(playerid, DIALOG_ADDSTATION, DIALOG_STYLE_INPUT, "Radio Station Manager", "Enter the link of the station you'd like to add", "Add", "Cancel"); } } return 1; } /*GetArenaPlayers(arena) { new players; foreach(new i : Player) { if(PlayerInfo[i][pPaintball] == arena) { players++; } } return players; }*/ SetPlayerToSpawn(playerid) { if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) { SetSpawnInfo(playerid, NO_TEAM, PlayerInfo[playerid][pSkin], 820.5590, -1342.6283, 13.5216, 90.0000, 0, 0, 0, 0, 0, 0); TogglePlayerSpectating(playerid, 0); } else { if(IsPlayerInAnyVehicle(playerid)) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z + 5.0); } switch(GetPlayerState(playerid)) { case PLAYER_STATE_NONE, PLAYER_STATE_WASTED: { SpawnPlayer(playerid); } default: { OnPlayerSpawn(playerid); } } } PlayerInfo[playerid][pACTime] = gettime() + 2; } SetPlayerToFacePlayer(playerid, targetid) { new Float:px, Float:py, Float:pz, Float:tx, Float:ty, Float:tz; GetPlayerPos(targetid, tx, ty, tz); GetPlayerPos(playerid, px, py, pz); SetPlayerFacingAngle(playerid, 180.0 - atan2(px - tx, py - ty)); } forward SavePlayerVariables(playerid); public SavePlayerVariables(playerid) { if(PlayerInfo[playerid][pLogged] && !PlayerInfo[playerid][pAdminDuty] && !PlayerInfo[playerid][pUndercover][0]) { if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING && !IsPlayerInRangeOfPoint(playerid, 2.0, 0.0, 0.0, 0.0) && !PlayerInfo[playerid][pJoinedEvent] && !PlayerInfo[playerid][pAcceptedHelp] && PlayerInfo[playerid][pPreviewHouse] == -1) { SavePlayerWeapons(playerid); GetPlayerCameraPos(playerid, PlayerInfo[playerid][pCameraX], PlayerInfo[playerid][pCameraY], PlayerInfo[playerid][pCameraZ]); GetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]); GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPosA]); if(!PlayerInfo[playerid][pHHCheck]) { GetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]); GetPlayerArmour(playerid, PlayerInfo[playerid][pArmor]); } PlayerInfo[playerid][pInterior] = GetPlayerInterior(playerid); PlayerInfo[playerid][pWorld] = GetPlayerVirtualWorld(playerid); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET camera_x = '%f', camera_y = '%f', camera_z = '%f', pos_x = '%f', pos_y = '%f', pos_z = '%f', pos_a = '%f', interior = %i, world = %i, health = '%f', armor = '%f', minutes = %i, warnings = %i, injured = %i, hospital = %i, upgradepoints = %i, spawnhealth = '%f', spawnarmor = '%f', jailtype = %i, jailtime = %i WHERE uid = %i", PlayerInfo[playerid][pCameraX], PlayerInfo[playerid][pCameraY], PlayerInfo[playerid][pCameraZ], PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], PlayerInfo[playerid][pPosA], PlayerInfo[playerid][pInterior], PlayerInfo[playerid][pWorld], PlayerInfo[playerid][pHealth], PlayerInfo[playerid][pArmor], PlayerInfo[playerid][pMinutes], PlayerInfo[playerid][pWarnings], PlayerInfo[playerid][pInjured], PlayerInfo[playerid][pHospital], PlayerInfo[playerid][pUpgradePoints], PlayerInfo[playerid][pSpawnHealth], PlayerInfo[playerid][pSpawnArmor], PlayerInfo[playerid][pJailType], PlayerInfo[playerid][pJailTime], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET newbiemuted = %i, helpmuted = %i, admuted = %i, livemuted = %i, globalmuted = %i, reportmuted = %i, reportwarns = %i, fightstyle = %i, cookies = %i, toggletextdraws = %i, toggleooc = %i, togglephone = %i, toggleadmin = %i, togglehelper = %i, togglenewbie = %i, togglewt = %i, togglevip = %i, hunger = %i, thirst = %i WHERE uid = %i", PlayerInfo[playerid][pNewbieMuted], PlayerInfo[playerid][pHelpMuted], PlayerInfo[playerid][pAdMuted], PlayerInfo[playerid][pLiveMuted], PlayerInfo[playerid][pGlobalMuted], PlayerInfo[playerid][pReportMuted], PlayerInfo[playerid][pReportWarns], PlayerInfo[playerid][pFightStyle], PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pToggleTextdraws], PlayerInfo[playerid][pToggleOOC], PlayerInfo[playerid][pTogglePhone], PlayerInfo[playerid][pToggleAdmin], PlayerInfo[playerid][pToggleHelper], PlayerInfo[playerid][pToggleNewbie], PlayerInfo[playerid][pToggleWT], PlayerInfo[playerid][pToggleVIP], PlayerInfo[playerid][pHunger], PlayerInfo[playerid][pThirst], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET toggleradio = %i, togglemusic = %i, togglefaction = %i, togglenews = %i, toggleglobal = %i, togglecam = %i, togglehud = %i, weedtime = %i, weedgrams = %i, showturfs = %i, showlands = %i, watchon = %i, gpson = %i, couriercooldown = %i, pizzacooldown = %i, detectivecooldown = %i, thiefcooldown = %i, crackcooldown = %i, duty = %i, bandana = %i WHERE uid = %i", PlayerInfo[playerid][pToggleRadio], PlayerInfo[playerid][pToggleMusic], PlayerInfo[playerid][pToggleFaction], PlayerInfo[playerid][pToggleNews], PlayerInfo[playerid][pToggleGlobal], PlayerInfo[playerid][pToggleCam], PlayerInfo[playerid][pToggleHUD], PlayerInfo[playerid][pWeedTime], PlayerInfo[playerid][pWeedGrams], PlayerInfo[playerid][pShowTurfs], PlayerInfo[playerid][pShowLands], PlayerInfo[playerid][pWatchOn], PlayerInfo[playerid][pGPSOn], PlayerInfo[playerid][pCourierCooldown], PlayerInfo[playerid][pPizzaCooldown], PlayerInfo[playerid][pDetectiveCooldown], PlayerInfo[playerid][pThiefCooldown], PlayerInfo[playerid][pCocaineCooldown], PlayerInfo[playerid][pDuty], PlayerInfo[playerid][pBandana], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET togglereports = %i, togglewhisper = %i, togglebug = %i, newbiemutetime = %i, reportmutetime = %i, globalmutetime = %i, adminhide = %i, totalpatients = %i, totalfires = %i, scanneron = %i, rarecooldown = %i WHERE uid = %i", PlayerInfo[playerid][pToggleReports], PlayerInfo[playerid][pToggleWhisper], PlayerInfo[playerid][pToggleBug], PlayerInfo[playerid][pNewbieMuteTime], PlayerInfo[playerid][pReportMuteTime], PlayerInfo[playerid][pGlobalMuteTime], PlayerInfo[playerid][pAdminHide], PlayerInfo[playerid][pTotalPatients], PlayerInfo[playerid][pTotalFires], PlayerInfo[playerid][pScannerOn], PlayerInfo[playerid][pRareTime], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gunlicense = %i WHERE uid = %i", PlayerInfo[playerid][pGunLicense], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } } SavePlayerWeapons(playerid) { if(PlayerInfo[playerid][pLogged] && !PlayerInfo[playerid][pJoinedEvent]) { // Saving weapons. mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weapon_0 = %i, weapon_1 = %i, weapon_2 = %i, weapon_3 = %i, weapon_4 = %i, weapon_5 = %i, weapon_6 = %i, weapon_7 = %i, weapon_8 = %i, weapon_9 = %i, weapon_10 = %i, weapon_11 = %i, weapon_12 = %i WHERE uid = %i", PlayerInfo[playerid][pWeapons][0], PlayerInfo[playerid][pWeapons][1], PlayerInfo[playerid][pWeapons][2], PlayerInfo[playerid][pWeapons][3], PlayerInfo[playerid][pWeapons][4], PlayerInfo[playerid][pWeapons][5], PlayerInfo[playerid][pWeapons][6], PlayerInfo[playerid][pWeapons][7], PlayerInfo[playerid][pWeapons][8], PlayerInfo[playerid][pWeapons][9], PlayerInfo[playerid][pWeapons][10], PlayerInfo[playerid][pWeapons][11], PlayerInfo[playerid][pWeapons][12], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } } SendPaycheck(playerid) { // Paycheck amounts are temporary until a job system is put in place. PlayerInfo[playerid][pPaycheck] += min(PlayerInfo[playerid][pLevel], 21) * 750; new paycheck = PlayerInfo[playerid][pPaycheck]; new interest, rate; new tax = (paycheck / 100) * gTax; // gTax = tax new rent = 0, renting = -1; // temp new total = paycheck - tax; // If the player is a VIP, adjust his interest rate accordingly. if(PlayerInfo[playerid][pVIPPackage] == 0) { rate = 1; } if(PlayerInfo[playerid][pVIPPackage] == 1) { rate = 3; } if(PlayerInfo[playerid][pVIPPackage] == 2) { rate = 6; } if(PlayerInfo[playerid][pVIPPackage] == 3) { rate = 8; } //Calculate the interest due. interest = (PlayerInfo[playerid][pBank] / 1000) * rate; //If the calculated interest is above $25000, then we need to shut that shit down and set the interest to $25,000 to avoid the previous exploit. if(interest > 25000) { interest = 25000; } total += interest; if(PlayerInfo[playerid][pRentingHouse]) { foreach(new i : House) { if(HouseInfo[i][hExists] && HouseInfo[i][hID] == PlayerInfo[playerid][pRentingHouse] && HouseInfo[i][hRentPrice] > 0) { rent = HouseInfo[i][hRentPrice]; renting = i; } } } SendClientMessage(playerid, COLOR_NAVYBLUE, "_____________ Paycheck _______________"); SendClientMessageEx(playerid, COLOR_GREY2, "Paycheck: {33CC33}+%s", FormatNumber(paycheck)); if(PlayerInfo[playerid][pFaction] >= 0 && FactionInfo[PlayerInfo[playerid][pFaction]][fPaycheck][PlayerInfo[playerid][pFactionRank]] > 0) { SendClientMessageEx(playerid, COLOR_GREY2, "Faction Pay: {33CC33}+%s", FormatNumber(FactionInfo[PlayerInfo[playerid][pFaction]][fPaycheck][PlayerInfo[playerid][pFactionRank]])); total += FactionInfo[PlayerInfo[playerid][pFaction]][fPaycheck][PlayerInfo[playerid][pFactionRank]]; } SendClientMessageEx(playerid, COLOR_GREY2, "Interest: {33CC33}+%s {C8C8C8}(rate: %.1f) (max: $25,000)", FormatNumber(interest), floatdiv(float(rate), 10)); SendClientMessageEx(playerid, COLOR_GREY2, "Income Tax: {FF6347}-%s {C8C8C8}(%i percent)", FormatNumber(tax), gTax); if(renting != -1) { if(total >= rent || PlayerInfo[playerid][pBank] >= rent) { if(total >= rent) { total -= rent; } else { PlayerInfo[playerid][pBank] -= rent; } SendClientMessageEx(playerid, COLOR_GREY2, "Rent Paid: {FF6347}-%s", FormatNumber(rent)); HouseInfo[renting][hCash] += rent; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET cash = %i WHERE id = %i", HouseInfo[renting][hCash], HouseInfo[renting][hID]); mysql_tquery(connectionID, queryBuffer); } else { rent = -1; } } SendClientMessageEx(playerid, COLOR_GREY2, "Old Balance: %s", FormatNumber(PlayerInfo[playerid][pBank])); SendClientMessage(playerid, COLOR_NAVYBLUE, "______________________________________"); SendClientMessageEx(playerid, COLOR_GREY2, "New Balance: %s", FormatNumber(PlayerInfo[playerid][pBank] + total)); SendClientMessageEx(playerid, COLOR_AQUA, "You have played %i/25 minutes this hour and earned your paycheck.", PlayerInfo[playerid][pMinutes]); GameTextForPlayer(playerid, "~y~Payday~n~~w~Paycheck", 5000, 1); GiftAllowed = 1; if(rent == -1) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rentinghouse = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[playerid][pRentingHouse] = 0; SendClientMessage(playerid, COLOR_RED, "You couldn't afford to pay rent and were evicted as a result."); } AddToTaxVault(tax); if((gDoubleXP) || PlayerInfo[playerid][pDoubleXP] > 0) PlayerInfo[playerid][pEXP] += 2; else PlayerInfo[playerid][pEXP]++; if(PlayerInfo[playerid][pGang] >= 0) { GiveGangPoints(PlayerInfo[playerid][pGang], 1); } PlayerInfo[playerid][pHours]++; PlayerInfo[playerid][pBank] += total; PlayerInfo[playerid][pMinutes] = 0; PlayerInfo[playerid][pPaycheck] = 0; if(PlayerInfo[playerid][pWeaponRestricted] > 0) { PlayerInfo[playerid][pWeaponRestricted]--; } if((!gDoubleXP) && PlayerInfo[playerid][pDoubleXP] > 0) { PlayerInfo[playerid][pDoubleXP]--; if(PlayerInfo[playerid][pDoubleXP] > 0) SendClientMessageEx(playerid, COLOR_YELLOW, "Your double XP Cookie expires in %i more hours.", PlayerInfo[playerid][pDoubleXP]); else SendClientMessage(playerid, COLOR_YELLOW, "Your double XP cookie has expired."); } if(PlayerInfo[playerid][pHours] >= 20) { AwardAchievement(playerid, "Regular"); } if(PlayerInfo[playerid][pHours] >= 40) { AwardAchievement(playerid, "Addicted"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET minutes = 0, hours = hours + 1, exp = %i, bank = %i, paycheck = 0, weaponrestricted = %i, doublexp = %i WHERE uid = %i", PlayerInfo[playerid][pEXP], PlayerInfo[playerid][pBank], PlayerInfo[playerid][pWeaponRestricted], PlayerInfo[playerid][pDoubleXP], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); gTotalHours++; SaveServerInfo(); } HangupCall(playerid, reason) { new callerid = PlayerInfo[playerid][pCallLine]; if(reason == HANGUP_DROPPED) { SendClientMessage(playerid, COLOR_GREY, "The call has been dropped..."); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s presses a button and hangs up their mobile phone.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_GREY, "You hung up your phone and ended the call."); if(callerid != playerid) { SendClientMessage(callerid, COLOR_GREY, "They hung up their phone and ended the call."); } } if(callerid != playerid) { if(GetPlayerSpecialAction(callerid) == SPECIAL_ACTION_USECELLPHONE) { SetPlayerSpecialAction(callerid, SPECIAL_ACTION_STOPUSECELLPHONE); } PlayerInfo[callerid][pCallStage] = 0; PlayerInfo[callerid][pCallLine] = INVALID_PLAYER_ID; } if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USECELLPHONE) { SetPlayerSpecialAction(playerid, SPECIAL_ACTION_STOPUSECELLPHONE); } PlayerInfo[playerid][pCallStage] = 0; PlayerInfo[playerid][pCallLine] = INVALID_PLAYER_ID; } AddToTaxVault(amount) { gVault += amount; SaveServerInfo(); } SaveServerInfo() { new File:file = fopen("server_info.ini", io_write); if(file) { new string[255]; format(string, sizeof(string), "%i|%i|%i|%s|%s|%i|%i|%i|%i|%i|%i|%i|%i|%s|%s|%i|%i|%i|%i", gTax, gVault, gPlayerRecord, gRecordDate, gServerMOTD, gConnections, gTotalRegistered, gTotalKills, gTotalDeaths, gTotalHours, gAnticheatBans, gDoubleXP, RobberyInfo[rTime], adminMOTD, helperMOTD, MaxCapCount[0], MaxCapCount[1], gacooldown, gNewsVault); fwrite(file, string); fclose(file); } } LoadServerInfo() { new File:file = fopen("server_info.ini", io_read); if(file) { new string[255]; fread(file, string); sscanf(string, "p<|>iiis[24]s[128]iiiiiiiis[128]s[128]iiii", gTax, gVault, gPlayerRecord, gRecordDate, gServerMOTD, gConnections, gTotalRegistered, gTotalKills, gTotalDeaths, gTotalHours, gAnticheatBans, gDoubleXP, RobberyInfo[rTime], adminMOTD, helperMOTD, MaxCapCount[0], MaxCapCount[1], gacooldown, gNewsVault); fclose(file); } if(gTax == 0) { gTax = 10; } SetDoubleXP(gDoubleXP); } RefreshLoginScreen() { new string[80]; mysql_tquery(connectionID, "SELECT * FROM changes ORDER BY slot", "OnQueryFinished", "ii", THREAD_LOGIN_UPDATE, 1); mysql_tquery(connectionID, "SELECT username, hours FROM users WHERE hours > 0 ORDER BY hours DESC LIMIT 10", "OnQueryFinished", "ii", THREAD_LOGIN_UPDATE, 2); if(gPlayerRecord) { format(string, sizeof(string), "The player record count is %i, achieved on %s.", gPlayerRecord, gRecordDate); TextDrawSetString(LoginScreen[8], string); } else { TextDrawSetString(LoginScreen[8], "There is no record player count that has been recorded yet."); } } RefreshTime() { new hour, minute, string[12]; gettime(hour, minute); format(string, sizeof(string), "%02d:%02d", hour, minute); TextDrawSetString(TimeTD, string); } GetBankRobbers() { new count; for(new i = 0; i < MAX_BANK_ROBBERS; i ++) { if(RobberyInfo[rRobbers][i] != INVALID_PLAYER_ID) { count++; } } return count; } AddToBankRobbery(playerid) { for(new i = 0; i < MAX_BANK_ROBBERS; i ++) { if(RobberyInfo[rRobbers][i] == INVALID_PLAYER_ID) { RobberyInfo[rRobbers][i] = playerid; PlayerInfo[playerid][pRobCash] = 0; break; } } } RemoveFromBankRobbery(playerid) { for(new i = 0; i < MAX_BANK_ROBBERS; i ++) { if(RobberyInfo[rRobbers][i] == playerid) { RobberyInfo[rRobbers][i] = INVALID_PLAYER_ID; } } if(!GetBankRobbers()) { ResetRobbery(); } else if(RobberyInfo[rPlanning] && RobberyInfo[rRobbers][0] == INVALID_PLAYER_ID) { for(new i = 1; i < MAX_BANK_ROBBERS; i ++) { if(RobberyInfo[rRobbers][i] != INVALID_PLAYER_ID) { RobberyInfo[rRobbers][0] = RobberyInfo[rRobbers][i]; RobberyInfo[rRobbers][i] = INVALID_PLAYER_ID; SendClientMessageEx(RobberyInfo[rRobbers][0], COLOR_AQUA, "You are now the leader of this bank heist!"); break; } } } PlayerInfo[playerid][pRobCash] = 0; PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; RemovePlayerAttachedObject(playerid, 8); RemovePlayerAttachedObject(playerid, 9); PlayerPlaySound(playerid, 3402, 0.0, 0.0, 0.0); DisablePlayerCheckpoint(playerid); return 0; } IsPlayerInBankRobbery(playerid) { if(RobberyInfo[rPlanning] || RobberyInfo[rStarted]) { for(new i = 0; i < MAX_BANK_ROBBERS; i ++) { if(RobberyInfo[rRobbers][i] == playerid) { return 1; } } } return 0; } ResetEditing(playerid) { PlayerInfo[playerid][pEditRack] = -1; return 1; } ResetRobbery() { if(RobberyInfo[rStarted]) { SendClientMessageToAllEx(COLOR_AQUA, "Breaking News: The bank robbery is now finished. %s was stolen from the bank.", FormatNumber(RobberyInfo[rStolen])); } if(IsValidDynamicObject(RobberyInfo[rObjects][0])) { DestroyDynamicObject(RobberyInfo[rObjects][0]); } if(IsValidDynamicObject(RobberyInfo[rObjects][1])) { DestroyDynamicObject(RobberyInfo[rObjects][1]); } for(new i = 0; i < 5; i ++) { DestroyDynamic3DTextLabel(RobberyInfo[rText][i]); RobberyInfo[rText][i] = Text3D:INVALID_3DTEXT_ID; } for(new i = 0; i < MAX_BANK_ROBBERS; i ++) { RobberyInfo[rRobbers][i] = INVALID_PLAYER_ID; } RobberyInfo[rTime] = 8; RobberyInfo[rPlanning] = 0; RobberyInfo[rStarted] = 0; RobberyInfo[rStolen] = 0; RobberyInfo[rObjects][0] = CreateDynamicObject(19799, 1678.248901, -988.194702, 671.695007, 0.000000, 0.000000, 0.000000); RobberyInfo[rObjects][1] = INVALID_OBJECT_ID; } ResetEvent() { if(EventInfo[eReady] || EventInfo[eStarted]) { foreach(new i : Player) { if(PlayerInfo[i][pJoinedEvent]) { PlayerInfo[i][pJoinedEvent] = 0; SetPlayerToSpawn(i); } } } for(new i = 0; i < 5; i ++) { EventInfo[eWeapons][i] = 0; } EventInfo[eReady] = 0; EventInfo[eStarted] = 0; EventInfo[eLocked] = 0; EventInfo[eType] = 0; EventInfo[eJoinText] = 0; EventInfo[eHealth] = 100.0; EventInfo[eArmor] = 0.0; EventInfo[eInterior] = 0; EventInfo[eWorld] = 0; EventInfo[eNext] = 0; EventInfo[eCS] = 0; EventInfo[eQS] = 0; EventInfo[eHeal] = 0; for(new i = 0; i < 2; i ++) { EventInfo[ePosX][i] = 0.0; EventInfo[ePosY][i] = 0.0; EventInfo[ePosZ][i] = 0.0; EventInfo[ePosA][i] = 0.0; EventInfo[eSkin][i] = 0; } } PreloadPlayerAnims(playerid) { static const animLibraries[][] = { !"AIRPORT", !"ATTRACTORS", !"BAR", !"BASEBALL", !"BD_FIRE", !"BEACH", !"BENCHPRESS", !"BF_INJECTION", !"BIKED", !"BIKEH", !"BIKELEAP", !"BIKES", !"BIKEV", !"BIKE_DBZ", !"BMX", !"BOMBER", !"BOX", !"BSKTBALL", !"BUDDY", !"BUS", !"CAMERA", !"CAR", !"CARRY", !"CAR_CHAT", !"CASINO", !"CHAINSAW", !"CHOPPA", !"CLOTHES", !"COACH", !"COLT45", !"COP_AMBIENT", !"COP_DVBYZ", !"CRACK", !"CRIB", !"DAM_JUMP", !"DANCING", !"DEALER", !"DILDO", !"DODGE", !"DOZER", !"DRIVEBYS", !"FAT", !"FIGHT_B", !"FIGHT_C", !"FIGHT_D", !"FIGHT_E", !"FINALE", !"FINALE2", !"FLAME", !"FLOWERS", !"FOOD", !"FREEWEIGHTS", !"GANGS", !"GHANDS", !"GHETTO_DB", !"GOGGLES", !"GRAFFITI", !"GRAVEYARD", !"GRENADE", !"GYMNASIUM", !"HAIRCUTS", !"HEIST9", !"INT_HOUSE", !"INT_OFFICE", !"INT_SHOP", !"JST_BUISNESS", !"KART", !"KISSING", !"KNIFE", !"LAPDAN1", !"LAPDAN2", !"LAPDAN3", !"LOWRIDER", !"MD_CHASE", !"MD_END", !"MEDIC", !"MISC", !"MTB", !"MUSCULAR", !"NEVADA", !"ON_LOOKERS", !"OTB", !"PARACHUTE", !"PARK", !"PAULNMAC", !"PED", !"PLAYER_DVBYS", !"PLAYIDLES", !"POLICE", !"POOL", !"POOR", !"PYTHON", !"QUAD", !"QUAD_DBZ", !"RAPPING", !"RIFLE", !"RIOT", !"ROB_BANK", !"ROCKET", !"RUSTLER", !"RYDER", !"SCRATCHING", !"SHAMAL", !"SHOP", !"SHOTGUN", !"SILENCED", !"SKATE", !"SMOKING", !"SNIPER", !"SPRAYCAN", !"STRIP", !"SUNBATHE", !"SWAT", !"SWEET", !"SWIM", !"SWORD", !"TANK", !"TATTOOS", !"TEC", !"TRAIN", !"TRUCK", !"UZI", !"VAN", !"VENDING", !"VORTEX", !"WAYFARER", !"WEAPONS", !"WUZI", !"WOP", !"GFUNK", !"RUNNINGMAN", !"BLOWJOBZ", !"SAMP" }; for(new i = 0; i < sizeof(animLibraries); i ++) { ApplyAnimation(playerid, animLibraries[i], "null", 0.0, 0, 0, 0, 0, 0, 1); } } ApplyAnimationEx(playerid, animlib[], animname[], Float:fDelta, loop, lockx, locky, freeze, time) { ApplyAnimation(playerid, animlib, animname, fDelta, loop, lockx, locky, freeze, time, 1); if(loop > 0 || freeze > 0) { PlayerInfo[playerid][pLoopAnim] = 1; if(!PlayerInfo[playerid][pToggleTextdraws]) { TextDrawShowForPlayer(playerid, AnimationTD); } } } PlayerUseAnims(playerid) { if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT || GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pMiningTime] > 0 || PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pLootTime] > 0) { return 0; } return 1; } GetAvailableAttachedSlot(playerid) { for(new i = 0; i < 5; i ++) { if(!IsPlayerAttachedObjectSlotUsed(playerid, i)) { return i; } } return -1; } CancelTaxiRide(playerid) // playerid is the driver of the taxi. { new passengerid = PlayerInfo[playerid][pTaxiPassenger], bill = PlayerInfo[playerid][pTaxiBill], earned = PlayerInfo[playerid][pTaxiBill], string[20]; if(PlayerInfo[playerid][pLaborUpgrade] != 0) { earned += percent(earned, PlayerInfo[playerid][pLaborUpgrade]); } SendClientMessageEx(passengerid, COLOR_AQUA, "This ride costed you {FF6347}$%i{33CCFF}.", bill); SendClientMessageEx(playerid, COLOR_AQUA, "You earned {00AA00}$%i{33CCFF} on your paycheck for this ride.", earned); format(string, sizeof(string), "~r~-$%i", bill); GameTextForPlayer(passengerid, string, 5000, 1); format(string, sizeof(string), "~g~+$%i", earned); GameTextForPlayer(playerid, string, 5000, 1); GivePlayerCash(passengerid, -bill); AddToPaycheck(playerid, earned); PlayerInfo[playerid][pTaxiPassenger] = INVALID_PLAYER_ID; PlayerInfo[playerid][pTaxiBill] = 0; PlayerInfo[playerid][pTaxiTime] = 0; } SetFreezePos(playerid, Float:x, Float:y, Float:z) { if(PlayerInfo[playerid][pFreezeTimer] >= 0) { KillTimer(PlayerInfo[playerid][pFreezeTimer]); } PlayerInfo[playerid][pFreezeTimer] = SetTimerEx("UnfreezePlayer", 3000, false, "ifff", playerid, x, y, z); SetPlayerPos(playerid, x, y, z); TogglePlayerControllable(playerid, false); GameTextForPlayer(playerid, "~w~Loading objects...", 3000, 3); } IsPlayerChatActive(playerid) { foreach(new i : Player) { if(chattingWith[playerid]{i}) { return 1; } } return 0; } PlayerHasJob(playerid, job) { return (PlayerInfo[playerid][pJob] == job || PlayerInfo[playerid][pSecondJob] == job); } GetWeaponClipSize(weaponid) { switch(weaponid) { case 22, 23: return 17; case 26: return 2; case 24, 27: return 7; case 28, 31, 32: return 50; case 29, 30: return 30; } return 0; } ResetPlayerWeaponsEx(playerid) { ResetPlayerWeapons(playerid); SetPlayerArmedWeapon(playerid, 0); for(new i = 0; i < 13; i ++) { PlayerInfo[playerid][pWeapons][i] = 0; PlayerInfo[playerid][pTempWeapons][i] = 0; } PlayerInfo[playerid][pACTime] = gettime() + 2; } RemovePlayerWeapon(playerid, weaponid) { // Reset the player's weapons. ResetPlayerWeapons(playerid); // Set the armed slot to zero. SetPlayerArmedWeapon(playerid, 0); // Set the weapon in the slot to zero. PlayerInfo[playerid][pACTime] = gettime() + 2; PlayerInfo[playerid][pWeapons][weaponSlotIDs[weaponid]] = 0; PlayerInfo[playerid][pTempWeapons][weaponSlotIDs[weaponid]] = 0; // Set the player's weapons. SetPlayerWeapons(playerid); // Save them to prevent rollbacks. SavePlayerWeapons(playerid); } GivePlayerWeaponEx(playerid, weaponid, bool:temp = false) { if(1 <= weaponid <= 46) { if(temp) { PlayerInfo[playerid][pTempWeapons][weaponSlotIDs[weaponid]] = weaponid; GivePlayerWeapon(playerid, weaponid, 29999); } else { PlayerInfo[playerid][pWeapons][weaponSlotIDs[weaponid]] = weaponid; SetPlayerWeapons(playerid); } if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { SetPlayerArmedWeapon(playerid, 0); } else if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) { switch(weaponid) { case 22, 23, 25, 28..34: { SetPlayerArmedWeapon(playerid, weaponid); } default: { SetPlayerArmedWeapon(playerid, 0); } } } else { SetPlayerArmedWeapon(playerid, weaponid); } SavePlayerWeapons(playerid); PlayerInfo[playerid][pACTime] = gettime() + 2; } } GetScriptWeapon(playerid) { new weaponid = GetPlayerWeapon(playerid); if(PlayerHasWeapon(playerid, weaponid)) { return weaponid; } return 0; } PlayerHasWeapon(playerid, weaponid, bool:temp = false) { switch(weaponid) { case 0, 2, 40, 46: { return 1; } } if(weaponid == 23 && (PlayerInfo[playerid][pTazer] || (IsLawEnforcement(playerid) || GetFactionType(playerid) == FACTION_GOVERNMENT))) { return 1; } if((temp) && PlayerInfo[playerid][pTempWeapons][weaponSlotIDs[weaponid]] == weaponid) { return 1; } return PlayerInfo[playerid][pWeapons][weaponSlotIDs[weaponid]] == weaponid; } SetPlayerWeapons(playerid) { if(!PlayerInfo[playerid][pJoinedEvent] && !PlayerInfo[playerid][pJailType] && !PlayerInfo[playerid][pWeaponRestricted]) { new weaponid = GetPlayerWeapon(playerid); ResetPlayerWeapons(playerid); for(new i = 0; i < 13; i ++) { if(PlayerInfo[playerid][pWeapons][i] > 0) { if(i == 2 && PlayerInfo[playerid][pTazer]) { GivePlayerWeaponEx(playerid, 23, true); continue; } if(16 <= PlayerInfo[playerid][pWeapons][i] <= 18) GivePlayerWeapon(playerid, PlayerInfo[playerid][pWeapons][i], 1); else GivePlayerWeapon(playerid, PlayerInfo[playerid][pWeapons][i], 29999); } } switch(GetPlayerState(playerid)) { case PLAYER_STATE_DRIVER: { SetPlayerArmedWeapon(playerid, 0); } case PLAYER_STATE_PASSENGER: { switch(weaponid) { case 22, 23, 25, 28..34: { SetPlayerArmedWeapon(playerid, weaponid); } default: { SetPlayerArmedWeapon(playerid, 0); } } } default: { SetPlayerArmedWeapon(playerid, weaponid); } } } } SetPlayerClothing(playerid) { // Reset any clothing that the player has on them. for(new i = 0; i < MAX_PLAYER_CLOTHING; i ++) { if(ClothingInfo[playerid][i][cExists] && ClothingInfo[playerid][i][cAttached]) { RemovePlayerAttachedObject(playerid, ClothingInfo[playerid][i][cAttachedIndex]); } } // Now, we reapply the clothing to the player. for(new i = 0; i < MAX_PLAYER_CLOTHING; i ++) { if(ClothingInfo[playerid][i][cExists] && ClothingInfo[playerid][i][cAttached]) { if(ClothingInfo[playerid][i][cAttachedIndex] == -1) { ClothingInfo[playerid][i][cAttachedIndex] = GetAvailableAttachedSlot(playerid); } if(ClothingInfo[playerid][i][cAttachedIndex] >= 0) { SetPlayerAttachedObject(playerid, ClothingInfo[playerid][i][cAttachedIndex], ClothingInfo[playerid][i][cModel], ClothingInfo[playerid][i][cBone], ClothingInfo[playerid][i][cPosX], ClothingInfo[playerid][i][cPosY], ClothingInfo[playerid][i][cPosZ], ClothingInfo[playerid][i][cRotX], ClothingInfo[playerid][i][cRotY], ClothingInfo[playerid][i][cRotZ], ClothingInfo[playerid][i][cScaleX], ClothingInfo[playerid][i][cScaleY], ClothingInfo[playerid][i][cScaleZ]); } else { // Clothing wasn't attached... slots are probably all full. ClothingInfo[playerid][i][cAttached] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE clothing SET attached = 0 WHERE id = %i", ClothingInfo[playerid][i][cID]); mysql_tquery(connectionID, queryBuffer); } } } PlayerInfo[playerid][pAwaitingClothing] = 0; } /*SetPlayerInPaintball(playerid, type) { if(PlayerInfo[playerid][pPaintball] == 0) { SavePlayerVariables(playerid); ResetPlayerWeapons(playerid); } if(type == 1) { new rand = random(sizeof(paintballFSpawns)); SetPlayerPos(playerid, paintballFSpawns[rand][0], paintballFSpawns[rand][1], paintballFSpawns[rand][2]); SetPlayerFacingAngle(playerid, paintballFSpawns[rand][3]); SetPlayerInterior(playerid, 18); SetPlayerVirtualWorld(playerid, 1000); SetCameraBehindPlayer(playerid); SetPlayerHealth(playerid, 100.0); SetPlayerArmour(playerid, 100.0); GivePlayerWeaponEx(playerid, 24, true); GivePlayerWeaponEx(playerid, 27, true); GivePlayerWeaponEx(playerid, 29, true); GivePlayerWeaponEx(playerid, 31, true); GivePlayerWeaponEx(playerid, 34, true); PlayerInfo[playerid][pPaintball] = 1; } else if(type == 2) { SetPlayerPos(playerid, paintballTSpawns[pbNext][0], paintballTSpawns[pbNext][1], paintballTSpawns[pbNext][2]); SetPlayerFacingAngle(playerid, paintballTSpawns[pbNext][3]); SetPlayerInterior(playerid, 18); SetPlayerVirtualWorld(playerid, 1001); SetCameraBehindPlayer(playerid); SetPlayerHealth(playerid, 100.0); SetPlayerArmour(playerid, 100.0); GivePlayerWeaponEx(playerid, 24, true); GivePlayerWeaponEx(playerid, 27, true); GivePlayerWeaponEx(playerid, 29, true); GivePlayerWeaponEx(playerid, 31, true); GivePlayerWeaponEx(playerid, 34, true); PlayerInfo[playerid][pPaintball] = 2; PlayerInfo[playerid][pPaintballTeam] = pbNext; if(!pbNext) { pbNext = 1; } else { pbNext = 0; } } else if(type == 3) { new rand = random(sizeof(paintballDSpawns)); SetPlayerPos(playerid, paintballDSpawns[rand][0], paintballDSpawns[rand][1], paintballDSpawns[rand][2]); SetPlayerFacingAngle(playerid, paintballDSpawns[rand][3]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 1000); SetCameraBehindPlayer(playerid); GangZoneShowForPlayer(playerid, zone_paintball[0], 0xFFFF0096); SetPlayerHealth(playerid, 25.0); SetPlayerArmour(playerid, 0.0); GivePlayerWeaponEx(playerid, 24, true); PlayerInfo[playerid][pPaintball] = 3; } else if(type == 4) { new rand = random(sizeof(paintballSSpawns)); SetPlayerPos(playerid, paintballSSpawns[rand][0], paintballSSpawns[rand][1], paintballSSpawns[rand][2]); SetPlayerFacingAngle(playerid, paintballSSpawns[rand][3]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 1001); SetCameraBehindPlayer(playerid); GangZoneShowForPlayer(playerid, zone_paintball[1], 0xFFFF0096); SetPlayerHealth(playerid, 38.0); SetPlayerArmour(playerid, 0.0); GivePlayerWeaponEx(playerid, 34, true); PlayerInfo[playerid][pPaintball] = 4; } }*/ SetPlayerInEvent(playerid) { SavePlayerVariables(playerid); ResetPlayerWeapons(playerid); PlayerInfo[playerid][pJoinedEvent] = 1; PlayerInfo[playerid][pBandana] = 0; PlayerInfo[playerid][pDuty] = 0; if(EventInfo[eType] == 2) { PlayerInfo[playerid][pEventTeam] = EventInfo[eNext]; if(EventInfo[eNext] == RED_TEAM) { EventInfo[eNext] = BLUE_TEAM; } else { EventInfo[eNext] = RED_TEAM; } if(PlayerInfo[playerid][pEventTeam] == RED_TEAM) { GameTextForPlayer(playerid, "~w~You are on~n~~r~Red Team", 3000, 4); } else if(PlayerInfo[playerid][pEventTeam] == BLUE_TEAM) { GameTextForPlayer(playerid, "~w~You are on~n~~b~Blue Team", 3000, 6); } } else { PlayerInfo[playerid][pEventTeam] = 0; } for(new x = 0; x < 5; x ++) { if(EventInfo[eWeapons][x]) { GivePlayerWeaponEx(playerid, EventInfo[eWeapons][x], true); } } SetPlayerPos(playerid, EventInfo[ePosX][PlayerInfo[playerid][pEventTeam]], EventInfo[ePosY][PlayerInfo[playerid][pEventTeam]], EventInfo[ePosZ][PlayerInfo[playerid][pEventTeam]]); SetPlayerFacingAngle(playerid, EventInfo[ePosA][PlayerInfo[playerid][pEventTeam]]); SetPlayerInterior(playerid, EventInfo[eInterior]); SetPlayerVirtualWorld(playerid, EventInfo[eWorld]); SetPlayerHealth(playerid, EventInfo[eHealth]); SetPlayerArmour(playerid, EventInfo[eArmor]); SetCameraBehindPlayer(playerid); if(EventInfo[eSkin][PlayerInfo[playerid][pEventTeam]]) { SetPlayerSkin(playerid, EventInfo[eSkin][PlayerInfo[playerid][pEventTeam]]); } if(!isnull(EventInfo[eJoinText])) { GameTextForPlayer(playerid, EventInfo[eJoinText], 6000, 3); } if(EventInfo[eType] == 1 || EventInfo[eType] == 2) { SendClientMessageEx(playerid, COLOR_WHITE, "** Event rules: Crackshooting is %s, Quickswapping is %s, Healing is %s.", (EventInfo[eCS]) ? ("{FFD700}Allowed{FFFFFF}") : ("{FF6347}Not allowed{FFFFFF}"), (EventInfo[eQS]) ? ("{FFD700}Allowed{FFFFFF}") : ("{FF6347}Not allowed{FFFFFF}"), (EventInfo[eHeal]) ? ("{FFD700}Allowed{FFFFFF}") : ("{FF6347}Not allowed{FFFFFF}")); } return 1; } SetPlayerInHospital(playerid, time = 15, type = -1) { PlayerInfo[playerid][pHospitalType] = (type == -1) ? (random(2) + 1) : (type); PlayerInfo[playerid][pHospitalTime] = time; PlayerInfo[playerid][pHospital] = 1; TogglePlayerControllable(playerid, 0); SetPlayerDrunkLevel(playerid, 50000); GameTextForPlayer(playerid, "~w~Recovering...", 1500, 3); SetPlayerPos(playerid, -10.4534, 149.3639, 999.0613); SetPlayerCameraPos(playerid, -833.5241, -1358.8575, 86.9054); SetPlayerCameraLookAt(playerid, -830.8118, -1360.3612, 87.0289); //SetPlayerCameraLookAt(playerid, -830.8118, -1360.3612, 87.0289); SetPlayerInterior(playerid, 0); } SetPlayerInJail(playerid) { if(PlayerInfo[playerid][pCallLine] != INVALID_PLAYER_ID) { HangupCall(PlayerInfo[playerid][pCallLine], HANGUP_DROPPED); } if(PlayerInfo[playerid][pJailType] == 1) // OOC jail { switch(random(4)) { case 0: { SetPlayerPos(playerid, 227.4201, 110.0224, 999.0156); } case 1: { SetPlayerPos(playerid, 223.4770, 110.1765, 999.0156); } case 2: { SetPlayerPos(playerid, 219.4810, 110.4918, 999.0156); } case 3: { SetPlayerPos(playerid, 215.6093, 110.7171, 999.0156); } } SetPlayerFacingAngle(playerid, 0.0000); SetPlayerInterior(playerid, 10); SetPlayerVirtualWorld(playerid, 99999); SetCameraBehindPlayer(playerid); } else if(PlayerInfo[playerid][pJailType] == 2) // OOC prison { SetPlayerPos(playerid, -1132.9137, 856.5791, 3.0703); SetPlayerFacingAngle(playerid, 36.0000); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 99999); SetCameraBehindPlayer(playerid); } else if(PlayerInfo[playerid][pJailType] == 3) // IC prison { new index = random(sizeof(cellSpawns)); SetFreezePos(playerid, cellSpawns[index][0], cellSpawns[index][1], cellSpawns[index][2]); SetPlayerFacingAngle(playerid, cellSpawns[index][3]); SetPlayerInterior(playerid, 2); SetPlayerVirtualWorld(playerid, GetStaticEntranceWorld("Prison")); SetCameraBehindPlayer(playerid); } } NOPCheck(playerid) { new vehicleid = GetPlayerVehicleID(playerid); if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && gettime() - PlayerInfo[playerid][pLastUpdate] < 3 && PlayerInfo[playerid][pAdmin] < 2) { if((pizzaVehicles[0] <= vehicleid <= pizzaVehicles[5]) && !PlayerHasJob(playerid, JOB_PIZZAMAN)) { RemovePlayerFromVehicle(playerid); PlayerInfo[playerid][pNOPTime]++; } else if((courierVehicles[0] <= vehicleid <= courierVehicles[3]) && !PlayerHasJob(playerid, JOB_COURIER)) { RemovePlayerFromVehicle(playerid); PlayerInfo[playerid][pNOPTime]++; } else if((sweeperVehicles[0] <= vehicleid <= sweeperVehicles[3]) && !PlayerHasJob(playerid, JOB_SWEEPER)) { RemovePlayerFromVehicle(playerid); PlayerInfo[playerid][pNOPTime]++; } else if((taxiVehicles[0] <= vehicleid <= taxiVehicles[3]) && !PlayerHasJob(playerid, JOB_TAXIDRIVER)) { RemovePlayerFromVehicle(playerid); PlayerInfo[playerid][pNOPTime]++; } else if((garbageVehicles[0] <= vehicleid <= garbageVehicles[5]) && !PlayerHasJob(playerid, JOB_GARBAGEMAN)) { RemovePlayerFromVehicle(playerid); PlayerInfo[playerid][pNOPTime]++; } else if((testVehicles[0] <= vehicleid <= testVehicles[4]) && !PlayerInfo[playerid][pDrivingTest]) { RemovePlayerFromVehicle(playerid); PlayerInfo[playerid][pNOPTime]++; } else if(VehicleInfo[vehicleid][vFactionType] != FACTION_NONE && GetFactionType(playerid) != VehicleInfo[vehicleid][vFactionType]) { RemovePlayerFromVehicle(playerid); PlayerInfo[playerid][pNOPTime]++; } else if(VehicleInfo[vehicleid][vGang] >= 0 && PlayerInfo[playerid][pGang] != VehicleInfo[vehicleid][vGang]) { RemovePlayerFromVehicle(playerid); PlayerInfo[playerid][pNOPTime]++; } else if(VehicleInfo[vehicleid][vJob] >= 0 && PlayerInfo[playerid][pJob] != VehicleInfo[vehicleid][vJob]) { RemovePlayerFromVehicle(playerid); PlayerInfo[playerid][pNOPTime]++; } else if(PlayerInfo[playerid][pNOPTime] > 0) { PlayerInfo[playerid][pNOPTime]--; } if(PlayerInfo[playerid][pNOPTime] >= 15) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s was kicked for suspected NOP hacks.", GetPlayerRPName(playerid)); Log_Write("log_cheat", "%s (uid: %i) was kicked for suspected NOP hacks.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID]); KickPlayer(playerid); } } } AFKCheck(playerid) { new Float:x, Float:y, Float:z, Float:cx, Float:cy, Float:cz; GetPlayerPos(playerid, x, y, z); GetPlayerCameraPos(playerid, cx, cy, cz); if(PlayerInfo[playerid][pAFKPos][0] == x && PlayerInfo[playerid][pAFKPos][1] == y && PlayerInfo[playerid][pAFKPos][2] == z && PlayerInfo[playerid][pAFKPos][3] == cx && PlayerInfo[playerid][pAFKPos][4] == cy && PlayerInfo[playerid][pAFKPos][5] == cz) { PlayerInfo[playerid][pAFKTime]++; if(!PlayerInfo[playerid][pAFK] && PlayerInfo[playerid][pAFKTime] >= 60) { //SendClientMessage(playerid, COLOR_LIGHTORANGE, "** You are now marked as {00AA00}Away from keyboard{F7A763} as you haven't moved in one minute."); //SendClientMessage(playerid, COLOR_LIGHTRED, "SERVER: You have been marked as AFK as you haven't moved in one minute."); PlayerInfo[playerid][pAFK] = 1; } } else { if(PlayerInfo[playerid][pAFK]) { if(PlayerInfo[playerid][pAFKTime] < 120) { //SendClientMessageEx(playerid, COLOR_LIGHTORANGE, "** You are no longer marked as Away from Keyboard after %i seconds.", PlayerInfo[playerid][pAFKTime]); //SendClientMessageEx(playerid, COLOR_LIGHTRED, "SERVER: You are no longer marked as AFK after %i seconds.", PlayerInfo[playerid][pAFKTime]); } else { //SendClientMessageEx(playerid, COLOR_LIGHTORANGE, "** You are no longer marked as Away from Keyboard after %i minutes.", PlayerInfo[playerid][pAFKTime] / 60); //SendClientMessageEx(playerid, COLOR_LIGHTRED, "SERVER: You are no longer marked as AFK after %i minutes.", PlayerInfo[playerid][pAFKTime] / 60); } PlayerInfo[playerid][pAFK] = 0; } PlayerInfo[playerid][pAFKTime] = 0; } PlayerInfo[playerid][pAFKPos][0] = x; PlayerInfo[playerid][pAFKPos][1] = y; PlayerInfo[playerid][pAFKPos][2] = z; PlayerInfo[playerid][pAFKPos][3] = cx; PlayerInfo[playerid][pAFKPos][4] = cy; PlayerInfo[playerid][pAFKPos][5] = cz; } TeleportToVehicle(playerid, vehicleid) { new Float:x, Float:y, Float:z, Float:a, interior, garageid; GetVehiclePos(vehicleid, x, y, z); GetVehicleZAngle(vehicleid, a); if((garageid = GetVehicleGarage(vehicleid)) >= 0) { interior = garageInteriors[GarageInfo[garageid][gType]][intID]; } TeleportToCoords(playerid, x + 1, y + 1, z + 1, a, interior, GetVehicleVirtualWorld(vehicleid)); } TeleportToPlayer(playerid, targetid, bool:vehicle = true) { new Float:x, Float:y, Float:z, Float:a; GetPlayerPos(targetid, x, y, z); GetPlayerFacingAngle(targetid, a); TeleportToCoords(playerid, x + 1, y + 1, z, a, GetPlayerInterior(targetid), GetPlayerVirtualWorld(targetid), .vehicle = vehicle); } TeleportToCoords(playerid, Float:x, Float:y, Float:z, Float:angle, interiorid, worldid, bool:freeze = false, bool:vehicle = true) { new vehicleid = GetPlayerVehicleID(playerid); if((vehicle) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { foreach(new i : Player) { if(IsPlayerInVehicle(i, vehicleid)) { SetPlayerInterior(i, interiorid); SetPlayerVirtualWorld(i, worldid); } } SetVehiclePos(vehicleid, x, y, z); SetVehicleZAngle(vehicleid, angle); SetVehicleVirtualWorld(vehicleid, worldid); LinkVehicleToInterior(vehicleid, interiorid); } else { SetPlayerPos(playerid, x, y, z); SetPlayerFacingAngle(playerid, angle); SetPlayerInterior(playerid, interiorid); SetPlayerVirtualWorld(playerid, worldid); SetCameraBehindPlayer(playerid); } if((freeze) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { SetTimerEx("VehicleUnfreeze", 3000, false, "iifffii", playerid, GetPlayerVehicleID(playerid), x, y, z, interiorid, worldid); GameTextForPlayer(playerid, "~w~Loading objects...", 3000, 3); TogglePlayerControllable(playerid, 0); } new houseid; if((houseid = GetInsideHouse(playerid)) >= 0) { if(HouseInfo[houseid][hLights] == 1) { TextDrawHideForPlayer(playerid, houseLights); } else { TextDrawShowForPlayer(playerid, houseLights); } } } ShowLandsOnMap(playerid, enable) { foreach(new i : Land) { if(LandInfo[i][lExists]) { if(enable) { GangZoneShowForPlayer(playerid, LandInfo[i][lGangZone], (LandInfo[i][lOwnerID] > 0) ? (0xFF6347AA) : (0x33CC33AA)); } else { GangZoneHideForPlayer(playerid, LandInfo[i][lGangZone]); } } } PlayerInfo[playerid][pShowLands] = enable; } ShowTurfsOnMap(playerid, enable) { foreach(new i : Turf) { if(TurfInfo[i][tExists]) { if(enable) { GangZoneShowForPlayer(playerid, TurfInfo[i][tGangZone], GetTurfColor(i)); if(TurfInfo[i][tCapturer] == INVALID_PLAYER_ID) { GangZoneStopFlashForPlayer(playerid, TurfInfo[i][tGangZone]); } else { if(IsLawEnforcement(TurfInfo[i][tCapturer])) GangZoneFlashForPlayer(playerid, TurfInfo[i][tGangZone], 0x8D8DFF00); else if(PlayerInfo[TurfInfo[i][tCapturer]][pGang] >= 0) GangZoneFlashForPlayer(playerid, TurfInfo[i][tGangZone], (GangInfo[PlayerInfo[TurfInfo[i][tCapturer]][pGang]][gColor] & ~0xff) + 0xAA); } } else { GangZoneHideForPlayer(playerid, TurfInfo[i][tGangZone]); } } } PlayerInfo[playerid][pShowTurfs] = enable; } /*ShowTurfsOnMap(playerid, enable) { foreach(new i : Turf) { if(TurfInfo[i][tExists]) { if(enable) { GangZoneShowForPlayer(playerid, TurfInfo[i][tGangZone], GetTurfColor(i)); if(TurfInfo[i][tCapturer] == INVALID_PLAYER_ID) { GangZoneStopFlashForPlayer(playerid, TurfInfo[i][tGangZone]); } else { if(PlayerInfo[TurfInfo[i][tCapturer]][pGang] == -1 && IsLawEnforcement(TurfInfo[i][tCapturer])) GangZoneFlashForPlayer(playerid, TurfInfo[i][tGangZone], 0x000000AA); else if(PlayerInfo[TurfInfo[i][tCapturer]][pGang] >= 0) GangZoneFlashForPlayer(playerid, TurfInfo[i][tGangZone], (GangInfo[PlayerInfo[TurfInfo[i][tCapturer]][pGang]][gColor] & ~0xff) + 0xAA); } } else { GangZoneHideForPlayer(playerid, TurfInfo[i][tGangZone]); } } } PlayerInfo[playerid][pShowTurfs] = enable; }*/ CancelZoneCreation(playerid) { for(new i = 0; i < 4; i ++) { DestroyDynamicPickup(PlayerInfo[playerid][pZonePickups][i]); PlayerInfo[playerid][pZonePickups][i] = -1; } GangZoneDestroy(PlayerInfo[playerid][pZoneID]); PlayerInfo[playerid][pZoneID] = -1; PlayerInfo[playerid][pZoneCreation] = 0; PlayerInfo[playerid][pMinX] = 0.0; PlayerInfo[playerid][pMinY] = 0.0; PlayerInfo[playerid][pMaxX] = 0.0; PlayerInfo[playerid][pMaxY] = 0.0; } ResetCooking(playerid) { PlayerInfo[playerid][pCookMeth] = 0; PlayerInfo[playerid][pCookGrams] = 0; PlayerInfo[playerid][pCookTime] = 0; } ResetPlayer(playerid) { if(PlayerInfo[playerid][pJoinedEvent]) { SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); ResetPlayerWeapons(playerid); PlayerInfo[playerid][pJoinedEvent] = 0; } /*if(PlayerInfo[playerid][pPaintball] > 0) { ResetPlayerWeapons(playerid); PlayerInfo[playerid][pPaintball] = 0; PlayerInfo[playerid][pPaintballTeam] = -1; }*/ if(PlayerInfo[playerid][pHospital]) { GameTextForPlayer(playerid, " ", 100, 3); PlayerInfo[playerid][pHospital] = 0; PlayerInfo[playerid][pHospitalTime] = 0; } if(PlayerInfo[playerid][pMiningTime] > 0) { ClearAnimations(playerid, 1); } if(PlayerInfo[playerid][pTazedTime] > 0) { ClearAnimations(playerid, 1); TogglePlayerControllable(playerid, 1); } if(PlayerInfo[playerid][pCuffed]) { TogglePlayerControllable(playerid, 1); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE); } if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY) { SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE); } if(PlayerInfo[playerid][pLiveBroadcast] != INVALID_PLAYER_ID) { PlayerInfo[PlayerInfo[playerid][pLiveBroadcast]][pLiveBroadcast] = INVALID_PLAYER_ID; PlayerInfo[playerid][pLiveBroadcast] = INVALID_PLAYER_ID; } if(PlayerInfo[playerid][pPlantedBomb]) { DestroyDynamicObject(PlayerInfo[playerid][pBombObject]); PlayerInfo[playerid][pBombObject] = INVALID_OBJECT_ID; PlayerInfo[playerid][pPlantedBomb] = 0; } if(PlayerInfo[playerid][pFreezeTimer] >= 0) { KillTimer(PlayerInfo[playerid][pFreezeTimer]); TogglePlayerControllable(playerid, 1); PlayerInfo[playerid][pFreezeTimer] = -1; } /*if(PlayerInfo[playerid][pDueling] != INVALID_PLAYER_ID) { PlayerInfo[PlayerInfo[playerid][pDueling]][pDueling] = INVALID_PLAYER_ID; PlayerInfo[playerid][pDueling] = INVALID_PLAYER_ID; }*/ if(RobberyInfo[rPlanning] || RobberyInfo[rStarted]) { RemoveFromBankRobbery(playerid); } foreach(new i : Player) { if(PlayerInfo[i][pDraggedBy] == playerid) { PlayerInfo[i][pDraggedBy] = INVALID_PLAYER_ID; } } PlayerInfo[playerid][pLoseReason] = -1; if(PlayerInfo[playerid][pLoseReason] == REASON_HUNGER || PlayerInfo[playerid][pLoseReason] == REASON_ALL || PlayerInfo[playerid][pLoseReason] == REASON_THIRST) KillTimer(PlayerInfo[playerid][pLoseHealth]); PlayerInfo[playerid][pInformed] = false; PlayerInfo[playerid][pInjured] = 0; PlayerInfo[playerid][pAcceptedHelp] = 0; PlayerInfo[playerid][pMiningTime] = 0; PlayerInfo[playerid][pMiningRock] = 0; PlayerInfo[playerid][pSweeping] = 0; PlayerInfo[playerid][pGraffiti] = -1; PlayerInfo[playerid][pGraffitiTime] = 0; PlayerInfo[playerid][pSweepTime] = 0; PlayerInfo[playerid][pSweepEarnings] = 0; PlayerInfo[playerid][pTazer] = 0; PlayerInfo[playerid][pTazedTime] = 0; PlayerInfo[playerid][pCuffed] = 0; PlayerInfo[playerid][pTied] = 0; PlayerInfo[playerid][pDraggedBy] = INVALID_PLAYER_ID; PlayerInfo[playerid][pDelivered] = 0; PlayerInfo[playerid][pContractTaken] = INVALID_PLAYER_ID; PlayerInfo[playerid][pPoisonTime] = 0; PlayerInfo[playerid][pCapturingPoint] = -1; PlayerInfo[playerid][pCaptureTime] = 0; PlayerInfo[playerid][pCocaineTrunk] = INVALID_VEHICLE_ID; PlayerInfo[playerid][pPreviewHouse] = -1; PlayerInfo[playerid][pPreviewType] = 0; PlayerInfo[playerid][pPreviewTime] = 0; PlayerInfo[playerid][pHHCheck] = 0; CancelActiveCheckpoint(playerid); CancelBreakIn(playerid); RemovePlayerAttachedObject(playerid, 9); } CancelBreakIn(playerid) { if(PlayerInfo[playerid][pLockBreak] != INVALID_VEHICLE_ID) { new damage[4]; SetVehicleParams(PlayerInfo[playerid][pLockBreak], VEHICLE_ALARM, false); GetVehicleDamageStatus(PlayerInfo[playerid][pLockBreak], damage[0], damage[1], damage[2], damage[3]); UpdateVehicleDamageStatus(PlayerInfo[playerid][pLockBreak], damage[0], 0, damage[2], damage[3]); DestroyDynamic3DTextLabel(PlayerInfo[playerid][pLockText]); KillTimer(PlayerInfo[playerid][pLockTimer]); PlayerInfo[playerid][pLockText] = Text3D:INVALID_3DTEXT_ID; PlayerInfo[playerid][pLockBreak] = INVALID_VEHICLE_ID; } } forward garbagewait(playerid); public garbagewait(playerid) { GameTextForPlayer(playerid, "Garbage Loaded....~n~Proceed to the next checkpoint.", 5000, 3); TogglePlayerControllable(playerid, 1); } CancelActiveCheckpoint(playerid) { if(PlayerInfo[playerid][pDrivingTest]) { SetVehicleToRespawn(PlayerInfo[playerid][pTestVehicle]); } if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY) { SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE); RemovePlayerAttachedObject(playerid, 9); } DisablePlayerCheckpoint(playerid); PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; PlayerInfo[playerid][pPizzas] = 0; PlayerInfo[playerid][pSmuggleMats] = 0; PlayerInfo[playerid][pSmuggleDrugs] = 0; PlayerInfo[playerid][pDrivingTest] = 0; PlayerInfo[playerid][pTestVehicle] = INVALID_VEHICLE_ID; PlayerInfo[playerid][pTestCP] = 0; PlayerInfo[playerid][pMiningRock] = 0; PlayerInfo[playerid][pShipment] = -1; PlayerInfo[playerid][pGarbage] = 0; } ReferralCheck(playerid) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT username, ip FROM users WHERE uid = %i", PlayerInfo[playerid][pReferralUID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_REWARD_REFERRER, playerid); } PlayLoginMusic(playerid) { new File:file = fopen("login.txt", io_read); if(file) { new url[128]; fread(file, url); fclose(file); PlayAudioStreamForPlayer(playerid, url); } } AwardAchievement(playerid, const name[]) { for(new i = 0; i < sizeof(achievementInfo); i ++) { if(!strcmp(achievementInfo[i][aName], name)) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT IGNORE INTO achievements(uid, achievement) VALUES(%i, '%e')", PlayerInfo[playerid][pID], name); mysql_tquery(connectionID, queryBuffer, "OnPlayerAchievementCheck", "is", playerid, name); return 1; } } return 0; } SetPlayerSpecialTag(playerid, type) { new string[128]; if(IsValidDynamic3DTextLabel(PlayerInfo[playerid][pSpecialTag])) { DestroyDynamic3DTextLabel(PlayerInfo[playerid][pSpecialTag]); PlayerInfo[playerid][pSpecialTag] = Text3D:INVALID_3DTEXT_ID; } foreach(new i : Player) { if(type == TAG_NONE) ShowPlayerNameTagForPlayer(i, playerid, 1); else ShowPlayerNameTagForPlayer(i, playerid, 0); } switch(type) { case TAG_ADMIN: { if(!strcmp(PlayerInfo[playerid][pAdminName], "None", true)) format(string, sizeof(string), "%s\n{089DCE}ECRP Administrator\n{FF6347}%s", GetPlayerNameEx(playerid), GetAdminRank(playerid)); else format(string, sizeof(string), "%s\n{089DCE}ECRP Administrator\n{FF6347}%s", PlayerInfo[playerid][pAdminName], GetAdminRank(playerid)); if(strlen(GetAdminDivisionFull(playerid)) > 0) { format(string, sizeof(string), "%s\n{00C2E0}%s", string, GetAdminDivisionFull(playerid)); } PlayerInfo[playerid][pSpecialTag] = CreateDynamic3DTextLabel(string, COLOR_WHITE, 0.0, 0.0, 0.2, 20.0, .attachedplayer = playerid, .testlos = 1); } case TAG_HELPER: { format(string, sizeof(string), "%s\n{089DCE}Helper Assisting\n{00FF00}%s", GetPlayerRPName(playerid), GetHelperRank(playerid)); PlayerInfo[playerid][pSpecialTag] = CreateDynamic3DTextLabel(string, COLOR_WHITE, 0.0, 0.0, 0.2, 20.0, .attachedplayer = playerid, .testlos = 1); } case TAG_VIP: { format(string, sizeof(string), "%s\n{D909D9}Very Important Player\n{33CC33}%s VIP", GetPlayerRPName(playerid), GetVIPRank(PlayerInfo[playerid][pVIPPackage])); PlayerInfo[playerid][pSpecialTag] = CreateDynamic3DTextLabel(string, COLOR_WHITE, 0.0, 0.0, 0.2, 20.0, .attachedplayer = playerid, .testlos = 1); } } PlayerInfo[playerid][pTagType] = type; } SendNewbieChatMessage(playerid, text[]) { new string[64]; if((!isnull(PlayerInfo[playerid][pCustomTitle]) && strcmp(PlayerInfo[playerid][pCustomTitle], "None", true) != 0) && PlayerInfo[playerid][pAdminHide] == 0) { new color; if(PlayerInfo[playerid][pCustomTColor] == -1 || PlayerInfo[playerid][pCustomTColor] == -256) { color = 0xC8C8C8FF; } else { color = PlayerInfo[playerid][pCustomTColor]; } format(string, sizeof(string), "{%06x}%s{7DAEFF} %s", color >>> 8, PlayerInfo[playerid][pCustomTitle], GetPlayerRPName(playerid)); } else if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdminHide] == 0) { format(string, sizeof(string), "{FF6347}%s{7DAEFF} %s", GetAdminRank(playerid), GetPlayerRPName(playerid)); } else if(PlayerInfo[playerid][pHelper] > 0) { format(string, sizeof(string), "%s %s", GetHelperRank(playerid), GetPlayerRPName(playerid)); } else if(PlayerInfo[playerid][pFormerAdmin]) { format(string, sizeof(string), "{FF69B5}Former Admin{7DAEFF} %s", GetPlayerRPName(playerid)); } else if(PlayerInfo[playerid][pVIPPackage] > 0) { format(string, sizeof(string), "{D909D9}%s VIP{7DAEFF} %s", GetVIPRank(PlayerInfo[playerid][pVIPPackage]), GetPlayerRPName(playerid)); } else if(PlayerInfo[playerid][pLevel] > 1) { format(string, sizeof(string), "Player %s", GetPlayerRPName(playerid)); } else if(PlayerInfo[playerid][pHours] > 250) { format(string, sizeof(string), "ECRP Veteran: %s", GetPlayerRPName(playerid)); } else { format(string, sizeof(string), "Newbie %s", GetPlayerRPName(playerid)); } foreach(new i : Player) { if(!PlayerInfo[i][pToggleNewbie]) { if(strlen(text) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_NEWBIE, "** %s: %.*s...", string, MAX_SPLIT_LENGTH, text); SendClientMessageEx(i, COLOR_NEWBIE, "** %s: ...%s", string, text[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_NEWBIE, "** %s: %s", string, text); } } } if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pHelper] == 0) { PlayerInfo[playerid][pLastNewbie] = gettime(); } } ShowCopClothingMenu(playerid) { new models[sizeof(copClothing)]; for(new i = 0; i < sizeof(copClothing); i ++) { models[i] = copClothing[i][cModel]; } ShowPlayerSelectionMenu(playerid, MODEL_SELECTION_COPCLOTHING, "LEO Clothing", models, sizeof(models)); } #if defined SERVER_INTRO ShowServerIntro(playerid) { if(!PlayerInfo[playerid][pWatchingIntro]) { TogglePlayerSpectating(playerid, 1); TogglePlayerControllable(playerid, 0); PlayAudioStreamForPlayer(playerid, "http://music.theroleplay.com/gtav.mp3"); SetPlayerVirtualWorld(playerid, playerid); SetPlayerPos(playerid, 155.3337, -1776.4384, 14.8978+5.0); SetPlayerCameraPos(playerid, 155.3337, -1776.4384, 14.8978); SetPlayerCameraLookAt(playerid, 156.2734, -1776.0850, 14.2128); InterpolateCameraLookAt(playerid, 156.2734, -1776.0850, 14.2128, 156.2713, -1776.0797, 14.7078, 5000, CAMERA_MOVE); TextDrawShowForPlayer(playerid, introTextdraws[0]); TextDrawShowForPlayer(playerid, introTextdraws[1]); TextDrawShowForPlayer(playerid, introTextdraws[2]); SetTimerEx("StreamNextStep", 4500, false, "ii", playerid, 0); SetTimerEx("ShowLoginScreenTextdraw", 2400, false, "ii", playerid, 1); PlayerInfo[playerid][pWatchingIntro] = 1; } } #endif /*ShowTutorialTextDraws(playerid) { TextDrawShowForPlayer(playerid, Tutorial[0]); TextDrawShowForPlayer(playerid, Tutorial[1]); TextDrawShowForPlayer(playerid, Tutorial[2]); }*/ HideTutorialTextDraws(playerid) { TextDrawHideForPlayer(playerid, Tutorial[0]); TextDrawHideForPlayer(playerid, Tutorial[1]); TextDrawHideForPlayer(playerid, Tutorial[2]); } SellWeapon(playerid, targetid, weaponid, price = 0) { new cost; switch(weaponid) { case 2, 5..8, 10, 14, 15: cost = 50; case 22: cost = 100; case 23: cost = 150; case 24: cost = 2000; case 25: cost = 200; case 28, 32: cost = 500; case 29: cost = 1000; case 30: cost = 3500; case 31: cost = 4500; case 33: cost = 1000; case 27: cost = 7500; case 34: cost = 7500; } if((weaponid == 27 || weaponid == 34) && PlayerInfo[playerid][pVIPPackage] == 3) { cost = 5000; } if(PlayerInfo[playerid][pMaterials] >= cost) { PlayerInfo[playerid][pMaterials] -= cost; PlayerInfo[playerid][pLastSell] = gettime(); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(targetid == playerid) { SendClientMessageEx(playerid, COLOR_AQUA, "You have crafted yourself a {FF6347}%s{33CCFF}.", GetWeaponNameEx(weaponid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s puts together some materials and crafts themselves a %s.", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid)); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s puts together some materials and crafts a %s for %s.", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid), GetPlayerRPName(targetid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have sold %s a {FF6347}%s{33CCFF} for {00AA00}%s{33CCFF}.", GetPlayerRPName(targetid), GetWeaponNameEx(weaponid), FormatNumber(price)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has sold you a {FF6347}%s{33CCFF} for {00AA00}%s{33CCFF}.", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid), FormatNumber(price)); GivePlayerCash(playerid, price); GivePlayerCash(targetid, -price); } if(weaponid >= 22) { IncreaseJobSkill(playerid, JOB_WEAPONDEALER); } GivePlayerWeaponEx(targetid, weaponid); return 1; } else { SendClientMessage(targetid, COLOR_GREY, "That player has ran out of materials."); } return 0; } Namechange(playerid, oldname[], newname[]) { if(!PlayerInfo[playerid][pUndercover][0]) { foreach(new i : House) { if(HouseInfo[i][hExists] && !strcmp(HouseInfo[i][hOwner], oldname, false)) { strcpy(HouseInfo[i][hOwner], newname, MAX_PLAYER_NAME); ReloadHouse(i); } } foreach(new i : Garage) { if(GarageInfo[i][gExists] && !strcmp(GarageInfo[i][gOwner], oldname, false)) { strcpy(GarageInfo[i][gOwner], newname, MAX_PLAYER_NAME); ReloadGarage(i); } } foreach(new i : Business) { if(BusinessInfo[i][bExists] && !strcmp(BusinessInfo[i][bOwner], oldname, false)) { strcpy(BusinessInfo[i][bOwner], newname, MAX_PLAYER_NAME); ReloadBusiness(i); } } foreach(new i : Land) { if(LandInfo[i][lExists] && !strcmp(LandInfo[i][lOwner], oldname, false)) { strcpy(LandInfo[i][lOwner], newname, MAX_PLAYER_NAME); ReloadLand(i); } } foreach(new i: Vehicle) { if(VehicleInfo[i][vID] && !strcmp(VehicleInfo[i][vOwner], oldname, false)) { strcpy(VehicleInfo[i][vOwner], newname, MAX_PLAYER_NAME); } } // Updating queries. mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET owner = '%s' WHERE owner = '%s'", newname, oldname); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET owner = '%s' WHERE owner = '%s'", newname, oldname); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET owner = '%s' WHERE owner = '%s'", newname, oldname); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET owner = '%s' WHERE owner = '%s'", newname, oldname); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE lands SET owner = '%s' WHERE owner = '%s'", newname, oldname); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET username = '%s' WHERE uid = %i", newname, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); strcpy(PlayerInfo[playerid][pUsername], newname, MAX_PLAYER_NAME); SetPlayerName(playerid, newname); SavePlayerVariables(playerid); } } IsAPlane(vehicleid) { switch(GetVehicleModel(vehicleid)) { case 460, 464, 476, 511..513, 519, 520, 553, 577, 592, 593: return 1; } return 0; } IsAHelicopter(vehicleid) { switch(GetVehicleModel(vehicleid)) { case 417, 425, 447, 465, 469, 487, 488, 497, 501, 548, 563: return 1; } return 0; } IsABoat(vehicleid) { switch(GetVehicleModel(vehicleid)) { case 430, 446, 452..454, 472, 473, 484, 493, 595: return 1; } return 0; } IsSurfVehicle(vehicleid) { switch(GetVehicleModel(vehicleid)) { case 406, 408, 422, 430, 432, 433, 441, 444, 446, 452..455, 460, 464, 470, 472, 473, 476, 478, 481, 484, 490, 493, 509..513, 519, 520, 528, 537, 538, 543, 553, 554, 556, 557, 569, 570, 577, 578, 590, 592..595, 600, 605, 607, 608: return 1; } return 0; } VehicleHasDoors(vehicleid) { switch (GetVehicleModel(vehicleid)) { case 400..424, 426..429, 431..440, 442..445, 451, 455, 456, 458, 459, 466, 467, 470, 474, 475, 477..480, 482, 483, 486, 489, 490..492, 494..496, 498..500, 502..508, 514..518, 524..529, 533..536, 540..547, 549..552, 554..562, 565..568, 573, 575, 576, 578..580, 582, 585, 587..589, 596..605, 609: return 1; } return 0; } IsEmergencyFaction(playerid) { switch(GetFactionType(playerid)) { case FACTION_POLICE, FACTION_FEDERAL, FACTION_MEDIC, FACTION_ARMY: return 1; } return 0; } IsLawEnforcement(playerid) { return GetFactionType(playerid) == FACTION_POLICE || GetFactionType(playerid) == FACTION_FEDERAL || GetFactionType(playerid) == FACTION_ARMY; } IsPlayerBeingFound(playerid) { foreach(new i : Player) { if(PlayerInfo[i][pFindPlayer] == playerid && PlayerInfo[i][pFindTime] > 0) { return 1; } } return 0; } IsGateModel(modelid) { switch(modelid) { case 8957, 7891, 3037, 19861, 19864, 19912, 971, 975, 980, 985, 19870, 988: { return 1; } } return 0; } IsGateObject(objectid) { new modelid = Streamer_GetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_MODEL_ID); if((modelid) && IsGateModel(modelid)) { return 1; } return 0; } IsDoorObject(objectid) { new modelid = Streamer_GetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_MODEL_ID); if((modelid) && !IsGateObject(objectid)) { for(new i = 0; i < sizeof(furnitureArray); i ++) { if(!strcmp(furnitureArray[i][fCategory], "Doors & Gates") && furnitureArray[i][fModel] == modelid) { return 1; } } } return 0; } RemoveFaction(factionid) { foreach(new i : Player) { if(PlayerInfo[i][pFaction] == factionid) { SetPlayerFaction(i, -1); SendClientMessageEx(i, COLOR_LIGHTRED, "The faction you were apart of has been deleted by an administrator."); } } DestroyDynamic3DTextLabel(FactionInfo[factionid][fText]); DestroyDynamicPickup(FactionInfo[factionid][fPickup]); FactionInfo[factionid][fName] = 0; FactionInfo[factionid][fLeader] = 0; FactionInfo[factionid][fType] = FACTION_NONE; FactionInfo[factionid][fColor] = 0; FactionInfo[factionid][fRankCount] = 0; FactionInfo[factionid][fTurfcookies] = 0; FactionInfo[factionid][fText] = Text3D:INVALID_3DTEXT_ID; FactionInfo[factionid][fPickup] = -1; for(new i = 0; i < MAX_FACTION_RANKS; i ++) { strcpy(FactionRanks[factionid][i], "Unspecified", 32); FactionInfo[factionid][fPaycheck][i] = 0; } for(new i = 0; i < MAX_FACTION_DIVISIONS; i ++) { FactionDivisions[factionid][i][0] = 0; } for(new i = 0; i < MAX_LOCKERS; i ++) { if(LockerInfo[i][lExists] && LockerInfo[i][lFaction] == factionid) { DestroyDynamic3DTextLabel(LockerInfo[i][lText]); DestroyDynamicPickup(LockerInfo[i][lPickup]); LockerInfo[i][lExists] = 0; } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM factions WHERE id = %i", factionid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM factionranks WHERE id = %i", factionid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM factionskins WHERE id = %i", factionid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM factionpay WHERE id = %i", factionid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM divisions WHERE id = %i", factionid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM factionlockers WHERE factionid = %i", factionid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET faction = -1, factionrank = 0, factionleader = 0, division = -1 WHERE faction = %i", factionid); mysql_tquery(connectionID, queryBuffer); } GetFactionSkinCount(factionid) { new count; for(new i = 0; i < MAX_FACTION_SKINS; i ++) { if(FactionInfo[factionid][fSkins][i] != 0) { count++; } } return count; } GetTotalFactionPay(factionid) { new amount; for(new i = 0; i < FactionInfo[factionid][fRankCount]; i ++) { amount += FactionInfo[factionid][fPaycheck][i]; } return amount; } GetFactionType(playerid) { if(PlayerInfo[playerid][pFaction] >= 0) { return FactionInfo[PlayerInfo[playerid][pFaction]][fType]; } return FACTION_NONE; } SetPlayerFaction(playerid, factionid, rank = 0, leader = 0) { // This needed its own function because I got fed up of having to put "[pFaction] = -1" everywhere. if(factionid == -1) { if(PlayerInfo[playerid][pFaction] >= 0) { SetScriptSkin(playerid, 230); ResetPlayerWeaponsEx(playerid); } PlayerInfo[playerid][pFaction] = -1; PlayerInfo[playerid][pFactionRank] = 0; PlayerInfo[playerid][pFactionLeader] = 0; PlayerInfo[playerid][pDivision] = -1; PlayerInfo[playerid][pDuty] = 0; PlayerInfo[playerid][pTazer] = 0; } else if((0 <= factionid < MAX_FACTIONS) && FactionInfo[factionid][fType] != FACTION_NONE) { if(PlayerInfo[playerid][pFaction] >= 0 && factionid != PlayerInfo[playerid][pFaction]) { PlayerInfo[playerid][pDivision] = -1; } PlayerInfo[playerid][pFaction] = factionid; PlayerInfo[playerid][pFactionRank] = rank; PlayerInfo[playerid][pFactionLeader] = leader; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET faction = %i, factionrank = %i, division = %i, factionleader = %i WHERE uid = %i", PlayerInfo[playerid][pFaction], PlayerInfo[playerid][pFactionRank], PlayerInfo[playerid][pDivision], PlayerInfo[playerid][pFactionLeader], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } SetupFaction(factionid, name[], type) { strcpy(FactionInfo[factionid][fName], name, 48); strcpy(FactionInfo[factionid][fShortName], "None", 24); strcpy(FactionInfo[factionid][fMOTD], "None", 128); strcpy(FactionInfo[factionid][fLeader], "No-one", MAX_PLAYER_NAME); FactionInfo[factionid][fType] = type; FactionInfo[factionid][fColor] = 0xFFFFFF00; FactionInfo[factionid][fRankCount] = 6; FactionInfo[factionid][fTurfcookies] = 0; FactionInfo[factionid][fText] = Text3D:INVALID_3DTEXT_ID; FactionInfo[factionid][fPickup] = -1; for(new i = 0; i < MAX_FACTION_RANKS; i ++) { strcpy(FactionRanks[factionid][i], "Unspecified", 32); FactionInfo[factionid][fPaycheck][i] = 0; } for(new i = 0; i < MAX_FACTION_SKINS; i ++) { FactionInfo[factionid][fSkins][i] = 0; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO factions (id, name, type) VALUES(%i, '%e', %i)", factionid, name, type); mysql_tquery(connectionID, queryBuffer); } IsPlayerInRangeOfLocker(playerid, factionid) { new lockerid; if((lockerid = GetNearbyLocker(playerid)) >= 0 && LockerInfo[lockerid][lFaction] == factionid) { return 1; } return 0; } GetNearbyLocation(playerid, Float:radii) { for(new i = 0; i < MAX_LOCATIONS; i ++) { if(LocationInfo[i][locExists] && IsPlayerInRangeOfPoint(playerid, radii, LocationInfo[i][locPosX], LocationInfo[i][locPosY], LocationInfo[i][locPosZ]) && GetPlayerInterior(playerid) == 0 && GetPlayerVirtualWorld(playerid) == 0) { return i; } } return -1; } GetNearbyAtm(playerid) { for(new i = 0; i < MAX_ATMS; i ++) { if(AtmInfo[i][aExists] && IsPlayerInRangeOfPoint(playerid, 3.0, AtmInfo[i][aPosX], AtmInfo[i][aPosY], AtmInfo[i][aPosZ])) { return i; } } return -1; } GetNearbyLocker(playerid) { for(new i = 0; i < MAX_LOCKERS; i ++) { if(LockerInfo[i][lExists] && IsPlayerInRangeOfPoint(playerid, 3.0, LockerInfo[i][lPosX], LockerInfo[i][lPosY], LockerInfo[i][lPosZ])) { return i; } } return -1; } ReloadLockers(factionid) { for(new i = 0; i < MAX_LOCKERS; i ++) { if(LockerInfo[i][lExists] && LockerInfo[i][lFaction] == factionid) { ReloadLocker(i); } } } ReloadLocker(lockerid) { if(LockerInfo[lockerid][lExists]) { DestroyDynamic3DTextLabel(LockerInfo[lockerid][lText]); DestroyDynamicPickup(LockerInfo[lockerid][lPickup]); if(LockerInfo[lockerid][lLabel]) { new string[128]; format(string, sizeof(string), "%s\nLocker access\n/locker to access locker.", FactionInfo[LockerInfo[lockerid][lFaction]][fName]); LockerInfo[lockerid][lText] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, LockerInfo[lockerid][lPosX], LockerInfo[lockerid][lPosY], LockerInfo[lockerid][lPosZ], 10.0, .worldid = LockerInfo[lockerid][lWorld], .interiorid = LockerInfo[lockerid][lInterior]); } LockerInfo[lockerid][lPickup] = CreateDynamicPickup(LockerInfo[lockerid][lIcon], 1, LockerInfo[lockerid][lPosX], LockerInfo[lockerid][lPosY], LockerInfo[lockerid][lPosZ], .worldid = LockerInfo[lockerid][lWorld], .interiorid = LockerInfo[lockerid][lInterior]); } } ReloadAtm(atmid) { if(AtmInfo[atmid][aExists]) { DestroyDynamic3DTextLabel(AtmInfo[atmid][aText]); DestroyDynamicObject(AtmInfo[atmid][aObject]); AtmInfo[atmid][aText] = CreateDynamic3DTextLabel("ATM machine\n/atm to operate.", COLOR_YELLOW, AtmInfo[atmid][aPosX], AtmInfo[atmid][aPosY], AtmInfo[atmid][aPosZ] + 0.4, 10.0); AtmInfo[atmid][aObject] = CreateDynamicObject(19324, AtmInfo[atmid][aPosX], AtmInfo[atmid][aPosY], AtmInfo[atmid][aPosZ], 0.0, 0.0, AtmInfo[atmid][aPosA]); } } SetupGang(gangid, name[]) { strcpy(GangInfo[gangid][gName], name, 32); strcpy(GangInfo[gangid][gMOTD], "None", 128); strcpy(GangInfo[gangid][gLeader], "No-one", MAX_PLAYER_NAME); GangInfo[gangid][gSetup] = 1; GangInfo[gangid][gColor] = 0xFFFFFF00; GangInfo[gangid][gStrikes] = 0; GangInfo[gangid][gLevel] = 1; GangInfo[gangid][gPoints] = 0; GangInfo[gangid][gTurfcookies] = 0; GangInfo[gangid][gStashX] = 0.0; GangInfo[gangid][gStashY] = 0.0; GangInfo[gangid][gStashZ] = 0.0; GangInfo[gangid][gStashInterior] = 0; GangInfo[gangid][gStashWorld] = 0; GangInfo[gangid][gCash] = 0; GangInfo[gangid][gMaterials] = 0; GangInfo[gangid][gWeed] = 0; GangInfo[gangid][gCocaine] = 0; GangInfo[gangid][gMeth] = 0; GangInfo[gangid][gPainkillers] = 0; GangInfo[gangid][gArmsDealer] = 0; GangInfo[gangid][gDrugDealer] = 0; GangInfo[gangid][gArmsX] = 0.0; GangInfo[gangid][gArmsY] = 0.0; GangInfo[gangid][gArmsZ] = 0.0; GangInfo[gangid][gDrugX] = 0.0; GangInfo[gangid][gDrugY] = 0.0; GangInfo[gangid][gDrugZ] = 0.0; GangInfo[gangid][gArmsWorld] = 0; GangInfo[gangid][gDrugWorld] = 0; GangInfo[gangid][gDrugWeed] = 0; GangInfo[gangid][gDrugCocaine] = 0; GangInfo[gangid][gDrugMeth] = 0; GangInfo[gangid][gArmsMaterials] = 0; GangInfo[gangid][gAlliance] = -1; GangInfo[gangid][gPickup] = -1; GangInfo[gangid][gActors][0] = INVALID_ACTOR_ID; GangInfo[gangid][gActors][1] = INVALID_ACTOR_ID; GangInfo[gangid][gText][0] = Text3D:INVALID_3DTEXT_ID; GangInfo[gangid][gText][1] = Text3D:INVALID_3DTEXT_ID; GangInfo[gangid][gText][2] = Text3D:INVALID_3DTEXT_ID; GangInfo[gangid][gWeaponRanks][GANGWEAPON_9MM] = 1; GangInfo[gangid][gWeaponRanks][GANGWEAPON_SDPISTOL] = 1; GangInfo[gangid][gWeaponRanks][GANGWEAPON_DEAGLE] = 2; GangInfo[gangid][gWeaponRanks][GANGWEAPON_SHOTGUN] = 1; GangInfo[gangid][gWeaponRanks][GANGWEAPON_SAWNOFF] = 4; GangInfo[gangid][gWeaponRanks][GANGWEAPON_TEC9] = 1; GangInfo[gangid][gWeaponRanks][GANGWEAPON_UZI] = 1; GangInfo[gangid][gWeaponRanks][GANGWEAPON_MP5] = 2; GangInfo[gangid][gWeaponRanks][GANGWEAPON_AK47] = 3; GangInfo[gangid][gWeaponRanks][GANGWEAPON_M4] = 4; GangInfo[gangid][gWeaponRanks][GANGWEAPON_RIFLE] = 2; GangInfo[gangid][gWeaponRanks][GANGWEAPON_SNIPER] = 5; GangInfo[gangid][gWeaponRanks][GANGWEAPON_MOLOTOV] = 5; for(new i = 0; i < 7; i ++) { strcpy(GangRanks[gangid][i], "Unspecified", 32); } for(new i = 0; i < 12; i ++) { if(i < 3) { GangInfo[gangid][gDrugPrices][i] = 0; } GangInfo[gangid][gArmsPrices][i] = 0; } for(new i = 0; i < MAX_GANG_SKINS; i ++) { GangInfo[gangid][gSkins][i] = 0; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO gangs (id, name) VALUES(%i, '%e')", gangid, name); mysql_tquery(connectionID, queryBuffer); } GetNearbyPoint(playerid, Float:radius = 3.0) { for(new i = 0; i < MAX_POINTS; i ++) { if(PointInfo[i][pExists] && IsPlayerInRangeOfPoint(playerid, radius, PointInfo[i][pPointX], PointInfo[i][pPointY], PointInfo[i][pPointZ]) && GetPlayerInterior(playerid) == PointInfo[i][pPointInterior] && GetPlayerVirtualWorld(playerid) == PointInfo[i][pPointWorld]) { return i; } } return -1; } AddPointMoney(type, amount) { for(new i = 0; i < MAX_POINTS; i ++) { if(PointInfo[i][pExists] && PointInfo[i][pType] == type) { if(PointInfo[i][pCapturedGang] >= 0) { amount /= 2; GangInfo[PointInfo[i][pCapturedGang]][gCash] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET cash = %i WHERE id = %i", GangInfo[PointInfo[i][pCapturedGang]][gCash], PointInfo[i][pCapturedGang]); mysql_tquery(connectionID, queryBuffer); } PointInfo[i][pProfits] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET profits = %i WHERE id = %i", PointInfo[i][pProfits], i); mysql_tquery(connectionID, queryBuffer); } } } ReloadPoint(pointid) { if(PointInfo[pointid][pExists]) { new string[128], name[32] = "None"; DestroyDynamic3DTextLabel(PointInfo[pointid][pText]); DestroyDynamicPickup(PointInfo[pointid][pPickup]); if(PointInfo[pointid][pCapturedGang] >= 0) { strcpy(name, GangInfo[PointInfo[pointid][pCapturedGang]][gName]); } if(PointInfo[pointid][pTime] > 0) format(string, sizeof(string), "%s\nOwned by: %s\nAvailable in %i hours.", PointInfo[pointid][pName], name, PointInfo[pointid][pTime]); else format(string, sizeof(string), "%s\nOwned by: %s\nAvailable to capture!", PointInfo[pointid][pName], name); PointInfo[pointid][pText] = CreateDynamic3DTextLabel(string, COLOR_YELLOW, PointInfo[pointid][pPointX], PointInfo[pointid][pPointY], PointInfo[pointid][pPointZ], 10.0, .worldid = PointInfo[pointid][pPointWorld], .interiorid = PointInfo[pointid][pPointInterior]); PointInfo[pointid][pPickup] = CreateDynamicPickup(19132, 1, PointInfo[pointid][pPointX], PointInfo[pointid][pPointY], PointInfo[pointid][pPointZ], .worldid = PointInfo[pointid][pPointWorld], .interiorid = PointInfo[pointid][pPointInterior]); } } ReloadGang(gangid) { if(GangInfo[gangid][gSetup]) { new string[128], color; DestroyDynamic3DTextLabel(GangInfo[gangid][gText][0]); DestroyDynamic3DTextLabel(GangInfo[gangid][gText][1]); DestroyDynamic3DTextLabel(GangInfo[gangid][gText][2]); DestroyDynamicPickup(GangInfo[gangid][gPickup]); DestroyActor(GangInfo[gangid][gActors][0]); DestroyActor(GangInfo[gangid][gActors][1]); if(GangInfo[gangid][gColor] == -1 || GangInfo[gangid][gColor] == -256) { color = 0xC8C8C8FF; } else { color = GangInfo[gangid][gColor]; } if(GangInfo[gangid][gStashX] != 0.0 && GangInfo[gangid][gStashY] != 0.0 && GangInfo[gangid][gStashZ] != 0.0) { format(string, sizeof(string), "Level %i Gang Stash\n{%06x}%s{C8C8C8}", GangInfo[gangid][gLevel], color >>> 8, GangInfo[gangid][gName]); GangInfo[gangid][gText][0] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, GangInfo[gangid][gStashX], GangInfo[gangid][gStashY], GangInfo[gangid][gStashZ], 10.0, .worldid = GangInfo[gangid][gStashWorld], .interiorid = GangInfo[gangid][gStashInterior]); GangInfo[gangid][gPickup] = CreateDynamicPickup(19132, 1, GangInfo[gangid][gStashX], GangInfo[gangid][gStashY], GangInfo[gangid][gStashZ], .worldid = GangInfo[gangid][gStashWorld], .interiorid = GangInfo[gangid][gStashInterior]); } if(GangInfo[gangid][gArmsDealer] && GangInfo[gangid][gArmsX] != 0.0 && GangInfo[gangid][gArmsY] != 0.0 && GangInfo[gangid][gArmsZ] != 0.0) { format(string, sizeof(string), "%s\nArms Dealer\n/armsdealer for more info.", GangInfo[gangid][gName]); GangInfo[gangid][gActors][0] = CreateActor(179, GangInfo[gangid][gArmsX], GangInfo[gangid][gArmsY], GangInfo[gangid][gArmsZ], GangInfo[gangid][gArmsA]); GangInfo[gangid][gText][1] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, GangInfo[gangid][gArmsX], GangInfo[gangid][gArmsY], GangInfo[gangid][gArmsZ] + 0.3, 10.0, .worldid = GangInfo[gangid][gArmsWorld]); SetActorVirtualWorld(GangInfo[gangid][gActors][0], GangInfo[gangid][gArmsWorld]); } if(GangInfo[gangid][gDrugDealer] && GangInfo[gangid][gDrugX] != 0.0 && GangInfo[gangid][gDrugY] != 0.0 && GangInfo[gangid][gDrugZ] != 0.0) { format(string, sizeof(string), "%s\nDrug Dealer\n/drugdealer for more info.", GangInfo[gangid][gName]); GangInfo[gangid][gActors][1] = CreateActor(28, GangInfo[gangid][gDrugX], GangInfo[gangid][gDrugY], GangInfo[gangid][gDrugZ], GangInfo[gangid][gDrugA]); GangInfo[gangid][gText][2] = CreateDynamic3DTextLabel(string, COLOR_ORANGE, GangInfo[gangid][gDrugX], GangInfo[gangid][gDrugY], GangInfo[gangid][gDrugZ] + 0.3, 10.0, .worldid = GangInfo[gangid][gDrugWorld]); SetActorVirtualWorld(GangInfo[gangid][gActors][1], GangInfo[gangid][gDrugWorld]); } } } GiveGangPoints(gangid, amount) { if(GangInfo[gangid][gSetup]) { GangInfo[gangid][gPoints] = GangInfo[gangid][gPoints] + amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET points = %i WHERE id = %i", GangInfo[gangid][gPoints], gangid); mysql_tquery(connectionID, queryBuffer); } } RemoveGang(gangid) { if(GangInfo[gangid][gAlliance] >= 0) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET alliance = -1 WHERE id = %i", gangid); mysql_tquery(connectionID, queryBuffer); GangInfo[GangInfo[gangid][gAlliance]][gAlliance] = -1; } foreach(new i : Player) { if(PlayerInfo[i][pGang] == gangid) { SendClientMessageEx(i, COLOR_LIGHTRED, "The gang you were apart of has been deleted by an administrator."); PlayerInfo[i][pGang] = -1; PlayerInfo[i][pGangRank] = 0; } } for(new i = 0; i < MAX_GANG_CREWS; i ++) { GangCrews[gangid][i][0] = 0; } DestroyDynamic3DTextLabel(GangInfo[gangid][gText][0]); DestroyDynamic3DTextLabel(GangInfo[gangid][gText][1]); DestroyDynamic3DTextLabel(GangInfo[gangid][gText][2]); DestroyDynamicPickup(GangInfo[gangid][gPickup]); DestroyActor(GangInfo[gangid][gActors][0]); DestroyActor(GangInfo[gangid][gActors][1]); GangInfo[gangid][gSetup] = 0; GangInfo[gangid][gName] = 0; GangInfo[gangid][gMOTD] = 0; GangInfo[gangid][gLeader] = 0; GangInfo[gangid][gColor] = 0; GangInfo[gangid][gStrikes] = 0; GangInfo[gangid][gLevel] = 0; GangInfo[gangid][gPoints] = 0; GangInfo[gangid][gTurfcookies] = 0; GangInfo[gangid][gStashX] = 0.0; GangInfo[gangid][gStashY] = 0.0; GangInfo[gangid][gStashZ] = 0.0; GangInfo[gangid][gStashInterior] = 0; GangInfo[gangid][gStashWorld] = 0; GangInfo[gangid][gCash] = 0; GangInfo[gangid][gMaterials] = 0; GangInfo[gangid][gWeed] = 0; GangInfo[gangid][gCocaine] = 0; GangInfo[gangid][gMeth] = 0; GangInfo[gangid][gPainkillers] = 0; GangInfo[gangid][gArmsDealer] = 0; GangInfo[gangid][gDrugDealer] = 0; GangInfo[gangid][gArmsX] = 0.0; GangInfo[gangid][gArmsY] = 0.0; GangInfo[gangid][gArmsZ] = 0.0; GangInfo[gangid][gDrugX] = 0.0; GangInfo[gangid][gDrugY] = 0.0; GangInfo[gangid][gDrugZ] = 0.0; GangInfo[gangid][gArmsWorld] = 0; GangInfo[gangid][gDrugWorld] = 0; GangInfo[gangid][gDrugWeed] = 0; GangInfo[gangid][gDrugCocaine] = 0; GangInfo[gangid][gDrugMeth] = 0; GangInfo[gangid][gArmsMaterials] = 0; GangInfo[gangid][gPickup] = -1; GangInfo[gangid][gActors][0] = INVALID_ACTOR_ID; GangInfo[gangid][gActors][1] = INVALID_ACTOR_ID; GangInfo[gangid][gText][0] = Text3D:INVALID_3DTEXT_ID; GangInfo[gangid][gText][1] = Text3D:INVALID_3DTEXT_ID; GangInfo[gangid][gText][2] = Text3D:INVALID_3DTEXT_ID; GangInfo[gangid][gAlliance] = -1; for(new i = 0; i < 7; i ++) { strcpy(GangRanks[gangid][i], "Unspecified", 32); } for(new i = 0; i < 14; i ++) { GangInfo[gangid][gWeapons][i] = 0; } for(new i = 0; i < MAX_GANG_SKINS; i ++) { GangInfo[gangid][gSkins][i] = 0; } for(new i = 0; i < MAX_POINTS; i ++) { if(PointInfo[i][pExists] && PointInfo[i][pCapturedGang] == gangid) { PointInfo[i][pCapturedGang] = -1; } } foreach(new i : Turf) { if(TurfInfo[i][tExists] && TurfInfo[i][tCapturedGang] == gangid) { TurfInfo[i][tCapturedGang] = -1; } } foreach(new i : Vehicle) { if(VehicleInfo[i][vID] > 0 && VehicleInfo[i][vGang] == gangid) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM vehicles WHERE id = %i", VehicleInfo[i][vID]); mysql_tquery(connectionID, queryBuffer); DespawnVehicle(i, false); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM gangs WHERE id = %i", gangid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM gangranks WHERE id = %i", gangid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM gangskins WHERE id = %i", gangid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM crews WHERE id = %i", gangid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET capturedgang = -1 WHERE capturedgang = %i", gangid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE turfs SET capturedgang = -1 WHERE capturedgang = %i", gangid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gang = -1, gangrank = 0 WHERE gang = %i", gangid); mysql_tquery(connectionID, queryBuffer); } GetGangVehicles(gangid) { new count; foreach(new i: Vehicle) { if(VehicleInfo[i][vID] > 0 && VehicleInfo[i][vGang] == gangid) { count++; } } return count; } GetGangVehicleLimit(gangid) { switch(GangInfo[gangid][gLevel]) { case 1: return 6; case 2: return 8; case 3: return 12; } return 0; } GetGangMemberLimit(gangid) { switch(GangInfo[gangid][gLevel]) { case 1: return 30; case 2: return 60; case 3: return 80; } return 0; } GetGangSkinCount(gangid) { new count; for(new i = 0; i < MAX_GANG_SKINS; i ++) { if(GangInfo[gangid][gSkins][i] != 0) { count++; } } return count; } GetSpawnedVehicles(playerid) { new count; foreach(new i: Vehicle) { if(IsVehicleOwner(playerid, i)) { count++; } } return count; } GetVehicleGarage(vehicleid) { foreach(new i : Garage) { if(GarageInfo[i][gExists] && GarageInfo[i][gWorld] == GetVehicleVirtualWorld(vehicleid)) { return i; } } return -1; } ResetVehicleObjects(vehicleid) { if(IsValidDynamicObject(vehicleSiren[vehicleid])) { DestroyDynamicObject(vehicleSiren[vehicleid]); vehicleSiren[vehicleid] = INVALID_OBJECT_ID; } if(IsValidDynamic3DTextLabel(vehicleCallsign[vehicleid])) { DestroyDynamic3DTextLabel(vehicleCallsign[vehicleid]); vehicleCallsign[vehicleid] = Text3D:INVALID_3DTEXT_ID; } if(VehicleInfo[vehicleid][vNeonEnabled]) { if(IsValidDynamicObject(VehicleInfo[vehicleid][vObjects][0])) { DestroyDynamicObject(VehicleInfo[vehicleid][vObjects][0]); VehicleInfo[vehicleid][vObjects][0] = INVALID_OBJECT_ID; } if(IsValidDynamicObject(VehicleInfo[vehicleid][vObjects][1])) { DestroyDynamicObject(VehicleInfo[vehicleid][vObjects][1]); VehicleInfo[vehicleid][vObjects][1] = INVALID_OBJECT_ID; } } adminVehicle{vehicleid} = false; } DestroyVehicleEx(vehicleid) { if(IsValidVehicle(vehicleid)) { ResetVehicleObjects(vehicleid); } return DestroyVehicle(vehicleid); } GetNearbyVehicle(playerid) { new Float:x, Float:y, Float:z; foreach(new i: Vehicle) { if(IsVehicleStreamedIn(i, playerid)) { GetVehiclePos(i, x, y, z); if(IsPlayerInRangeOfPoint(playerid, 3.5, x, y, z)) { return i; } } } return INVALID_VEHICLE_ID; } GetVehicleRelativePos(vehicleid, &Float:x, &Float:y, &Float:z, Float:xoff= 0.0, Float:yoff= 0.0, Float:zoff= 0.0) { new Float:rot; GetVehicleZAngle(vehicleid, rot); rot = 360 - rot; GetVehiclePos(vehicleid, x, y, z); x = floatsin(rot, degrees) * yoff + floatcos(rot, degrees) * xoff + x; y = floatcos(rot, degrees) * yoff - floatsin(rot, degrees) * xoff + y; z = zoff + z; } IsPlayerAtVehicleDoor(playerid, vehicleid, type) { new Float:vx, Float:vy, Float:vz, Float:va, Float:x, Float:y, Float:z, Float:a; GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_FRONTSEAT, x, y, z); if(type == DOOR_DRIVER) { GetVehicleRelativePos(vehicleid, vx, vy, vz, -x * 2, y, z); } else { GetVehicleRelativePos(vehicleid, vx, vy, vz, x * 2, y, z); } GetPlayerFacingAngle(playerid, a); GetVehicleZAngle(vehicleid, va); if(IsPlayerInRangeOfPoint(playerid, 1.0, vx, vy, vz)) { return 1; } return 0; } GetVehicleBoot(vehicleid, &Float:x, &Float:y, &Float:z) { if(IsValidVehicle(vehicleid)) { new Float:pos[7]; GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, pos[0], pos[1], pos[2]); GetVehiclePos(vehicleid, pos[3], pos[4], pos[5]); GetVehicleZAngle(vehicleid, pos[6]); x = pos[3] - (floatsqroot(pos[1] + pos[1]) * floatsin(-pos[6], degrees)); y = pos[4] - (floatsqroot(pos[1] + pos[1]) * floatcos(-pos[6], degrees)); z = pos[5]; return 1; } x = 0.0; y = 0.0; z = 0.0; return 0; } IsPlayerInRangeOfBoot(playerid, vehicleid) { new Float:x, Float:y, Float:z; GetVehicleBoot(vehicleid, x, y, z); return (GetPlayerVirtualWorld(playerid) == GetVehicleVirtualWorld(vehicleid)) && IsPlayerInRangeOfPoint(playerid, 3.0, x, y, z); } IsVehicleBeingPicked(vehicleid) { foreach(new i : Player) { if(PlayerInfo[i][pLockBreak] == vehicleid) { return 1; } } return 0; } IsVehicleOwner(playerid, vehicleid) { return (VehicleInfo[vehicleid][vOwnerID] == PlayerInfo[playerid][pID]); } SetVehicleNeon(vehicleid, modelid) { if(18647 <= modelid <= 18652) { if(VehicleInfo[vehicleid][vNeonEnabled]) { DestroyDynamicObject(VehicleInfo[vehicleid][vObjects][0]); DestroyDynamicObject(VehicleInfo[vehicleid][vObjects][1]); } VehicleInfo[vehicleid][vNeon] = modelid; VehicleInfo[vehicleid][vNeonEnabled] = (modelid > 0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET neon = %i, neonenabled = 1 WHERE id = %i", VehicleInfo[vehicleid][vNeon], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); ReloadVehicleNeon(vehicleid); } } ReloadVehicleNeon(vehicleid) { if(VehicleInfo[vehicleid][vID] > 0) { DestroyDynamicObject(VehicleInfo[vehicleid][vObjects][0]); DestroyDynamicObject(VehicleInfo[vehicleid][vObjects][1]); if(VehicleInfo[vehicleid][vNeon] && VehicleInfo[vehicleid][vNeonEnabled]) { new Float:x, Float:y, Float:z; GetVehicleModelInfo(VehicleInfo[vehicleid][vModel], VEHICLE_MODEL_INFO_SIZE, x, y, z); VehicleInfo[vehicleid][vObjects][0] = CreateDynamicObject(VehicleInfo[vehicleid][vNeon], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); VehicleInfo[vehicleid][vObjects][1] = CreateDynamicObject(VehicleInfo[vehicleid][vNeon], 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachDynamicObjectToVehicle(VehicleInfo[vehicleid][vObjects][0], vehicleid, -x / 2.8, 0.0, -0.6, 0.0, 0.0, 0.0); AttachDynamicObjectToVehicle(VehicleInfo[vehicleid][vObjects][1], vehicleid, x / 2.8, 0.0, -0.6, 0.0, 0.0, 0.0); } } } ResyncVehicle(vehicleid) { new worldid = GetVehicleVirtualWorld(vehicleid); SetVehicleVirtualWorld(vehicleid, cellmax); SetVehicleVirtualWorld(vehicleid, worldid); } SaveVehicleModifications(vehicleid) { for(new i = 0; i < 14; i ++) { VehicleInfo[vehicleid][vMods][i] = GetVehicleComponentInSlot(vehicleid, i); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET mod_%i = %i WHERE id = %i", i + 1, VehicleInfo[vehicleid][vMods][i], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } } ReloadVehicle(vehicleid) { if(VehicleInfo[vehicleid][vPaintjob] >= 0) { ChangeVehiclePaintjob(vehicleid, VehicleInfo[vehicleid][vPaintjob]); } if(VehicleInfo[vehicleid][vNeon] && VehicleInfo[vehicleid][vNeonEnabled]) { ReloadVehicleNeon(vehicleid); } for(new i = 0; i < 14; i ++) { if(VehicleInfo[vehicleid][vMods][i] >= 1000) { AddVehicleComponent(vehicleid, VehicleInfo[vehicleid][vMods][i]); } } if(strcmp(VehicleInfo[vehicleid][vPlate], "None") != 0) { SetVehicleNumberPlate(vehicleid, VehicleInfo[vehicleid][vPlate]); ResyncVehicle(vehicleid); } else { SetVehicleNumberPlate(vehicleid, "_"); ResyncVehicle(vehicleid); } LinkVehicleToInterior(vehicleid, VehicleInfo[vehicleid][vInterior]); SetVehicleVirtualWorld(vehicleid, VehicleInfo[vehicleid][vWorld]); SetVehicleHealth(vehicleid, VehicleInfo[vehicleid][vHealth]); SetVehicleParams(vehicleid, VEHICLE_DOORS, VehicleInfo[vehicleid][vLocked]); } DespawnVehicle(vehicleid, bool:save = true) { if(VehicleInfo[vehicleid][vID] > 0) { if(VehicleInfo[vehicleid][vNeonEnabled]) { DestroyDynamicObject(VehicleInfo[vehicleid][vObjects][0]); DestroyDynamicObject(VehicleInfo[vehicleid][vObjects][1]); } if(save) { new Float:health; GetVehicleHealth(vehicleid, health); SaveVehicleModifications(vehicleid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET fuel = %i, health = '%f' WHERE id = %i", vehicleFuel[vehicleid], health, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } DestroyVehicleEx(vehicleid); ResetVehicle(vehicleid); } } ResetVehicle(vehicleid) { strcpy(VehicleInfo[vehicleid][vPlate], "None", 32); strcpy(VehicleInfo[vehicleid][vOwner], "Nobody", MAX_PLAYER_NAME); if(VehicleInfo[vehicleid][vTimer] >= 0) { KillTimer(VehicleInfo[vehicleid][vTimer]); } VehicleInfo[vehicleid][vID] = 0; VehicleInfo[vehicleid][vOwnerID] = 0; VehicleInfo[vehicleid][vModel] = 0; VehicleInfo[vehicleid][vPrice] = 0; VehicleInfo[vehicleid][vTickets] = 0; VehicleInfo[vehicleid][vLocked] = 0; VehicleInfo[vehicleid][vHealth] = 1000.0; VehicleInfo[vehicleid][vPosX] = 0.0; VehicleInfo[vehicleid][vPosY] = 0.0; VehicleInfo[vehicleid][vPosZ] = 0.0; VehicleInfo[vehicleid][vPosA] = 0.0; VehicleInfo[vehicleid][vColor1] = 0; VehicleInfo[vehicleid][vColor2] = 0; VehicleInfo[vehicleid][vPaintjob] = -1; VehicleInfo[vehicleid][vInterior] = 0; VehicleInfo[vehicleid][vWorld] = 0; VehicleInfo[vehicleid][vCash] = 0; VehicleInfo[vehicleid][vMaterials] = 0; VehicleInfo[vehicleid][vWeed] = 0; VehicleInfo[vehicleid][vCocaine] = 0; VehicleInfo[vehicleid][vMeth] = 0; VehicleInfo[vehicleid][vPainkillers] = 0; VehicleInfo[vehicleid][vWeapons][0] = 0; VehicleInfo[vehicleid][vWeapons][1] = 0; VehicleInfo[vehicleid][vWeapons][2] = 0; VehicleInfo[vehicleid][vWeapons][3] = 0; VehicleInfo[vehicleid][vWeapons][4] = 0; VehicleInfo[vehicleid][vGang] = -1; VehicleInfo[vehicleid][vFactionType] = FACTION_NONE; VehicleInfo[vehicleid][vVIP] = 0; VehicleInfo[vehicleid][vJob] = JOB_NONE; VehicleInfo[vehicleid][vObjects][0] = INVALID_OBJECT_ID; VehicleInfo[vehicleid][vObjects][1] = INVALID_OBJECT_ID; VehicleInfo[vehicleid][vTimer] = -1; VehicleInfo[vehicleid][vRank] = 0; VehicleInfo[vehicleid][vForSale] = false; VehicleInfo[vehicleid][vForSalePrice] = 0; if(VehicleInfo[vehicleid][vForSaleLabel] != Text3D:INVALID_3DTEXT_ID) DestroyDynamic3DTextLabel(VehicleInfo[vehicleid][vForSaleLabel]); VehicleInfo[vehicleid][vForSaleLabel] = Text3D:INVALID_3DTEXT_ID; for(new i = 0; i < 14; i ++) { VehicleInfo[vehicleid][vMods][i] = 0; } ResetVehicleObjects(vehicleid); } IsPointInLand(landid, Float:x, Float:y) { if((LandInfo[landid][lMinX] <= x <= LandInfo[landid][lMaxX]) && (LandInfo[landid][lMinY] <= y <= LandInfo[landid][lMaxY])) { return 1; } return 0; } GangZoneCreateEx(Float:minx, Float:miny, Float:maxx, Float:maxy) { return GangZoneCreate((minx > maxx) ? (maxx) : (minx), (miny > maxy) ? (maxy) : (miny), (minx > maxx) ? (minx) : (maxx), (miny > maxy) ? (miny) : (maxy)); } HasLandPerms(playerid, landid) { return IsLandOwner(playerid, landid) || PlayerInfo[playerid][pLandPerms] == landid; } IsLandOwner(playerid, landid) { return (LandInfo[landid][lOwnerID] == PlayerInfo[playerid][pID]); } SetLandOwner(landid, playerid) { if(playerid == INVALID_PLAYER_ID) { strcpy(LandInfo[landid][lOwner], "Nobody", MAX_PLAYER_NAME); LandInfo[landid][lOwnerID] = 0; } else { GetPlayerName(playerid, LandInfo[landid][lOwner], MAX_PLAYER_NAME); LandInfo[landid][lOwnerID] = PlayerInfo[playerid][pID]; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE lands SET ownerid = %i, owner = '%s' WHERE id = %i", LandInfo[landid][lOwnerID], LandInfo[landid][lOwner], LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer); ReloadLand(landid); } GetLandObjectID(sql_id) { for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_LAND && Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID) == sql_id) { return i; } } return INVALID_OBJECT_ID; } GetLandObjectCapacity(level) { switch(level) { case 1: return 150; case 2: return 200; case 3: return 300; case 4: return 500; case 5: return 1000; } return 0; } RemoveLandObject(objectid) { if(IsValidDynamicObject(objectid) && Streamer_GetExtraInt(objectid, E_OBJECT_TYPE) == E_OBJECT_LAND) { new id = Streamer_GetExtraInt(objectid, E_OBJECT_INDEX_ID); DeleteLandObject(objectid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM landobjects WHERE id = %i", id); mysql_tquery(connectionID, queryBuffer); } } DeleteLandObject(objectid) { if(IsValidDynamicObject(objectid) && Streamer_GetExtraInt(objectid, E_OBJECT_TYPE) == E_OBJECT_LAND) { new Text3D:textid = Text3D:Streamer_GetExtraInt(objectid, E_OBJECT_3DTEXT_ID); if(IsValidDynamic3DTextLabel(textid)) { DestroyDynamic3DTextLabel(textid); } DestroyDynamicObject(objectid); } } RemoveAllLandObjects(landid) { if(LandInfo[landid][lExists]) { for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_LAND && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == LandInfo[landid][lID]) { DeleteLandObject(i); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM landobjects WHERE landid = %i", LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer); } } stock Graffiti_Refresh(id) { if (id != -1 && GraffitiData[id][graffitiExists]) { if (IsValidDynamicMapIcon(GraffitiData[id][graffitiIcon])) DestroyDynamicMapIcon(GraffitiData[id][graffitiIcon]); if (IsValidDynamicObject(GraffitiData[id][graffitiObject])) DestroyDynamicObject(GraffitiData[id][graffitiObject]); GraffitiData[id][graffitiIcon] = CreateDynamicMapIcon(GraffitiData[id][graffitiPos][0], GraffitiData[id][graffitiPos][1], GraffitiData[id][graffitiPos][2], 23, 0, -1, -1, -1, 100.0, MAPICON_GLOBAL); GraffitiData[id][graffitiObject] = CreateDynamicObject(19482, GraffitiData[id][graffitiPos][0], GraffitiData[id][graffitiPos][1], GraffitiData[id][graffitiPos][2], 0.0, 0.0, GraffitiData[id][graffitiPos][3]); SetDynamicObjectMaterial(GraffitiData[id][graffitiObject], 0, 0, "none", "none", 0); SetDynamicObjectMaterialText(GraffitiData[id][graffitiObject], 0, GraffitiData[id][graffitiText], OBJECT_MATERIAL_SIZE_256x128, "Arial", 24, 1, GraffitiData[id][graffitiColor], 0, 0); } return 1; } stock IsSprayingInProgress(id) { foreach (new i : Player) { if (PlayerInfo[i][pGraffiti] == id && IsPlayerInRangeOfPoint(i, 5.0, GraffitiData[id][graffitiPos][0], GraffitiData[id][graffitiPos][1], GraffitiData[id][graffitiPos][2])) return 1; } return 0; } stock Graffiti_Nearest(playerid) { for (new i = 0; i < MAX_GRAFFITI_POINTS; i ++) if (GraffitiData[i][graffitiExists] && IsPlayerInRangeOfPoint(playerid, 5.0, GraffitiData[i][graffitiPos][0], GraffitiData[i][graffitiPos][1], GraffitiData[i][graffitiPos][2])) return i; return -1; } stock SQL_ReturnEscaped(const string[]) { new entry[256]; mysql_real_escape_string(string, entry, connectionID); return entry; } stock Graffiti_Delete(id) { if (id != -1 && GraffitiData[id][graffitiExists]) { new string[64]; if (IsValidDynamicMapIcon(GraffitiData[id][graffitiIcon])) DestroyDynamicMapIcon(GraffitiData[id][graffitiIcon]); if (IsValidDynamicObject(GraffitiData[id][graffitiObject])) DestroyDynamicObject(GraffitiData[id][graffitiObject]); format(string, sizeof(string), "DELETE FROM `graffiti` WHERE `graffitiID` = '%d'", GraffitiData[id][graffitiID]); mysql_tquery(connectionID, string); GraffitiData[id][graffitiExists] = false; GraffitiData[id][graffitiText][0] = 0; GraffitiData[id][graffitiID] = 0; } return 1; } stock Graffiti_Save(id) { new query[384]; format(query, sizeof(query), "UPDATE `graffiti` SET `graffitiX` = '%.4f', `graffitiY` = '%.4f', `graffitiZ` = '%.4f', `graffitiAngle` = '%.4f', `graffitiColor` = '%d', `graffitiText` = '%s' WHERE `graffitiID` = '%d'", GraffitiData[id][graffitiPos][0], GraffitiData[id][graffitiPos][1], GraffitiData[id][graffitiPos][2], GraffitiData[id][graffitiPos][3], GraffitiData[id][graffitiColor], SQL_ReturnEscaped(GraffitiData[id][graffitiText]), GraffitiData[id][graffitiID] ); return mysql_tquery(connectionID, query); } stock Graffiti_Create(Float:x, Float:y, Float:z, Float:angle) { for (new i = 0; i < MAX_GRAFFITI_POINTS; i ++) { if (!GraffitiData[i][graffitiExists]) { GraffitiData[i][graffitiExists] = 1; GraffitiData[i][graffitiPos][0] = x; GraffitiData[i][graffitiPos][1] = y; GraffitiData[i][graffitiPos][2] = z; GraffitiData[i][graffitiPos][3] = angle - 90.0; GraffitiData[i][graffitiColor] = 0xFFFFFFFF; format(GraffitiData[i][graffitiText], 32, "Graffiti"); Graffiti_Refresh(i); mysql_tquery(connectionID, "INSERT INTO `graffiti` (`graffitiColor`) VALUES(0)", "OnGraffitiCreated", "d", i); return i; } } return -1; } stock Speed_Refresh(speedid) { if (speedid != -1 && SpeedData[speedid][speedExists]) { new string[64]; if (IsValidDynamicObject(SpeedData[speedid][speedObject])) DestroyDynamicObject(SpeedData[speedid][speedObject]); if (IsValidDynamic3DTextLabel(SpeedData[speedid][speedText3D])) DestroyDynamic3DTextLabel(SpeedData[speedid][speedText3D]); format(string, sizeof(string), "[Camera %d]\n{FFFFFF}Speed Limit: %.0f mph", speedid, SpeedData[speedid][speedLimit]); SpeedData[speedid][speedText3D] = CreateDynamic3DTextLabel(string, COLOR_AQUA, SpeedData[speedid][speedPos][0], SpeedData[speedid][speedPos][1], SpeedData[speedid][speedPos][2] + 2.5, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0); SpeedData[speedid][speedObject] = CreateDynamicObject(18880, SpeedData[speedid][speedPos][0], SpeedData[speedid][speedPos][1], SpeedData[speedid][speedPos][2], 0.0, 0.0, SpeedData[speedid][speedPos][3]); } return 1; } stock Speed_Save(speedid) { new query[255]; format(query, sizeof(query), "UPDATE `speedcameras` SET `speedRange` = '%.4f', `speedLimit` = '%.4f', `speedX` = '%.4f', `speedY` = '%.4f', `speedZ` = '%.4f', `speedAngle` = '%.4f' WHERE `speedID` = '%d'", SpeedData[speedid][speedRange], SpeedData[speedid][speedLimit], SpeedData[speedid][speedPos][0], SpeedData[speedid][speedPos][1], SpeedData[speedid][speedPos][2], SpeedData[speedid][speedPos][3], SpeedData[speedid][speedID] ); return mysql_tquery(connectionID, query); } stock Speed_Nearest(playerid) { for (new i = 0; i < MAX_SPEED_CAMERAS; i ++) if (SpeedData[i][speedExists] && IsPlayerInRangeOfPoint(playerid, SpeedData[i][speedRange], SpeedData[i][speedPos][0], SpeedData[i][speedPos][1], SpeedData[i][speedPos][2])) return i; return -1; } stock Speed_Delete(speedid) { if (speedid != -1 && SpeedData[speedid][speedExists]) { new string[64]; if (IsValidDynamicObject(SpeedData[speedid][speedObject])) DestroyDynamicObject(SpeedData[speedid][speedObject]); if (IsValidDynamic3DTextLabel(SpeedData[speedid][speedText3D])) DestroyDynamic3DTextLabel(SpeedData[speedid][speedText3D]); format(string, sizeof(string), "DELETE FROM `speedcameras` WHERE `speedID` = '%d'", SpeedData[speedid][speedID]); mysql_tquery(connectionID, string); SpeedData[speedid][speedExists] = false; SpeedData[speedid][speedLimit] = 0.0; SpeedData[speedid][speedRange] = 0.0; SpeedData[speedid][speedID] = 0; } return 1; } stock Speed_Create(playerid, Float:limit, Float:range) { new Float:x, Float:y, Float:z, Float:angle; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, angle); for (new i = 0; i < MAX_SPEED_CAMERAS; i ++) if (!SpeedData[i][speedExists]) { SpeedData[i][speedExists] = true; SpeedData[i][speedRange] = range; SpeedData[i][speedLimit] = limit; SpeedData[i][speedPos][0] = x + (1.5 * floatsin(-angle, degrees)); SpeedData[i][speedPos][1] = y + (1.5 * floatcos(-angle, degrees)); SpeedData[i][speedPos][2] = z - 1.2; SpeedData[i][speedPos][3] = angle; Speed_Refresh(i); mysql_tquery(connectionID, "INSERT INTO `speedcameras` (`speedRange`) VALUES(0.0)", "OnSpeedCreated", "d", i); return i; } return -1; } forward Graffiti_Load(); public Graffiti_Load() { static rows, fields; cache_get_data(rows, fields, connectionID); for (new i = 0; i < rows; i ++) if (i < MAX_GRAFFITI_POINTS) { cache_get_field_content(i, "graffitiText", GraffitiData[i][graffitiText], connectionID, 64); GraffitiData[i][graffitiExists] = 1; GraffitiData[i][graffitiID] = cache_get_field_content_int(i, "graffitiID"); GraffitiData[i][graffitiPos][0] = cache_get_field_content_float(i, "graffitiX"); GraffitiData[i][graffitiPos][1] = cache_get_field_content_float(i, "graffitiY"); GraffitiData[i][graffitiPos][2] = cache_get_field_content_float(i, "graffitiZ"); GraffitiData[i][graffitiPos][3] = cache_get_field_content_float(i, "graffitiAngle"); GraffitiData[i][graffitiColor] = cache_get_field_content_int(i, "graffitiColor"); Graffiti_Refresh(i); } return 1; } Rack_Save(rackid) { static query[512]; format(query, sizeof(query), "UPDATE `gunracks` SET `rackHouse` = '%d', `rackX` = '%.4f', `rackY` = '%.4f', `rackZ` = '%.4f', `rackA` = '%.4f', `rackInterior` = '%d', `rackWorld` = '%d', `rackWeapon1` = '%d', `rackWeapon2` = '%d', `rackWeapon3` = '%d', `rackWeapon4` = '%d' WHERE `rackID` = '%d'", RackData[rackid][rackHouse], RackData[rackid][rackPos][0], RackData[rackid][rackPos][1], RackData[rackid][rackPos][2], RackData[rackid][rackPos][3], RackData[rackid][rackInterior], RackData[rackid][rackWorld], RackData[rackid][rackWeapons][0], RackData[rackid][rackWeapons][1], RackData[rackid][rackWeapons][2], RackData[rackid][rackWeapons][3], RackData[rackid][rackID] ); return mysql_tquery(connectionID, query); } Rack_Nearest(playerid) { for (new i = 0; i != MAX_WEAPON_RACKS; i ++) if (RackData[i][rackExists] && IsPlayerInRangeOfPoint(playerid, 3.0, RackData[i][rackPos][0], RackData[i][rackPos][1], RackData[i][rackPos][2])) { if (GetPlayerInterior(playerid) == RackData[i][rackInterior] && GetPlayerVirtualWorld(playerid) == RackData[i][rackWorld]) return i; } return -1; } Rack_Count(houseid) { new count; for (new i = 0; i != MAX_WEAPON_RACKS; i ++) if (RackData[i][rackExists] && RackData[i][rackHouse] == HouseInfo[houseid][hID]) { count++; } return count; } Rack_ShowGuns(playerid, rackid) { if (rackid != -1 && RackData[rackid][rackExists]) { new string[128]; for (new i = 0; i < 4; i ++) { if (!RackData[rackid][rackWeapons][i]) format(string, sizeof(string), "%s%d: Empty Slot\n", string, i + 1); else format(string, sizeof(string), "%s%d: \n", string, i + 1, ReturnWeaponName(RackData[rackid][rackWeapons][i])); } ShowPlayerDialog(playerid, DIALOG_RACKWEAPONS, DIALOG_STYLE_LIST, "Weapon Rack", string, "Select", "Cancel"); } return 1; } Rack_Delete(rackid) { if (rackid != -1 && RackData[rackid][rackExists]) { static string[64]; format(string, sizeof(string), "DELETE FROM `gunracks` WHERE `rackID` = '%d'", RackData[rackid][rackID]); mysql_tquery(connectionID, string); for (new i = 0; i < 5; i ++) if (IsValidDynamicObject(RackData[rackid][rackObjects][i])) { DestroyDynamicObject(RackData[rackid][rackObjects][i]); } if (IsValidDynamic3DTextLabel(RackData[rackid][rackText3D])) { DestroyDynamic3DTextLabel(RackData[rackid][rackText3D]); } RackData[rackid][rackExists] = false; RackData[rackid][rackID] = 0; RackData[rackid][rackHouse] = 0; } return 1; } Rack_Create(playerid, houseid) { static Float:x, Float:y, Float:z, Float:angle; if (GetPlayerPos(playerid, x, y, z) && GetPlayerFacingAngle(playerid, angle)) { for (new i = 0; i != MAX_WEAPON_RACKS; i ++) if (!RackData[i][rackExists]) { x += 1.5 * floatsin(-angle, degrees); y += 1.5 * floatcos(-angle, degrees); RackData[i][rackExists] = true; RackData[i][rackHouse] = (houseid == -1) ? (-1) : (HouseInfo[houseid][hID]); RackData[i][rackPos][0] = x; RackData[i][rackPos][1] = y; RackData[i][rackPos][2] = z; RackData[i][rackPos][3] = angle; RackData[i][rackInterior] = GetPlayerInterior(playerid); RackData[i][rackWorld] = GetPlayerVirtualWorld(playerid); Rack_Refresh(i); mysql_tquery(connectionID, "INSERT INTO `gunracks` (`rackHouse`) VALUES(0)", "OnRackCreated", "d", i); return i; } } return -1; } Rack_RefreshGuns(rackid) { if (rackid != -1 && RackData[rackid][rackExists]) { new Float:x, Float:y, Float:z; z = RackData[rackid][rackPos][2] + 2.19; for (new i = 0; i < 4; i ++) if (IsValidDynamicObject(RackData[rackid][rackObjects][i])) { DestroyDynamicObject(RackData[rackid][rackObjects][i]); RackData[rackid][rackObjects][i] = INVALID_OBJECT_ID; } for (new i = 0; i < 4; i ++) { if (RackData[rackid][rackWeapons][i]) { x = RackData[rackid][rackPos][0] - (0.2 * floatsin(-RackData[rackid][rackPos][3], degrees) + (0.45 * floatsin(-RackData[rackid][rackPos][3] - 90, degrees))); y = RackData[rackid][rackPos][1] - (0.2 * floatcos(-RackData[rackid][rackPos][3], degrees) + (0.45 * floatcos(-RackData[rackid][rackPos][3] - 90, degrees))); RackData[rackid][rackObjects][i] = CreateDynamicObject(GetWeaponModel(RackData[rackid][rackWeapons][i]), x, y, z, 94.7, 93.7, (22 <= RackData[rackid][rackWeapons][i] <= 38) ? (RackData[rackid][rackPos][3] + 90.0) : (RackData[rackid][rackPos][3]), RackData[rackid][rackWorld], RackData[rackid][rackInterior]); } else { RackData[rackid][rackObjects][i] = INVALID_OBJECT_ID; } z = z - 0.69; } } return 1; } Rack_Refresh(rackid) { if (rackid != -1 && RackData[rackid][rackExists]) { static str[64]; if (IsValidDynamicObject(RackData[rackid][rackObjects][4])) { DestroyDynamicObject(RackData[rackid][rackObjects][4]); } if (IsValidDynamic3DTextLabel(RackData[rackid][rackText3D])) { DestroyDynamic3DTextLabel(RackData[rackid][rackText3D]); } format(str, sizeof(str), "[Rack %d]\n{FFFFFF}/gunrack to use this rack.", rackid); RackData[rackid][rackText3D] = CreateDynamic3DTextLabel(str, COLOR_AQUA, RackData[rackid][rackPos][0], RackData[rackid][rackPos][1], RackData[rackid][rackPos][2] + 1.2, 15.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, RackData[rackid][rackWorld], RackData[rackid][rackInterior]); Rack_RefreshGuns(rackid); RackData[rackid][rackObjects][4] = CreateDynamicObject(2475, RackData[rackid][rackPos][0], RackData[rackid][rackPos][1], RackData[rackid][rackPos][2], 0.0, 0.0, RackData[rackid][rackPos][3], RackData[rackid][rackWorld], RackData[rackid][rackInterior]); } return 1; } forward Speed_Load(); public Speed_Load() { static rows, fields; cache_get_data(rows, fields, connectionID); for (new i = 0; i < rows; i ++) if (i < MAX_SPEED_CAMERAS) { SpeedData[i][speedExists] = true; SpeedData[i][speedID] = cache_get_field_content_int(i, "speedID"); SpeedData[i][speedRange] = cache_get_field_content_float(i, "speedRange"); SpeedData[i][speedLimit] = cache_get_field_content_float(i, "speedLimit"); SpeedData[i][speedPos][0] = cache_get_field_content_float(i, "speedX"); SpeedData[i][speedPos][1] = cache_get_field_content_float(i, "speedY"); SpeedData[i][speedPos][2] = cache_get_field_content_float(i, "speedZ"); SpeedData[i][speedPos][3] = cache_get_field_content_float(i, "speedAngle"); Speed_Refresh(i); } return 1; } forward Rack_Load(); public Rack_Load() { static rows, fields, str[24]; cache_get_data(rows, fields, connectionID); for (new i = 0; i < rows; i ++) if (i < MAX_WEAPON_RACKS) { RackData[i][rackExists] = true; RackData[i][rackID] = cache_get_field_content_int(i, "rackID"); RackData[i][rackHouse] = cache_get_field_content_int(i, "rackHouse"); RackData[i][rackPos][0] = cache_get_field_content_float(i, "rackX"); RackData[i][rackPos][1] = cache_get_field_content_float(i, "rackY"); RackData[i][rackPos][2] = cache_get_field_content_float(i, "rackZ"); RackData[i][rackPos][3] = cache_get_field_content_float(i, "rackA"); RackData[i][rackInterior] = cache_get_field_content_int(i, "rackInterior"); RackData[i][rackWorld] = cache_get_field_content_int(i, "rackWorld"); for (new j = 0; j < 4; j ++) { format(str, 24, "rackWeapon%d", j + 1); RackData[i][rackWeapons][j] = cache_get_field_content_int(i, str); } Rack_Refresh(i); } return 1; } ReloadLandObject(objectid, labels) { if(IsValidDynamicObject(objectid) && Streamer_GetExtraInt(objectid, E_OBJECT_TYPE) == E_OBJECT_LAND) { new id = Streamer_GetExtraInt(objectid, E_OBJECT_INDEX_ID); DeleteLandObject(objectid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM landobjects WHERE id = %i", id); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOAD_LANDOBJECTS, labels); } } ReloadAllLandObjects(landid) { if(LandInfo[landid][lExists]) { for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_LAND && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == LandInfo[landid][lID]) { DeleteLandObject(i); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM landobjects WHERE landid = %i", LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOAD_LANDOBJECTS, LandInfo[landid][lLabels]); } } ReloadLand(landid) { if(LandInfo[landid][lExists]) { DestroyDynamicArea(LandInfo[landid][lArea]); GangZoneDestroy(LandInfo[landid][lGangZone]); DestroyDynamic3DTextLabel(LandInfo[landid][lTextdraw]); LandInfo[landid][lArea] = CreateDynamicRectangle(LandInfo[landid][lMinX], LandInfo[landid][lMinY], LandInfo[landid][lMaxX], LandInfo[landid][lMaxY]); LandInfo[landid][lGangZone] = GangZoneCreateEx(LandInfo[landid][lMinX], LandInfo[landid][lMinY], LandInfo[landid][lMaxX], LandInfo[landid][lMaxY]); LandInfo[landid][lTextdraw] = CreateDynamic3DTextLabel("Land", COLOR_GREY, LandInfo[landid][lMinX], LandInfo[landid][lMinY], LandInfo[landid][lHeight], 10.0); UpdateLandText(landid); foreach(new i : Player) { if(PlayerInfo[i][pShowLands]) { GangZoneShowForPlayer(i, LandInfo[landid][lGangZone], (LandInfo[landid][lOwnerID] > 0) ? (0xFF6347AA) : (0x33CC33AA)); } } } } GetNearbyLand(playerid) { if(GetPlayerInterior(playerid) == 0 && GetPlayerVirtualWorld(playerid) == 0) { foreach(new i : Land) { if(LandInfo[i][lExists] && IsPlayerInDynamicArea(playerid, LandInfo[i][lArea])) { return i; } } } return -1; } TurfTaxCheck(playerid, amount) { new turfid = GetNearbyTurf(playerid); if(turfid >= 0 && TurfInfo[turfid][tType] == 7 && TurfInfo[turfid][tCapturedGang] >= 0) { if(!(PlayerInfo[playerid][pGang] >= 0 && PlayerInfo[playerid][pGang] == TurfInfo[turfid][tCapturedGang])) { amount = percent(amount, 10); SendClientMessageEx(playerid, COLOR_AQUA, "You have been taxed a 10 percent fee of {FF6347}$%i{33CCFF} for selling in %s's turf.", amount, GangInfo[TurfInfo[turfid][tCapturedGang]][gName]); GivePlayerCash(playerid, -amount); GangInfo[TurfInfo[turfid][tCapturedGang]][gCash] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET cash = %i WHERE id = %i", GangInfo[TurfInfo[turfid][tCapturedGang]][gCash], TurfInfo[turfid][tCapturedGang]); mysql_tquery(connectionID, queryBuffer); } } } GetNearbyTurf(playerid) { if(GetPlayerInterior(playerid) == 0 && GetPlayerVirtualWorld(playerid) == 0) { foreach(new i : Turf) { if(TurfInfo[i][tExists] && IsPlayerInDynamicArea(playerid, TurfInfo[i][tArea])) { return i; } } } return -1; } GetTurfColor(turfid) { if(TurfInfo[turfid][tCapturedGang] >= 0) { return (GangInfo[TurfInfo[turfid][tCapturedGang]][gColor] & ~0xff) + 0xAA; } else if(TurfInfo[turfid][tCapturedGang] == -5) { return 0x8D8DFFAA; } return 0x000000AA; } ReloadTurf(turfid) { if(TurfInfo[turfid][tExists]) { DestroyDynamicArea(TurfInfo[turfid][tArea]); GangZoneDestroy(TurfInfo[turfid][tGangZone]); TurfInfo[turfid][tArea] = CreateDynamicRectangle(TurfInfo[turfid][tMinX], TurfInfo[turfid][tMinY], TurfInfo[turfid][tMaxX], TurfInfo[turfid][tMaxY]); TurfInfo[turfid][tGangZone] = GangZoneCreateEx(TurfInfo[turfid][tMinX], TurfInfo[turfid][tMinY], TurfInfo[turfid][tMaxX], TurfInfo[turfid][tMaxY]); foreach(new i : Player) { if(PlayerInfo[i][pShowTurfs]) { ShowTurfsOnMap(i, true); } } } } GetNearbyEntranceEx(playerid) { return GetNearbyEntrance(playerid) == -1 ? GetInsideEntrance(playerid) : GetNearbyEntrance(playerid); } GetNearbyEntrance(playerid) { foreach(new i : Entrance) { if(EntranceInfo[i][eExists] && IsPlayerInRangeOfPoint(playerid, EntranceInfo[i][eRadius], EntranceInfo[i][ePosX], EntranceInfo[i][ePosY], EntranceInfo[i][ePosZ]) && GetPlayerInterior(playerid) == EntranceInfo[i][eOutsideInt] && GetPlayerVirtualWorld(playerid) == EntranceInfo[i][eOutsideVW]) { return i; } } return -1; } GetInsideEntrance(playerid) { foreach(new i : Entrance) { if(EntranceInfo[i][eExists] && IsPlayerInRangeOfPoint(playerid, 100.0, EntranceInfo[i][eIntX], EntranceInfo[i][eIntY], EntranceInfo[i][eIntZ]) && GetPlayerInterior(playerid) == EntranceInfo[i][eInterior] && GetPlayerVirtualWorld(playerid) == EntranceInfo[i][eWorld]) { return i; } } return -1; } SetEntranceOwner(entranceid, playerid) { if(playerid == INVALID_PLAYER_ID) { strcpy(EntranceInfo[entranceid][eOwner], "Nobody", MAX_PLAYER_NAME); EntranceInfo[entranceid][eOwnerID] = 0; } else { GetPlayerName(playerid, EntranceInfo[entranceid][eOwner], MAX_PLAYER_NAME); EntranceInfo[entranceid][eOwnerID] = PlayerInfo[playerid][pID]; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET ownerid = %i, owner = '%s' WHERE id = %i", EntranceInfo[entranceid][eOwnerID], EntranceInfo[entranceid][eOwner], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); } ReloadEntrance(entranceid) { if(EntranceInfo[entranceid][eExists]) { new string[128]; DestroyDynamic3DTextLabel(EntranceInfo[entranceid][eText]); DestroyDynamicPickup(EntranceInfo[entranceid][ePickup]); DestroyDynamicMapIcon(EntranceInfo[entranceid][eMapIconID]); if(EntranceInfo[entranceid][eLabel]) { if(EntranceInfo[entranceid][eOwnerID]) { format(string, sizeof(string), "%s\nOwner: %s\n{FF8C00}Press Y to enter.", EntranceInfo[entranceid][eName], EntranceInfo[entranceid][eOwner]); } else { /*if(EntranceInfo[entranceid][eType] == 1) format(string, sizeof(string), "%s\n{AFAFAF}/offerduel to duel.", EntranceInfo[entranceid][eName]);*/ if(EntranceInfo[entranceid][eType] == 2) format(string, sizeof(string), "%s\n{AFAFAF}/repaircar to repair your vehicle.", EntranceInfo[entranceid][eName]); else format(string, sizeof(string), "%s\n{FF8C00}Press Y to enter.", EntranceInfo[entranceid][eName]); } new color = COLOR_GREY1; if(EntranceInfo[entranceid][eColor] != -256) { color = EntranceInfo[entranceid][eColor]; } EntranceInfo[entranceid][eText] = CreateDynamic3DTextLabel(string, color, EntranceInfo[entranceid][ePosX], EntranceInfo[entranceid][ePosY], (EntranceInfo[entranceid][eIcon] == 19902) ? (EntranceInfo[entranceid][ePosZ] + 0.1) : (EntranceInfo[entranceid][ePosZ]), 10.0, .worldid = EntranceInfo[entranceid][eOutsideVW], .interiorid = EntranceInfo[entranceid][eOutsideInt]); } EntranceInfo[entranceid][ePickup] = CreateDynamicPickup(EntranceInfo[entranceid][eIcon], 1, EntranceInfo[entranceid][ePosX], EntranceInfo[entranceid][ePosY], (EntranceInfo[entranceid][eIcon] == 19902) ? (EntranceInfo[entranceid][ePosZ] - 1.0) : (EntranceInfo[entranceid][ePosZ]), .worldid = EntranceInfo[entranceid][eOutsideVW], .interiorid = EntranceInfo[entranceid][eOutsideInt]); if(EntranceInfo[entranceid][eMapIcon]) { EntranceInfo[entranceid][eMapIconID] = CreateDynamicMapIcon(EntranceInfo[entranceid][ePosX], EntranceInfo[entranceid][ePosY], EntranceInfo[entranceid][ePosZ], EntranceInfo[entranceid][eMapIcon], 0, .worldid = EntranceInfo[entranceid][eOutsideVW], .interiorid = EntranceInfo[entranceid][eOutsideInt]); } } } IsEntranceOwner(playerid, entranceid) { return (EntranceInfo[entranceid][eOwnerID] == PlayerInfo[playerid][pID]); } GetClosestBusiness(playerid, type) { new Float:distance[2] = {99999.0, 0.0}, index = -1; foreach(new i : Business) { if((BusinessInfo[i][bExists] && BusinessInfo[i][bType] == type) && (BusinessInfo[i][bOutsideInt] == 0 && BusinessInfo[i][bOutsideVW] == 0)) { distance[1] = GetPlayerDistanceFromPoint(playerid, BusinessInfo[i][bPosX], BusinessInfo[i][bPosY], BusinessInfo[i][bPosZ]); if(distance[0] > distance[1]) { distance[0] = distance[1]; index = i; } } } return index; } GetNearbyBusinessEx(playerid) { return GetNearbyBusiness(playerid) == -1 ? GetInsideBusiness(playerid) : GetNearbyBusiness(playerid); } GetNearbyBusiness(playerid, Float:radius = 2.0) { foreach(new i : Business) { if(BusinessInfo[i][bExists] && IsPlayerInRangeOfPoint(playerid, radius, BusinessInfo[i][bPosX], BusinessInfo[i][bPosY], BusinessInfo[i][bPosZ]) && GetPlayerInterior(playerid) == BusinessInfo[i][bOutsideInt] && GetPlayerVirtualWorld(playerid) == BusinessInfo[i][bOutsideVW]) { return i; } } return -1; } GetInsideBusiness(playerid) { foreach(new i : Business) { if(BusinessInfo[i][bExists] && IsPlayerInRangeOfPoint(playerid, 100.0, BusinessInfo[i][bIntX], BusinessInfo[i][bIntY], BusinessInfo[i][bIntZ]) && GetPlayerInterior(playerid) == BusinessInfo[i][bInterior] && GetPlayerVirtualWorld(playerid) == BusinessInfo[i][bWorld]) { return i; } } return -1; } SetBusinessOwner(businessid, playerid) { if(playerid == INVALID_PLAYER_ID) { strcpy(BusinessInfo[businessid][bOwner], "Nobody", MAX_PLAYER_NAME); BusinessInfo[businessid][bOwnerID] = 0; } else { GetPlayerName(playerid, BusinessInfo[businessid][bOwner], MAX_PLAYER_NAME); BusinessInfo[businessid][bOwnerID] = PlayerInfo[playerid][pID]; } BusinessInfo[businessid][bTimestamp] = gettime(); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET timestamp = %i, ownerid = %i, owner = '%s' WHERE id = %i", BusinessInfo[businessid][bTimestamp], BusinessInfo[businessid][bOwnerID], BusinessInfo[businessid][bOwner], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); } ReloadBusiness(businessid) { if(BusinessInfo[businessid][bExists]) { new string[128]; DestroyDynamic3DTextLabel(BusinessInfo[businessid][bText]); DestroyDynamicPickup(BusinessInfo[businessid][bPickup]); DestroyDynamicMapIcon(BusinessInfo[businessid][bMapIcon]); if(BusinessInfo[businessid][bOwnerID] == 0) { format(string, sizeof(string), "[Business]\nPrice: %s\nType: %s\nEntry Fee: $%i\nStatus: %s", FormatNumber(BusinessInfo[businessid][bPrice]), bizInteriors[BusinessInfo[businessid][bType]][intType], BusinessInfo[businessid][bEntryFee], (BusinessInfo[businessid][bLocked]) ? ("{ffff00}Closed") : ("{00AA00}Opened")); } else { format(string, sizeof(string), "[Business]\nOwner: %s\nType: %s\nEntry Fee: $%i\nStatus: %s", BusinessInfo[businessid][bOwner], bizInteriors[BusinessInfo[businessid][bType]][intType], BusinessInfo[businessid][bEntryFee], (BusinessInfo[businessid][bLocked]) ? ("{FFFF00}Closed") : ("{00AA00}Opened")); } BusinessInfo[businessid][bText] = CreateDynamic3DTextLabel(string, COLOR_GREY1, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ] + 0.1, 10.0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt]); BusinessInfo[businessid][bPickup] = CreateDynamicPickup(1272, 1, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt]); switch(BusinessInfo[businessid][bType]) { //case BUSINESS_STORE: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 17, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL); //case BUSINESS_Ammunation: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 6, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL); //case BUSINESS_CLOTHES: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 45, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL); //case BUSINESS_RESTAURANT: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 10, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL); //case BUSINESS_GYM: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 54, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL); //case BUSINESS_AGENCY: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 58, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL); // case BUSINESS_BARCLUB: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 49, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL); // case BUSINESS_TOOLSHOP: BusinessInfo[businessid][bMapIcon] = CreateDynamicMapIcon(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 11, 0, .worldid = BusinessInfo[businessid][bOutsideVW], .interiorid = BusinessInfo[businessid][bOutsideInt], .style = MAPICON_GLOBAL); } } } IsBusinessOwner(playerid, businessid) { return (BusinessInfo[businessid][bOwnerID] == PlayerInfo[playerid][pID]); } IsGarageOwner(playerid, garageid) { return (GarageInfo[garageid][gOwnerID] == PlayerInfo[playerid][pID]); } GetNearbyGarageEx(playerid) { return GetNearbyGarage(playerid) == -1 ? GetInsideGarage(playerid) : GetNearbyGarage(playerid); } GetNearbyGarage(playerid) { foreach(new i : Garage) { if(GarageInfo[i][gExists] && IsPlayerInRangeOfPoint(playerid, 4.0, GarageInfo[i][gPosX], GarageInfo[i][gPosY], GarageInfo[i][gPosZ])) { return i; } } return -1; } GetInsideGarage(playerid) { foreach(new i : Garage) { if(GarageInfo[i][gExists] && IsPlayerInRangeOfPoint(playerid, 50.0, garageInteriors[GarageInfo[i][gType]][intVX], garageInteriors[GarageInfo[i][gType]][intVY], garageInteriors[GarageInfo[i][gType]][intVZ]) && GetPlayerInterior(playerid) == garageInteriors[GarageInfo[i][gType]][intID] && GetPlayerVirtualWorld(playerid) == GarageInfo[i][gWorld]) { return i; } } return -1; } ReloadGarage(garageid) { if(GarageInfo[garageid][gExists]) { new string[128]; DestroyDynamic3DTextLabel(GarageInfo[garageid][gText]); DestroyDynamicPickup(GarageInfo[garageid][gPickup]); if(GarageInfo[garageid][gOwnerID] == 0) { format(string, sizeof(string), "[{ADADAD}Garage{54878D}]\nPrice: {00AA00}%s{54878D}\nSize: %s\nCapacity: %i cars", FormatNumber(GarageInfo[garageid][gPrice]), garageInteriors[GarageInfo[garageid][gType]][intName], GarageInfo[garageid][gType] + 1); } else { format(string, sizeof(string), "[{ADADAD}Garage{54878D}]\nOwner: %s\nSize: %s\nCapacity: %i cars", GarageInfo[garageid][gOwner], garageInteriors[GarageInfo[garageid][gType]][intName], GarageInfo[garageid][gType] + 1); } GarageInfo[garageid][gText] = CreateDynamic3DTextLabel(string, 0x54878DFF, GarageInfo[garageid][gPosX], GarageInfo[garageid][gPosY], GarageInfo[garageid][gPosZ] + 0.1, 10.0); GarageInfo[garageid][gPickup] = CreateDynamicPickup(1318, 1, GarageInfo[garageid][gPosX], GarageInfo[garageid][gPosY], GarageInfo[garageid][gPosZ]); } } SetGarageOwner(garageid, playerid) { if(playerid == INVALID_PLAYER_ID) { strcpy(GarageInfo[garageid][gOwner], "Nobody", MAX_PLAYER_NAME); GarageInfo[garageid][gOwnerID] = 0; } else { GetPlayerName(playerid, GarageInfo[garageid][gOwner], MAX_PLAYER_NAME); GarageInfo[garageid][gOwnerID] = PlayerInfo[playerid][pID]; } GarageInfo[garageid][gTimestamp] = gettime(); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET timestamp = %i, ownerid = %i, owner = '%s' WHERE id = %i", GarageInfo[garageid][gTimestamp], GarageInfo[garageid][gOwnerID], GarageInfo[garageid][gOwner], GarageInfo[garageid][gID]); mysql_tquery(connectionID, queryBuffer); ReloadGarage(garageid); } HasFurniturePerms(playerid, houseid) { return IsHouseOwner(playerid, houseid) || PlayerInfo[playerid][pFurniturePerms] == houseid; } IsHouseOwner(playerid, houseid) { return (HouseInfo[houseid][hOwnerID] == PlayerInfo[playerid][pID]); } GetVehicleStashCapacity(vehicleid, item) { static const stashCapacities[][] = { // Cash Mats W C M P W {25000, 5000, 25, 25, 10, 5, 3}, // level 1 {50000, 10000, 50, 50, 25, 10, 4}, // level 2 {100000, 25000, 100, 75, 50, 20, 5} // level 3 }; if(VehicleInfo[vehicleid][vTrunk] > 0) { return stashCapacities[VehicleInfo[vehicleid][vTrunk] - 1][item]; } return 0; } GetGangStashCapacity(gangid, item) { static const stashCapacities[][] = { {1000000, 100000, 500, 500, 250, 50}, {2000000, 200000, 1000, 1000, 500, 100}, {3000000, 300000, 1500, 1500, 1000, 250} }; return stashCapacities[GangInfo[gangid][gLevel] - 1][item]; } GetHouseStashCapacity(houseid, item) { static const stashCapacities[][] = { // Cash Mats W C M P W {100000, 50000, 100, 50, 25, 20, 2}, // level 1 {250000, 75000, 250, 100, 50, 40, 4}, // level 2 {500000, 100000, 500, 250, 100, 60, 6}, // level 3 {750000, 250000, 750, 500, 200, 80, 8}, // level 4 {1000000, 500000, 1000, 750, 250, 100, 10}, // level 5 {1000000, 500000, 1000, 750, 250, 100, 10} // level 6 }; return stashCapacities[HouseInfo[houseid][hLevel] - 1][item]; } GetHouseTenantCapacity(houseid) { switch(HouseInfo[houseid][hLevel]) { case 0: return 5; case 1: return 10; case 2: return 15; case 3: return 20; case 4: return 25; case 5, 6: return 30; } return 0; } GetHouseFurnitureCapacity(houseid) { switch(HouseInfo[houseid][hLevel]) { case 0: return 50; case 1: return 100; case 2: return 150; case 3: return 250; case 4: return 400; case 5: return 500; case 6: return 9999; } return 0; } GetRandomHouse(playerid) // For pizzaboy job. { new index, houseIDs[MAX_HOUSES] = {-1, ...}; foreach(new i : House) { if(HouseInfo[i][hExists] && HouseInfo[i][hOutsideInt] == 0 && HouseInfo[i][hOutsideVW] == 0) { if(300.0 <= GetPlayerDistanceFromPoint(playerid, HouseInfo[i][hPosX], HouseInfo[i][hPosY], HouseInfo[i][hPosZ]) <= 1200.0) { if(HouseInfo[i][hDelivery]) { houseIDs[index++] = i; } } } } if(index == 0) { return -1; } return houseIDs[random(index)]; } GetNearbyHouseEx(playerid) { return GetNearbyHouse(playerid) == -1 ? GetInsideHouse(playerid) : GetNearbyHouse(playerid); } GetNearbyHouse(playerid) { foreach(new i : House) { if(HouseInfo[i][hExists] && IsPlayerInRangeOfPoint(playerid, 2.0, HouseInfo[i][hPosX], HouseInfo[i][hPosY], HouseInfo[i][hPosZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hOutsideInt] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hOutsideVW]) { return i; } } return -1; } GetInsideHouse(playerid) { foreach(new i : House) { if(HouseInfo[i][hExists] && IsPlayerInRangeOfPoint(playerid, 100.0, HouseInfo[i][hIntX], HouseInfo[i][hIntY], HouseInfo[i][hIntZ]) && GetPlayerInterior(playerid) == HouseInfo[i][hInterior] && GetPlayerVirtualWorld(playerid) == HouseInfo[i][hWorld]) { return i; } } return -1; } SetHouseOwner(houseid, playerid) { if(playerid == INVALID_PLAYER_ID) { strcpy(HouseInfo[houseid][hOwner], "Nobody", MAX_PLAYER_NAME); HouseInfo[houseid][hOwnerID] = 0; } else { GetPlayerName(playerid, HouseInfo[houseid][hOwner], MAX_PLAYER_NAME); HouseInfo[houseid][hOwnerID] = PlayerInfo[playerid][pID]; } HouseInfo[houseid][hTimestamp] = gettime(); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET timestamp = %i, ownerid = %i, owner = '%s' WHERE id = %i", HouseInfo[houseid][hTimestamp], HouseInfo[houseid][hOwnerID], HouseInfo[houseid][hOwner], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); } RemoveFurniture(objectid) { if(IsValidDynamicObject(objectid) && Streamer_GetExtraInt(objectid, E_OBJECT_TYPE) == E_OBJECT_FURNITURE) { new id = Streamer_GetExtraInt(objectid, E_OBJECT_INDEX_ID); DeleteFurnitureObject(objectid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM furniture WHERE id = %i", id); mysql_tquery(connectionID, queryBuffer); } } DeleteFurnitureObject(objectid) { if(IsValidDynamicObject(objectid) && Streamer_GetExtraInt(objectid, E_OBJECT_TYPE) == E_OBJECT_FURNITURE) { new Text3D:textid = Text3D:Streamer_GetExtraInt(objectid, E_OBJECT_3DTEXT_ID); if(IsValidDynamic3DTextLabel(textid)) { DestroyDynamic3DTextLabel(textid); } DestroyDynamicObject(objectid); } } RemoveAllFurniture(houseid) { if(HouseInfo[houseid][hExists]) { for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_FURNITURE && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == HouseInfo[houseid][hID]) { DeleteFurnitureObject(i); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM furniture WHERE houseid = %i", HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); } } ReloadFurniture(objectid, labels) { if(IsValidDynamicObject(objectid) && Streamer_GetExtraInt(objectid, E_OBJECT_TYPE) == E_OBJECT_FURNITURE) { new id = Streamer_GetExtraInt(objectid, E_OBJECT_INDEX_ID); DeleteFurnitureObject(objectid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM furniture WHERE id = %i", id); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOAD_FURNITURE, labels); } } ReloadAllFurniture(houseid) { if(HouseInfo[houseid][hExists]) { for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_FURNITURE && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == HouseInfo[houseid][hID]) { DeleteFurnitureObject(i); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM furniture WHERE houseid = %i", HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOAD_FURNITURE, HouseInfo[houseid][hLabels]); } } ReloadHouse(houseid) { if(HouseInfo[houseid][hExists]) { new string[128], type[16]; DestroyDynamic3DTextLabel(HouseInfo[houseid][hText]); DestroyDynamicPickup(HouseInfo[houseid][hPickup]); if(HouseInfo[houseid][hType] == -1) { type = "Other"; } else { strcpy(type, houseInteriors[HouseInfo[houseid][hType]][intClass]); } if(HouseInfo[houseid][hOwnerID] == 0) { format(string, sizeof(string), "[For Sale - %i]\nPrice: %s\nClass: %s\nHouse Level: %i", houseid, FormatNumber(HouseInfo[houseid][hPrice]), type, HouseInfo[houseid][hLevel]); } else { if(HouseInfo[houseid][hRentPrice] > 0) { format(string, sizeof(string), "[House - %i]\nOwner: %s\nClass: %s\nRent: $%i\nLevel: %i", houseid, HouseInfo[houseid][hOwner], type, HouseInfo[houseid][hRentPrice], HouseInfo[houseid][hLevel]); } else { format(string, sizeof(string), "[House - %i]\nOwner: %s\nClass: %s\nHouse Level: %i", houseid, HouseInfo[houseid][hOwner], type, HouseInfo[houseid][hLevel]); } } HouseInfo[houseid][hText] = CreateDynamic3DTextLabel(string, COLOR_AQUA, HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ] + 0.1, 10.0, .worldid = HouseInfo[houseid][hOutsideVW], .interiorid = HouseInfo[houseid][hOutsideInt]); HouseInfo[houseid][hPickup] = CreateDynamicPickup(1273, 1, HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ], .worldid = HouseInfo[houseid][hOutsideVW], .interiorid = HouseInfo[houseid][hOutsideInt]); // HouseInfo[houseid][hMapIcon] = CreateDynamicMapIcon(HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ], 31, 1, -1, -1, -1, 100.0); } } IsNumeric(const string[]) { new len = strlen(string), i; if(string[0] == '-') i = 1; while(i < len) { if(!('0' <= string[i++] <= '9')) return 0; } return 1; } GetVehicleParams(vehicleid, param) { new params[7]; GetVehicleParamsEx(vehicleid, params[0], params[1], params[2], params[3], params[4], params[5], params[6]); return params[param] == VEHICLE_PARAMS_ON; } SetVehicleParams(vehicleid, param, status) { new params[7]; GetVehicleParamsEx(vehicleid, params[0], params[1], params[2], params[3], params[4], params[5], params[6]); params[param] = status; return SetVehicleParamsEx(vehicleid, params[0], params[1], params[2], params[3], params[4], params[5], params[6]); } Float:GetVehicleSpeedMPH(vehicleid) { new Float:x, Float:y, Float:z; if(GetVehicleVelocity(vehicleid, x, y, z)) { return floatsqroot((x * x) + (y * y) + (z * z)) * 100; } return 0.0; } Float:GetVehicleSpeed(vehicleid) { new Float:x, Float:y, Float:z; if(GetVehicleVelocity(vehicleid, x, y, z)) { return floatsqroot((x * x) + (y * y) + (z * z)) * 181.5; } return 0.0; } VehicleHasWindows(vehicleid) { static const vehicleWindows[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0 }; new model = GetVehicleModel(vehicleid); if(400 <= model <= 611) { return vehicleWindows[model - 400]; } return 0; } VehicleHasEngine(vehicleid) { static const vehicleEngines[] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0 }; new modelid = GetVehicleModel(vehicleid); if(400 <= modelid <= 611) { return vehicleEngines[modelid - 400]; } return 0; } GetVehicleSeatCount(vehicleid) { static const vehicleSeats[] = { 4, 2, 2, 2, 4, 4, 1, 2, 2, 4, 2, 2, 2, 4, 2, 2, 4, 2, 4, 2, 4, 4, 2, 2, 2, 1, 4, 4, 4, 2, 1, 7, 1, 2, 2, 0, 2, 7, 4, 2, 4, 1, 2, 2, 2, 4, 1, 2, 1, 0, 0, 2, 1, 1, 1, 2, 2, 2, 4, 4, 2, 2, 2, 2, 1, 1, 4, 4, 2, 2, 4, 2, 1, 1, 2, 2, 1, 2, 2, 4, 2, 1, 4, 3, 1, 1, 1, 4, 2, 2, 4, 2, 4, 1, 2, 2, 2, 4, 4, 2, 2, 1, 2, 2, 2, 2, 2, 4, 2, 1, 1, 2, 1, 1, 2, 2, 4, 2, 2, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 4, 1, 1, 1, 2, 2, 2, 2, 7, 7, 1, 4, 2, 2, 2, 2, 2, 4, 4, 2, 2, 4, 4, 2, 1, 2, 2, 2, 2, 2, 2, 4, 4, 2, 2, 1, 2, 4, 4, 1, 0, 0, 1, 1, 2, 1, 2, 2, 1, 2, 4, 4, 2, 4, 1, 0, 4, 2, 2, 2, 2, 0, 0, 7, 2, 2, 1, 4, 4, 4, 2, 2, 2, 2, 2, 4, 2, 0, 0, 0, 4, 0, 0 }; new modelid = GetVehicleModel(vehicleid); if(400 <= modelid <= 611) { return vehicleSeats[modelid - 400]; } return 0; } IsSeatOccupied(vehicleid, seatid) { foreach(new i : Player) { if(IsPlayerInVehicle(i, vehicleid) && GetPlayerVehicleSeat(i) == seatid) { return 1; } } return 0; } GetVehicleName(vehicleid) { new modelid = GetVehicleModel(vehicleid), name[32]; if(400 <= modelid <= 611) strcat(name, vehicleNames[modelid - 400]); else name = "Unknown"; return name; } GetVehicleModelByName(const string[]) { new modelid = strval(string); if(400 <= modelid <= 611) { return modelid; } for(new i = 0; i < sizeof(vehicleNames); i ++) { if(strfind(vehicleNames[i], string, true) != -1) { return i + 400; } } return 0; } GetVehicleDriver(vehicleid) { foreach(new i : Player) { if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER) { return i; } } return INVALID_PLAYER_ID; } IsVehicleOccupied(vehicleid) { foreach(new i : Player) { if(IsPlayerInVehicle(i, vehicleid) && GetPlayerState(i) == PLAYER_STATE_DRIVER) { return 1; } } return 0; } AnticheatCheck(playerid) { if(gettime() > PlayerInfo[playerid][pACTime] && !PlayerInfo[playerid][pKicked]) { // Speedhacking if((gAnticheat) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetVehicleSpeed(GetPlayerVehicleID(playerid)) > 350 && PlayerInfo[playerid][pAdmin] < 2 && !IsAPlane(GetPlayerVehicleID(playerid)) && !IsAHelicopter(GetPlayerVehicleID(playerid))) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly speedhacking, speed: %.1f km/h.", GetPlayerRPName(playerid), playerid, GetVehicleSpeed(GetPlayerVehicleID(playerid))); Log_Write("log_cheat", "%s (uid: %i) possibly speedhacked, speed: %.1f km/h", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleSpeed(GetPlayerVehicleID(playerid))); } // Jetpack if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK && PlayerInfo[playerid][pAdmin] < 2 && !PlayerInfo[playerid][pJetpack]) { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Jetpack", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Jetpack"); } // Flying hacks if((gAnticheat) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { switch(GetPlayerAnimationIndex(playerid)) { case 958, 1538, 1539, 1543: { new Float:z, Float:vx, Float:vy, Float:vz; GetPlayerPos(playerid, z, z, z); GetPlayerVelocity(playerid, vx, vy, vz); if((z > 30.0) && (0.9 <= floatsqroot((vx * vx) + (vy * vy) + (vz * vz)) <= 1.9) && PlayerInfo[playerid][pAdmin] < 2) { SendClientMessageToAllEx(COLOR_YELLOW, "AdmCmd: %s was kicked by %s, reason: Flying hacks", GetPlayerRPName(playerid), SERVER_ANTICHEAT); KickPlayer(playerid); } } } } // Armor hacks if(!PlayerInfo[playerid][pJoinedEvent]) { new Float:armor; GetPlayerArmour(playerid, armor); if(floatround(armor) > floatround(PlayerInfo[playerid][pArmor]) && gettime() > PlayerInfo[playerid][pACTime] && gettime() > PlayerInfo[playerid][pArmorTime] && PlayerInfo[playerid][pAdmin] < 2) { PlayerInfo[playerid][pACWarns]++; PlayerInfo[playerid][pArmorTime] = gettime() + 10; if(PlayerInfo[playerid][pACWarns] < MAX_ANTICHEAT_WARNINGS) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly armor hacking. (old: %.2f, new: %.2f)", GetPlayerRPName(playerid), playerid, PlayerInfo[playerid][pArmor], armor); Log_Write("log_cheat", "%s (uid: %i) possibly hacked armor. (old: %.2f, new: %.2f)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], PlayerInfo[playerid][pArmor], armor); } else { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Armor hacking", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Armor hacking"); } PlayerInfo[playerid][pArmor] = armor; } } } // Ammo hacks if(!PlayerInfo[playerid][pJoinedEvent] && !(PlayerInfo[playerid][pTazer] && GetPlayerWeapon(playerid) == 23)) { new weapon, ammo; GetPlayerWeaponData(playerid, 8, weapon, ammo); if((16 <= weapon <= 18) && ammo <= 0) { RemovePlayerWeapon(playerid, weapon); } } // Warping into vehicles while locked /*if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && GetVehicleParams(GetPlayerVehicleID(playerid), VEHICLE_DOORS) && (!IsVehicleOwner(playerid, GetPlayerVehicleID(playerid)) && PlayerInfo[playerid][pVehicleKeys] != GetPlayerVehicleID(playerid))) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z + 1.0); GameTextForPlayer(playerid, "~r~This vehicle is locked!", 3000, 3); }*/ } IsAnIP(ip[]) { new part[4]; if(!sscanf(ip, "p<.>iiii", part[0], part[1], part[2], part[3])) { return (0 <= part[0] <= 255) && (0 <= part[1] <= 255) && (0 <= part[2] <= 255) && (0 <= part[3] <= 255); } else if(!sscanf(ip, "p<.>iicc", part[0], part[1], part[2], part[3])) { return (0 <= part[0] <= 255) && (0 <= part[1] <= 255) && (part[2] == '*' && part[3] == '*'); } return 0; } IsValidName(name[]) { for(new i = 0, j = strlen(name); i < j; i ++) { if(!(3 <= j <= MAX_PLAYER_NAME)) return 0; switch(name[i]) { case 'A'..'Z', 'a'..'z', '0'..'9', '_', '.', '[', ']', '(', ')', '=', '@': { continue; } default: { return 0; } } } return 1; } IsValidModel(modelid) { static modeldat[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -128, -515899393, -134217729, -1, -1, 33554431, -1, -1, -1, -14337, -1, -33, 127, 0, 0, 0, 0, 0, -8388608, -1, -1, -1, -16385, -1, -1, -1, -1, -1, -1, -1, -33, -1, -771751937, -1, -9, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 33554431, -25, -1, -1, -1, -1, -1, -1, -1073676289, -2147483648, 34079999, 2113536, -4825600, -5, -1, -3145729, -1, -16777217, -63, -1, -1, -1, -1, -201326593, -1, -1, -1, -1, -1, -257, -1, 1073741823, -133122, -1, -1, -65, -1, -1, -1, -1, -1, -1, -2146435073, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1073741823, -64, -1, -1, -1, -1, -2635777, 134086663, 0, -64, -1, -1, -1, -1, -1, -1, -1, -536870927, -131069, -1, -1, -1, -1, -1, -1, -1, -1, -16384, -1, -33554433, -1, -1, -1, -1, -1, -1610612737, 524285, -128, -1, 2080309247, -1, -1, -1114113, -1, -1, -1, 66977343, -524288, -1, -1, -1, -1, -2031617, -1, 114687, -256, -1, -4097, -1, -4097, -1, -1, 1010827263, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32768, -1, -1, -1, -1, -1, 2147483647, -33554434, -1, -1, -49153, -1148191169, 2147483647, -100781080, -262145, -57, 134217727, -8388608, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1048577, -1, -449, -1017, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1835009, -2049, -1, -1, -1, -1, -1, -1, -8193, -1, -536870913, -1, -1, -1, -1, -1, -87041, -1, -1, -1, -1, -1, -1, -209860, -1023, -8388609, -2096897, -1, -1048577, -1, -1, -1, -1, -1, -1, -897, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1610612737, -3073, -28673, -1, -1, -1, -1537, -1, -1, -13, -1, -1, -1, -1, -1985, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1056964609, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -236716037, -1, -1, -1, -1, -1, -1, -1, -536870913, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2097153, -2109441, -1, 201326591, -4194304, -1, -1, -241, -1, -1, -1, -1, -1, -1, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32768, -1, -1, -1, -2, -671096835, -1, -8388609, -66323585, -13, -1793, -32257, -247809, -1, -1, -513, 16252911, 0, 0, 0, -131072, 33554383, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 8356095, 0, 0, 0, 0, 0, 0, -256, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -268435449, -1, -1, -2049, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 92274627, -65536, -2097153, -268435457, 591191935, 1, 0, -16777216, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 127 }; if((modelid >= 0) && ((modelid / 32) < sizeof (modeldat)) && (modeldat[modelid / 32] & (1 << (modelid % 32)))) { return 1; } if((18632 <= modelid <= 19999) || (11682 <= modelid <= 11753)) { return 1; } return 0; } forward SetVehicleEngine(vehicleid, playerid); public SetVehicleEngine(vehicleid, playerid) { if(PlayerInfo[playerid][pLogged]) { PlayerInfo[playerid][pEngine] = 0; if(PlayerInfo[playerid][pCrash]) { switch(random(2)) { case 0: { SetVehicleParams(vehicleid, VEHICLE_ENGINE, true); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "Engine started. ((%s))", GetPlayerRPName(playerid)); PlayerInfo[playerid][pCrash] = 0; return 1; } case 1: { SetVehicleParams(vehicleid, VEHICLE_ENGINE, false); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s attempts to turn on the engine of the %s but fails.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); return 1; } } } SetVehicleParams(vehicleid, VEHICLE_ENGINE, true); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "Engine started. ((%s))", GetPlayerRPName(playerid)); } return 1; } IsPlayerOnline(const name[], &id = INVALID_PLAYER_ID) { foreach(new i : Player) { if(!strcmp(GetPlayerNameEx(i), name, true) && PlayerInfo[i][pLogged]) { id = i; return 1; } } id = INVALID_PLAYER_ID; return 0; } /*IsPlayerSpawned(playerid) { switch(GetPlayerState(playerid)) { case PLAYER_STATE_NONE, PLAYER_STATE_WASTED, PLAYER_STATE_SPECTATING: { return 0; } } return 1; }*/ IsPlayerAiming(playerid) { new keys, ud, lr; GetPlayerKeys(playerid, keys, ud, lr); if((keys & KEY_HANDBRAKE) & KEY_HANDBRAKE && (22 <= GetPlayerWeapon(playerid) <= 38)) { switch(GetPlayerAnimationIndex(playerid)) { case 1160..1167, 360..363, 220, 640, 1189, 1331, 1365, 1453, 1449, 1643: { return 1; } } } return 0; } IsPointInRangeOfPoint(Float:x1, Float:y1, Float:z1, Float:radius, Float:x2, Float:y2, Float:z2) { x1 -= x2; y1 -= y2; z1 -= z2; return ((x1 * x1) + (y1 * y1) + (z1 * z1)) < (radius * radius); } IsVehicleInGarage(vehicleid, garageid) { new Float:x, Float:y, Float:z; GetVehiclePos(vehicleid, x, y, z); return IsPointInRangeOfPoint(x, y, z, 50.0, garageInteriors[GarageInfo[garageid][gType]][intVX], garageInteriors[GarageInfo[garageid][gType]][intVY], garageInteriors[GarageInfo[garageid][gType]][intVZ]) && GetVehicleVirtualWorld(vehicleid) == GarageInfo[garageid][gWorld]; } IsPlayerInMiningArea(playerid) { for(new i = 0; i < sizeof(minerPositions); i ++) { if(IsPlayerInRangeOfPoint(playerid, 4.0, minerPositions[i][0], minerPositions[i][1], minerPositions[i][2])) { return 1; } } return 0; } IsPlayerAtFuelStation(playerid) { if(IsPlayerInRangeOfPoint(playerid, 12.0, 70.4957,1217.7952,18.8132) || IsPlayerInRangeOfPoint(playerid, 12.0, 1944.3260, -1772.9254, 13.3906) || IsPlayerInRangeOfPoint(playerid, 12.0, -90.5515, -1169.4578, 2.4079) || IsPlayerInRangeOfPoint(playerid, 12.0, -1609.7958, -2718.2048, 48.5391)) { return 1; } else if(IsPlayerInRangeOfPoint(playerid, 12.0, -2029.4968, 156.4366, 28.9498) || IsPlayerInRangeOfPoint(playerid, 12.0, -2408.7590, 976.0934, 45.4175) || IsPlayerInRangeOfPoint(playerid, 12.0, -2243.9629, -2560.6477, 31.8841) || IsPlayerInRangeOfPoint(playerid, 12.0, -1676.6323, 414.0262, 6.9484)) { return 1; } else if(IsPlayerInRangeOfPoint(playerid, 12.0, 2202.2349, 2474.3494, 10.5258) || IsPlayerInRangeOfPoint(playerid, 12.0, 614.9333, 1689.7418, 6.6968) || IsPlayerInRangeOfPoint(playerid, 12.0, -1328.8250, 2677.2173, 49.7665) || IsPlayerInRangeOfPoint(playerid, 12.0, 70.3882, 1218.6783, 18.5165)) { return 1; } else if(IsPlayerInRangeOfPoint(playerid, 12.0, 654.9641, -559.7485, 16.5015) || IsPlayerInRangeOfPoint(playerid, 12.0, 654.9617, -570.4176, 16.5015) || IsPlayerInRangeOfPoint(playerid, 12.0, 1382.9899, 461.9903, 20.1245) || IsPlayerInRangeOfPoint(playerid, 12.0, 1380.9395, 457.2494, 19.9260)) { return 1; } else if((IsAPlane(GetPlayerVehicleID(playerid)) || IsAHelicopter(GetPlayerVehicleID(playerid))) && IsPlayerInRangeOfPoint(playerid, 20.0, 1439.7886, -2445.6777, 13.5547)) { return 1; } else if((IsABoat(GetPlayerVehicleID(playerid))) && IsPlayerInRangeOfPoint(playerid, 10.0, 133.461380, -1815.096557, 3.989328) || IsPlayerInRangeOfPoint(playerid, 10.0, 138.547210, -1815.308593, 3.989328) || IsPlayerInRangeOfPoint(playerid, 10.0, 144.042800, -1815.534912, 3.989328)) { return 1; } return 0; } IsPlayerAtFishingPlace(playerid) { if(IsPlayerInRangeOfPoint(playerid, 1.0, -419.2844,1163.5040,2.1437) || IsPlayerInRangeOfPoint(playerid, 1.0, 398.7553, -2088.7490, 7.8359) || IsPlayerInRangeOfPoint(playerid, 1.0, 396.2197, -2088.6692, 7.8359) || IsPlayerInRangeOfPoint(playerid, 1.0, 391.1094, -2088.7976, 7.8359)) { return 1; } else if(IsPlayerInRangeOfPoint(playerid, 1.0, 383.4157, -2088.7849, 7.8359) || IsPlayerInRangeOfPoint(playerid, 1.0, 374.9598, -2088.7979, 7.8359) || IsPlayerInRangeOfPoint(playerid, 1.0, 369.8107, -2088.7927, 7.8359) || IsPlayerInRangeOfPoint(playerid, 1.0, 367.3637, -2088.7925, 7.8359)) { return 1; } else if(IsPlayerInRangeOfPoint(playerid, 1.0, 362.2244, -2088.7981, 7.8359) || IsPlayerInRangeOfPoint(playerid, 1.0, 354.5382, -2088.7979, 7.8359)) { return 1; } return 0; } IsPlayerInRangeOfDynamicObject(playerid, objectid, Float:radius) { if(IsValidDynamicObject(objectid)) { new interiorid = Streamer_GetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_INTERIOR_ID), worldid = Streamer_GetIntData(STREAMER_TYPE_OBJECT, objectid, E_STREAMER_WORLD_ID), Float:x, Float:y, Float:z; GetDynamicObjectPos(objectid, x, y, z); if(interiorid == -1) { interiorid = GetPlayerInterior(playerid); } if(worldid == -1) { worldid = GetPlayerVirtualWorld(playerid); } if(IsPlayerInRangeOfPoint(playerid, radius, x, y, z) && GetPlayerInterior(playerid) == interiorid && GetPlayerVirtualWorld(playerid) == worldid) { return 1; } } return 0; } IsPlayerInRangeOfPlayer(playerid, targetid, Float:radius) { new Float:x, Float:y, Float:z; GetPlayerPos(targetid, x, y, z); if(IsPlayerInRangeOfPoint(playerid, radius, x, y, z) && GetPlayerInterior(playerid) == GetPlayerInterior(targetid) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(targetid)) { return 1; } return 0; } SetMusicStream(type, extraid, url[]) { switch(type) { case MUSIC_MP3PLAYER: { if(isnull(url) && PlayerInfo[extraid][pStreamType] == type) { StopAudioStreamForPlayer(extraid); PlayerInfo[extraid][pStreamType] = MUSIC_NONE; } else { PlayAudioStreamForPlayer(extraid, url); PlayerInfo[extraid][pStreamType] = type; } } case MUSIC_BOOMBOX: { foreach(new i : Player) { if(PlayerInfo[i][pBoomboxListen] == extraid) { if(isnull(url) && PlayerInfo[i][pStreamType] == type) { StopAudioStreamForPlayer(i); PlayerInfo[i][pStreamType] = MUSIC_NONE; } else if(PlayerInfo[i][pStreamType] == MUSIC_NONE || PlayerInfo[i][pStreamType] == MUSIC_BOOMBOX) { PlayAudioStreamForPlayer(i, url); PlayerInfo[i][pStreamType] = type; } } } strcpy(PlayerInfo[extraid][pBoomboxURL], url, 128); } case MUSIC_VEHICLE: { foreach(new i : Player) { if(IsPlayerInVehicle(i, extraid)) { if(isnull(url) && PlayerInfo[i][pStreamType] == type) { StopAudioStreamForPlayer(i); PlayerInfo[i][pStreamType] = MUSIC_NONE; } else if(PlayerInfo[i][pStreamType] == MUSIC_NONE || PlayerInfo[i][pStreamType] == MUSIC_VEHICLE) { PlayAudioStreamForPlayer(i, url); PlayerInfo[i][pStreamType] = type; } } } strcpy(vehicleStream[extraid], url, 128); } } } DestroyWeedPlant(playerid) { if(PlayerInfo[playerid][pWeedPlanted]) { DestroyDynamicObject(PlayerInfo[playerid][pWeedObject]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weedplanted = 0, weedtime = 0, weedgrams = 0, weed_x = 0.0, weed_y = 0.0, weed_z = 0.0, weed_a = 0.0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[playerid][pWeedPlanted] = 0; PlayerInfo[playerid][pWeedTime] = 0; PlayerInfo[playerid][pWeedGrams] = 0; PlayerInfo[playerid][pWeedX] = 0.0; PlayerInfo[playerid][pWeedY] = 0.0; PlayerInfo[playerid][pWeedZ] = 0.0; PlayerInfo[playerid][pWeedA] = 0.0; } } DestroyBoombox(playerid) { if(PlayerInfo[playerid][pBoomboxPlaced]) { DestroyDynamicObject(PlayerInfo[playerid][pBoomboxObject]); DestroyDynamic3DTextLabel(PlayerInfo[playerid][pBoomboxText]); PlayerInfo[playerid][pBoomboxObject] = INVALID_OBJECT_ID; PlayerInfo[playerid][pBoomboxText] = Text3D:INVALID_3DTEXT_ID; PlayerInfo[playerid][pBoomboxPlaced] = 0; PlayerInfo[playerid][pBoomboxURL] = 0; } } GetNearbyBoombox(playerid) { foreach(new i : Player) { if(PlayerInfo[i][pBoomboxPlaced] && IsPlayerInRangeOfDynamicObject(playerid, PlayerInfo[i][pBoomboxObject], 30.0)) { return i; } } return INVALID_PLAYER_ID; } SendClientMessageEx(playerid, color, const text[], {Float,_}:...) { static args, str[192]; if((args = numargs()) <= 3) { SendClientMessage(playerid, color, text); } else { while(--args >= 3) { #emit LCTRL 5 #emit LOAD.alt args #emit SHL.C.alt 2 #emit ADD.C 12 #emit ADD #emit LOAD.I #emit PUSH.pri } #emit PUSH.S text #emit PUSH.C 192 #emit PUSH.C str #emit PUSH.S 8 #emit SYSREQ.C format #emit LCTRL 5 #emit SCTRL 4 SendClientMessage(playerid, color, str); #emit RETN } return 1; } SendClientMessageToAllEx(color, const text[], {Float,_}:...) { static args, str[192]; if((args = numargs()) <= 2) { foreach(new i : Player) { if(PlayerInfo[i][pLogged]) { SendClientMessage(i, color, text); } } } else { while(--args >= 2) { #emit LCTRL 5 #emit LOAD.alt args #emit SHL.C.alt 2 #emit ADD.C 12 #emit ADD #emit LOAD.I #emit PUSH.pri } #emit PUSH.S text #emit PUSH.C 192 #emit PUSH.C str #emit LOAD.S.pri 8 #emit ADD.C 4 #emit PUSH.pri #emit SYSREQ.C format #emit LCTRL 5 #emit SCTRL 4 foreach(new i : Player) { if(PlayerInfo[i][pLogged]) { SendClientMessage(i, color, str); } } #emit RETN } return 1; } Log_Write(table[], const text[], {Float,_}:...) { static args, str[1024]; if((args = numargs()) <= 2) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO %e VALUES(null, NOW(), '%e')", table, text); mysql_tquery(connectionID, queryBuffer); } else { while(--args >= 2) { #emit LCTRL 5 #emit LOAD.alt args #emit SHL.C.alt 2 #emit ADD.C 12 #emit ADD #emit LOAD.I #emit PUSH.pri } #emit PUSH.S text #emit PUSH.C 192 #emit PUSH.C str #emit LOAD.S.pri 8 #emit ADD.C 4 #emit PUSH.pri #emit SYSREQ.C format #emit LCTRL 5 #emit SCTRL 4 mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO %e VALUES(null, NOW(), '%e')", table, str); mysql_tquery(connectionID, queryBuffer); #emit RETN } return 1; } SendFactionMessage(factionid, color, const text[], {Float,_}:...) { static args, str[192]; if((args = numargs()) <= 3) { foreach(new i : Player) { if(PlayerInfo[i][pLogged] && PlayerInfo[i][pFaction] == factionid) { SendClientMessage(i, color, text); } } } else { while(--args >= 3) { #emit LCTRL 5 #emit LOAD.alt args #emit SHL.C.alt 2 #emit ADD.C 12 #emit ADD #emit LOAD.I #emit PUSH.pri } #emit PUSH.S text #emit PUSH.C 192 #emit PUSH.C str #emit PUSH.S 8 #emit SYSREQ.C format #emit LCTRL 5 #emit SCTRL 4 foreach(new i : Player) { if(PlayerInfo[i][pLogged] && PlayerInfo[i][pFaction] == factionid) { SendClientMessage(i, color, str); } } #emit RETN } return 1; } SendGangMessage(gangid, color, const text[], {Float,_}:...) { static args, str[192]; if((args = numargs()) <= 3) { foreach(new i : Player) { if(PlayerInfo[i][pLogged] && PlayerInfo[i][pGang] == gangid) { SendClientMessage(i, color, text); } } } else { while(--args >= 3) { #emit LCTRL 5 #emit LOAD.alt args #emit SHL.C.alt 2 #emit ADD.C 12 #emit ADD #emit LOAD.I #emit PUSH.pri } #emit PUSH.S text #emit PUSH.C 192 #emit PUSH.C str #emit PUSH.S 8 #emit SYSREQ.C format #emit LCTRL 5 #emit SCTRL 4 foreach(new i : Player) { if(PlayerInfo[i][pLogged] && PlayerInfo[i][pGang] == gangid) { SendClientMessage(i, color, str); } } #emit RETN } return 1; } SendGraphicMessage(color, string2[]) { foreach(Player, i) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pGraphic] >= 1 || PlayerInfo[i][pAdmin] >= 5) { SendClientMessage(i, color, string2); } } } } SendFMMessage(color, string2[]) { foreach(Player, i) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pFactionMod] >= 1 || PlayerInfo[i][pGameAffairs] || PlayerInfo[i][pAdmin] >= 7) { SendClientMessage(i, color, string2); } } } } SendGMMessage(color, string2[]) { foreach(Player, i) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pGangMod] >= 1 || PlayerInfo[i][pGameAffairs] || PlayerInfo[i][pAdmin] >= 7) { SendClientMessage(i, color, string2); } } } } SendAPMessage(color, string2[]) { foreach(Player, i) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pAdminPersonnel] >= 1 || PlayerInfo[i][pAdmin] >= 8) { SendClientMessage(i, color, string2); } } } } SendWDMessage(color, string2[]) { foreach(Player, i) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pWebDev] >= 1 || PlayerInfo[i][pAdmin] >= 8) { SendClientMessage(i, color, string2); } } } } SendDGAMessage(color, string2[]) { foreach(Player, i) { if(IsPlayerConnected(i)) { if(PlayerInfo[i][pGameAffairs] >= 1 || PlayerInfo[i][pAdmin] >= 8) { SendClientMessage(i, color, string2); } } } } SendAdminMessage(color, const text[], {Float,_}:...) { static args, str[192]; if((args = numargs()) <= 2) { foreach(new i : Player) { if(PlayerInfo[i][pLogged] && PlayerInfo[i][pAdmin] > 0) { SendClientMessage(i, color, text); } } print(text); } else { while(--args >= 2) { #emit LCTRL 5 #emit LOAD.alt args #emit SHL.C.alt 2 #emit ADD.C 12 #emit ADD #emit LOAD.I #emit PUSH.pri } #emit PUSH.S text #emit PUSH.C 192 #emit PUSH.C str #emit LOAD.S.pri 8 #emit ADD.C 4 #emit PUSH.pri #emit SYSREQ.C format #emit LCTRL 5 #emit SCTRL 4 foreach(new i : Player) { if(PlayerInfo[i][pLogged] && PlayerInfo[i][pAdmin] > 0) { SendClientMessage(i, color, str); } } print(str); #emit RETN } return 1; } SendHelperMessage(color, const text[], {Float,_}:...) { static args, str[192]; if((args = numargs()) <= 2) { foreach(new i : Player) { if(PlayerInfo[i][pLogged] && PlayerInfo[i][pHelper] > 0) { SendClientMessage(i, color, text); } } print(text); } else { while(--args >= 2) { #emit LCTRL 5 #emit LOAD.alt args #emit SHL.C.alt 2 #emit ADD.C 12 #emit ADD #emit LOAD.I #emit PUSH.pri } #emit PUSH.S text #emit PUSH.C 192 #emit PUSH.C str #emit LOAD.S.pri 8 #emit ADD.C 4 #emit PUSH.pri #emit SYSREQ.C format #emit LCTRL 5 #emit SCTRL 4 foreach(new i : Player) { if(PlayerInfo[i][pLogged] && PlayerInfo[i][pHelper] > 0) { SendClientMessage(i, color, str); } } print(str); #emit RETN } return 1; } SendTurfMessage(turfid, color, const text[], {Float,_}:...) { static args, str[192]; if((args = numargs()) <= 3) { foreach(new i : Player) { if(PlayerInfo[i][pLogged] && GetNearbyTurf(i) == turfid) { SendClientMessage(i, color, text); } } } else { while(--args >= 3) { #emit LCTRL 5 #emit LOAD.alt args #emit SHL.C.alt 2 #emit ADD.C 12 #emit ADD #emit LOAD.I #emit PUSH.pri } #emit PUSH.S text #emit PUSH.C 192 #emit PUSH.C str #emit PUSH.S 8 #emit SYSREQ.C format #emit LCTRL 5 #emit SCTRL 4 foreach(new i : Player) { if(PlayerInfo[i][pLogged] && GetNearbyTurf(i) == turfid) { SendClientMessage(i, color, str); } } #emit RETN } return 1; } SendStaffMessage(color, const text[], {Float,_}:...) { static args, str[192]; if((args = numargs()) <= 2) { foreach(new i : Player) { if(PlayerInfo[i][pLogged] && (PlayerInfo[i][pAdmin] > 0 || PlayerInfo[i][pHelper] > 0)) { SendClientMessage(i, color, text); } } print(text); } else { while(--args >= 2) { #emit LCTRL 5 #emit LOAD.alt args #emit SHL.C.alt 2 #emit ADD.C 12 #emit ADD #emit LOAD.I #emit PUSH.pri } #emit PUSH.S text #emit PUSH.C 192 #emit PUSH.C str #emit LOAD.S.pri 8 #emit ADD.C 4 #emit PUSH.pri #emit SYSREQ.C format #emit LCTRL 5 #emit SCTRL 4 foreach(new i : Player) { if(PlayerInfo[i][pLogged] && (PlayerInfo[i][pAdmin] > 0 || PlayerInfo[i][pHelper] > 0)) { SendClientMessage(i, color, str); } } print(str); #emit RETN } return 1; } SetPlayerBubbleText(playerid, Float:drawdistance, color, text[], {Float,_}:...) { static args, str[192]; if((args = numargs()) <= 4) { SetPlayerChatBubble(playerid, text, color, drawdistance, 8000); } else { while(--args >= 4) { #emit LCTRL 5 #emit LOAD.alt args #emit SHL.C.alt 2 #emit ADD.C 12 #emit ADD #emit LOAD.I #emit PUSH.pri } #emit PUSH.S text #emit PUSH.C 192 #emit PUSH.C str #emit LOAD.S.pri 8 #emit CONST.alt 4 #emit SUB #emit PUSH.pri #emit SYSREQ.C format #emit LCTRL 5 #emit SCTRL 4 SetPlayerChatBubble(playerid, str, color, drawdistance, 8000); #emit RETN } return 1; } SendProximityMessage(playerid, Float:radius, color, const text[], {Float,_}:...) { static args, str[192]; if((args = numargs()) <= 4) { foreach(new i : Player) { if(IsPlayerInRangeOfPlayer(i, playerid, radius) || PlayerInfo[i][pListen]) { SendClientMessage(i, color, text); } } } else { while(--args >= 4) { #emit LCTRL 5 #emit LOAD.alt args #emit SHL.C.alt 2 #emit ADD.C 12 #emit ADD #emit LOAD.I #emit PUSH.pri } #emit PUSH.S text #emit PUSH.C 192 #emit PUSH.C str #emit LOAD.S.pri 8 #emit CONST.alt 4 #emit SUB #emit PUSH.pri #emit SYSREQ.C format #emit LCTRL 5 #emit SCTRL 4 foreach(new i : Player) { if(IsPlayerInRangeOfPlayer(i, playerid, radius) || PlayerInfo[i][pListen]) { SendClientMessage(i, color, str); } } #emit RETN } return 1; } SendProximityFadeMessage(playerid, Float:radius, const text[], color1, color2, color3, color4, color5) { foreach(new i : Player) { if(IsPlayerInRangeOfPlayer(i, playerid, radius / 16)) { SendClientMessage(i, color1, text); } else if(IsPlayerInRangeOfPlayer(i, playerid, radius / 8)) { SendClientMessage(i, color2, text); } else if(IsPlayerInRangeOfPlayer(i, playerid, radius / 4)) { SendClientMessage(i, color3, text); } else if(IsPlayerInRangeOfPlayer(i, playerid, radius / 2)) { SendClientMessage(i, color4, text); } else if(IsPlayerInRangeOfPlayer(i, playerid, radius)) { SendClientMessage(i, color5, text); } else if(PlayerInfo[i][pListen]) { SendClientMessage(i, color5, text); } } } // --------------------------------------- forward TutorialTimer(playerid, stage); public TutorialTimer(playerid, stage) { //new string[2048]; if(PlayerInfo[playerid][pLogged] && PlayerInfo[playerid][pTutorial]) { switch(stage) { /*case 1: { ClearChat(playerid); ShowTutorialTextDraws(playerid); InterpolateCameraPos(playerid, -37.715755, -2101.054931, 121.661994, 3031.810302, -638.207458, 196.425064, 12000); InterpolateCameraLookAt(playerid, -33.558185, -2098.420898, 120.781112, 3028.381103, -641.794555, 195.814514, 12000); format(string, sizeof(string), "Welcome to Emerald City Rolepaly! Thanks for choosing us as your Roleplay Destination, we hope you enjoy your stay!"); strcat(string, "~n~Here at Gold, we pride ourselves in being a Medium Roleplay Community. Roleplay that is actually fun!"); strcat(string, "~n~What fun is a community where the rules are so strict, you've got to roleplay breathing? We ain't got time for that."); strcat(string, "~n~Anyway, please enjoy this short introduction to get to know Emerald City Rolepaly on a personal level."); TextDrawSetString(Tutorial[2], string); PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 16000, false, "ii", playerid, 2); } case 2: { ClearChat(playerid); InterpolateCameraPos(playerid, 3022.353027, -640.721740, 193.414672, 1227.661254, -1835.082397, 25.913717, 12000); InterpolateCameraLookAt(playerid, 3019.046142, -644.348388, 192.459640, 1226.208251, -1830.758422, 23.866357, 12000); SetPlayerPos(playerid, 1223.7166,-1851.4952,8.3894); format(string, sizeof(string), "You're about to see our Department of Motor Vehicles. This is where you'll obtain your drivers license."); strcat(string, "~n~While you may drive without a license, it is recommended that you obtain one, else LSPD will be after you!"); strcat(string, "~n~Once you've obtained your drivers license, it's time to get a job! We have many great jobs to offer."); strcat(string, "~n~If you're looking for a decent starting job, try out our courier job, garbage man job, or miner job!"); TextDrawSetString(Tutorial[2], string); PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 15000, false, "ii", playerid, 3); } case 3: { PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 1000, false, "ii", playerid, 4); } case 4: { ClearChat(playerid); InterpolateCameraPos(playerid, 1244.807250, -1896.417480, 62.970653, 1320.417602, -1480.743286, 78.601524, 5000); InterpolateCameraLookAt(playerid, 1243.523193, -1892.262817, 60.502914, 1318.168212, -1476.724731, 76.654434, 5000); SetPlayerPos(playerid, 1310.9757,-1445.2444,-27.2783); format(string, sizeof(string), "This is the market area, the most common hangout on Emerald City Rolepaly"); strcat(string, "~n~You'll be starting out as a level 1 newbie with no upgrades. You'll need to level up with respect points."); strcat(string, "~n~For every hour you play, you'll gain 1 respect point. You earn this on your paycheck."); strcat(string, "~n~Paychecks will be given out once every hour when the time hits xx:00."); strcat(string, "~n~As a new player, your inventory is severely limited. You'll need to upgrade it with upgrade points."); strcat(string, "~n~You'll also start out with a 2 hour weapon restriction to avoid deathmatching."); strcat(string, "~n~We believe that our upgrades system gives the players an incentive to play and work hard."); TextDrawSetString(Tutorial[2], string); PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 15000, false, "ii", playerid, 5); } case 5: { ClearChat(playerid); InterpolateCameraPos(playerid, 1320.417602, -1480.743408, 78.601516, 1482.683227, -1628.944824, 44.981044, 5000); InterpolateCameraLookAt(playerid, 1317.750488, -1476.783447, 77.116455, 1486.893188, -1631.457153, 43.999187, 5000); SetPlayerPos(playerid, 1493.3798,-1668.6997,-15.7351); format(string, sizeof(string), "Countryside Rolepaly has many great factions to offer."); strcat(string, "~n~You're currently looking at the Los Santos Police Department."); strcat(string, "~n~Factions are legal organizations, each with their own unique roles."); strcat(string, "~n~Factions are dedicated to helping the citizens of Los Santos,"); strcat(string, "~n~Whether it be enforcing the law, saving lives, or reporting the news."); strcat(string, "~n~You can apply to become a faction member on our forum at ecrp.h0v1n8.nl"); strcat(string, "~n~Being in a faction is quite fun and can lead to some good cash and perks for you!"); TextDrawSetString(Tutorial[2], string); PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 15000, false, "ii", playerid, 6); } case 6: { ClearChat(playerid); InterpolateCameraPos(playerid, 1477.633544, -1627.411010, 50.594058, 2446.644531, -1661.652465, 29.177988, 7000); InterpolateCameraLookAt(playerid, 1481.815795, -1629.860473, 49.365783, 2451.346191, -1662.243896, 27.582590, 7000); SetPlayerPos(playerid, 2467.3708,-1666.0961,7.8903); format(string, sizeof(string), "Doing things the legal way isnt your type? We've got you covered."); strcat(string, "~n~Here on Countryside Rolepaly we have an amazing gang system with many unique features!"); strcat(string, "~n~Gangs are illegal organizations you may join by roleplaying with the higher ranks."); strcat(string, "~n~Gangs offer many different types of roleplay, from street gangs to mafias & cartels."); strcat(string, "~n~Gangs main objectives are to own the city of Los Santos by capturing points & turfs"); strcat(string, "~n~Grab yourself a gun and roleplay your way into a gang!"); strcat(string, "~n~You can also apply for your own gang slot at ecrp.h0v1n8.nl!!"); TextDrawSetString(Tutorial[2], string); PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 15000, false, "ii", playerid, 7); } case 7: { ClearChat(playerid); InterpolateCameraPos(playerid, 2426.551025, -1659.479614, 44.816139, 2097.071533, -1293.159912, 29.785530, 7000); InterpolateCameraLookAt(playerid, 2431.008300, -1659.783935, 42.571231, 2095.802246, -1288.467041, 28.616756, 7000); SetPlayerPos(playerid, 2093.6177,-1302.5441,4.6590); format(string, sizeof(string), "Want your own piece of real estate? We've got you covered!"); strcat(string, "~n~Here on Countryside Rolepaly we offer a wide variety of property types you may own."); strcat(string, "~n~Buying your own house will allow you to customize the interior and store your goodies!"); strcat(string, "~n~Buying a garage will allow you to keep your car from being stolen, repair it, and upgrade it! "); strcat(string, "~n~Buying your own business is an excellent source of income! There are many different types!"); strcat(string, "~n~Lands are quite special. You can own your own piece of the map!"); strcat(string, "~n~Owning a land allows you to place walls and other objects, and customize your piece of land."); TextDrawSetString(Tutorial[2], string); PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 15000, false, "ii", playerid, 8); } case 8: { PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 1000, false, "ii", playerid, 9); } case 9: { ClearChat(playerid); InterpolateCameraPos(playerid, 2100.492675, -1313.117553, 40.094261, 2214.083496, -1122.290161, 34.281135, 7000); InterpolateCameraLookAt(playerid, 2099.261718, -1308.616088, 38.299301, 2214.811767, -1127.109375, 33.165603, 7000); SetPlayerPos(playerid, 2216.8718,-1122.6305,4.1262); format(string, sizeof(string), "Being a roleplay server, we do have rules, but we promise they're not too bad!"); strcat(string, "~n~1.) No deathmatching, e.g. killing without a proper reason. Don't ruin it for everyone else."); strcat(string, "~n~2.) No metagaming. Metagaming is mixing OOC information in character."); strcat(string, "~n~3.) No powergaming. Powergaming is commiting unrealistic acts and forcing actions upon others."); strcat(string, "~n~4.) No hacking/cheating. We have zero tolerance for people who use cheats. Permanent ban."); strcat(string, "~n~5.) No exploiting. If you find a bug that gives you an unfair advantage, report it on the forums."); strcat(string, "~n~Please visit our website - ecrp.h0v1n8.nl for a complete list of our rules.!"); TextDrawSetString(Tutorial[2], string); PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 18000, false, "ii", playerid, 10); } case 10: { ClearChat(playerid); InterpolateCameraPos(playerid, 2214.083251, -1122.290527, 34.281147, 797.200866, -1325.562011, 16.992176, 12000); InterpolateCameraLookAt(playerid, 2215.083740, -1127.120239, 33.460655, 800.632263, -1329.196899, 16.878904, 12000); SetPlayerPos(playerid, 798.7332,-1325.8041,-18.0216); format(string, sizeof(string), "Thanks for taking the time to read our tutorial, we greatly appreciate it."); strcat(string, "~n~We know you'll have tons of fun here, and meet many great people."); strcat(string, "~n~So get out there! Get a job and buy yourself some property! Make a name for yourself!"); strcat(string, "~n~You'll be spawned in just a moment."); TextDrawSetString(Tutorial[2], string); PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 15000, false, "ii", playerid, 11); }*/ case 11: { PlayerInfo[playerid][pTutorial] = 0; PlayerInfo[playerid][pSetup] = 0; HideTutorialTextDraws(playerid); SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); SetPlayerPos(playerid, 150.8411,1170.9283,15.4053); SetPlayerFacingAngle(playerid, 90.0000); SetPlayerVirtualWorld(playerid, 0); SetCameraBehindPlayer(playerid); StopAudioStreamForPlayer(playerid); TogglePlayerControllable(playerid, 1); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET setup = 0, gender = %i, age = %i, skin = %i WHERE uid = %i", PlayerInfo[playerid][pGender], PlayerInfo[playerid][pAge], PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_WHITE, "Welcome to {FF1AFF}Emerald City Roleplay{FFFFFF}. Make sure to visit FORUMS.COM for news and updates. - join our discord. discord.gg/82GtB4A"); SendClientMessage(playerid, COLOR_WHITE, "Use the {FFFF90}/gps{FFFFFF} command to point to locations of jobs, businesses, and common places."); SendStaffMessage(COLOR_YELLOW, "OnPlayerSpawn: %s[%d] has just spawned on Emerald City Roleplay for the first time!", GetPlayerRPName(playerid), playerid); ShowPlayerDialog(playerid, DIALOG_NEWBWELCOME, DIALOG_STYLE_MSGBOX, "{FFFFFF}Welcome to {FF1AFF}Emerald City Rolepaly", "Would you like a helper to show you around?", "Yes", "No"); } } } } forward Countdown(playerid, count); public Countdown(playerid, count) { foreach(new i : Player) { if(PlayerInfo[i][pJoinedEvent]) { switch(count) { case 3: { GameTextForPlayer(i, "~g~3", 1500, 3); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0); } case 2: { GameTextForPlayer(i, "~g~2", 1500, 3); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0); } case 1: { GameTextForPlayer(i, "~g~1", 1500, 3); PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0); } case 0: { GameTextForPlayer(i, "~g~Go! Go! Go!", 2000, 3); PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0); } } } } count--; if(count >= 0) { SetTimerEx("Countdown", 1000, false, "ii", playerid, count); } } #if defined SERVER_INTRO forward ShowLoginScreenTextdraw(playerid, type); public ShowLoginScreenTextdraw(playerid, type) { if(PlayerInfo[playerid][pWatchingIntro]) { if(type == 1) { TextDrawShowForPlayer(playerid, introTextdraws[3]); } else if(type == 2) { TextDrawShowForPlayer(playerid, introTextdraws[5]); } else if(type == 3) { TextDrawShowForPlayer(playerid, introTextdraws[19]); } else if(type == 4) { TextDrawShowForPlayer(playerid, introTextdraws[21]); } else if(type == 5) { TextDrawShowForPlayer(playerid, introTextdraws[24]); } else if(type == 6) { TextDrawShowForPlayer(playerid, introTextdraws[25]); } } } forward StreamNextStep(playerid, type); public StreamNextStep(playerid, type) { if(!PlayerInfo[playerid][pWatchingIntro]) { return 0; } switch(type) { case 0: { InterpolateCameraPos(playerid, 187.600982, -1791.727050, 119.087432, 193.731567, -1789.235473, 118.845245, 5000); InterpolateCameraLookAt(playerid, 189.006942, -1790.279785, 114.512641, 195.057144, -1788.512817, 114.078620, 5000); SetTimerEx("StreamNextStep", 4500, false, "ii", playerid, 1); ClearChat(playerid); TextDrawHideForPlayer(playerid, introTextdraws[2]); TextDrawHideForPlayer(playerid, introTextdraws[3]); TextDrawShowForPlayer(playerid, introTextdraws[4]); SetTimerEx("ShowLoginScreenTextdraw", 2000, false, "ii", playerid, 2); } case 1: { InterpolateCameraPos(playerid, 300.803771, -1753.841796, 59.482250, 332.887237, -1753.466674, 60.534908, 4000); InterpolateCameraLookAt(playerid, 302.467315, -1749.504394, 57.633026, 334.005126, -1748.907470, 58.813385, 4000); SetTimerEx("StreamNextStep", 4000-600, false, "ii", playerid, 2); ClearChat(playerid); TextDrawHideForPlayer(playerid, introTextdraws[4]); TextDrawHideForPlayer(playerid, introTextdraws[5]); TextDrawShowForPlayer(playerid, introTextdraws[6]); TextDrawShowForPlayer(playerid, introTextdraws[7]); } case 2: { InterpolateCameraPos(playerid, 350.840972, -1794.716308, 13.146982, 346.193756, -1800.415649, 10.697548, 8000); InterpolateCameraLookAt(playerid, 348.053558, -1790.653564, 12.295993, 342.141357, -1797.657592, 9.712170, 8000); SetTimerEx("StreamNextStep", 8000-600, false, "ii", playerid, 3); ClearChat(playerid); TextDrawHideForPlayer(playerid, introTextdraws[6]); TextDrawHideForPlayer(playerid, introTextdraws[7]); TextDrawShowForPlayer(playerid, introTextdraws[8]); TextDrawShowForPlayer(playerid, introTextdraws[9]); TextDrawShowForPlayer(playerid, introTextdraws[10]); TextDrawShowForPlayer(playerid, introTextdraws[11]); } case 3: { InterpolateCameraPos(playerid, 169.602859, -1775.647705, 6.933395, 169.617141, -1776.156250, 12.790164, 5000); InterpolateCameraLookAt(playerid, 169.547332, -1770.651367, 7.117267, 169.588928, -1771.159301, 12.618641, 5000); SetTimerEx("StreamNextStep", 4500, false, "ii", playerid, 4); ClearChat(playerid); TextDrawHideForPlayer(playerid, introTextdraws[8]); TextDrawHideForPlayer(playerid, introTextdraws[9]); TextDrawHideForPlayer(playerid, introTextdraws[10]); TextDrawHideForPlayer(playerid, introTextdraws[11]); TextDrawShowForPlayer(playerid, introTextdraws[12]); TextDrawShowForPlayer(playerid, introTextdraws[13]); } case 4: { InterpolateCameraPos(playerid, 386.273284, -2030.129516, 59.993469, 395.822113, -2044.595703, 59.993469, 5000); InterpolateCameraLookAt(playerid, 386.591949, -2029.832275, 55.012496, 396.252319, -2044.526245, 55.012496, 5000); SetTimerEx("StreamNextStep", 4500, false, "ii", playerid, 5); ClearChat(playerid); TextDrawHideForPlayer(playerid, introTextdraws[12]); TextDrawHideForPlayer(playerid, introTextdraws[13]); TextDrawShowForPlayer(playerid, introTextdraws[14]); TextDrawShowForPlayer(playerid, introTextdraws[15]); } case 5: { InterpolateCameraPos(playerid, 341.018402, -2095.904052, 6.937077, 342.805603, -2096.498535, 6.648118, 5000); InterpolateCameraLookAt(playerid, 345.258972, -2093.501220, 5.821543, 347.304443, -2094.563964, 5.639461, 5000); SetTimerEx("StreamNextStep", 4500, false, "ii", playerid, 6); ClearChat(playerid); TextDrawHideForPlayer(playerid, introTextdraws[14]); TextDrawHideForPlayer(playerid, introTextdraws[15]); TextDrawShowForPlayer(playerid, introTextdraws[16]); TextDrawShowForPlayer(playerid, introTextdraws[17]); } case 6: { InterpolateCameraPos(playerid, 481.641052, -1804.006835, 6.803627, 484.250549, -1802.375244, 6.660738, 5000); InterpolateCameraLookAt(playerid, 485.734344, -1801.318481, 5.794973, 488.679290, -1800.236572, 5.759444, 5000); SetTimerEx("StreamNextStep", 4500, false, "ii", playerid, 7); ClearChat(playerid); TextDrawHideForPlayer(playerid, introTextdraws[16]); TextDrawHideForPlayer(playerid, introTextdraws[17]); TextDrawShowForPlayer(playerid, introTextdraws[18]); SetTimerEx("ShowLoginScreenTextdraw", 2000, false, "ii", playerid, 3); //TextDrawShowForPlayer(playerid, introTextdraws[19]); } case 7: { InterpolateCameraPos(playerid, 662.689147, -1868.981201, 6.513285, 665.048583, -1870.174438, 6.864079, 5000); InterpolateCameraLookAt(playerid, 658.142028, -1867.027709, 5.800874, 661.006286, -1867.294311, 6.260089, 5000); SetTimerEx("StreamNextStep", 4500, false, "ii", playerid, 8); ClearChat(playerid); TextDrawHideForPlayer(playerid, introTextdraws[18]); TextDrawHideForPlayer(playerid, introTextdraws[19]); TextDrawShowForPlayer(playerid, introTextdraws[20]); SetTimerEx("ShowLoginScreenTextdraw", 2000, false, "ii", playerid, 4); //TextDrawShowForPlayer(playerid, introTextdraws[21]); } case 8: { InterpolateCameraPos(playerid, 542.343933, -1901.457519, 2.008791, 544.523376, -1901.883666, 2.085470, 5000); InterpolateCameraLookAt(playerid, 544.995666, -1897.256958, 2.577868, 546.892395, -1897.521118, 2.681705, 5000); SetTimerEx("StreamNextStep", 4500, false, "ii", playerid, 9); ClearChat(playerid); TextDrawHideForPlayer(playerid, introTextdraws[20]); TextDrawHideForPlayer(playerid, introTextdraws[21]); TextDrawShowForPlayer(playerid, introTextdraws[22]); } case 9: { InterpolateCameraPos(playerid, 542.945800, -1863.699707, 4.435829, 539.996215, -1863.695556, 4.304386, 7000); InterpolateCameraLookAt(playerid, 537.950744, -1863.694213, 4.213245, 535.009887, -1863.990478, 4.081802, 7000); SetTimerEx("StreamNextStep", 6500, false, "ii", playerid, 10); ClearChat(playerid); TextDrawHideForPlayer(playerid, introTextdraws[22]); TextDrawShowForPlayer(playerid, introTextdraws[23]); SetTimerEx("ShowLoginScreenTextdraw", 1000, false, "ii", playerid, 5); SetTimerEx("ShowLoginScreenTextdraw", 3000, false, "ii", playerid, 6); } case 10: { for(new i = 0; i < 26; i ++) { TextDrawHideForPlayer(playerid, introTextdraws[i]); } SetPlayerVirtualWorld(playerid, 0); ShowMainMenuCamera(playerid, 0); ShowDialogToPlayer(playerid, DIALOG_REGISTER); } } return 1; } #endif forward GrandTheftAutoV(playerid, step, Float:x, Float:y, Float:z, Float:angle, Float:cx, Float:cy, Float:cz); public GrandTheftAutoV(playerid, step, Float:x, Float:y, Float:z, Float:angle, Float:cx, Float:cy, Float:cz) { if(PlayerInfo[playerid][pLogged]) { SetPlayerCameraLookAt(playerid, x, y, z); switch(step) { case 1: { SetPlayerCameraPos(playerid, x, y, z + 100.0); PlayerPlaySound(playerid, 16200, 0.0, 0.0, 0.0); SetTimerEx("GrandTheftAutoV", 1000, false, "iifffffff", playerid, 2, x, y, z, angle, cx, cy, cz); } case 2: { SetPlayerCameraPos(playerid, x, y, z + 50.0); PlayerPlaySound(playerid, 16200, 0.0, 0.0, 0.0); SetTimerEx("GrandTheftAutoV", 1000, false, "iifffffff", playerid, 3, x, y, z, angle, cx, cy, cz); } case 3: { SetPlayerCameraPos(playerid, x, y, z + 25.0); PlayerPlaySound(playerid, 16200, 0.0, 0.0, 0.0); SetTimerEx("GrandTheftAutoV", 1000, false, "iifffffff", playerid, 4, x, y, z, angle, cx, cy, cz); } case 4: { InterpolateCameraPos(playerid, cx, cy, cz + 25.0, cx, cy, cz, 1000); InterpolateCameraLookAt(playerid, x + 4.0 * floatsin(-angle, degrees), y + 4.0 * floatcos(-angle, degrees), z, x, y, z + 0.6, 1000); SetTimerEx("GrandTheftAutoV", 1500, false, "iifffffff", playerid, 5, x, y, z, angle, cx, cy, cz); } case 5: { SetCameraBehindPlayer(playerid); TogglePlayerControllable(playerid, 1); PlayerInfo[playerid][pLoginCamera] = 0; } } } } forward DestroyLockText(playerid); public DestroyLockText(playerid) { if(IsValidDynamic3DTextLabel(PlayerInfo[playerid][pLockText])) { DestroyDynamic3DTextLabel(PlayerInfo[playerid][pLockText]); PlayerInfo[playerid][pLockText] = Text3D:INVALID_3DTEXT_ID; } } forward HideAchievementTextdraw(playerid); public HideAchievementTextdraw(playerid) { for(new i = 6; i < 10; i ++) { PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][i]); } } forward SpectateUpdate(playerid, targetid); public SpectateUpdate(playerid, targetid) { if(PlayerInfo[playerid][pSpectating] == targetid) { SetPlayerInterior(playerid, GetPlayerInterior(targetid)); SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid)); if(IsPlayerInAnyVehicle(targetid)) { PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid)); } else { PlayerSpectatePlayer(playerid, targetid); } } } forward StreamedCheck(playerid, Float:x, Float:y, Float:z, interior, world); public StreamedCheck(playerid, Float:x, Float:y, Float:z, interior, world) { foreach(new i : Entrance) { if(EntranceInfo[i][eExists] && EntranceInfo[i][eFreeze] && IsPointInRangeOfPoint(x, y, z, 100.0, EntranceInfo[i][eIntX], EntranceInfo[i][eIntY], EntranceInfo[i][eIntZ]) && interior == EntranceInfo[i][eInterior] && world == EntranceInfo[i][eWorld]) { SetFreezePos(playerid, x, y, z); return 1; } } for(new i = 0; i < sizeof(staticEntrances); i ++) { if(staticEntrances[i][eFreeze] && IsPointInRangeOfPoint(x, y, z, 100.0, staticEntrances[i][eIntX], staticEntrances[i][eIntY], staticEntrances[i][eIntZ]) && world == staticEntrances[i][eWorld]) { SetFreezePos(playerid, x, y, z); return 1; } } return 0; } forward UnfreezeNewbie(playerid); public UnfreezeNewbie(playerid) { TogglePlayerControllable(playerid, 1); } forward VehicleUnfreeze(playerid, vehicleid, Float:x, Float:y, Float:z, interior, world); public VehicleUnfreeze(playerid, vehicleid, Float:x, Float:y, Float:z, interior, world) { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsPlayerInRangeOfPoint(playerid, 100.0, x, y, z) && GetPlayerInterior(playerid) == interior && GetPlayerVirtualWorld(playerid) == world) { SetVehiclePos(vehicleid, x, y, z); } TogglePlayerControllable(playerid, 1); } forward UnfreezePlayer(playerid, Float:x, Float:y, Float:z); public UnfreezePlayer(playerid, Float:x, Float:y, Float:z) { if(IsPlayerInRangeOfPoint(playerid, 5.0, x, y, z)) { SetPlayerPos(playerid, x, y, z); TogglePlayerControllable(playerid, 1); PlayerInfo[playerid][pFreezeTimer] = -1; } } forward DestroyWater(objectid); public DestroyWater(objectid) { DestroyDynamicObject(objectid); } forward SecondTimer(); public SecondTimer() { new hour, minute, boomboxid, string[128]; gettime(hour, minute); if((gGMX) && mysql_unprocessed_queries(connectionID) == 0) { SendRconCommand("gmx"); } foreach(new i : Player) { //SetPlayerTime(i, hour, minute); if(PlayerInfo[i][pLogged] && !PlayerInfo[i][pKicked]) { AFKCheck(i); NOPCheck(i); if(PlayerInfo[i][pLoopAnim] && !PlayerInfo[i][pToggleTextdraws]) { TextDrawShowForPlayer(i, AnimationTD); } else { TextDrawHideForPlayer(i, AnimationTD); } if(GetPlayerSurfingVehicleID(i) != INVALID_PLAYER_ID && GetPlayerState(i) == PLAYER_STATE_ONFOOT && !IsSurfVehicle(GetPlayerSurfingVehicleID(i)) && !PlayerInfo[i][pAdminDuty] && GetVehicleSpeed(GetPlayerSurfingVehicleID(i)) > 40) { new Float:x, Float:y, Float:z; SendProximityMessage(i, 20.0, COLOR_PURPLE, "** %s slipped off the top of the vehicle.", GetPlayerRPName(i)); GetPlayerPos(i, x, y, z); SetPlayerPos(i, x + 1, y, z + 3.0); ApplyAnimation(i, "PED", "BIKE_fallR", 4.1, 0, 1, 1, 0, 0); } if(PlayerInfo[i][pShipment] >= 0) { if((GetPlayerState(i) == PLAYER_STATE_DRIVER) && (GetVehicleModel(GetPlayerVehicleID(i)) != 414 && GetVehicleModel(GetPlayerVehicleID(i)) != 498)) { PlayerInfo[i][pShipment] = -1; SendClientMessage(i, COLOR_GREY, "Shipment cancelled. You went into another vehicle."); } } if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_DRINK_BEER || GetPlayerSpecialAction(i) == SPECIAL_ACTION_DRINK_WINE) { if(GetPlayerDrunkLevel(i) > 7000) { AwardAchievement(i, "Party hard"); } } if(PlayerInfo[i][pPizzas] > 0 && GetPlayerState(i) == PLAYER_STATE_DRIVER) { if(GetVehicleModel(GetPlayerVehicleID(i)) == 448) { if(PlayerInfo[i][pPizzaTime] < 90) { PlayerInfo[i][pPizzaTime]++; } } else { PlayerInfo[i][pPizzas] = 0; PlayerInfo[i][pCP] = 0; DisablePlayerCheckpoint(i); SendClientMessage(i, COLOR_GREY, "Pizza delivery cancelled. You went into another vehicle."); } } else if (PlayerInfo[i][pGraffiti] != -1 && PlayerInfo[i][pGraffitiTime] > 0) { if (Graffiti_Nearest(i) != PlayerInfo[i][pGraffiti]) { PlayerInfo[i][pGraffiti] = -1; PlayerInfo[i][pGraffitiTime] = 0; } else { PlayerInfo[i][pGraffitiTime]--; if (PlayerInfo[i][pGraffitiTime] < 1) { new str[500]; strunpack(str, PlayerInfo[i][pGraffitiText]); format(GraffitiData[PlayerInfo[i][pGraffiti]][graffitiText], 64, str); GraffitiData[PlayerInfo[i][pGraffiti]][graffitiColor] = PlayerInfo[i][pGraffitiColor]; Graffiti_Refresh(PlayerInfo[i][pGraffiti]); Graffiti_Save(PlayerInfo[i][pGraffiti]); ClearAnimations(i, 1); SendProximityMessage(i, 30.0, COLOR_PURPLE, "** %s puts their can of spray paint away.", GetPlayerRPName(i)); PlayerInfo[i][pGraffiti] = -1; PlayerInfo[i][pGraffitiTime] = 0; } } } if(!PlayerInfo[i][pToggleTextdraws]) { if(PlayerInfo[i][pGPSOn]) { PlayerTextDrawSetString(i, PlayerInfo[i][pText][0], GetPlayerZoneName(i)); } } /*if(NetStats_PacketLossPercent(i) > 20.0 && gettime() - PlayerInfo[i][pLastDesync] > 120) { GameTextForPlayer(i, "You are desynced. Please relog once you see this message.", 10000, 6); PlayerInfo[i][pLastDesync] = gettime(); }*/ if(PlayerInfo[i][pSpectating] != INVALID_PLAYER_ID) { if(GetPlayerInterior(i) != GetPlayerInterior(PlayerInfo[i][pSpectating])) SetPlayerInterior(i, GetPlayerInterior(PlayerInfo[i][pSpectating])); if(GetPlayerVirtualWorld(i) != GetPlayerVirtualWorld(PlayerInfo[i][pSpectating])) SetPlayerVirtualWorld(i, GetPlayerVirtualWorld(PlayerInfo[i][pSpectating])); } if(PlayerInfo[i][pTutorial]) { TogglePlayerControllable(i, 0); } if(PlayerInfo[i][pAwaitingClothing]) { SetPlayerClothing(i); } if(PlayerInfo[i][pDraggedBy] != INVALID_PLAYER_ID) { TeleportToPlayer(i, PlayerInfo[i][pDraggedBy]); } if(PlayerInfo[i][pVIPPackage] > 0 && gettime() > PlayerInfo[i][pVIPTime]) { PlayerInfo[i][pVIPPackage] = 0; PlayerInfo[i][pVIPTime] = 0; PlayerInfo[i][pSecondJob] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET vippackage = 0, viptime = 0, secondjob = -1 WHERE uid = %i", PlayerInfo[i][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(i, COLOR_LIGHTRED, "Your VIP subscription has expired. You are no longer a VIP."); } if(PlayerInfo[i][pVIPPackage] < 2 && PlayerInfo[i][pSecondJob] != JOB_NONE) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET secondjob = -1 WHERE uid = %i", PlayerInfo[i][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[i][pSecondJob] = JOB_NONE; SendClientMessage(i, COLOR_LIGHTRED, "Your second job has been removed as you aren't a Gold+ VIP."); } if(PlayerInfo[i][pHHCheck]) { if(PlayerInfo[i][pHHTime] > 0) { new health = GetPlayerHealthEx(i); if(health == PlayerInfo[i][pHHRounded]) { PlayerInfo[i][pHHCount]++; } SetPlayerHealth(i, random(100) + 1); PlayerInfo[i][pHHTime]--; PlayerInfo[i][pHHRounded] = health; } else { if(gettime() - PlayerInfo[i][pLastUpdate] >= 3) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] failed the health hack check as they tabbed.", GetPlayerRPName(i), i); } else if(PlayerInfo[i][pHHCount] > 0) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly health hacking with a %i percent chance.", GetPlayerRPName(i), i, PlayerInfo[i][pHHCount] * 20); } else { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] does not appear to be health hacking.", GetPlayerRPName(i), i); } if(NetStats_PacketLossPercent(i) > 10.0) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is desynced and has a packet loss of %.1f percent.", GetPlayerRPName(i), i, NetStats_PacketLossPercent(i)); } SetPlayerHealth(i, PlayerInfo[i][pHealth]); PlayerInfo[i][pHHCheck] = 0; } } if(PlayerInfo[i][pReceivingAid] && !PlayerInfo[i][pHHCheck]) { new Float:health; GetPlayerHealth(i, health); if((health + 1.0) > 100.0) { SetPlayerHealth(i, 100.0); PlayerInfo[i][pReceivingAid] = 0; } else { SetPlayerHealth(i, health + 1.0); } } if(PlayerInfo[i][pInjured] && IsPlayerInAnyVehicle(i) && GetVehicleModel(GetPlayerVehicleID(i)) != 416) { new Float:x, Float:y, Float:z; GetPlayerPos(i, x, y, z); SetPlayerPos(i, x, y, z + 0.5); ClearAnimations(i); } if(PlayerInfo[i][pTazedTime] > 0) { PlayerInfo[i][pTazedTime]--; if(!PlayerInfo[i][pTazedTime]) { ClearAnimations(i, 1); if(!PlayerInfo[i][pCuffed]) { TogglePlayerControllable(i, 1); } } } if(PlayerInfo[i][pFishTime] > 0) { PlayerInfo[i][pFishTime]--; if(!IsPlayerAtFishingPlace(i)) { ClearAnimations(i, 1); RemovePlayerAttachedObject(i, 9); PlayerInfo[i][pFishTime] = 0; } else if(PlayerInfo[i][pFishTime] <= 0 && IsPlayerAtFishingPlace(i)) { new rand = Random(1, 100); if(1 <= rand <= 20) { SendClientMessage(i, COLOR_GREY, "You reeled in your line and caught nothing..."); } else if(21 <= rand <= 30) { new amount = 50 + random(100); SendClientMessageEx(i, COLOR_AQUA, "You reeled in your line and caught a used wallet with {00AA00}$%i{33CCFF} inside.", amount); GivePlayerCash(i, amount); } else if(98 <= rand <= 99) { new amount = random(2000) + 1000; SendClientMessageEx(i, COLOR_AQUA, "You reeled in your line and caught a rare 18th century coin valued at {00AA00}$%i{33CCFF}!", amount); GivePlayerCash(i, amount); } else { new weight, level = GetJobLevel(i, JOB_FISHERMAN); if(PlayerInfo[i][pUsedBait]) { weight = random(40) + (level * 10); } else { weight = random(15) + (level * 10); } SendClientMessageEx(i, COLOR_AQUA, "You reeled in your line and caught a fish weighing %i kg!", weight); PlayerInfo[i][pFishWeight] += weight; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fishweight = %i WHERE uid = %i", PlayerInfo[i][pFishWeight], PlayerInfo[i][pID]); mysql_tquery(connectionID, queryBuffer); IncreaseJobSkill(i, JOB_FISHERMAN); if(PlayerInfo[i][pFishWeight] >= 1500) { SendClientMessage(i, COLOR_YELLOW, "You have too much fish. You can continue fishing once you sell your load."); } } ClearAnimations(i, 1); RemovePlayerAttachedObject(i, 9); } } if(PlayerInfo[i][pJailType] > 0) { PlayerInfo[i][pJailTime]--; if(PlayerInfo[i][pJailTime] <= 0) { ResetPlayerWeaponsEx(i); SendClientMessage(i, COLOR_GREY2, "Your jail sentence has expired."); SetPlayerPos(i, 135.3039,1950.1998,19.3892); SetPlayerFacingAngle(i, 180.0000); SetPlayerInterior(i, 0); SetPlayerVirtualWorld(i, 0); SetCameraBehindPlayer(i); PlayerInfo[i][pJailType] = 0; PlayerInfo[i][pJailTime] = 0; } } if(PlayerInfo[i][pEditType] > 0 && IsValidDynamicObject(PlayerInfo[i][pEditObject]) && !IsPlayerInRangeOfDynamicObject(i, PlayerInfo[i][pEditObject], 50.0)) { if(PlayerInfo[i][pEditType] == EDIT_FURNITURE_PREVIEW) { SendClientMessage(i, COLOR_GREY2, "You left the editing area. Furniture previewing cancelled."); DestroyDynamicObject(PlayerInfo[i][pEditObject]); } else if(PlayerInfo[i][pEditType] == EDIT_FURNITURE) { ReloadFurniture(PlayerInfo[i][pEditObject], HouseInfo[PlayerInfo[i][pFurnitureHouse]][hLabels]); SendClientMessage(i, COLOR_GREY2, "You left the editing area. Editing mode has been disabled."); } else if(PlayerInfo[i][pEditType] == EDIT_LAND_OBJECT) { ReloadLandObject(PlayerInfo[i][pEditObject], LandInfo[PlayerInfo[i][pObjectLand]][lLabels]); SendClientMessage(i, COLOR_GREY2, "You left the editing area. Editing mode has been disabled."); } else if(PlayerInfo[i][pEditType] == EDIT_LAND_OBJECT_PREVIEW) { SendClientMessage(i, COLOR_GREY2, "You left the editing area. Furniture previewing cancelled."); DestroyDynamicObject(PlayerInfo[i][pEditObject]); } CancelEdit(i); PlayerInfo[i][pEditType] = 0; PlayerInfo[i][pEditObject] = INVALID_OBJECT_ID; } if(PlayerInfo[i][pHospital] && PlayerInfo[i][pHospitalTime]) { PlayerInfo[i][pHospitalTime]--; if(PlayerInfo[i][pHospitalTime] == 0) { if(PlayerInfo[i][pInsurance] > 0) { AwardAchievement(i, "Obamacare"); } SetPlayerPos(i, -10.4534, 149.3639, 999.0613); SetPlayerFacingAngle(i, 180.0000); SetPlayerInterior(i, 1); SetPlayerVirtualWorld(i, PlayerInfo[i][pHospitalType]); SetCameraBehindPlayer(i); if(!(GetFactionType(i) == FACTION_POLICE || GetFactionType(i) == FACTION_MEDIC)) { GivePlayerCash(i, -500); GameTextForPlayer(i, "~w~Discharged~n~~r~-$500", 5000, 1); } TogglePlayerControllable(i, 1); SetPlayerDrunkLevel(i, 0); if(PlayerInfo[i][pDelivered]) { if(GetFactionType(i) == FACTION_POLICE || GetFactionType(i) == FACTION_MEDIC) SendClientMessage(i, COLOR_DOCTOR, "You have not been billed for your stay. You also keep all of your weapons!"); else SendClientMessage(i, COLOR_DOCTOR, "You have been billed $500 for your stay. You also keep all of your weapons!"); PlayerInfo[i][pDelivered] = 0; } else { if(GetFactionType(i) == FACTION_POLICE || GetFactionType(i) == FACTION_MEDIC) SendClientMessage(i, COLOR_DOCTOR, "You have not been billed for your stay. Your weapons have been confiscated by staff."); else SendClientMessage(i, COLOR_DOCTOR, "You have been billed $500 for your stay. Your weapons have been confiscated by staff."); SendClientMessage(i, COLOR_LIGHTRED, "(( You have lost 30 minutes of your memory. ))"); } new hospital[32]; switch(PlayerInfo[i][pHospitalType]) { case HOSPITAL_COUNTY: strcat(hospital, "Fort Carson\nMedical Center"); } foreach(new x : Player) { if(IsLawEnforcement(x)) { //SendClientMessageEx(x, COLOR_YELLOW, "LSFMD: Wanted suspect %s[%i] was last spotted at the %s hospital!", GetPlayerRPName(i), i, hospital); } } SetPlayerHealth(i, PlayerInfo[i][pSpawnHealth]); SetScriptArmour(i, PlayerInfo[i][pSpawnArmor]); PlayerInfo[i][pHospital] = 0; PlayerInfo[i][pHospitalTime] = 0; } else { GameTextForPlayer(i, "~w~Recovering...", 1500, 3); SetPlayerDrunkLevel(i, 50000); } } if(PlayerInfo[i][pRefuel] != INVALID_VEHICLE_ID) { PlayerInfo[i][pRefuelAmount] += 2; vehicleFuel[PlayerInfo[i][pRefuel]]++; if(vehicleFuel[PlayerInfo[i][pRefuel]] >= 100 || PlayerInfo[i][pCash] < PlayerInfo[i][pRefuelAmount]) { AddPointMoney(POINT_FUEL, PlayerInfo[i][pRefuelAmount]); GivePlayerCash(i, -PlayerInfo[i][pRefuelAmount]); SendClientMessageEx(i, COLOR_AQUA, "You've refilled your vehicle's gas tank for {FF6347}$%i{33CCFF}.", PlayerInfo[i][pRefuelAmount]); PlayerInfo[i][pRefuel] = INVALID_VEHICLE_ID; PlayerInfo[i][pRefuelAmount] = 0; } } if(PlayerInfo[i][pMiningTime] > 0) { PlayerInfo[i][pMiningTime]--; if(PlayerInfo[i][pMiningTime] <= 0) { if(IsPlayerInMiningArea(i) && GetPlayerState(i) == PLAYER_STATE_ONFOOT && !PlayerInfo[i][pTazedTime] && !PlayerInfo[i][pCuffed]) { new number = random(10) + 1; PlayerInfo[i][pCP] = CHECKPOINT_MINING; SetPlayerAttachedObject(i, 9, 3929, 1, 0.242999, 0.324000, 0.012000, -17.200078, 20.699993, 9.800034, 0.579999, 0.617999, 0.676999); SetPlayerSpecialAction(i, SPECIAL_ACTION_CARRY); ApplyAnimation(i, "CARRY", "liftup", 4.1, 0, 0, 0, 0, 0, 1); SetPlayerCheckpoint(i, -715.7991,2355.0259,127.1597, 2.0); if(1 <= number <= 5) { PlayerInfo[i][pMiningRock] = 1; SendClientMessage(i, COLOR_AQUA, "You have dug up an ordinary stone. Drop it off at the marker."); } else if(number == 6 && !PlayerInfo[i][pRareTime]) { SendClientMessage(i, COLOR_AQUA, "Woah, this looks oddly weird to find in the middle of a city, lets show it to the boss."); PlayerInfo[i][pMiningRock] = 3; } else { PlayerInfo[i][pMiningRock] = 2; SendClientMessage(i, COLOR_AQUA, "You have dug up a quality stone. Drop it off at the marker."); } } else { RemovePlayerAttachedObject(i, 9); ClearAnimations(i, 1); } } } if(PlayerInfo[i][pSweeping] && GetVehicleModel(GetPlayerVehicleID(i)) == 574 && GetVehicleSpeed(GetPlayerVehicleID(i)) > 35.0 && !PlayerInfo[i][pAFK]) { PlayerInfo[i][pSweepTime]--; if(PlayerInfo[i][pSweepTime] <= 0) { new cost = 200 + random(50); if(PlayerInfo[i][pLaborUpgrade] > 0) { cost += percent(cost, PlayerInfo[i][pLaborUpgrade]); } AddToPaycheck(i, cost); format(string, sizeof(string), "~g~+$%i", cost); GameTextForPlayer(i, string, 5000, 1); PlayerInfo[i][pSweepEarnings] += cost; PlayerInfo[i][pSweepTime] = 30; } } if(PlayerInfo[i][pTaxiPassenger] != INVALID_PLAYER_ID) { if((GetVehicleModel(GetPlayerVehicleID(i)) != 420 && GetVehicleModel(GetPlayerVehicleID(i)) != 438) || !IsPlayerInVehicle(PlayerInfo[i][pTaxiPassenger], GetPlayerVehicleID(i)) || PlayerInfo[i][pTaxiFare] == 0 || PlayerInfo[PlayerInfo[i][pTaxiPassenger]][pCash] < PlayerInfo[i][pTaxiBill]) { CancelTaxiRide(i); } else { PlayerInfo[i][pTaxiTime]++; if(PlayerInfo[i][pTaxiTime] >= 15) { PlayerInfo[i][pTaxiTime] = 0; PlayerInfo[i][pTaxiBill] += PlayerInfo[i][pTaxiFare]; } format(string, sizeof(string), "~n~~n~~n~~n~~n~~n~~n~~g~Taxi Meter:~w~ $%i", PlayerInfo[i][pTaxiBill]); GameTextForPlayer(i, string, 3000, 3); } } if(PlayerInfo[i][pMuted] > 0) { PlayerInfo[i][pMuted]--; if(PlayerInfo[i][pMuted] <= 0) { SendClientMessage(i, COLOR_GREY, "You are no longer muted."); } } if(PlayerInfo[i][pSpamTime] > 0) { PlayerInfo[i][pSpamTime]--; } if(PlayerInfo[i][pVehicleCount] > 0) { PlayerInfo[i][pVehicleCount]--; } if(PlayerInfo[i][pMechanicCall] > 0) { PlayerInfo[i][pMechanicCall]--; } if(PlayerInfo[i][pTaxiCall] > 0) { PlayerInfo[i][pTaxiCall]--; } if(PlayerInfo[i][pEmergencyCall] > 0) { PlayerInfo[i][pEmergencyCall]--; } if(PlayerInfo[i][pCourierCooldown] > 0) { PlayerInfo[i][pCourierCooldown]--; } if(PlayerInfo[i][pPizzaCooldown] > 0) { PlayerInfo[i][pPizzaCooldown]--; } if(PlayerInfo[i][pDetectiveCooldown] > 0) { PlayerInfo[i][pDetectiveCooldown]--; } if(PlayerInfo[i][pThiefCooldown] > 0) { PlayerInfo[i][pThiefCooldown]--; } if(PlayerInfo[i][pCocaineCooldown] > 0) { PlayerInfo[i][pCocaineCooldown]--; } if(PlayerInfo[i][pACFired] > 0) { PlayerInfo[i][pACFired]--; } if(PlayerInfo[i][pRapidFire] > 0) { PlayerInfo[i][pRapidFire]--; } if(PlayerInfo[i][pGodmode] > 0) { PlayerInfo[i][pGodmode]--; } if(PlayerInfo[i][pPreviewHouse] >= 0) { PlayerInfo[i][pPreviewTime]--; if(PlayerInfo[i][pPreviewTime] <= 0 && GetPlayerInterior(i) == houseInteriors[PlayerInfo[i][pPreviewType]][intID]) { SetPlayerPos(i, HouseInfo[PlayerInfo[i][pPreviewHouse]][hIntX], HouseInfo[PlayerInfo[i][pPreviewHouse]][hIntY], HouseInfo[PlayerInfo[i][pPreviewHouse]][hIntZ]); SetPlayerFacingAngle(i, HouseInfo[PlayerInfo[i][pPreviewHouse]][hIntA]); SetPlayerInterior(i, HouseInfo[PlayerInfo[i][pPreviewHouse]][hInterior]); SetPlayerVirtualWorld(i, HouseInfo[PlayerInfo[i][pPreviewHouse]][hWorld]); SetCameraBehindPlayer(i); PlayerInfo[i][pPreviewHouse] = -1; PlayerInfo[i][pPreviewType] = 0; PlayerInfo[i][pPreviewTime] = 0; SendClientMessage(i, COLOR_WHITE, "You are no longer previewing the interior as the time period ran out."); } } if(PlayerInfo[i][pCocaineTrunk] != INVALID_VEHICLE_ID) { if(!IsPlayerInRangeOfBoot(i, PlayerInfo[i][pCocaineTrunk])) { SendClientMessage(i, COLOR_GREY, "You are no longer cracking the trunk as you left your spot."); PlayerInfo[i][pCocaineTrunk] = INVALID_VEHICLE_ID; } else if(VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vLocked]) { SendClientMessage(i, COLOR_GREY, "You are no longer cracking the trunk as the vehicle is now locked."); PlayerInfo[i][pCocaineTrunk] = INVALID_VEHICLE_ID; } else { PlayerInfo[i][pCocaineTime]--; if(PlayerInfo[i][pCocaineTime] <= 0) { new count; for(new x = 0; x < 5; x ++) { if(VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vWeapons][x] != 0) { count++; } } if(count == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vCocaine] == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vMeth] == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vWeed] == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vPainkillers] == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vMaterials] == 0 && VehicleInfo[PlayerInfo[i][pCocaineTrunk]][vCash] == 0) { SendProximityMessage(i, 20.0, COLOR_PURPLE, "** %s cracks open the trunk of the %s and finds nothing.", GetPlayerRPName(i), GetVehicleName(PlayerInfo[i][pCocaineTrunk])); } else { PlayerInfo[i][pCocaineFrom] = PlayerInfo[i][pCocaineTrunk]; ShowDialogToPlayer(i, DIALOG_CRACKTRUNK); } switch(GetJobLevel(i, JOB_THIEF)) { case 1: PlayerInfo[i][pCocaineCooldown] = 720; case 2: PlayerInfo[i][pCocaineCooldown] = 600; case 3: PlayerInfo[i][pCocaineCooldown] = 420; case 4: PlayerInfo[i][pCocaineCooldown] = 300; case 5: PlayerInfo[i][pCocaineCooldown] = 180; } IncreaseJobSkill(i, JOB_THIEF); PlayerInfo[i][pCocaineTrunk] = INVALID_VEHICLE_ID; } else { format(string, sizeof(string), "~w~Cracking trunk... ~r~%i", PlayerInfo[i][pCocaineTime]); GameTextForPlayer(i, string, 2000, 3); } } } if(PlayerInfo[i][pLootTime] > 0) { PlayerInfo[i][pLootTime]--; if(IsPlayerInBankRobbery(i) && PlayerInfo[i][pLootTime] <= 0) { new amount = random(500) + 500; ClearAnimations(i, 1); PlayerInfo[i][pRobCash] += amount; PlayerInfo[i][pCP] = CHECKPOINT_ROBBERY; PlayerInfo[i][pLastLoad] = gettime(); format(string, sizeof(string), "~g~+$%i", amount); GameTextForPlayer(i, string, 5000, 1); SendClientMessageEx(i, COLOR_AQUA, "You have looted {00AA00}$%i{33CCFF} and now have $%i. You can keep looting or deliver the cash to the {FF6347}marker{33CCFF}.", amount, PlayerInfo[i][pRobCash]); SetPlayerCheckpoint(i, 1429.9939, 1066.9581, 9.8938, 3.0); } else if((PlayerInfo[i][pRobbingBiz] >= 0 && PlayerInfo[i][pRobbingBiz] == GetInsideBusiness(i)) && PlayerInfo[i][pLootTime] <= 0) { new amount = random(300) + 100; ClearAnimations(i, 1); PlayerInfo[i][pRobCash] += amount; PlayerInfo[i][pCP] = CHECKPOINT_ROBBERY; PlayerInfo[i][pLastLoad] = gettime(); format(string, sizeof(string), "~g~+$%i", amount); GameTextForPlayer(i, string, 5000, 1); SendClientMessageEx(i, COLOR_AQUA, "You have looted {00AA00}$%i{33CCFF} and now have $%i. You can keep looting or deliver the cash to the {FF6347}marker{33CCFF} (/stoprobbery).", amount, PlayerInfo[i][pRobCash]); SetPlayerCheckpoint(i, 1429.9939, 1066.9581, 9.8938, 3.0); if(PlayerInfo[i][pRobCash] < 10000) { ApplyAnimation(i, "BOMBER", "BOM_Plant_Loop", 4.1, 1, 0, 0, 0, 0, 1); GameTextForPlayer(i, "~w~Looting business vault...", 5000, 3); PlayerInfo[i][pLootTime] = 5; } else { callcmd::stoprobbery(i, "/1"); } } } if(PlayerInfo[i][pHunted] > 0) { foreach(new x : Player) { if(PlayerInfo[x][pLogged] && GetPlayerInterior(x) == GetPlayerInterior(i) && PlayerInfo[i][pHunted] > 0) { SetPlayerMarkerForPlayer(x, i, COLOR_RETIRED); } } } if(PlayerInfo[i][pFindTime] > 0) { PlayerInfo[i][pFindTime]--; if(PlayerInfo[i][pFindTime] == 0) { SetPlayerMarkerForPlayer(i, PlayerInfo[i][pFindPlayer], GetPlayerColor(PlayerInfo[i][pFindPlayer])); PlayerInfo[i][pFindPlayer] = INVALID_PLAYER_ID; } } if((PlayerInfo[i][pToggleMusic]) || (PlayerInfo[i][pBoomboxListen] != INVALID_PLAYER_ID && GetNearbyBoombox(i) != PlayerInfo[i][pBoomboxListen])) { PlayerInfo[i][pBoomboxListen] = INVALID_PLAYER_ID; if(PlayerInfo[i][pStreamType] == MUSIC_BOOMBOX) { StopAudioStreamForPlayer(i); PlayerInfo[i][pStreamType] = MUSIC_NONE; } } if((!PlayerInfo[i][pToggleMusic]) && ((boomboxid = GetNearbyBoombox(i)) != INVALID_PLAYER_ID && PlayerInfo[i][pBoomboxListen] != boomboxid)) { PlayerInfo[i][pBoomboxListen] = boomboxid; if(PlayerInfo[i][pStreamType] == MUSIC_NONE) { PlayAudioStreamForPlayer(i, PlayerInfo[boomboxid][pBoomboxURL]); PlayerInfo[i][pStreamType] = MUSIC_BOOMBOX; } } if(PlayerInfo[i][pPickPlant] != INVALID_PLAYER_ID) { PlayerInfo[i][pPickTime]--; if(PlayerInfo[i][pPickTime] <= 0) { new planterid = PlayerInfo[i][pPickPlant]; if(!IsPlayerConnected(planterid) || !PlayerInfo[planterid][pLogged] || !PlayerInfo[planterid][pWeedPlanted]) { SendClientMessage(i, COLOR_GREY, "This plant is no longer available to pick."); } else if(!IsPlayerInRangeOfPoint(i, 3.0, PlayerInfo[planterid][pWeedX], PlayerInfo[planterid][pWeedY], PlayerInfo[planterid][pWeedZ])) { SendClientMessage(i, COLOR_GREY, "Picking failed. You left the area of the plant."); } else if(GetPlayerSpecialAction(i) != SPECIAL_ACTION_DUCK) { SendClientMessage(i, COLOR_GREY, "Picking failed. You must stay crouched when picking a plant."); } else { PlayerInfo[i][pWeed] += PlayerInfo[planterid][pWeedGrams]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[i][pWeed], PlayerInfo[i][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(i, COLOR_AQUA, "You have harvested %i grams of weed from this plant.", PlayerInfo[planterid][pWeedGrams]); DestroyWeedPlant(planterid); } PlayerInfo[i][pPickPlant] = INVALID_PLAYER_ID; PlayerInfo[i][pPickTime] = 0; } } if(PlayerInfo[i][pCookMeth] > 0) { PlayerInfo[i][pCookTime]--; if(PlayerInfo[i][pCookTime] <= 0) { if(!IsPlayerInRangeOfPoint(i, 5.0, 1.2179, 2.8095, 999.4284)) { SendClientMessage(i, COLOR_GREY, "Cooking failed. You have left the cooking spot."); ResetCooking(i); } else if(PlayerInfo[i][pEphedrine] <= 0) { SendClientMessage(i, COLOR_GREY, "Cooking failed. You have ran out of ephedrine."); ResetCooking(i); } else if(PlayerInfo[i][pMeth] + 2 > GetPlayerCapacity(i, CAPACITY_METH)) { SendClientMessage(i, COLOR_GREY, "Cooking failed. You have ran out of inventory space for meth."); ResetCooking(i); } else { GameTextForPlayer(i, "~g~+2~w~ grams of meth", 3000, 3); PlayerInfo[i][pEphedrine] -= 1; PlayerInfo[i][pMeth] += 2; PlayerInfo[i][pCookGrams] += 2; if((PlayerInfo[i][pCookGrams] % 4) == 0) { PlayerInfo[i][pMuriaticAcid]--; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET ephedrine = %i, meth = %i, muriaticacid = %i WHERE uid = %i", PlayerInfo[i][pEphedrine], PlayerInfo[i][pMeth], PlayerInfo[i][pMuriaticAcid], PlayerInfo[i][pID]); mysql_tquery(connectionID, queryBuffer); if(!PlayerInfo[i][pEphedrine]) { SendClientMessageEx(i, COLOR_LIGHTRED, "You ran out of ephedrine therefore ending your cookoff. You made %i grams of meth from %i grams of ephedrine.", PlayerInfo[i][pCookGrams], PlayerInfo[i][pCookGrams] / 2); ResetCooking(i); } else if(!PlayerInfo[i][pMuriaticAcid]) { SendClientMessageEx(i, COLOR_LIGHTRED, "You ran out of muriatic acid therefore ending your cookoff. You made %i grams of meth from %i grams of ephedrine.", PlayerInfo[i][pCookGrams], PlayerInfo[i][pCookGrams] / 2); ResetCooking(i); } else if(PlayerInfo[i][pMeth] >= GetPlayerCapacity(i, CAPACITY_METH)) { SendClientMessageEx(i, COLOR_LIGHTRED, "You ran out of inventory space for meth therefore ending your cookoff. You made %i grams of meth from %i grams of ephedrine.", PlayerInfo[i][pCookGrams], PlayerInfo[i][pCookGrams] / 2); ResetCooking(i); } else { PlayerInfo[i][pCookTime] = 15; } } } } if(PlayerInfo[i][pDrugsUsed] >= 4) { PlayerInfo[i][pDrugsTime]--; if(PlayerInfo[i][pDrugsTime] <= 0) { SendClientMessage(i, COLOR_GREY, "You are no longer stoned."); SetPlayerWeather(i, gWeather); SetPlayerTime(i, gWorldTime, 0); SetPlayerDrunkLevel(i, 500); PlayerInfo[i][pDrugsUsed] = 0; PlayerInfo[i][pDrugsTime] = 0; } else { SetPlayerWeather(i, -66); SetPlayerTime(i, 12, 0); SetPlayerDrunkLevel(i, 40000); } } if(PlayerInfo[i][pCapturingPoint] >= 0) { PlayerInfo[i][pCaptureTime]--; if(PlayerInfo[i][pCaptureTime] <= 0) { new Float:x, Float:y, Float:z; GetPlayerPos(i, x, y, z); if(PointInfo[PlayerInfo[i][pCapturingPoint]][pTime] == 0 && PlayerInfo[i][pPointX] == x && PlayerInfo[i][pPointY] == y && PlayerInfo[i][pPointZ] == z) { SendClientMessageToAllEx(COLOR_YELLOW, "Point wars: %s attempted to capture %s for %s. It will be theirs in 15 minutes.", GetPlayerRPName(i), PointInfo[PlayerInfo[i][pCapturingPoint]][pName], GangInfo[PlayerInfo[i][pGang]][gName]); PointInfo[PlayerInfo[i][pCapturingPoint]][pCaptureTime] = 15; PointInfo[PlayerInfo[i][pCapturingPoint]][pCapturer] = i; } else { SendClientMessage(i, COLOR_GREY, "You moved from your position and therefore failed to capture."); } PlayerInfo[i][pCapturingPoint] = -1; PlayerInfo[i][pCaptureTime] = 0; } } if(PlayerInfo[i][pPoisonTime] > 0) { new Float:health; GetPlayerHealth(i, health); SetPlayerHealth(i, health - 3.0 < 1.0 ? 1.0 : health - 3.0); PlayerInfo[i][pPoisonTime]--; } AnticheatCheck(i); //GetPlayerHealth(i, PlayerInfo[i][pHealth]); if(PlayerInfo[i][pGang] >= 0 && !PlayerInfo[i][pBandana]) { new id; if((id = GetNearbyTurf(i)) >= 0 && TurfInfo[id][tTime] == 0 && TurfInfo[id][tCapturer] != INVALID_PLAYER_ID) { if(PlayerInfo[i][pTagType] == TAG_VIP) { SetPlayerSpecialTag(i, TAG_NONE); SendClientMessage(i, COLOR_YELLOW, "Your VIP tag was automatically disabled as you've entered an active turf area."); } PlayerInfo[i][pBandana] = 1; SendClientMessage(i, COLOR_WHITE, "Your bandana was enabled automatically as you entered a turf in an active war."); SetPlayerColor(i, GangInfo[PlayerInfo[i][pGang]][gColor] & ~0xff); } if((id = GetNearbyPoint(i, 30.0)) >= 0 && PointInfo[id][pTime] == 0 && PointInfo[id][pCapturer] != INVALID_PLAYER_ID) { if(PlayerInfo[i][pTagType] == TAG_VIP) { SetPlayerSpecialTag(i, TAG_NONE); SendClientMessage(i, COLOR_YELLOW, "Your VIP tag was automatically disabled as you've entered an active point area."); } PlayerInfo[i][pBandana] = 1; SendClientMessage(i, COLOR_WHITE, "Your bandana was enabled automatically as you are in range of an active point."); } } if(!PlayerInfo[i][pBackup] && !IsPlayerBeingFound(i)) { // Yeah, this is indeed a mess. But it works. Cleaning this section is on my list. if(PlayerInfo[i][pJoinedEvent] && EventInfo[eType] == 2) { SetPlayerColor(i, (PlayerInfo[i][pEventTeam] == RED_TEAM) ? (0xFF000000) : (0x0000FF00)); /*} else if(PlayerInfo[i][pPaintball] == 2) { SetPlayerColor(i, (PlayerInfo[i][pPaintballTeam] == 1) ? (0x33CCFF00) : (0xFFFF9900));*/ } else if(PlayerInfo[i][pJailType] == 2) { SetPlayerColor(i, 0xAD7A2100); } else if(PlayerInfo[i][pFaction] >= 0 && PlayerInfo[i][pDuty] && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_HITMAN) { SetPlayerColor(i, FactionInfo[PlayerInfo[i][pFaction]][fColor] & ~0xff); //} else if(PlayerInfo[i][pFaction] >= 0 && PlayerInfo[i][pDuty] == 0 && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_HITMAN && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_POLICE && FactionInfo[PlayerInfo[i][pFaction]][fType] != FACTION_MEDIC) { //SetPlayerColor(i, FactionInfo[PlayerInfo[i][pFaction]][fColor] & ~0xff); } else if(PlayerInfo[i][pGang] >= 0 && PlayerInfo[i][pBandana]) { SetPlayerColor(i, GangInfo[PlayerInfo[i][pGang]][gColor] & ~0xff); } else if(PlayerHasJob(i, JOB_TAXIDRIVER) && PlayerInfo[i][pTaxiFare] > 0) { SetPlayerColor(i, 0xF5DEB300); } else if(PlayerInfo[i][pVIPPackage] > 0 && PlayerInfo[i][pVIPColor]) { SetPlayerColor(i, 0xFF00FF00); //} else if(PlayerInfo[i][pAdmin] > 0 && PlayerInfo[i][pAdminDuty]) { //SetPlayerColor(i, 0xAA333300); // 0xFFD70000 } else { SetPlayerColor(i, 0xFFFFFF00); } } } } for(new i = 0; i < MAX_ACTORS; i ++) { if(IsValidActor(i)) { new Float:x, Float:y, Float:z; GetActorPos(i, x, y, z); SetActorPos(i, x, y, z); } } format(string, sizeof(string), "Raw ephedrine\nStock: %i\nPrice: $1,000/gram\n/buydrug ephedrine [amount]", gEphedrineStock); UpdateDynamic3DTextLabelText(gEphedrineStockText, COLOR_YELLOW, string); format(string, sizeof(string), "Marijuana seeds\nStock: %i\nPrice: $500/seed\n/buydrug seeds [amount]", gSeedsStock); UpdateDynamic3DTextLabelText(gSeedsStockText, COLOR_YELLOW, string); format(string, sizeof(string), "Cocaine\nStock: %i\nPrice: $750/gram\n/buydrug cocaine [amount]", gCocaineStock); UpdateDynamic3DTextLabelText(gCocaineText, COLOR_YELLOW, string); if(Iter_Count(Player) > gPlayerRecord) { gPlayerRecord = Iter_Count(Player); gRecordDate = GetDate(); SaveServerInfo(); } } forward LastAlertPayCheck(playerid); public LastAlertPayCheck(playerid) { if(PayCheckCode[playerid] != 0) { GameTextForPlayer(playerid, "~w~Type /paycheck", 2500, 1); SendClientMessage(playerid, COLOR_WHITE, "You have one minute left before your paycheck expires. Go to the City Hall to get your paycheck."); SetTimerEx("DestroyCheck", 60000, false, "i", playerid); } } forward DestroyCheck(playerid); public DestroyCheck(playerid) { if(PayCheckCode[playerid] != 0) { PayCheckCode[playerid] = 0; SendClientMessage(playerid, COLOR_WHITE, "Your paycheck code expired."); } } CMD:taxhelp(playerid, params[]) { SendClientMessageEx(playerid, COLOR_GREY, "The tax is currently set to {33CCFF}%i percent", gTax); return 1; } CMD:paycheck(playerid, params[]) { if(PayCheckCode[playerid] == 0) return SendClientMessage(playerid, COLOR_WHITE, "There is no paycheck to sign. Please wait for the next paycheck."); if(!IsPlayerInRangeOfPoint(playerid, 3.0, -2.7946,1525.6603,1501.8143)) return SendClientMessage(playerid, COLOR_WHITE, "You need to be in the City Hall in order to get your paycheck."); new string[128]; format(string, sizeof(string), "Check code: %d\n\nEnter your check code to receive your paycheck:", PayCheckCode[playerid]); ShowPlayerDialog(playerid, DIALOG_PAYCHECK, DIALOG_STYLE_INPUT, "Sign check", string, "Sign check","Cancel"); return 1; } forward MinuteTimer(); public MinuteTimer() { new hour; gettime(.hour = hour); RefreshTime(); if(gacooldown) { for(new x = 0; x < MAX_GANGS; x++) { if(GangInfo[x][gInvCooldown] > 0) { GangInfo[x][gInvCooldown]--; } } } if(gHour != hour) { SendClientMessageToAllEx(COLOR_WHITE, "Emerald City Roleplay: The time is now {AFAFAF}%02d:00{FFFFFF}.", hour); new budget; for(new i = 0; i < MAX_FACTIONS; i ++) { if(FactionInfo[i][fType] != FACTION_NONE) { budget += FactionInfo[i][fBudget] - GetTotalFactionPay(i); } } AddToTaxVault(-budget); foreach(new i : Player) { if(PlayerInfo[i][pLogged] && !PlayerInfo[i][pKicked]) { if(PlayerInfo[i][pAFK] && PlayerInfo[i][pAFKTime] > 900) { SendClientMessage(i, COLOR_LIGHTRED, "You didn't receive a paycheck this hour as you were AFK for more than 15 minutes."); } else if(PlayerInfo[i][pMinutes] < 25) { SendClientMessage(i, COLOR_LIGHTRED, "You are ineligible for a paycheck as you played less than 25 minutes this hour."); } else { new code = Random(100000, 999999); PayCheckCode[i] = code; SendClientMessage(i, COLOR_GREY,"_______________________________________________________________"); SendClientMessage(i, COLOR_WHITE,"Information for tax on paychecks: {33CCFF}/taxhelp"); SendClientMessage(i, COLOR_GREY,"_______________________________________________________________"); SendClientMessage(i, COLOR_WHITE,"Sign the check to receive your paycheck."); SendClientMessage(i, COLOR_AQUA, "Type /paycheck"); SendClientMessage(i, COLOR_WHITE,"You have 30 minutes to go to the city hall and sign your paycheck."); SendClientMessage(i, COLOR_GREY,"_______________________________________________________________"); GameTextForPlayer(i, "~w~Type ", 2500, 1); SetTimerEx("LastAlertPayCheck", 1800000, false, "i", i); } if(GetFactionType(i) == FACTION_GOVERNMENT) { SendClientMessageEx(i, COLOR_YELLOW2, "%s were taken out of the tax vault for every faction's paycheck.", FormatNumber(budget)); } if(PlayerInfo[i][pReportMuted]) { PlayerInfo[i][pReportMuted]--; if(PlayerInfo[i][pReportMuted] <= 0) { PlayerInfo[i][pReportMuted] = 0; PlayerInfo[i][pReportWarns] = 0; SendClientMessage(i, COLOR_YELLOW, "Your report mute has automatically been lifted."); } } } } for(new i = 0; i < MAX_POINTS; i ++) { if(PointInfo[i][pExists]) { if(PointInfo[i][pTime] > 0) { PointInfo[i][pTime]--; ReloadPoint(i); } if(!PointInfo[i][pTime]) { SendClientMessageToAllEx(COLOR_YELLOW, "Point wars: %s is now available to capture.", PointInfo[i][pName]); PointInfo[i][pCapturedGang] = -1; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET time = %i, capturedgang = %i WHERE id = %i", PointInfo[i][pTime], PointInfo[i][pCapturedGang], i); mysql_tquery(connectionID, queryBuffer); } } foreach(new i : Turf) { if(TurfInfo[i][tExists]) { if(TurfInfo[i][tTime] > 0) { TurfInfo[i][tTime]--; ReloadTurf(i); } if(!TurfInfo[i][tTime] && TurfInfo[i][tType] != 8) { SendTurfMessage(i, COLOR_YELLOW, "Turf wars: %s is now available to capture.", TurfInfo[i][tName]); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE turfs SET time = %i WHERE id = %i", TurfInfo[i][tTime], i); mysql_tquery(connectionID, queryBuffer); } } switch(hour) { case 0, 4, 8, 12, 16, 18: { for(new i = 0; i < MAX_GANGS; i ++) { if(GangInfo[i][gSetup] && GangInfo[i][gTurfcookies] < 10) { GangInfo[i][gTurfcookies]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET turfcookies = turfcookies + 1 WHERE id = %i", i); mysql_tquery(connectionID, queryBuffer); } } for(new i = 0; i < MAX_FACTIONS; i ++) { if((FactionInfo[i][fType] == FACTION_POLICE || FactionInfo[i][fType] == FACTION_FEDERAL || FactionInfo[i][fType] == FACTION_ARMY) && FactionInfo[i][fTurfcookies] < 3) { FactionInfo[i][fTurfcookies]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET turfcookies = turfcookies + 1 WHERE id = %i", i); mysql_tquery(connectionID, queryBuffer); } } } } if(RobberyInfo[rTime] > 0) { RobberyInfo[rTime]--; } SetWorldTime(hour); gWorldTime = hour; gHour = hour; gCharityHealth = 0; gCharityArmor = 0; } else { foreach(new i : Player) { if(PlayerInfo[i][pWeedPlanted] && PlayerInfo[i][pWeedTime] > 0) { PlayerInfo[i][pWeedTime]--; if((PlayerInfo[i][pWeedTime] % 2) == 0) { PlayerInfo[i][pWeedGrams]++; } } if(PlayerInfo[i][pLogged] && PlayerInfo[i][pAFKTime] < 900) { //new amount = 35 * min(PlayerInfo[i][pLevel], 21); //AddToPaycheck(i, amount); PlayerInfo[i][pMinutes]++; } } for(new i = 0; i < MAX_POINTS; i ++) { if(PointInfo[i][pExists] && PointInfo[i][pCapturer] != INVALID_PLAYER_ID && PointInfo[i][pCaptureTime] > 0) { if(PlayerInfo[PointInfo[i][pCapturer]][pGang] == -1)// || PlayerInfo[PointInfo[i][pCapturer]][pGangRank] < 5) { PointInfo[i][pCapturer] = INVALID_PLAYER_ID; PointInfo[i][pCaptureTime] = 0; } else { PointInfo[i][pCaptureTime]--; if(PointInfo[i][pCaptureTime] <= 0) { GiveGangPoints(PlayerInfo[PointInfo[i][pCapturer]][pGang], 50); GetPlayerName(PointInfo[i][pCapturer], PointInfo[i][pCapturedBy], MAX_PLAYER_NAME); PointInfo[i][pCapturedGang] = PlayerInfo[PointInfo[i][pCapturer]][pGang]; GangInfo[PointInfo[i][pCapturedGang]][gCash] += PointInfo[i][pProfits]; GangInfo[PointInfo[i][pCapturedGang]][gTurfcookies] ++; SendClientMessageToAllEx(COLOR_YELLOW, "Point wars: %s has successfully captured %s for %s.", GetPlayerRPName(PointInfo[i][pCapturer]), PointInfo[i][pName], GangInfo[PointInfo[i][pCapturedGang]][gName]); SendGangMessage(PointInfo[i][pCapturedGang], COLOR_YELLOW, "Your gang has earned $%i, 50 GP, and 1 Turf cookie for successfully capturing this point.", PointInfo[i][pProfits]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET turfcookies = %i, cash = %i WHERE id = %i", GangInfo[PointInfo[i][pCapturedGang]][gTurfcookies], GangInfo[PointInfo[i][pCapturedGang]][gCash], PointInfo[i][pCapturedGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET capturedby = '%s', capturedgang = %i, profits = 0, time = 20 WHERE id = %i", PointInfo[i][pCapturedBy], PointInfo[i][pCapturedGang], i); mysql_tquery(connectionID, queryBuffer); PointInfo[i][pCapturer] = INVALID_PLAYER_ID; PointInfo[i][pCaptureTime] = 0; PointInfo[i][pProfits] = 0; PointInfo[i][pTime] = 20; ReloadPoint(i); } } } } foreach(new i : Turf) { if(TurfInfo[i][tExists] && TurfInfo[i][tCapturer] != INVALID_PLAYER_ID && TurfInfo[i][tCaptureTime] > 0) { if(!IsLawEnforcement(TurfInfo[i][tCapturer]) && (PlayerInfo[TurfInfo[i][tCapturer]][pGang] == -1)) { TurfInfo[i][tCapturer] = INVALID_PLAYER_ID; TurfInfo[i][tCaptureTime] = 0; ReloadTurf(i); } else { TurfInfo[i][tCaptureTime]--; if(TurfInfo[i][tCaptureTime] <= 0) { GetPlayerName(TurfInfo[i][tCapturer], TurfInfo[i][tCapturedBy], MAX_PLAYER_NAME); if(IsLawEnforcement(TurfInfo[i][tCapturer])) { SendClientMessageToAllEx(COLOR_YELLOW, "Turf wars: %s has been successfully claimed back by %s.", TurfInfo[i][tName], GetPlayerRPName(TurfInfo[i][tCapturer])); GetPlayerName(TurfInfo[i][tCapturer], TurfInfo[i][tCapturedBy], MAX_PLAYER_NAME); TurfInfo[i][tCapturedGang] = -5; SendTurfMessage(i, COLOR_YELLOW, "Turf wars: The police have succesfully shutdown %s.", TurfInfo[i][tName]); for(new y = 0; y < MAX_FACTIONS; y++) { if(FactionInfo[y][fType] == FACTION_POLICE || FactionInfo[y][fType] == FACTION_FEDERAL || FactionInfo[y][fType] == FACTION_ARMY) { SendFactionMessage(y, COLOR_YELLOW, "TURFS: Your faction has successfully shutdown a turf, You have earned $5000."); foreach(new x: Player) { if(PlayerInfo[x][pFaction] == y) { GivePlayerCash(x, 5000); } } } } } else { new gangid = PlayerInfo[TurfInfo[i][tCapturer]][pGang]; TurfInfo[i][tCapturedGang] = gangid; GiveGangPoints(gangid, 25); SendClientMessageToAllEx(COLOR_YELLOW, "Turf wars: %s has been successfully claimed by %s for %s.", TurfInfo[i][tName], GetPlayerRPName(TurfInfo[i][tCapturer]), GangInfo[gangid][gName]); switch(TurfInfo[i][tType]) { case 1: { new amount = 10000 + (5000*GangInfo[gangid][gMatLevel]); GangInfo[gangid][gMaterials] = GangInfo[gangid][gMaterials] + amount > GetGangStashCapacity(gangid, STASH_CAPACITY_MATERIALS) ? GetGangStashCapacity(gangid, STASH_CAPACITY_MATERIALS) : GangInfo[gangid][gMaterials] + 15000; SendGangMessage(gangid, COLOR_YELLOW, "Your gang earned %i materials in the stash for capturing this turf!", amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i WHERE id = %i", GangInfo[gangid][gMaterials], gangid); mysql_tquery(connectionID, queryBuffer); } case 2: { new amount = 10 + GangInfo[gangid][gGunLevel]; GangInfo[gangid][gWeapons][GANGWEAPON_9MM] += amount; GangInfo[gangid][gWeapons][GANGWEAPON_SDPISTOL] += amount; GangInfo[gangid][gWeapons][GANGWEAPON_SHOTGUN] += amount; GangInfo[gangid][gWeapons][GANGWEAPON_TEC9] += amount; GangInfo[gangid][gWeapons][GANGWEAPON_UZI] += amount; SendGangMessage(gangid, COLOR_YELLOW, "Your gang earned +%i of 9mm/SDPistol/Shotgun/Tec9/Uzi each in its stash for capturing this turf!", amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_9mm = %i, weapon_sdpistol = %i, weapon_shotgun = %i, weapon_tec9 = %i, weapon_uzi = %i WHERE id = %i", GangInfo[gangid][gWeapons][GANGWEAPON_9MM], GangInfo[gangid][gWeapons][GANGWEAPON_SDPISTOL], GangInfo[gangid][gWeapons][GANGWEAPON_SHOTGUN], GangInfo[gangid][gWeapons][GANGWEAPON_TEC9], GangInfo[gangid][gWeapons][GANGWEAPON_UZI], gangid); mysql_tquery(connectionID, queryBuffer); } case 3: { new amount = 10 + GangInfo[gangid][gGunLevel]; GangInfo[gangid][gWeapons][GANGWEAPON_MP5] += amount; GangInfo[gangid][gWeapons][GANGWEAPON_AK47] += amount; GangInfo[gangid][gWeapons][GANGWEAPON_RIFLE] += amount; SendGangMessage(gangid, COLOR_YELLOW, "Your gang earned +%i of MP5/AK47/Rifle each in its stash for capturing this turf!", amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_mp5 = %i, weapon_ak47 = %i, weapon_rifle = %i WHERE id = %i", GangInfo[gangid][gWeapons][GANGWEAPON_MP5], GangInfo[gangid][gWeapons][GANGWEAPON_AK47], GangInfo[gangid][gWeapons][GANGWEAPON_RIFLE], gangid); mysql_tquery(connectionID, queryBuffer); } case 4: { new amount = 10 + GangInfo[gangid][gGunLevel]; GangInfo[gangid][gWeapons][GANGWEAPON_M4] += amount; GangInfo[gangid][gWeapons][GANGWEAPON_DEAGLE] += amount; //GangInfo[gangid][gWeapons][GANGWEAPON_SNIPER] += amount; SendGangMessage(gangid, COLOR_YELLOW, "Your gang earned +%i of M4/Deagle and +%i of each in its stash for capturing this turf!", amount, (amount-8)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_m4 = %i, weapon_deagle = %i WHERE id = %i", GangInfo[gangid][gWeapons][GANGWEAPON_M4],GangInfo[gangid][gWeapons][GANGWEAPON_DEAGLE], gangid); mysql_tquery(connectionID, queryBuffer); } case 5: { GangInfo[gangid][gWeed] = GangInfo[gangid][gWeed] + 100 > GetGangStashCapacity(gangid, STASH_CAPACITY_WEED) ? GetGangStashCapacity(gangid, STASH_CAPACITY_WEED) : GangInfo[gangid][gWeed] + 100; GangInfo[gangid][gMeth] = GangInfo[gangid][gMeth] + 50 > GetGangStashCapacity(gangid, STASH_CAPACITY_METH) ? GetGangStashCapacity(gangid, STASH_CAPACITY_METH) : GangInfo[gangid][gMeth] + 50; SendGangMessage(gangid, COLOR_YELLOW, "Your gang earned 100 grams of weed & 50 grams of meth in the stash for capturing this turf!"); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weed = %i, meth = %i WHERE id = %i", GangInfo[gangid][gWeed], GangInfo[gangid][gMeth], gangid); mysql_tquery(connectionID, queryBuffer); } case 6: { GangInfo[gangid][gCocaine] = GangInfo[gangid][gCocaine] + 75 > GetGangStashCapacity(gangid, STASH_CAPACITY_COCAINE) ? GetGangStashCapacity(gangid, STASH_CAPACITY_COCAINE) : GangInfo[gangid][gCocaine] + 75; SendGangMessage(gangid, COLOR_YELLOW, "Your gang earned 75 grams of cocaine in the stash for capturing this turf!"); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET cocaine = %i WHERE id = %i", GangInfo[gangid][gCocaine], gangid); mysql_tquery(connectionID, queryBuffer); } case 7: { SendGangMessage(gangid, COLOR_YELLOW, "Your gang will now receive 10 percents of all sales in this turf."); } } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE turfs SET capturedby = '%s', capturedgang = %i, time = 12 WHERE id = %i", TurfInfo[i][tCapturedBy], TurfInfo[i][tCapturedGang], i); mysql_tquery(connectionID, queryBuffer); TurfInfo[i][tCapturer] = INVALID_PLAYER_ID; TurfInfo[i][tCaptureTime] = 0; TurfInfo[i][tTime] = 12; ReloadTurf(i); } } } } for(new i = 0; i < MAX_REPORTS; i ++) { if(ReportInfo[i][rExists] && ReportInfo[i][rTime] > 0) { ReportInfo[i][rTime]--; if(ReportInfo[i][rTime] <= 0 && ReportInfo[i][rAccepted] == 0) { SendClientMessage(ReportInfo[i][rReporter], COLOR_GREY, "Your report has expired. You can make an admin request on ecrp.h0v1n8.nl if you still need help."); ReportInfo[i][rExists] = 0; } } } } RefreshLoginScreen(); } forward FuelTimer(); public FuelTimer() { new driverid; foreach(new i: Vehicle) { if((driverid = GetVehicleDriver(i)) != INVALID_VEHICLE_ID) { if(vehicleFuel[i] > 0) { vehicleFuel[i]--; switch(vehicleFuel[i]) { case 15, 10, 5: { SendClientMessage(driverid, COLOR_LIGHTRED, "** This vehicle is running low on fuel. Visit the nearest gas station to fill up. (/refuel)"); } } } if(vehicleFuel[i] <= 0 && driverid != INVALID_PLAYER_ID) { GameTextForPlayer(driverid, "~r~Out of fuel", 5000, 3); TogglePlayerControllable(driverid, 0); } } } } forward InjuredTimer(); public InjuredTimer() { foreach(new i : Player) { if(PlayerInfo[i][pLogged] && PlayerInfo[i][pInjured] && GetVehicleModel(GetPlayerVehicleID(i)) != 416) { new Float:health; GetPlayerHealth(i, health); SetPlayerHealth(i, health - 1.0); } } } forward RandomFire(check); public RandomFire(check) { new count, index, announced, rand = random(10); if(!IsFireActive()) { if(check) { foreach(new i : Player) { if(GetFactionType(i) == FACTION_MEDIC) { count++; } } } else { count = 3; } if(count >= 3) { for(new i = 0; i < sizeof(randomFireSpawns); i ++) { if(randomFireSpawns[i][fireIndex] == rand) { if(!announced) { foreach(new x : Player) { if(IsPlayerInRangeOfPoint(x, 30.0, randomFireSpawns[i][fireX], randomFireSpawns[i][fireY], randomFireSpawns[i][fireZ])) { SendClientMessage(x, COLOR_PURPLE, "** An explosion can be heard. Smoke is rising from a building nearby."); } if(GetFactionType(x) == FACTION_MEDIC) { PlayerInfo[x][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(x, randomFireSpawns[i][fireX], randomFireSpawns[i][fireY], randomFireSpawns[i][fireZ], 3.0); SendClientMessageEx(x, COLOR_DOCTOR, "** All units, a fire has been reported in %s. Please head to the beacon on your map. **", GetZoneName(randomFireSpawns[i][fireX], randomFireSpawns[i][fireY], randomFireSpawns[i][fireZ])); } } announced = 1; } gFireObjects[index] = CreateDynamicObject(18691, randomFireSpawns[i][fireX], randomFireSpawns[i][fireY], randomFireSpawns[i][fireZ], 0.0, 0.0, randomFireSpawns[i][fireA], .streamdistance = 50.0); gFireHealth[index++] = 50.0; } } gFires = index; } } } forward KickPlayer(playerid); public KickPlayer(playerid) { if(!PlayerInfo[playerid][pKicked]) { PlayerInfo[playerid][pKicked] = 1; SetTimerEx("KickPlayer", 200, false, "i", playerid); } else { PlayerInfo[playerid][pKicked] = 0; Kick(playerid); } } #if defined SERVER_INTRO forward ShowMainMenuCamera(playerid, query); public ShowMainMenuCamera(playerid, query) { if(!query) { for(new i = 0; i < 11; i ++) { TextDrawShowForPlayer(playerid, LoginScreen[i]); } //InterpolateCameraPos(playerid, 2090.500732, -1730.270385, 122.216575, 873.889953, -1519.312011, 123.752815, 60000); //InterpolateCameraLookAt(playerid, 2090.014404, -1730.264892, 122.177040, 873.899353, -1518.828613, 123.698936, 60000); // InterpolateCameraPos(playerid, 2169.808105, -1659.838256, 103.374832, 2167.935058, -1136.155029, 106.361320, 30000); // InterpolateCameraLookAt(playerid, 2169.811035, -1659.351928, 103.347076, 2167.435058, -1136.148559, 106.344200, 30000); ShowRandomCamera(playerid); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM bans WHERE username = '%s' OR ip = '%s' OR ip LIKE '%s'", GetPlayerNameEx(playerid), GetPlayerIP(playerid), GetPlayerIPRange(playerid)); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOOKUP_BANS, playerid); } } #else forward ShowMainMenuCamera(playerid); public ShowMainMenuCamera(playerid) { for(new i = 0; i < 11; i ++) { TextDrawShowForPlayer(playerid, LoginScreen[i]); } //PlayAudioStreamForPlayer(playerid, "http://music.ecrp.h0v1n8.nl/blow.mp3"); // Hernandez PlayLoginMusic(playerid); ClearChat(playerid); //InterpolateCameraPos(playerid, 2090.500732, -1730.270385, 122.216575, 873.889953, -1519.312011, 123.752815, 60000); //InterpolateCameraLookAt(playerid, 2090.014404, -1730.264892, 122.177040, 873.899353, -1518.828613, 123.698936, 60000); // InterpolateCameraPos(playerid, 2169.808105, -1659.838256, 103.374832, 2167.935058, -1136.155029, 106.361320, 30000); // InterpolateCameraLookAt(playerid, 2169.811035, -1659.351928, 103.347076, 2167.435058, -1136.148559, 106.344200, 30000); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM bans WHERE username = '%s' OR ip = '%s' OR ip LIKE '%s'", GetPlayerNameEx(playerid), GetPlayerIP(playerid), GetPlayerIPRange(playerid)); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOOKUP_BANS, playerid); } #endif forward DespawnTimer(vehicleid); public DespawnTimer(vehicleid) { if(VehicleInfo[vehicleid][vOwnerID] > 0 && !IsVehicleOccupied(vehicleid) && !IsVehicleBeingPicked(vehicleid)) { DespawnVehicle(vehicleid); } else { // ANOTHER TEN MINUTES! VehicleInfo[vehicleid][vTimer] = SetTimerEx("DespawnTimer", 300000, false, "i", vehicleid); } } /*forward HTTP_ListShoutcastStations(index, response_code, data[]); public HTTP_ListShoutcastStations(index, response_code, data[]) { }*/ forward HTTP_ProxyCheck(playerid, response_code, data[]); public HTTP_ProxyCheck(playerid, response_code, data[]) { if(response_code == 200) { if(data[0] == 'Y') { SendAdminMessage(COLOR_YELLOW,"AdmWarning: %s[%i] has attempted to connect with a proxy/VPN.", GetPlayerRPName(playerid), playerid); SendClientMessage(playerid, COLOR_RED, "_________Please disable your proxy/VPN and rejoin!_________"); KickPlayer(playerid); } if(data[0] == 'X') { printf("WRONG IP FORMAT"); } } else { printf("The request failed! The response code was: %d", response_code); } return 1; } forward HTTP_OnMusicFetchResponse(index, response_code, data[]); public HTTP_OnMusicFetchResponse(index, response_code, data[]) { if(response_code == 200) { new buffer[2048], string[288], count, start, pos; strcpy(buffer, data); while((pos = strfind(buffer, "
")) != -1) { strdel(buffer, pos, pos + 5); if(++count == 8) { strmid(string, buffer, start, pos); SendClientMessage(index, COLOR_YELLOW, string); start = pos; count = 0; } else { if((strlen(buffer) - pos) < 6) { strmid(string, buffer, start, pos); SendClientMessage(index, COLOR_YELLOW, string); break; } strins(buffer, ", ", pos); } } } else { SendClientMessageEx(index, COLOR_RED, "The music database is currently not available. (error %i)", response_code); } } forward Radio_PlayStation(playerid); public Radio_PlayStation(playerid) { if(cache_get_row_count(radioConnectionID)) { new name[128], url[128]; cache_get_field_content(0, "name", name); cache_get_field_content(0, "url", url); switch(PlayerInfo[playerid][pMusicType]) { case MUSIC_MP3PLAYER: { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the radio station on their MP3 player.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You are now tuned in to {00AA00}%s{33CCFF}.", name); SetMusicStream(MUSIC_MP3PLAYER, playerid, url); } case MUSIC_BOOMBOX: { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the radio station on their boombox.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "Your boombox is now tuned in to {00AA00}%s{33CCFF}.", name); SetMusicStream(MUSIC_BOOMBOX, playerid, url); } case MUSIC_VEHICLE: { if(IsPlayerInAnyVehicle(playerid)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the radio station in their vehicle.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "Your radio is now tuned in to {00AA00}%s{33CCFF}.", name); SetMusicStream(MUSIC_VEHICLE, GetPlayerVehicleID(playerid), url); } } } } } forward Radio_ListStations(playerid); public Radio_ListStations(playerid) { new rows = cache_get_row_count(radioConnectionID); if((!rows) && PlayerInfo[playerid][pSearch] && PlayerInfo[playerid][pPage] == 1) { SendClientMessage(playerid, COLOR_GREY, "No results found."); ShowDialogToPlayer(playerid, DIALOG_MP3RADIOSEARCH); } else if(rows) { static string[MAX_LISTED_STATIONS * 64], name[128]; string[0] = 0; for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "name", name); format(string, sizeof(string), "%s\n%s", string, name); } if(PlayerInfo[playerid][pPage] > 1) { strcat(string, "\n{FF6347}<< Go back{FFFFFF}"); } if(rows == MAX_LISTED_STATIONS) { strcat(string, "\n{00AA00}>> Next page{FFFFFF}"); } ShowPlayerDialog(playerid, DIALOG_MP3RADIORESULTS, DIALOG_STYLE_LIST, "Results", string, "Play", "Back"); } } forward MDC_ListCharges(playerid); public MDC_ListCharges(playerid) { new rows = cache_get_row_count(connectionID); if(!rows) { SendClientMessage(playerid, COLOR_GREY, "This player has no active charges on them."); } else { new chargedby[MAX_PLAYER_NAME], date[24], reason[128], string[512]; string = "Charged by\tDate\tReason"; for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "chargedby", chargedby); cache_get_field_content(i, "date", date); cache_get_field_content(i, "reason", reason); format(string, sizeof(string), "%s\n%s\t%s\t%s", string, chargedby, date, reason); } ShowPlayerDialog(playerid, DIALOG_MDCCHARGES, DIALOG_STYLE_TABLIST_HEADERS, "Active charges:", string, "<<", ""); } return 1; } forward MDC_ClearCharges(playerid); public MDC_ClearCharges(playerid) { if(cache_get_row_count(connectionID)) { new username[MAX_PLAYER_NAME], id = PlayerInfo[playerid][pSelected]; cache_get_field_content(0, "username", username); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM charges WHERE uid = %i", id); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET wantedlevel = 0 WHERE uid = %i", id); mysql_tquery(connectionID, queryBuffer); foreach(new i : Player) { if(!strcmp(GetPlayerNameEx(i), username)) { SendClientMessageEx(i, COLOR_WHITE, "Your crimes were cleared by %s.", GetPlayerRPName(playerid)); PlayerInfo[i][pWantedLevel] = 0; } } SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_ROYALBLUE, "** HQ: %s %s has cleared %s's charges and wanted level.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), username); } } forward MDC_PlayerLookup(playerid, username[]); public MDC_PlayerLookup(playerid, username[]) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "That player doesn't exist and therefore has no information to view."); ShowPlayerDialog(playerid, DIALOG_PLAYERLOOKUP, DIALOG_STYLE_INPUT, "Player lookup", "Enter the full name of the player to lookup:", "Submit", "Cancel"); } else { new string[200]; PlayerInfo[playerid][pSelected] = cache_get_field_content_int(0, "uid"); format(string, sizeof(string), "Name: %s\nGender: %s\nAge: %i years old\nCrimes commited: %i\nTimes arrested: %i\nWanted level: %i/6\nDrivers license: %s", username, (cache_get_field_content_int(0, "gender") == 2) ? ("Female") : ("Male"), cache_get_field_content_int(0, "age"), cache_get_field_content_int(0, "crimes"), cache_get_field_content_int(0, "arrested"), cache_get_field_content_int(0, "wantedlevel"), cache_get_field_content_int(0, "carlicense") ? ("Yes") : ("No")); ShowPlayerDialog(playerid, DIALOG_MDCPLAYER1, DIALOG_STYLE_MSGBOX, "Player lookup", string, "Options", "Cancel"); } } public OnPlayerExitVehicle(playerid, vehicleid) { if(Harvesting[playerid]) { DisablePlayerCheckpoint(playerid); Harvesting[playerid] = 0; SetVehicleToRespawn(GetPlayerVehicleID(playerid)); GameTextForPlayer(playerid, "~r~Mission Failed", 1000, 0); SendClientMessage(playerid, COLOR_GREY, "FARMER: You left your vehicle so you failed the harvesting."); } for(new i=0; i<12; i++) PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][i]); return 1; } /*public OnPlayerLeaveDynamicArea(playerid, areaid) { if(gettime() - PlayerInfo[playerid][pLastDeath] > 10 && (areaid == area_paintball[0] || areaid == area_paintball[1])) { if(PlayerInfo[playerid][pPaintball] == 3 || PlayerInfo[playerid][pPaintball] == 4) { SendClientMessage(playerid, COLOR_RED, "You were poisoned to death for leaving the arena. (Use /exit)"); SetPlayerHealth(playerid, 0.0); } } return 1; }*/ forward OnPlayerUpgradeGarage(playerid, garageid); public OnPlayerUpgradeGarage(playerid, garageid) { new count, rows = cache_get_row_count(connectionID), vehicleid; for(new i = 0; i < rows; i ++) { vehicleid = GetVehicleLinkedID(cache_get_field_content_int(0, "id")); if((vehicleid == INVALID_VEHICLE_ID) || (vehicleid != INVALID_VEHICLE_ID && GetVehicleVirtualWorld(vehicleid) == GarageInfo[garageid][gWorld])) { count++; } } if(count) { SendClientMessage(playerid, COLOR_GREY, "You have despawned vehicles parked in your garage. Park them outside before upgrading."); } else { foreach(new i : Player) { if(GetInsideGarage(i) == garageid) { SetPlayerPos(i, garageInteriors[GarageInfo[garageid][gType] + 1][intVX], garageInteriors[GarageInfo[garageid][gType] + 1][intVY], garageInteriors[GarageInfo[garageid][gType] + 1][intVZ]); SetPlayerFacingAngle(i, garageInteriors[GarageInfo[garageid][gType] + 1][intVA]); SetPlayerInterior(i, garageInteriors[GarageInfo[garageid][gType] + 1][intID]); SetCameraBehindPlayer(i); } } GarageInfo[garageid][gType]++; GarageInfo[garageid][gPrice] = garageInteriors[GarageInfo[garageid][gType]][intPrice]; GivePlayerCash(playerid, -garageInteriors[GarageInfo[garageid][gType]][intPrice]); SendClientMessageEx(playerid, COLOR_GREEN, "You have upgraded your garage's size to %s for %s.", garageInteriors[GarageInfo[garageid][gType]][intName], FormatNumber(garageInteriors[GarageInfo[garageid][gType]][intPrice])); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET type = %i, price = %i WHERE id = %i", GarageInfo[garageid][gType], GarageInfo[garageid][gPrice], GarageInfo[garageid][gID]); mysql_tquery(connectionID, queryBuffer); Log_Write("log_property", "%s (uid: %i) upgraded their garage (id: %i) to %s size for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GarageInfo[garageid][gID], garageInteriors[GarageInfo[garageid][gType]][intName], garageInteriors[GarageInfo[garageid][gType]][intPrice]); } } forward OnPlayerCheckMoney(playerid, achievement[]); public OnPlayerCheckMoney(playerid, achievement[]) { if(cache_get_row_count(connectionID)) { AwardAchievement(playerid, achievement); } } forward OnPlayerAwardedAchievement(playerid, name[]); public OnPlayerAwardedAchievement(playerid, name[]) { new count = cache_get_row_int(0, 0), string[64]; format(string, sizeof(string), "~g~~h~~h~%s~n~~w~(%i/%i unlocked)", name, count, sizeof(achievementInfo)); PlayerTextDrawSetString(playerid, PlayerInfo[playerid][pText][9], string); for(new i = 6; i < 10; i ++) { PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][i]); } if(count == sizeof(achievementInfo)) { SendClientMessageToAllEx(COLOR_GREEN, "Congratulations to %s for completeting the achievement challenge, they've received 10 cookies.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "Well done! You have completed all achievements and received 50 cookies."); PlayerInfo[playerid][pCookies] += 10; } SetTimerEx("HideAchievementTextdraw", 10000, false, "i", playerid); } forward OnPlayerAchievementCheck(playerid, name[]); public OnPlayerAchievementCheck(playerid, name[]) { if(cache_affected_rows(connectionID) > 0) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM achievements WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer, "OnPlayerAwardedAchievement", "is", playerid, name); } } forward OnPlayerUseCarStorage(playerid); public OnPlayerUseCarStorage(playerid) { new vehicleid = GetVehicleLinkedID(cache_get_field_content_int(0, "id")); if(vehicleid != INVALID_VEHICLE_ID) { if(IsVehicleOccupied(vehicleid) && GetVehicleDriver(vehicleid) != playerid) { SendClientMessage(playerid, COLOR_GREY, "This vehicle is occupied."); } else if(IsVehicleBeingPicked(vehicleid)) { SendClientMessage(playerid, COLOR_GREY, "This vehicle is being broken into!"); } else { new Float:health; GetVehicleHealth(vehicleid, health); if(health < 600.0) { SendClientMessage(playerid, COLOR_GREY, "This vehicle is too damaged to be despawned."); } else { SendClientMessageEx(playerid, COLOR_AQUA, "Your {FF6347}%s{33CCFF} which is located in %s has been despawned.", GetVehicleName(vehicleid), GetVehicleZoneName(vehicleid)); DespawnVehicle(vehicleid); } } } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM vehicles WHERE id = %i AND ownerid = %i", cache_get_field_content_int(0, "id"), PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer, "OnPlayerSpawnVehicle", "ii", playerid, false); } } forward OnPlayerAttemptResetUpgrades(playerid); public OnPlayerAttemptResetUpgrades(playerid) { if(PlayerInfo[playerid][pVIPPackage] == 0 && cache_get_row_int(0, 0) > 3) { SendClientMessageEx(playerid, COLOR_GREY, "You own %i/%i vehicle at the moment. Please sell one of them before using this command.", cache_get_row_int(0, 0), GetPlayerAssetLimit(playerid, LIMIT_HOUSES)); } else { PlayerInfo[playerid][pUpgradePoints] = (PlayerInfo[playerid][pLevel] - 1) * 2; PlayerInfo[playerid][pInventoryUpgrade] = 0; PlayerInfo[playerid][pAddictUpgrade] = 0; PlayerInfo[playerid][pTraderUpgrade] = 0; PlayerInfo[playerid][pAssetUpgrade] = 0; PlayerInfo[playerid][pLaborUpgrade] = 0; PlayerInfo[playerid][pSpawnHealth] = 50.0; PlayerInfo[playerid][pSpawnArmor] = 0.0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET upgradepoints = %i, inventoryupgrade = 0, addictupgrade = 0, traderupgrade = 0, assetupgrade = 0, laborupgrade = 0, spawnhealth = '50.0', spawnarmor = '0.0' WHERE uid = %i", PlayerInfo[playerid][pUpgradePoints], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You have reset your upgrade points. You now have %i upgrade points available.", PlayerInfo[playerid][pUpgradePoints]); } } forward OnBanAttempt(username[], ip[], from[], reason[], permanent); public OnBanAttempt(username[], ip[], from[], reason[], permanent) { if(cache_get_row_count(connectionID)) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE bans SET reason = '%e' WHERE id = %i", reason, cache_get_row_int(0, 0)); mysql_tquery(connectionID, queryBuffer); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO bans VALUES(null, '%s', '%s', '%s', NOW(), '%e', %i)", username, ip, from, reason, permanent); mysql_tquery(connectionID, queryBuffer); } } forward OnPlayerAttemptInviteGang(playerid, targetid); public OnPlayerAttemptInviteGang(playerid, targetid) { if(cache_get_row_int(0, 0) >= GetGangMemberLimit(PlayerInfo[playerid][pGang])) { SendClientMessageEx(playerid, COLOR_GREY, "Your gang can't have more than %i members at its level.", GetGangMemberLimit(PlayerInfo[playerid][pGang])); } else { PlayerInfo[targetid][pGangOffer] = playerid; PlayerInfo[targetid][pGangOffered] = PlayerInfo[playerid][pGang]; SendClientMessageEx(targetid, COLOR_AQUA, "%s has invited you to join {00AA00}%s{33CCFF} (/accept gang).", GetPlayerRPName(playerid), GangInfo[PlayerInfo[playerid][pGang]][gName]); SendClientMessageEx(playerid, COLOR_AQUA, "You have invited %s to join your gang.", GetPlayerRPName(targetid)); } } forward OnPlayerAttemptBuyVehicleEx(playerid, offeredby, vehicleid, price); public OnPlayerAttemptBuyVehicleEx(playerid, offeredby, vehicleid, price) { new count = cache_get_row_int(0, 0); if(count >= GetPlayerAssetLimit(playerid, LIMIT_VEHICLES)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently own %i/%i vehicles. You can't own anymore unless you upgrade your asset perk.", count, GetPlayerAssetLimit(playerid, LIMIT_VEHICLES)); } else { GetPlayerName(playerid, VehicleInfo[vehicleid][vOwner], MAX_PLAYER_NAME); VehicleInfo[vehicleid][vOwnerID] = PlayerInfo[playerid][pID]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET ownerid = %i, owner = '%s' WHERE id = %i", VehicleInfo[vehicleid][vOwnerID], VehicleInfo[vehicleid][vOwner], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); if(VehicleInfo[vehicleid][vForSale]) { VehicleInfo[vehicleid][vForSale] = false; VehicleInfo[vehicleid][vForSalePrice] = 0; DestroyDynamic3DTextLabel(VehicleInfo[vehicleid][vForSaleLabel]); VehicleInfo[vehicleid][vForSaleLabel] = Text3D:INVALID_3DTEXT_ID; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET forsale = 0, forsaleprice = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } GivePlayerCash(offeredby, price); GivePlayerCash(playerid, -price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's vehicle offer and paid %s for their %s.", GetPlayerRPName(offeredby), FormatNumber(price), GetVehicleName(vehicleid)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s accepted your vehicle offer and paid %s for your %s.", GetPlayerRPName(playerid), FormatNumber(price), GetVehicleName(vehicleid)); Log_Write("log_property", "%s (uid: %i) (IP: %s) sold their %s (id: %i) for $%i to %s (uid: %i) (IP: %s)", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], GetPlayerIP(offeredby), GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID], price, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerIP(playerid)); } } /*forward OnPlayerAttemptBuyVehicle(playerid, index); public OnPlayerAttemptBuyVehicle(playerid, index) { new count = cache_get_row_int(0, 0); if(count >= GetPlayerAssetLimit(playerid, LIMIT_VEHICLES)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently own %i/%i vehicles. You can't own anymore unless you upgrade your asset perk.", count, GetPlayerAssetLimit(playerid, LIMIT_VEHICLES)); } else { new string[20]; if(PlayerInfo[playerid][pCash] < vehicleArray[index][carPrice]) { SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this vehicle."); } else if(GetSpawnedVehicles(playerid) >= MAX_SPAWNED_VEHICLES) { SendClientMessageEx(playerid, COLOR_GREY, "You can't have more than %i vehicles spawned at a time.", MAX_SPAWNED_VEHICLES); } else { new Float:x, Float:y, Float:z, Float:angle; if(IsPlayerInRangeOfPoint(playerid, 3.0, 542.0433, -1293.5909, 17.2422)) { switch(random(3)) { case 0: x = 562.3970, y = -1283.8485, z = 17.0007, angle = 0.0000; case 1: x = 557.8670, y = -1283.9822, z = 17.0007, angle = 0.0000; case 2: x = 552.8177, y = -1284.1307, z = 17.0007, angle = 0.0000; } } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 154.2223, -1946.3030, 5.1920)) { switch(random(4)) { case 0: x = 138.0530, y = -1828.8923, z = -0.4000, angle = 90.0000; case 1: x = 138.0067, y = -1819.7065, z = -0.4000, angle = 90.0000; case 2: x = 137.9428, y = -1810.7821, z = -0.4000, angle = 90.0000; case 3: x = 137.0448, y = -1801.4567, z = -0.4000, angle = 90.0000; } } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 1892.6315, -2328.6721, 13.5469)) { switch(random(3)) { case 0: x = 1806.3048, y = -2424.4480, z = 15.0087, angle = 180.0000; case 1: x = 1847.3726, y = -2428.7100, z = 15.0087, angle = 180.0000; case 2: x = 1891.6610, y = -2433.3047, z = 15.0087, angle = 180.0000; } } AwardAchievement(playerid, "First wheels"); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO vehicles (ownerid, owner, modelid, price, pos_x, pos_y, pos_z, pos_a) VALUES(%i, '%s', %i, %i, '%f', '%f', '%f', '%f')", PlayerInfo[playerid][pID], GetPlayerNameEx(playerid), vehicleArray[index][carModel], vehicleArray[index][carPrice], x, y, z, angle); mysql_tquery(connectionID, queryBuffer); AddPointMoney(POINT_AUTOEXPORT, percent(vehicleArray[index][carPrice], 3)); GivePlayerCash(playerid, -vehicleArray[index][carPrice]); format(string, sizeof(string), "~r~-$%i", vehicleArray[index][carPrice]); GameTextForPlayer(playerid, string, 5000, 1); SendClientMessageEx(playerid, COLOR_GREEN, "%s purchased for $%i. /carstorage to spawn this vehicle.", vehicleNames[vehicleArray[index][carModel] - 400], vehicleArray[index][carPrice]); Log_Write("log_property", "%s (uid: %i) purchased a %s for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], vehicleNames[vehicleArray[index][carModel] - 400], vehicleArray[index][carPrice]); } } }*/ forward OnPlayerChangeNumber(playerid, number); public OnPlayerChangeNumber(playerid, number) { if(cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "That phone number is already taken."); ShowPlayerDialog(playerid, DIALOG_COOKIENUMBER, DIALOG_STYLE_INPUT, "Number change", "Enter your phone number of choice:", "Submit", "Cancel"); } else { PlayerInfo[playerid][pCookies] -= 75; PlayerInfo[playerid][pPhone] = number; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, phone = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pPhone], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have redeemed 75 cookies for a {00AA00}number change{33CCFF} to %i.", number); } } forward OnHitmanPassport(playerid, name[], level, skinid); public OnHitmanPassport(playerid, name[], level, skinid) { if(cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "That name is already taken, please choose another."); } else { strcpy(PlayerInfo[playerid][pNameChange], name, MAX_PLAYER_NAME); PlayerInfo[playerid][pFreeNamechange] = 2; PlayerInfo[playerid][pChosenLevel] = level; PlayerInfo[playerid][pChosenSkin] = skinid; SendClientMessageEx(playerid, COLOR_AQUA, "You have requested a namechange to {00AA00}%s{33CCFF} for free, please wait for admin approval.", name); SendClientMessageEx(playerid, COLOR_AQUA, "Once the namechange has been approved, you will receive your chosen name, level and skin."); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is requesting a namechange to %s. (/acceptname %i or /denyname %i)", GetPlayerRPName(playerid), playerid, name, playerid, playerid); } } forward OnPlayerAttemptNameChange(playerid, name[]); public OnPlayerAttemptNameChange(playerid, name[]) { if(cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "That name is already taken, please choose another."); if(PlayerInfo[playerid][pFreeNamechange]) { ShowPlayerDialog(playerid, DIALOG_FREENAMECHANGE, DIALOG_STYLE_INPUT, "Non-RP Name", "An administrator has came to the conclusion that your name is non-RP.\nTherefore you have been given this free namechange in order to correct it.\n\nEnter a name in the Firstname_Lastname format in the box below:", "Submit", "Cancel"); } } else { strcpy(PlayerInfo[playerid][pNameChange], name, MAX_PLAYER_NAME); if(PlayerInfo[playerid][pFreeNamechange]) { SendClientMessageEx(playerid, COLOR_AQUA, "You have requested a namechange to {00AA00}%s{33CCFF} for free, please wait for admin approval.", name); } else { SendClientMessageEx(playerid, COLOR_AQUA, "You have requested a namechange to {00AA00}%s{33CCFF} for %s, please wait for admin approval.", name, FormatNumber(PlayerInfo[playerid][pLevel] * 7500)); } SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is requesting a namechange to %s. (/acceptname %i or /denyname %i)", GetPlayerRPName(playerid), playerid, name, playerid, playerid); } } forward OnPlayerRamFurnitureDoor(playerid, objectid, id); public OnPlayerRamFurnitureDoor(playerid, objectid, id) { if(cache_get_field_content_int(0, "door_opened")) { SendClientMessage(playerid, COLOR_GREY, "The door is already opened."); } else { new Float:rx, Float:ry, Float:rz; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s rams the door down.", GetPlayerRPName(playerid)); GetDynamicObjectRot(objectid, rx, ry, rz); rz -= 90.0; SetDynamicObjectRot(objectid, rx, ry, rz); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE furniture SET rot_z = '%f', door_locked = 0, door_opened = 1 WHERE id = %i", rz, id); mysql_tquery(connectionID, queryBuffer); } } forward OnPlayerRamLandDoor(playerid, objectid, id); public OnPlayerRamLandDoor(playerid, objectid, id) { if(cache_get_field_content_int(0, "door_opened")) { SendClientMessage(playerid, COLOR_GREY, "The door is already opened."); } else { new Float:rx, Float:ry, Float:rz; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s rams the door down.", GetPlayerRPName(playerid)); GetDynamicObjectRot(objectid, rx, ry, rz); rz -= 90.0; SetDynamicObjectRot(objectid, rx, ry, rz); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE landobjects SET rot_z = '%f', door_locked = 0, door_opened = 1 WHERE id = %i", rz, id); mysql_tquery(connectionID, queryBuffer); } } forward OnPlayerLockFurnitureDoor(playerid, id); public OnPlayerLockFurnitureDoor(playerid, id) { new status = !cache_get_field_content_int(0, "door_locked"); if(status) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s locks the door.", GetPlayerRPName(playerid)); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s unlocks the door.", GetPlayerRPName(playerid)); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE furniture SET door_locked = %i WHERE id = %i", status, id); mysql_tquery(connectionID, queryBuffer); } forward OnPlayerUseFurnitureDoor(playerid, objectid, id); public OnPlayerUseFurnitureDoor(playerid, objectid, id) { if(cache_get_row_int(0, 1)) { SendClientMessage(playerid, COLOR_GREY, "This door is locked."); } else { new status = !cache_get_row_int(0, 0), Float:rx, Float:ry, Float:rz; GetDynamicObjectRot(objectid, rx, ry, rz); if(status) { rz -= 90.0; } else { rz += 90.0; } SetDynamicObjectRot(objectid, rx, ry, rz); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE furniture SET rot_z = '%f', door_opened = %i WHERE id = %i", rz, status, id); mysql_tquery(connectionID, queryBuffer); if(status) SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s opens the door.", GetPlayerRPName(playerid)); else SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s closes the door.", GetPlayerRPName(playerid)); } } forward OnPlayerLockLandDoor(playerid, id); public OnPlayerLockLandDoor(playerid, id) { new status = !cache_get_field_content_int(0, "door_locked"); if(status) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s locks the door.", GetPlayerRPName(playerid)); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s unlocks the door.", GetPlayerRPName(playerid)); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE landobjects SET door_locked = %i WHERE id = %i", status, id); mysql_tquery(connectionID, queryBuffer); } forward OnPlayerUseLandGate(playerid, objectid, id); public OnPlayerUseLandGate(playerid, objectid, id) { if(!Streamer_GetExtraInt(objectid, E_OBJECT_OPENED)) { new Float:x = cache_get_field_content_float(0, "move_x"), Float:y = cache_get_field_content_float(0, "move_y"), Float:z = cache_get_field_content_float(0, "move_z"); if(x == 0.0 && y == 0.0 && z == 0.0) { SendClientMessage(playerid, COLOR_GREY, "This gate has no destination set."); } else { MoveDynamicObject(objectid, x, y, z, 3.0, cache_get_field_content_float(0, "move_rx"), cache_get_field_content_float(0, "move_ry"), cache_get_field_content_float(0, "move_rz")); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to open the gate.", GetPlayerRPName(playerid)); Streamer_SetExtraInt(objectid, E_OBJECT_OPENED, 1); } } else { MoveDynamicObject(objectid, cache_get_field_content_float(0, "pos_x"), cache_get_field_content_float(0, "pos_y"), cache_get_field_content_float(0, "pos_z"), 3.0, cache_get_field_content_float(0, "rot_x"), cache_get_field_content_float(0, "rot_y"), cache_get_field_content_float(0, "rot_z")); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their remote to close the gate.", GetPlayerRPName(playerid)); Streamer_SetExtraInt(objectid, E_OBJECT_OPENED, 0); } } forward OnPlayerUseLandDoor(playerid, objectid, id); public OnPlayerUseLandDoor(playerid, objectid, id) { if(cache_get_row_int(0, 1)) { SendClientMessage(playerid, COLOR_GREY, "This door is locked."); } else { new status = !cache_get_row_int(0, 0), Float:rx, Float:ry, Float:rz; GetDynamicObjectRot(objectid, rx, ry, rz); if(status) { rz -= 90.0; } else { rz += 90.0; } SetDynamicObjectRot(objectid, rx, ry, rz); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE landobjects SET rot_z = '%f', door_opened = %i WHERE id = %i", rz, status, id); mysql_tquery(connectionID, queryBuffer); if(status) SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s opens the door.", GetPlayerRPName(playerid)); else SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s closes the door.", GetPlayerRPName(playerid)); } } forward OnPlayerAddToPhonebook(playerid, number, name[]); public OnPlayerAddToPhonebook(playerid, number, name[]) { if(cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "That number is already in the phonebook."); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO phonebook VALUES('%e', %i)", name, number); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You have added %s with number %i to the phonebook directory.", name, number); Log_Write("log_faction", "%s (uid: %i) added %s with number %i to the phonebook.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], name, number); } return 1; } forward OnPlayerRemoveFromPhonebook(playerid, number); public OnPlayerRemoveFromPhonebook(playerid, number) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "That number is not in the phonebook."); } else { new name[MAX_PLAYER_NAME]; cache_get_row(0, 0, name); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM phonebook WHERE number = %i", number); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You have removed %s with number %i from the phonebook directory.", name, number); Log_Write("log_faction", "%s (uid: %i) removed %s with number %i from the phonebook.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], name, number); } return 1; } forward OnPlayerListInjuries(playerid, targetid); public OnPlayerListInjuries(playerid, targetid) { new rows = cache_get_row_count(connectionID); if(!rows) { SendClientMessage(playerid, COLOR_GREY, "That player doesn't have any injuries."); } else { SendClientMessageEx(playerid, COLOR_NAVYBLUE, "______ %s's Injuries ______", GetPlayerRPName(targetid)); for(new i = 0; i < rows; i ++) { SendClientMessageEx(playerid, COLOR_YELLOW, "[%i seconds ago] %s was shot with a %s", gettime() - cache_get_row_int(i, 1), GetPlayerRPName(targetid), GetWeaponNameEx(cache_get_row_int(i, 0))); } } } forward OnPlayerOfflineKickFaction(playerid, username[]); public OnPlayerOfflineKickFaction(playerid, username[]) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist."); } else if(cache_get_row_int(0, 1) != PlayerInfo[playerid][pFaction]) { SendClientMessage(playerid, COLOR_GREY, "That player is not apart of your faction."); } /*else if(cache_get_row_int(0, 2) > PlayerInfo[playerid][pFactionRank]) { SendClientMessage(playerid, COLOR_GREY, "That player has a higher rank than you."); }*/ else { new uid = cache_get_row_int(0, 0), factionid = cache_get_row_int(0, 1), rankid = cache_get_row_int(0, 2); Log_Write("log_faction", "%s (uid: %i) offline kicked %s (uid: %i) from %s (id: %i) as rank %s (%i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username, uid, FactionInfo[factionid][fName], factionid, FactionRanks[factionid][rankid], rankid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET faction = -1, factionrank = 0, factionleader = 0, division = -1 WHERE uid = %i", uid); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have offline kicked %s from your faction.", username); } } forward OnPlayerOfflineKickGang(playerid, username[]); public OnPlayerOfflineKickGang(playerid, username[]) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist."); } else if(cache_get_row_int(0, 1) != PlayerInfo[playerid][pGang]) { SendClientMessage(playerid, COLOR_GREY, "That player is not apart of your gang."); } else if(cache_get_row_int(0, 2) > PlayerInfo[playerid][pGangRank]) { SendClientMessage(playerid, COLOR_GREY, "That player has a higher rank than you."); } else { new uid = cache_get_row_int(0, 0), gangid = cache_get_row_int(0, 1), rankid = cache_get_row_int(0, 2); Log_Write("log_gang", "%s (uid: %i) offline kicked %s (uid: %i) from %s (id: %i) as rank %s (%i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username, uid, GangInfo[gangid][gName], gangid, GangRanks[gangid][rankid], rankid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gang = -1, gangrank = 0 WHERE uid = %i", uid); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have offline kicked %s from your gang.", username); } } forward OnPlayerListGangs(playerid, gangid); public OnPlayerListGangs(playerid, gangid) { new color, members = cache_get_row_int(0, 0), color2, allyname[32]; if(GangInfo[gangid][gColor] == -1 || GangInfo[gangid][gColor] == -256) { color = 0xC8C8C8FF; } else { color = GangInfo[gangid][gColor]; } new alliance = GangInfo[gangid][gAlliance]; if(alliance >= 0) { strcpy(allyname, GangInfo[alliance][gName]); if(GangInfo[alliance][gColor] == -1 || GangInfo[alliance][gColor] == -256) { color2 = 0xC8C8C8FF; } else { color2 = GangInfo[alliance][gColor]; } } if(alliance >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "ID: %i | {%06x}%s{C8C8C8} | Leader: %s | Members: %i/%i | Strikes: %i/3 | Ally: {%06x}%s{C8C8C8}", gangid, color >>> 8, GangInfo[gangid][gName], GangInfo[gangid][gLeader], members, GetGangMemberLimit(gangid), GangInfo[gangid][gStrikes], color2 >>> 8, allyname); } else if(alliance >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "ID: %i | {%06x}%s{C8C8C8} | Leader: %s | Members: %i/%i | Strikes: %i/3 | Ally: {%06x}%s", gangid, color >>> 8, GangInfo[gangid][gName], GangInfo[gangid][gLeader], members, GetGangMemberLimit(gangid), GangInfo[gangid][gStrikes], color2 >>> 8, allyname); } else { SendClientMessageEx(playerid, COLOR_GREY2, "ID: %i | {%06x}%s{C8C8C8} | Leader: %s | Members: %i/%i | Strikes: %i/3", gangid, color >>> 8, GangInfo[gangid][gName], GangInfo[gangid][gLeader], members, GetGangMemberLimit(gangid), GangInfo[gangid][gStrikes]); } } forward OnPlayerListFactions(playerid, factionid); public OnPlayerListFactions(playerid, factionid) { new color, members = cache_get_row_int(0, 0); if(FactionInfo[factionid][fColor] == -1 || FactionInfo[factionid][fColor] == -256) { color = 0xC8C8C8FF; } else { color = FactionInfo[factionid][fColor]; } if(FactionInfo[factionid][fType] == FACTION_HITMAN && PlayerInfo[playerid][pAdmin] < 7) { SendClientMessageEx(playerid, COLOR_GREY2, "ID: %i | Name: {%06x}%s{C8C8C8} | Leader: Classified | Members: 0", factionid, color >>> 8, FactionInfo[factionid][fName]); } else { SendClientMessageEx(playerid, COLOR_GREY2, "ID: %i | Name: {%06x}%s{C8C8C8} | Leader: %s | Members: %i", factionid, color >>> 8, FactionInfo[factionid][fName], FactionInfo[factionid][fLeader], members); } } forward OnPlayerBuyPhoneNumber(playerid, number); public OnPlayerBuyPhoneNumber(playerid, number) { if(cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The specified phone number is already taken."); } else { PlayerInfo[playerid][pPhone] = number; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET phone = %i WHERE uid = %i", number, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -10000); GameTextForPlayer(playerid, "~r~-$10,000", 5000, 1); SendClientMessageEx(playerid, COLOR_AQUA, "You paid $10,000 to change your phone number to %i.", number); Log_Write("log_vip", "%s VIP %s (uid: %i) has purchased phone number: %i for $10000.", GetVIPRank(PlayerInfo[playerid][pVIPPackage]), GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], number); } } forward OnPlayerSpawnVehicle(playerid, parked); public OnPlayerSpawnVehicle(playerid, parked) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The slot specified contains no valid vehicle which you can spawn."); } else { if(GetVehicleLinkedID(cache_get_field_content_int(0, "id")) != INVALID_VEHICLE_ID) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle is spawned already. /findcar to track it."); } if(GetSpawnedVehicles(playerid) >= MAX_SPAWNED_VEHICLES) { return SendClientMessageEx(playerid, COLOR_GREY, "You can't have more than %i vehicles spawned at a time.", MAX_SPAWNED_VEHICLES); } new modelid = cache_get_field_content_int(0, "modelid"), Float:x = cache_get_field_content_float(0, "pos_x"), Float:y = cache_get_field_content_float(0, "pos_y"), Float:z = cache_get_field_content_float(0, "pos_z"), Float:a = cache_get_field_content_float(0, "pos_a"), color1 = cache_get_field_content_int(0, "color1"), color2 = cache_get_field_content_int(0, "color2"), vehicleid; vehicleid = CreateVehicle(modelid, x, y, z, a, color1, color2, -1); if(vehicleid != INVALID_VEHICLE_ID) { ResetVehicle(vehicleid); cache_get_field_content(0, "owner", VehicleInfo[vehicleid][vOwner], connectionID, MAX_PLAYER_NAME); cache_get_field_content(0, "plate", VehicleInfo[vehicleid][vPlate], connectionID, 32); VehicleInfo[vehicleid][vID] = cache_get_field_content_int(0, "id"); VehicleInfo[vehicleid][vOwnerID] = cache_get_field_content_int(0, "ownerid"); VehicleInfo[vehicleid][vPrice] = cache_get_field_content_int(0, "price"); VehicleInfo[vehicleid][vTickets] = cache_get_field_content_int(0, "tickets"); VehicleInfo[vehicleid][vLocked] = cache_get_field_content_int(0, "locked"); VehicleInfo[vehicleid][vHealth] = cache_get_field_content_float(0, "health"); VehicleInfo[vehicleid][vPaintjob] = cache_get_field_content_int(0, "paintjob"); VehicleInfo[vehicleid][vInterior] = cache_get_field_content_int(0, "interior"); VehicleInfo[vehicleid][vWorld] = cache_get_field_content_int(0, "world"); VehicleInfo[vehicleid][vNeon] = cache_get_field_content_int(0, "neon"); VehicleInfo[vehicleid][vNeonEnabled] = cache_get_field_content_int(0, "neonenabled"); VehicleInfo[vehicleid][vTrunk] = cache_get_field_content_int(0, "trunk"); VehicleInfo[vehicleid][vAlarm] = cache_get_field_content_int(0, "alarm"); VehicleInfo[vehicleid][vMods][0] = cache_get_field_content_int(0, "mod_1"); VehicleInfo[vehicleid][vMods][1] = cache_get_field_content_int(0, "mod_2"); VehicleInfo[vehicleid][vMods][2] = cache_get_field_content_int(0, "mod_3"); VehicleInfo[vehicleid][vMods][3] = cache_get_field_content_int(0, "mod_4"); VehicleInfo[vehicleid][vMods][4] = cache_get_field_content_int(0, "mod_5"); VehicleInfo[vehicleid][vMods][5] = cache_get_field_content_int(0, "mod_6"); VehicleInfo[vehicleid][vMods][6] = cache_get_field_content_int(0, "mod_7"); VehicleInfo[vehicleid][vMods][7] = cache_get_field_content_int(0, "mod_8"); VehicleInfo[vehicleid][vMods][8] = cache_get_field_content_int(0, "mod_9"); VehicleInfo[vehicleid][vMods][9] = cache_get_field_content_int(0, "mod_10"); VehicleInfo[vehicleid][vMods][10] = cache_get_field_content_int(0, "mod_11"); VehicleInfo[vehicleid][vMods][11] = cache_get_field_content_int(0, "mod_12"); VehicleInfo[vehicleid][vMods][12] = cache_get_field_content_int(0, "mod_13"); VehicleInfo[vehicleid][vMods][13] = cache_get_field_content_int(0, "mod_14"); VehicleInfo[vehicleid][vCash] = cache_get_field_content_int(0, "cash"); VehicleInfo[vehicleid][vMaterials] = cache_get_field_content_int(0, "materials"); VehicleInfo[vehicleid][vWeed] = cache_get_field_content_int(0, "weed"); VehicleInfo[vehicleid][vCocaine] = cache_get_field_content_int(0, "cocaine"); VehicleInfo[vehicleid][vMeth] = cache_get_field_content_int(0, "meth"); VehicleInfo[vehicleid][vPainkillers] = cache_get_field_content_int(0, "painkillers"); VehicleInfo[vehicleid][vWeapons][0] = cache_get_field_content_int(0, "weapon_1"); VehicleInfo[vehicleid][vWeapons][1] = cache_get_field_content_int(0, "weapon_2"); VehicleInfo[vehicleid][vWeapons][2] = cache_get_field_content_int(0, "weapon_3"); VehicleInfo[vehicleid][vWeapons][3] = cache_get_field_content_int(0, "weapon_4"); VehicleInfo[vehicleid][vWeapons][4] = cache_get_field_content_int(0, "weapon_5"); VehicleInfo[vehicleid][vGang] = -1; VehicleInfo[vehicleid][vFactionType] = FACTION_NONE; VehicleInfo[vehicleid][vJob] = JOB_NONE; VehicleInfo[vehicleid][vRespawnDelay] = -1; VehicleInfo[vehicleid][vModel] = modelid; VehicleInfo[vehicleid][vPosX] = x; VehicleInfo[vehicleid][vPosY] = y; VehicleInfo[vehicleid][vPosZ] = z; VehicleInfo[vehicleid][vPosA] = a; VehicleInfo[vehicleid][vColor1] = color1; VehicleInfo[vehicleid][vColor2] = color2; VehicleInfo[vehicleid][vObjects][0] = INVALID_OBJECT_ID; VehicleInfo[vehicleid][vObjects][1] = INVALID_OBJECT_ID; VehicleInfo[vehicleid][vTimer] = -1; VehicleInfo[vehicleid][vRank] = 0; vehicleFuel[vehicleid] = cache_get_field_content_int(0, "fuel"); adminVehicle{vehicleid} = false; ReloadVehicle(vehicleid); if(!parked) { SendClientMessageEx(playerid, COLOR_AQUA, "You have spawned your %s which is located in %s. /findcar to track it.", GetVehicleName(vehicleid), GetVehicleZoneName(vehicleid)); } } } return 1; } forward OnPlayerAttachCopClothing(playerid, name[], clothingid); public OnPlayerAttachCopClothing(playerid, name[], clothingid) { strcpy(ClothingInfo[playerid][clothingid][cName], name, 32); ClothingInfo[playerid][clothingid][cID] = cache_insert_id(connectionID); ClothingInfo[playerid][clothingid][cExists] = 1; ClothingInfo[playerid][clothingid][cAttached] = 0; ClothingInfo[playerid][clothingid][cAttachedIndex] = -1; SendClientMessageEx(playerid, COLOR_AQUA, "%s added to clothing inventory. /clothing to attach your new item.", name); } forward OnPlayerBuyClothingItem(playerid, name[], price, businessid, clothingid); public OnPlayerBuyClothingItem(playerid, name[], price, businessid, clothingid) { new string[16]; if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } strcpy(ClothingInfo[playerid][clothingid][cName], name, 32); ClothingInfo[playerid][clothingid][cID] = cache_insert_id(connectionID); ClothingInfo[playerid][clothingid][cExists] = 1; ClothingInfo[playerid][clothingid][cAttached] = 0; ClothingInfo[playerid][clothingid][cAttachedIndex] = -1; BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -price); SendClientMessageEx(playerid, COLOR_AQUA, "%s purchased for {00AA00}$%i{33CCFF}. /clothing to find your new item.", name, price); format(string, sizeof(string), "~r~-$%i", price); GameTextForPlayer(playerid, string, 5000, 1); } forward OnPlayerSendTextMessage(playerid, number, msg[]); public OnPlayerSendTextMessage(playerid, number, msg[]) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The number you're trying to reach does not belong to any particular person."); } else if(cache_get_row_int(0, 1)) { SendClientMessage(playerid, COLOR_GREY, "That player is currently imprisoned and cannot use their phone."); } else if(cache_get_row_int(0, 2)) { SendClientMessage(playerid, COLOR_GREY, "That player has their mobile phone switched off."); } else { new username[MAX_PLAYER_NAME]; cache_get_row(0, 0, username); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO texts VALUES(null, %i, %i, '%s', NOW(), '%e')", PlayerInfo[playerid][pPhone], number, GetPlayerNameEx(playerid), msg); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes out a cellphone and sends a message.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_YELLOW, "** SMS to %s (%i): %s **", username, number, msg); SendClientMessage(playerid, COLOR_WHITE, "The player who owns the number is offline, but will receive your text when they log in."); GivePlayerCash(playerid, -1); GameTextForPlayer(playerid, "~w~Text sent!~n~~r~-$1", 5000, 1); } } forward OnPlayerRentHouse(playerid, houseid); public OnPlayerRentHouse(playerid, houseid) { if(cache_get_row_int(0, 0) >= GetHouseTenantCapacity(houseid)) { SendClientMessageEx(playerid, COLOR_GREY, "This house has reached its limit of %i tenants.", GetHouseTenantCapacity(houseid)); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rentinghouse = %i WHERE uid = %i", HouseInfo[houseid][hID], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[playerid][pRentingHouse] = HouseInfo[houseid][hID]; SendClientMessageEx(playerid, COLOR_GREEN, "You are now renting at %s's house. You will pay %s every paycheck.", HouseInfo[houseid][hOwner], FormatNumber(HouseInfo[houseid][hRentPrice])); } } forward OnPlayerEvict(playerid, username[]); public OnPlayerEvict(playerid, username[]) { if(!cache_get_row_count(connectionID)) { return SendClientMessage(playerid, COLOR_GREY, "That player doesn't exist, or is not renting at your home."); } else { foreach(new i : Player) { if(!strcmp(GetPlayerNameEx(i), username) && PlayerInfo[i][pLogged]) { PlayerInfo[i][pRentingHouse] = 0; SendClientMessage(i, COLOR_RED, "You have been evicted from your home by the owner."); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rentinghouse = 0 WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_WHITE, "You have evicted %s from your property.", username); } return 1; } forward OnListPlayerFlags(playerid, targetid); public OnListPlayerFlags(playerid, targetid) { new rows = cache_get_row_count(connectionID); if(!rows) { SendClientMessage(playerid, COLOR_GREY, "This player has no flags listed under their account."); } else { new flaggedby[24], date[24], desc[128]; SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_________ %s's Flags _________", GetPlayerRPName(targetid)); for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "flaggedby", flaggedby); cache_get_field_content(i, "date", date); cache_get_field_content(i, "description", desc); SendClientMessageEx(playerid, COLOR_GREY2, "[%i][%s] %s (from: %s)", i + 1, date, desc, flaggedby); } } } forward OnVerifyRemoveFlag(playerid, targetid); public OnVerifyRemoveFlag(playerid, targetid) { if(cache_get_row_count(connectionID)) { new desc[128]; cache_get_field_content(0, "description", desc); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM flags WHERE id = %i", cache_get_field_content_int(0, "id")); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's flag for '%s'.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), desc); } } forward OnVerifyRemoveVehicle(playerid, targetid); public OnVerifyRemoveVehicle(playerid, targetid) { if(cache_get_row_count(connectionID)) { new vehicleid = GetVehicleLinkedID(cache_get_field_content_int(0, "id")), modelid = cache_get_field_content_int(0, "modelid"); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM vehicles WHERE id = %i", cache_get_field_content_int(0, "id")); mysql_tquery(connectionID, queryBuffer); if(vehicleid != INVALID_VEHICLE_ID) { DespawnVehicle(vehicleid, false); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), vehicleNames[modelid - 400]); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}%s{33CCFF} from your vehicle list.", GetPlayerRPName(playerid), vehicleNames[modelid - 400]); } } forward OnUpdatePartner(playerid); public OnUpdatePartner(playerid) { if(cache_get_row_count(connectionID)) { cache_get_field_content(0, "username", PlayerInfo[playerid][pMarriedName], connectionID, MAX_PLAYER_NAME); } } forward OnAdminSetPhoneNumber(playerid, targetid, number); public OnAdminSetPhoneNumber(playerid, targetid, number) { if(cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The number specified is already taken."); } else { PlayerInfo[targetid][pPhone] = number; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's phone number to %i.", GetPlayerRPName(targetid), number); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET phone = %i WHERE uid = %i", number, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); Log_Write("log_admin", "%s (uid: %i) set %s's (uid: %i) phone number to %i", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], number); } } forward OnAdminChangePassword(playerid, username[], password[]); public OnAdminChangePassword(playerid, username[], password[]) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist."); } else { new hashed[129]; WP_Hash(hashed, sizeof(hashed), password); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET password = '%s' WHERE username = '%e'", hashed, username); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has changed %s's account password.", GetPlayerRPName(playerid), username); } } forward OnAdminListVehiclesForRemoval(playerid, targetid); public OnAdminListVehiclesForRemoval(playerid, targetid) { new rows = cache_get_row_count(connectionID); if(!rows) { SendClientMessage(playerid, COLOR_GREY, "This player owns no vehicles."); } else { static string[1024]; string = "#\tModel\tLocation"; for(new i = 0; i < rows; i ++) { new vehicleid = GetVehicleLinkedID(cache_get_field_content_int(i, "id")); if(vehicleid == INVALID_VEHICLE_ID) { format(string, sizeof(string), "%s\nn/a\t%s\t%s", string, vehicleNames[cache_get_field_content_int(i, "modelid") - 400], (cache_get_field_content_int(i, "interior")) ? ("Garage") : GetZoneName(cache_get_field_content_float(i, "pos_x"), cache_get_field_content_float(i, "pos_y"), cache_get_field_content_float(i, "pos_z"))); } else { format(string, sizeof(string), "%s\nID %i\t%s\t%s", string, vehicleid, GetVehicleName(vehicleid), GetVehicleZoneName(vehicleid)); } } PlayerInfo[playerid][pRemoveFrom] = targetid; ShowPlayerDialog(playerid, DIALOG_REMOVEPVEH, DIALOG_STYLE_TABLIST_HEADERS, "Choose a vehicle to remove.", string, "Select", "Cancel"); } } forward OnAdminListVehicles(playerid, targetid); public OnAdminListVehicles(playerid, targetid) { new rows = cache_get_row_count(connectionID); SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_____ %s's Vehicles _____", GetPlayerRPName(targetid)); for(new i = 0; i < rows; i ++) { new vehicleid = GetVehicleLinkedID(cache_get_field_content_int(i, "id")); if(vehicleid == INVALID_VEHICLE_ID) { SendClientMessageEx(playerid, COLOR_GREY2, "ID: n/a | Model: %s | Location: %s", vehicleNames[cache_get_field_content_int(i, "modelid") - 400], (cache_get_field_content_int(i, "interior")) ? ("Garage") : GetZoneName(cache_get_field_content_float(i, "pos_x"), cache_get_field_content_float(i, "pos_y"), cache_get_field_content_float(i, "pos_z"))); } else { SendClientMessageEx(playerid, COLOR_GREY2, "ID: %i | Model: %s | Location: %s", vehicleid, GetVehicleName(vehicleid), GetVehicleZoneName(vehicleid)); } } } forward OnAdminOfflineDM(playerid, username[]); public OnAdminOfflineDM(playerid, username[]) { if(cache_get_row_count(connectionID)) { if(cache_get_field_content_int(0, "adminlevel") > PlayerInfo[playerid][pAdmin]) { SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be punished."); } else { new ip[16], id = cache_get_field_content_int(0, "uid"), warns = cache_get_field_content_int(0, "warns"); warns++; if(warns < 3) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET jailtype = 2, jailtime = %i, dmwarnings = %i, weaponrestricted = %i, prisonedby = '%s', prisonreason = 'DM' WHERE uid = %i", warns * 3600, warns, warns * 4, GetPlayerNameEx(playerid), id); mysql_tquery(connectionID, queryBuffer); Log_Write("log_punishments", "%s (uid: %i) offline prisoned %s (uid: %i) for %i minutes, reason: DM [/dm]", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username, id, warns * 60); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was offline DM Warned & Prisoned for %i minutes by %s, reason: DM (%i/3)", username, warns * 60, GetPlayerRPName(playerid), warns); } else { cache_get_field_content(0, "ip", ip); AddBan(username, ip, GetPlayerNameEx(playerid), "DM (3/3 warnings)"); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET dmwarnings = 0 WHERE uid = %i", id); mysql_tquery(connectionID, queryBuffer); Log_Write("log_punishments", "%s (uid: %i) offline banned %s (uid: %i), reason: DM (3/3 warnings)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username, id); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was offline banned by %s, reason: DM (3/3 warnings)", username, GetPlayerRPName(playerid)); } } } else { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist."); } } forward OnAdminCheckNameHistory(playerid, targetid); public OnAdminCheckNameHistory(playerid, targetid) { new rows = cache_get_row_count(connectionID); if(!rows) { SendClientMessage(playerid, COLOR_GREY, "This player has no namechange history recorded."); } else { new oldname[MAX_PLAYER_NAME], newname[MAX_PLAYER_NAME], changedby[MAX_PLAYER_NAME], date[24]; SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ Namechange History _____"); for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "oldname", oldname); cache_get_field_content(i, "newname", newname); cache_get_field_content(i, "changedby", changedby); cache_get_field_content(i, "date", date); SendClientMessageEx(playerid, COLOR_YELLOW, "[%s] %s has changed %s's name to %s.", date, changedby, oldname, newname); } } } forward OnAdminListFlagsForRemoval(playerid, targetid); public OnAdminListFlagsForRemoval(playerid, targetid) { new rows = cache_get_row_count(connectionID); if(!rows) { SendClientMessage(playerid, COLOR_GREY, "This player has no flags listed under their account."); } else { static string[4096], flaggedby[24], date[24], desc[128]; string = "#\tFlagged by\tDate\tDescription"; for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "flaggedby", flaggedby); cache_get_field_content(i, "date", date); cache_get_field_content(i, "description", desc); format(string, sizeof(string), "%s\n%i\t%s\t%s\t%s", string, i + 1, flaggedby, date, desc); } PlayerInfo[playerid][pRemoveFrom] = targetid; ShowPlayerDialog(playerid, DIALOG_REMOVEFLAG, DIALOG_STYLE_TABLIST_HEADERS, "Choose a flag to remove.", string, "Select", "Cancel"); } } forward OnAdminCreateLocker(playerid, lockerid, factionid, Float:x, Float:y, Float:z, interior, world); public OnAdminCreateLocker(playerid, lockerid, factionid, Float:x, Float:y, Float:z, interior, world) { LockerInfo[lockerid][lID] = cache_insert_id(connectionID); LockerInfo[lockerid][lExists] = 1; LockerInfo[lockerid][lFaction] = factionid; LockerInfo[lockerid][lPosX] = x; LockerInfo[lockerid][lPosY] = y; LockerInfo[lockerid][lPosZ] = z; LockerInfo[lockerid][lInterior] = interior; LockerInfo[lockerid][lWorld] = world; LockerInfo[lockerid][lIcon] = 1239; LockerInfo[lockerid][lLabel] = 1; // CHANGE SQL TOO PLS LockerInfo[lockerid][locKevlar] = { 1, 0 }; LockerInfo[lockerid][locMedKit] = { 1, 0 }; LockerInfo[lockerid][locNitestick] = { 0, 0 }; LockerInfo[lockerid][locMace] = { 0, 0 }; LockerInfo[lockerid][locDeagle] = { 1, 0 }; LockerInfo[lockerid][locShotgun] = { 1, 0 }; LockerInfo[lockerid][locMP5] = { 1, 0 }; LockerInfo[lockerid][locM4] = { 1, 0 }; LockerInfo[lockerid][locSniper] = { 1, 0 }; LockerInfo[lockerid][locCamera] = { 0, 0 }; LockerInfo[lockerid][locFireExt] = { 0, 0 }; LockerInfo[lockerid][locPainKillers] = { 0, 0 }; LockerInfo[lockerid][lText] = Text3D:INVALID_3DTEXT_ID; LockerInfo[lockerid][lPickup] = -1; ReloadLocker(lockerid); SendClientMessageEx(playerid, COLOR_GREEN, "** Locker %i created for %s.", lockerid, FactionInfo[factionid][fName]); } forward OnAdminCreateAtm(playerid, atm, Float:x, Float:y, Float:z, Float:a); public OnAdminCreateAtm(playerid, atm, Float:x, Float:y, Float:z, Float:a) { AtmInfo[atm][aID] = cache_insert_id(connectionID); AtmInfo[atm][aExists] = true; AtmInfo[atm][aPosX] = x; AtmInfo[atm][aPosY] = y; AtmInfo[atm][aPosZ] = z; AtmInfo[atm][aPosA] = a; ReloadAtm(atm); SendClientMessageEx(playerid, COLOR_GREEN, "** ATM [%i] created at %.1f, %.1f, %.1f.", atm, x, y, z); } forward OnAdminCreateLocation(playerid, location, name[], Float:x, Float:y, Float:z); public OnAdminCreateLocation(playerid, location, name[], Float:x, Float:y, Float:z) { LocationInfo[location][locID] = cache_insert_id(connectionID); LocationInfo[location][locExists] = true; strcpy(LocationInfo[location][locName], name, 32); LocationInfo[location][locPosX] = x; LocationInfo[location][locPosY] = y; LocationInfo[location][locPosZ] = z; SendClientMessageEx(playerid, COLOR_GREEN, "** Location [%i] %s created at %.1f, %.1f, %.1f.", location, name, x, y, z); } forward OnAdminOfflineCheck(playerid, username[]); public OnAdminOfflineCheck(playerid, username[]) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist."); } else { // At first I didn't know how I was going to do this. But then I came up with a plan. // Load everything into an unused player slot, use DisplayStats as normal, then destroy the data. // This ensures that whenever I add a new thing to /stats for instance, I don't have to maintain // two stats functions, I can just call DisplayStats and let the work do itself. PlayerInfo[MAX_PLAYERS][pID] = cache_get_field_content_int(0, "uid"); PlayerInfo[MAX_PLAYERS][pSetup] = cache_get_field_content_int(0, "setup"); PlayerInfo[MAX_PLAYERS][pGender] = cache_get_field_content_int(0, "gender"); PlayerInfo[MAX_PLAYERS][pAge] = cache_get_field_content_int(0, "age"); PlayerInfo[MAX_PLAYERS][pHunger] = cache_get_field_content_int(0, "hunger"); PlayerInfo[MAX_PLAYERS][pThirst] = cache_get_field_content_int(0, "thirst"); PlayerInfo[MAX_PLAYERS][pSkin] = cache_get_field_content_int(0, "skin"); PlayerInfo[MAX_PLAYERS][pCameraX] = cache_get_field_content_float(0, "camera_x"); PlayerInfo[MAX_PLAYERS][pCameraY] = cache_get_field_content_float(0, "camera_y"); PlayerInfo[MAX_PLAYERS][pCameraZ] = cache_get_field_content_float(0, "camera_z"); PlayerInfo[MAX_PLAYERS][pPosX] = cache_get_field_content_float(0, "pos_x"); PlayerInfo[MAX_PLAYERS][pPosY] = cache_get_field_content_float(0, "pos_y"); PlayerInfo[MAX_PLAYERS][pPosZ] = cache_get_field_content_float(0, "pos_z"); PlayerInfo[MAX_PLAYERS][pPosA] = cache_get_field_content_float(0, "pos_a"); PlayerInfo[MAX_PLAYERS][pInterior] = cache_get_field_content_int(0, "interior"); PlayerInfo[MAX_PLAYERS][pWorld] = cache_get_field_content_int(0, "world"); PlayerInfo[MAX_PLAYERS][pCash] = cache_get_field_content_int(0, "cash"); PlayerInfo[MAX_PLAYERS][pBank] = cache_get_field_content_int(0, "bank"); PlayerInfo[MAX_PLAYERS][pPaycheck] = cache_get_field_content_int(0, "paycheck"); PlayerInfo[MAX_PLAYERS][pLevel] = cache_get_field_content_int(0, "level"); PlayerInfo[MAX_PLAYERS][pvLock] = cache_get_field_content_int(0, "vehlock"); PlayerInfo[MAX_PLAYERS][pGraphic] = cache_get_field_content_int(0, "graphic"); PlayerInfo[MAX_PLAYERS][pEXP] = cache_get_field_content_int(0, "exp"); PlayerInfo[MAX_PLAYERS][pMinutes] = cache_get_field_content_int(0, "minutes"); PlayerInfo[MAX_PLAYERS][pHours] = cache_get_field_content_int(0, "hours"); PlayerInfo[MAX_PLAYERS][pAdmin] = cache_get_field_content_int(0, "adminlevel"); PlayerInfo[MAX_PLAYERS][pHelper] = cache_get_field_content_int(0, "helperlevel"); PlayerInfo[MAX_PLAYERS][pHealth] = cache_get_field_content_float(0, "health"); PlayerInfo[MAX_PLAYERS][pArmor] = cache_get_field_content_float(0, "armor"); PlayerInfo[MAX_PLAYERS][pUpgradePoints] = cache_get_field_content_int(0, "upgradepoints"); PlayerInfo[MAX_PLAYERS][pWarnings] = cache_get_field_content_int(0, "warnings"); PlayerInfo[MAX_PLAYERS][pInjured] = cache_get_field_content_int(0, "injured"); PlayerInfo[MAX_PLAYERS][pHospital] = cache_get_field_content_int(0, "hospital"); PlayerInfo[MAX_PLAYERS][pSpawnHealth] = cache_get_field_content_float(0, "spawnhealth"); PlayerInfo[MAX_PLAYERS][pSpawnArmor] = cache_get_field_content_float(0, "spawnarmor"); PlayerInfo[MAX_PLAYERS][pJailType] = cache_get_field_content_int(0, "jailtype"); PlayerInfo[MAX_PLAYERS][pJailTime] = cache_get_field_content_int(0, "jailtime"); PlayerInfo[MAX_PLAYERS][pNewbieMuted] = cache_get_field_content_int(0, "newbiemuted"); PlayerInfo[MAX_PLAYERS][pHelpMuted] = cache_get_field_content_int(0, "helpmuted"); PlayerInfo[MAX_PLAYERS][pAdMuted] = cache_get_field_content_int(0, "admuted"); PlayerInfo[MAX_PLAYERS][pLiveMuted] = cache_get_field_content_int(0, "livemuted"); PlayerInfo[MAX_PLAYERS][pGlobalMuted] = cache_get_field_content_int(0, "globalmuted"); PlayerInfo[MAX_PLAYERS][pReportMuted] = cache_get_field_content_int(0, "reportmuted"); PlayerInfo[MAX_PLAYERS][pReportWarns] = cache_get_field_content_int(0, "reportwarns"); PlayerInfo[MAX_PLAYERS][pFightStyle] = cache_get_field_content_int(0, "fightstyle"); PlayerInfo[MAX_PLAYERS][pCookies] = cache_get_field_content_int(0, "cookies"); PlayerInfo[MAX_PLAYERS][pPhone] = cache_get_field_content_int(0, "phone"); PlayerInfo[MAX_PLAYERS][pJob] = cache_get_field_content_int(0, "job"); PlayerInfo[MAX_PLAYERS][pSecondJob] = cache_get_field_content_int(0, "secondjob"); PlayerInfo[MAX_PLAYERS][pCrimes] = cache_get_field_content_int(0, "crimes"); PlayerInfo[MAX_PLAYERS][pArrested] = cache_get_field_content_int(0, "arrested"); PlayerInfo[MAX_PLAYERS][pWantedLevel] = cache_get_field_content_int(0, "wantedlevel"); PlayerInfo[MAX_PLAYERS][pMaterials] = cache_get_field_content_int(0, "materials"); PlayerInfo[MAX_PLAYERS][pWeed] = cache_get_field_content_int(0, "weed"); PlayerInfo[MAX_PLAYERS][pCocaine] = cache_get_field_content_int(0, "cocaine"); PlayerInfo[MAX_PLAYERS][pMeth] = cache_get_field_content_int(0, "meth"); PlayerInfo[MAX_PLAYERS][pPainkillers] = cache_get_field_content_int(0, "painkillers"); PlayerInfo[MAX_PLAYERS][pSeeds] = cache_get_field_content_int(0, "seeds"); PlayerInfo[MAX_PLAYERS][pEphedrine] = cache_get_field_content_int(0, "ephedrine"); PlayerInfo[MAX_PLAYERS][pMuriaticAcid] = cache_get_field_content_int(0, "muriaticacid"); PlayerInfo[MAX_PLAYERS][pBakingSoda] = cache_get_field_content_int(0, "bakingsoda"); PlayerInfo[MAX_PLAYERS][pCigars] = cache_get_field_content_int(0, "cigars"); PlayerInfo[MAX_PLAYERS][pWalkieTalkie] = cache_get_field_content_int(0, "walkietalkie"); PlayerInfo[MAX_PLAYERS][pChannel] = cache_get_field_content_int(0, "channel"); PlayerInfo[MAX_PLAYERS][pRentingHouse] = cache_get_field_content_int(0, "rentinghouse"); PlayerInfo[MAX_PLAYERS][pSpraycans] = cache_get_field_content_int(0, "spraycans"); PlayerInfo[MAX_PLAYERS][pBoombox] = cache_get_field_content_int(0, "boombox"); PlayerInfo[MAX_PLAYERS][pMP3Player] = cache_get_field_content_int(0, "mp3player"); PlayerInfo[MAX_PLAYERS][pPhonebook] = cache_get_field_content_int(0, "phonebook"); PlayerInfo[MAX_PLAYERS][pFishingRod] = cache_get_field_content_int(0, "fishingrod"); PlayerInfo[MAX_PLAYERS][pFishingBait] = cache_get_field_content_int(0, "fishingbait"); PlayerInfo[MAX_PLAYERS][pFishWeight] = cache_get_field_content_int(0, "fishweight"); PlayerInfo[MAX_PLAYERS][pComponents] = cache_get_field_content_int(0, "components"); PlayerInfo[MAX_PLAYERS][pCourierSkill] = cache_get_field_content_int(0, "courierskill"); PlayerInfo[MAX_PLAYERS][pFishingSkill] = cache_get_field_content_int(0, "fishingskill"); PlayerInfo[MAX_PLAYERS][pGuardSkill] = cache_get_field_content_int(0, "guardskill"); PlayerInfo[MAX_PLAYERS][pWeaponSkill] = cache_get_field_content_int(0, "weaponskill"); PlayerInfo[MAX_PLAYERS][pMechanicSkill] = cache_get_field_content_int(0, "mechanicskill"); PlayerInfo[MAX_PLAYERS][pLawyerSkill] = cache_get_field_content_int(0, "lawyerskill"); PlayerInfo[MAX_PLAYERS][pSmugglerSkill] = cache_get_field_content_int(0, "smugglerskill"); PlayerInfo[MAX_PLAYERS][pDetectiveSkill] = cache_get_field_content_int(0, "detectiveskill"); PlayerInfo[MAX_PLAYERS][pThiefSkill] = cache_get_field_content_int(0, "thiefskill"); PlayerInfo[MAX_PLAYERS][pToggleTextdraws] = cache_get_field_content_int(0, "toggletextdraws"); PlayerInfo[MAX_PLAYERS][pToggleOOC] = cache_get_field_content_int(0, "toggleooc"); PlayerInfo[MAX_PLAYERS][pTogglePhone] = cache_get_field_content_int(0, "togglephone"); PlayerInfo[MAX_PLAYERS][pToggleAdmin] = cache_get_field_content_int(0, "toggleadmin"); PlayerInfo[MAX_PLAYERS][pToggleHelper] = cache_get_field_content_int(0, "togglehelper"); PlayerInfo[MAX_PLAYERS][pToggleNewbie] = cache_get_field_content_int(0, "togglenewbie"); PlayerInfo[MAX_PLAYERS][pToggleWT] = cache_get_field_content_int(0, "togglewt"); PlayerInfo[MAX_PLAYERS][pToggleRadio] = cache_get_field_content_int(0, "toggleradio"); PlayerInfo[MAX_PLAYERS][pToggleVIP] = cache_get_field_content_int(0, "togglevip"); PlayerInfo[MAX_PLAYERS][pToggleMusic] = cache_get_field_content_int(0, "togglemusic"); PlayerInfo[MAX_PLAYERS][pToggleFaction] = cache_get_field_content_int(0, "togglefaction"); PlayerInfo[MAX_PLAYERS][pToggleNews] = cache_get_field_content_int(0, "togglenews"); PlayerInfo[MAX_PLAYERS][pToggleGlobal] = cache_get_field_content_int(0, "toggleglobal"); PlayerInfo[MAX_PLAYERS][pToggleCam] = cache_get_field_content_int(0, "togglecam"); PlayerInfo[MAX_PLAYERS][pToggleHUD] = cache_get_field_content_int(0, "togglehud"); PlayerInfo[MAX_PLAYERS][pToggleReports] = cache_get_field_content_int(0, "togglereports"); PlayerInfo[MAX_PLAYERS][pToggleWhisper] = cache_get_field_content_int(0, "togglewhisper"); PlayerInfo[MAX_PLAYERS][pCarLicense] = cache_get_field_content_int(0, "carlicense"); PlayerInfo[MAX_PLAYERS][pVIPPackage] = cache_get_field_content_int(0, "vippackage"); PlayerInfo[MAX_PLAYERS][pVIPTime] = cache_get_field_content_int(0, "viptime"); PlayerInfo[MAX_PLAYERS][pVIPCooldown] = cache_get_field_content_int(0, "vipcooldown"); PlayerInfo[MAX_PLAYERS][pWeapons][0] = cache_get_field_content_int(0, "weapon_0"); PlayerInfo[MAX_PLAYERS][pWeapons][1] = cache_get_field_content_int(0, "weapon_1"); PlayerInfo[MAX_PLAYERS][pWeapons][2] = cache_get_field_content_int(0, "weapon_2"); PlayerInfo[MAX_PLAYERS][pWeapons][3] = cache_get_field_content_int(0, "weapon_3"); PlayerInfo[MAX_PLAYERS][pWeapons][4] = cache_get_field_content_int(0, "weapon_4"); PlayerInfo[MAX_PLAYERS][pWeapons][5] = cache_get_field_content_int(0, "weapon_5"); PlayerInfo[MAX_PLAYERS][pWeapons][6] = cache_get_field_content_int(0, "weapon_6"); PlayerInfo[MAX_PLAYERS][pWeapons][7] = cache_get_field_content_int(0, "weapon_7"); PlayerInfo[MAX_PLAYERS][pWeapons][8] = cache_get_field_content_int(0, "weapon_8"); PlayerInfo[MAX_PLAYERS][pWeapons][9] = cache_get_field_content_int(0, "weapon_9"); PlayerInfo[MAX_PLAYERS][pWeapons][10] = cache_get_field_content_int(0, "weapon_10"); PlayerInfo[MAX_PLAYERS][pWeapons][11] = cache_get_field_content_int(0, "weapon_11"); PlayerInfo[MAX_PLAYERS][pWeapons][12] = cache_get_field_content_int(0, "weapon_12"); PlayerInfo[MAX_PLAYERS][pFaction] = cache_get_field_content_int(0, "faction"); PlayerInfo[MAX_PLAYERS][pFactionRank] = cache_get_field_content_int(0, "factionrank"); PlayerInfo[MAX_PLAYERS][pFactionLeader] = cache_get_field_content_int(0, "factionleader"); PlayerInfo[MAX_PLAYERS][pGang] = cache_get_field_content_int(0, "gang"); PlayerInfo[MAX_PLAYERS][pGangRank] = cache_get_field_content_int(0, "gangrank"); PlayerInfo[MAX_PLAYERS][pDivision] = cache_get_field_content_int(0, "division"); PlayerInfo[MAX_PLAYERS][pCrew] = cache_get_field_content_int(0, "crew"); PlayerInfo[MAX_PLAYERS][pContracted] = cache_get_field_content_int(0, "contracted"); PlayerInfo[MAX_PLAYERS][pBombs] = cache_get_field_content_int(0, "bombs"); PlayerInfo[MAX_PLAYERS][pCompletedHits] = cache_get_field_content_int(0, "completedhits"); PlayerInfo[MAX_PLAYERS][pFailedHits] = cache_get_field_content_int(0, "failedhits"); PlayerInfo[MAX_PLAYERS][pReports] = cache_get_field_content_int(0, "reports"); PlayerInfo[MAX_PLAYERS][pNewbies] = cache_get_field_content_int(0, "newbies"); PlayerInfo[MAX_PLAYERS][pHelpRequests] = cache_get_field_content_int(0, "helprequests"); PlayerInfo[MAX_PLAYERS][pSpeedometer] = cache_get_field_content_int(0, "speedometer"); PlayerInfo[MAX_PLAYERS][pFactionMod] = cache_get_field_content_int(0, "factionmod"); PlayerInfo[MAX_PLAYERS][pWebDev] = cache_get_field_content_int(0, "webdev"); PlayerInfo[MAX_PLAYERS][pGangMod] = cache_get_field_content_int(0, "gangmod"); PlayerInfo[MAX_PLAYERS][pBanAppealer] = cache_get_field_content_int(0, "banappealer"); PlayerInfo[MAX_PLAYERS][pFormerAdmin] = cache_get_field_content_int(0, "FormerAdmin"); PlayerInfo[MAX_PLAYERS][pDeveloper] = cache_get_field_content_int(0, "scripter"); PlayerInfo[MAX_PLAYERS][pWeedPlanted] = cache_get_field_content_int(0, "weedplanted"); PlayerInfo[MAX_PLAYERS][pWeedTime] = cache_get_field_content_int(0, "weedtime"); PlayerInfo[MAX_PLAYERS][pWeedGrams] = cache_get_field_content_int(0, "weedgrams"); PlayerInfo[MAX_PLAYERS][pWeedX] = cache_get_field_content_float(0, "weed_x"); PlayerInfo[MAX_PLAYERS][pWeedY] = cache_get_field_content_float(0, "weed_y"); PlayerInfo[MAX_PLAYERS][pWeedZ] = cache_get_field_content_float(0, "weed_z"); PlayerInfo[MAX_PLAYERS][pWeedA] = cache_get_field_content_float(0, "weed_a"); PlayerInfo[MAX_PLAYERS][pInventoryUpgrade] = cache_get_field_content_int(0, "inventoryupgrade"); PlayerInfo[MAX_PLAYERS][pAddictUpgrade] = cache_get_field_content_int(0, "addictupgrade"); PlayerInfo[MAX_PLAYERS][pTraderUpgrade] = cache_get_field_content_int(0, "traderupgrade"); PlayerInfo[MAX_PLAYERS][pAssetUpgrade] = cache_get_field_content_int(0, "assetupgrade"); PlayerInfo[MAX_PLAYERS][pLaborUpgrade] = cache_get_field_content_int(0, "laborupgrade"); PlayerInfo[MAX_PLAYERS][pDMWarnings] = cache_get_field_content_int(0, "dmwarnings"); PlayerInfo[MAX_PLAYERS][pWeaponRestricted] = cache_get_field_content_int(0, "weaponrestricted"); PlayerInfo[MAX_PLAYERS][pReferralUID] = cache_get_field_content_int(0, "referral_uid"); PlayerInfo[MAX_PLAYERS][pWatch] = cache_get_field_content_int(0, "watch"); PlayerInfo[MAX_PLAYERS][pGPS] = cache_get_field_content_int(0, "gps"); PlayerInfo[MAX_PLAYERS][pClothes] = cache_get_field_content_int(0, "clothes"); PlayerInfo[MAX_PLAYERS][pShowLands] = cache_get_field_content_int(0, "showlands"); PlayerInfo[MAX_PLAYERS][pShowTurfs] = cache_get_field_content_int(0, "showturfs"); PlayerInfo[MAX_PLAYERS][pWatchOn] = cache_get_field_content_int(0, "watchon"); PlayerInfo[MAX_PLAYERS][pGPSOn] = cache_get_field_content_int(0, "gpson"); PlayerInfo[MAX_PLAYERS][pDoubleXP] = cache_get_field_content_int(0, "doublexp"); PlayerInfo[MAX_PLAYERS][pCourierCooldown] = cache_get_field_content_int(0, "couriercooldown"); PlayerInfo[MAX_PLAYERS][pPizzaCooldown] = cache_get_field_content_int(0, "pizzacooldown"); PlayerInfo[MAX_PLAYERS][pDetectiveCooldown] = cache_get_field_content_int(0, "detectivecooldown"); PlayerInfo[MAX_PLAYERS][pThiefCooldown] = cache_get_field_content_int(0, "thiefcooldown"); PlayerInfo[MAX_PLAYERS][pCocaineCooldown] = cache_get_field_content_int(0, "crackcooldown"); PlayerInfo[MAX_PLAYERS][pGasCan] = cache_get_field_content_int(0, "gascan"); PlayerInfo[MAX_PLAYERS][pDuty] = cache_get_field_content_int(0, "duty"); PlayerInfo[MAX_PLAYERS][pBandana] = cache_get_field_content_int(0, "bandana"); PlayerInfo[MAX_PLAYERS][pPassport] = cache_get_field_content_int(0, "passport"); PlayerInfo[MAX_PLAYERS][pPassportLevel] = cache_get_field_content_int(0, "passportlevel"); PlayerInfo[MAX_PLAYERS][pPassportSkin] = cache_get_field_content_int(0, "passportskin"); PlayerInfo[MAX_PLAYERS][pPassportPhone] = cache_get_field_content_int(0, "passportphone"); PlayerInfo[MAX_PLAYERS][pNewbieMuteTime] = cache_get_field_content_int(0, "newbiemutetime"); PlayerInfo[MAX_PLAYERS][pReportMuteTime] = cache_get_field_content_int(0, "reportmutetime"); PlayerInfo[MAX_PLAYERS][pGlobalMuteTime] = cache_get_field_content_int(0, "globalmutetime"); PlayerInfo[MAX_PLAYERS][pAdminHide] = cache_get_field_content_int(0, "adminhide"); PlayerInfo[MAX_PLAYERS][pInsurance] = cache_get_field_content_int(0, "insurance"); PlayerInfo[MAX_PLAYERS][pRope] = cache_get_field_content_int(0, "rope"); PlayerInfo[MAX_PLAYERS][pTotalPatients] = cache_get_field_content_int(0, "totalpatients"); PlayerInfo[MAX_PLAYERS][pTotalFires] = cache_get_field_content_int(0, "totalfires"); PlayerInfo[MAX_PLAYERS][pMask] = cache_get_field_content_int(0, "mask"); PlayerInfo[MAX_PLAYERS][pGunLicense] = cache_get_field_content_int(0, "gunlicense"); strcpy(PlayerInfo[MAX_PLAYERS][pUsername], username, MAX_PLAYER_NAME); DisplayStats(MAX_PLAYERS, playerid); } } forward OnAdminOfflineFlag(playerid, username[], desc[]); public OnAdminOfflineFlag(playerid, username[], desc[]) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist."); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, '%s', NOW(), '%e')", cache_get_field_content_int(0, "uid"), GetPlayerNameEx(playerid), desc); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s offline flagged %s's account for '%s'.", GetPlayerRPName(playerid), username, desc); } } forward OnAdminCheckBanHistory(playerid, username[]); public OnAdminCheckBanHistory(playerid, username[]) { new rows = cache_get_row_count(connectionID); if(!rows) { SendClientMessage(playerid, COLOR_GREY, "This player has no ban history recorded."); } else { new date[24], description[255]; for(new i = 0; i < rows; i ++) { cache_get_row(i, 0, date); cache_get_row(i, 1, description); SendClientMessageEx(playerid, COLOR_LIGHTRED, "[%s] %s", date, description); } } } forward OnAdminCheckLastActive(playerid, username[]); public OnAdminCheckLastActive(playerid, username[]) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist."); } else { new date[40]; cache_get_row(0, 0, date); SendClientMessageEx(playerid, COLOR_GREEN, "%s last logged in on the %s (server time).", username, date); } } forward OnAdminSetHelperLevel(playerid, username[], level); public OnAdminSetHelperLevel(playerid, username[], level) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist."); } else if((PlayerInfo[playerid][pAdmin] < 6) && cache_get_row_int(0, 0) > PlayerInfo[playerid][pHelper] && level < cache_get_row_int(0, 0)) { SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher helper level than you. They cannot be demoted."); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET helperlevel = %i WHERE username = '%e'", level, username); mysql_tquery(connectionID, queryBuffer); SendStaffMessage(COLOR_LIGHTRED, "AdmCmd: %s has offline set %s's helper level to %i.", GetPlayerRPName(playerid), username, level); Log_Write("log_admin", "%s (uid: %i) has offline set %s's helper level to %i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username, level); } } forward OnAdminSetAdminLevel(playerid, username[], level); public OnAdminSetAdminLevel(playerid, username[], level) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist."); } else if(cache_get_row_int(0, 0) > PlayerInfo[playerid][pAdmin] && level < cache_get_row_int(0, 0)) { SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be demoted."); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET adminlevel = %i WHERE username = '%e'", level, username); mysql_tquery(connectionID, queryBuffer); if(level == 0) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET scripter = 0, gangmod = 0, banappealer = 0, factionmod = 0, helpermanager = 0, webdev = 0, dynamicadmin = 0, adminpersonnel = 0 WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has offline set %s's admin level to %i.", GetPlayerRPName(playerid), username, level); Log_Write("log_admin", "%s (uid: %i) has offline set %s's admin level to %i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username, level); } } forward OnAdminCreateTurf(playerid, turfid, name[], type, Float:minx, Float:miny, Float:maxx, Float:maxy, Float:height); public OnAdminCreateTurf(playerid, turfid, name[], type, Float:minx, Float:miny, Float:maxx, Float:maxy, Float:height) { strcpy(TurfInfo[turfid][tName], name, 32); strcpy(TurfInfo[turfid][tCapturedBy], "No-one", MAX_PLAYER_NAME); TurfInfo[turfid][tExists] = 1; TurfInfo[turfid][tCapturedGang] = -1; TurfInfo[turfid][tTime] = 12; TurfInfo[turfid][tType] = type; TurfInfo[turfid][tMinX] = minx; TurfInfo[turfid][tMinY] = miny; TurfInfo[turfid][tMaxX] = maxx; TurfInfo[turfid][tMaxY] = maxy; TurfInfo[turfid][tHeight] = height; TurfInfo[turfid][tGangZone] = -1; TurfInfo[turfid][tArea] = -1; TurfInfo[turfid][tCaptureTime] = 0; TurfInfo[turfid][tCapturer] = INVALID_PLAYER_ID; Iter_Add(Turf, turfid); ReloadTurf(turfid); SendClientMessageEx(playerid, COLOR_GREEN, "** Turf %i created successfully.", turfid); } forward OnAdminCreateLand(playerid, landid, price, Float:minx, Float:miny, Float:maxx, Float:maxy, Float:height); public OnAdminCreateLand(playerid, landid, price, Float:minx, Float:miny, Float:maxx, Float:maxy, Float:height) { strcpy(LandInfo[landid][lOwner], "Nobody", MAX_PLAYER_NAME); LandInfo[landid][lExists] = 1; LandInfo[landid][lID] = cache_insert_id(connectionID); LandInfo[landid][lOwnerID] = 0; LandInfo[landid][lLevel] = 1; LandInfo[landid][lPrice] = price; LandInfo[landid][lMinX] = minx; LandInfo[landid][lMinY] = miny; LandInfo[landid][lMaxX] = maxx; LandInfo[landid][lMaxY] = maxy; LandInfo[landid][lHeight] = height; LandInfo[landid][lGangZone] = -1; LandInfo[landid][lArea] = -1; Iter_Add(Land, landid); ReloadLand(landid); SendClientMessageEx(playerid, COLOR_GREEN, "** Land %i created successfully.", landid); } forward OnAdminCreateEntrance(playerid, entranceid, name[], Float:x, Float:y, Float:z, Float:angle); public OnAdminCreateEntrance(playerid, entranceid, name[], Float:x, Float:y, Float:z, Float:angle) { strcpy(EntranceInfo[entranceid][eOwner], "Nobody", MAX_PLAYER_NAME); strcpy(EntranceInfo[entranceid][eName], name, 40); strcpy(EntranceInfo[entranceid][ePassword], "None", 64); EntranceInfo[entranceid][eExists] = 1; EntranceInfo[entranceid][eID] = cache_insert_id(connectionID); EntranceInfo[entranceid][eOwnerID] = 0; EntranceInfo[entranceid][eIcon] = 19132; EntranceInfo[entranceid][eLocked] = 0; EntranceInfo[entranceid][eRadius] = 3.0; EntranceInfo[entranceid][ePosX] = x; EntranceInfo[entranceid][ePosY] = y; EntranceInfo[entranceid][ePosZ] = z; EntranceInfo[entranceid][ePosA] = angle; EntranceInfo[entranceid][eIntX] = 0.0; EntranceInfo[entranceid][eIntY] = 0.0; EntranceInfo[entranceid][eIntZ] = 0.0; EntranceInfo[entranceid][eIntA] = 0.0; EntranceInfo[entranceid][eInterior] = 0; EntranceInfo[entranceid][eWorld] = EntranceInfo[entranceid][eID] + 4000000; EntranceInfo[entranceid][eOutsideInt] = GetPlayerInterior(playerid); EntranceInfo[entranceid][eOutsideVW] = GetPlayerVirtualWorld(playerid); EntranceInfo[entranceid][eAdminLevel] = 0; EntranceInfo[entranceid][eFactionType] = FACTION_NONE; EntranceInfo[entranceid][eGang] = -1; EntranceInfo[entranceid][eVIP] = 0; EntranceInfo[entranceid][eVehicles] = 0; EntranceInfo[entranceid][eFreeze] = 0; EntranceInfo[entranceid][eLabel] = 1; EntranceInfo[entranceid][eType] = 0; EntranceInfo[entranceid][eMapIcon] = 0; EntranceInfo[entranceid][eText] = Text3D:INVALID_3DTEXT_ID; EntranceInfo[entranceid][ePickup] = -1; EntranceInfo[entranceid][eMapIconID] = -1; EntranceInfo[entranceid][eColor] = -256; Iter_Add(Entrance, entranceid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET world = %i WHERE id = %i", EntranceInfo[entranceid][eWorld], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_GREEN, "** Entrance %i created successfully.", entranceid); } forward OnAdminCreateBusiness(playerid, businessid, type, Float:x, Float:y, Float:z, Float:angle); public OnAdminCreateBusiness(playerid, businessid, type, Float:x, Float:y, Float:z, Float:angle) { strcpy(BusinessInfo[businessid][bOwner], "Nobody", MAX_PLAYER_NAME); BusinessInfo[businessid][bExists] = 1; BusinessInfo[businessid][bID] = cache_insert_id(connectionID); BusinessInfo[businessid][bOwnerID] = 0; BusinessInfo[businessid][bType] = type; BusinessInfo[businessid][bPrice] = bizInteriors[type][intPrice]; BusinessInfo[businessid][bEntryFee] = 0; BusinessInfo[businessid][bLocked] = 0; BusinessInfo[businessid][bPosX] = x; BusinessInfo[businessid][bPosY] = y; BusinessInfo[businessid][bPosZ] = z; BusinessInfo[businessid][bPosA] = angle; BusinessInfo[businessid][bIntX] = bizInteriors[type][intX]; BusinessInfo[businessid][bIntY] = bizInteriors[type][intY]; BusinessInfo[businessid][bIntZ] = bizInteriors[type][intZ]; BusinessInfo[businessid][bIntA] = bizInteriors[type][intA]; BusinessInfo[businessid][bInterior] = bizInteriors[type][intID]; BusinessInfo[businessid][bWorld] = BusinessInfo[businessid][bID] + 3000000; BusinessInfo[businessid][bOutsideInt] = GetPlayerInterior(playerid); BusinessInfo[businessid][bOutsideVW] = GetPlayerVirtualWorld(playerid); BusinessInfo[businessid][bCash] = 0; BusinessInfo[businessid][bProducts] = 500; BusinessInfo[businessid][bMaterials] = 0; BusinessInfo[businessid][bText] = Text3D:INVALID_3DTEXT_ID; BusinessInfo[businessid][bPickup] = -1; BusinessInfo[businessid][bMapIcon] = -1; Iter_Add(Business, businessid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET world = %i WHERE id = %i", BusinessInfo[businessid][bWorld], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_GREEN, "** Business %i created successfully.", businessid); } forward OnAdminCreateGarage(playerid, garageid, type, Float:x, Float:y, Float:z, Float:angle); public OnAdminCreateGarage(playerid, garageid, type, Float:x, Float:y, Float:z, Float:angle) { strcpy(GarageInfo[garageid][gOwner], "Nobody", MAX_PLAYER_NAME); GarageInfo[garageid][gExists] = 1; GarageInfo[garageid][gID] = cache_insert_id(connectionID); GarageInfo[garageid][gOwnerID] = 0; GarageInfo[garageid][gType] = type; GarageInfo[garageid][gPrice] = garageInteriors[type][intPrice]; GarageInfo[garageid][gLocked] = 0; GarageInfo[garageid][gPosX] = x; GarageInfo[garageid][gPosY] = y; GarageInfo[garageid][gPosZ] = z; GarageInfo[garageid][gPosA] = angle; GarageInfo[garageid][gExitX] = x - 3.0 * floatsin(-angle, degrees); GarageInfo[garageid][gExitY] = y - 3.0 * floatsin(-angle, degrees); GarageInfo[garageid][gExitZ] = z; GarageInfo[garageid][gExitA] = angle - 180.0; GarageInfo[garageid][gWorld] = GarageInfo[garageid][gID] + 2000000; GarageInfo[garageid][gText] = Text3D:INVALID_3DTEXT_ID; GarageInfo[garageid][gPickup] = -1; Iter_Add(Garage, garageid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET world = %i WHERE id = %i", GarageInfo[garageid][gWorld], GarageInfo[garageid][gID]); mysql_tquery(connectionID, queryBuffer); ReloadGarage(garageid); SendClientMessageEx(playerid, COLOR_GREEN, "** Garage %i created successfully.", garageid); } forward OnAdminCreateHouse(playerid, houseid, type, Float:x, Float:y, Float:z, Float:angle); public OnAdminCreateHouse(playerid, houseid, type, Float:x, Float:y, Float:z, Float:angle) { strcpy(HouseInfo[houseid][hOwner], "Nobody", MAX_PLAYER_NAME); HouseInfo[houseid][hExists] = 1; HouseInfo[houseid][hID] = cache_insert_id(connectionID); HouseInfo[houseid][hOwnerID] = 0; HouseInfo[houseid][hType] = type; HouseInfo[houseid][hPrice] = houseInteriors[type][intPrice]; HouseInfo[houseid][hRentPrice] = 0; HouseInfo[houseid][hLevel] = 1; HouseInfo[houseid][hLocked] = 0; HouseInfo[houseid][hPosX] = x; HouseInfo[houseid][hPosY] = y; HouseInfo[houseid][hPosZ] = z; HouseInfo[houseid][hPosA] = angle; HouseInfo[houseid][hIntX] = houseInteriors[type][intX]; HouseInfo[houseid][hIntY] = houseInteriors[type][intY]; HouseInfo[houseid][hIntZ] = houseInteriors[type][intZ]; HouseInfo[houseid][hIntA] = houseInteriors[type][intA]; HouseInfo[houseid][hInterior] = houseInteriors[type][intID]; HouseInfo[houseid][hWorld] = HouseInfo[houseid][hID] + 1000000; HouseInfo[houseid][hOutsideInt] = GetPlayerInterior(playerid); HouseInfo[houseid][hOutsideVW] = GetPlayerVirtualWorld(playerid); HouseInfo[houseid][hCash] = 0; HouseInfo[houseid][hMaterials] = 0; HouseInfo[houseid][hWeed] = 0; HouseInfo[houseid][hCocaine] = 0; HouseInfo[houseid][hMeth] = 0; HouseInfo[houseid][hPainkillers] = 0; HouseInfo[houseid][hLabels] = 0; HouseInfo[houseid][hText] = Text3D:INVALID_3DTEXT_ID; HouseInfo[houseid][hPickup] = -1; HouseInfo[houseid][hDelivery] = 1; HouseInfo[houseid][hLights] = 1; Iter_Add(House, houseid); for(new i = 0; i < 10; i ++) { HouseInfo[houseid][hWeapons][i] = 0; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET world = %i WHERE id = %i", HouseInfo[houseid][hWorld], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); SendClientMessageEx(playerid, COLOR_GREEN, "** House %i created successfully.", houseid); } forward OnAdminDeleteAccount(playerid, username[]); public OnAdminDeleteAccount(playerid, username[]) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist."); } else if(cache_get_row_int(0, 0) > PlayerInfo[playerid][pAdmin]) { SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. You cannot delete them."); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has deleted %s's account.", GetPlayerNameEx(playerid), username); } } forward OnAdminListKills(playerid, targetid); public OnAdminListKills(playerid, targetid) { new rows = cache_get_row_count(connectionID); if(!rows) { SendClientMessage(playerid, COLOR_GREY, "That player hasn't killed, or has been killed, by anyone since they registered."); } else { new date[24], killer[24], target[24], reason[24]; SendClientMessage(playerid, COLOR_NAVYBLUE, "________ Kills & Deaths ________"); for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "date", date); cache_get_field_content(i, "killer", killer); cache_get_field_content(i, "target", target); cache_get_field_content(i, "reason", reason); if(cache_get_field_content_int(i, "killer_uid") == PlayerInfo[targetid][pID]) { SendClientMessageEx(playerid, COLOR_YELLOW, "[%s] %s killed %s (%s)", date, killer, target, reason); } else if(cache_get_field_content_int(i, "target_uid") == PlayerInfo[targetid][pID]) { SendClientMessageEx(playerid, COLOR_YELLOW, "[%s] %s was killed by %s (%s)", date, target, killer, reason); } } } } forward OnAdminListDamages(playerid, targetid); public OnAdminListDamages(playerid, targetid) { new rows = cache_get_row_count(connectionID); if(!rows) { SendClientMessage(playerid, COLOR_GREY, "That player hasn't been damaged by anyone since they connected."); } else { SendClientMessage(playerid, COLOR_NAVYBLUE, "___________ Damage Received ___________"); for(new i = 0; i < rows; i ++) { SendClientMessageEx(playerid, COLOR_YELLOW, "[%i seconds ago] %s was shot by %s with a %s", gettime() - cache_get_row_int(i, 2), GetPlayerRPName(targetid), GetPlayerRPName(cache_get_row_int(i, 1)), GetWeaponNameEx(cache_get_row_int(i, 0))); //SendClientMessageEx(playerid, COLOR_GREY2, "(Weapon: %s) - (From: %s) - (Time: %i seconds ago)", GetWeaponNameEx(cache_get_row_int(i, 0)), GetPlayerRPName(cache_get_row_int(i, 1)), gettime() - cache_get_row_int(i, 2)); } } } forward OnAdminListShots(playerid, targetid); public OnAdminListShots(playerid, targetid) { new rows = cache_get_row_count(connectionID); if(!rows) { SendClientMessage(playerid, COLOR_GREY, "That player hasn't registered any shots since they connected."); } else { new weaponid, hittype, timestamp, hit[48]; SendClientMessageEx(playerid, COLOR_NAVYBLUE, "___________ %i Last Shots ___________", rows); for(new i = 0; i < rows; i ++) { weaponid = cache_get_field_content_int(i, "weaponid"); hittype = cache_get_field_content_int(i, "hittype"); timestamp = cache_get_field_content_int(i, "timestamp"); switch(hittype) { case BULLET_HIT_TYPE_PLAYER: cache_get_field_content(i, "hitplayer", hit); case BULLET_HIT_TYPE_VEHICLE: format(hit, sizeof(hit), "Vehicle (ID %i)", cache_get_field_content_int(i, "hitid")); default: hit = "Missed"; } SendClientMessageEx(playerid, COLOR_YELLOW, "[%i seconds ago] %s shot a %s and hit: %s", gettime() - timestamp, GetPlayerRPName(targetid), GetWeaponNameEx(weaponid), hit); } } } forward OnAdminBanIP(playerid, ip[], reason[]); public OnAdminBanIP(playerid, ip[], reason[]) { if(cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "This IP address is already banned."); } else { foreach(new i : Player) { if(!strcmp(GetPlayerIP(i), ip)) { SendClientMessageEx(i, COLOR_YELLOW, "Your IP address has been banned by %s, reason: %s", GetPlayerRPName(playerid), reason); KickPlayer(i); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO bans VALUES(null, 'n/a', '%s', '%s', NOW(), '%s', 0)", ip, GetPlayerNameEx(playerid), reason); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has banned IP '%s', reason: %s", GetPlayerRPName(playerid), ip, reason); Log_Write("log_punishments", "%s (uid: %i) has banned IP: %s, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], ip, reason); } } forward OnAdminCheckBan(playerid, string[]); public OnAdminCheckBan(playerid, string[]) { new bannedby[MAX_PLAYER_NAME], username[MAX_PLAYER_NAME], ip[16], date[24], reason[128]; if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "There are no bans that match your criteria."); } else { cache_get_field_content(0, "bannedby", bannedby); cache_get_field_content(0, "username", username); cache_get_field_content(0, "ip", ip); cache_get_field_content(0, "date", date); cache_get_field_content(0, "reason", reason); if(!strcmp(username, "n/a", true)) { if(strfind(ip, "*", true) != -1) { SendClientMessageEx(playerid, COLOR_LIGHTRED, "[%s] IP address '%s' was rangebanned by %s, reason: %s", date, ip, bannedby, reason); } else { SendClientMessageEx(playerid, COLOR_LIGHTRED, "[%s] IP address '%s' was banned by %s, reason: %s", date, ip, bannedby, reason); } } else { if(strfind(ip, "*", true) != -1) { SendClientMessageEx(playerid, COLOR_LIGHTRED, "[%s] %s (IP: %s) was rangebanned by %s, reason: %s", date, username, ip, bannedby, reason); } else if(cache_get_field_content_int(0, "permanent")) { SendClientMessageEx(playerid, COLOR_LIGHTRED, "[%s] %s (IP: %s) was permanently banned by %s, reason: %s", date, username, ip, bannedby, reason); } else { SendClientMessageEx(playerid, COLOR_LIGHTRED, "[%s] %s (IP: %s) was banned by %s, reason: %s", date, username, ip, bannedby, reason); } } } } forward OnAdminUnbanUser(playerid, username[]); public OnAdminUnbanUser(playerid, username[]) { if(cache_get_row_count(connectionID)) { if(cache_get_row_int(0, 1) && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This player is permanently banned. Permabans may only be lifted by management."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM bans WHERE id = %i", cache_get_row_int(0, 0)); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has unbanned %s.", GetPlayerRPName(playerid), username); Log_Write("log_punishments", "%s (uid: %i) has unbanned %s.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username); } else { SendClientMessage(playerid, COLOR_GREY, "There is no banned player known by that name."); } return 1; } forward OnAdminLockAccount(playerid, username[]); public OnAdminLockAccount(playerid, username[]) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist."); } else if(cache_get_row_int(0, 0)) { SendClientMessage(playerid, COLOR_GREY, "This player's account is already locked. /unlockaccount to unlock it."); } else if(cache_get_row_int(0, 1) > PlayerInfo[playerid][pAdmin]) { SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be locked."); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET locked = 1 WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has locked %s's account.", GetPlayerRPName(playerid), username); Log_Write("log_admin", "%s (uid: %i) locked %s's account.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username); } } forward OnAdminUnlockAccount(playerid, username[]); public OnAdminUnlockAccount(playerid, username[]) { if(!cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The player specified doesn't exist, or their account is not locked."); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET locked = 0 WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has unlocked %s's account.", GetPlayerRPName(playerid), username); Log_Write("log_admin", "%s (uid: %i) unlocked %s's account.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username); } } forward OnAdminChangeName(playerid, targetid, name[]); public OnAdminChangeName(playerid, targetid, name[]) { if(cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The name specified is taken already."); } else { Log_Write("log_admin", "%s (uid: %i) changed %s's (uid: %i) name to %s.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], name); Log_Write("log_namechanges", "%s (uid: %i) changed %s's (uid: %i) name to %s.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], name); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO log_namehistory VALUES(null, %i, '%s', '%s', '%s', NOW())", PlayerInfo[targetid][pID], GetPlayerNameEx(targetid), name, GetPlayerNameEx(playerid)); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has changed %s's name to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), name); SendClientMessageEx(targetid, COLOR_WHITE, "%s changed your name from %s to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), name); Namechange(targetid, GetPlayerNameEx(targetid), name); } } forward OnAdminOfflineBan(playerid, username[], reason[]); public OnAdminOfflineBan(playerid, username[], reason[]) { if(cache_get_row_count(connectionID)) { if(cache_get_row_int(0, 0) > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be banned."); } new ip[16]; cache_get_row(0, 1, ip); AddBan(username, ip, GetPlayerNameEx(playerid), reason); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO log_bans VALUES(null, %i, NOW(), '%s (IP: %s) was banned by %s, reason: %e')", cache_get_field_content_int(0, "uid"), username, ip, GetPlayerNameEx(playerid), reason); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was offline banned by %s, reason: %s", username, GetPlayerNameEx(playerid), reason); Log_Write("log_punishments", "%s (uid: %i) offline banned %s, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username, reason); } else { SendClientMessage(playerid, COLOR_GREY, "That player is not registered."); } return 1; } forward OnAdminOfflinePrison(playerid, username[], minutes, reason[]); public OnAdminOfflinePrison(playerid, username[], minutes, reason[]) { if(cache_get_row_count(connectionID)) { if(cache_get_row_int(0, 0) > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be prisoned."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET jailtype = 2, jailtime = %i, prisonedby = '%e', prisonreason = '%e' WHERE username = '%e'", minutes * 60, GetPlayerNameEx(playerid), reason, username); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was offline prisoned for %i minutes by %s, reason: %s", username, minutes, GetPlayerRPName(playerid), reason); Log_Write("log_punishments", "%s (uid: %i) offline prisoned %s for %i minutes, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username, minutes, reason); } else { SendClientMessage(playerid, COLOR_GREY, "That player is not registered."); } return 1; } forward OnAdminOfflineFine(playerid, username[], amount, reason[]); public OnAdminOfflineFine(playerid, username[], amount, reason[]) { if(cache_get_row_count(connectionID)) { if(cache_get_row_int(0, 0) > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be fined."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cash = cash - %i WHERE username = '%e'", amount, username); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was offline fined for %s by %s, reason: %s", username, FormatNumber(amount), GetPlayerRPName(playerid), reason); Log_Write("log_admin", "%s (uid: %i) offline fined %s for $%i, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], username, amount, reason); } else { SendClientMessage(playerid, COLOR_GREY, "That player is not registered."); } return 1; } public OnQueryError(errorid, error[], callback[], query[], connectionHandle) { new File:file = fopen("mysql_error.txt", io_append); if(file) { new string[2048]; format(string, sizeof(string), "[%s]\r\nError ID: %i\r\nCallback: %s\r\nQuery: %s\r\nError: %s\r\n\r\n", GetDate(), errorid, callback, query, error); fwrite(file, string); fclose(file); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: A MySQL error occurred (error %i). Details written to mysql_error.txt.", errorid); return 1; } forward OnQueryFinished(threadid, extraid); public OnQueryFinished(threadid, extraid) { new rows = cache_get_row_count(connectionID); switch(threadid) { case THREAD_LOOKUP_BANS: { if(rows) { new bannedby[24], date[24], reason[128]; cache_get_field_content(0, "bannedby", bannedby); cache_get_field_content(0, "date", date); cache_get_field_content(0, "reason", reason); GameTextForPlayer(extraid, "~r~You are banned!", 999999, 3); if(cache_get_field_content_int(0, "permanent")) SendClientMessageEx(extraid, COLOR_YELLOW, "You are permanently banned from this server."); else SendClientMessageEx(extraid, COLOR_YELLOW, "You are banned from this server. You can appeal your ban at ecrp.h0v1n8.nl."); SendClientMessageEx(extraid, COLOR_LIGHTRED, "Admin: %s", bannedby); SendClientMessageEx(extraid, COLOR_LIGHTRED, "Date: %s", date); SendClientMessageEx(extraid, COLOR_LIGHTRED, "Reason: %s", reason); KickPlayer(extraid); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE username = '%s'", GetPlayerNameEx(extraid)); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOOKUP_ACCOUNT, extraid); } } case THREAD_LOOKUP_ACCOUNT: { if(rows) { #if defined SERVER_INTRO //PlayAudioStreamForPlayer(extraid, "http://music.ecrp.h0v1n8.nl/blow.mp3"); // Hernandez PlayLoginMusic(extraid); SetTimerEx("ShowMainMenuCamera", 400, false, "ii", extraid, 0); #endif ShowDialogToPlayer(extraid, DIALOG_LOGIN); } else { /*new namechange; for(new i = strlen(string); i > 0; i--) { if(!('A' <= string[i] <= 'Z') && !('a' <= string[i] <= 'z') && (string[i] != '_')) { namechange = true; break; } }*/ if(strfind(GetPlayerNameEx(extraid), "_") == -1) { ShowPlayerDialog(extraid, DIALOG_FREENAMECHANGE, DIALOG_STYLE_INPUT, "Non-RP Name", "An administrator has came to the conclusion that your name is non-RP.\nTherefore you have been given this free namechange in order to correct it.\n\nEnter a name in the Firstname_Lastname format in the box below:", "Submit", ""); //SendClientMessage(extraid, COLOR_LIGHTRED, "Please reconnect with a proper roleplay name in the Firstname_Lastname format."); //KickPlayer(extraid); } else { #if defined SERVER_INTRO ShowServerIntro(extraid); #else ShowDialogToPlayer(extraid, DIALOG_REGISTER); #endif } } } case THREAD_ACCOUNT_REGISTER: { new id = cache_insert_id(connectionID); //if(id) //{ /*mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM users WHERE uid = %i", id); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_PROCESS_LOGIN, extraid);*/ mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM users WHERE uid = %i", id); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_PROCESS_LOGIN, extraid); //ShowDialogToPlayer(extraid, DIALOG_RULES); //} } case THREAD_PROCESS_LOGIN: { if(!rows) { PlayerInfo[extraid][pLoginTries]++; if(PlayerInfo[extraid][pLoginTries] < 9999999) { ShowDialogToPlayer(extraid, DIALOG_LOGIN); SendClientMessageEx(extraid, COLOR_RED, "Incorrect password"); } else { ShowPlayerDialog(extraid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FF1AFF}ECRP{FFFFFF} | Unable to Login", "{FFFFFF}It seems like you've forgotten your password.\n\nYou can post an administrative request on {FF1AFF}ecrp.h0v1n8.nl{FFFFFF} to have it reset.", "Cancel", ""); KickPlayer(extraid); } } else if(cache_get_field_content_int(0, "locked")) { SendClientMessage(extraid, COLOR_LIGHTRED, "** This account is currently locked. Post an administrative request to have it lifted."); ShowPlayerDialog(extraid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FF1AFF}ECRP{FFFFFF} | Unable to Login", "{FFFFFF}This account is currently locked.\n\nYou can post an administrative request on {FF1AFF}ecrp.h0v1n8.nl{FFFFFF} to have it lifted.", "Cancel", ""); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s tried to login with a locked account.", GetPlayerRPName(extraid)); KickPlayer(extraid); } else { if(PlayerInfo[extraid][pAdminDuty]) { ResetPlayerWeaponsEx(extraid); } new date[64], string[64]; cache_get_field_content(0, "login_date", date); cache_get_field_content(0, "accent", PlayerInfo[extraid][pAccent], connectionID, 16); cache_get_field_content(0, "adminname", PlayerInfo[extraid][pAdminName], connectionID, MAX_PLAYER_NAME); cache_get_field_content(0, "contractby", PlayerInfo[extraid][pContractBy], connectionID, MAX_PLAYER_NAME); cache_get_field_content(0, "prisonedby", PlayerInfo[extraid][pPrisonedBy], connectionID, MAX_PLAYER_NAME); cache_get_field_content(0, "prisonreason", PlayerInfo[extraid][pPrisonReason], connectionID, 128); cache_get_field_content(0, "passportname", PlayerInfo[extraid][pPassportName], connectionID, MAX_PLAYER_NAME); cache_get_field_content(0, "customtitle", PlayerInfo[extraid][pCustomTitle], connectionID, 64); //cache_get_field_content(0, "marriedname", PlayerInfo[extraid][pMarriedName], connectionID, MAX_PLAYER_NAME); PlayerInfo[extraid][pCustomTColor] = cache_get_field_content_int(0, "customcolor"); PlayerInfo[extraid][pID] = cache_get_field_content_int(0, "uid"); PlayerInfo[extraid][pSetup] = cache_get_field_content_int(0, "setup"); PlayerInfo[extraid][pGender] = cache_get_field_content_int(0, "gender"); PlayerInfo[extraid][pAge] = cache_get_field_content_int(0, "age"); PlayerInfo[extraid][pHunger] = cache_get_field_content_int(0, "hunger"); PlayerInfo[extraid][pThirst] = cache_get_field_content_int(0, "thirst"); PlayerInfo[extraid][pSkin] = cache_get_field_content_int(0, "skin"); PlayerInfo[extraid][pCameraX] = cache_get_field_content_float(0, "camera_x"); PlayerInfo[extraid][pCameraY] = cache_get_field_content_float(0, "camera_y"); PlayerInfo[extraid][pCameraZ] = cache_get_field_content_float(0, "camera_z"); PlayerInfo[extraid][pPosX] = cache_get_field_content_float(0, "pos_x"); PlayerInfo[extraid][pPosY] = cache_get_field_content_float(0, "pos_y"); PlayerInfo[extraid][pPosZ] = cache_get_field_content_float(0, "pos_z"); PlayerInfo[extraid][pPosA] = cache_get_field_content_float(0, "pos_a"); PlayerInfo[extraid][pInterior] = cache_get_field_content_int(0, "interior"); PlayerInfo[extraid][pWorld] = cache_get_field_content_int(0, "world"); PlayerInfo[extraid][pCash] = cache_get_field_content_int(0, "cash"); PlayerInfo[extraid][pBank] = cache_get_field_content_int(0, "bank"); PlayerInfo[extraid][pPaycheck] = cache_get_field_content_int(0, "paycheck"); PlayerInfo[extraid][pLevel] = cache_get_field_content_int(0, "level"); PlayerInfo[extraid][pvLock] = cache_get_field_content_int(0, "vehlock"); PlayerInfo[extraid][pGraphic] = cache_get_field_content_int(0, "graphic"); PlayerInfo[extraid][pEXP] = cache_get_field_content_int(0, "exp"); PlayerInfo[extraid][pMinutes] = cache_get_field_content_int(0, "minutes"); PlayerInfo[extraid][pHours] = cache_get_field_content_int(0, "hours"); PlayerInfo[extraid][pAdmin] = cache_get_field_content_int(0, "adminlevel"); PlayerInfo[extraid][pHelper] = cache_get_field_content_int(0, "helperlevel"); PlayerInfo[extraid][pHealth] = cache_get_field_content_float(0, "health"); PlayerInfo[extraid][pArmor] = cache_get_field_content_float(0, "armor"); PlayerInfo[extraid][pUpgradePoints] = cache_get_field_content_int(0, "upgradepoints"); PlayerInfo[extraid][pWarnings] = cache_get_field_content_int(0, "warnings"); PlayerInfo[extraid][pInjured] = cache_get_field_content_int(0, "injured"); PlayerInfo[extraid][pHospital] = cache_get_field_content_int(0, "hospital"); PlayerInfo[extraid][pSpawnHealth] = cache_get_field_content_float(0, "spawnhealth"); PlayerInfo[extraid][pSpawnArmor] = cache_get_field_content_float(0, "spawnarmor"); PlayerInfo[extraid][pJailType] = cache_get_field_content_int(0, "jailtype"); PlayerInfo[extraid][pJailTime] = cache_get_field_content_int(0, "jailtime"); PlayerInfo[extraid][pNewbieMuted] = cache_get_field_content_int(0, "newbiemuted"); PlayerInfo[extraid][pHelpMuted] = cache_get_field_content_int(0, "helpmuted"); PlayerInfo[extraid][pAdMuted] = cache_get_field_content_int(0, "admuted"); PlayerInfo[extraid][pLiveMuted] = cache_get_field_content_int(0, "livemuted"); PlayerInfo[extraid][pGlobalMuted] = cache_get_field_content_int(0, "globalmuted"); PlayerInfo[extraid][pReportMuted] = cache_get_field_content_int(0, "reportmuted"); PlayerInfo[extraid][pReportWarns] = cache_get_field_content_int(0, "reportwarns"); PlayerInfo[extraid][pFightStyle] = cache_get_field_content_int(0, "fightstyle"); PlayerInfo[extraid][pCookies] = cache_get_field_content_int(0, "cookies"); PlayerInfo[extraid][pPhone] = cache_get_field_content_int(0, "phone"); PlayerInfo[extraid][pJob] = cache_get_field_content_int(0, "job"); PlayerInfo[extraid][pSecondJob] = cache_get_field_content_int(0, "secondjob"); PlayerInfo[extraid][pCrimes] = cache_get_field_content_int(0, "crimes"); PlayerInfo[extraid][pArrested] = cache_get_field_content_int(0, "arrested"); PlayerInfo[extraid][pWantedLevel] = cache_get_field_content_int(0, "wantedlevel"); PlayerInfo[extraid][pMaterials] = cache_get_field_content_int(0, "materials"); PlayerInfo[extraid][pWeed] = cache_get_field_content_int(0, "weed"); PlayerInfo[extraid][pCocaine] = cache_get_field_content_int(0, "cocaine"); PlayerInfo[extraid][pMeth] = cache_get_field_content_int(0, "meth"); PlayerInfo[extraid][pPainkillers] = cache_get_field_content_int(0, "painkillers"); PlayerInfo[extraid][pSeeds] = cache_get_field_content_int(0, "seeds"); PlayerInfo[extraid][pEphedrine] = cache_get_field_content_int(0, "ephedrine"); PlayerInfo[extraid][pMuriaticAcid] = cache_get_field_content_int(0, "muriaticacid"); PlayerInfo[extraid][pBakingSoda] = cache_get_field_content_int(0, "bakingsoda"); PlayerInfo[extraid][pCigars] = cache_get_field_content_int(0, "cigars"); PlayerInfo[extraid][pWalkieTalkie] = cache_get_field_content_int(0, "walkietalkie"); PlayerInfo[extraid][pChannel] = cache_get_field_content_int(0, "channel"); PlayerInfo[extraid][pRentingHouse] = cache_get_field_content_int(0, "rentinghouse"); PlayerInfo[extraid][pSpraycans] = cache_get_field_content_int(0, "spraycans"); PlayerInfo[extraid][pBoombox] = cache_get_field_content_int(0, "boombox"); PlayerInfo[extraid][pMP3Player] = cache_get_field_content_int(0, "mp3player"); PlayerInfo[extraid][pPhonebook] = cache_get_field_content_int(0, "phonebook"); PlayerInfo[extraid][pFishingRod] = cache_get_field_content_int(0, "fishingrod"); PlayerInfo[extraid][pFishingBait] = cache_get_field_content_int(0, "fishingbait"); PlayerInfo[extraid][pFishWeight] = cache_get_field_content_int(0, "fishweight"); PlayerInfo[extraid][pComponents] = cache_get_field_content_int(0, "components"); PlayerInfo[extraid][pCourierSkill] = cache_get_field_content_int(0, "courierskill"); PlayerInfo[extraid][pFishingSkill] = cache_get_field_content_int(0, "fishingskill"); PlayerInfo[extraid][pGuardSkill] = cache_get_field_content_int(0, "guardskill"); PlayerInfo[extraid][pWeaponSkill] = cache_get_field_content_int(0, "weaponskill"); PlayerInfo[extraid][pMechanicSkill] = cache_get_field_content_int(0, "mechanicskill"); PlayerInfo[extraid][pLawyerSkill] = cache_get_field_content_int(0, "lawyerskill"); PlayerInfo[extraid][pSmugglerSkill] = cache_get_field_content_int(0, "smugglerskill"); PlayerInfo[extraid][pDetectiveSkill] = cache_get_field_content_int(0, "detectiveskill"); PlayerInfo[extraid][pThiefSkill] = cache_get_field_content_int(0, "thiefskill"); PlayerInfo[extraid][pToggleTextdraws] = cache_get_field_content_int(0, "toggletextdraws"); PlayerInfo[extraid][pToggleOOC] = cache_get_field_content_int(0, "toggleooc"); PlayerInfo[extraid][pTogglePhone] = cache_get_field_content_int(0, "togglephone"); PlayerInfo[extraid][pToggleAdmin] = cache_get_field_content_int(0, "toggleadmin"); PlayerInfo[extraid][pToggleHelper] = cache_get_field_content_int(0, "togglehelper"); PlayerInfo[extraid][pToggleNewbie] = cache_get_field_content_int(0, "togglenewbie"); PlayerInfo[extraid][pToggleWT] = cache_get_field_content_int(0, "togglewt"); PlayerInfo[extraid][pToggleRadio] = cache_get_field_content_int(0, "toggleradio"); PlayerInfo[extraid][pToggleVIP] = cache_get_field_content_int(0, "togglevip"); PlayerInfo[extraid][pToggleMusic] = cache_get_field_content_int(0, "togglemusic"); PlayerInfo[extraid][pToggleFaction] = cache_get_field_content_int(0, "togglefaction"); PlayerInfo[extraid][pToggleNews] = cache_get_field_content_int(0, "togglenews"); PlayerInfo[extraid][pToggleGlobal] = cache_get_field_content_int(0, "toggleglobal"); PlayerInfo[extraid][pToggleCam] = cache_get_field_content_int(0, "togglecam"); PlayerInfo[extraid][pToggleHUD] = cache_get_field_content_int(0, "togglehud"); PlayerInfo[extraid][pToggleReports] = cache_get_field_content_int(0, "togglereports"); PlayerInfo[extraid][pToggleWhisper] = cache_get_field_content_int(0, "togglewhisper"); PlayerInfo[extraid][pToggleBug] = cache_get_field_content_int(0, "togglebug"); PlayerInfo[extraid][pCarLicense] = cache_get_field_content_int(0, "carlicense"); PlayerInfo[extraid][pVIPPackage] = cache_get_field_content_int(0, "vippackage"); PlayerInfo[extraid][pVIPTime] = cache_get_field_content_int(0, "viptime"); PlayerInfo[extraid][pVIPCooldown] = cache_get_field_content_int(0, "vipcooldown"); PlayerInfo[extraid][pWeapons][0] = cache_get_field_content_int(0, "weapon_0"); PlayerInfo[extraid][pWeapons][1] = cache_get_field_content_int(0, "weapon_1"); PlayerInfo[extraid][pWeapons][2] = cache_get_field_content_int(0, "weapon_2"); PlayerInfo[extraid][pWeapons][3] = cache_get_field_content_int(0, "weapon_3"); PlayerInfo[extraid][pWeapons][4] = cache_get_field_content_int(0, "weapon_4"); PlayerInfo[extraid][pWeapons][5] = cache_get_field_content_int(0, "weapon_5"); PlayerInfo[extraid][pWeapons][6] = cache_get_field_content_int(0, "weapon_6"); PlayerInfo[extraid][pWeapons][7] = cache_get_field_content_int(0, "weapon_7"); PlayerInfo[extraid][pWeapons][8] = cache_get_field_content_int(0, "weapon_8"); PlayerInfo[extraid][pWeapons][9] = cache_get_field_content_int(0, "weapon_9"); PlayerInfo[extraid][pWeapons][10] = cache_get_field_content_int(0, "weapon_10"); PlayerInfo[extraid][pWeapons][11] = cache_get_field_content_int(0, "weapon_11"); PlayerInfo[extraid][pWeapons][12] = cache_get_field_content_int(0, "weapon_12"); PlayerInfo[extraid][pFaction] = cache_get_field_content_int(0, "faction"); PlayerInfo[extraid][pFactionRank] = cache_get_field_content_int(0, "factionrank"); PlayerInfo[extraid][pFactionLeader] = cache_get_field_content_int(0, "factionleader"); PlayerInfo[extraid][pGang] = cache_get_field_content_int(0, "gang"); PlayerInfo[extraid][pGangRank] = cache_get_field_content_int(0, "gangrank"); PlayerInfo[extraid][pDivision] = cache_get_field_content_int(0, "division"); PlayerInfo[extraid][pCrew] = cache_get_field_content_int(0, "crew"); PlayerInfo[extraid][pContracted] = cache_get_field_content_int(0, "contracted"); PlayerInfo[extraid][pBombs] = cache_get_field_content_int(0, "bombs"); PlayerInfo[extraid][pCompletedHits] = cache_get_field_content_int(0, "completedhits"); PlayerInfo[extraid][pFailedHits] = cache_get_field_content_int(0, "failedhits"); PlayerInfo[extraid][pReports] = cache_get_field_content_int(0, "reports"); PlayerInfo[extraid][pNewbies] = cache_get_field_content_int(0, "newbies"); PlayerInfo[extraid][pHelpRequests] = cache_get_field_content_int(0, "helprequests"); PlayerInfo[extraid][pSpeedometer] = cache_get_field_content_int(0, "speedometer"); PlayerInfo[extraid][pWebDev] = cache_get_field_content_int(0, "webdev"); PlayerInfo[extraid][pFactionMod] = cache_get_field_content_int(0, "factionmod"); PlayerInfo[extraid][pGangMod] = cache_get_field_content_int(0, "gangmod"); PlayerInfo[extraid][pBanAppealer] = cache_get_field_content_int(0, "banappealer"); PlayerInfo[extraid][pFormerAdmin] = cache_get_field_content_int(0, "FormerAdmin"); PlayerInfo[extraid][pDeveloper] = cache_get_field_content_int(0, "scripter"); PlayerInfo[extraid][pHelperManager] = cache_get_field_content_int(0, "helpermanager"); PlayerInfo[extraid][pDynamicAdmin] = cache_get_field_content_int(0, "dynamicadmin"); PlayerInfo[extraid][pAdminPersonnel] = cache_get_field_content_int(0, "adminpersonnel"); PlayerInfo[extraid][pHumanResources] = cache_get_field_content_int(0, "humanresources"); PlayerInfo[extraid][pComplaintMod] = cache_get_field_content_int(0, "complaintmod"); PlayerInfo[extraid][pWeedPlanted] = cache_get_field_content_int(0, "weedplanted"); PlayerInfo[extraid][pWeedTime] = cache_get_field_content_int(0, "weedtime"); PlayerInfo[extraid][pWeedGrams] = cache_get_field_content_int(0, "weedgrams"); PlayerInfo[extraid][pWeedX] = cache_get_field_content_float(0, "weed_x"); PlayerInfo[extraid][pWeedY] = cache_get_field_content_float(0, "weed_y"); PlayerInfo[extraid][pWeedZ] = cache_get_field_content_float(0, "weed_z"); PlayerInfo[extraid][pWeedA] = cache_get_field_content_float(0, "weed_a"); PlayerInfo[extraid][pInventoryUpgrade] = cache_get_field_content_int(0, "inventoryupgrade"); PlayerInfo[extraid][pAddictUpgrade] = cache_get_field_content_int(0, "addictupgrade"); PlayerInfo[extraid][pTraderUpgrade] = cache_get_field_content_int(0, "traderupgrade"); PlayerInfo[extraid][pAssetUpgrade] = cache_get_field_content_int(0, "assetupgrade"); PlayerInfo[extraid][pLaborUpgrade] = cache_get_field_content_int(0, "laborupgrade"); PlayerInfo[extraid][pDMWarnings] = cache_get_field_content_int(0, "dmwarnings"); PlayerInfo[extraid][pWeaponRestricted] = cache_get_field_content_int(0, "weaponrestricted"); PlayerInfo[extraid][pReferralUID] = cache_get_field_content_int(0, "referral_uid"); PlayerInfo[extraid][pWatch] = cache_get_field_content_int(0, "watch"); PlayerInfo[extraid][pGPS] = cache_get_field_content_int(0, "gps"); PlayerInfo[extraid][pClothes] = cache_get_field_content_int(0, "clothes"); PlayerInfo[extraid][pShowLands] = cache_get_field_content_int(0, "showlands"); PlayerInfo[extraid][pShowTurfs] = cache_get_field_content_int(0, "showturfs"); PlayerInfo[extraid][pWatchOn] = cache_get_field_content_int(0, "watchon"); PlayerInfo[extraid][pGPSOn] = cache_get_field_content_int(0, "gpson"); PlayerInfo[extraid][pDoubleXP] = cache_get_field_content_int(0, "doublexp"); PlayerInfo[extraid][pCourierCooldown] = cache_get_field_content_int(0, "couriercooldown"); PlayerInfo[extraid][pPizzaCooldown] = cache_get_field_content_int(0, "pizzacooldown"); PlayerInfo[extraid][pDetectiveCooldown] = cache_get_field_content_int(0, "detectivecooldown"); PlayerInfo[extraid][pThiefCooldown] = cache_get_field_content_int(0, "thiefcooldown"); PlayerInfo[extraid][pCocaineCooldown] = cache_get_field_content_int(0, "crackcooldown"); PlayerInfo[extraid][pGasCan] = cache_get_field_content_int(0, "gascan"); PlayerInfo[extraid][pDuty] = cache_get_field_content_int(0, "duty"); PlayerInfo[extraid][pBandana] = cache_get_field_content_int(0, "bandana"); PlayerInfo[extraid][pPassport] = cache_get_field_content_int(0, "passport"); PlayerInfo[extraid][pPassportLevel] = cache_get_field_content_int(0, "passportlevel"); PlayerInfo[extraid][pPassportSkin] = cache_get_field_content_int(0, "passportskin"); PlayerInfo[extraid][pPassportPhone] = cache_get_field_content_int(0, "passportphone"); PlayerInfo[extraid][pNewbieMuteTime] = cache_get_field_content_int(0, "newbiemutetime"); PlayerInfo[extraid][pReportMuteTime] = cache_get_field_content_int(0, "reportmutetime"); PlayerInfo[extraid][pGlobalMuteTime] = cache_get_field_content_int(0, "globalmutetime"); PlayerInfo[extraid][pAdminHide] = cache_get_field_content_int(0, "adminhide"); PlayerInfo[extraid][pInsurance] = cache_get_field_content_int(0, "insurance"); PlayerInfo[extraid][pRope] = cache_get_field_content_int(0, "rope"); PlayerInfo[extraid][pTotalPatients] = cache_get_field_content_int(0, "totalpatients"); PlayerInfo[extraid][pTotalFires] = cache_get_field_content_int(0, "totalfires"); PlayerInfo[extraid][pPasswordChanged] = cache_get_field_content_int(0, "passwordchanged"); PlayerInfo[extraid][pFirstAid] = cache_get_field_content_int(0, "firstaid"); PlayerInfo[extraid][pPoliceScanner] = cache_get_field_content_int(0, "policescanner"); PlayerInfo[extraid][pBodykits] = cache_get_field_content_int(0, "bodykits"); PlayerInfo[extraid][pRimkits] = cache_get_field_content_int(0, "rimkits"); PlayerInfo[extraid][pScannerOn] = cache_get_field_content_int(0, "scanneron"); PlayerInfo[extraid][pGunLicense] = cache_get_field_content_int(0, "gunlicense"); new tempkey = cache_get_field_content_int(0, "landkeys"); for(new i = 0; i < MAX_LANDS; i++) { if(LandInfo[i][lExists]) { if(LandInfo[i][lID] == tempkey) { PlayerInfo[extraid][pLandPerms] = i; break; } } } PlayerInfo[extraid][pBugged] = cache_get_field_content_int(0, "bugged"); PlayerInfo[extraid][pRareTime] = cache_get_field_content_int(0, "rarecooldown"); PlayerInfo[extraid][pDiamonds] = cache_get_field_content_int(0, "diamonds"); PlayerInfo[extraid][pSkates] = cache_get_field_content_int(0, "rollerskates"); PlayerInfo[extraid][pMarriedTo] = cache_get_field_content_int(0, "marriedto"); PlayerInfo[extraid][pInformed] = false; PlayerInfo[extraid][pLoseReason] = -1; PlayerInfo[extraid][pHasTimer] = false; if(PlayerInfo[extraid][pMarriedTo] != -1) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT username FROM users WHERE uid = %i", PlayerInfo[extraid][pMarriedTo]); mysql_tquery(connectionID, queryBuffer, "OnUpdatePartner", "i", extraid); } else { strcpy(PlayerInfo[extraid][pMarriedName], "Nobody", MAX_PLAYER_NAME); } PlayerInfo[extraid][pLogged] = 1; PlayerInfo[extraid][pACTime] = gettime() + 5; if(!PlayerInfo[extraid][pAdminDuty]) { ClearChat(extraid); } for(new i = 0; i < 11; i ++) { TextDrawHideForPlayer(extraid, LoginScreen[i]); } if(!PlayerInfo[extraid][pToggleTextdraws]) { RefreshPlayerTextdraws(extraid); } if(cache_get_field_content_int(extraid, "refercount") > 0) { new count = cache_get_field_content_int(0, "refercount"); SendClientMessageEx(extraid, COLOR_GREEN, "%i players who you've referred reached level 3. Therefore you received %i cookies!", count, count * 10); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET refercount = 0 WHERE uid = %i", PlayerInfo[extraid][pID]); mysql_tquery(connectionID, queryBuffer); } if(!PlayerInfo[extraid][pSetup]) { if(!PlayerInfo[extraid][pAdminDuty] && !PlayerInfo[extraid][pToggleCam]) { PlayerInfo[extraid][pLoginCamera] = 1; } else { PlayerInfo[extraid][pLoginCamera] = 0; } if(PlayerInfo[extraid][pWeedPlanted] && PlayerInfo[extraid][pWeedObject] == INVALID_OBJECT_ID) { PlayerInfo[extraid][pWeedObject] = CreateDynamicObject(3409, PlayerInfo[extraid][pWeedX], PlayerInfo[extraid][pWeedY], PlayerInfo[extraid][pWeedZ] - 1.8, 0.0, 0.0, PlayerInfo[extraid][pWeedA]); } if(PlayerInfo[extraid][pShowTurfs]) { ShowTurfsOnMap(extraid, true); } if(PlayerInfo[extraid][pShowLands]) { ShowLandsOnMap(extraid, true); } if(!PlayerInfo[extraid][pAdminDuty]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET lastlogin = NOW(), ip = '%s' WHERE uid = %i", GetPlayerIP(extraid), PlayerInfo[extraid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT id FROM flags WHERE uid = %i", PlayerInfo[extraid][pID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_COUNT_FLAGS, extraid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM clothing WHERE uid = %i", PlayerInfo[extraid][pID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOAD_CLOTHING, extraid); if(!PlayerInfo[extraid][pTogglePhone]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM texts WHERE recipient_number = %i", PlayerInfo[extraid][pPhone]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_COUNT_TEXTS, extraid); } } foreach(new i: Vehicle) { if(IsVehicleOwner(extraid, i) && VehicleInfo[i][vTimer] >= 0) { KillTimer(VehicleInfo[i][vTimer]); VehicleInfo[i][vTimer] = -1; } } // Just in case. SetPlayerSpecialTag(extraid, TAG_NONE); if(PlayerInfo[extraid][pAdminDuty]) { PlayerInfo[extraid][pAdminDuty] = 0; SetPlayerName(extraid, PlayerInfo[extraid][pUsername]); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s is no longer on admin duty.", GetPlayerRPName(extraid)); SendClientMessage(extraid, COLOR_WHITE, "You are no longer on admin duty. Your account's statistics have been preserved."); } else { if(!isnull(gServerMOTD)) { SendClientMessageEx(extraid, COLOR_YELLOW, "** MOTD: %s", gServerMOTD); } if(!isnull(adminMOTD) && PlayerInfo[extraid][pAdmin] > 0) { SendClientMessageEx(extraid, COLOR_LIGHTRED, "** Admin MOTD: %s", adminMOTD); } if(!isnull(helperMOTD) && PlayerInfo[extraid][pHelper] > 0) { SendClientMessageEx(extraid, COLOR_AQUA, "** Helper MOTD: %s", helperMOTD); } if(PlayerInfo[extraid][pGang] >= 0 && strcmp(GangInfo[PlayerInfo[extraid][pGang]][gMOTD], "None", true) != 0) { SendClientMessageEx(extraid, COLOR_YELLOW, "Gang MOTD: %s", GangInfo[PlayerInfo[extraid][pGang]][gMOTD]); } if(PlayerInfo[extraid][pFaction] >= 0 && strcmp(FactionInfo[PlayerInfo[extraid][pFaction]][fMOTD], "None", true) != 0) { SendClientMessageEx(extraid, COLOR_YELLOW, "Faction MOTD: %s", FactionInfo[PlayerInfo[extraid][pFaction]][fMOTD]); } if(PlayerInfo[extraid][pAdmin] && !PlayerInfo[extraid][pAdminHide]) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s %s has logged in.", GetAdminRank(extraid), GetPlayerRPName(extraid)); } if(PlayerInfo[extraid][pGang] >= 0) { SendGangMessage(PlayerInfo[extraid][pGang], COLOR_AQUA, "(( %s %s has logged in. ))", GangRanks[PlayerInfo[extraid][pGang]][PlayerInfo[extraid][pGangRank]], GetPlayerRPName(extraid)); } if(PlayerInfo[extraid][pFaction] >= 0) { SendFactionMessage(PlayerInfo[extraid][pFaction], COLOR_FACTIONCHAT, "(( %s %s has logged in. ))", FactionRanks[PlayerInfo[extraid][pFaction]][PlayerInfo[extraid][pFactionRank]], GetPlayerRPName(extraid)); } format(string, sizeof(string), "~w~Welcome ~n~~y~ %s", GetPlayerRPName(extraid)); GameTextForPlayer(extraid, string, 5000, 1); if(PlayerInfo[extraid][pAdmin] > 0) { SendClientMessageEx(extraid, COLOR_WHITE, "Emerald City Roleplay: You have logged in as a {FF6347}level %i %s{FFFFFF}.", PlayerInfo[extraid][pAdmin], GetAdminRank(extraid)); } else if(PlayerInfo[extraid][pHelper] > 0) { SendClientMessageEx(extraid, COLOR_WHITE, "Emerald City Roleplay: You have logged in as a {33CCFF}%s{FFFFFF}.", GetHelperRank(extraid)); } else if(PlayerInfo[extraid][pVIPPackage] > 0) { SendClientMessageEx(extraid, COLOR_WHITE, "Emerald City Roleplay: You have logged in as a {D909D9}%s VIP{FFFFFF}.", GetVIPRank(PlayerInfo[extraid][pVIPPackage])); } else if(PlayerInfo[extraid][pLevel] >= 2) { SendClientMessageEx(extraid, COLOR_WHITE, "Emerald City Roleplay: You have logged in as a {AFAFAF}level %i player{FFFFFF}.", PlayerInfo[extraid][pLevel]); } else { SendClientMessage(extraid, COLOR_WHITE, "Emerald City Roleplay: You have logged in as a {AFAFAF}level 1 newbie{FFFFFF}."); } SendClientMessageEx(extraid, COLOR_NAVYBLUE, "Your last login was on the %s (server time).", GetDate()); StopAudioStreamForPlayer(extraid); } if(PlayerInfo[extraid][pFaction] >= 0 && FactionInfo[PlayerInfo[extraid][pFaction]][fType] == FACTION_NONE) { SetPlayerFaction(extraid, -1); SendClientMessageEx(extraid, COLOR_LIGHTRED, "You were either kicked from the faction while offline or it was deleted."); } if(PlayerInfo[extraid][pGang] >= 0 && !GangInfo[PlayerInfo[extraid][pGang]][gSetup]) { SendClientMessage(extraid, COLOR_LIGHTRED, "You have either been kicked from the gang while offline or it was deleted."); PlayerInfo[extraid][pGang] = -1; PlayerInfo[extraid][pGangRank] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gang = -1, gangrank = 0 WHERE uid = %i", PlayerInfo[extraid][pID]); mysql_tquery(connectionID, queryBuffer); } if(PlayerInfo[extraid][pPasswordChanged] == 0) { ShowPlayerDialog(extraid, DIALOG_CHANGEPASS, DIALOG_STYLE_INPUT, "{FF1AFF}Emerald City Roleplay{FFFFFF} | Change password", "Please change your password for security purposes\nEnter your new password below:", "Submit", "Cancel"); } } SetPlayerToSpawn(extraid); } } case THREAD_COUNT_FLAGS: { if(rows) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has %i pending flags. (/listflags %i)", GetPlayerRPName(extraid), extraid, rows, extraid); } } case THREAD_TRACE_IP: { if(rows) { new username[24], date[24]; SendClientMessageEx(extraid, COLOR_NAVYBLUE, "___________ %i Results Found ___________", rows); for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "username", username); cache_get_field_content(i, "lastlogin", date); SendClientMessageEx(extraid, COLOR_GREY2, "Name: %s - Last Seen: %s", username, date); } } else { SendClientMessage(extraid, COLOR_GREY, "This IP address is not associated with any accounts."); } } case THREAD_LOGIN_UPDATE: { new string[1028]; if(extraid == 1) // Changes { new text[128]; if(!rows) { strcat(string, "~n~- n/a"); } else { for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "text", text); format(string, sizeof(string), "%s- %s~n~", string, text); } } TextDrawSetString(LoginScreen[6], string); } else if(extraid == 2) // Top ten players { new username[MAX_PLAYER_NAME]; if(!rows) { strcat(string, "~n~- n/a"); } else { for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "username", username); format(string, sizeof(string), "%s - %s (%i hrs)~n~", string, username, cache_get_field_content_int(i, "hours")); } } TextDrawSetString(LoginScreen[7], string); } } case THREAD_LIST_CHANGES: { new text[128]; SendClientMessage(extraid, COLOR_NAVYBLUE, "________ Changes List ________"); for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "text", text); SendClientMessageEx(extraid, COLOR_GREY1, "Slot %i -> %s", cache_get_field_content_int(i, "slot"), text); } } case THREAD_LIST_HELPERS: { new username[MAX_PLAYER_NAME], lastlogin[24]; SendClientMessage(extraid, COLOR_NAVYBLUE, "_______ Helper Roster _______"); for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "username", username); cache_get_field_content(i, "lastlogin", lastlogin); switch(cache_get_field_content_int(i, "helperlevel")) { case 1: SendClientMessageEx(extraid, COLOR_GREY2, "Junior Helper %s - Last Seen: %s", username, lastlogin); case 2: SendClientMessageEx(extraid, COLOR_GREY2, "Senior Helper %s - Last Seen: %s", username, lastlogin); case 3: SendClientMessageEx(extraid, COLOR_GREY2, "Ast. Head Helper %s - Last Seen: %s", username, lastlogin); case 4: SendClientMessageEx(extraid, COLOR_GREY2, "Head Helper %s - Last Seen: %s", username, lastlogin); } } } case THREAD_LOAD_HOUSES: { for(new i = 0; i < rows && i < MAX_HOUSES; i ++) { cache_get_field_content(i, "owner", HouseInfo[i][hOwner], connectionID, MAX_PLAYER_NAME); HouseInfo[i][hID] = cache_get_field_content_int(i, "id"); HouseInfo[i][hOwnerID] = cache_get_field_content_int(i, "ownerid"); HouseInfo[i][hType] = cache_get_field_content_int(i, "type"); HouseInfo[i][hPrice] = cache_get_field_content_int(i, "price"); HouseInfo[i][hRentPrice] = cache_get_field_content_int(i, "rentprice"); HouseInfo[i][hLevel] = cache_get_field_content_int(i, "level"); HouseInfo[i][hLocked] = cache_get_field_content_int(i, "locked"); HouseInfo[i][hTimestamp] = cache_get_field_content_int(i, "timestamp"); HouseInfo[i][hPosX] = cache_get_field_content_float(i, "pos_x"); HouseInfo[i][hPosY] = cache_get_field_content_float(i, "pos_y"); HouseInfo[i][hPosZ] = cache_get_field_content_float(i, "pos_z"); HouseInfo[i][hPosA] = cache_get_field_content_float(i, "pos_a"); HouseInfo[i][hIntX] = cache_get_field_content_float(i, "int_x"); HouseInfo[i][hIntY] = cache_get_field_content_float(i, "int_y"); HouseInfo[i][hIntZ] = cache_get_field_content_float(i, "int_z"); HouseInfo[i][hIntA] = cache_get_field_content_float(i, "int_a"); HouseInfo[i][hInterior] = cache_get_field_content_int(i, "interior"); HouseInfo[i][hWorld] = cache_get_field_content_int(i, "world"); HouseInfo[i][hOutsideInt] = cache_get_field_content_int(i, "outsideint"); HouseInfo[i][hOutsideVW] = cache_get_field_content_int(i, "outsidevw"); HouseInfo[i][hCash] = cache_get_field_content_int(i, "cash"); HouseInfo[i][hMaterials] = cache_get_field_content_int(i, "materials"); HouseInfo[i][hWeed] = cache_get_field_content_int(i, "weed"); HouseInfo[i][hCocaine] = cache_get_field_content_int(i, "cocaine"); HouseInfo[i][hMeth] = cache_get_field_content_int(i, "meth"); HouseInfo[i][hPainkillers] = cache_get_field_content_int(i, "painkillers"); HouseInfo[i][hWeapons][0] = cache_get_field_content_int(i, "weapon_1"); HouseInfo[i][hWeapons][1] = cache_get_field_content_int(i, "weapon_2"); HouseInfo[i][hWeapons][2] = cache_get_field_content_int(i, "weapon_3"); HouseInfo[i][hWeapons][3] = cache_get_field_content_int(i, "weapon_4"); HouseInfo[i][hWeapons][4] = cache_get_field_content_int(i, "weapon_5"); HouseInfo[i][hWeapons][5] = cache_get_field_content_int(i, "weapon_6"); HouseInfo[i][hWeapons][6] = cache_get_field_content_int(i, "weapon_7"); HouseInfo[i][hWeapons][7] = cache_get_field_content_int(i, "weapon_8"); HouseInfo[i][hWeapons][8] = cache_get_field_content_int(i, "weapon_9"); HouseInfo[i][hWeapons][9] = cache_get_field_content_int(i, "weapon_10"); HouseInfo[i][hDelivery] = cache_get_field_content_int(i, "delivery"); HouseInfo[i][hLights] = cache_get_field_content_int(i, "lights"); HouseInfo[i][hText] = Text3D:INVALID_3DTEXT_ID; HouseInfo[i][hPickup] = -1; HouseInfo[i][hLabels] = 0; HouseInfo[i][hExists] = 1; Iter_Add(House, i); ReloadHouse(i); } printf("[Script] %i houses loaded.", rows); } case THREAD_LIST_TENANTS: { if(!rows) { SendClientMessage(extraid, COLOR_GREY, "There is nobody currently renting at your home."); } else { new username[MAX_PLAYER_NAME], date[24]; SendClientMessage(extraid, COLOR_NAVYBLUE, "_______ List of Tenants _______"); for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "username", username); cache_get_field_content(i, "lastlogin", date); SendClientMessageEx(extraid, COLOR_GREY2, "Name: %s - Last Seen: %s", username, date); } } } case THREAD_LOAD_FURNITURE: { for(new i = 0; i < rows; i ++) { new objectid = CreateDynamicObject(cache_get_field_content_int(i, "modelid"), cache_get_field_content_float(i, "pos_x"), cache_get_field_content_float(i, "pos_y"), cache_get_field_content_float(i, "pos_z"), cache_get_field_content_float(i, "rot_x"), cache_get_field_content_float(i, "rot_y"), cache_get_field_content_float(i, "rot_z"), cache_get_field_content_int(i, "world"), cache_get_field_content_int(i, "interior")); Streamer_SetExtraInt(objectid, E_OBJECT_TYPE, E_OBJECT_FURNITURE); Streamer_SetExtraInt(objectid, E_OBJECT_INDEX_ID, cache_get_field_content_int(i, "id")); Streamer_SetExtraInt(objectid, E_OBJECT_EXTRA_ID, cache_get_field_content_int(i, "houseid")); if(extraid) { new string[48]; cache_get_field_content(i, "name", string); format(string, sizeof(string), "[%i] - %s", objectid, string); Streamer_SetExtraInt(objectid, E_OBJECT_3DTEXT_ID, _:CreateDynamic3DTextLabel(string, COLOR_GREY2, cache_get_field_content_float(i, "pos_x"), cache_get_field_content_float(i, "pos_y"), cache_get_field_content_float(i, "pos_z"), 10.0, .worldid = cache_get_field_content_int(i, "world"), .interiorid = cache_get_field_content_int(i, "interior"))); } } } case THREAD_LOAD_GARAGES: { for(new i = 0; i < rows && i < MAX_GARAGES; i ++) { cache_get_field_content(i, "owner", GarageInfo[i][gOwner], connectionID, MAX_PLAYER_NAME); GarageInfo[i][gID] = cache_get_field_content_int(i, "id"); GarageInfo[i][gOwnerID] = cache_get_field_content_int(i, "ownerid"); GarageInfo[i][gType] = cache_get_field_content_int(i, "type"); GarageInfo[i][gPrice] = cache_get_field_content_int(i, "price"); GarageInfo[i][gLocked] = cache_get_field_content_int(i, "locked"); GarageInfo[i][gTimestamp] = cache_get_field_content_int(i, "timestamp"); GarageInfo[i][gPosX] = cache_get_field_content_float(i, "pos_x"); GarageInfo[i][gPosY] = cache_get_field_content_float(i, "pos_y"); GarageInfo[i][gPosZ] = cache_get_field_content_float(i, "pos_z"); GarageInfo[i][gPosA] = cache_get_field_content_float(i, "pos_a"); GarageInfo[i][gExitX] = cache_get_field_content_float(i, "exit_x"); GarageInfo[i][gExitY] = cache_get_field_content_float(i, "exit_y"); GarageInfo[i][gExitZ] = cache_get_field_content_float(i, "exit_z"); GarageInfo[i][gExitA] = cache_get_field_content_float(i, "exit_a"); GarageInfo[i][gWorld] = cache_get_field_content_int(i, "world"); GarageInfo[i][gText] = Text3D:INVALID_3DTEXT_ID; GarageInfo[i][gPickup] = -1; GarageInfo[i][gExists] = 1; Iter_Add(Garage, i); ReloadGarage(i); } printf("[Script] %i garages loaded.", rows); } case THREAD_LOAD_BUSINESSES: { for(new i = 0; i < rows && i < MAX_BUSINESSES; i ++) { cache_get_field_content(i, "owner", BusinessInfo[i][bOwner], connectionID, MAX_PLAYER_NAME); BusinessInfo[i][bID] = cache_get_field_content_int(i, "id"); BusinessInfo[i][bOwnerID] = cache_get_field_content_int(i, "ownerid"); BusinessInfo[i][bType] = cache_get_field_content_int(i, "type"); BusinessInfo[i][bPrice] = cache_get_field_content_int(i, "price"); BusinessInfo[i][bEntryFee] = cache_get_field_content_int(i, "entryfee"); BusinessInfo[i][bLocked] = cache_get_field_content_int(i, "locked"); BusinessInfo[i][bTimestamp] = cache_get_field_content_int(i, "timestamp"); BusinessInfo[i][bPosX] = cache_get_field_content_float(i, "pos_x"); BusinessInfo[i][bPosY] = cache_get_field_content_float(i, "pos_y"); BusinessInfo[i][bPosZ] = cache_get_field_content_float(i, "pos_z"); BusinessInfo[i][bPosA] = cache_get_field_content_float(i, "pos_a"); BusinessInfo[i][bIntX] = cache_get_field_content_float(i, "int_x"); BusinessInfo[i][bIntY] = cache_get_field_content_float(i, "int_y"); BusinessInfo[i][bIntZ] = cache_get_field_content_float(i, "int_z"); BusinessInfo[i][bIntA] = cache_get_field_content_float(i, "int_a"); BusinessInfo[i][bInterior] = cache_get_field_content_int(i, "interior"); BusinessInfo[i][bWorld] = cache_get_field_content_int(i, "world"); BusinessInfo[i][bOutsideInt] = cache_get_field_content_int(i, "outsideint"); BusinessInfo[i][bOutsideVW] = cache_get_field_content_int(i, "outsidevw"); BusinessInfo[i][bCash] = cache_get_field_content_int(i, "cash"); BusinessInfo[i][bProducts] = cache_get_field_content_int(i, "products"); BusinessInfo[i][bMaterials] = cache_get_field_content_int(i, "materials"); BusinessInfo[i][bText] = Text3D:INVALID_3DTEXT_ID; BusinessInfo[i][bPickup] = -1; BusinessInfo[i][bMapIcon] = -1; BusinessInfo[i][bExists] = 1; Iter_Add(Business, i); ReloadBusiness(i); } printf("[Script] %i businesses loaded.", rows); } case THREAD_LOAD_ENTRANCES: { for(new i = 0; i < rows && i < MAX_ENTRANCES; i ++) { cache_get_field_content(i, "owner", EntranceInfo[i][eOwner], connectionID, MAX_PLAYER_NAME); cache_get_field_content(i, "name", EntranceInfo[i][eName], connectionID, 40); cache_get_field_content(i, "password", EntranceInfo[i][ePassword], connectionID, 64); EntranceInfo[i][eID] = cache_get_field_content_int(i, "id"); EntranceInfo[i][eOwnerID] = cache_get_field_content_int(i, "ownerid"); EntranceInfo[i][eIcon] = cache_get_field_content_int(i, "iconid"); EntranceInfo[i][eLocked] = cache_get_field_content_int(i, "locked"); EntranceInfo[i][eRadius] = cache_get_field_content_float(i, "radius"); EntranceInfo[i][ePosX] = cache_get_field_content_float(i, "pos_x"); EntranceInfo[i][ePosY] = cache_get_field_content_float(i, "pos_y"); EntranceInfo[i][ePosZ] = cache_get_field_content_float(i, "pos_z"); EntranceInfo[i][ePosA] = cache_get_field_content_float(i, "pos_a"); EntranceInfo[i][eIntX] = cache_get_field_content_float(i, "int_x"); EntranceInfo[i][eIntY] = cache_get_field_content_float(i, "int_y"); EntranceInfo[i][eIntZ] = cache_get_field_content_float(i, "int_z"); EntranceInfo[i][eIntA] = cache_get_field_content_float(i, "int_a"); EntranceInfo[i][eInterior] = cache_get_field_content_int(i, "interior"); EntranceInfo[i][eWorld] = cache_get_field_content_int(i, "world"); EntranceInfo[i][eOutsideInt] = cache_get_field_content_int(i, "outsideint"); EntranceInfo[i][eOutsideVW] = cache_get_field_content_int(i, "outsidevw"); EntranceInfo[i][eAdminLevel] = cache_get_field_content_int(i, "adminlevel"); EntranceInfo[i][eFactionType] = cache_get_field_content_int(i, "factiontype"); EntranceInfo[i][eGang] = cache_get_field_content_int(i, "gang"); EntranceInfo[i][eVIP] = cache_get_field_content_int(i, "vip"); EntranceInfo[i][eVehicles] = cache_get_field_content_int(i, "vehicles"); EntranceInfo[i][eFreeze] = cache_get_field_content_int(i, "freeze"); EntranceInfo[i][eLabel] = cache_get_field_content_int(i, "label"); EntranceInfo[i][eType] = cache_get_field_content_int(i, "type"); EntranceInfo[i][eMapIcon] = cache_get_field_content_int(i, "mapicon"); EntranceInfo[i][eColor] = cache_get_field_content_int(i, "color"); EntranceInfo[i][eText] = Text3D:INVALID_3DTEXT_ID; EntranceInfo[i][ePickup] = -1; EntranceInfo[i][eMapIconID] = -1; EntranceInfo[i][eExists] = 1; Iter_Add(Entrance, i); ReloadEntrance(i); } printf("[Script] %i entrances loaded.", rows); } case THREAD_LOAD_FACTIONS: { for(new i = 0; i < rows && i < MAX_FACTIONS; i ++) { new factionid = cache_get_field_content_int(i, "id"); cache_get_field_content(i, "name", FactionInfo[factionid][fName], connectionID, 48); cache_get_field_content(i, "shortname", FactionInfo[factionid][fShortName], connectionID, 24); cache_get_field_content(i, "motd", FactionInfo[factionid][fMOTD], connectionID, 128); cache_get_field_content(i, "leader", FactionInfo[factionid][fLeader], connectionID, MAX_PLAYER_NAME); FactionInfo[factionid][fType] = cache_get_field_content_int(i, "type"); FactionInfo[factionid][fColor] = cache_get_field_content_int(i, "color"); FactionInfo[factionid][fRankCount] = cache_get_field_content_int(i, "rankcount"); FactionInfo[factionid][fTurfcookies] = cache_get_field_content_int(i, "turfcookies"); FactionInfo[factionid][fBudget] = cache_get_field_content_int(i, "budget"); FactionInfo[factionid][fText] = Text3D:INVALID_3DTEXT_ID; FactionInfo[factionid][fPickup] = -1; } printf("[Script] %i factions loaded.", rows); } case THREAD_LOAD_FACTIONRANKS: { for(new i = 0; i < MAX_FACTIONS; i ++) { for(new r = 0; r < MAX_FACTION_RANKS; r ++) { strcpy(FactionRanks[i][r], "Unspecified", 32); } } for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "name", FactionRanks[cache_get_field_content_int(i, "id")][cache_get_field_content_int(i, "rank")], connectionID, 32); } } case THREAD_LOAD_FACTIONSKINS: { for(new i = 0; i < rows; i ++) { FactionInfo[cache_get_field_content_int(i, "id")][fSkins][cache_get_field_content_int(i, "slot")] = cache_get_field_content_int(i, "skinid"); } } case THREAD_LOAD_FACTIONPAY: { for(new i = 0; i < rows; i ++) { FactionInfo[cache_get_field_content_int(i, "id")][fPaycheck][cache_get_field_content_int(i, "rank")] = cache_get_field_content_int(i, "amount"); } } case THREAD_LOAD_DIVISIONS: { for(new i = 0; i < MAX_FACTIONS; i ++) { for(new r = 0; r < MAX_FACTION_DIVISIONS; r ++) { FactionDivisions[i][r][0] = 0; } } for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "name", FactionDivisions[cache_get_field_content_int(i, "id")][cache_get_field_content_int(i, "divisionid")], connectionID, 32); } } case THREAD_LOAD_LANDS: { for(new i = 0; i < rows && i < MAX_LANDS; i ++) { cache_get_field_content(i, "owner", LandInfo[i][lOwner], connectionID, MAX_PLAYER_NAME); LandInfo[i][lID] = cache_get_field_content_int(i, "id"); LandInfo[i][lOwnerID] = cache_get_field_content_int(i, "ownerid"); LandInfo[i][lLevel] = cache_get_field_content_int(i, "level"); LandInfo[i][lPrice] = cache_get_field_content_int(i, "price"); LandInfo[i][lMinX] = cache_get_field_content_float(i, "min_x"); LandInfo[i][lMinY] = cache_get_field_content_float(i, "min_y"); LandInfo[i][lMaxX] = cache_get_field_content_float(i, "max_x"); LandInfo[i][lMaxY] = cache_get_field_content_float(i, "max_y"); LandInfo[i][lHeight] = cache_get_field_content_float(i, "height"); LandInfo[i][lGangZone] = -1; LandInfo[i][lArea] = -1; LandInfo[i][lLabels] = 0; //LandInfo[i][lTextdraw]; LandInfo[i][lExists] = 1; Iter_Add(Land, i); ReloadLand(i); } printf("[Script] %i lands loaded.", rows); } case THREAD_LOAD_LANDOBJECTS: { for(new i = 0; i < rows; i ++) { new objectid = CreateDynamicObject(cache_get_field_content_int(i, "modelid"), cache_get_field_content_float(i, "pos_x"), cache_get_field_content_float(i, "pos_y"), cache_get_field_content_float(i, "pos_z"), cache_get_field_content_float(i, "rot_x"), cache_get_field_content_float(i, "rot_y"), cache_get_field_content_float(i, "rot_z")); Streamer_SetExtraInt(objectid, E_OBJECT_TYPE, E_OBJECT_LAND); Streamer_SetExtraInt(objectid, E_OBJECT_INDEX_ID, cache_get_field_content_int(i, "id")); Streamer_SetExtraInt(objectid, E_OBJECT_EXTRA_ID, cache_get_field_content_int(i, "landid")); Streamer_SetExtraFloat(objectid, E_OBJECT_X, cache_get_field_content_float(i, "pos_x")); Streamer_SetExtraFloat(objectid, E_OBJECT_Y, cache_get_field_content_float(i, "pos_y")); Streamer_SetExtraFloat(objectid, E_OBJECT_Z, cache_get_field_content_float(i, "pos_z")); if(extraid) { new string[48]; cache_get_field_content(i, "name", string); format(string, sizeof(string), "[%i] - %s", objectid, string); Streamer_SetExtraInt(objectid, E_OBJECT_3DTEXT_ID, _:CreateDynamic3DTextLabel(string, COLOR_GREY2, cache_get_field_content_float(i, "pos_x"), cache_get_field_content_float(i, "pos_y"), cache_get_field_content_float(i, "pos_z"), 10.0)); } } } case THREAD_LOAD_GANGS: { for(new i = 0; i < rows && i < MAX_GANGS; i ++) { new gangid = cache_get_field_content_int(i, "id"); cache_get_field_content(i, "name", GangInfo[gangid][gName], connectionID, 32); cache_get_field_content(i, "motd", GangInfo[gangid][gMOTD], connectionID, 128); cache_get_field_content(i, "leader", GangInfo[gangid][gLeader], connectionID, MAX_PLAYER_NAME); GangInfo[gangid][gColor] = cache_get_field_content_int(i, "color"); GangInfo[gangid][gStrikes] = cache_get_field_content_int(i, "strikes"); GangInfo[gangid][gLevel] = cache_get_field_content_int(i, "level"); GangInfo[gangid][gPoints] = cache_get_field_content_int(i, "points"); GangInfo[gangid][gTurfcookies] = cache_get_field_content_int(i, "turfcookies"); GangInfo[gangid][gStashX] = cache_get_field_content_float(i, "stash_x"); GangInfo[gangid][gStashY] = cache_get_field_content_float(i, "stash_y"); GangInfo[gangid][gStashZ] = cache_get_field_content_float(i, "stash_z"); GangInfo[gangid][gStashInterior] = cache_get_field_content_int(i, "stashinterior"); GangInfo[gangid][gStashWorld] = cache_get_field_content_int(i, "stashworld"); GangInfo[gangid][gCash] = cache_get_field_content_int(i, "cash"); GangInfo[gangid][gMaterials] = cache_get_field_content_int(i, "materials"); GangInfo[gangid][gWeed] = cache_get_field_content_int(i, "weed"); GangInfo[gangid][gCocaine] = cache_get_field_content_int(i, "cocaine"); GangInfo[gangid][gMeth] = cache_get_field_content_int(i, "meth"); GangInfo[gangid][gPainkillers] = cache_get_field_content_int(i, "painkillers"); GangInfo[gangid][gAlliance] = cache_get_field_content_int (i, "alliance"); GangInfo[gangid][gMatLevel] = cache_get_field_content_int (i, "matlevel"); GangInfo[gangid][gGunLevel] = cache_get_field_content_int (i, "gunlevel"); // Gang stash weapons GangInfo[gangid][gWeapons][GANGWEAPON_9MM] = cache_get_field_content_int(i, "weapon_9mm"); GangInfo[gangid][gWeapons][GANGWEAPON_SDPISTOL] = cache_get_field_content_int(i, "weapon_sdpistol"); GangInfo[gangid][gWeapons][GANGWEAPON_DEAGLE] = cache_get_field_content_int(i, "weapon_deagle"); GangInfo[gangid][gWeapons][GANGWEAPON_SHOTGUN] = cache_get_field_content_int(i, "weapon_shotgun"); GangInfo[gangid][gWeapons][GANGWEAPON_SAWNOFF] = cache_get_field_content_int(i, "weapon_sawnoff"); GangInfo[gangid][gWeapons][GANGWEAPON_TEC9] = cache_get_field_content_int(i, "weapon_tec9"); GangInfo[gangid][gWeapons][GANGWEAPON_UZI] = cache_get_field_content_int(i, "weapon_uzi"); GangInfo[gangid][gWeapons][GANGWEAPON_MP5] = cache_get_field_content_int(i, "weapon_mp5"); GangInfo[gangid][gWeapons][GANGWEAPON_AK47] = cache_get_field_content_int(i, "weapon_ak47"); GangInfo[gangid][gWeapons][GANGWEAPON_M4] = cache_get_field_content_int(i, "weapon_m4"); GangInfo[gangid][gWeapons][GANGWEAPON_RIFLE] = cache_get_field_content_int(i, "weapon_rifle"); GangInfo[gangid][gWeapons][GANGWEAPON_SNIPER] = cache_get_field_content_int(i, "weapon_sniper"); GangInfo[gangid][gWeapons][GANGWEAPON_MOLOTOV] = cache_get_field_content_int(i, "weapon_molotov"); // Gang stash weapon ranks (01/07/2017) GangInfo[gangid][gWeaponRanks][GANGWEAPON_9MM] = cache_get_field_content_int(i, "rank_9mm"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_SDPISTOL] = cache_get_field_content_int(i, "rank_sdpistol"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_DEAGLE] = cache_get_field_content_int(i, "rank_deagle"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_SHOTGUN] = cache_get_field_content_int(i, "rank_shotgun"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_SAWNOFF] = cache_get_field_content_int(i, "rank_sawnoff"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_TEC9] = cache_get_field_content_int(i, "rank_tec9"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_UZI] = cache_get_field_content_int(i, "rank_uzi"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_MP5] = cache_get_field_content_int(i, "rank_mp5"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_AK47] = cache_get_field_content_int(i, "rank_ak47"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_M4] = cache_get_field_content_int(i, "rank_m4"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_RIFLE] = cache_get_field_content_int(i, "rank_rifle"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_SNIPER] = cache_get_field_content_int(i, "rank_sniper"); GangInfo[gangid][gWeaponRanks][GANGWEAPON_MOLOTOV] = cache_get_field_content_int(i, "rank_molotov"); GangInfo[gangid][gVestRank] = cache_get_field_content_int(i, "rank_vest"); // Gang arms & drug dealer GangInfo[gangid][gArmsDealer] = cache_get_field_content_int(i, "armsdealer"); GangInfo[gangid][gDrugDealer] = cache_get_field_content_int(i, "drugdealer"); GangInfo[gangid][gArmsX] = cache_get_field_content_float(i, "arms_x"); GangInfo[gangid][gArmsY] = cache_get_field_content_float(i, "arms_y"); GangInfo[gangid][gArmsZ] = cache_get_field_content_float(i, "arms_z"); GangInfo[gangid][gArmsA] = cache_get_field_content_float(i, "arms_a"); GangInfo[gangid][gDrugX] = cache_get_field_content_float(i, "drug_x"); GangInfo[gangid][gDrugY] = cache_get_field_content_float(i, "drug_y"); GangInfo[gangid][gDrugZ] = cache_get_field_content_float(i, "drug_z"); GangInfo[gangid][gDrugA] = cache_get_field_content_float(i, "drug_a"); GangInfo[gangid][gArmsWorld] = cache_get_field_content_int(i, "armsworld"); GangInfo[gangid][gDrugWorld] = cache_get_field_content_int(i, "drugworld"); GangInfo[gangid][gDrugWeed] = cache_get_field_content_int(i, "drugweed"); GangInfo[gangid][gDrugCocaine] = cache_get_field_content_int(i, "drugcocaine"); GangInfo[gangid][gDrugMeth] = cache_get_field_content_int(i, "drugmeth"); GangInfo[gangid][gArmsMaterials] = cache_get_field_content_int(i, "armsmaterials"); GangInfo[gangid][gArmsPrices][0] = cache_get_field_content_int(i, "armsprice_1"); GangInfo[gangid][gArmsPrices][1] = cache_get_field_content_int(i, "armsprice_2"); GangInfo[gangid][gArmsPrices][2] = cache_get_field_content_int(i, "armsprice_3"); GangInfo[gangid][gArmsPrices][3] = cache_get_field_content_int(i, "armsprice_4"); GangInfo[gangid][gArmsPrices][4] = cache_get_field_content_int(i, "armsprice_5"); GangInfo[gangid][gArmsPrices][5] = cache_get_field_content_int(i, "armsprice_6"); GangInfo[gangid][gArmsPrices][6] = cache_get_field_content_int(i, "armsprice_7"); GangInfo[gangid][gArmsPrices][7] = cache_get_field_content_int(i, "armsprice_8"); GangInfo[gangid][gArmsPrices][8] = cache_get_field_content_int(i, "armsprice_9"); GangInfo[gangid][gArmsPrices][9] = cache_get_field_content_int(i, "armsprice_10"); GangInfo[gangid][gArmsPrices][10] = cache_get_field_content_int(i, "armsprice_11"); GangInfo[gangid][gArmsPrices][11] = cache_get_field_content_int(i, "armsprice_12"); GangInfo[gangid][gDrugPrices][0] = cache_get_field_content_int(i, "weed_price"); GangInfo[gangid][gDrugPrices][1] = cache_get_field_content_int(i, "cocaine_price"); GangInfo[gangid][gDrugPrices][2] = cache_get_field_content_int(i, "meth_price"); GangInfo[gangid][gText][0] = Text3D:INVALID_3DTEXT_ID; GangInfo[gangid][gText][1] = Text3D:INVALID_3DTEXT_ID; GangInfo[gangid][gText][2] = Text3D:INVALID_3DTEXT_ID; GangInfo[gangid][gActors][0] = INVALID_ACTOR_ID; GangInfo[gangid][gActors][1] = INVALID_ACTOR_ID; GangInfo[gangid][gPickup] = -1; GangInfo[gangid][gSetup] = 1; ReloadGang(gangid); } printf("[Script] %i gangs loaded.", rows); } case THREAD_LOAD_GANGRANKS: { for(new i = 0; i < MAX_GANGS; i ++) { for(new r = 0; r < 7; r ++) { strcpy(GangRanks[i][r], "Unspecified", 32); } } for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "name", GangRanks[cache_get_field_content_int(i, "id")][cache_get_field_content_int(i, "rank")], connectionID, 32); } } case THREAD_LOAD_GANGSKINS: { for(new i = 0; i < rows; i ++) { GangInfo[cache_get_field_content_int(i, "id")][gSkins][cache_get_field_content_int(i, "slot")] = cache_get_field_content_int(i, "skinid"); } } case THREAD_LOAD_POINTS: { for(new i = 0; i < rows && i < MAX_POINTS; i ++) { new pointid = cache_get_field_content_int(i, "id"); cache_get_field_content(i, "name", PointInfo[pointid][pName], connectionID, 32); cache_get_field_content(i, "capturedby", PointInfo[pointid][pCapturedBy], connectionID, MAX_PLAYER_NAME); PointInfo[pointid][pCapturedGang] = cache_get_field_content_int(i, "capturedgang"); PointInfo[pointid][pType] = cache_get_field_content_int(i, "type"); PointInfo[pointid][pProfits] = cache_get_field_content_int(i, "profits"); PointInfo[pointid][pTime] = cache_get_field_content_int(i, "time"); PointInfo[pointid][pPointX] = cache_get_field_content_float(i, "point_x"); PointInfo[pointid][pPointY] = cache_get_field_content_float(i, "point_y"); PointInfo[pointid][pPointZ] = cache_get_field_content_float(i, "point_z"); PointInfo[pointid][pPointInterior] = cache_get_field_content_int(i, "pointinterior"); PointInfo[pointid][pPointWorld] = cache_get_field_content_int(i, "pointworld"); PointInfo[pointid][pCaptureTime] = 0; PointInfo[pointid][pCapturer] = INVALID_PLAYER_ID; PointInfo[pointid][pText] = Text3D:INVALID_3DTEXT_ID; PointInfo[pointid][pPickup] = -1; PointInfo[pointid][pExists] = 1; if(PointInfo[pointid][pCapturedGang] >= 0 && !GangInfo[PointInfo[pointid][pCapturedGang]][gSetup]) { PointInfo[pointid][pCapturedGang] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET capturedgang = -1 WHERE id = %i", pointid); mysql_tquery(connectionID, queryBuffer); } ReloadPoint(pointid); } printf("[Script] %i points loaded.", rows); } case THREAD_LOAD_TURFS: { for(new i = 0; i < rows && i < MAX_TURFS; i ++) { new turfid = cache_get_field_content_int(i, "id"); cache_get_field_content(i, "name", TurfInfo[turfid][tName], connectionID, 32); cache_get_field_content(i, "capturedby", TurfInfo[turfid][tCapturedBy], connectionID, MAX_PLAYER_NAME); TurfInfo[turfid][tCapturedGang] = cache_get_field_content_int(i, "capturedgang"); TurfInfo[turfid][tType] = cache_get_field_content_int(i, "type"); TurfInfo[turfid][tTime] = cache_get_field_content_int(i, "time"); TurfInfo[turfid][tMinX] = cache_get_field_content_float(i, "min_x"); TurfInfo[turfid][tMinY] = cache_get_field_content_float(i, "min_y"); TurfInfo[turfid][tMaxX] = cache_get_field_content_float(i, "max_x"); TurfInfo[turfid][tMaxY] = cache_get_field_content_float(i, "max_y"); TurfInfo[turfid][tHeight] = cache_get_field_content_float(i, "height"); TurfInfo[turfid][tGangZone] = -1; TurfInfo[turfid][tArea] = -1; TurfInfo[turfid][tCaptureTime] = 0; TurfInfo[turfid][tCapturer] = INVALID_PLAYER_ID; TurfInfo[turfid][tExists] = 1; Iter_Add(Turf, turfid); ReloadTurf(turfid); } printf("[Script] %i turfs loaded.", rows); } case THREAD_LOAD_LOCKERS: { for(new i = 0; i < rows && i < MAX_LOCKERS; i ++) { LockerInfo[i][lID] = cache_get_field_content_int(i, "id"); LockerInfo[i][lFaction] = cache_get_field_content_int(i, "factionid"); LockerInfo[i][lPosX] = cache_get_field_content_float(i, "pos_x"); LockerInfo[i][lPosY] = cache_get_field_content_float(i, "pos_y"); LockerInfo[i][lPosZ] = cache_get_field_content_float(i, "pos_z"); LockerInfo[i][lInterior] = cache_get_field_content_int(i, "interior"); LockerInfo[i][lWorld] = cache_get_field_content_int(i, "world"); LockerInfo[i][lIcon] = cache_get_field_content_int(i, "iconid"); LockerInfo[i][lLabel] = cache_get_field_content_int(i, "label"); LockerInfo[i][locKevlar][0] = cache_get_field_content_int(i, "weapon_kevlar"); LockerInfo[i][locMedKit][0] = cache_get_field_content_int(i, "weapon_medkit"); LockerInfo[i][locNitestick][0] = cache_get_field_content_int(i, "weapon_nitestick"); LockerInfo[i][locMace][0] = cache_get_field_content_int(i, "weapon_mace"); LockerInfo[i][locDeagle][0] = cache_get_field_content_int(i, "weapon_deagle"); LockerInfo[i][locShotgun][0] = cache_get_field_content_int(i, "weapon_shotgun"); LockerInfo[i][locMP5][0] = cache_get_field_content_int(i, "weapon_mp5"); LockerInfo[i][locM4][0] = cache_get_field_content_int(i, "weapon_m4"); LockerInfo[i][locSniper][0] = cache_get_field_content_int(i, "weapon_sniper"); LockerInfo[i][locCamera][0] = cache_get_field_content_int(i, "weapon_camera"); LockerInfo[i][locFireExt][0] = cache_get_field_content_int(i, "weapon_fire_extinguisher"); LockerInfo[i][locPainKillers][0] = cache_get_field_content_int(i, "weapon_painkillers"); LockerInfo[i][locKevlar][1] = cache_get_field_content_int(i, "price_kevlar"); LockerInfo[i][locMedKit][1] = cache_get_field_content_int(i, "price_medkit"); LockerInfo[i][locNitestick][1] = cache_get_field_content_int(i, "price_nitestick"); LockerInfo[i][locMace][1] = cache_get_field_content_int(i, "price_mace"); LockerInfo[i][locDeagle][1] = cache_get_field_content_int(i, "price_deagle"); LockerInfo[i][locShotgun][1] = cache_get_field_content_int(i, "price_shotgun"); LockerInfo[i][locMP5][1] = cache_get_field_content_int(i, "price_mp5"); LockerInfo[i][locM4][1] = cache_get_field_content_int(i, "price_m4"); LockerInfo[i][locSniper][1] = cache_get_field_content_int(i, "price_sniper"); LockerInfo[i][locCamera][1] = cache_get_field_content_int(i, "price_camera"); LockerInfo[i][locFireExt][1] = cache_get_field_content_int(i, "price_fire_extinguisher"); LockerInfo[i][locPainKillers][1] = cache_get_field_content_int(i, "price_painkillers"); LockerInfo[i][lText] = Text3D:INVALID_3DTEXT_ID; LockerInfo[i][lPickup] = -1; LockerInfo[i][lExists] = 1; ReloadLocker(i); } } case THREAD_LOAD_CLOTHING: { for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "name", ClothingInfo[extraid][i][cName], connectionID, 32); ClothingInfo[extraid][i][cID] = cache_get_field_content_int(i, "id"); ClothingInfo[extraid][i][cModel] = cache_get_field_content_int(i, "modelid"); ClothingInfo[extraid][i][cBone] = cache_get_field_content_int(i, "boneid"); ClothingInfo[extraid][i][cAttached] = cache_get_field_content_int(i, "attached"); ClothingInfo[extraid][i][cPosX] = cache_get_field_content_float(i, "pos_x"); ClothingInfo[extraid][i][cPosY] = cache_get_field_content_float(i, "pos_y"); ClothingInfo[extraid][i][cPosZ] = cache_get_field_content_float(i, "pos_z"); ClothingInfo[extraid][i][cRotX] = cache_get_field_content_float(i, "rot_x"); ClothingInfo[extraid][i][cRotY] = cache_get_field_content_float(i, "rot_y"); ClothingInfo[extraid][i][cRotZ] = cache_get_field_content_float(i, "rot_z"); ClothingInfo[extraid][i][cScaleX] = cache_get_field_content_float(i, "scale_x"); ClothingInfo[extraid][i][cScaleY] = cache_get_field_content_float(i, "scale_y"); ClothingInfo[extraid][i][cScaleZ] = cache_get_field_content_float(i, "scale_z"); ClothingInfo[extraid][i][cExists] = 1; ClothingInfo[extraid][i][cAttachedIndex] = -1; } PlayerInfo[extraid][pAwaitingClothing] = 1; } case THREAD_HOUSE_INFORMATION: { new type[16], houseid = GetNearbyHouseEx(extraid); if(HouseInfo[houseid][hType] == -1) { type = "Other"; } else { strcpy(type, houseInteriors[HouseInfo[houseid][hType]][intClass]); } SendClientMessageEx(extraid, COLOR_NAVYBLUE, "_______ House ID %i _______", houseid); SendClientMessageEx(extraid, COLOR_GREY2, "Value: %s - Rent Price: %s - Level: %i/5 - Active: %s - Locked: %s", FormatNumber(HouseInfo[houseid][hPrice]), FormatNumber(HouseInfo[houseid][hRentPrice]), HouseInfo[houseid][hLevel], (gettime() - HouseInfo[houseid][hTimestamp] > 2592000) ? ("{FF6347}No{C8C8C8}") : ("Yes"), (HouseInfo[houseid][hLocked]) ? ("Yes") : ("No")); SendClientMessageEx(extraid, COLOR_GREY2, "Class: %s - Location: %s - Furniture: %i/%i - Tenants: %i/%i", type, GetZoneName(HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ]), cache_get_row_int(0, 0), GetHouseFurnitureCapacity(houseid), cache_get_row_int(0, 1), GetHouseTenantCapacity(houseid)); } case THREAD_COUNT_FURNITURE: { new houseid = GetInsideHouse(extraid); if(cache_get_row_int(0, 0) >= GetHouseFurnitureCapacity(houseid)) { SendClientMessageEx(extraid, COLOR_GREY, "Your house is only allowed up to %i furniture at its current level.", GetHouseFurnitureCapacity(houseid)); } else { ShowDialogToPlayer(extraid, DIALOG_BUYFURNITURETYPE); //ShowDialogToPlayer(extraid, DIALOG_BUYFURNITURE1); } } case THREAD_SELL_FURNITURE: { if(cache_get_row_count(connectionID)) { new name[32], price = percent(cache_get_field_content_int(0, "price"), 75); cache_get_field_content(0, "name", name); GivePlayerCash(extraid, price); SendClientMessageEx(extraid, COLOR_AQUA, "You have sold {FF6347}%s{33CCFF} and received a 75 percent refund of {00AA00}$%i{33CCFF}.", name, price); RemoveFurniture(PlayerInfo[extraid][pSelected]); } } case THREAD_CLEAR_FURNITURE: { if(!rows) { SendClientMessage(extraid, COLOR_GREY, "Your home contains no furniture which can be sold."); } else { new price, houseid = GetInsideHouse(extraid); for(new i = 0; i < rows; i ++) { price += percent(cache_get_field_content_int(i, "price"), 75); } RemoveAllFurniture(houseid); GivePlayerCash(extraid, price); SendClientMessageEx(extraid, COLOR_AQUA, "You have sold a total of %i items and received {00AA00}$%i{33CCFF} back.", rows, price); } } case THREAD_DUPLICATE_FURNITURE: { //name, modelid, price, pos_x, pos_y, pos_z, rot_x, rot_y, rot_z if(cache_get_row_count(connectionID)) { new string[20], name[32], houseid = GetInsideHouse(extraid); new modelid = cache_get_field_content_int(0, "modelid"); new price = cache_get_field_content_int(0, "price"); new Float:x = cache_get_field_content_float(0, "pos_x"); new Float:y = cache_get_field_content_float(0, "pos_y"); new Float:z = cache_get_field_content_float(0, "pos_z"); new Float:rx = cache_get_field_content_float(0, "rot_x"); new Float:ry = cache_get_field_content_float(0, "rot_y"); new Float:rz = cache_get_field_content_float(0, "rot_z"); if(PlayerInfo[extraid][pCash] < price) { SendClientMessage(extraid, COLOR_GREY, "You can't afford to duplicate this furniture."); } else { // INSERT INTO furniture VALUES(null, %i, %i, '%e', %i, '%f', '%f', '%f', '%f', '%f', '%f', %i, %i, 0, 0) PlayerInfo[extraid][pFurnitureHouse] = houseid; cache_get_field_content(0, "name", name); GivePlayerCash(extraid, -price); SendClientMessageEx(extraid, COLOR_GREEN, "%s duplicated for $%i. You will now edit this object.", name, price); format(string, sizeof(string), "~r~-$%i", price); GameTextForPlayer(extraid, string, 5000, 1); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO furniture VALUES(null, %i, %i, '%e', %i, '%f', '%f', '%f', '%f', '%f', '%f', %i, %i, 0, 0)", HouseInfo[houseid][hID], modelid, name, price, x, y, z, rx, ry, rz, GetPlayerInterior(extraid), GetPlayerVirtualWorld(extraid)); mysql_tquery(connectionID, queryBuffer); mysql_tquery(connectionID, "SELECT * FROM furniture WHERE id = LAST_INSERT_ID()", "OnQueryFinished", "ii", THREAD_LOAD_FURNITURE, HouseInfo[houseid][hLabels]); mysql_tquery(connectionID, "SELECT LAST_INSERT_ID() FROM furniture LIMIT 1", "OnQueryFinished", "ii", THREAD_DUPLICATED_FURNITURE, extraid); } } } case THREAD_DUPLICATED_FURNITURE: { if(cache_get_row_count(connectionID)) { new id = cache_get_row_int(0, 0); for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_FURNITURE && Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID) == id) { PlayerInfo[extraid][pEditType] = EDIT_FURNITURE; PlayerInfo[extraid][pEditObject] = i; EditDynamicObject(extraid, i); GameTextForPlayer(extraid, "~w~Editing Mode~n~~g~Click disk to save~n~~r~Press ESC to cancel", 5000, 1); //PlayerInfo[extraid][pSelected] = i; //ShowDialogToPlayer(extraid, DIALOG_LANDOBJECTMENU); break; } } } } case THREAD_COUNT_TEXTS: { rows = cache_get_row_int(0, 0); if(rows) { SendClientMessageEx(extraid, COLOR_YELLOW, "** You have %i unread text messages. (/texts)", rows); } } case THREAD_VIEW_TEXTS: { if(!rows) { SendClientMessage(extraid, COLOR_GREY, "You have no more unread text messages to read."); } else { static listString[4096], sender[MAX_PLAYER_NAME], date[24], message[128]; listString = "Texts sent to you while offline (recent first):\n"; for(new i = 0; i < min(rows, 25); i ++) { cache_get_field_content(i, "sender", sender); cache_get_field_content(i, "date", date); cache_get_field_content(i, "message", message); format(listString, sizeof(listString), "%s\n[%s] SMS from %s (%i): %s", listString, date, sender, cache_get_field_content_int(i, "sender_number"), message); } if(rows > 25) { ShowPlayerDialog(extraid, DIALOG_UNREADTEXTS, DIALOG_STYLE_MSGBOX, "Unread Texts", listString, "Next", "OK"); } else { ShowPlayerDialog(extraid, DIALOG_UNREADTEXTS, DIALOG_STYLE_MSGBOX, "Unread Texts", listString, "OK", ""); } } } case THREAD_LIST_VEHICLES: { if(!rows) { SendClientMessage(extraid, COLOR_GREY, "You own no vehicles which you can spawn."); } else { static string[1024]; string = "#\tModel\tLocation"; for(new i = 0; i < rows; i ++) { format(string, sizeof(string), "%s\n%i\t%s\t%s", string, i + 1, vehicleNames[cache_get_field_content_int(i, "modelid") - 400], (cache_get_field_content_int(i, "world")) ? ("Garage") : (GetZoneName(cache_get_field_content_float(i, "pos_x"), cache_get_field_content_float(i, "pos_y"), cache_get_field_content_float(i, "pos_z")))); } ShowPlayerDialog(extraid, DIALOG_SPAWNCAR, DIALOG_STYLE_TABLIST_HEADERS, "Choose a vehicle to spawn.", string, "Select", "Cancel"); } } case THREAD_CAR_STORAGE: { if(!rows) { SendClientMessage(extraid, COLOR_GREY, "You own no vehicles which you can spawn."); } else { new string[1024], vehicleid; string = "#\tModel\tStatus\tLocation"; for(new i = 0; i < rows; i ++) { if((vehicleid = GetVehicleLinkedID(cache_get_field_content_int(i, "id"))) != INVALID_VEHICLE_ID) format(string, sizeof(string), "%s\n%i\t%s\t{00AA00}Spawned{FFFFFF}\t%s", string, i + 1, vehicleNames[GetVehicleModel(vehicleid) - 400], GetVehicleZoneName(vehicleid)); else format(string, sizeof(string), "%s\n%i\t%s\t{FF6347}Despawned{FFFFFF}\t%s", string, i + 1, vehicleNames[cache_get_field_content_int(i, "modelid") - 400], (cache_get_field_content_int(i, "world")) ? ("Garage") : (GetZoneName(cache_get_field_content_float(i, "pos_x"), cache_get_field_content_float(i, "pos_y"), cache_get_field_content_float(i, "pos_z")))); } ShowPlayerDialog(extraid, DIALOG_CARSTORAGE, DIALOG_STYLE_TABLIST_HEADERS, "Choose a vehicle to (de)spawn.", string, "Select", "Cancel"); } } case THREAD_FACTION_ROSTER: { new username[MAX_PLAYER_NAME], date[24]; SendClientMessage(extraid, COLOR_NAVYBLUE, "_____ Faction Roster _____"); for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "username", username); cache_get_field_content(i, "lastlogin", date); SendClientMessageEx(extraid, COLOR_GREY2, "%s %s - Last Seen: %s", FactionRanks[PlayerInfo[extraid][pFaction]][cache_get_field_content_int(i, "factionrank")], username, date); } } case THREAD_GANG_ROSTER: { new username[MAX_PLAYER_NAME], date[24]; SendClientMessage(extraid, COLOR_NAVYBLUE, "_____ Gang Roster _____"); for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "username", username); cache_get_field_content(i, "lastlogin", date); SendClientMessageEx(extraid, COLOR_GREY2, "[%i] %s %s - Last Seen: %s", cache_get_field_content_int(i, "gangrank"), GangRanks[PlayerInfo[extraid][pGang]][cache_get_field_content_int(i, "gangrank")], username, date); } } case THREAD_VIEW_PHONEBOOK: { if((!rows) && PlayerInfo[extraid][pPage] == 1) { SendClientMessage(extraid, COLOR_GREY, "The phonebook directory is currently empty."); } else { static string[MAX_LISTED_NUMBERS * 32], name[MAX_PLAYER_NAME]; string = "#\tName\tNumber"; for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "name", name); format(string, sizeof(string), "%s\n%i\t%s\t%i", string, ((PlayerInfo[extraid][pPage] - 1) * MAX_LISTED_NUMBERS) + (i + 1), name, cache_get_field_content_int(i, "number")); } if(PlayerInfo[extraid][pPage] > 1) { strcat(string, "\n{FF6347}<< Go back{FFFFFF}"); } if(rows == MAX_LISTED_NUMBERS) { strcat(string, "\n{00AA00}>> Next page{FFFFFF}"); } ShowPlayerDialog(extraid, DIALOG_PHONEBOOK, DIALOG_STYLE_TABLIST_HEADERS, "Phonebook directory", string, "Select", "Close"); } } case THREAD_COUNT_LANDOBJECTS: { new landid = GetNearbyLand(extraid); if(cache_get_row_int(0, 0) >= GetLandObjectCapacity(LandInfo[landid][lLevel])) { SendClientMessageEx(extraid, COLOR_GREY, "You are only only allowed up to %i objects for your land.", GetLandObjectCapacity(LandInfo[landid][lLevel])); } else { ShowDialogToPlayer(extraid, DIALOG_LANDBUILDTYPE); //ShowDialogToPlayer(extraid, DIALOG_LANDBUILD1); } } case THREAD_SELL_LANDOBJECT: { if(cache_get_row_count(connectionID)) { new name[32], price = percent(cache_get_field_content_int(0, "price"), 75); cache_get_field_content(0, "name", name); GivePlayerCash(extraid, price); SendClientMessageEx(extraid, COLOR_AQUA, "You have sold {FF6347}%s{33CCFF} and received a 75 percent refund of {00AA00}$%i{33CCFF}.", name, price); RemoveLandObject(PlayerInfo[extraid][pSelected]); } } case THREAD_DUPLICATE_LANDOBJECT: { //name, modelid, price, pos_x, pos_y, pos_z, rot_x, rot_y, rot_z if(cache_get_row_count(connectionID)) { new string[20], name[32], landid = GetNearbyLand(extraid); new modelid = cache_get_field_content_int(0, "modelid"); new price = cache_get_field_content_int(0, "price"); new Float:x = cache_get_field_content_float(0, "pos_x"); new Float:y = cache_get_field_content_float(0, "pos_y"); new Float:z = cache_get_field_content_float(0, "pos_z"); new Float:rx = cache_get_field_content_float(0, "rot_x"); new Float:ry = cache_get_field_content_float(0, "rot_y"); new Float:rz = cache_get_field_content_float(0, "rot_z"); if(PlayerInfo[extraid][pCash] < price) { SendClientMessage(extraid, COLOR_GREY, "You can't afford to duplicate this object."); } else { PlayerInfo[extraid][pObjectLand] = landid; cache_get_field_content(0, "name", name); GivePlayerCash(extraid, -price); SendClientMessageEx(extraid, COLOR_GREEN, "%s duplicated for $%i. You will now edit this object.", name, price); format(string, sizeof(string), "~r~-$%i", price); GameTextForPlayer(extraid, string, 5000, 1); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO landobjects VALUES(null, %i, %i, '%e', %i, '%f', '%f', '%f', '%f', '%f', '%f', 0, 0, '0.0', '0.0', '0.0', '-1000.0', '-1000.0', '-1000.0')", LandInfo[landid][lID], modelid, name, price, x, y, z, rx, ry, rz); mysql_tquery(connectionID, queryBuffer); mysql_tquery(connectionID, "SELECT * FROM landobjects WHERE id = LAST_INSERT_ID()", "OnQueryFinished", "ii", THREAD_LOAD_LANDOBJECTS, LandInfo[landid][lLabels]); mysql_tquery(connectionID, "SELECT LAST_INSERT_ID() FROM landobjects LIMIT 1", "OnQueryFinished", "ii", THREAD_DUPLICATED_OBJECT, extraid); } } } case THREAD_DUPLICATED_OBJECT: { if(cache_get_row_count(connectionID)) { new id = cache_get_row_int(0, 0); for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_LAND && Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID) == id) { PlayerInfo[extraid][pEditType] = EDIT_LAND_OBJECT; PlayerInfo[extraid][pEditObject] = i; EditDynamicObject(extraid, i); GameTextForPlayer(extraid, "~w~Editing Mode~n~~g~Click disk to save~n~~r~Press ESC to cancel", 5000, 1); //PlayerInfo[extraid][pSelected] = i; //ShowDialogToPlayer(extraid, DIALOG_LANDOBJECTMENU); break; } } } } case THREAD_CLEAR_LANDOBJECTS: { if(!rows) { SendClientMessage(extraid, COLOR_GREY, "Your land contains no furniture which can be sold."); } else { new price, landid = GetNearbyLand(extraid); for(new i = 0; i < rows; i ++) { price += percent(cache_get_field_content_int(i, "price"), 75); } RemoveAllLandObjects(landid); GivePlayerCash(extraid, price); SendClientMessageEx(extraid, COLOR_AQUA, "You have sold a total of %i items and received {00AA00}$%i{33CCFF} back.", rows, price); } } case THREAD_LIST_LANDOBJECTS: { if((!rows) && PlayerInfo[extraid][pPage] == 1) { SendClientMessage(extraid, COLOR_GREY, "Your land contains no objects which can be listed."); } else { static string[MAX_LISTED_OBJECTS * 48], name[32]; string = "#\tName\tCost\tDistance"; for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "name", name); format(string, sizeof(string), "%s\n%i\t%s\t{00AA00}$%i{FFFFFF}\t%.1fm", string, GetLandObjectID(cache_get_field_content_int(i, "id")), name, cache_get_field_content_int(i, "price"), GetPlayerDistanceFromPoint(extraid, cache_get_field_content_float(i, "pos_x"), cache_get_field_content_float(i, "pos_y"), cache_get_field_content_float(i, "pos_z"))); } if(PlayerInfo[extraid][pPage] > 1) { strcat(string, "\n{FF6347}<< Go back{FFFFFF}"); } if(rows == MAX_LISTED_OBJECTS) { strcat(string, "\n{00AA00}>> Next page{FFFFFF}"); } ShowPlayerDialog(extraid, DIALOG_LANDOBJECTS, DIALOG_STYLE_TABLIST_HEADERS, "List of objects", string, "Select", "Back"); } } case THREAD_LAND_MAINMENU: { new landid = GetNearbyLand(extraid), string[64]; format(string, sizeof(string), "Land menu {FFD700}(Level: %i/3) (%i/%i objects)", LandInfo[landid][lLevel], cache_get_row_int(0, 0), GetLandObjectCapacity(LandInfo[landid][lLevel])); ShowPlayerDialog(extraid, DIALOG_LANDMENU, DIALOG_STYLE_LIST, string, "Build object\nEdit object\nToggle labels\nList all objects\nSell all objects\nUpgrade land\nPermissions", "Select", "Cancel"); } case THREAD_LAND_INFORMATION: { new landid = GetNearbyLand(extraid); //SendClientMessage(extraid, COLOR_NAVYBLUE, "_______ My Land _______"); //SendClientMessageEx(extraid, COLOR_GREY2, "(ID: %i) - (Value: $%i) - (Objects: %i/%i) - (Location: %s)", landid, LandInfo[landid][lPrice], cache_get_row_int(0, 0), GetLandObjectCapacity(landid), GetZoneName(LandInfo[landid][lMinX], LandInfo[landid][lMinY], LandInfo[landid][lHeight])); SendClientMessageEx(extraid, COLOR_WHITE, "** Your level %i/3 land in %s is worth {00AA00}%s{FFFFFF} and contains %i/%i objects.", LandInfo[landid][lLevel], GetZoneName(LandInfo[landid][lMinX], LandInfo[landid][lMinY], LandInfo[landid][lHeight]), FormatNumber(LandInfo[landid][lPrice]), cache_get_row_int(0, 0), GetLandObjectCapacity(LandInfo[landid][lLevel])); } case THREAD_LOAD_VEHICLES: { new modelid, Float:pos_x, Float:pos_y, Float:pos_z, Float:pos_a, color1, color2, respawndelay, siren, vehicleid; for(new i = 0; i < rows; i ++) { modelid = cache_get_field_content_int(i, "modelid"), pos_x = cache_get_field_content_float(i, "pos_x"), pos_y = cache_get_field_content_float(i, "pos_y"), pos_z = cache_get_field_content_float(i, "pos_z"), pos_a = cache_get_field_content_float(i, "pos_a"), color1 = cache_get_field_content_int(i, "color1"), color2 = cache_get_field_content_int(i, "color2"), respawndelay = cache_get_field_content_int(i, "respawndelay"); siren = cache_get_field_content_int(i, "siren"); vehicleid = CreateVehicle(modelid, pos_x, pos_y, pos_z, pos_a, color1, color2, respawndelay, siren); if(vehicleid != INVALID_VEHICLE_ID) { ResetVehicle(vehicleid); // Forgot this! VehicleInfo[vehicleid][vID] = cache_get_field_content_int(i, "id"); VehicleInfo[vehicleid][vGang] = cache_get_field_content_int(i, "gangid"); VehicleInfo[vehicleid][vFactionType] = cache_get_field_content_int(i, "factiontype"); VehicleInfo[vehicleid][vRank] = cache_get_field_content_int(i, "rank"); VehicleInfo[vehicleid][vVIP] = cache_get_field_content_int(i, "vippackage"); VehicleInfo[vehicleid][vJob] = cache_get_field_content_int(i, "job"); VehicleInfo[vehicleid][vHealth] = cache_get_field_content_int(i, "health"); if(VehicleInfo[vehicleid][vGang] >= 0) { VehicleInfo[vehicleid][vPrice] = cache_get_field_content_int(i, "price"); VehicleInfo[vehicleid][vLocked] = cache_get_field_content_int(i, "locked"); VehicleInfo[vehicleid][vPaintjob] = cache_get_field_content_int(i, "paintjob"); VehicleInfo[vehicleid][vInterior] = cache_get_field_content_int(i, "interior"); VehicleInfo[vehicleid][vWorld] = cache_get_field_content_int(i, "world"); VehicleInfo[vehicleid][vMods][0] = cache_get_field_content_int(i, "mod_1"); VehicleInfo[vehicleid][vMods][1] = cache_get_field_content_int(i, "mod_2"); VehicleInfo[vehicleid][vMods][2] = cache_get_field_content_int(i, "mod_3"); VehicleInfo[vehicleid][vMods][3] = cache_get_field_content_int(i, "mod_4"); VehicleInfo[vehicleid][vMods][4] = cache_get_field_content_int(i, "mod_5"); VehicleInfo[vehicleid][vMods][5] = cache_get_field_content_int(i, "mod_6"); VehicleInfo[vehicleid][vMods][6] = cache_get_field_content_int(i, "mod_7"); VehicleInfo[vehicleid][vMods][7] = cache_get_field_content_int(i, "mod_8"); VehicleInfo[vehicleid][vMods][8] = cache_get_field_content_int(i, "mod_9"); VehicleInfo[vehicleid][vMods][9] = cache_get_field_content_int(i, "mod_10"); VehicleInfo[vehicleid][vMods][10] = cache_get_field_content_int(i, "mod_11"); VehicleInfo[vehicleid][vMods][11] = cache_get_field_content_int(i, "mod_12"); VehicleInfo[vehicleid][vMods][12] = cache_get_field_content_int(i, "mod_13"); VehicleInfo[vehicleid][vMods][13] = cache_get_field_content_int(i, "mod_14"); ReloadVehicle(vehicleid); } VehicleInfo[vehicleid][vModel] = modelid; VehicleInfo[vehicleid][vPosX] = pos_x; VehicleInfo[vehicleid][vPosY] = pos_y; VehicleInfo[vehicleid][vPosZ] = pos_z; VehicleInfo[vehicleid][vPosA] = pos_a; VehicleInfo[vehicleid][vColor1] = color1; VehicleInfo[vehicleid][vColor2] = color2; VehicleInfo[vehicleid][vRespawnDelay] = respawndelay; VehicleInfo[vehicleid][vObjects][0] = INVALID_OBJECT_ID; VehicleInfo[vehicleid][vObjects][1] = INVALID_OBJECT_ID; VehicleInfo[vehicleid][vTimer] = -1; vehicleFuel[vehicleid] = 100; SetVehicleHealth(vehicleid, VehicleInfo[vehicleid][vHealth]); } } } case THREAD_GANG_INFORMATION: { if(rows) { new count, total; foreach(new i : Turf) { if(TurfInfo[i][tExists]) { if(TurfInfo[i][tCapturedGang] == PlayerInfo[extraid][pGang]) count++; else if(TurfInfo[i][tType] != 8) total++; } } SendClientMessageEx(extraid, COLOR_NAVYBLUE, "______ %s ______", GangInfo[PlayerInfo[extraid][pGang]][gName]); SendClientMessageEx(extraid, COLOR_GREY2, "Leader: %s - Level: %i/3 - Strikes: %i/3 - Members: %i/%i - Vehicles: %i/%i", GangInfo[PlayerInfo[extraid][pGang]][gLeader], GangInfo[PlayerInfo[extraid][pGang]][gLevel], GangInfo[PlayerInfo[extraid][pGang]][gStrikes], cache_get_row_int(0, 0), GetGangMemberLimit(PlayerInfo[extraid][pGang]), GetGangVehicles(PlayerInfo[extraid][pGang]), GetGangVehicleLimit(PlayerInfo[extraid][pGang])); SendClientMessageEx(extraid, COLOR_GREY2, "Gang Points: %s GP - Turf cookies: %s - Cash: $%s/$%s - Materials: %s/%s", FormatNumber(GangInfo[PlayerInfo[extraid][pGang]][gPoints], 0), FormatNumber(GangInfo[PlayerInfo[extraid][pGang]][gTurfcookies], 0), FormatNumber(GangInfo[PlayerInfo[extraid][pGang]][gCash], 0), FormatNumber(GetGangStashCapacity(PlayerInfo[extraid][pGang], STASH_CAPACITY_CASH), 0), FormatNumber(GangInfo[PlayerInfo[extraid][pGang]][gMaterials], 0), FormatNumber(GetGangStashCapacity(PlayerInfo[extraid][pGang], STASH_CAPACITY_MATERIALS), 0)); SendClientMessageEx(extraid, COLOR_GREY2, "Turfs: %i/%i - Weed: %i/%ig - Cocaine: %i/%ig - Meth: %i/%ig - Painkillers: %i/%i", count, total, GangInfo[PlayerInfo[extraid][pGang]][gWeed], GetGangStashCapacity(PlayerInfo[extraid][pGang], STASH_CAPACITY_WEED), GangInfo[PlayerInfo[extraid][pGang]][gCocaine], GetGangStashCapacity(PlayerInfo[extraid][pGang], STASH_CAPACITY_COCAINE), GangInfo[PlayerInfo[extraid][pGang]][gMeth], GetGangStashCapacity(PlayerInfo[extraid][pGang], STASH_CAPACITY_METH), GangInfo[PlayerInfo[extraid][pGang]][gPainkillers], GetGangStashCapacity(PlayerInfo[extraid][pGang], STASH_CAPACITY_PAINKILLERS)); } } case THREAD_OFFLINE_IP: { if(!rows) { SendClientMessage(extraid, COLOR_GREY, "The username specified is not registered."); } else { new username[MAX_PLAYER_NAME], ip[16]; cache_get_field_content(0, "username", username); cache_get_field_content(0, "ip", ip); if((cache_get_field_content_int(0, "adminlevel") > 2) && (PlayerInfo[extraid][pAdmin])) { SendClientMessage(extraid, COLOR_GREY, "You cannot check the IP of another admin"); } else { SendClientMessageEx(extraid, COLOR_WHITE, "** %s's IP: %s **", username, ip); } } } case THREAD_CHECK_REFERRAL: { if(!rows) { SendClientMessage(extraid, COLOR_GREY, "The player specified doesn't exist."); ShowDialogToPlayer(extraid, DIALOG_REFERRAL); } else { new username[MAX_PLAYER_NAME], ip[16]; cache_get_field_content(0, "username", username); cache_get_field_content(0, "ip", ip); if(!strcmp(GetPlayerIP(extraid), ip)) { SendClientMessage(extraid, COLOR_GREY, "This account is listed under your own IP address. You can't refer yourself."); ShowDialogToPlayer(extraid, DIALOG_REFERRAL); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET referral_uid = %i WHERE uid = %i", cache_get_field_content_int(0, "uid"), PlayerInfo[extraid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[extraid][pTutorial] = 0; PlayerInfo[extraid][pSetup] = 0; HideTutorialTextDraws(extraid); SetPlayerSkin(extraid, PlayerInfo[extraid][pSkin]); SetPlayerPos(extraid, 1763.0375, -1383.5703, 15.7578); SetPlayerFacingAngle(extraid, 90.0000); SetPlayerVirtualWorld(extraid, 0); SetCameraBehindPlayer(extraid); StopAudioStreamForPlayer(extraid); TogglePlayerControllable(extraid, 1); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET setup = 0, gender = %i, age = %i, skin = %i WHERE uid = %i", PlayerInfo[extraid][pGender], PlayerInfo[extraid][pAge], PlayerInfo[extraid][pSkin], PlayerInfo[extraid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(extraid, COLOR_WHITE, "Welcome to {FF1AFF}Emerald City Roleplay{FFFFFF}. Make sure to visit ecrp.h0v1n8.nl for news and updates."); SendClientMessage(extraid, COLOR_WHITE, "Use the {FFFF90}/gps{FFFFFF} command to point to locations of jobs, businesses, and common places."); SendStaffMessage(COLOR_YELLOW, "OnPlayerSpawn: %s[%d] has just spawned on Emerald City Roleplay for the first time!", GetPlayerRPName(extraid), extraid); ShowPlayerDialog(extraid, DIALOG_NEWBWELCOME, DIALOG_STYLE_MSGBOX, "{FFFFFF}Welcome to {FF1AFF}Emerald City Roleplay", "Would you like a helper to show you around?", "Yes", "No"); //PlayerInfo[extraid][pTutorialTimer] = SetTimerEx("TutorialTimer", 14000, false, "ii", extraid, 1); PlayerInfo[extraid][pReferralUID] = cache_get_field_content_int(0, "uid"); SendClientMessageEx(extraid, COLOR_YELLOW, "You have chosen %s as your referral. This player will be rewarded once you reach level 3.", username); //SendClientMessage(extraid, COLOR_YELLOW, "That's all the information we need right now. The tutorial will start in just a moment."); } } } case THREAD_REWARD_REFERRER: { if(rows) { new username[MAX_PLAYER_NAME], ip[16], referralid = INVALID_PLAYER_ID; cache_get_field_content(0, "username", username); cache_get_field_content(0, "ip", ip); // Add a log entry for this referral. Log_Write("log_referrals", "%s (uid: %i) (IP: %s) has received 10 cookies for referring %s (uid: %i) (IP: %s).", username, PlayerInfo[extraid][pReferralUID], ip, GetPlayerNameEx(extraid), PlayerInfo[extraid][pID], GetPlayerIP(extraid)); // Check to see if any of the players online match the player's referral UID. foreach(new i : Player) { if(i != extraid && PlayerInfo[i][pLogged] && PlayerInfo[i][pID] == PlayerInfo[extraid][pReferralUID]) { referralid = i; break; } } // Referrer is online. if(referralid != INVALID_PLAYER_ID && strcmp(GetPlayerIP(referralid), GetPlayerIP(extraid)) != 0) { PlayerInfo[referralid][pCookies] += 10; SendClientMessage(referralid, COLOR_GREEN, "A player who you've referred reached level 3. Therefore you received 10 cookies!"); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s (IP: %s) earned 10 cookies for referring %s (IP: %s).", GetPlayerRPName(referralid), GetPlayerIP(referralid), GetPlayerRPName(extraid), GetPlayerIP(extraid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = cookies + 10 WHERE uid = %i AND ip != '%s'", PlayerInfo[extraid][pReferralUID], GetPlayerIP(extraid)); mysql_tquery(connectionID, queryBuffer); } else { // Referrer is offline. Let's give them their cookies and increment refercount which sends them an alert on login! mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = cookies + 10, refercount = refercount + 1 WHERE uid = %i AND ip != '%s'", PlayerInfo[extraid][pReferralUID], GetPlayerIP(extraid)); mysql_tquery(connectionID, queryBuffer); } // Finally, remove the player's link to the referrer as the prize has been given. mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET referral_uid = 0 WHERE uid = %i", PlayerInfo[extraid][pID]); mysql_tquery(connectionID, queryBuffer); } } case THREAD_LIST_FLAGGED: { new flags[MAX_PLAYERS], username[MAX_PLAYER_NAME], targetid; SendClientMessage(extraid, COLOR_NAVYBLUE, "_____ Flagged Players _____"); for(new i = 0; i < rows; i ++) { cache_get_row(i, 0, username); if(IsPlayerOnline(username, targetid)) { flags[targetid]++; } } foreach(new i : Player) { if(flags[i] > 0) { SendClientMessageEx(extraid, COLOR_GREY3, "** %s[%i] has %i active flags.", GetPlayerRPName(i), i, flags[i]); } } } case THREAD_LIST_ACHIEVEMENTS: { static string[2048]; new achieved[sizeof(achievementInfo)], achievement[32], title[64], count; string = "Name\tDescription\tStatus"; for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "achievement", achievement); for(new x = 0; x < sizeof(achievementInfo); x ++) { if(!strcmp(achievementInfo[x][aName], achievement, true)) { achieved[x] = true; count++; } } } for(new i = 0; i < sizeof(achievementInfo); i ++) { if(achieved[i]) format(string, sizeof(string), "%s\n%s\t%s\t{00AA00}Unlocked{FFFFFF}", string, achievementInfo[i][aName], achievementInfo[i][aDescription]); else format(string, sizeof(string), "%s\n%s\t%s\t{ED6464}Locked{FFFFFF}", string, achievementInfo[i][aName], achievementInfo[i][aDescription]); } format(title, sizeof(title), "Achievements (%i/%i unlocked)", count, sizeof(achievementInfo)); ShowPlayerDialog(extraid, 0, DIALOG_STYLE_TABLIST_HEADERS, title, string, "OK", ""); } case THREAD_LIST_ADMINS: { new username[MAX_PLAYER_NAME], lastlogin[24]; SendClientMessage(extraid, COLOR_GREEN, "---- Admin Team ----"); for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "username", username); cache_get_field_content(i, "lastlogin", lastlogin); SendClientMessageEx(extraid, COLOR_GREY2, "Level %i Admin %s - Last Seen: %s", cache_get_field_content_int(i, "adminlevel"), username, lastlogin); } } case THREAD_DUPLICATE_LANDOBJ: { if(cache_get_row_int(0, 0) >= GetLandObjectCapacity(LandInfo[PlayerInfo[extraid][pObjectLand]][lLevel])) { SendClientMessageEx(extraid, COLOR_GREY, "You are only only allowed up to %i objects for your land.", GetLandObjectCapacity(LandInfo[PlayerInfo[extraid][pObjectLand]][lLevel])); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT name, modelid, price, pos_x, pos_y, pos_z, rot_x, rot_y, rot_z FROM landobjects WHERE id = %i", Streamer_GetExtraInt(PlayerInfo[extraid][pSelected], E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_DUPLICATE_LANDOBJECT, extraid); } } case THREAD_CHECKDUPE_FURNITURE: { new houseid = GetInsideHouse(extraid); if(cache_get_row_int(0, 0) >= GetHouseFurnitureCapacity(houseid)) { SendClientMessageEx(extraid, COLOR_GREY, "You are only only allowed up to %i objects for your house.", GetHouseFurnitureCapacity(houseid)); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT name, modelid, price, pos_x, pos_y, pos_z, rot_x, rot_y, rot_z FROM furniture WHERE id = %i", Streamer_GetExtraInt(PlayerInfo[extraid][pSelected], E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_DUPLICATE_FURNITURE, extraid); } } case THREAD_LOAD_LOCATIONS: { for(new i = 0; i < rows && i < MAX_LOCATIONS; i ++) { cache_get_field_content(i, "name", LocationInfo[i][locName], connectionID, 64); LocationInfo[i][locID] = cache_get_field_content_int(i, "id"); LocationInfo[i][locPosX] = cache_get_field_content_float(i, "pos_x"); LocationInfo[i][locPosY] = cache_get_field_content_float(i, "pos_y"); LocationInfo[i][locPosZ] = cache_get_field_content_float(i, "pos_z"); LocationInfo[i][locExists] = true; } printf("[Script] %i locations loaded", (rows < MAX_LOCATIONS) ? (rows) : (MAX_LOCATIONS)); } case THREAD_UPDATE_LANDLABELS: { new landid = extraid; new string[128]; if(IsValidDynamic3DTextLabel(LandInfo[landid][lTextdraw])) { if(LandInfo[landid][lOwnerID] > 0) { format(string, sizeof(string), "This land is owned by %s\n{FFD700}Level: %i/3\n{FFFFFF}%i/%i Objects", LandInfo[landid][lOwner], LandInfo[landid][lLevel], cache_get_row_int(0, 0), GetLandObjectCapacity(LandInfo[landid][lLevel])); UpdateDynamic3DTextLabelText(LandInfo[landid][lTextdraw], COLOR_GREY, string); } else { format(string, sizeof(string), "This land is for sale by the state\n{00AA00}Price: %s{FFFFFF}\n{FFD700}Level: %i/3\n{FFFFFF}%i/%i Objects", FormatNumber(LandInfo[landid][lPrice]), LandInfo[landid][lLevel], cache_get_row_int(0, 0), GetLandObjectCapacity(LandInfo[landid][lLevel])); UpdateDynamic3DTextLabelText(LandInfo[landid][lTextdraw], COLOR_GREY, string); } } } case THREAD_LOAD_CREWS: { for(new i = 0; i < MAX_GANGS; i ++) { for(new r = 0; r < MAX_GANG_CREWS; r ++) { GangCrews[i][r][0] = 0; } } for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "name", GangCrews[cache_get_field_content_int(i, "id")][cache_get_field_content_int(i, "crewid")], connectionID, 32); } printf("[Script] %i crews loaded", rows); } case THREAD_LIST_VIPS: { new username[MAX_PLAYER_NAME], lastlogin[24], viplevel, viptime; SendClientMessage(extraid, COLOR_VIP, "---- VIP List ----"); for(new i = 0; i < rows; i ++) { cache_get_field_content(i, "username", username); cache_get_field_content(i, "lastlogin", lastlogin); viplevel = cache_get_field_content_int(i, "vippackage"); viptime = cache_get_field_content_int(i, "viptime"); SendClientMessageEx(extraid, COLOR_GREY2, "[%i] {D909D9}%s VIP{C8C8C8} %s - Last Seen: %s - Expires: %s", viplevel, GetVIPRank(viplevel), username, lastlogin, GetDateFromTimestamp(viptime, 4)); } } case THREAD_LOAD_ATMS: { for(new i = 0; i < rows && i < MAX_ATMS; i ++) { AtmInfo[i][aID] = cache_get_field_content_int(i, "id"); AtmInfo[i][aPosX] = cache_get_field_content_float(i, "pos_x"); AtmInfo[i][aPosY] = cache_get_field_content_float(i, "pos_y"); AtmInfo[i][aPosZ] = cache_get_field_content_float(i, "pos_z"); AtmInfo[i][aPosA] = cache_get_field_content_float(i, "pos_r"); AtmInfo[i][aExists] = true; ReloadAtm(i); } printf("[Script] %i atms loaded", (rows < MAX_ATMS) ? (rows) : (MAX_ATMS)); } case THREAD_REMOVE_VIP: { printf("[Script] %i vips removed.", rows); } case THREAD_LOAD_PLAYERBACKPACK: { new szField[64]; for(new i = 0; i < rows && i < MAX_BACKPACKS; i ++) { BackpackInfo[i][bBackpackOwner] = -1; BackpackInfo[i][bBackpackSize] = 0; BackpackInfo[i][bHouseStored] = 0; BackpackInfo[i][bVehicleStored] = 0; BackpackInfo[i][bCash] = 0; BackpackInfo[i][bPot] = 0; BackpackInfo[i][bCrack] = 0; BackpackInfo[i][bMats] = 0; for(new weaponid; weaponid= 0 && (ReportInfo[PlayerInfo[i][pActiveReport]][rHandledBy] == playerid || ReportInfo[PlayerInfo[i][pActiveReport]][rReporter] == playerid)) { if(ReportInfo[PlayerInfo[i][pActiveReport]][rReporter] == playerid) SendClientMessage(i, COLOR_GREEN, "The player who made the report has left the server."); else if(ReportInfo[PlayerInfo[i][pActiveReport]][rHandledBy] == playerid) SendClientMessage(i, COLOR_GREEN, "The admin who accepted the report has left the server."); ReportInfo[PlayerInfo[i][pActiveReport]][rExists] = 0; PlayerInfo[i][pActiveReport] = -1; } /*if(PlayerInfo[i][pDueling] == playerid) { SendClientMessage(i, COLOR_WHITE, "Your duel target has left the server."); PlayerInfo[i][pDueling] = INVALID_PLAYER_ID; SetPlayerToSpawn(i); }*/ if(PlayerInfo[i][pContractTaken] == playerid) { SendClientMessage(i, COLOR_YELLOW, "Your contract target has disconnected from the server."); PlayerInfo[i][pContractTaken] = INVALID_PLAYER_ID; } if(PlayerInfo[i][pDraggedBy] == playerid) { SendClientMessage(i, COLOR_AQUA, "The person dragging you has disconnected. You are free!"); PlayerInfo[i][pDraggedBy] = INVALID_PLAYER_ID; } if(PlayerInfo[i][pTaxiPassenger] == playerid) { CancelTaxiRide(i); } if(PlayerInfo[i][pCallLine] == playerid) { HangupCall(PlayerInfo[i][pCallLine], HANGUP_DROPPED); } } if(PlayerInfo[playerid][pLogged]) { if(PlayerInfo[playerid][pUndercover][0]) { OnUndercover(playerid, 0, "", 0, 0.0, 0.0); } if(PlayerInfo[playerid][pHurt]) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s possibly left the server while in a gunfight.", GetPlayerRPName(playerid)); PlayerInfo[playerid][pInjured] = 1; } SavePlayerVariables(playerid); if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pCuffed] > 0) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s left the server while tazed or cuffed.", GetPlayerRPName(playerid)); ResetPlayerWeaponsEx(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET jailtype = 2, jailtime = 1200, prisonedby = 'Server', prisonreason = 'Logging to avoid arrest' WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } } if(PlayerInfo[playerid][pActiveReport] >= 0) { callcmd::cr(playerid, "\1"); } if(PlayerInfo[playerid][pHunted]) { SendClientMessageToAllEx(COLOR_LIGHTORANGE, "(( The hunted AIDS victim %s has left the server ))", GetPlayerRPName(playerid)); } if(PlayerInfo[playerid][pAcceptedEMS] != INVALID_PLAYER_ID) { SendClientMessageEx(PlayerInfo[playerid][pAcceptedEMS], COLOR_YELLOW, "Your patient %s has left the server while injured.", GetPlayerRPName(playerid)); PlayerInfo[playerid][pAcceptedEMS] = INVALID_PLAYER_ID; } foreach(new i : Player) { if(PlayerInfo[i][pAcceptedEMS] == playerid) { SendClientMessage(i, COLOR_YELLOW, "Your medic has left the server while rescuing you. (you can now accept your fate)"); PlayerInfo[i][pAcceptedEMS] = INVALID_PLAYER_ID; } } if(PlayerInfo[playerid][pTutorial]) { KillTimer(PlayerInfo[playerid][pTutorialTimer]); } if(IsValidDynamicObject(PlayerInfo[playerid][pEditObject])) { DestroyDynamicObject(PlayerInfo[playerid][pEditObject]); } if(IsValidDynamic3DTextLabel(PlayerInfo[playerid][pSpecialTag])) { DestroyDynamic3DTextLabel(PlayerInfo[playerid][pSpecialTag]); } if(IsValidDynamicObject(PlayerInfo[playerid][pBombObject])) { DestroyDynamicObject(PlayerInfo[playerid][pBombObject]); } if(IsValidDynamicObject(PlayerInfo[playerid][pWeedObject])) { DestroyDynamicObject(PlayerInfo[playerid][pWeedObject]); } if(PlayerInfo[playerid][pLockBreak] != INVALID_VEHICLE_ID) { CancelBreakIn(playerid); } if(PlayerInfo[playerid][pAdminDuty]) { SetPlayerName(playerid, PlayerInfo[playerid][pUsername]); } if(PlayerInfo[playerid][pBoomboxPlaced]) { DestroyBoombox(playerid); } if(PlayerInfo[playerid][pZoneID] >= 0) { GangZoneDestroy(PlayerInfo[playerid][pZoneID]); } if(RobberyInfo[rPlanning] || RobberyInfo[rStarted]) { RemoveFromBankRobbery(playerid); } for(new i = 0; i < 4; i ++) { if(IsValidDynamicPickup(PlayerInfo[playerid][pZonePickups][i])) { DestroyDynamicPickup(PlayerInfo[playerid][pZonePickups][i]); } } if(PlayerInfo[playerid][pLogged]) { foreach(new i: Vehicle) { if(IsVehicleOwner(playerid, i) && VehicleInfo[i][vTimer] == -1) { VehicleInfo[i][vTimer] = SetTimerEx("DespawnTimer", 600000, false, "i", i); } } } for(new i = 0; i < MAX_REPORTS; i ++) { if(ReportInfo[i][rExists] && ReportInfo[i][rReporter] == playerid) { ReportInfo[i][rExists] = 0; } } for(new i = 0; i < MAX_POINTS; i ++) { if(PointInfo[i][pExists] && PointInfo[i][pCaptureTime] > 0 && PointInfo[i][pCapturer] == playerid) { SendProximityMessage(i, 20.0, COLOR_RED, "(( %s disconnected and therefore failed to capture the point. ))", GetPlayerRPName(playerid)); PointInfo[i][pCapturer] = INVALID_PLAYER_ID; PointInfo[i][pCaptureTime] = 0; } } foreach(new i : Turf) { if(TurfInfo[i][tExists] && TurfInfo[i][tCaptureTime] > 0 && TurfInfo[i][tCapturer] == playerid) { if(reason == 0) { if(PlayerInfo[playerid][pGang] >= 0) { GangInfo[PlayerInfo[playerid][pGang]][gTurfcookies]++; SendGangMessage(PlayerInfo[playerid][pGang], COLOR_YELLOW, "%s crashed while attempting to capture a turf. 1 turf cookie was refunded to your gang.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET turfcookies = turfcookies + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } else if(PlayerInfo[playerid][pFaction] >= 0) { FactionInfo[PlayerInfo[playerid][pFaction]][fTurfcookies]++; SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_YELLOW, "%s crashed while attempting to capture a turf. 1 turf cookie was refunded to your faction.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET turfcookies = turfcookies + 1 WHERE id = %i", PlayerInfo[playerid][pFaction]); mysql_tquery(connectionID, queryBuffer); } } SendTurfMessage(i, COLOR_RED, "(( %s disconnected and therefore failed to capture the turf. ))", GetPlayerRPName(playerid)); TurfInfo[i][tCapturer] = INVALID_PLAYER_ID; TurfInfo[i][tCaptureTime] = 0; ReloadTurf(i); } } switch(reason) { case 0: SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "%s has left the server. (Timeout)", GetPlayerRPName(playerid)); case 1: SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "%s has left the server. (Leaving)", GetPlayerRPName(playerid)); case 2: SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "%s has left the server. (Kicked)", GetPlayerRPName(playerid)); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM shots WHERE (playerid = %i) OR (hitid = %i AND hittype = 1)", playerid, playerid); mysql_tquery(connectionID, queryBuffer); return 1; } public OnPlayerRequestClass(playerid, classid) { if(PlayerInfo[playerid][pKicked]) return 0; if(IsPlayerNPC(playerid)) return 1; if(!PlayerInfo[playerid][pLogged]) { ClearChat(playerid); TogglePlayerSpectating(playerid, 1); SetPlayerColor(playerid, 0xFFFFFF00); SetPlayerTeam(playerid, NO_TEAM); // Due to a SA-MP bug, you can't apply camera coordinates directly after enabling spectator mode (to hide HUD). // In this case we'll use a timer to defer this action. #if defined SERVER_INTRO ShowMainMenuCamera(playerid, 1); #else SetTimerEx("ShowMainMenuCamera", 400, false, "i", playerid); #endif } return 1; } public OnPlayerSpawn(playerid) { if(PlayerInfo[playerid][pKicked]) return 0; foreach(new i : Player) { if(PlayerInfo[i][pSpectating] == playerid) { SetTimerEx("SpectateUpdate", 1000, false, "ii", i, playerid); } } LoadPlayerBackpack(playerid); //TextDrawHideForPlayer(playerid, ); if(PlayerInfo[playerid][pSetup]) { if(PlayerInfo[playerid][pTutorial]) { KillTimer(PlayerInfo[playerid][pTutorialTimer]); PlayerInfo[playerid][pTutorial] = 0; } ShowDialogToPlayer(playerid, DIALOG_GENDER); StopAudioStreamForPlayer(playerid); SendClientMessage(playerid, COLOR_WHITE, "Welcome to {FF1AFF}Emerald City Roleplay{FFFFFF}. You have successfully registered your account on our server."); SendClientMessage(playerid, COLOR_WHITE, "Before you can play, you are required to fill in some information then watch a brief tutorial."); } else if(PlayerInfo[playerid][pJailTime] > 0) { SetPlayerInJail(playerid); if(PlayerInfo[playerid][pJailType] == 2) { SendClientMessageEx(playerid, COLOR_LIGHTRED, "** You were placed in admin prison by %s, reason: %s", PlayerInfo[playerid][pPrisonedBy], PlayerInfo[playerid][pPrisonReason]); } else { SendClientMessage(playerid, COLOR_LIGHTRED, "** You haven't completed your jail sentence yet."); } } /*else if(PlayerInfo[playerid][pPaintball] > 0) { SetPlayerInPaintball(playerid, PlayerInfo[playerid][pPaintball]); }*/ else { PlayerInfo[playerid][pJoinedEvent] = 0; if(PlayerInfo[playerid][pInjured]) { SetPlayerHealth(playerid, 100.0); SetPlayerArmour(playerid, 0.0); ApplyAnimation(playerid, "PED", "KO_skid_front", 4.1, 0, 0, 0, 1, 0, 1); GameTextForPlayer(playerid, "~r~Injured~n~~w~/call 911 or~n~/accept death", 5000, 3); SendClientMessage(playerid, COLOR_DOCTOR, "You are injured and losing blood. /call 911 for medical attention."); SendClientMessage(playerid, COLOR_DOCTOR, "If you wish to accept your death and go to hospital use /accept death."); } else if(PlayerInfo[playerid][pHospital]) { if(PlayerInfo[playerid][pInsurance] == 0) SetPlayerInHospital(playerid); else SetPlayerInHospital(playerid, .type = PlayerInfo[playerid][pInsurance]); ResetPlayerWeaponsEx(playerid); } else { SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]); SetScriptArmour(playerid, PlayerInfo[playerid][pArmor]); } if(!PlayerInfo[playerid][pHospital]) { /*if(PlayerInfo[playerid][pDueling] != INVALID_PLAYER_ID) { PlayerInfo[PlayerInfo[playerid][pDueling]][pDueling] = INVALID_PLAYER_ID; PlayerInfo[playerid][pDueling] = INVALID_PLAYER_ID; }*/ if(PlayerInfo[playerid][pInterior] || PlayerInfo[playerid][pWorld]) { SetTimerEx("StreamedCheck", 1000, false, "ifffii", playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], PlayerInfo[playerid][pInterior], PlayerInfo[playerid][pWorld]); } SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]); SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPosA]); SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]); SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pWorld]); SetPlayerWeapons(playerid); if(!PlayerInfo[playerid][pInterior] && PlayerInfo[playerid][pLoginCamera] && !PlayerInfo[playerid][pToggleCam]) { SetPlayerCameraLookAt(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]); SetPlayerCameraPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ] + 100.0); TogglePlayerControllable(playerid, 0); SetTimerEx("GrandTheftAutoV", 2000, false, "iifffffff", playerid, 1, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ], PlayerInfo[playerid][pPosA], PlayerInfo[playerid][pCameraX], PlayerInfo[playerid][pCameraY], PlayerInfo[playerid][pCameraZ]); PlayerInfo[playerid][pLoginCamera] = 0; } else { SetCameraBehindPlayer(playerid); } } } SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightStyle]); SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 998); SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 998); SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 998); SetPlayerClothing(playerid); PreloadPlayerAnims(playerid); RefreshPlayerTextdraws(playerid); // here SetTimerEx("UpdateTDS", 1000, true, "i", playerid); if(PlayerInfo[playerid][pLoseReason] == REASON_ALL || PlayerInfo[playerid][pLoseReason] == REASON_HUNGER || PlayerInfo[playerid][pLoseReason] == REASON_THIRST) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } if(PlayerInfo[playerid][pHasTimer]) { KillTimer(PlayerInfo[playerid][pTimer][0]); KillTimer(PlayerInfo[playerid][pTimer][1]); PlayerInfo[playerid][pHasTimer] = false; } PlayerInfo[playerid][pTimer][0] = SetTimerEx("HungerTimer", 900000, true, "i", playerid); // 5 min PlayerInfo[playerid][pTimer][1] = SetTimerEx("ThirstTimer", 600000, true, "i", playerid); // 4 mins return 1; } forward UpdateTDS(playerid); public UpdateTDS(playerid) { if(!PlayerInfo[playerid][pToggleTextdraws]) { new h[25], t[25]; format(h, sizeof(h), "%i", PlayerInfo[playerid][pHunger]); PlayerTextDrawSetString(playerid, pHungerTD[playerid], h); format(t, sizeof(t), "%i", PlayerInfo[playerid][pThirst]); PlayerTextDrawSetString(playerid, pThirstTD[playerid], t); } return 1; } forward HungerTimer(playerid); public HungerTimer(playerid) { if(PlayerInfo[playerid][pInjured] != 1 && !PlayerInfo[playerid][pJoinedEvent] && PlayerInfo[playerid][pJailTime] == 0 && !PlayerInfo[playerid][pAdminDuty]) { new Float: hp, reason = PlayerInfo[playerid][pLoseReason]; GetPlayerHealth(playerid, hp); if(hp>0) // he's not dead { PlayerInfo[playerid][pHasTimer] = true; if(PlayerInfo[playerid][pHunger] > 0) // He still has hunger level { if(reason == REASON_HUNGER) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } PlayerInfo[playerid][pHunger]--; } else { if(PlayerInfo[playerid][pHunger] == 0 && PlayerInfo[playerid][pThirst] != 0) { if(reason != REASON_HUNGER) { if(reason != -1) KillTimer(PlayerInfo[playerid][pLoseHealth]); PlayerInfo[playerid][pLoseHealth] = SetTimerEx("LoseHealth", 240000, true, "ii", playerid, 5 ); PlayerInfo[playerid][pLoseReason] = REASON_HUNGER; if(!PlayerInfo[playerid][pInformed]) { SendClientMessage(playerid, COLOR_EAT, "You have to eat."); PlayerInfo[playerid][pInformed] = true; } } } else if(PlayerInfo[playerid][pHunger] == 0 && PlayerInfo[playerid][pThirst] == 0) { if(reason != REASON_ALL) { if(reason != -1) KillTimer(PlayerInfo[playerid][pLoseHealth]); PlayerInfo[playerid][pLoseHealth] = SetTimerEx("LoseHealth", 240000, true, "ii", playerid, 10 ); PlayerInfo[playerid][pLoseReason] = REASON_ALL; if(!PlayerInfo[playerid][pInformed]) { PlayerInfo[playerid][pInformed] = true; } } } } if(PlayerInfo[playerid][pThirst] == 0 && PlayerInfo[playerid][pHunger] != 0 ) // he will lose health because of thirst only { if(reason != REASON_THIRST) { if(reason != -1) KillTimer(PlayerInfo[playerid][pLoseHealth]); PlayerInfo[playerid][pLoseHealth] = SetTimerEx("LoseHealth", 240000, true, "ii", playerid, 5 ); PlayerInfo[playerid][pLoseReason] = REASON_THIRST; if(!PlayerInfo[playerid][pInformed]) { SendClientMessage(playerid, COLOR_EAT, "You have to Drink."); PlayerInfo[playerid][pInformed] = true; } } } } } return 1; } forward LoseHealth(playerid, dmg); public LoseHealth(playerid, dmg) { if(PlayerInfo[playerid][pInjured] != 1 && !PlayerInfo[playerid][pJoinedEvent] && PlayerInfo[playerid][pJailTime] == 0) { new reason = PlayerInfo[playerid][pLoseReason]; if(reason != -1) { new Float: hp; GetPlayerHealth(playerid, hp); SetPlayerHealth(playerid, hp-dmg); } else KillTimer(PlayerInfo[playerid][pLoseHealth]); } return 1; } forward ThirstTimer(playerid); public ThirstTimer(playerid) { if(PlayerInfo[playerid][pInjured] != 1 && !PlayerInfo[playerid][pJoinedEvent] && PlayerInfo[playerid][pJailTime] == 0 && !PlayerInfo[playerid][pAdminDuty]) { new Float: hp, reason = PlayerInfo[playerid][pLoseReason]; GetPlayerHealth(playerid, hp); if(hp>0) // he's not dead { PlayerInfo[playerid][pHasTimer] = true; if(PlayerInfo[playerid][pThirst] > 0) // He still has thirst level { if(reason == REASON_THIRST) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } PlayerInfo[playerid][pThirst]--; } } } return 1; } public OnPlayerDeath(playerid, killerid, reason) { if((gettime() - PlayerInfo[playerid][pLastDeath]) < 2) { return 1; } foreach(new i : Player) { if(PlayerInfo[i][pAdmin] >= 1 || PlayerInfo[i][pAdminDuty]) { if(PlayerInfo[playerid][pInjured] == 0) { SendDeathMessageToPlayer(i, killerid, playerid, reason); } } } if(PlayerInfo[playerid][pLogged]) { if(PlayerInfo[playerid][pJoinedEvent]) { foreach(new i : Player) { if(PlayerInfo[i][pJoinedEvent] && !PlayerInfo[playerid][pHunted]) { if(killerid == INVALID_PLAYER_ID) SendClientMessageEx(i, COLOR_LIGHTORANGE, "(( %s died. ))", GetPlayerRPName(playerid)); else SendClientMessageEx(i, COLOR_LIGHTORANGE, "(( %s was killed by %s. ))", GetPlayerRPName(playerid), GetPlayerRPName(killerid)); } } if(PlayerInfo[playerid][pHunted]) { if(killerid == INVALID_PLAYER_ID) { SendClientMessageToAllEx(COLOR_LIGHTORANGE, "(( Our dear friend %s has died of vicious AIDS, may he rest in piece. ))", GetPlayerRPName(playerid)); } else { SendClientMessageToAllEx(COLOR_LIGHTORANGE, "(( Our dear friend %s was slain by %s, may he rest in piece. ))", GetPlayerRPName(playerid), GetPlayerRPName(killerid)); SendClientMessageEx(killerid, COLOR_AQUA, "You have slain the hunted %s, you have been flagged for a prize.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, 'Server', NOW(), 'Allhunt winner')", PlayerInfo[killerid][pID]); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: Server flagged %s's account for 'Allhunt winner'.", GetPlayerRPName(killerid)); } PlayerInfo[playerid][pHunted] = 0; } } /*else if(PlayerInfo[playerid][pPaintball] > 0) { foreach(new i : Player) { if(PlayerInfo[playerid][pPaintball] == PlayerInfo[i][pPaintball]) { if(killerid == INVALID_PLAYER_ID) SendClientMessageEx(i, COLOR_LIGHTORANGE, "(( %s died. ))", GetPlayerRPName(playerid)); else SendClientMessageEx(i, COLOR_LIGHTORANGE, "(( %s was killed by %s. ))", GetPlayerRPName(playerid), GetPlayerRPName(killerid)); } } } else if(PlayerInfo[playerid][pDueling] != INVALID_PLAYER_ID) { new entranceid = GetInsideEntrance(playerid); SendClientMessageEx(playerid, COLOR_LIGHTORANGE, "(( You lost your duel against %s! ))", GetPlayerRPName(PlayerInfo[playerid][pDueling])); if(killerid != INVALID_PLAYER_ID) { SendClientMessageEx(killerid, COLOR_LIGHTORANGE, "(( You won the duel against %s! ))", GetPlayerRPName(playerid)); if(entranceid >= 0 && EntranceInfo[entranceid][eType] == 1) { foreach(new i : Player) { if(GetInsideEntrance(i) == entranceid) { SendClientMessageEx(i, COLOR_YELLOW, "Duel Arena: %s has won their duel against %s.", GetPlayerRPName(killerid), GetPlayerRPName(playerid)); } } } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has won their duel against %s.", GetPlayerRPName(killerid), GetPlayerRPName(playerid)); } SetPlayerWeapons(killerid); SetPlayerToSpawn(killerid); } }*/ else { if(killerid != INVALID_PLAYER_ID) { HandleContract(playerid, killerid); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pJailType] == 0 && PlayerInfo[playerid][pPreviewHouse] == -1) { if(PlayerInfo[playerid][pInjured] == 0) { ResetPlayer(playerid); PlayerInfo[playerid][pInjured] = 1; foreach(new i : Player) { if(GetFactionType(i) == FACTION_MEDIC) { SendClientMessageEx(i, COLOR_GREY, "Dispatch: Beacon %s (%i) is in need of immediate medical assistance.", GetPlayerRPName(playerid), playerid); } } } else { PlayerInfo[playerid][pInjured] = 0; PlayerInfo[playerid][pHospital] = 1; if(PlayerInfo[playerid][pAcceptedEMS] != INVALID_PLAYER_ID) { SendClientMessageEx(PlayerInfo[playerid][pAcceptedEMS], COLOR_YELLOW, "Your patient %s has bled out.", GetPlayerRPName(playerid)); PlayerInfo[playerid][pAcceptedEMS] = INVALID_PLAYER_ID; } } } else { PlayerInfo[playerid][pHealth] = 32767.0; } if(killerid != INVALID_PLAYER_ID) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO kills VALUES(null, %i, %i, '%s', '%s', '%s', NOW())", PlayerInfo[killerid][pID], PlayerInfo[playerid][pID], GetPlayerNameEx(killerid), GetPlayerNameEx(playerid), GetDeathReason(reason)); mysql_tquery(connectionID, queryBuffer); } GetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]); GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPosA]); PlayerInfo[playerid][pInterior] = GetPlayerInterior(playerid); PlayerInfo[playerid][pWorld] = GetPlayerVirtualWorld(playerid); } } if(PlayerInfo[playerid][pCallLine] != INVALID_PLAYER_ID) { HangupCall(PlayerInfo[playerid][pCallLine], HANGUP_DROPPED); } if(IsValidDynamic3DTextLabel(PlayerInfo[playerid][pMaskLabel])) DestroyDynamic3DTextLabel(PlayerInfo[playerid][pMaskLabel]); PlayerInfo[playerid][pMask] = 0; PlayerInfo[playerid][pMaskID] = -1; PlayerInfo[playerid][pMaskOn] = false; if(reason == 50 && killerid != INVALID_PLAYER_ID) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] was helibladed by %s[%i].", GetPlayerRPName(playerid), playerid, GetPlayerRPName(killerid), killerid); } if(killerid != INVALID_PLAYER_ID) { gTotalKills++; } gTotalDeaths++; SaveServerInfo(); PlayerInfo[playerid][pLastDeath] = gettime(); return 1; } public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger) { IsPlayerSteppingInVehicle[playerid] = vehicleid; if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z + 0.5); ClearAnimations(playerid); } if((!ispassenger) && (PlayerInfo[playerid][pCuffed] || PlayerInfo[playerid][pTied] || PlayerInfo[playerid][pInjured])) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z + 0.5); ClearAnimations(playerid); } if(!ispassenger) { if((pizzaVehicles[0] <= vehicleid <= pizzaVehicles[5]) && !PlayerHasJob(playerid, JOB_PIZZAMAN)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Pizzaman."); ClearAnimations(playerid); } if((courierVehicles[0] <= vehicleid <= courierVehicles[3]) && !PlayerHasJob(playerid, JOB_COURIER)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Courier."); ClearAnimations(playerid); } if((sweeperVehicles[0] <= vehicleid <= sweeperVehicles[3]) && !PlayerHasJob(playerid, JOB_SWEEPER)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Street Sweeper."); ClearAnimations(playerid); } if((taxiVehicles[0] <= vehicleid <= taxiVehicles[3]) && !PlayerHasJob(playerid, JOB_TAXIDRIVER)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Taxi Driver."); ClearAnimations(playerid); } if((garbageVehicles[0] <= vehicleid <= garbageVehicles[5]) && !PlayerHasJob(playerid, JOB_GARBAGEMAN)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Garbage Man."); ClearAnimations(playerid); } if((testVehicles[0] <= vehicleid <= testVehicles[4]) && !PlayerInfo[playerid][pDrivingTest]) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not taking your drivers test."); ClearAnimations(playerid); } if(VehicleInfo[vehicleid][vFactionType] != FACTION_NONE && GetFactionType(playerid) != VehicleInfo[vehicleid][vFactionType]) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as it doesn't belong to your faction."); ClearAnimations(playerid); } else if(VehicleInfo[vehicleid][vFactionType] != FACTION_NONE && VehicleInfo[vehicleid][vRank] > PlayerInfo[playerid][pFactionRank]) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot operate this vehicle as you aren't a rank %i in your faction.", VehicleInfo[vehicleid][vRank]); ClearAnimations(playerid); } if(VehicleInfo[vehicleid][vGang] >= 0 && PlayerInfo[playerid][pGang] != VehicleInfo[vehicleid][vGang]) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as it doesn't belong to your gang."); ClearAnimations(playerid); } else if(VehicleInfo[vehicleid][vGang] >= 0 && VehicleInfo[vehicleid][vRank] > PlayerInfo[playerid][pGangRank]) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot operate this vehicle as you aren't a rank %i in your gang.", VehicleInfo[vehicleid][vRank]); ClearAnimations(playerid); } if(VehicleInfo[vehicleid][vJob] >= 0 && PlayerInfo[playerid][pJob] != VehicleInfo[vehicleid][vJob]) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a %s.", GetJobName(VehicleInfo[vehicleid][vJob])); ClearAnimations(playerid); } if(VehicleInfo[vehicleid][vVIP] > 0 && PlayerInfo[playerid][pVIPPackage] < VehicleInfo[vehicleid][vVIP]) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a %s VIP+.", GetVIPRank(VehicleInfo[vehicleid][vVIP])); ClearAnimations(playerid); } } return 1; } public OnPlayerEnterCheckpoint(playerid) { switch(PlayerInfo[playerid][pCP]) { case CHECKPOINT_PIZZA: { new string[32], amount; amount = 100 + random(50); // varies from 100 to 150 if(gettime() - PlayerInfo[playerid][pLastPizza] < 15 && PlayerInfo[playerid][pAdmin] < 2 && !PlayerInfo[playerid][pKicked]) { PlayerInfo[playerid][pACWarns]++; if(PlayerInfo[playerid][pACWarns] < MAX_ANTICHEAT_WARNINGS) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly teleport pizza delivering (time: %i).", GetPlayerRPName(playerid), playerid, gettime() - PlayerInfo[playerid][pLastPizza]); } else { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Teleport pizza runs", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Teleport pizza runs"); } } if(PlayerInfo[playerid][pLaborUpgrade] > 0) { amount += percent(amount, PlayerInfo[playerid][pLaborUpgrade]); } format(string, sizeof(string), "~g~+$%i", amount); GameTextForPlayer(playerid, string, 5000, 1); GivePlayerMoney(playerid, amount); PlayerInfo[playerid][pPizzas] = 0; PlayerInfo[playerid][pPizzaTime] = 0; PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; SendClientMessageEx(playerid, COLOR_AQUA, "You were paid {00AA00}$%i{33CCFF} for delivering a Banana Pizza. ", amount); DisablePlayerCheckpoint(playerid); } case CHECKPOINT_TEST: { PlayerInfo[playerid][pTestCP]++; if(PlayerInfo[playerid][pTestCP] < sizeof(drivingTestCPs)) { if(!(testVehicles[0] <= GetPlayerVehicleID(playerid) <= testVehicles[4])) { SendClientMessage(playerid, COLOR_LIGHTRED, "** You failed the test as you exited your vehicle."); DisablePlayerCheckpoint(playerid); SetVehicleToRespawn(PlayerInfo[playerid][pTestVehicle]); PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; PlayerInfo[playerid][pDrivingTest] = 0; } else { SetPlayerCheckpoint(playerid, drivingTestCPs[PlayerInfo[playerid][pTestCP]][0], drivingTestCPs[PlayerInfo[playerid][pTestCP]][1], drivingTestCPs[PlayerInfo[playerid][pTestCP]][2], 3.0); } } else { new Float:health; GetVehicleHealth(PlayerInfo[playerid][pTestVehicle], health); if(health < 900.0) { GameTextForPlayer(playerid, "~r~Failed", 5000, 1); SendClientMessage(playerid, COLOR_LIGHTRED, "** You brought back the vehicle damaged and therefore failed your test."); } else { AwardAchievement(playerid, "Legal driver"); GameTextForPlayer(playerid, "~w~Passed!~n~~r~-$500", 5000, 1); SendClientMessage(playerid, COLOR_AQUA, "You successfully passed your drivers test and received your license!"); GivePlayerCash(playerid, -500); PlayerInfo[playerid][pCarLicense] = 1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET carlicense = 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } DisablePlayerCheckpoint(playerid); SetVehicleToRespawn(PlayerInfo[playerid][pTestVehicle]); PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; PlayerInfo[playerid][pDrivingTest] = 0; } } case CHECKPOINT_MINING: { new cost, string[20]; if(PlayerInfo[playerid][pMiningRock] == 1) cost = 23 + random(15); else if(PlayerInfo[playerid][pMiningRock] == 2) cost = 37 + random(10); else if(PlayerInfo[playerid][pMiningRock] == 3) { new rock = random(552); switch(rock) { case 0..250: { //cost = 1295 + random(50); cost = 250 + random(70); // varies from 250 to 320 SendClientMessageEx(playerid, COLOR_WHITE, "Bam, a great stone indeed, the fact you can find stuff in this dump makes me wonder whether theres a diamond hidden in there somewhere."); } case 251..380: { //cost = 3495 + random(200); cost = 300 + random(80); // varies from 300 to 380 SendClientMessage(playerid, COLOR_WHITE, "Looks like a ruby, awesome. I'll be sending this Mining Enterprises immediately."); } case 381..400: { //cost = 12595 + random(2000); cost = 350 + random(90); // varies from 350 to 440 AwardAchievement(playerid, "Diamond!"); SendClientMessage(playerid, COLOR_WHITE, "BINGO!, It's a freakin' diamond, we're going to be damn rich!"); SendClientMessage(playerid, COLOR_WHITE, "Boss: You know what? since you found it, you should get to keep it."); PlayerInfo[playerid][pDiamonds] ++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET diamonds = %i WHERE uid = %i", PlayerInfo[playerid][pDiamonds], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } case 401..552: { cost = 400 + random(100); // varies from 400 to 500 SendClientMessage(playerid, COLOR_WHITE, "Looks like you've found a sapphire, damn good job. Let's go for that diamond!"); } } PlayerInfo[playerid][pRareTime] = 600; // 10 mins //SendClientMessage(playerid, COLOR_GREY, "A cooldown for 60 minutes (of playtime) has been applied. Until then you can't find anymore rare stones."); } if(PlayerInfo[playerid][pLaborUpgrade] > 0) { cost += percent(cost, PlayerInfo[playerid][pLaborUpgrade]); } AddToPaycheck(playerid, cost); SendClientMessageEx(playerid, COLOR_AQUA, "You have earned {00AA00}$%i{33CCFF} on your paycheck for your mined rock.", cost); ApplyAnimation(playerid, "CARRY", "putdwn", 4.1, 0, 0, 0, 0, 0, 1); format(string, sizeof(string), "~g~+$%i", cost); GameTextForPlayer(playerid, string, 5000, 1); PlayerInfo[playerid][pMiningRock] = 0; PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; SetPlayerSpecialAction(playerid, SPECIAL_ACTION_NONE); RemovePlayerAttachedObject(playerid, 9); DisablePlayerCheckpoint(playerid); } case CHECKPOINT_MATS: { //if((PlayerInfo[playerid][pSmuggleMats] == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, 2173.2129, -2264.1548, 13.3467)) || (PlayerInfo[playerid][pSmuggleMats] == 2 && IsPlayerInRangeOfPoint(playerid, 3.0, 2288.0918, -1105.6555, 37.9766))) if((PlayerInfo[playerid][pSmuggleMats] == 1 && IsPlayerInRangeOfPoint(playerid, 3.0, 1198.9027,246.9536,19.5547)) || (PlayerInfo[playerid][pSmuggleMats] == 2 && IsPlayerInRangeOfPoint(playerid, 3.0, 2288.0918, -1105.6555, 37.9766)) || (PlayerInfo[playerid][pSmuggleMats] == 3 && IsPlayerInRangeOfPoint(playerid, 20.0, 29.0318,-1399.3555,1.7680)) || (PlayerInfo[playerid][pSmuggleMats] == 4 && (IsPlayerInRangeOfPoint(playerid, 30.0, -1368.1206,-203.7393,14.1484) || IsPlayerInRangeOfPoint(playerid,30.0,310.8307,2033.6459,17.6406) || IsPlayerInRangeOfPoint(playerid,30.0,401.2192,2502.6482,16.4844) || IsPlayerInRangeOfPoint(playerid,30.0,1582.8756,1356.8186,10.8556) || IsPlayerInRangeOfPoint(playerid,30.0,1574.8552,1505.5690,10.8361)))) { if(gettime() - PlayerInfo[playerid][pSmuggleTime] < 20 && PlayerInfo[playerid][pAdmin] < 2 && !PlayerInfo[playerid][pKicked]) { PlayerInfo[playerid][pACWarns]++; if(PlayerInfo[playerid][pACWarns] < MAX_ANTICHEAT_WARNINGS) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly teleport matrunning (time: %i).", GetPlayerRPName(playerid), playerid, gettime() - PlayerInfo[playerid][pSmuggleTime]); } else { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Teleport matrun", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Teleport matrun"); } } if(PlayerInfo[playerid][pMaterials] + 250 > GetPlayerCapacity(playerid, CAPACITY_MATERIALS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i materials. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMaterials], GetPlayerCapacity(playerid, CAPACITY_MATERIALS)); } if(PlayerInfo[playerid][pSmuggleMats] == 1) { AddPointMoney(POINT_MATFACTORY1, 75); } else { AddPointMoney(POINT_MATFACTORY2, 75); } if(PlayerInfo[playerid][pGang] >= 0) { GiveGangPoints(PlayerInfo[playerid][pGang], 1); } if(IsPlayerInAnyVehicle(playerid)) { PlayerInfo[playerid][pDedication] = 0; } if(PlayerInfo[playerid][pDedication]) { AwardAchievement(playerid, "Dedication"); } if(PlayerInfo[playerid][pSmuggleMats] == 1) { AddPointMoney(POINT_MATFACTORY1, 75); PlayerInfo[playerid][pMaterials] += 250; SendClientMessage(playerid, COLOR_AQUA, "You have dropped off your load and collected 250 materials from the depot."); }else if (PlayerInfo[playerid][pSmuggleMats] == 2) { AddPointMoney(POINT_MATFACTORY2, 75); PlayerInfo[playerid][pMaterials] += 250; SendClientMessage(playerid, COLOR_AQUA, "You have dropped off your load and collected 250 materials from the depot."); } else if (PlayerInfo[playerid][pSmuggleMats] == 3) { PlayerInfo[playerid][pMaterials] += 350; SendClientMessage(playerid, COLOR_AQUA, "You have dropped off your load and collected 350 materials from the depot."); } else if (PlayerInfo[playerid][pSmuggleMats] == 4) { PlayerInfo[playerid][pMaterials] += 650; SendClientMessage(playerid, COLOR_AQUA, "You have dropped off your load and collected 650 materials from the depot."); } if(PlayerInfo[playerid][pSmuggleMats] > 0 && PlayerInfo[playerid][pVIPPackage] >= 3) { PlayerInfo[playerid][pMaterials] += 250; SendClientMessage(playerid, COLOR_AQUA, "You've earned 250 more materials for being a {D909D9}Legendary VIP"); } PlayerInfo[playerid][pSmuggleMats] = 0; PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; //SendClientMessage(playerid, COLOR_AQUA, "You have dropped off your load and collected 250 materials from the depot."); DisablePlayerCheckpoint(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } } case CHECKPOINT_DRUGS: { //new amount = 500 + (GetJobLevel(playerid, JOB_DRUGDEALER) * 250); new amount = 400 + (GetJobLevel(playerid, JOB_DRUGDEALER) * 100); switch(PlayerInfo[playerid][pSmuggleDrugs]) { case 1: { if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2167.7371, -1670.6298, 15.0804)) { return SendClientMessage(playerid, COLOR_GREY, "You aren't at the correct dropoff spot."); } if(gSeedsStock >= 1000) { return SendClientMessage(playerid, COLOR_GREY, "The drug den does not need anymore seeds."); } gSeedsStock += 10; GivePlayerCash(playerid, amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have earned {00AA00}$%i{33CCFF} for your delivery of marijuana seeds.", amount); } case 2: { if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2349.7727, -1169.6304, 28.0243)) { return SendClientMessage(playerid, COLOR_GREY, "You aren't at the correct dropoff spot."); } if(gCocaineStock >= 500) { return SendClientMessage(playerid, COLOR_GREY, "The crack house does not need anymore cocaine."); } gCocaineStock += 10; GivePlayerCash(playerid, amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have earned {00AA00}$%i{33CCFF} for your delivery of cocaine.", amount); } case 3: { if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2167.7371, -1670.6298, 15.0804)) { return SendClientMessage(playerid, COLOR_GREY, "You aren't at the correct dropoff spot."); } if(gEphedrineStock >= 250) { return SendClientMessage(playerid, COLOR_GREY, "The drug den does not need anymore ephedrine."); } gEphedrineStock += 10; GivePlayerCash(playerid, amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have earned {00AA00}$%i{33CCFF} for your delivery of raw ephedrine.", amount); } } if(gettime() - PlayerInfo[playerid][pSmuggleTime] < 60 && PlayerInfo[playerid][pAdmin] < 2) { PlayerInfo[playerid][pACWarns]++; if(PlayerInfo[playerid][pACWarns] < MAX_ANTICHEAT_WARNINGS) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly teleport drug smuggling (time: %i).", GetPlayerRPName(playerid), playerid, gettime() - PlayerInfo[playerid][pSmuggleTime]); } else if(!PlayerInfo[playerid][pKicked]) { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Teleport drug smuggling", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Teleport drug smuggling"); } } else { if(PlayerInfo[playerid][pGang] >= 0) { GiveGangPoints(PlayerInfo[playerid][pGang], 1); } } PlayerInfo[playerid][pSmuggleDrugs] = 0; PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; DisablePlayerCheckpoint(playerid); IncreaseJobSkill(playerid, JOB_DRUGDEALER); } case CHECKPOINT_HOUSE: { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s has entered the house.", GetPlayerRPName(playerid)); SetPlayerPos(playerid, HouseInfo[PlayerInfo[playerid][pInviteHouse]][hIntX], HouseInfo[PlayerInfo[playerid][pInviteHouse]][hIntY], HouseInfo[PlayerInfo[playerid][pInviteHouse]][hIntZ]); SetPlayerFacingAngle(playerid, HouseInfo[PlayerInfo[playerid][pInviteHouse]][hIntA]); SetPlayerInterior(playerid, HouseInfo[PlayerInfo[playerid][pInviteHouse]][hInterior]); SetPlayerVirtualWorld(playerid, HouseInfo[PlayerInfo[playerid][pInviteHouse]][hWorld]); SetCameraBehindPlayer(playerid); PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; DisablePlayerCheckpoint(playerid); } case CHECKPOINT_ROBBERY: { if(IsPlayerInBankRobbery(playerid) && PlayerInfo[playerid][pRobCash] > 0) { if(gettime() - PlayerInfo[playerid][pLastLoad] < 60 && PlayerInfo[playerid][pAdmin] < 2) { SendClientMessage(playerid, COLOR_GREY, "Robbery failed. You arrived at the checkpoint too fast."); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] arrived to the bank robbery checkpoint too fast.", GetPlayerRPName(playerid), playerid); } else { if(PlayerInfo[playerid][pGang] >= 0) { GiveGangPoints(PlayerInfo[playerid][pGang], 50); } RobberyInfo[rStolen] += PlayerInfo[playerid][pRobCash]; GivePlayerCash(playerid, PlayerInfo[playerid][pRobCash]); SendClientMessageEx(playerid, COLOR_AQUA, "You have earned {00AA00}$%i{33CCFF} for successfully completing the bank robbery.", PlayerInfo[playerid][pRobCash]); } RemoveFromBankRobbery(playerid); } PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; DisablePlayerCheckpoint(playerid); } case CHECKPOINT_DROPCAR: { new vehicleid = GetPlayerVehicleID(playerid); if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle."); } if(IsVehicleOwner(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't drop off your own vehicle."); } if(!GetVehicleCranePrice(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle is not worth anything."); } if(VehicleInfo[vehicleid][vID] > 0 && IsPointInRangeOfPoint(VehicleInfo[vehicleid][vPosX], VehicleInfo[vehicleid][vPosY], VehicleInfo[vehicleid][vPosZ], 300.0, 2695.8010, -2226.6643, 13.5501)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle is parked too close to the crane. You can't deliver it."); } if(gettime() - PlayerInfo[playerid][pDropTime] < 10 && PlayerInfo[playerid][pAdmin] < 2) { PlayerInfo[playerid][pACWarns]++; if(PlayerInfo[playerid][pACWarns] < MAX_ANTICHEAT_WARNINGS) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly teleport car delivering (time: %i).", GetPlayerRPName(playerid), playerid, gettime() - PlayerInfo[playerid][pDropTime]); } else if(!PlayerInfo[playerid][pKicked]) { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Teleport delivering", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Teleport delivering"); } } new money = GetVehicleCranePrice(vehicleid); GivePlayerCash(playerid, money); AddPointMoney(POINT_AUTOEXPORT, money / 3); switch(GetJobLevel(playerid, JOB_THIEF)) { case 1: { PlayerInfo[playerid][pThiefCooldown] = 900; SendClientMessageEx(playerid, COLOR_AQUA, "You have earned {00AA00}$%i{33CCFF} for your %s. Your cooldown time is 15 minutes.", money, GetVehicleName(vehicleid)); } case 2: { PlayerInfo[playerid][pThiefCooldown] = 720; SendClientMessageEx(playerid, COLOR_AQUA, "You have earned {00AA00}$%i{33CCFF} for your %s. Your cooldown time is 12 minutes.", money, GetVehicleName(vehicleid)); } case 3: { PlayerInfo[playerid][pThiefCooldown] = 540; SendClientMessageEx(playerid, COLOR_AQUA, "You have earned {00AA00}$%i{33CCFF} for your %s. Your cooldown time is 9 minutes.", money, GetVehicleName(vehicleid)); } case 4: { PlayerInfo[playerid][pThiefCooldown] = 420; SendClientMessageEx(playerid, COLOR_AQUA, "You have earned {00AA00}$%i{33CCFF} for your %s. Your cooldown time is 7 minutes.", money, GetVehicleName(vehicleid)); } case 5: { PlayerInfo[playerid][pThiefCooldown] = 300; SendClientMessageEx(playerid, COLOR_AQUA, "You have earned {00AA00}$%i{33CCFF} for your %s. Your cooldown time is 5 minutes.", money, GetVehicleName(vehicleid)); } } IncreaseJobSkill(playerid, JOB_THIEF); SetVehicleToRespawn(vehicleid); PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; DisablePlayerCheckpoint(playerid); } case CHECKPOINT_GARBAGE: { if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 408 && GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You need to be driving a Trashmaster."); } if(PlayerInfo[playerid][pGarbage] == 1) { GameTextForPlayer(playerid, "Loading Garbage....~n~Please wait.", 5000, 3); TogglePlayerControllable(playerid, 0); SetTimerEx("garbagewait", 5000, false, "i", playerid); DisablePlayerCheckpoint(playerid); PlayerInfo[playerid][pGarbage] = 2; SetPlayerCheckpoint(playerid, -89.2605,1160.8628,19.7422, 5.0); } if(PlayerInfo[playerid][pGarbage] == 2) { if(IsPlayerInRangeOfPoint(playerid, 5.0, -89.2605,1160.8628,19.7422)) { GameTextForPlayer(playerid, "Loading Garbage....~n~Please wait.", 5000, 3); TogglePlayerControllable(playerid, 0); SetTimerEx("garbagewait", 5000, false, "i", playerid); DisablePlayerCheckpoint(playerid); PlayerInfo[playerid][pGarbage] = 3; SetPlayerCheckpoint(playerid, -159.4072,1125.5530,19.7422, 5.0); } } if(PlayerInfo[playerid][pGarbage] == 3) { if(IsPlayerInRangeOfPoint(playerid, 5.0, -159.4072,1125.5530,19.7422)) { GameTextForPlayer(playerid, "Loading Garbage....~n~Please wait..", 5000, 3); TogglePlayerControllable(playerid, 0); SetTimerEx("garbagewait", 5000, false, "i", playerid); DisablePlayerCheckpoint(playerid); PlayerInfo[playerid][pGarbage] = 4; SetPlayerCheckpoint(playerid, -223.1108,1165.0017,19.7422, 5.0); } } if(PlayerInfo[playerid][pGarbage] == 4) { if(IsPlayerInRangeOfPoint(playerid, 5.0, -223.1108,1165.0017,19.7422)) { GameTextForPlayer(playerid, "Loading Garbage....~n~Please wait.", 5000, 3); TogglePlayerControllable(playerid, 0); SetTimerEx("garbagewait", 5000, false, "i", playerid); DisablePlayerCheckpoint(playerid); PlayerInfo[playerid][pGarbage] = 5; SetPlayerCheckpoint(playerid, 379.1042,886.5302,20.3975, 5.0); } } if(PlayerInfo[playerid][pGarbage] == 5) { if(IsPlayerInRangeOfPoint(playerid, 5.0, 379.1042,886.5302,20.3975)) { GameTextForPlayer(playerid, "Unloading Garbage....~n~Please wait.", 5000, 3); PlayerInfo[playerid][pGarbage] = 0; DisablePlayerCheckpoint(playerid); //new amount = 8500 + random(500); new amount = 400 + random(200); // varies from 400 to 600 PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] + amount; SendClientMessageEx(playerid, COLOR_AQUA, "Paycheck: You've earned $%i for your time working as a garbage man.", amount); PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cash = %i WHERE uid = %i", PlayerInfo[playerid][pCash], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } } } case CHECKPOINT_FARMER: { // created by someone else, unable to find original author. if(IsPlayerInRangeOfPoint(playerid, 10, -118.5861,97.2261,2.6873)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -109.4636,151.4172,2.9154, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -109.4636,151.4172,2.9154)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -127.0414,100.6100,2.6820, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -127.0414,100.6100,2.6820)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -135.4882,100.8177,2.6702, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -135.4882,100.8177,2.6702)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -118.5093,151.9468,3.1054, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -118.5093,151.9468,3.1054)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -126.4733,157.0845,3.6166, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -126.4733,157.0845,3.6166)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -144.0907,103.8081,2.7379, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -144.0907,103.8081,2.7379)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -152.6201,106.8605,2.7777, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -152.6201,106.8605,2.7777)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -135.0274,158.2204,4.1446, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -135.0274,158.2204,4.1446)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -143.7601,161.6512,4.8706, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -143.7601,161.6512,4.8706)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -160.1486,111.0322,2.8456, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -160.1486,111.0322,2.8456)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -168.9906,111.9079,2.8820, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -168.9906,111.9079,2.8820)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -150.9419,163.3034,5.3583, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -150.9419,163.3034,5.3583)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -159.2065,166.9300,6.4034, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -159.2065,166.9300,6.4034)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -176.2486,119.2714,3.0064, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -176.2486,119.2714,3.0064)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -184.6142,120.2215,3.0207, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -184.6142,120.2215,3.0207)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -166.3747,170.5458,7.4192, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -166.3747,170.5458,7.4192)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -176.9094,172.9636,8.0759, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -176.9094,172.9636,8.0759)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -191.9097,127.0431,3.2947, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -191.9097,127.0431,3.2947)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -200.5103,130.6894,3.0409, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -200.5103,130.6894,3.0409)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -184.7874,173.6687,8.2101, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -184.7874,173.6687,8.2101)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -191.9845,175.8390,8.2817, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -191.9845,175.8390,8.2817)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -206.7612,138.3951,3.2673, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -206.7612,138.3951,3.2673)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -214.1526,142.0226,3.0600, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -214.1526,142.0226,3.0600)) { DisablePlayerCheckpoint(playerid); SetPlayerCheckpoint(playerid, -201.9578,173.9965,7.6670, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -201.9578,173.9965,7.6670)) { new vehicleid = GetPlayerVehicleID(playerid); new amount = Random(100, 350); DisablePlayerCheckpoint(playerid); SendClientMessageEx(playerid, COLOR_AQUA,"FARM: You've harvested the field and made $%i from selling the crops.", amount); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); SetVehicleToRespawn(vehicleid); Harvesting[playerid] = 0; PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; GivePlayerCash(playerid, amount); } //===FSHARE===// /*if(IsPlayerInRangeOfPoint(playerid, 10, -335.1576,-1030.4205,59.1934)) { DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, COLOR_GREY, "FARMER: Well done! You got 4 More checkpoints to go."); SetPlayerCheckpoint(playerid, -1111.2207,-1619.7231,76.3672, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -1111.2207,-1619.7231,76.367)) { DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, COLOR_GREY, "FARMER: Well done! You got 3 More checkpoints to go."); SetPlayerCheckpoint(playerid, -414.3708,-1754.7161,6.4640, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -414.3708,-1754.7161,6.4640)) { DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, COLOR_GREY, "FARMER: Well done! You got 2 More checkpoints to go."); SetPlayerCheckpoint(playerid, -579.6287,-1468.8931,10.5009, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -579.6287,-1468.8931,10.5009)) { DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, COLOR_GREY, "FARMER: Well done! You got 1 More checkpoints to go."); SetPlayerCheckpoint(playerid, -382.5363,-1426.1783,26.2084, 10); } if(IsPlayerInRangeOfPoint(playerid, 10, -382.5363,-1426.1783,26.2084)) { new vehicleid = GetPlayerVehicleID(playerid); DisablePlayerCheckpoint(playerid); SendClientMessage(playerid, COLOR_GREY, "FARMER: Well done farmer! Here is your reward. You deserve it."); SendClientMessage(playerid, COLOR_PURPLE,"FARMER: You gained 2000$ from farm sharing."); PlayerPlaySound(playerid, 1058, 0.0, 0.0, 0.0); SetVehicleToRespawn(vehicleid); GivePlayerMoney(playerid, 2000);// you can change the money. }*/ } default: { PlayerInfo[playerid][pCP] = CHECKPOINT_NONE; DisablePlayerCheckpoint(playerid); } } return 1; } public OnPlayerPickUpDynamicPickup(playerid, pickupid) { if(pickupid == gPaycheck && IsPlayerInRangeOfPoint(playerid, 5.0, 1667.4180, -972.4201, 683.6855)) { if(PlayerInfo[playerid][pPaycheck] > 0) { new string[20]; format(string, sizeof(string), "~g~+$%i", PlayerInfo[playerid][pPaycheck]); GameTextForPlayer(playerid, string, 5000, 1); GivePlayerCash(playerid, PlayerInfo[playerid][pPaycheck]); PlayerPlaySound(playerid, 1150, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET paycheck = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[playerid][pPaycheck] = 0; } } if(PlayerInfo[playerid][pVIPPackage] > 0) { if(pickupid == gVIPHealth) { SetPlayerHealth(playerid, 100.0); } else if(pickupid == gVIPArmor) { SetScriptArmour(playerid, 100.0); } } if(gParachutes[0] <= pickupid <= gParachutes[1]) { GivePlayerWeaponEx(playerid, 46); } return 1; } public OnPlayerStreamIn(playerid, forplayerid) { if(IsValidDynamic3DTextLabel(PlayerInfo[playerid][pSpecialTag])) { ShowPlayerNameTagForPlayer(forplayerid, playerid, 0); } else { ShowPlayerNameTagForPlayer(forplayerid, playerid, 1); } if(PlayerInfo[playerid][pMaskOn]) { ShowPlayerNameTagForPlayer(forplayerid, playerid, 0); } else ShowPlayerNameTagForPlayer(forplayerid, playerid, 1); return 1; } public OnPlayerStreamOut(playerid, forplayerid) { ShowPlayerNameTagForPlayer(forplayerid, playerid, 1); return 1; } public OnVehicleStreamOut(vehicleid, forplayerid) { return 1; } public OnPlayerClickPlayer(playerid, clickedplayerid, source) { return 1; } //------------------------All car that are allowed to mod------------------------------------------------------------ // Put here all car's id's yo want to be modable // NOTE: DO NOT TRY TO ALLOW OR MOD BOATS ; PLANES OR OTHER NON CARS.THAT WIL CAUSE YOUR SERVER CRASH forward ModCar(playerid); public ModCar(playerid) { // changed to switch method to reduce processor load on server // new modelid = GetVehicleModel(GetPlayerVehicleID(playerid)); // this executes a fair amt of stuff, so running it once to populate variable (modelid),THEN checking variable, makes more sense switch(pmodelid[playerid]) { case 562,565,559,561,560,575,534,567,536,535,576,411,579,602,496,518,527,589,597,419, 533,526,474,545,517,410,600,436,580,439,549,491,445,604,507,585,587,466,492,546,551,516, 426, 547, 405, 409, 550, 566, 540, 421, 529,431,438,437,420,525,552,416,433,427,490,528, 407,544,470,598,596,599,601,428,499,609,524,578,486,406,573,455,588,403,514,423, 414,443,515,456,422,482,530,418,572,413,440,543,583,478,554,402,542,603,475,568,504,457, 483,508,429,541,415,480,434,506,451,555,477,400,404,489,479,442,458,467,558,444: { TogglePlayerControllable(playerid,0); return SendClientMessage(playerid, COLOR_WHITE, "[INFO] Select an item and push the SPACEBAR to approve."); } default: return SendClientMessage(playerid,COLOR_RED,"[WARNING] You are not allowed to modify/tune this vehicle"); } return 1; } public OnPlayerExitedMenu(playerid) { return 1; } /*ProcessDamage(playerid, issuerid, weaponid, Float:amount, bool:fmj = false) { new Float:health, Float:armour; GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armour); if(armour > 0.0) { if(armour >= amount) { armour -= amount; } else { health -= amount - armour; armour = 0; } } else if(health > 0.0) { if(health >= amount) { health -= amount; } else { health = 0; } } if((fmj) && health >= amount / 2) { health -= amount / 2; } SetPlayerHealth(playerid, health < 0.0 ? 0.0 : health); SetPlayerArmour(playerid, armour < 0.0 ? 0.0 : armour); if(health <= 0.0) { CallLocalFunction("OnPlayerDeath", "iii", playerid, issuerid, weaponid); } }*/ public OnPlayerDamage(&playerid, &Float:amount, &issuerid, &weapon, &bodypart) { if(playerid != INVALID_PLAYER_ID && issuerid != INVALID_PLAYER_ID) { if((22 <= weapon <= 36) && !PlayerHasWeapon(issuerid, weapon, true) && PlayerInfo[issuerid][pAdmin] < 2 && !PlayerInfo[issuerid][pKicked]) { new string[48]; format(string, sizeof(string), "Weapon hacks (%s)", GetWeaponNameEx(weapon)); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: %s", GetPlayerRPName(issuerid), SERVER_ANTICHEAT, string); BanPlayer(issuerid, SERVER_ANTICHEAT, string); return 0; } if((weapon == 23) && ((IsLawEnforcement(issuerid) || GetFactionType(issuerid) == FACTION_GOVERNMENT) && PlayerInfo[issuerid][pTazer] && GetPlayerState(issuerid) == PLAYER_STATE_ONFOOT) && amount > 5.0) { if(PlayerInfo[playerid][pAdminDuty]) { SendClientMessage(issuerid, COLOR_GREY, "You can't taze an administrator currently on duty."); return 0; } if(PlayerInfo[playerid][pTazedTime]) { SendClientMessage(issuerid, COLOR_GREY, "This player has already been tazed."); return 0; } if(!IsPlayerInRangeOfPlayer(issuerid, playerid, 10.0)) { SendClientMessage(issuerid, COLOR_GREY, "You can't taze that player. They are too far from you."); return 0; } if((22 <= GetPlayerWeapon(playerid) <= 38) && IsPlayerAiming(playerid)) { SendClientMessage(issuerid, COLOR_GREY, "Rush-tazing is forbidden. This means tazing a player who is aiming a gun at you."); return 0; } if(IsPlayerInAnyVehicle(playerid)) { SendClientMessage(issuerid, COLOR_GREY, "You can't taze a player who is in a vehicle."); return 0; } PlayerInfo[playerid][pTazedTime] = 10; TogglePlayerControllable(playerid, 0); ApplyAnimation(playerid, "PED", "KO_skid_front", 4.1, 0, 0, 0, 1, 0); GameTextForPlayer(playerid, "~r~Tazed", 5000, 3); SendProximityMessage(issuerid, 20.0, COLOR_PURPLE, "** %s aims their tazer full of electricity at %s and stuns them.", GetPlayerRPName(issuerid), GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You've been {FF6347}stunned{33CCFF} with electricity by %s's tazer.", GetPlayerRPName(issuerid)); SendClientMessageEx(issuerid, COLOR_AQUA, "You have stunned %s with electricity. They are disabled for 10 seconds.", GetPlayerRPName(playerid)); return 0; } if(gettime() - PlayerInfo[playerid][pLastUpdate] >= 3 && !PlayerInfo[playerid][pHurt]) { GameTextForPlayer(issuerid, "That player is AFK!", 5000, 3); return 0; } if(PlayerInfo[issuerid][pFreezeTimer] != -1) { PlayerInfo[issuerid][pFreezeTimer] = -1; } if(PlayerInfo[playerid][pFreezeTimer] != -1) { GameTextForPlayer(issuerid, "Wait for that player to sync in.", 5000, 3); return 0; } if(PlayerInfo[playerid][pNoDamage]) { GameTextForPlayer(issuerid, "That player has god-mode turned on!", 5000, 3); GameTextForPlayer(playerid, "God mode is on!", 5000, 3); return 0; } if(PlayerInfo[issuerid][pGodshand]) { SetPlayerHealth(playerid, 0.0); new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); CreateExplosionForPlayer(playerid, x, y, z, 6, 20.0); GameTextForPlayer(issuerid, "~r~EXECUTED.", 5000, 3); SendProximityMessage(playerid, 30.0, COLOR_PURPLE, "* God pick's up their hand and slams it onto %s, oliberating them.", GetPlayerNameEx(playerid)); SendProximityMessage(playerid, 30.0, COLOR_ORANGE, "** You have just witnessed a true miracle. **"); GameTextForPlayer(playerid, "DAMN BRUH, GET REKT", 5000, 3); PlayerInfo[issuerid][pGodshand] = 0; return 1; } /*if(PlayerInfo[playerid][pDraggedBy] != INVALID_PLAYER_ID) { PlayerInfo[playerid][pDraggedBy] = INVALID_PLAYER_ID; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s falls upon the ground as he gets shot on the back.", GetPlayerRPName(playerid)); }*/ if(IsPlayerInRangeOfPoint(playerid, 50.0, 1098.47, 19.32, 1000.68) && GetPlayerInterior(playerid) == 5 && !IsLawEnforcement(issuerid)) { new Float:iPos[3]; GameTextForPlayer(issuerid, "~r~Shooting ~w~inside the ~g~Casino ~w~is ~r~prohibited.", 5000, 3); GetPlayerPos(playerid, iPos[0], iPos[1], iPos[2]); PlayerInfo[issuerid][pFreezeTimer] = SetTimerEx("UnfreezePlayer", 3000, false, "ifff", issuerid, iPos[0], iPos[1], iPos[2]); TogglePlayerControllable(issuerid, false); return 0; } new playerTurfID, issuerTurfID; if((playerTurfID = GetNearbyTurf(playerid)) != -1 && TurfInfo[playerTurfID][tCapturer] != INVALID_PLAYER_ID || (issuerTurfID = GetNearbyTurf(issuerid)) != -1 && TurfInfo[issuerTurfID][tCapturer] != INVALID_PLAYER_ID) { if(!PlayerInfo[playerid][pJoinedEvent] && !PlayerInfo[playerid][pAdminDuty] && !PlayerInfo[issuerid][pAdminDuty]) { if(!PlayerInfo[playerid][pBandana] && !IsLawEnforcement(playerid) || !PlayerInfo[playerid][pDuty] && IsLawEnforcement(playerid)) { GameTextForPlayer(issuerid, "~w~Can't shoot unless the player has a bandana on.", 5000, 3); return 0; } else if(!PlayerInfo[issuerid][pBandana] && !IsLawEnforcement(issuerid) || !PlayerInfo[issuerid][pDuty] && IsLawEnforcement(issuerid)) { GameTextForPlayer(issuerid, "~w~Your bandana or badge must be on.", 5000, 3); return 0; } else if(playerTurfID == -1 && issuerTurfID != -1) { GameTextForPlayer(issuerid, "~w~That player is outside the turf bounds.", 5000, 3); return 0; } else if(issuerTurfID == -1 && playerTurfID != -1) { GameTextForPlayer(issuerid, "~w~You must be inside the turf.", 5000, 3); return 0; } } } if(!PlayerInfo[playerid][pJoinedEvent] && !PlayerInfo[playerid][pAdminDuty] && !PlayerInfo[issuerid][pAdminDuty]) { PlayerInfo[playerid][pHurt] = 60; } } if(playerid != INVALID_PLAYER_ID && PlayerInfo[playerid][pNoDamage]) { return 0; // for fall damage while on /god } return 1; } public OnPlayerDamageDone(playerid, Float:amount, issuerid, weapon, bodypart) { /*if(playerid != INVALID_PLAYER_ID && issuerid) { switch(weapon) // NO LONGER NEED AS HH IS IMPOSSIBLE NOW { case 22..34: { if(gettime() - PlayerInfo[playerid][pLastUpdate] < 2 && PlayerInfo[playerid][pAdmin] < 2) { new Float:health, Float:armour; GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armour); if(PlayerInfo[playerid][pGodmode] == 0) { GetPlayerHealth(playerid, PlayerInfo[playerid][pGodmodeHP]); GetPlayerArmour(playerid, PlayerInfo[playerid][pGodmodeAP]); } if(health != 0.0 && health == PlayerInfo[playerid][pGodmodeHP] && armour == PlayerInfo[playerid][pGodmodeAP]) { PlayerInfo[playerid][pGodmode]++; } if(PlayerInfo[playerid][pGodmode] >= 15 && !PlayerInfo[playerid][pKicked]) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly using health hacks.", GetPlayerRPName(playerid), playerid); Log_Write("log_cheat", "%s (uid: %i) is possibly using health hacks.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); PlayerInfo[playerid][pGodmode] = 0; } } } } }*/ new string[50]; if(playerid != INVALID_PLAYER_ID && issuerid != INVALID_PLAYER_ID) // motherfucker caused us to start out with bed rep BIATCH { if(PlayerInfo[issuerid][pToggleHUD] == 0 && IsPlayerConnected(issuerid)) { format(string, sizeof(string), "~g~Damage: You hit %s for %.0f damage.", GetPlayerRPName(playerid), amount); TextDrawSetString(Damage[issuerid], string); TextDrawShowForPlayer(issuerid, Damage[issuerid]); PlayerPlaySound(issuerid, 17802, 0.0, 0.0, 15.0); KillTimer(PlayerInfo[issuerid][pDamageTimer]); PlayerInfo[issuerid][pDamageTimer] = SetTimerEx("DestroyDamageTD", 1500, false, "i", issuerid); } if(IsPlayerConnected(issuerid)) { if(weapon == 4 && PlayerHasWeapon(issuerid, 4) && IsPlayerInRangeOfPlayer(playerid, issuerid, 20.0) && amount > 100.0) { SetPlayerHealth(playerid, 0.0); HandleContract(playerid, issuerid); } if(PlayerInfo[playerid][pToggleHUD] == 0) { format(string, sizeof(string), "~r~Damage: %s hit you for %.0f damage.", GetPlayerRPName(issuerid), amount); TextDrawSetString(Damage[playerid], string); TextDrawShowForPlayer(playerid, Damage[playerid]); PlayerPlaySound(playerid, 17802, 0.0, 0.0, 15.0); KillTimer(PlayerInfo[playerid][pDamageTimer]); PlayerInfo[playerid][pDamageTimer] = SetTimerEx("DestroyDamageTD", 1500, false, "i", playerid); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO shots VALUES(null, %i, %i, %i, %i, '%s', '0.0', '0.0', '0.0', %i)", issuerid, weapon, BULLET_HIT_TYPE_PLAYER, playerid, GetPlayerNameEx(playerid), gettime()); mysql_tquery(connectionID, queryBuffer); } return 1; } /*public OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid) { if((22 <= weaponid <= 36) && damagedid != INVALID_PLAYER_ID && !PlayerHasWeapon(playerid, weaponid, true) && PlayerInfo[playerid][pAdmin] < 2 && !PlayerInfo[playerid][pKicked]) { new string[48]; format(string, sizeof(string), "Weapon hacks (%s)", GetWeaponNameEx(weaponid)); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: %s", GetPlayerRPName(playerid), SERVER_ANTICHEAT, string); BanPlayer(playerid, SERVER_ANTICHEAT, string); return 0; } if((damagedid != INVALID_PLAYER_ID && weaponid == 23) && ((IsLawEnforcement(playerid) || GetFactionType(playerid) == FACTION_GOVERNMENT) && PlayerInfo[playerid][pTazer] && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) && amount > 5.0) { if(PlayerInfo[damagedid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You can't taze an administrator currently on duty."); } if(PlayerInfo[damagedid][pTazedTime]) { return SendClientMessage(playerid, COLOR_GREY, "This player has already been tazed."); } if(!IsPlayerInRangeOfPlayer(playerid, damagedid, 10.0)) { return SendClientMessage(playerid, COLOR_GREY, "You can't taze that player. They are too far from you."); } if((22 <= GetPlayerWeapon(damagedid) <= 38) && IsPlayerAiming(damagedid)) { return SendClientMessage(playerid, COLOR_GREY, "Rush-tazing is forbidden. This means tazing a player who is aiming a gun at you."); } if(IsPlayerInAnyVehicle(damagedid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't taze a player who is in a vehicle."); } PlayerInfo[damagedid][pTazedTime] = 10; TogglePlayerControllable(damagedid, 0); ApplyAnimation(damagedid, "PED", "KO_skid_front", 4.1, 0, 0, 0, 1, 0); GameTextForPlayer(damagedid, "~r~Tazed", 5000, 3); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s aims their tazer full of electricity at %s and stuns them.", GetPlayerRPName(playerid), GetPlayerRPName(damagedid)); SendClientMessageEx(damagedid, COLOR_AQUA, "You've been {FF6347}stunned{33CCFF} with electricity by %s's tazer.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have stunned %s with electricity. They are disabled for 10 seconds.", GetPlayerRPName(damagedid)); } if(PlayerInfo[playerid][pToggleHUD] == 0 && IsPlayerConnected(playerid)) { new string[50]; format(string, sizeof(string), "~g~Damage: You hit %s for %.0f damage.", GetPlayerRPName(damagedid), amount); TextDrawSetString(Damage[playerid], string); TextDrawShowForPlayer(playerid, Damage[playerid]); PlayerPlaySound(playerid, 17802, 0.0, 0.0, 15.0); KillTimer(PlayerInfo[playerid][pDamageTimer]); PlayerInfo[playerid][pDamageTimer] = SetTimerEx("DestroyDamageTD", 1500, false, "i", playerid); } if(damagedid != INVALID_PLAYER_ID && IsPlayerConnected(damagedid)) { switch(weaponid) { case 22..34: { if(gettime() - PlayerInfo[damagedid][pLastUpdate] < 2 && PlayerInfo[damagedid][pAdmin] < 2) { new Float:health, Float:armour; GetPlayerHealth(damagedid, health); GetPlayerArmour(damagedid, armour); if(PlayerInfo[damagedid][pGodmode] == 0) { GetPlayerHealth(damagedid, PlayerInfo[damagedid][pGodmodeHP]); GetPlayerArmour(damagedid, PlayerInfo[damagedid][pGodmodeAP]); } if(health != 0.0 && health == PlayerInfo[damagedid][pGodmodeHP] && armour == PlayerInfo[damagedid][pGodmodeAP]) { PlayerInfo[damagedid][pGodmode]++; } if(PlayerInfo[damagedid][pGodmode] >= 15 && !PlayerInfo[damagedid][pKicked]) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly using health hacks.", GetPlayerRPName(damagedid), damagedid); Log_Write("log_cheat", "%s (uid: %i) is possibly using health hacks.", GetPlayerRPName(damagedid), PlayerInfo[damagedid][pID]); PlayerInfo[damagedid][pGodmode] = 0; } } } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO shots VALUES(null, %i, %i, %i, %i, '%s', '0.0', '0.0', '0.0', %i)", playerid, weaponid, BULLET_HIT_TYPE_PLAYER, damagedid, GetPlayerNameEx(damagedid), gettime()); mysql_tquery(connectionID, queryBuffer); } return 1; } public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid, bodypart) { new string[50]; if(IsPlayerConnected(issuerid)) { if(weaponid == 4 && PlayerHasWeapon(issuerid, 4) && IsPlayerInRangeOfPlayer(playerid, issuerid, 20.0) && amount > 100.0) { SetPlayerHealth(playerid, 0.0); HandleContract(playerid, issuerid); } if(PlayerInfo[playerid][pToggleHUD] == 0) { format(string, sizeof(string), "~r~Damage: %s hit you for %.0f damage.", GetPlayerRPName(issuerid), amount); TextDrawSetString(Damage[playerid], string); TextDrawShowForPlayer(playerid, Damage[playerid]); PlayerPlaySound(playerid, 17802, 0.0, 0.0, 15.0); KillTimer(PlayerInfo[playerid][pDamageTimer]); PlayerInfo[playerid][pDamageTimer] = SetTimerEx("DestroyDamageTD", 1500, false, "i", playerid); } } return 1; }*/ public OnPlayerShootDynamicObject(playerid, weaponid, objectid, Float:x, Float:y, Float:z) { if(RobberyInfo[rPlanning] && objectid == RobberyInfo[rObjects][1]) { new bank[32]; if(GetPlayerVirtualWorld(playerid) == GetStaticEntranceWorld("Mulholland Bank")) { bank = "Mulholland Bank"; } else if(GetPlayerVirtualWorld(playerid) == GetStaticEntranceWorld("Rodeo Bank")) { bank = "Rodeo Bank"; } for(new i = 0; i < MAX_BANK_ROBBERS; i ++) { if(RobberyInfo[rRobbers][i] != INVALID_PLAYER_ID) { PlayerPlaySound(RobberyInfo[rRobbers][i], 3401, 0.0, 0.0, 0.0); GameTextForPlayer(RobberyInfo[rRobbers][i], "~w~Heist started", 5000, 1); SetPlayerAttachedObject(RobberyInfo[rRobbers][i], 8, 19801, 2, 0.091000, 0.012000, -0.000000, 0.099999, 87.799957, 179.500015, 1.345999, 1.523000, 1.270001, 0, 0); SetPlayerAttachedObject(RobberyInfo[rRobbers][i], 9, 1550, 1, 0.116999, -0.170999, -0.016000, -3.099997, 87.800018, -179.400009, 0.602000, 0.640000, 0.625000, 0, 0); ApplyAnimation(RobberyInfo[rRobbers][i], "GOGGLES", "goggles_put_on", 4.1, 0, 0, 0, 0, 0, 1); PlayerInfo[RobberyInfo[rRobbers][i]][pWantedLevel] = 6; PlayerInfo[RobberyInfo[rRobbers][i]][pCrimes]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO charges VALUES(null, %i, 'The State', NOW(), 'Bank Robbery')", PlayerInfo[RobberyInfo[rRobbers][i]][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET wantedlevel = 6, crimes = crimes + 1 WHERE uid = %i", PlayerInfo[RobberyInfo[rRobbers][i]][pID]); mysql_tquery(connectionID, queryBuffer); } } foreach(new i : Player) { if(IsLawEnforcement(i)) { SendClientMessageEx(i, COLOR_ROYALBLUE, "** HQ: A robbery is occurring at the %s. There are %i confirmed robbers.", bank, GetBankRobbers()); } } GetDynamicObjectPos(RobberyInfo[rObjects][1], x, y, z); MoveDynamicObject(RobberyInfo[rObjects][0], 1678.248901, -988.181152, 670.224853, 5.0, 90.000000, 0.000000, 0.000000); DestroyDynamicObject(RobberyInfo[rObjects][1]); CreateExplosion(x, y, z, 12, 6.0); SendClientMessageToAllEx(COLOR_AQUA, "Breaking News: A bank robbery is currently taking place at the %s!", bank); RobberyInfo[rText][0] = CreateDynamic3DTextLabel("/lootbox\nto loot deposit box.", COLOR_YELLOW, 1680.2344, -994.6146, 671.0032, 10.0); RobberyInfo[rText][1] = CreateDynamic3DTextLabel("/lootbox\nto loot deposit box.", COLOR_YELLOW, 1680.2335, -998.6115, 671.0032, 10.0); RobberyInfo[rText][2] = CreateDynamic3DTextLabel("/lootbox\nto loot deposit box.", COLOR_YELLOW, 1680.2344, -1002.5356, 671.0032, 10.0); RobberyInfo[rText][3] = CreateDynamic3DTextLabel("/lootbox\nto loot deposit box.", COLOR_YELLOW, 1674.2708, -998.4954, 671.0032, 10.0); RobberyInfo[rText][4] = CreateDynamic3DTextLabel("/lootbox\nto loot deposit box.", COLOR_YELLOW, 1674.2708, -994.5173, 671.0032, 10.0); RobberyInfo[rStarted] = 1; RobberyInfo[rStolen] = 0; RobberyInfo[rPlanning] = 0; } if(PlayerInfo[playerid][pDeleteMode]) { PlayerInfo[playerid][pSelected] = objectid; ShowDialogToPlayer(playerid, DIALOG_DELETEOBJECT); } return 1; } public OnPlayerSuspectedForAimbot(playerid,hitid,weaponid,warnings) { aimWarnings[playerid]++; new str[144], Float:Wstats[BUSTAIM_WSTATS_SHOTS]; /*if(warnings & WARNING_OUT_OF_RANGE_SHOT) { format(str, sizeof(str)," [#%i] %s(%i) fired shots from a distance greater than the %s's fire range (normal:%i)",aimWarnings[playerid],GetPlayerRPName(playerid),playerid,GetWeaponNameEx(weaponid),BustAim::GetNormalWeaponRange(weaponid)); SendAdminMessage(COLOR_YELLOW, str); BustAim::GetRangeStats(playerid,Wstats); format(str, sizeof(str)," Shooter -> Victim Distance (SA Units): 1)%f 2)%f 3)%f",Wstats[0],Wstats[1],Wstats[2]); SendAdminMessage(COLOR_YELLOW, str); }*/ if(warnings & WARNING_PROAIM_TELEPORT) { format(str, sizeof(str)," [#%i] %s(%i) is using proaim (teleport detected)",aimWarnings[playerid],GetPlayerRPName(playerid),playerid); SendAdminMessage(COLOR_YELLOW, str); BustAim::GetTeleportStats(playerid,Wstats); format(str, sizeof(str)," Bullet -> Victim Distance(SA Units): 1)%f 2)%f 3)%f",Wstats[0],Wstats[1],Wstats[2]); SendAdminMessage(COLOR_YELLOW, str); } if(warnings & WARNING_RANDOM_AIM) { format(str, sizeof(str)," [#%i] %s(%i) is suspected to be using aimbot (hits with random aim with %s)",aimWarnings[playerid],GetPlayerRPName(playerid),playerid,GetWeaponNameEx(weaponid)); SendAdminMessage(COLOR_YELLOW, str); BustAim::GetRandomAimStats(playerid,Wstats); format(str, sizeof(str)," Random Aim Offsets: 1)%f 2)%f 3)%f",Wstats[0],Wstats[1],Wstats[2]); SendAdminMessage(COLOR_YELLOW, str); } /*if(warnings & WARNING_CONTINOUS_SHOTS) { format(str, sizeof(str),"[#%i] %s(%i) has fired 10 shots continously with %s(%d)",aimWarnings[playerid],GetPlayerRPName(playerid),playerid,GetWeaponNameEx(weaponid),weaponid); SendAdminMessage(COLOR_YELLOW, str); }*/ if(aimWarnings[playerid] >= 10 && PlayerInfo[playerid][pAdmin] < 2) { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Aimbot", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Aimbot"); } return 0; } public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ) { /*if((PlayerInfo[playerid][pPaintball] > 0) && (GetPlayerVirtualWorld(playerid) != 1001 && GetPlayerVirtualWorld(playerid) != 1000)) { if(gettime() - PlayerInfo[playerid][pLastShot] >= 3) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is using paintball weapons outside of paintball.", GetPlayerRPName(playerid), playerid); PlayerInfo[playerid][pLastShot] = gettime(); ResetPlayerWeapons(playerid); } return 0; }*/ if((PlayerInfo[playerid][pJoinedEvent]) && (GetPlayerInterior(playerid) != EventInfo[eInterior] || GetPlayerVirtualWorld(playerid) != EventInfo[eWorld])) { if(gettime() - PlayerInfo[playerid][pLastShot] >= 3) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is using event weapons outside of the event.", GetPlayerRPName(playerid), playerid); PlayerInfo[playerid][pLastShot] = gettime(); ResetPlayerWeapons(playerid); } return 0; } //new entranceid; /*if(PlayerInfo[playerid][pDueling] != INVALID_PLAYER_ID && !IsPlayerInRangeOfPoint(playerid, 150.0, 1419.6472, 4.0132, 1002.3906) && (entranceid = GetInsideEntrance(playerid)) != -1 && EntranceInfo[entranceid][eType] != 1) { if(gettime() - PlayerInfo[playerid][pLastShot] >= 3) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is using duel weapons outside of the duel arena.", GetPlayerRPName(playerid), playerid); PlayerInfo[playerid][pLastShot] = gettime(); ResetPlayerWeapons(playerid); } return 0; }*/ if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID) { if((1 <= EventInfo[eType] <= 2) && PlayerInfo[playerid][pJoinedEvent]) { if(!EventInfo[eStarted]) { GameTextForPlayer(playerid, "~r~Don't shoot until the event starts!", 2000, 3); return 0; } else if(EventInfo[eType] == 2 && PlayerInfo[hitid][pEventTeam] == PlayerInfo[playerid][pEventTeam]) { GameTextForPlayer(playerid, "~r~Do not teamkill!", 2000, 3); return 0; } } /*if(PlayerInfo[playerid][pPaintball] == 2 && PlayerInfo[hitid][pPaintballTeam] == PlayerInfo[playerid][pPaintballTeam]) { GameTextForPlayer(playerid, "~r~Do not teamkill!", 2000, 3); return 0; }*/ if(PlayerInfo[playerid][pAcceptedHelp]) { GameTextForPlayer(playerid, "~r~Don't shoot at newbies!", 2000, 3); return 0; } } if(weaponid != 22 && weaponid != 26 && weaponid != 28 && weaponid != 32) { if(PlayerInfo[playerid][pClip] > 0) { new string[12]; PlayerInfo[playerid][pCurrentAmmo] = GetPlayerAmmo(playerid); PlayerInfo[playerid][pClip]--; format(string, sizeof(string), "%i", PlayerInfo[playerid][pClip]); PlayerTextDrawSetString(playerid, PlayerInfo[playerid][pText][5], string); } } if(!PlayerHasWeapon(playerid, weaponid, true) && PlayerInfo[playerid][pAdmin] < 2 && !PlayerInfo[playerid][pKicked] && gettime() > PlayerInfo[playerid][pACTime]) { new string[48]; format(string, sizeof(string), "Weapon hacks (%s)", GetWeaponNameEx(weaponid)); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: %s", GetPlayerRPName(playerid), SERVER_ANTICHEAT, string); BanPlayer(playerid, SERVER_ANTICHEAT, string); return 0; } if(hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID) { if(!PlayerInfo[hitid][pJoinedEvent]) { GetPlayerArmour(hitid, PlayerInfo[hitid][pArmor]); } } if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { if(22 <= GetPlayerWeapon(playerid) <= 36) { if(PlayerInfo[playerid][pACAmmo] == GetPlayerAmmo(playerid)) { PlayerInfo[playerid][pACFired]++; } if(!PlayerInfo[playerid][pReloading] && PlayerInfo[playerid][pACFired] >= 20) { if((gAnticheat) && PlayerInfo[playerid][pAdmin] < 2 && !PlayerInfo[playerid][pKicked]) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s was automatically kicked for infinite ammo.", GetPlayerRPName(playerid)); Log_Write("log_cheat", "%s (uid: %i) was automatically kicked for infinite ammo.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID]); KickPlayer(playerid); } } PlayerInfo[playerid][pACAmmo] = GetPlayerAmmo(playerid); } } // Anti CBug moved to WC_cbugpunishment /*if((23 <= weaponid <= 25) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { new interval, time = NetStats_GetConnectedTime(playerid); switch(weaponid) { case 23: interval = 200; case 24: interval = 600; case 25: interval = 500; } if((time - PlayerInfo[playerid][pCBug]) < interval && PlayerInfo[playerid][pPaintball] == 0 && PlayerInfo[playerid][pDueling] == INVALID_PLAYER_ID && !(PlayerInfo[playerid][pJoinedEvent] && EventInfo[eCS])) { if((hittype == BULLET_HIT_TYPE_PLAYER && hitid != INVALID_PLAYER_ID) && !PlayerInfo[hitid][pAdminDuty]) { //ApplyAnimation(playerid, "SWORD", "sword_block", 4.0, 0, 0, 0, 0, 0, 1); //SetPlayerHealth(playerid, GetPlayerHealthEx(playerid) - 30.0); //GameTextForPlayer(playerid, "~r~C-bug is not allowed", 3000, 3); //SendClientMessage(playerid, COLOR_LIGHTRED, "** Please do not abuse the C-Bug glitch. This action has been reported to the admins."); GameTextForPlayer(playerid, "~r~C-bug is not allowed", 3000, 3); ApplyAnimation(playerid, "SWORD", "sword_block", 4.0, 0, 0, 0, 0, 0, 1); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly abusing C-Bug with a %s.", GetPlayerRPName(playerid), playerid, GetWeaponNameEx(weaponid)); SetPlayerArmedWeapon(playerid, 0); PlayerInfo[playerid][pCBug] = time; return 0; } } PlayerInfo[playerid][pCBug] = time; }*/ // Rapid fire detection if((22 <= weaponid <= 27) && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && PlayerInfo[playerid][pAdmin] < 2) { new time = NetStats_GetConnectedTime(playerid); if((time - PlayerInfo[playerid][pLastFire]) < 25) { PlayerInfo[playerid][pRapidFire]++; if(PlayerInfo[playerid][pRapidFire] >= 5) { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Rapid fire", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Rapid fire"); } } PlayerInfo[playerid][pLastFire] = time; } /*else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO shots VALUES(null, %i, %i, %i, %i, null, '%f', '%f', '%f', %i)", playerid, weaponid, hittype, hitid, fX, fY, fZ, gettime()); }*/ return 1; } stock CanPlayerCbug(playerid) { if((23 <= GetPlayerWeapon(playerid) <= 25) || GetPlayerWeapon(playerid) == 34) { if(!(PlayerInfo[playerid][pJoinedEvent] && EventInfo[eCS])) { return 0; } } return 1; } /*public WC_CbugPunishment(playerid, weapon) { if(!CanPlayerCbug(playerid)) { if(!PlayerInfo[playerid][pAdminDuty]) { //ApplyAnimation(playerid, "SWORD", "sword_block", 4.0, 0, 0, 0, 0, 0, 1); //SetPlayerHealth(playerid, GetPlayerHealthEx(playerid) - 30.0); //GameTextForPlayer(playerid, "~r~C-bug is not allowed", 3000, 3); //SendClientMessage(playerid, COLOR_LIGHTRED, "** Please do not abuse the C-Bug glitch. This action has been reported to the admins."); GameTextForPlayer(playerid, "~r~C-bug is not allowed", 3000, 3); ApplyAnimation(playerid, "SWORD", "sword_block", 4.0, 0, 0, 0, 0, 0, 1); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly abusing C-Bug with a %s.", GetPlayerRPName(playerid), playerid, GetWeaponNameEx(weapon)); SetPlayerArmedWeapon(playerid, 0); FreezeSyncData(playerid, false); //ClearAnimations(playerid, 1); return 0; } } return 1; }*/ public OnPlayerTeleport(playerid, Float:distance) { if((gAnticheat) && PlayerInfo[playerid][pAdmin] < 2 && !PlayerInfo[playerid][pKicked]) { if(!IsPlayerInRangeOfPoint(playerid, 3.0, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ])) { PlayerInfo[playerid][pACWarns]++; if(PlayerInfo[playerid][pACWarns] < MAX_ANTICHEAT_WARNINGS) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly teleport hacking (distance: %.1f).", GetPlayerRPName(playerid), playerid, distance); Log_Write("log_cheat", "%s (uid: %i) possibly teleport hacked (distance: %.1f)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], distance); } else { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Teleport hacks", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Teleport hacks"); } } } return 1; } public OnPlayerAirbreak(playerid) { if((gAnticheat) && PlayerInfo[playerid][pAdmin] < 2 && !PlayerInfo[playerid][pKicked]) { PlayerInfo[playerid][pACWarns]++; if(PlayerInfo[playerid][pACWarns] < MAX_ANTICHEAT_WARNINGS) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly using airbreak.", GetPlayerRPName(playerid), playerid); Log_Write("log_cheat", "%s (uid: %i) possibly used airbreak.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID]); } else { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Airbreak", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Airbreak"); } } return 1; } public OnPlayerSelectionMenuResponse(playerid, extraid, response, listitem, modelid) { switch(extraid) { case MODEL_SELECTION_CLOTHES: { if(response) { new businessid = GetInsideBusiness(playerid); if(businessid >= 0 && BusinessInfo[businessid][bType] == BUSINESS_CLOTHES) { if(BusinessInfo[businessid][bProducts] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "This business is out of stock."); } if(PlayerInfo[playerid][pVIPPackage] == 0 && PlayerInfo[playerid][pCash] < 1000) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy new clothes."); } if((PlayerInfo[playerid][pVIPPackage] == 0 && GetFactionType(playerid) != FACTION_POLICE && GetFactionType(playerid) != FACTION_MEDIC) && (!(0 <= modelid <= 311) || (265 <= modelid <= 267) || (274 <= modelid <= 288) || (300 <= modelid <= 302) || (306 <= modelid <= 311))) { return SendClientMessage(playerid, COLOR_GREY, "You are not allowed to use that skin as it is either invalid or faction reserved."); } if(PlayerInfo[playerid][pVIPPackage] == 0) { new price = 1000; if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid %s to the shopkeeper and received a new set of clothes.", GetPlayerRPName(playerid), FormatNumber(price)); SendClientMessageEx(playerid, COLOR_WHITE, "You've changed your clothes for $%i.", price); } else { SendClientMessage(playerid, COLOR_VIP, "VIP Perk: You changed your clothes free of charge."); } SetScriptSkin(playerid, modelid); } } } case MODEL_SELECTION_FURNITURE: { if(response) { new houseid = GetInsideHouse(playerid); if(houseid >= 0 && HasFurniturePerms(playerid, houseid)) { PurchaseFurniture(playerid, listitem + PlayerInfo[playerid][pFurnitureIndex]); } } else { ShowDialogToPlayer(playerid, DIALOG_BUYFURNITURE1); } } case MODEL_SELECTION_LANDOBJECTS: { if(response) { new landid = GetNearbyLand(playerid); if(landid >= 0 && HasLandPerms(playerid, landid)) { PurchaseLandObject(playerid, landid, listitem + PlayerInfo[playerid][pFurnitureIndex]); } } else { ShowDialogToPlayer(playerid, DIALOG_LANDBUILD1); } } case MODEL_SELECTION_CLOTHING: { if(response) { new businessid = GetInsideBusiness(playerid); if(businessid >= 0 && BusinessInfo[businessid][bType] == BUSINESS_CLOTHES) { PreviewClothing(playerid, listitem + PlayerInfo[playerid][pClothingIndex]); } } else { ShowDialogToPlayer(playerid, DIALOG_BUYCLOTHINGTYPE); } } case MODEL_SELECTION_COPCLOTHING: { if((response) && IsLawEnforcement(playerid)) { SetPlayerAttachedObject(playerid, 9, modelid, copClothing[listitem][cBone]); PlayerInfo[playerid][pEditType] = EDIT_COP_CLOTHING; PlayerInfo[playerid][pSelected] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have selected {FF6347}%s{33CCFF}. Use the editor to arrange your clothing and click the disk icon to save.", copClothing[listitem][cName]); EditAttachedObject(playerid, 9); } } case MODEL_SELECTION_VIPCLOTHES: { if((response) && PlayerInfo[playerid][pVIPPackage] > 0) { SetScriptSkin(playerid, modelid); SendClientMessage(playerid, COLOR_VIP, "VIP Perk: You changed your clothes free of charge."); } } } return 1; } public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid) { // Finally... an end to that ANNOYING spectate bug! foreach(new i : Player) { if(PlayerInfo[i][pSpectating] == playerid) { SetTimerEx("SpectateUpdate", 500, false, "ii", i, playerid); } } if((newinteriorid == 0) && IsPlayerInBankRobbery(playerid)) { PlayerPlaySound(playerid, 3402, 0.0, 0.0, 0.0); } /*if(PlayerInfo[playerid][pPreviewHouse] >= 0) { PlayerInfo[playerid][pPreviewHouse] = -1; PlayerInfo[playerid][pPreviewType] = 0; PlayerInfo[playerid][pPreviewTime] = 0; SendClientMessage(playerid, COLOR_GREY, "Preview cancelled. You left your house interior."); }*/ return 1; } public OnPlayerUpdate(playerid) { if(PlayerInfo[playerid][pKicked]) return 0; if(!PlayerInfo[playerid][pLogged]) return 1; new vehicleid = GetPlayerVehicleID(playerid), keys, string[128], index = GetPlayerAnimationIndex(playerid), drunkLevel = GetPlayerDrunkLevel(playerid); if(PlayerInfo[playerid][pCurrentWeapon] != GetPlayerWeapon(playerid)) { PlayerInfo[playerid][pCurrentWeapon] = GetPlayerWeapon(playerid); PlayerInfo[playerid][pCurrentAmmo] = GetPlayerAmmo(playerid); PlayerInfo[playerid][pACAmmo] = PlayerInfo[playerid][pCurrentAmmo]; PlayerInfo[playerid][pACFired] = 0; PlayerInfo[playerid][pCBug] = 0; PlayerInfo[playerid][pClip] = GetWeaponClipSize(PlayerInfo[playerid][pCurrentWeapon]); // Weapon hacks if((gAnticheat) && PlayerInfo[playerid][pAdmin] < 2) { if(PlayerInfo[playerid][pCurrentWeapon] > 1 && !PlayerHasWeapon(playerid, PlayerInfo[playerid][pCurrentWeapon], true) && !PlayerInfo[playerid][pKicked]) { PlayerInfo[playerid][pACWarns]++; if(PlayerInfo[playerid][pACWarns] < MAX_ANTICHEAT_WARNINGS) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has a desynced %s.", GetPlayerRPName(playerid), playerid, GetWeaponNameEx(PlayerInfo[playerid][pCurrentWeapon])); Log_Write("log_cheat", "%s (uid: %i) had a desynced %s with %i ammunition.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetWeaponNameEx(PlayerInfo[playerid][pCurrentWeapon]), GetPlayerAmmo(playerid)); } else { format(string, sizeof(string), "Weapon hacks (%s)", GetWeaponNameEx(PlayerInfo[playerid][pCurrentWeapon])); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: %s", GetPlayerRPName(playerid), SERVER_ANTICHEAT, string); BanPlayer(playerid, SERVER_ANTICHEAT, string); } } } } if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && PlayerInfo[playerid][pCurrentWeapon] > 0 && GetWeaponClipSize(PlayerInfo[playerid][pCurrentWeapon]) > 0 && !PlayerInfo[playerid][pToggleHUD] && !PlayerInfo[playerid][pToggleTextdraws]) { PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][5]); } else { PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][5]); } if(GetPlayerWeaponState(playerid) == WEAPONSTATE_RELOADING) { if(GetPlayerWeapon(playerid) != 25 && GetPlayerWeapon(playerid) != 33 && GetPlayerWeapon(playerid) != 34) { PlayerInfo[playerid][pReloading] = 1; } PlayerInfo[playerid][pACFired] = 0; } if(PlayerInfo[playerid][pReloading] && GetPlayerWeaponState(playerid) != WEAPONSTATE_RELOADING) { PlayerInfo[playerid][pClip] = GetWeaponClipSize(GetPlayerWeapon(playerid)); PlayerInfo[playerid][pReloading] = 0; } if(PlayerInfo[playerid][pCurrentVehicle] != vehicleid) { PlayerInfo[playerid][pCurrentVehicle] = vehicleid; PlayerInfo[playerid][pVehicleCount]++; if((!IsABoat(vehicleid) && GetVehicleModel(vehicleid) != 539) && PlayerInfo[playerid][pVehicleCount] >= 4 && PlayerInfo[playerid][pAdmin] < 2 && !PlayerInfo[playerid][pKicked]) { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Car warping", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Car warping"); return 0; } } if((44 <= GetPlayerWeapon(playerid) <= 45) && keys & KEY_FIRE) { return 0; } if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT && PlayerInfo[playerid][pCurrentWeapon] > 0 && GetWeaponClipSize(PlayerInfo[playerid][pCurrentWeapon]) > 0 && !PlayerInfo[playerid][pToggleHUD] && !PlayerInfo[playerid][pToggleTextdraws]) { PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][5]); } else { PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][5]); } if(PlayerInfo[playerid][pCurrentAmmo] != GetPlayerAmmo(playerid)) { if(PlayerInfo[playerid][pCurrentAmmo] > GetPlayerAmmo(playerid)) { switch(GetPlayerWeapon(playerid)) { case 22, 26, 28, 32: { PlayerInfo[playerid][pClip] -= PlayerInfo[playerid][pCurrentAmmo] - GetPlayerAmmo(playerid); } } if(PlayerInfo[playerid][pClip] < 0) { PlayerInfo[playerid][pClip] = 0; } } PlayerInfo[playerid][pCurrentAmmo] = GetPlayerAmmo(playerid); } if(GetPlayerWeaponState(playerid) == WEAPONSTATE_RELOADING) { if(GetPlayerWeapon(playerid) != 25 && GetPlayerWeapon(playerid) != 33 && GetPlayerWeapon(playerid) != 34) { PlayerInfo[playerid][pReloading] = 1; } PlayerInfo[playerid][pACFired] = 0; } if(PlayerInfo[playerid][pReloading] && GetPlayerWeaponState(playerid) != WEAPONSTATE_RELOADING) { PlayerInfo[playerid][pClip] = GetWeaponClipSize(GetPlayerWeapon(playerid)); PlayerInfo[playerid][pReloading] = 0; } if(!PlayerInfo[playerid][pToggleHUD] && !PlayerInfo[playerid][pToggleTextdraws] && GetPlayerState(playerid) != PLAYER_STATE_SPECTATING) { new Float:health, Float:armour; GetPlayerHealth(playerid, health); GetPlayerArmour(playerid, armour); if(floatround(armour) > 0) { format(string, sizeof(string), "%.0f", armour); PlayerTextDrawSetString(playerid, PlayerInfo[playerid][pText][3], string); PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][3]); } else { PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][3]); } format(string, sizeof(string), "%.0f", health); PlayerTextDrawSetString(playerid, PlayerInfo[playerid][pText][4], string); PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][4]); if(PlayerInfo[playerid][pReloading]) { string = "0"; } else { format(string, sizeof(string), "%i", PlayerInfo[playerid][pClip]); } PlayerTextDrawSetString(playerid, PlayerInfo[playerid][pText][5], string); } if(GetPlayerWeapon(playerid) > 1 && PlayerInfo[playerid][pInjured]) { SetPlayerArmedWeapon(playerid, 0); } if(!drunkLevel) { SetPlayerDrunkLevel(playerid, 1000); } if(PlayerInfo[playerid][pDrunkLevel] != drunkLevel) { new value = PlayerInfo[playerid][pDrunkLevel] - drunkLevel; if(0 <= value <= 250) { PlayerInfo[playerid][pFPS] = value; } PlayerInfo[playerid][pDrunkLevel] = drunkLevel; } if(!GetPlayerInterior(playerid)) { SetPlayerTime(playerid, gWorldTime, 0); } else { new garageid; if((garageid = GetInsideGarage(playerid)) >= 0 && GarageInfo[garageid][gType] == 2) SetPlayerTime(playerid, 0, 0); else SetPlayerTime(playerid, 12, 0); } if((keys & KEY_HANDBRAKE) && GetPlayerWeapon(playerid) == 34) { if(!PlayerInfo[playerid][pSniper]) { for(new i = 0; i < MAX_PLAYER_CLOTHING; i ++) { if(ClothingInfo[playerid][i][cAttached]) RemovePlayerAttachedObject(playerid, i); } PlayerInfo[playerid][pSniper] = 1; } } else if(PlayerInfo[playerid][pSniper]) { SetPlayerClothing(playerid); PlayerInfo[playerid][pSniper] = 0; } if(PlayerInfo[playerid][pNoKnife] && GetPlayerWeapon(playerid) == 4) { SetPlayerArmedWeapon(playerid, 0); } if(PlayerInfo[playerid][pAnimation] != index) { if(PlayerInfo[playerid][pLockBreak] != INVALID_VEHICLE_ID) { vehicleid = PlayerInfo[playerid][pLockBreak]; if(!IsValidVehicle(vehicleid) || VehicleInfo[vehicleid][vOwnerID] == 0) { SendClientMessage(playerid, COLOR_GREY, "You are no longer breaking into this vehicle as it despawned."); CancelBreakIn(playerid); } else if(GetNearbyVehicle(playerid) != vehicleid) { SendClientMessage(playerid, COLOR_GREY, "You are no longer breaking into this vehicle as you left its location."); CancelBreakIn(playerid); } else if(VehicleInfo[vehicleid][vLocked] == 0) { SendClientMessage(playerid, COLOR_GREY, "You are no longer breaking into this vehicle as it was unlocked."); CancelBreakIn(playerid); } else if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) { SendClientMessage(playerid, COLOR_GREY, "You are no longer breaking into this vehicle as you aren't onfoot."); CancelBreakIn(playerid); } else { switch(index) { case 17..19, 1545..1547, 312..314, 1136..1138, 472..474, 482..484, 494..496, 504..505, 1165: { if(IsValidVehicle(vehicleid) && (IsPlayerAtVehicleDoor(playerid, vehicleid, DOOR_DRIVER) || IsPlayerAtVehicleDoor(playerid, vehicleid, DOOR_PASSENGER))) { new damage[4]; GetVehicleDamageStatus(vehicleid, damage[0], damage[1], damage[2], damage[3]); if(2 <= GetPlayerWeapon(playerid) <= 9) PlayerInfo[playerid][pLockHealth] -= 20.0; else PlayerInfo[playerid][pLockHealth] -= 10.0; if(PlayerInfo[playerid][pLockHealth] <= 0) { VehicleInfo[vehicleid][vLocked] = 0; SetVehicleParams(vehicleid, VEHICLE_DOORS, false); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); GameTextForPlayer(playerid, "~g~Vehicle unlocked!", 3000, 6); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s successfully kicked down the door of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); CancelBreakIn(playerid); UpdateVehicleDamageStatus(vehicleid, damage[0], 262144, damage[2], damage[3]); } else { new Float:x, Float:y, Float:z, garageid = GetVehicleGarage(vehicleid); if(!GetVehicleParams(vehicleid, VEHICLE_ALARM)) { if(VehicleInfo[vehicleid][vAlarm] > 0) { foreach(new i : Player) { if(IsVehicleOwner(i, vehicleid)) { SendClientMessageEx(i, COLOR_YELLOW, "** SMS from OnStar: The alarm was activated on your %s located in %s, Ph: 999 **", GetVehicleName(vehicleid), GetVehicleZoneName(vehicleid)); } if(GetFactionType(i) == FACTION_POLICE) { if(VehicleInfo[vehicleid][vAlarm] == 2) { SendClientMessageEx(i, COLOR_ROYALBLUE, "** HQ: The alarm was activated on %s's %s in %s. **", VehicleInfo[vehicleid][vOwner], GetVehicleName(vehicleid), GetVehicleZoneName(vehicleid)); } else if(VehicleInfo[vehicleid][vAlarm] == 3) { if(PlayerInfo[playerid][pCP] == CHECKPOINT_NONE) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; if(garageid >= 0) { SetPlayerCheckpoint(playerid, GarageInfo[garageid][gPosX], GarageInfo[garageid][gPosY], GarageInfo[garageid][gPosZ], 3.0); } else { GetVehiclePos(vehicleid, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 3.0); } } SendClientMessageEx(i, COLOR_ROYALBLUE, "** HQ: The alarm was activated on %s's %s in %s (marked on map). **", VehicleInfo[vehicleid][vOwner], GetVehicleName(vehicleid), GetVehicleZoneName(vehicleid)); } } } } SetVehicleParams(vehicleid, VEHICLE_ALARM, true); } GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_FRONTSEAT, x, y, z); UpdateVehicleDamageStatus(vehicleid, damage[0], 131072, damage[2], damage[3]); format(string, sizeof(string), "%.0f HP", PlayerInfo[playerid][pLockHealth]); if(PlayerInfo[playerid][pLockText] == Text3D:INVALID_3DTEXT_ID) { if(IsPlayerAtVehicleDoor(playerid, PlayerInfo[playerid][pLockBreak], DOOR_DRIVER)) { PlayerInfo[playerid][pLockText] = CreateDynamic3DTextLabel(string, COLOR_GREEN, -x * 2, y + 0.25, z, 5.0, .attachedvehicle = vehicleid); } else if(IsPlayerAtVehicleDoor(playerid, PlayerInfo[playerid][pLockBreak], DOOR_PASSENGER)) { PlayerInfo[playerid][pLockText] = CreateDynamic3DTextLabel(string, COLOR_GREEN, x * 2, y + 0.25, z, 5.0, .attachedvehicle = vehicleid); } } else { UpdateDynamic3DTextLabelText(PlayerInfo[playerid][pLockText], COLOR_GREEN, string); } KillTimer(PlayerInfo[playerid][pLockTimer]); PlayerInfo[playerid][pLockTimer] = SetTimerEx("DestroyLockText", 5000, false, "i", playerid); } } } } } } PlayerInfo[playerid][pAnimation] = index; } PlayerInfo[playerid][pLastUpdate] = gettime(); return 1; } forward OnPlayerUpdateEx(); public OnPlayerUpdateEx() { foreach(new playerid : Player) { if(PlayerInfo[playerid][pKicked]) continue; if(!PlayerInfo[playerid][pLogged]) continue; new keys, ud, lr; GetPlayerKeys(playerid, keys, ud, lr); if(PlayerInfo[playerid][pHurt] > 0) { PlayerInfo[playerid][pHurt]--; } if(PlayerInfo[playerid][pGovTimer] > 0) { PlayerInfo[playerid][pGovTimer]--; } if(PlayerInfo[playerid][pRareTime] > 0) { PlayerInfo[playerid][pRareTime]--; } if(GetPlayerMoney(playerid) != PlayerInfo[playerid][pCash]) { ResetPlayerMoney(playerid); GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]); } if(GetPlayerScore(playerid) != PlayerInfo[playerid][pLevel]) { SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]); } if(GetPlayerWantedLevel(playerid) != PlayerInfo[playerid][pWantedLevel]) { SetPlayerWantedLevel(playerid, PlayerInfo[playerid][pWantedLevel]); } if((GetPlayerAnimationIndex(playerid) != 1209) && ((PlayerInfo[playerid][pInjured] && GetVehicleModel(GetPlayerVehicleID(playerid)) != 416) || (PlayerInfo[playerid][pTazedTime] > 0 && PlayerInfo[playerid][pDraggedBy] == INVALID_PLAYER_ID))) { ApplyAnimation(playerid, "PED", "KO_skid_front", 4.1, 0, 0, 0, 1, 0, 1); } if((keys & KEY_FIRE) && IsFireActive() && GetFactionType(playerid) == FACTION_MEDIC) { new Float:x, Float:y, Float:z, Float:vx, Float:vy, Float:vz, Float:cx, Float:cy, Float:cz; if(GetPlayerWeapon(playerid) == 42 && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { for(new i = 0; i < MAX_FIRES; i ++) { if(IsPlayerInRangeOfDynamicObject(playerid, gFireObjects[i], 4.0)) { gFireHealth[i] = gFireHealth[i] - 10.0; if(gFireHealth[i] <= 0.0) { PlayerInfo[playerid][pTotalFires]++; GetDynamicObjectPos(gFireObjects[i], x, y, z); GameTextForPlayer(playerid, "~r~Fire extinguished", 2000, 3); SetTimerEx("DestroyWater", 2000, false, "i", CreateDynamicObject(18744, x, y, z - 0.2, 0.0, 0.0, 0.0)); DestroyDynamicObject(gFireObjects[i]); gFireObjects[i] = INVALID_OBJECT_ID; gFireHealth[i] = 0.0; } } } } else if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && (GetVehicleModel(GetPlayerVehicleID(playerid)) == 407 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 544)) { GetPlayerCameraFrontVector(playerid, vx, vy, vz); GetPlayerCameraPos(playerid, cx, cy, cz); for(new i = 0; i < MAX_FIRES; i ++) { if(IsPlayerInRangeOfDynamicObject(playerid, gFireObjects[i], 12.0)) { GetDynamicObjectPos(gFireObjects[i], x, y, z); if(DistanceCameraTargetToLocation(cx, cy, cz, x, y, z + 2.5, vx, vy, vz) < 12.0) { gFireHealth[i] = gFireHealth[i] - 5.0; if(gFireHealth[i] <= 0.0) { GetDynamicObjectPos(gFireObjects[i], x, y, z); GameTextForPlayer(playerid, "~r~Fire extinguished", 2000, 3); SetTimerEx("DestroyWater", 2000, false, "i", CreateDynamicObject(18744, x, y, z - 0.2, 0.0, 0.0, 0.0)); DestroyDynamicObject(gFireObjects[i]); gFireObjects[i] = INVALID_OBJECT_ID; gFireHealth[i] = 0.0; } } } } } if(!IsFireActive()) { new amount; foreach(new i : Player) { if(GetFactionType(i) == FACTION_MEDIC && IsPlayerInRangeOfPoint(playerid, 20.0, x, y, z)) { amount = gFires * 150; if(PlayerInfo[i][pLaborUpgrade] > 0) { amount += percent(amount, PlayerInfo[i][pLaborUpgrade]); } SendClientMessageEx(i, COLOR_AQUA, "Well done! You helped put out the fire and received {00AA00}$%i{33CCFF} on your paycheck.", amount); AddToPaycheck(i, amount); } } gFires = 0; } } } return 1; } Float:GetPlayerDistanceFromPlayer(playerid, targetid) { new Float:Pos[3]; GetPlayerPos(playerid, Pos[0], Pos[1], Pos[2]); return GetPlayerDistanceFromPoint(targetid, Pos[0], Pos[1], Pos[2]); } forward AntiNameTag(); public AntiNameTag() { if(antiNT) { foreach(new playerid : Player) { foreach(new i : Player) { if(i == playerid) continue; if(PlayerInfo[i][pAdminDuty]) continue; if(GetPlayerDistanceFromPlayer(playerid, i) <= 30.0) { ShowPlayerNameTagForPlayer(playerid, i, true); } else { ShowPlayerNameTagForPlayer(playerid, i, false); } } } } } forward UpdateSpeedo(); public UpdateSpeedo() { foreach(new playerid : Player) { new vehicleid = GetPlayerVehicleID(playerid), string[128]; if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && VehicleHasEngine(vehicleid)) { new Float:health, Float:damage; GetVehicleHealth(vehicleid, health); if(health < 300.0) { SetVehicleHealth(vehicleid, 300.0); SetVehicleParams(vehicleid, VEHICLE_ENGINE, 0); //SendClientMessage(playerid, COLOR_RED, "The engine has shut down for being totalled and needs repairing."); GameTextForPlayer(playerid, "~r~Engine totalled", 3000, 3); } damage = (1000.0 - health) / 7.0; if(damage > 100.0) damage = 100.0; if(PlayerInfo[playerid][pSpeedometer] == 1) { format(string, sizeof(string), "~b~~h~Speed:~w~ %.0f KM/H~n~~b~~h~Fuel:~w~ %i%c~n~~r~~h~Damage:~w~ %.0f%c~n~~b~~h~Doors:~w~ %s", GetVehicleSpeed(vehicleid), vehicleFuel[vehicleid], '%', damage, '%', (GetVehicleParams(vehicleid, VEHICLE_DOORS)) ? ("Locked") : ("Unlocked")); } else if(PlayerInfo[playerid][pSpeedometer] == 2) { format(string, sizeof(string), "~b~~h~Speed:~w~ %.0f MPH~n~~b~~h~Fuel:~w~ %i%c~n~~r~~h~Damage:~w~ %.0f%c~n~~b~~h~Doors:~w~ %s", GetVehicleSpeedMPH(vehicleid), vehicleFuel[vehicleid], '%', damage, '%', (GetVehicleParams(vehicleid, VEHICLE_DOORS)) ? ("Locked") : ("Unlocked")); } //PlayerTextDrawSetString(playerid, PlayerInfo[playerid][pText][2], string); for(new i = 0; i < MAX_DEPLOYABLES; i ++) { if(DeployInfo[i][dExists] && DeployInfo[i][dType] == DEPLOY_SPIKESTRIP && IsPlayerInRangeOfPoint(playerid, 3.0, DeployInfo[i][dPosX], DeployInfo[i][dPosY], DeployInfo[i][dPosZ])) { new panels, doors, lights, tires; GetVehicleDamageStatus(vehicleid, panels, doors, lights, tires); if(tires != 15) { UpdateVehicleDamageStatus(vehicleid, panels, doors, lights, 15); GameTextForPlayer(playerid, "~r~Spiked", 3000, 3); } } } } } return 1; } public OnVehicleRespray(playerid, vehicleid, color1, color2) { if(VehicleInfo[vehicleid][vOwnerID] > 0 || VehicleInfo[vehicleid][vGang] >= 0) { VehicleInfo[vehicleid][vColor1] = color1; VehicleInfo[vehicleid][vColor2] = color2; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET color1 = %i, color2 = %i WHERE id = %i", color1, color2, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } return 1; } public OnVehiclePaintjob(playerid, vehicleid, paintjobid) { if(VehicleInfo[vehicleid][vOwnerID] > 0 || VehicleInfo[vehicleid][vGang] >= 0) { VehicleInfo[vehicleid][vPaintjob] = paintjobid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET paintjob = %i WHERE id = %i", paintjobid, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } return 1; } public OnVehicleMod(playerid, vehicleid, componentid) { if(!GetPlayerInterior(playerid) && PlayerInfo[playerid][pAdmin] < 2 && !PlayerInfo[playerid][pKicked]) { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Illegal modding", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Illegal modding"); return 0; } if(VehicleInfo[vehicleid][vOwnerID] > 0 || VehicleInfo[vehicleid][vGang] >= 0) { new slotid = GetVehicleComponentType(componentid); VehicleInfo[vehicleid][vMods][slotid] = componentid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET mod_%i = %i WHERE id = %i", slotid + 1, componentid, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } return 1; } public OnVehicleSpawn(vehicleid) { if(adminVehicle{vehicleid}) { DestroyVehicleEx(vehicleid); adminVehicle{vehicleid} = false; } if(IsValidDynamicObject(vehicleSiren[vehicleid])) { DestroyDynamicObject(vehicleSiren[vehicleid]); vehicleSiren[vehicleid] = INVALID_OBJECT_ID; } if(IsValidDynamic3DTextLabel(vehicleCallsign[vehicleid])) { DestroyDynamic3DTextLabel(vehicleCallsign[vehicleid]); vehicleCallsign[vehicleid] = Text3D:INVALID_3DTEXT_ID; } if((VehicleInfo[vehicleid][vID] > 0 && VehicleInfo[vehicleid][vOwnerID] > 0) || (VehicleInfo[vehicleid][vGang] >= 0)) { ReloadVehicle(vehicleid); if(VehicleInfo[vehicleid][vGang] >= 0) { vehicleFuel[vehicleid] = 100; } } else { if(VehicleInfo[vehicleid][vID] > 0 && VehicleInfo[vehicleid][vHealth] > 300.0) { SetVehicleHealth(vehicleid, VehicleInfo[vehicleid][vHealth]); } vehicleFuel[vehicleid] = 100; } vehicleStream[vehicleid][0] = 0; DestroyObject(obj[vehicleid]); DestroyObject(obj2[vehicleid]); Flasher[vehicleid] = 0; return 1; } public OnPlayerText(playerid, text[]) { if(PlayerInfo[playerid][pLogged] && !PlayerInfo[playerid][pKicked]) { if(PlayerInfo[playerid][pTutorial]) { SendClientMessage(playerid, COLOR_LIGHTRED, "** You are currently in the tutorial. Chatting is disabled."); return 0; } if(PlayerInfo[playerid][pHospital]) { SendClientMessage(playerid, COLOR_LIGHTRED, "** You are currently in the hospital. Chatting is disabled."); return 0; } if(PlayerInfo[playerid][pMuted]) { SendClientMessage(playerid, COLOR_LIGHTRED, "** You are currently muted. Chatting is disabled."); return 0; } if(++PlayerInfo[playerid][pSpamTime] >= 4 && PlayerInfo[playerid][pAdmin] < 2) { PlayerInfo[playerid][pMuted] = 10; SendClientMessage(playerid, COLOR_YELLOW, "You've been temporarily muted by the server for ten seconds for spamming."); return 0; } if(PlayerInfo[playerid][pAdmin] < 6 && CheckServerAd(text)) { new string[128]; format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s (ID: %d) may be server advertising: '{AA3333}%s{FFFF00}'.", GetPlayerNameEx(playerid), playerid, text); SendAdminMessage(COLOR_YELLOW, string, 2); Log_Write("logs/hack.log", string); SendClientMessage(playerid, COLOR_GREY, "Your chat was blocked, you have automatically reported for server advertising."); if(++PlayerInfo[playerid][pAdvertWarnings] > MAX_ANTICHEAT_WARNINGS) { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Server advertisement", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Server advertisement"); } return 0; } if(PlayerInfo[playerid][pJoinedEvent]) { foreach(new i : Player) { if(PlayerInfo[i][pJoinedEvent]) { if(EventInfo[eType] == 2 && PlayerInfo[i][pEventTeam] == PlayerInfo[playerid][pEventTeam]) { SendClientMessageEx(i, COLOR_LIGHTORANGE, "(( {%06x}%s:{F7A763} %s ))", GetPlayerColor(playerid) >>> 8, GetPlayerRPName(playerid), text); } else { SendClientMessageEx(i, COLOR_LIGHTORANGE, "(( %s: %s ))", GetPlayerRPName(playerid), text); } } } } else { new string[144]; if(PlayerInfo[playerid][pCallLine] != INVALID_PLAYER_ID) { if(PlayerInfo[playerid][pCallLine] != playerid && PlayerInfo[playerid][pCallStage] == 2) { if(!strcmp(PlayerInfo[playerid][pAccent], "None", true)) { SendClientMessageEx(PlayerInfo[playerid][pCallLine], COLOR_YELLOW, "%s says (cellphone): %s", GetPlayerRPName(playerid), text); } else { SendClientMessageEx(PlayerInfo[playerid][pCallLine], COLOR_YELLOW, "(%s) %s says (cellphone): %s", PlayerInfo[playerid][pAccent], GetPlayerRPName(playerid), text); } } if(!strcmp(PlayerInfo[playerid][pAccent], "None", true)) { format(string, sizeof(string), "%s says (cellphone): %s", GetPlayerRPName(playerid), text); } else { format(string, sizeof(string), "(%s) %s says (cellphone): %s", PlayerInfo[playerid][pAccent], GetPlayerRPName(playerid), text); } SendProximityFadeMessage(playerid, 20.0, string, COLOR_GREY1, COLOR_GREY2, COLOR_GREY3, COLOR_GREY4, COLOR_GREY5); if(PlayerInfo[playerid][pCallLine] == playerid) { switch(PlayerInfo[playerid][pCallStage]) { case 911: { if(!strcmp(text, "police", true)) { SendClientMessage(playerid, COLOR_ROYALBLUE, "Dispatch: This is the Los Santos Police Department. What is your emergency?"); PlayerInfo[playerid][pCallStage] = 912; } else if(!strcmp(text, "medic", true)) { SendClientMessage(playerid, COLOR_DOCTOR, "Dispatch: This is the Los Santos Fire & Medical Department. What is your emergency?"); PlayerInfo[playerid][pCallStage] = 913; } else { SendClientMessage(playerid, COLOR_YELLOW, "Dispatch: Sorry? I don't know what you mean... Enter 'police' or 'medic'."); } } case 912: { foreach(new i : Player) { if(IsLawEnforcement(i)) { SendClientMessageEx(i, COLOR_ROYALBLUE, "______ Emergency Hotline ______"); SendClientMessageEx(i, COLOR_GREY2, "Caller: %s, Number: %i", GetPlayerRPName(playerid), PlayerInfo[playerid][pPhone]); SendClientMessageEx(i, COLOR_GREY2, "Location: %s", GetPlayerZoneName(playerid)); SendClientMessageEx(i, COLOR_GREY2, "Emergency: %s", text); SendClientMessageEx(i, COLOR_WHITE, "** Use '/trackcall %i' to track the caller's location.", playerid); } } strcpy(PlayerInfo[playerid][pEmergency], text, 128); PlayerInfo[playerid][pEmergencyCall] = 120; PlayerInfo[playerid][pEmergencyType] = FACTION_POLICE; SendClientMessage(playerid, COLOR_ROYALBLUE, "Dispatch: All units in the area have been notified. Thank you for your time."); HangupCall(playerid, HANGUP_USER); } case 913: { foreach(new i : Player) { if(GetFactionType(i) == FACTION_MEDIC) { SendClientMessageEx(i, COLOR_DOCTOR, "______ Emergency Hotline ______"); SendClientMessageEx(i, COLOR_GREY2, "Caller: %s, Number: %i", GetPlayerRPName(playerid), PlayerInfo[playerid][pPhone]); SendClientMessageEx(i, COLOR_GREY2, "Location: %s", GetPlayerZoneName(playerid)); SendClientMessageEx(i, COLOR_GREY2, "Emergency: %s", text); SendClientMessageEx(i, COLOR_WHITE, "** Use '/trackcall %i' to track the caller's location.", playerid); } } strcpy(PlayerInfo[playerid][pEmergency], text, 128); PlayerInfo[playerid][pEmergencyCall] = 120; PlayerInfo[playerid][pEmergencyType] = FACTION_MEDIC; SendClientMessage(playerid, COLOR_DOCTOR, "Dispatch: All units in the area have been notified. Thank you for your time."); HangupCall(playerid, HANGUP_USER); } case 6397: { foreach(new i : Player) { if(GetFactionType(i) == FACTION_NEWS) { SendClientMessageEx(i, COLOR_NAVYBLUE, "______ News Hotline ______"); SendClientMessageEx(i, COLOR_GREY2, "Caller: %s, Number: %i", GetPlayerRPName(playerid), PlayerInfo[playerid][pPhone]); SendClientMessageEx(i, COLOR_GREY2, "Message: %s", text); } } SendClientMessage(playerid, COLOR_NAVYBLUE, "News Team: Thank you. We will get back to you shortly!"); HangupCall(playerid, HANGUP_USER); } case 6324: { foreach(new i : Player) { if(PlayerHasJob(i, JOB_MECHANIC)) { SendClientMessageEx(i, COLOR_NAVYBLUE, "______ Mechanic Hotline ______"); SendClientMessageEx(i, COLOR_GREY2, "Caller: %s, Number: %i", GetPlayerRPName(playerid), PlayerInfo[playerid][pPhone]); SendClientMessageEx(i, COLOR_GREY2, "Situation: %s", text); SendClientMessageEx(i, COLOR_WHITE, "** Use '/takecall %i' in order to take this call.", playerid); } } PlayerInfo[playerid][pMechanicCall] = 60; SendClientMessage(playerid, COLOR_LIGHTORANGE, "Dispatch: Thank you. We will alert all mechanics on duty."); HangupCall(playerid, HANGUP_USER); } case 8294: { foreach(new i : Player) { if(PlayerHasJob(i, JOB_TAXIDRIVER)) { SendClientMessageEx(i, COLOR_NAVYBLUE, "______ Taxi Hotline ______"); SendClientMessageEx(i, COLOR_GREY2, "Caller: %s, Number: %i", GetPlayerRPName(playerid), PlayerInfo[playerid][pPhone]); SendClientMessageEx(i, COLOR_GREY2, "Location: %s", text); SendClientMessageEx(i, COLOR_WHITE, "** Use '/takecall %i' in order to take this call.", playerid); } } PlayerInfo[playerid][pTaxiCall] = 60; SendClientMessage(playerid, COLOR_YELLOW, "Dispatch: Thank you. We will alert all taxi drivers on duty."); HangupCall(playerid, HANGUP_USER); } } } } else if(PlayerInfo[playerid][pMaskOn]) { if(!strcmp(PlayerInfo[playerid][pAccent], "None", true)) { format(string, sizeof(string), "Stranger says: %s", text); } else { format(string, sizeof(string), "(%s) Stranger says: %s", PlayerInfo[playerid][pAccent], text); } SendProximityFadeMessage(playerid, 20.0, string, COLOR_GREY1, COLOR_GREY2, COLOR_GREY3, COLOR_GREY4, COLOR_GREY5); SetPlayerBubbleText(playerid, 20.0, COLOR_WHITE, "says: %s", text); } else if(PlayerInfo[playerid][pLiveBroadcast] != INVALID_PLAYER_ID) { foreach(new i : Player) { if(!PlayerInfo[i][pToggleNews]) { if(GetFactionType(playerid) == FACTION_NEWS) { SendClientMessageEx(i, COLOR_LIGHTGREEN, "Live Reporter %s: %s", GetPlayerRPName(playerid), text); } else { SendClientMessageEx(i, COLOR_LIGHTGREEN, "Live Guest %s: %s", GetPlayerRPName(playerid), text); } } } SendProximityFadeMessage(playerid, 20.0, string, COLOR_GREY1, COLOR_GREY2, COLOR_GREY3, COLOR_GREY4, COLOR_GREY5); } else { if((PlayerInfo[playerid][pHelper] > 0 && PlayerInfo[playerid][pAcceptedHelp]) || (PlayerInfo[playerid][pAdmin] > 0 && PlayerInfo[playerid][pAdminDuty])) { callcmd::b(playerid, text); } else { if(!strcmp(PlayerInfo[playerid][pAccent], "None", true)) { format(string, sizeof(string), "%s says: %s", GetPlayerRPName(playerid), text); } else { format(string, sizeof(string), "(%s) %s says: %s", PlayerInfo[playerid][pAccent], GetPlayerRPName(playerid), text); } if(PlayerInfo[playerid][pBugged]) { foreach(new i : Player) { if(GetFactionType(i) == FACTION_FEDERAL) { SendClientMessageEx(i, 0x9ACD3200, "(bug) %s says: %s", GetPlayerRPName(playerid), text); } } } SendProximityFadeMessage(playerid, 20.0, string, COLOR_GREY1, COLOR_GREY2, COLOR_GREY3, COLOR_GREY4, COLOR_GREY5); SetPlayerBubbleText(playerid, 20.0, COLOR_WHITE, "says: %s", text); } } } } PlayerInfo[playerid][pAFKPos][0] = 0.0; PlayerInfo[playerid][pAFKPos][1] = 0.0; PlayerInfo[playerid][pAFKPos][2] = 0.0; return 0; } public OnPlayerCommandReceived(playerid, cmd[], params[], flags) { if(PlayerInfo[playerid][pKicked]) return 0; if(!PlayerInfo[playerid][pLogged]) { SendClientMessage(playerid, COLOR_RED, "You cannot use commands if you're not logged in."); return 0; } if(isnull(params)) { params[0] = EOS; } if(PlayerInfo[playerid][pTutorial])// && strcmp(cmd, "/report", true, 6)) { SendClientMessage(playerid, COLOR_LIGHTRED, "** You are currently in the tutorial. Commands are disabled."); return 0; } if(GetPlayerState(playerid) == PLAYER_STATE_WASTED) { SendClientMessage(playerid, COLOR_LIGHTRED, "** You are currently dead. Commands are disabled."); return 0; } if(PlayerInfo[playerid][pMuted]) { SendClientMessage(playerid, COLOR_LIGHTRED, "** You are currently muted. Commands are disabled."); return 0; } if(++PlayerInfo[playerid][pSpamTime] >= 4 && PlayerInfo[playerid][pAdmin] < 2) { PlayerInfo[playerid][pMuted] = 10; SendClientMessage(playerid, COLOR_YELLOW, "You've been temporarily muted by the server for ten seconds due to flooding."); return 0; } if(PlayerInfo[playerid][pAdmin] < 6 && CheckServerAd(params)) { new string[128]; format(string,sizeof(string),"{AA3333}AdmWarning{FFFF00}: %s (ID: %d) may be server advertising: '{AA3333}/%s %s{FFFF00}'.", GetPlayerNameEx(playerid), playerid, cmd, params); SendAdminMessage(COLOR_YELLOW, string, 2); Log_Write("logs/hack.log", string); SendClientMessage(playerid, COLOR_GREY, "Your command was blocked, you have automatically reported for server advertising."); PlayerInfo[playerid][pAdvertWarnings] ++; return 0; } /*if((PlayerInfo[playerid][pAdmin] < 6) && (!strcmp(cmd, "/ban", true, 3) || !strcmp(cmd, "/kick", true, 4) || !strcmp(cmd, "/sban", true, 4) || !strcmp(cmd, "/skick", true, 5) || !strcmp(cmd, "/permaban", true, 8) || !strcmp(cmd, "/rangeban", true, 8) || !strcmp(cmd, "/getip", true, 5) || !strcmp(cmd, "/traceip", true, 7))) { SendClientMessage(playerid, COLOR_LIGHTRED, "** These commands cannot be used during beta testing."); return 0; } if((PlayerInfo[playerid][pAdmin] < 5) && (!strcmp(cmd, "/adminname"))) { SendClientMessage(playerid, COLOR_LIGHTRED, "** These commands cannot be used during beta testing."); return 0; }*/ //PlayerInfo[playerid][pAFKPos][0] = 0.0; //PlayerInfo[playerid][pAFKPos][1] = 0.0; //PlayerInfo[playerid][pAFKPos][2] = 0.0; return 1; } forward unkcmd(playerid); // by Pedro public unkcmd(playerid) { TextDrawHideForPlayer(playerid, Textdraw0); TextDrawHideForPlayer(playerid, Textdraw1); TextDrawHideForPlayer(playerid, Textdraw2); TextDrawHideForPlayer(playerid, Textdraw3); TextDrawHideForPlayer(playerid, Textdraw4); TextDrawHideForPlayer(playerid, Textdraw5); TextDrawHideForPlayer(playerid, Textdraw6); TextDrawHideForPlayer(playerid, Textdraw7); TextDrawHideForPlayer(playerid, Textdraw8); return 1; } public OnPlayerCommandPerformed(playerid, cmd[], params[], result, flags) { if(result == -1) { SendClientMessageEx(playerid, COLOR_GREY, "Invalid command./help for a list of commands or /assistance to get a helper.", cmd); } return 1; } public OnRconLoginAttempt(ip[], password[], success) { if(success) { foreach(new i : Player) { if(!strcmp(GetPlayerIP(i), ip) && PlayerInfo[i][pAdmin] < 6 && !PlayerInfo[i][pDeveloper]) { BanPlayer(i, "Server", "Unauthorized RCON login"); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s was banned for an unauthorized RCON login.", GetPlayerRPName(i)); } else { return 1; } } } return 1; } stock GetUniquePlate(vehicleid) { new string[128], rows; for(new i = 0; i < 10; i++){ format(string,sizeof(string),"%i-%c%c%c %i%i%i",random(10),(65+random(26)),(65+random(26)),(65+random(26)),random(10),random(10),random(10)); printf("string begin of loop = %s",string); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT plate FROM vehicles WHERE plate = '%e'", string); mysql_tquery(connectionID, queryBuffer); if(rows > 0) { printf("string already exists = %s",string); format(string,sizeof(string),"%i-%c%c%c %i%i%i",random(10),(65+random(26)),(65+random(26)),(65+random(26)),random(10),random(10),random(10)); } else { format(VehicleInfo[vehicleid][vPlate],32, "%s", string); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET plate = '%e' WHERE id = %i", VehicleInfo[vehicleid][vPlate], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SetVehicleNumberPlate(vehicleid, VehicleInfo[vehicleid][vPlate]); SetVehicleToRespawn(vehicleid); break; } } return 1; } public OnPlayerKeyStateChange(playerid, newkeys, oldkeys) { new time = NetStats_GetConnectedTime(playerid); /*if (HOLDING(KEY_SPRINT) || PRESSED(KEY_SPRINT) || RELEASED(KEY_SPRINT)) { if (IsPlayerSteppingInVehicle[playerid] > -1) { for(new i = 0; i < MAX_PLAYERS; i++) { if (GetPlayerVehicleID(i) == IsPlayerSteppingInVehicle[playerid] && i != playerid) { new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); SetPlayerPos(playerid,x,y,z); GameTextForPlayer(playerid,"~r~Please do NOT abuse the \r\n~w~Jack bug",5000,4); IsPlayerSteppingInVehicle[playerid] = -1; SendAdminMessage(COLOR_YELLOW,"AdmWarning: %s[%i] has tried to abuse the jack bug!", GetPlayerRPName(playerid), playerid); } } } }*/ // skating if(PlayerInfo[playerid][pSkating] && GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { //static bool:act; SetPlayerArmedWeapon(playerid, 0); if(newkeys & KEY_HANDBRAKE) { ApplyAnimationEx(playerid, "SKATE","skate_sprint",4.1,1,1,1,1,1); if(!PlayerInfo[playerid][pSkateAct]) { PlayerInfo[playerid][pSkateAct] = true; RemovePlayerAttachedObject(playerid, 5); DestroyDynamicObject(PlayerInfo[playerid][pSkateObj]); PlayerInfo[playerid][pSkateObj] = CreateDynamicObject(19878,0,0,0,0,0,0, .playerid = playerid); AttachDynamicObjectToPlayer(PlayerInfo[playerid][pSkateObj], playerid, -0.2,0,-0.9,0,0,90); } } if(oldkeys & KEY_HANDBRAKE) { ApplyAnimationEx(playerid, "CARRY","crry_prtial",4.0,0,0,0,0,0); if(PlayerInfo[playerid][pSkateAct]) { PlayerInfo[playerid][pSkateAct] = false; DestroyDynamicObject(PlayerInfo[playerid][pSkateObj]); RemovePlayerAttachedObject(playerid, 5); SetPlayerAttachedObject(playerid, 5,19878,6,-0.055999,0.013000,0.000000,-84.099983,0.000000,-106.099998,1.000000,1.000000,1.000000); } } } if(newkeys & KEY_SPRINT) { if(PlayerInfo[playerid][pLoopAnim]) { PlayerInfo[playerid][pLoopAnim] = 0; ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0, 1); TextDrawHideForPlayer(playerid, AnimationTD); } } if(newkeys & KEY_SECONDARY_ATTACK && GetPlayerState(playerid) == PLAYER_STATE_DRIVER && VehicleHasEngine(GetPlayerVehicleID(playerid)) && vehicleFuel[GetPlayerVehicleID(playerid)] <= 0) { RemovePlayerFromVehicle(playerid); } // LS ELEVATOR if(!IsPlayerInAnyVehicle(playerid) && (newkeys & KEY_YES)) { new Float:pos[3]; GetPlayerPos(playerid, pos[0], pos[1], pos[2]); if(pos[1] < 1854.5137 && pos[1] > 1852.5137 && pos[0] < -279.9157 && pos[0] > -279.0157) // He is using the elevator button-279.7157, 1853.5137, 42.5607 ShowElevatorDialog(playerid); else // Is he in a floor button? { if(pos[1] > 1851.8827 && pos[1] < 1853.8827 && pos[0] < -280.1317 && pos[0] > -282.1317) //-281.1317, 1852.8827, z, { // He is most likely using it, check floor: new i=20; while(pos[2] < GetDoorsZCoordForFloor(i) + 3.5 && i > 0) i --; if(i == 0 && pos[2] < GetDoorsZCoordForFloor(0) + 2.0) i = -1; if(i <= 19) { CallElevator(playerid, i + 1); GameTextForPlayer(playerid, "~r~Elevator called", 3500, 4); } } } } // END LS ELEVATOR if((time - PlayerInfo[playerid][pLastPress]) >= 400) { if(newkeys & KEY_YES) { new success; if(PlayerInfo[playerid][pInjured] == 0 && PlayerInfo[playerid][pTazedTime] == 0 && PlayerInfo[playerid][pCuffed] == 0) { if(PlayerInfo[playerid][pHurt] - 30 > 0) return SendClientMessageEx(playerid, COLOR_GREY, "You are too hurt to operate/enter anything. Please wait %i seconds before trying again.", (PlayerInfo[playerid][pHurt] - 30)); if((success = EnterCheck(playerid)) == 0) success = ExitCheck(playerid); if(!success) { DoorCheck(playerid); //GateCheck(playerid); } } PlayerInfo[playerid][pLastPress] = time; // Prevents spamming. Sometimes keys get messed up and register twice. } else if(newkeys & KEY_NO) { if(!GateCheck(playerid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { callcmd::engine(playerid, "\1"); } PlayerInfo[playerid][pLastPress] = time; // Prevents spamming. Sometimes keys get messed up and register twice. } } return 1; } public OnPlayerStateChange(playerid, newstate, oldstate) { if(PlayerInfo[playerid][pKicked]) return 0; IsPlayerSteppingInVehicle[playerid] = -1; if( (newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) && VehicleHasEngine(GetPlayerVehicleID(playerid))) for(new i=0; i<12; i++) PlayerTextDrawShow(playerid, TDEditor_PTD[playerid][i]); if(newstate == PLAYER_STATE_DRIVER) { new vehicleid = GetPlayerVehicleID(playerid); if((pizzaVehicles[0] <= vehicleid <= pizzaVehicles[5]) && !PlayerHasJob(playerid, JOB_PIZZAMAN)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Pizzaman."); RemovePlayerFromVehicle(playerid); return 1; } if((courierVehicles[0] <= vehicleid <= courierVehicles[3]) && !PlayerHasJob(playerid, JOB_COURIER)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Courier."); RemovePlayerFromVehicle(playerid); return 1; } if((sweeperVehicles[0] <= vehicleid <= sweeperVehicles[3]) && !PlayerHasJob(playerid, JOB_SWEEPER)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Street Sweeper."); RemovePlayerFromVehicle(playerid); return 1; } if((taxiVehicles[0] <= vehicleid <= taxiVehicles[3]) && !PlayerHasJob(playerid, JOB_TAXIDRIVER)) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a Taxi Driver."); RemovePlayerFromVehicle(playerid); return 1; } if((testVehicles[0] <= vehicleid <= testVehicles[4]) && !PlayerInfo[playerid][pDrivingTest]) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not taking your drivers test."); RemovePlayerFromVehicle(playerid); return 1; } if(VehicleInfo[vehicleid][vFactionType] != FACTION_NONE && GetFactionType(playerid) != VehicleInfo[vehicleid][vFactionType]) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as it doesn't belong to your faction."); RemovePlayerFromVehicle(playerid); return 1; } else if(VehicleInfo[vehicleid][vFactionType] != FACTION_NONE && VehicleInfo[vehicleid][vRank] > PlayerInfo[playerid][pFactionRank]) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot operate this vehicle as you aren't a rank %i in your faction.", VehicleInfo[vehicleid][vRank]); RemovePlayerFromVehicle(playerid); return 1; } if(VehicleInfo[vehicleid][vGang] >= 0 && PlayerInfo[playerid][pGang] != VehicleInfo[vehicleid][vGang]) { SendClientMessage(playerid, COLOR_GREY, "You cannot operate this vehicle as it doesn't belong to your gang."); RemovePlayerFromVehicle(playerid); return 1; } else if(VehicleInfo[vehicleid][vGang] >= 0 && VehicleInfo[vehicleid][vRank] > PlayerInfo[playerid][pGangRank]) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot operate this vehicle as you aren't a rank %i in your gang.", VehicleInfo[vehicleid][vRank]); RemovePlayerFromVehicle(playerid); return 1; } if(VehicleInfo[vehicleid][vJob] >= 0 && PlayerInfo[playerid][pJob] != VehicleInfo[vehicleid][vJob]) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a %s.", GetJobName(VehicleInfo[vehicleid][vJob])); RemovePlayerFromVehicle(playerid); return 1; } if(VehicleInfo[vehicleid][vVIP] > 0 && PlayerInfo[playerid][pVIPPackage] < VehicleInfo[vehicleid][vVIP]) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot operate this vehicle as you are not a %s VIP+.", GetVIPRank(VehicleInfo[vehicleid][vVIP])); RemovePlayerFromVehicle(playerid); return 1; } /*if(VehicleInfo[vehicleid][vLocked]) { SendClientMessageEx(playerid, COLOR_GREY, "You cannot operate this vehicle as it is locked."); RemovePlayerFromVehicle(playerid); return 1; }*/ if(!VehicleHasEngine(vehicleid)) { SetVehicleParams(vehicleid, VEHICLE_ENGINE, true); } else if(!GetVehicleParams(vehicleid, VEHICLE_ENGINE)) { if(testVehicles[0] <= vehicleid <= testVehicles[4]) { PlayerInfo[playerid][pCP] = CHECKPOINT_TEST; PlayerInfo[playerid][pTestVehicle] = vehicleid; PlayerInfo[playerid][pTestCP] = 0; SetVehicleParams(vehicleid, VEHICLE_ENGINE, 1); SetPlayerCheckpoint(playerid, drivingTestCPs[PlayerInfo[playerid][pTestCP]][0], drivingTestCPs[PlayerInfo[playerid][pTestCP]][1], drivingTestCPs[PlayerInfo[playerid][pTestCP]][2], 3.0); SendClientMessage(playerid, COLOR_AQUA, "Drive through the checkpoints to proceed with the test. Try not to damage your vehicle."); } else { new vehid = GetPlayerDealerVehID(playerid), veh; if(vehid != -1) { veh = vehData[vehid][vModel]; if(veh != vehicleid) return printf("error"); // What happens after he enters a vehicle SendClientMessage(playerid, COLOR_GREY, "You have entered a dealership vehicle. Type /buyvehicle to purchase it."); } else { //SetVehicleParams(vehicleid, VEHICLE_ENGINE, 1); GameTextForPlayer(playerid, "~r~Engine Off~n~~w~/engine", 3000, 3); SendClientMessage(playerid, COLOR_AQUA, "Your vehicle's engine is turned off, you can use /engine or Press 'N' to turn it on/off."); } } } /*if(testVehicles[0] <= vehicleid <= testVehicles[4]) { PlayerInfo[playerid][pCP] = CHECKPOINT_TEST; PlayerInfo[playerid][pTestVehicle] = vehicleid; PlayerInfo[playerid][pTestCP] = 0; SetPlayerCheckpoint(playerid, drivingTestCPs[PlayerInfo[playerid][pTestCP]][0], drivingTestCPs[PlayerInfo[playerid][pTestCP]][1], drivingTestCPs[PlayerInfo[playerid][pTestCP]][2], 3.0); SendClientMessage(playerid, COLOR_AQUA, "Drive through the checkpoints to proceed with the test. Try not to damage your vehicle."); }*/ if(VehicleHasEngine(vehicleid) && vehicleFuel[vehicleid] <= 0) { GameTextForPlayer(playerid, "~r~Out of fuel", 5000, 3); TogglePlayerControllable(playerid, 0); } if(!PlayerInfo[playerid][pCarLicense] && !PlayerInfo[playerid][pDrivingTest]) { if(GetPlayerDealerVehID(playerid) == -1) SendClientMessage(playerid, COLOR_LIGHTRED, "You are operating this vehicle without a license. Watch out for the cops!"); } if(IsVehicleOwner(playerid, vehicleid) && VehicleInfo[vehicleid][vTickets] > 0) { SendClientMessageEx(playerid, COLOR_AQUA, "This vehicle has %s in unpaid tickets. You can pay your tickets using /paytickets.", FormatNumber(VehicleInfo[vehicleid][vTickets])); } if(!PlayerInfo[playerid][pToggleTextdraws] && VehicleHasEngine(vehicleid)) { //PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][1]); //PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][2]); } if(PlayerHasJob(playerid, JOB_THIEF) && !IsVehicleOwner(playerid, vehicleid) && GetVehicleCranePrice(vehicleid) > 0) { SendClientMessageEx(playerid, COLOR_YELLOW, "This vehicle is worth $%i. /dropcar to sell it at the crane.", GetVehicleCranePrice(vehicleid)); } SetPlayerArmedWeapon(playerid, 0); /*if(isnull(vehicleStream[vehicleid])) { SendClientMessage(playerid, COLOR_LIGHTORANGE, "Radio: Use {FFD700}/setradio{F7A763} to listen to a radio station."); }*/ /*if(isnull(vehicleStream[vehicleid])) { SendClientMessage(playerid, COLOR_WHITE, "** Use {C8C8C8}/setradio{FFFFFF} to change the radio station in this vehicle."); }*/ } else if(oldstate == PLAYER_STATE_DRIVER) { PlayerInfo[playerid][pCrash] = 0; if(PlayerInfo[playerid][pDrivingTest]) { PlayerInfo[playerid][pDrivingTest] = 0; SetVehicleToRespawn(PlayerInfo[playerid][pTestVehicle]); SendClientMessage(playerid, COLOR_LIGHTRED, "** You have exited the vehicle and therefore failed the test."); } for(new i=0; i<12; i++) PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][i]); // 0-11 el 12 m4 m3ak } else if(newstate == PLAYER_STATE_PASSENGER) { new driverid = GetVehicleDriver(GetPlayerVehicleID(playerid)); if((driverid != INVALID_VEHICLE_ID && PlayerInfo[driverid][pTaxiFare] > 0 && PlayerInfo[driverid][pTaxiPassenger] == INVALID_PLAYER_ID) && (GetVehicleModel(GetPlayerVehicleID(playerid)) == 420 || GetVehicleModel(GetPlayerVehicleID(playerid)) == 438)) { if(PlayerInfo[playerid][pCash] < PlayerInfo[driverid][pTaxiFare]) { SendClientMessage(playerid, COLOR_GREY, "You can't afford to pay the fare. Therefore you can't ride this taxi."); RemovePlayerFromVehicle(playerid); return 1; } PlayerInfo[driverid][pTaxiPassenger] = playerid; PlayerInfo[driverid][pTaxiBill] = PlayerInfo[driverid][pTaxiFare]; PlayerInfo[driverid][pTaxiTime] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s enters %s's taxi cab.", GetPlayerRPName(playerid), GetPlayerRPName(driverid)); SendClientMessageEx(playerid, COLOR_YELLOW, "You will be charged the fare price of {FF6347}$%i{33CCFF} every 15 seconds during your ride.", PlayerInfo[driverid][pTaxiFare]); SendClientMessageEx(driverid, COLOR_AQUA, "*%s has entered your taxi. You will earn {00AA00}$%i{33CCFF} every 15 seconds during the ride.", GetPlayerRPName(playerid), PlayerInfo[driverid][pTaxiFare]); } switch(GetPlayerWeapon(playerid)) { case 22, 23, 25, 28..33: SetPlayerArmedWeapon(playerid, GetScriptWeapon(playerid)); default: SetPlayerArmedWeapon(playerid, 0); } } if(newstate == PLAYER_STATE_DRIVER || newstate == PLAYER_STATE_PASSENGER) { new vehicleid = GetPlayerVehicleID(playerid); foreach(new i : Player) { if(GetPlayerState(i) == PLAYER_STATE_SPECTATING && PlayerInfo[i][pSpectating] == playerid) { PlayerSpectateVehicle(i, vehicleid); } } if(!isnull(vehicleStream[vehicleid]) && PlayerInfo[playerid][pStreamType] == MUSIC_NONE && !PlayerInfo[playerid][pToggleMusic]) { PlayerInfo[playerid][pStreamType] = MUSIC_VEHICLE; PlayAudioStreamForPlayer(playerid, vehicleStream[vehicleid]); SendClientMessage(playerid, COLOR_WHITE, "You are now tuned in to this vehicle's radio. /stopmusic to stop listening."); } PlayerInfo[playerid][pDedication] = 0; } else if(oldstate == PLAYER_STATE_DRIVER || oldstate == PLAYER_STATE_PASSENGER) { foreach(new i : Player) { if(GetPlayerState(i) == PLAYER_STATE_SPECTATING && PlayerInfo[i][pSpectating] == playerid) { PlayerSpectatePlayer(i, playerid); } } if(PlayerInfo[playerid][pStreamType] == MUSIC_VEHICLE) { StopAudioStreamForPlayer(playerid); PlayerInfo[playerid][pStreamType] = MUSIC_NONE; } } if(newstate == PLAYER_STATE_DRIVER) { pvehicleid[playerid] = GetPlayerVehicleID(playerid); pmodelid[playerid] = GetVehicleModel(pvehicleid[playerid]); } else { pvehicleid[playerid] = 0; pmodelid[playerid] = 0; } return 1; } GetVehicleWithinDistance( playerid, Float:x1, Float:y1, Float:z1, Float:dist, &vehic){ for(new i = 1; i < MAX_VEHICLES; i++){ if(GetVehicleModel(i) > 0){ if(GetPlayerVehicleID(playerid) != i ){ new Float:x, Float:y, Float:z; new Float:x2, Float:y2, Float:z2; GetVehiclePos(i, x, y, z); x2 = x1 - x; y2 = y1 - y; z2 = z1 - z; new Float:iDist = (x2*x2+y2*y2+z2*z2); printf("Vehicle %d is %f", i, iDist); if( iDist < dist){ vehic = i; } } } } } #pragma unused GetVehicleWithinDistance public OnPlayerEditAttachedObject(playerid, response, index, modelid, boneid, Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ, Float:fRotX, Float:fRotY, Float:fRotZ, Float:fScaleX, Float:fScaleY, Float:fScaleZ) { if(!(-3.0 <= fScaleX <= 3.0)) fScaleX = fScaleX < -3.0 ? 0.0 : 3.0; if(!(-3.0 <= fScaleY <= 3.0)) fScaleY = fScaleY < -3.0 ? 0.0 : 3.0; if(!(-3.0 <= fScaleZ <= 3.0)) fScaleZ = fScaleZ < -3.0 ? 0.0 : 3.0; switch(PlayerInfo[playerid][pEditType]) { case EDIT_CLOTHING_PREVIEW: { RemovePlayerAttachedObject(playerid, 9); if(response) { new businessid = GetInsideBusiness(playerid); if(businessid >= 0 && BusinessInfo[businessid][bType] == BUSINESS_CLOTHES) { if(BusinessInfo[businessid][bProducts] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "This business is out of stock now."); } if(PlayerInfo[playerid][pCash] < clothingArray[PlayerInfo[playerid][pSelected]][clothingPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You couldn't afford to purchase this item."); } for(new i = 0; i < MAX_PLAYER_CLOTHING; i ++) { if(!ClothingInfo[playerid][i][cExists]) { ClothingInfo[playerid][i][cModel] = modelid; ClothingInfo[playerid][i][cBone] = boneid; ClothingInfo[playerid][i][cPosX] = fOffsetX; ClothingInfo[playerid][i][cPosY] = fOffsetY; ClothingInfo[playerid][i][cPosZ] = fOffsetZ; ClothingInfo[playerid][i][cRotX] = fRotX; ClothingInfo[playerid][i][cRotY] = fRotY; ClothingInfo[playerid][i][cRotZ] = fRotZ; ClothingInfo[playerid][i][cScaleX] = fScaleX; ClothingInfo[playerid][i][cScaleY] = fScaleY; ClothingInfo[playerid][i][cScaleZ] = fScaleZ; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO clothing VALUES(null, %i, '%e', %i, %i, 0, '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f')", PlayerInfo[playerid][pID], clothingArray[PlayerInfo[playerid][pSelected]][clothingName], modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ); mysql_tquery(connectionID, queryBuffer, "OnPlayerBuyClothingItem", "isiii", playerid, clothingArray[PlayerInfo[playerid][pSelected]][clothingName], clothingArray[PlayerInfo[playerid][pSelected]][clothingPrice], businessid, i); return 1; } } SendClientMessage(playerid, COLOR_GREY, "You have no more clothing slots available. Therefore you can't buy this."); } } else { if(PlayerInfo[playerid][pMenuType] == 0) ShowClothingSelectionMenu(playerid); else ShowDialogToPlayer(playerid, DIALOG_BUYCLOTHING); } } case EDIT_CLOTHING: { new clothingid = PlayerInfo[playerid][pSelected]; if(response) { ClothingInfo[playerid][clothingid][cPosX] = fOffsetX; ClothingInfo[playerid][clothingid][cPosY] = fOffsetY; ClothingInfo[playerid][clothingid][cPosZ] = fOffsetZ; ClothingInfo[playerid][clothingid][cRotX] = fRotX; ClothingInfo[playerid][clothingid][cRotY] = fRotY; ClothingInfo[playerid][clothingid][cRotZ] = fRotZ; ClothingInfo[playerid][clothingid][cScaleX] = fScaleX; ClothingInfo[playerid][clothingid][cScaleY] = fScaleY; ClothingInfo[playerid][clothingid][cScaleZ] = fScaleZ; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE clothing SET pos_x = '%f', pos_y = '%f', pos_z = '%f', rot_x = '%f', rot_y = '%f', rot_z = '%f', scale_x = '%f', scale_y = '%f', scale_z = '%f' WHERE id = %i", fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ, ClothingInfo[playerid][clothingid][cID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREY, "Changes saved."); } if(!ClothingInfo[playerid][clothingid][cAttached]) { RemovePlayerAttachedObject(playerid, 9); } else { RemovePlayerAttachedObject(playerid, ClothingInfo[playerid][clothingid][cAttachedIndex]); SetPlayerAttachedObject(playerid, ClothingInfo[playerid][clothingid][cAttachedIndex], ClothingInfo[playerid][clothingid][cModel], ClothingInfo[playerid][clothingid][cBone], ClothingInfo[playerid][clothingid][cPosX], ClothingInfo[playerid][clothingid][cPosY], ClothingInfo[playerid][clothingid][cPosZ], ClothingInfo[playerid][clothingid][cRotX], ClothingInfo[playerid][clothingid][cRotY], ClothingInfo[playerid][clothingid][cRotZ], ClothingInfo[playerid][clothingid][cScaleX], ClothingInfo[playerid][clothingid][cScaleY], ClothingInfo[playerid][clothingid][cScaleZ]); } } case EDIT_COP_CLOTHING: { RemovePlayerAttachedObject(playerid, 9); if(response) { for(new i = 0; i < MAX_PLAYER_CLOTHING; i ++) { if(!ClothingInfo[playerid][i][cExists]) { ClothingInfo[playerid][i][cModel] = modelid; ClothingInfo[playerid][i][cBone] = boneid; ClothingInfo[playerid][i][cPosX] = fOffsetX; ClothingInfo[playerid][i][cPosY] = fOffsetY; ClothingInfo[playerid][i][cPosZ] = fOffsetZ; ClothingInfo[playerid][i][cRotX] = fRotX; ClothingInfo[playerid][i][cRotY] = fRotY; ClothingInfo[playerid][i][cRotZ] = fRotZ; ClothingInfo[playerid][i][cScaleX] = fScaleX; ClothingInfo[playerid][i][cScaleY] = fScaleY; ClothingInfo[playerid][i][cScaleZ] = fScaleZ; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO clothing VALUES(null, %i, '%e', %i, %i, 0, '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f')", PlayerInfo[playerid][pID], copClothing[PlayerInfo[playerid][pSelected]][cName], modelid, boneid, fOffsetX, fOffsetY, fOffsetZ, fRotX, fRotY, fRotZ, fScaleX, fScaleY, fScaleZ); mysql_tquery(connectionID, queryBuffer, "OnPlayerAttachCopClothing", "isi", playerid, copClothing[PlayerInfo[playerid][pSelected]][cName], i); return 1; } } SendClientMessage(playerid, COLOR_GREY, "You have no more clothing slots available. Therefore you can't attach this."); } else { ShowCopClothingMenu(playerid); } } } return 1; } public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) { if(response == EDIT_RESPONSE_FINAL) { if (PlayerInfo[playerid][pEditGraffiti] != -1 && GraffitiData[PlayerInfo[playerid][pEditGraffiti]][graffitiExists]) { GraffitiData[PlayerInfo[playerid][pEditGraffiti]][graffitiPos][0] = x; GraffitiData[PlayerInfo[playerid][pEditGraffiti]][graffitiPos][1] = y; GraffitiData[PlayerInfo[playerid][pEditGraffiti]][graffitiPos][2] = z; GraffitiData[PlayerInfo[playerid][pEditGraffiti]][graffitiPos][3] = rz; Graffiti_Refresh(PlayerInfo[playerid][pEditGraffiti]); Graffiti_Save(PlayerInfo[playerid][pEditGraffiti]); } else if (PlayerInfo[playerid][pEditRack] != -1 && RackData[PlayerInfo[playerid][pEditRack]][rackExists]) { RackData[PlayerInfo[playerid][pEditRack]][rackPos][0] = x; RackData[PlayerInfo[playerid][pEditRack]][rackPos][1] = y; RackData[PlayerInfo[playerid][pEditRack]][rackPos][2] = z; RackData[PlayerInfo[playerid][pEditRack]][rackPos][3] = rz; Rack_Refresh(PlayerInfo[playerid][pEditRack]); Rack_Save(PlayerInfo[playerid][pEditRack]); } } switch(PlayerInfo[playerid][pEditType]) { case EDIT_FURNITURE_PREVIEW: { if(response != EDIT_RESPONSE_UPDATE) { DestroyDynamicObject(PlayerInfo[playerid][pEditObject]); PlayerInfo[playerid][pEditObject] = INVALID_OBJECT_ID; PlayerInfo[playerid][pEditType] = 0; if(response == EDIT_RESPONSE_FINAL) { new houseid = GetInsideHouse(playerid); if(houseid >= 0 && HasFurniturePerms(playerid, houseid)) { if(PlayerInfo[playerid][pCash] < furnitureArray[PlayerInfo[playerid][pSelected]][fPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You couldn't afford to purchase this item."); } new string[16]; GivePlayerCash(playerid, -furnitureArray[PlayerInfo[playerid][pSelected]][fPrice]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO furniture VALUES(null, %i, %i, '%e', %i, '%f', '%f', '%f', '%f', '%f', '%f', %i, %i, 0, 0)", HouseInfo[houseid][hID], furnitureArray[PlayerInfo[playerid][pSelected]][fModel], furnitureArray[PlayerInfo[playerid][pSelected]][fName], furnitureArray[PlayerInfo[playerid][pSelected]][fPrice], x, y, z, rx, ry, rz, HouseInfo[houseid][hInterior], HouseInfo[houseid][hWorld]); mysql_tquery(connectionID, queryBuffer); mysql_tquery(connectionID, "SELECT * FROM furniture WHERE id = LAST_INSERT_ID()", "OnQueryFinished", "ii", THREAD_LOAD_FURNITURE, HouseInfo[houseid][hLabels]); format(string, sizeof(string), "~r~-$%i", furnitureArray[PlayerInfo[playerid][pSelected]][fPrice]); GameTextForPlayer(playerid, string, 5000, 1); if(!strcmp(furnitureArray[PlayerInfo[playerid][pSelected]][fCategory], "Doors & Gates")) { SendClientMessage(playerid, COLOR_WHITE, "You can use /door to control your door and /lock to unlock or lock it."); } } } else if(response == EDIT_RESPONSE_CANCEL) { if(PlayerInfo[playerid][pMenuType] == 0) ShowObjectSelectionMenu(playerid, MODEL_SELECTION_FURNITURE); else ShowDialogToPlayer(playerid, DIALOG_BUYFURNITURE2); } } } case EDIT_FURNITURE: { if(response != EDIT_RESPONSE_UPDATE) { if(response == EDIT_RESPONSE_FINAL) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE furniture SET pos_x = '%f', pos_y = '%f', pos_z = '%f', rot_x = '%f', rot_y = '%f', rot_z = '%f' WHERE id = %i", x, y, z, rx, ry, rz, Streamer_GetExtraInt(objectid, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_GREY, "Changes saved."); } ReloadFurniture(objectid, HouseInfo[PlayerInfo[playerid][pFurnitureHouse]][hLabels]); PlayerInfo[playerid][pEditType] = 0; } } case EDIT_LAND_OBJECT_PREVIEW: { if(response != EDIT_RESPONSE_UPDATE) { DestroyDynamicObject(PlayerInfo[playerid][pEditObject]); PlayerInfo[playerid][pEditObject] = INVALID_OBJECT_ID; PlayerInfo[playerid][pEditType] = 0; if(response == EDIT_RESPONSE_FINAL) { new landid = PlayerInfo[playerid][pObjectLand]; if(landid >= 0 && HasLandPerms(playerid, landid)) { if(PlayerInfo[playerid][pCash] < furnitureArray[PlayerInfo[playerid][pSelected]][fPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You couldn't afford to purchase this item."); } if(!IsPointInLand(landid, x, y)) { return SendClientMessage(playerid, COLOR_GREY, "The object has exceeded the boundaries for your land."); } new string[16]; GivePlayerCash(playerid, -furnitureArray[PlayerInfo[playerid][pSelected]][fPrice]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO landobjects VALUES(null, %i, %i, '%e', %i, '%f', '%f', '%f', '%f', '%f', '%f', 0, 0, '0.0', '0.0', '0.0', '-1000.0', '-1000.0', '-1000.0')", LandInfo[landid][lID], furnitureArray[PlayerInfo[playerid][pSelected]][fModel], furnitureArray[PlayerInfo[playerid][pSelected]][fName], furnitureArray[PlayerInfo[playerid][pSelected]][fPrice], x, y, z, rx, ry, rz); mysql_tquery(connectionID, queryBuffer); mysql_tquery(connectionID, "SELECT * FROM landobjects WHERE id = LAST_INSERT_ID()", "OnQueryFinished", "ii", THREAD_LOAD_LANDOBJECTS, LandInfo[landid][lLabels]); format(string, sizeof(string), "~r~-$%i", furnitureArray[PlayerInfo[playerid][pSelected]][fPrice]); GameTextForPlayer(playerid, string, 5000, 1); if(!strcmp(furnitureArray[PlayerInfo[playerid][pSelected]][fCategory], "Doors & Gates")) { if(IsGateModel(furnitureArray[PlayerInfo[playerid][pSelected]][fModel])) { SendClientMessage(playerid, COLOR_WHITE, "You can use /gate to open and close your gate. To change the destination coordinates, use /land and choose 'Edit object'."); } else { SendClientMessage(playerid, COLOR_WHITE, "You can use /door to control your door and /lock to unlock or lock it."); } } } } else if(response == EDIT_RESPONSE_CANCEL) { if(PlayerInfo[playerid][pMenuType] == 0) ShowObjectSelectionMenu(playerid, MODEL_SELECTION_LANDOBJECTS); else ShowDialogToPlayer(playerid, DIALOG_LANDBUILD2); } } } case EDIT_LAND_OBJECT: { if(response != EDIT_RESPONSE_UPDATE) { if(response == EDIT_RESPONSE_FINAL) { if(!IsPointInLand(PlayerInfo[playerid][pObjectLand], x, y)) { SendClientMessage(playerid, COLOR_GREY, "The object has exceeded the boundaries for your land."); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE landobjects SET pos_x = '%f', pos_y = '%f', pos_z = '%f', rot_x = '%f', rot_y = '%f', rot_z = '%f' WHERE id = %i", x, y, z, rx, ry, rz, Streamer_GetExtraInt(objectid, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_GREY, "Changes saved."); } } ReloadLandObject(objectid, LandInfo[PlayerInfo[playerid][pObjectLand]][lLabels]); PlayerInfo[playerid][pEditType] = 0; } } case EDIT_LAND_GATE_MOVE: { if(response != EDIT_RESPONSE_UPDATE) { if(response == EDIT_RESPONSE_FINAL) { if(!IsPointInLand(PlayerInfo[playerid][pObjectLand], x, y)) { SendClientMessage(playerid, COLOR_GREY, "The object has exceeded the boundaries for your land."); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE landobjects SET move_x = '%f', move_y = '%f', move_z = '%f', move_rx = '%f', move_ry = '%f', move_rz = '%f' WHERE id = %i", x, y, z, rx, ry, rz, Streamer_GetExtraInt(objectid, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_GREY, "Changes saved."); } } ReloadLandObject(objectid, LandInfo[PlayerInfo[playerid][pObjectLand]][lLabels]); PlayerInfo[playerid][pEditType] = 0; } } } return 1; } public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if(PlayerInfo[playerid][pKicked]) return 0; // This is a fix to a known exploit where inserting '%' in the dialog box would crash the server. for(new i = 0, l = strlen(inputtext); i < l; i ++) { if(inputtext[i] == '%') inputtext[i] = '#'; } switch(dialogid) { case DIALOG_TYPE_MAIN: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { /*case 0:// Paintjobs { ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); } case 1: // colors { ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); }*/ case 0: // Hoods { ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } case 1: // Vents { ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } case 2: // Lights { ShowPlayerDialog(playerid, DIALOG_TYPE_LIGHTS, DIALOG_STYLE_LIST, "Lights", "Round\nSquare\n \nBack", "Apply", "Close"); } case 3: // Exhausts { ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } case 4: // Front Bumpers { ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } case 5: // Rear Bumpers { ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } case 6: // Roofs { ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } case 7: // Spoilers { ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } case 8: // Side Skirts { ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } case 9: // Bullbars { ShowPlayerDialog(playerid, DIALOG_TYPE_BULLBARS, DIALOG_STYLE_LIST, "Bullbars", "Locos Chrome Grill\nLocos Chrome Bars\nLocos Chrome Lights \nLocos Chrome Bullbar\n \nBack", "Apply", "Close"); } case 10: // Wheels { ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } case 11: // Car Stereo { ShowPlayerDialog(playerid, DIALOG_TYPE_CSTEREO, DIALOG_STYLE_LIST, "Car Stereo", "Bass Boost\n \nBack", "Apply", "Close"); } case 12: // Hydraulics { ShowPlayerDialog(playerid, DIALOG_TYPE_HYDRAULICS, DIALOG_STYLE_LIST, "Hydaulics", "Hydaulics\n \nBack", "Apply", "Close"); } case 13: // Nitrous Oxide { ShowPlayerDialog(playerid, DIALOG_TYPE_NITRO, DIALOG_STYLE_LIST, "Nitrous Oxide", "2x Nitrous\n5x Nitrous\n10x Nitrous\n \nBack", "Apply", "Close"); } case 14: // Repair Car { new car = GetPlayerVehicleID(playerid); SetVehicleHealth(car,1000); RepairVehicle(car); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); return 1; } } } } /*case DIALOG_TYPE_PAINTJOBS: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0:// Paintjobs { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 560 || pmodelid[playerid] == 575 || pmodelid[playerid] == 534 || // Broadway pmodelid[playerid] == 567 || pmodelid[playerid] == 536 || pmodelid[playerid] == 535 || pmodelid[playerid] == 576 || pmodelid[playerid] == 558) { new car = GetPlayerVehicleID(playerid); ChangeVehiclePaintjob(car,0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added paintjob to car"); ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); } else { SendClientMessage(playerid,COLOR_WHITE,"[INFO] Paintjob is only for Wheel Arch Angrls and Loco Low Co types of cars"); ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); } } case 1: // Colors { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 560 || pmodelid[playerid] == 575 || pmodelid[playerid] == 534 || // Broadway pmodelid[playerid] == 567 || pmodelid[playerid] == 536 || pmodelid[playerid] == 535 || pmodelid[playerid] == 576 || pmodelid[playerid] == 558) { new car = GetPlayerVehicleID(playerid); ChangeVehiclePaintjob(car,1); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added paintjob to car"); ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); } else { SendClientMessage(playerid,COLOR_WHITE,"[INFO] Paintjob is only for Wheel Arch Angrls and Loco Low Co types of cars"); ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); } } case 2: // Exhausts { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 560 || pmodelid[playerid] == 575 || pmodelid[playerid] == 534 || // Broadway pmodelid[playerid] == 567 || pmodelid[playerid] == 536 || pmodelid[playerid] == 535 || pmodelid[playerid] == 576 || pmodelid[playerid] == 558) { new car = GetPlayerVehicleID(playerid); ChangeVehiclePaintjob(car,2); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added paintjob to car"); ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); } else { SendClientMessage(playerid,COLOR_WHITE,"[INFO] Paintjob is only for Wheel Arch Angrls and Loco Low Co types of cars"); ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); } } case 3: // Front Bumpers { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 560 || pmodelid[playerid] == 575 || pmodelid[playerid] == 534 || // Broadway pmodelid[playerid] == 567 || pmodelid[playerid] == 536 || pmodelid[playerid] == 535 || pmodelid[playerid] == 576 || pmodelid[playerid] == 558) { new car = GetPlayerVehicleID(playerid); ChangeVehiclePaintjob(car,3); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added paintjob to car"); ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); } else { SendClientMessage(playerid,COLOR_WHITE,"[INFO] Paintjob is only for Wheel Arch Angrls and Loco Low Co types of cars"); ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); } } case 4: // Rear Bumpers { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 560 || pmodelid[playerid] == 575 || pmodelid[playerid] == 534 || // Broadway pmodelid[playerid] == 567 || pmodelid[playerid] == 536 || pmodelid[playerid] == 535 || pmodelid[playerid] == 576 || pmodelid[playerid] == 558) { new car = GetPlayerVehicleID(playerid); ChangeVehiclePaintjob(car,4); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added paintjob to car"); ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); } else { SendClientMessage(playerid,COLOR_WHITE,"[INFO] Paintjob is only for Wheel Arch Angrls and Loco Low Co types of cars"); ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); } } case 5: { ShowPlayerDialog(playerid, DIALOG_TYPE_PAINTJOBS, DIALOG_STYLE_LIST, "Paintjobs", "Paint Job 1\nPaint Job 2\nPaint Job 3\nPaint Job 4\nPaint Job 5\n \nBack", "Apply", "Close"); } case 6: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Paint Jobs\nColors\nHoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_COLORS: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,0,0); //GivePlayerMoney(playerid,-150); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 1: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,1,1); // GivePlayerMoney(playerid,-150); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 2: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,3,3); // GivePlayerMoney(playerid,-150); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 3: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,79,79); // GivePlayerMoney(playerid,-150); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 4: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,86,86); // GivePlayerMoney(playerid,-150); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 5: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,6,6); // GivePlayerMoney(playerid,-150); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 6: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,126,126); // GivePlayerMoney(playerid,-150); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 7: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,66,66); // GivePlayerMoney(playerid,-150); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 8: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,24,24); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 9: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,123,123); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 10: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,53,53); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 11: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,93,93); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 12: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,83,83); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 13: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,60,60); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 14: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,161,161); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 15: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); ChangeVehicleColor(car,153,153); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully repainted to car"); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } } case 16: { ShowPlayerDialog(playerid, DIALOG_TYPE_COLORS, DIALOG_STYLE_LIST, "Colors", "Black\nWhite\nRed\nBlue\nGreen\nYellow\nPink\nBrown\nGrey\nGold\nDark Blue\nLight Blue\nCold Green\nLight Grey\nDark Red\nDark Brown\n \nBack", "Apply", "Close"); } case 17: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "nHoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } }*/ case DIALOG_TYPE_EXHAUSTS: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem) { case 0: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 558 || pmodelid[playerid] == 561 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) { AddVehicleComponent(car,1034); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) { AddVehicleComponent(car,1046); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) { AddVehicleComponent(car,1065); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) { AddVehicleComponent(car,1064); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) { AddVehicleComponent(car,1028); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) { AddVehicleComponent(car,1089); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } case 1: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 558 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) { AddVehicleComponent(car,1037); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) { AddVehicleComponent(car,1045); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) { AddVehicleComponent(car,1066); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) { AddVehicleComponent(car,1059); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) { AddVehicleComponent(car,1029); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) { AddVehicleComponent(car,1092); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } case 2: { if(pmodelid[playerid] == 575 || pmodelid[playerid] == 534 || pmodelid[playerid] == 567 || pmodelid[playerid] == 536 || pmodelid[playerid] == 576 || pmodelid[playerid] == 535) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 575) // Brodway { AddVehicleComponent(car,1044); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 534)// Remington { AddVehicleComponent(car,1126); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 567)// Savanna { AddVehicleComponent(car,1129); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 536) // Blade { AddVehicleComponent(car,1104); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 535) // Slamvan { AddVehicleComponent(car,1113); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 576) // Tornado { AddVehicleComponent(car,1136); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } case 3: { if(pmodelid[playerid] == 575 || pmodelid[playerid] == 534 || pmodelid[playerid] == 567 || pmodelid[playerid] == 536 || pmodelid[playerid] == 576 || pmodelid[playerid] == 535) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 575) // Brodway { AddVehicleComponent(car,1043); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 534)// Remington { AddVehicleComponent(car,1127); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 567)// Savanna { AddVehicleComponent(car,1132); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 536) // Blade { AddVehicleComponent(car,1105); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 535) // Slamvan { AddVehicleComponent(car,1114); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 576) // Tornado { AddVehicleComponent(car,1135); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } case 4:// Large { if( pmodelid[playerid] == 401 ||//bravura pmodelid[playerid] == 518 ||//buccaneer pmodelid[playerid] == 527 ||//cadrona pmodelid[playerid] == 542 ||//clover pmodelid[playerid] == 589 ||//club pmodelid[playerid] == 400 ||//landstalker pmodelid[playerid] == 517 ||//majestic pmodelid[playerid] == 603 ||//phoenix pmodelid[playerid] == 426 ||//premier pmodelid[playerid] == 547 ||//primo pmodelid[playerid] == 405 ||//sentinel pmodelid[playerid] == 580 ||//stafford pmodelid[playerid] == 550 ||//sunrise pmodelid[playerid] == 549 ||//tampa pmodelid[playerid] == 477)//zr-350 { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 401) // bravura { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 518) // buccaneer { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 527) // cadrona { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 542) // clover { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 589) // club { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 400) // landstalker { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 603) // phoenix { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 436) // previon { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 547) // primo { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 405) // sentinel { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 580) // stafford { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 550) // sunrise { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 549) // tampa { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 477) // zr-350 { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 517) // majestic { AddVehicleComponent(car,1020); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } case 5: // Medium { if( pmodelid[playerid] == 527 ||//cadrona pmodelid[playerid] == 542 ||//clover pmodelid[playerid] == 400 ||//landstalker pmodelid[playerid] == 426 ||//premier pmodelid[playerid] == 436 ||//previon pmodelid[playerid] == 547 ||//primo pmodelid[playerid] == 405 ||//sentinel pmodelid[playerid] == 477)//zr-350 { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 527) // cadrona { AddVehicleComponent(car,1021); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 542) // clover { AddVehicleComponent(car,1021); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 400) // landstalker { AddVehicleComponent(car,1021); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 426) // premier { AddVehicleComponent(car,1021); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 436) // previon { AddVehicleComponent(car,1021); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 547) // primo { AddVehicleComponent(car,1021); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 405) // sentinel { AddVehicleComponent(car,1021); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 477) // zr350 { AddVehicleComponent(car,1021); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } case 6: // Small { if( pmodelid[playerid] == 436)//previon { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 436) // previon { AddVehicleComponent(car,1022); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } case 7: // Twin { if( pmodelid[playerid] == 518 ||//buccaneer pmodelid[playerid] == 415 ||//cheetah pmodelid[playerid] == 542 ||//clover pmodelid[playerid] == 546 ||//intruder pmodelid[playerid] == 400 ||//landstalker pmodelid[playerid] == 517 ||//majestic pmodelid[playerid] == 603 ||//phoenix pmodelid[playerid] == 426 ||//premier pmodelid[playerid] == 436 ||//previon pmodelid[playerid] == 547 ||//primo pmodelid[playerid] == 405 ||//sentinel pmodelid[playerid] == 550 ||//sunrise pmodelid[playerid] == 549 ||//tampa pmodelid[playerid] == 477)//zr-350 { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 518) // buccaneer { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 415) // cheetah { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 542) // clover { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 546) // intruder { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 400) // landstalker { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 517) // majestic { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 603) // phoenix { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 426) // premier { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 436) // previon { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 547) // primo { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 405 ) // sentinel { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 550) // sunrise { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 549) // tampa { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 477) // zr-350 { AddVehicleComponent(car,1019); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } case 8: // Upswept { if( pmodelid[playerid] == 401 ||//bravura pmodelid[playerid] == 518 ||//buccaneer pmodelid[playerid] == 415 ||//cheetah pmodelid[playerid] == 542 ||//clover pmodelid[playerid] == 546 ||//intruder pmodelid[playerid] == 400 ||//landstalker pmodelid[playerid] == 517 ||//majestic pmodelid[playerid] == 603 ||//phoenix pmodelid[playerid] == 426 ||//premier pmodelid[playerid] == 415 ||//cheetah pmodelid[playerid] == 547 ||//primo pmodelid[playerid] == 405 ||//sentinel pmodelid[playerid] == 550 ||//sunrise pmodelid[playerid] == 549 ||//tampa pmodelid[playerid] == 477)//zr-350 { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 415) // cheetah { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 518) // buccaneer { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 527) // cadrona { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 542) // clover { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 589) // club { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 400) // landstalker { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 603) // phoenix { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 546) // intruder { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 547) // primo { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 405) // sentinel { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 580) // stafford { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 550) // sunrise { AddVehicleComponent(car,1018); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 549) // tampa { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 477) // zr-350 { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 517) // majestic { AddVehicleComponent(car,1018); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } } case 9: // _ { ShowPlayerDialog(playerid, DIALOG_TYPE_EXHAUSTS, DIALOG_STYLE_LIST, "Exhausts", "Wheel Arc. Alien exhaust\nWheel Arc. X-Flow exhaust\nLow Co. Chromer exhaust\nLow Co. Slamin exhaust\nTransfender Large exhaust\nTransfender Medium exhaust\nTransfender Small exhaust\nTransfender Twin exhaust\nTransfender Upswept exhaust\n \nBack", "Apply", "Close"); } case 10: // Back { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_FBUMPS: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 558 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) // Elegy { AddVehicleComponent(car,1171); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) // Flash { AddVehicleComponent(car,1153); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) // Jester { AddVehicleComponent(car,1160); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) // Stratum { AddVehicleComponent(car,1155); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) // Sultan { AddVehicleComponent(car,1169); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) // Uranus { AddVehicleComponent(car,1166); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } } case 1: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 558 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) // Elegy { AddVehicleComponent(car,1172); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) // Flash { AddVehicleComponent(car,1152); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) // Jetser { AddVehicleComponent(car,1173); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) // Stratum { AddVehicleComponent(car,1157); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) // Sultan { AddVehicleComponent(car,1170); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) // Uranus { AddVehicleComponent(car,1165); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } } case 2: { if(pmodelid[playerid] == 575 || pmodelid[playerid] == 534 || pmodelid[playerid] == 567 || pmodelid[playerid] == 536 || pmodelid[playerid] == 576 || pmodelid[playerid] == 535) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 575) // Brodway { AddVehicleComponent(car,1174); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 534)// Remington { AddVehicleComponent(car,1179); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 567)// Savanna { AddVehicleComponent(car,1189); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 536) // Blade { AddVehicleComponent(car,1182); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 535) // Slamvan { AddVehicleComponent(car,1115); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 576) // Tornado { AddVehicleComponent(car,1191); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } } case 3: { if(pmodelid[playerid] == 575 || pmodelid[playerid] == 534 || pmodelid[playerid] == 567 || pmodelid[playerid] == 535 || pmodelid[playerid] == 536 || pmodelid[playerid] == 576 || pmodelid[playerid] == 576) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 575) // Brodway { AddVehicleComponent(car,1175); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 534)// Remington { AddVehicleComponent(car,1185); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 567)// Savanna { AddVehicleComponent(car,1188); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 536) // Blade { AddVehicleComponent(car,1181); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 535) // Slamvan { AddVehicleComponent(car,1116); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 576) // Tornado { AddVehicleComponent(car,1190); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } } case 4: { ShowPlayerDialog(playerid, DIALOG_TYPE_FBUMPS, DIALOG_STYLE_LIST,"Front Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow co. Chromer Bumper\nLow co. Slamin Bumper\n \nBack", "Apply", "Close"); } case 5: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_RBUMPS: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 558 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) // Elegy { AddVehicleComponent(car,1149); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) // Flash { AddVehicleComponent(car,1150); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) // Jester { AddVehicleComponent(car,1159); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) // Stratum { AddVehicleComponent(car,1154); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) // Sultan { AddVehicleComponent(car,1141); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) // Uranus { AddVehicleComponent(car,1168); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } } case 1: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 558 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) // Elegy { AddVehicleComponent(car,1148); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] YComponent successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) // Flash { AddVehicleComponent(car,1151); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) // Jetser { AddVehicleComponent(car,1161); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) // Stratum { AddVehicleComponent(car,1156); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) // Sultan { AddVehicleComponent(car,1140); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) // Uranus { AddVehicleComponent(car,1167); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } } case 2: { if(pmodelid[playerid] == 575 || pmodelid[playerid] == 534 || pmodelid[playerid] == 567 || pmodelid[playerid] == 536 || pmodelid[playerid] == 576 || pmodelid[playerid] == 535) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 575) // Brodway { AddVehicleComponent(car,1176); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 534)// Remington { AddVehicleComponent(car,1180); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 567)// Savanna { AddVehicleComponent(car,1187); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 536) // Blade { AddVehicleComponent(car,1184); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 535) // Slamvan { AddVehicleComponent(car,1109); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 576) // Tornado { AddVehicleComponent(car,1192); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } } case 3: { if(pmodelid[playerid] == 575 || pmodelid[playerid] == 534 || pmodelid[playerid] == 567 || pmodelid[playerid] == 536 || pmodelid[playerid] == 576 || pmodelid[playerid] == 535) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 575) // Brodway { AddVehicleComponent(car,1177); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 534)// Remington { AddVehicleComponent(car,1178); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 567)// Savanna { AddVehicleComponent(car,1186); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 536) // Blade { AddVehicleComponent(car,1183); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 535) // Slamvan { AddVehicleComponent(car,1110); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 576) // Tornado { AddVehicleComponent(car,1193); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } } case 4: { ShowPlayerDialog(playerid, DIALOG_TYPE_RBUMPS, DIALOG_STYLE_LIST, "Rear Bumpers", "Wheel Arc. Alien Bumper\nWheel Arc. X-Flow Bumper\nLow Co. Chromer Bumper\nLow Co. Slamin Bumper\n \nBack", "Apply", "Close"); } case 5: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_ROOFS: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 558 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) // Elegy { AddVehicleComponent(car,1038); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) // Flash { AddVehicleComponent(car,1054); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) // Jester { AddVehicleComponent(car,1067); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) // Stratum { AddVehicleComponent(car,1055); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) // Sultan { AddVehicleComponent(car,1032); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) // Uranus { AddVehicleComponent(car,1088); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } } case 1: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 558 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) // Elegy { AddVehicleComponent(car,1035); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) // Flash { AddVehicleComponent(car,1053); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) // Jetser { AddVehicleComponent(car,1068); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) // Stratum { AddVehicleComponent(car,1061); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) // Sultan { AddVehicleComponent(car,1033); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) // Uranus { AddVehicleComponent(car,1091); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } } case 2: { if(pmodelid[playerid] == 567 || pmodelid[playerid] == 536) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 567) // Savanna { AddVehicleComponent(car,1130); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 536) // Blade { AddVehicleComponent(car,1128); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } } case 3: { if(pmodelid[playerid] == 567 || pmodelid[playerid] == 536) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 567) // Savanna { AddVehicleComponent(car,1131); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 536) // Blade { AddVehicleComponent(car,1103); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } } case 4: { if( pmodelid[playerid] == 401 || pmodelid[playerid] == 518 || pmodelid[playerid] == 589 || pmodelid[playerid] == 492 || pmodelid[playerid] == 546 || pmodelid[playerid] == 603 || pmodelid[playerid] == 426 || pmodelid[playerid] == 436 || pmodelid[playerid] == 580 || pmodelid[playerid] == 550|| pmodelid[playerid] == 477) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 401) { AddVehicleComponent(car,1006); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 518) { AddVehicleComponent(car,1006); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 589) { AddVehicleComponent(car,1006); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 492) { AddVehicleComponent(car,1006); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 546) { AddVehicleComponent(car,1006); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 603) { AddVehicleComponent(car,1006); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 426) { AddVehicleComponent(car,1006); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 436) { AddVehicleComponent(car,1006); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 580) { AddVehicleComponent(car,1006); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 550) { AddVehicleComponent(car,1006); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 477) { AddVehicleComponent(car,1006); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } } case 5: { ShowPlayerDialog(playerid, DIALOG_TYPE_ROOFS, DIALOG_STYLE_LIST, "Roofs", "Wheel Arc. Alien\nWheel Arc. X-Flow\nLow Co. Hardtop Roof\nLow Co. Softtop Roof\nTransfender Roof Scoop\n \nBack", "Apply", "Close"); } case 6: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_SPOILERS: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 558 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) // Elegy { AddVehicleComponent(car,1147); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) // Flash { AddVehicleComponent(car,1049); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) // Jester { AddVehicleComponent(car,1162); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) // Stratum { AddVehicleComponent(car,1158); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) // Sultan { AddVehicleComponent(car,1138); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) // Uranus { AddVehicleComponent(car,1164); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } case 1: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 558 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) // Elegy { AddVehicleComponent(car,1146); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) // Flash { AddVehicleComponent(car,1150); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) // Jetser { AddVehicleComponent(car,1158); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) // Stratum { AddVehicleComponent(car,1060); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) // Sultan { AddVehicleComponent(car,1139); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) // Uranus { AddVehicleComponent(car,1163); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } case 2:// Win { if( pmodelid[playerid] == 401 ||//bravura pmodelid[playerid] == 518 ||//buccaneer pmodelid[playerid] == 527 ||//cadrona pmodelid[playerid] == 415 ||//cheetah pmodelid[playerid] == 546 ||//intruder pmodelid[playerid] == 603 ||//phoenix pmodelid[playerid] == 426 ||//premier pmodelid[playerid] == 436 ||//previon pmodelid[playerid] == 405 ||//sentinel pmodelid[playerid] == 477 ||//stallion pmodelid[playerid] == 580 ||//stafford pmodelid[playerid] == 550 ||//sunrise pmodelid[playerid] == 549)//tampa { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 401) // bravura { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 518) // buccaneer { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 527) // cadrona { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 415) // cheetah { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 546) // intruder { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 603) // phoenix { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 426) // premier { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 436) // previon { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 405) // sentinel { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 477) // stallion { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 580) // stafford { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 550) // sunrise { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 549) // tampa { AddVehicleComponent(car,1001); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } case 3: // Fury { if( pmodelid[playerid] == 518 ||//buccaneer pmodelid[playerid] == 415 ||//cheetah pmodelid[playerid] == 546 ||//intruder pmodelid[playerid] == 517 ||//majestic pmodelid[playerid] == 603 ||//phoenix pmodelid[playerid] == 405 ||//sentinel pmodelid[playerid] == 477 ||//stallion pmodelid[playerid] == 580 ||//stafford pmodelid[playerid] == 550 ||//sunrise pmodelid[playerid] == 549)//tampa { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 518) // buccaneer { AddVehicleComponent(car,1023); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 415) // cheetah { AddVehicleComponent(car,1023); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 546) // intruder { AddVehicleComponent(car,1023); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 517) // majestic { AddVehicleComponent(car,1023); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 603) // phoenix { AddVehicleComponent(car,1023); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 405) // sentinel { AddVehicleComponent(car,1023); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 477) // stallion { AddVehicleComponent(car,1023); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 580) // stafford { AddVehicleComponent(car,1023); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 550) // sunrise { AddVehicleComponent(car,1023); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 549) // tampa { AddVehicleComponent(car,1023); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } case 4: // Alpha { if( pmodelid[playerid] == 518 ||//buccaneer pmodelid[playerid] == 415 ||//cheetah pmodelid[playerid] == 401 ||//bravura pmodelid[playerid] == 517 ||//majestic pmodelid[playerid] == 426 ||//premier pmodelid[playerid] == 436 ||//previon pmodelid[playerid] == 477 ||//stallion pmodelid[playerid] == 547 ||//primo pmodelid[playerid] == 550 ||//sunrise pmodelid[playerid] == 549)//tampa { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 518) // buccaneer { AddVehicleComponent(car,1003); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 415) // cheetah { AddVehicleComponent(car,1003); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 401) // bravura { AddVehicleComponent(car,1003); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 517) // majestic { AddVehicleComponent(car,1003); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 426) // premier { AddVehicleComponent(car,1003); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 436) // previon { AddVehicleComponent(car,1003); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 477) // stallion { AddVehicleComponent(car,1003); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 547) // primo { AddVehicleComponent(car,1003); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 550) // sunrise { AddVehicleComponent(car,1003); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 549) // tampa { AddVehicleComponent(car,1003); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } case 5: // Pro { if( pmodelid[playerid] == 589 ||//club pmodelid[playerid] == 492 ||//greenwood pmodelid[playerid] == 547 ||//primo pmodelid[playerid] == 405)//sentinel { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 518) // club { AddVehicleComponent(car,1000); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 492) // greenwood { AddVehicleComponent(car,1000); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 547) // primo { AddVehicleComponent(car,1000); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 405) // sentinel { AddVehicleComponent(car,1000); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } case 6: // Champ { if( pmodelid[playerid] == 527 ||//cadrona pmodelid[playerid] == 542 ||//clover pmodelid[playerid] == 405)//sentinel { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 527) // cadrona { AddVehicleComponent(car,1014); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 542) // clover { AddVehicleComponent(car,1014); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 405) // sentinel { AddVehicleComponent(car,1014); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } case 7: // Race { if( pmodelid[playerid] == 527 ||//cadrona pmodelid[playerid] == 542)//clover { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 527) // cadrona { AddVehicleComponent(car,1014); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 542) // clover { AddVehicleComponent(car,1014); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } case 8: // Drag { if( pmodelid[playerid] == 546 ||//intruder pmodelid[playerid] == 517)//majestic { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 546) // intruder { AddVehicleComponent(car,1002); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 517) // majestic { AddVehicleComponent(car,1002); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } } case 9: { ShowPlayerDialog(playerid, DIALOG_TYPE_SPOILERS, DIALOG_STYLE_LIST, "Spoilers", "Wheel Arc. Alien Spoiler\nWheel Arc. X-Flow Spoiler\nTransfender Win Spoiler\nTransfender Fury Spoiler\nTransfender Alpha Spoiler\nTransfender Pro Spoiler\nTransfender Champ Spoiler\nTransfender Race Spoiler\nTransfender Drag Spoiler\n \nBack", "Apply", "Close"); } case 10: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_SIDESKIRTS: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 558 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) // Elegy { AddVehicleComponent(car,1036); AddVehicleComponent(car,1040); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) // Flash { AddVehicleComponent(car,1047); AddVehicleComponent(car,1051); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) // Jester { AddVehicleComponent(car,1069); AddVehicleComponent(car,1071); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] YComponent successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) // Stratum { AddVehicleComponent(car,1056); AddVehicleComponent(car,1062); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) // Sultan { AddVehicleComponent(car,1026); AddVehicleComponent(car,1027); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) // Uranus { AddVehicleComponent(car,1090); AddVehicleComponent(car,1094); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } case 1: { if(pmodelid[playerid] == 562 || pmodelid[playerid] == 565 || pmodelid[playerid] == 559 || pmodelid[playerid] == 561 || pmodelid[playerid] == 558 || pmodelid[playerid] == 560) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 562) // Elegy { AddVehicleComponent(car,1039); AddVehicleComponent(car,1041); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 565) // Flash { AddVehicleComponent(car,1048); AddVehicleComponent(car,1052); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 559) // Jetser { AddVehicleComponent(car,1070); AddVehicleComponent(car,1072); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 561) // Stratum { AddVehicleComponent(car,1057); AddVehicleComponent(car,1063); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 560) // Sultan { AddVehicleComponent(car,1031); AddVehicleComponent(car,1030); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 558) // Uranus { AddVehicleComponent(car,1093); AddVehicleComponent(car,1095); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } case 2: { if(pmodelid[playerid] == 575 || pmodelid[playerid] == 536 || pmodelid[playerid] == 576 || pmodelid[playerid] == 567) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 575) // Brodway { AddVehicleComponent(car,1042); AddVehicleComponent(car,1099); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 567) // Savanna { AddVehicleComponent(car,1102); AddVehicleComponent(car,1133); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 576) // Tornado { AddVehicleComponent(car,1134); AddVehicleComponent(car,1137); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } else if(pmodelid[playerid] == 536) // Blade { AddVehicleComponent(car,1108); AddVehicleComponent(car,1107); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } case 3: { if(pmodelid[playerid] == 534 || pmodelid[playerid] == 534) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 534) // Remington { AddVehicleComponent(car,1122); AddVehicleComponent(car,1101); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } case 4: { if(pmodelid[playerid] == 534 || pmodelid[playerid] == 534) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 534) // Remington { AddVehicleComponent(car,1106); AddVehicleComponent(car,1124); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car. "); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } case 5: { if(pmodelid[playerid] == 535) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 535) // Slamvan { AddVehicleComponent(car,1118); AddVehicleComponent(car,1120); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car. "); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } case 6: { if(pmodelid[playerid] == 535) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 535) // Slamvan { AddVehicleComponent(car,1119); AddVehicleComponent(car,1121); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car. "); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } case 7: { if( pmodelid[playerid] == 401 || pmodelid[playerid] == 518 || pmodelid[playerid] == 527 || pmodelid[playerid] == 415 || pmodelid[playerid] == 589 || pmodelid[playerid] == 546 || pmodelid[playerid] == 517 || pmodelid[playerid] == 603 || pmodelid[playerid] == 436 || pmodelid[playerid] == 439 || pmodelid[playerid] == 580 || pmodelid[playerid] == 549 || pmodelid[playerid] == 477) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 401) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 518) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 527) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 415) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 589) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 546) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 517) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 603) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 436) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 439) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 580) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 549) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 477) { AddVehicleComponent(car,1007); AddVehicleComponent(car,1017); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } } case 8: { ShowPlayerDialog(playerid, DIALOG_TYPE_SIDESKIRTS, DIALOG_STYLE_LIST, "Side Skirts", "Wheel Arc. Alien Side Skirt\nWheel Arc. X-Flow Side Skirt\nLocos Chrome Strip\nLocos Chrome Flames\nLocos Chrome Arches \nLocos Chrome Trim\nLocos Wheelcovers\nTransfender Side Skirt\n \nBack", "Apply", "Close"); } case 9: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_BULLBARS: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0: { if(pmodelid[playerid] == 534) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 534) // Remington { AddVehicleComponent(car,1100); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_BULLBARS, DIALOG_STYLE_LIST, "Bullbars", "Locos Chrome Grill\nLocos Chrome Bars\nLocos Chrome Lights \nLocos Chrome Bullbar\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car. "); ShowPlayerDialog(playerid, DIALOG_TYPE_BULLBARS, DIALOG_STYLE_LIST, "Bullbars", "Locos Chrome Grill\nLocos Chrome Bars\nLocos Chrome Lights \nLocos Chrome Bullbar\n \nBack", "Apply", "Close"); } } case 1: { if(pmodelid[playerid] == 534) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 534) // Remington { AddVehicleComponent(car,1123); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_BULLBARS, DIALOG_STYLE_LIST, "Bullbars", "Locos Chrome Grill\nLocos Chrome Bars\nLocos Chrome Lights \nLocos Chrome Bullbar\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car. "); ShowPlayerDialog(playerid, DIALOG_TYPE_BULLBARS, DIALOG_STYLE_LIST, "Bullbars", "Locos Chrome Grill\nLocos Chrome Bars\nLocos Chrome Lights \nLocos Chrome Bullbar\n \nBack", "Apply", "Close"); } } case 2: { if(pmodelid[playerid] == 534) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 534) // Remington { AddVehicleComponent(car,1125); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_BULLBARS, DIALOG_STYLE_LIST, "Bullbars", "Locos Chrome Grill\nLocos Chrome Bars\nLocos Chrome Lights \nLocos Chrome Bullbar\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component to your car. "); ShowPlayerDialog(playerid, DIALOG_TYPE_BULLBARS, DIALOG_STYLE_LIST, "Bullbars", "Locos Chrome Grill\nLocos Chrome Bars\nLocos Chrome Lights \nLocos Chrome Bullbar\n \nBack", "Apply", "Close"); } } case 3: { if(pmodelid[playerid] == 535) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 535) // Slamvan { AddVehicleComponent(car,1117); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_BULLBARS, DIALOG_STYLE_LIST, "Bullbars", "Locos Chrome Grill\nLocos Chrome Bars\nLocos Chrome Lights \nLocos Chrome Bullbar\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] ou cannot install this component to your car. "); ShowPlayerDialog(playerid, DIALOG_TYPE_BULLBARS, DIALOG_STYLE_LIST, "Bullbars", "Locos Chrome Grill\nLocos Chrome Bars\nLocos Chrome Lights \nLocos Chrome Bullbar\n \nBack", "Apply", "Close"); } } case 4: { ShowPlayerDialog(playerid, DIALOG_TYPE_BULLBARS, DIALOG_STYLE_LIST, "Bullbars", "Locos Chrome Grill\nLocos Chrome Bars\nLocos Chrome Lights \nLocos Chrome Bullbar\n \nBack", "Apply", "Close"); } case 5: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_WHEELS: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1025); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Offroad Wheels "); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 1: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1074); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Mega Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 2: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1076); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Wires Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 3: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1078); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Twist Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 4: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1081); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Grove Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 5: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1082); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Import Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 6: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1085); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Atomic Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 7: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1096); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Ahab Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 8: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1097); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Virtual Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 9: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1098); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Access Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 10: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1084); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Trance Wheels "); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 11: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1073); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Shadow Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 12: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1075); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Rimshine Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 13: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1077); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Classic Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 14: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1079); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Cutter Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 15: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1080); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Switch Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 16: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1083); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] You have succesfully added Dollar Wheels"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } } case 17: { ShowPlayerDialog(playerid, DIALOG_TYPE_WHEELS, DIALOG_STYLE_LIST, "Wheels", "Offroad\nMega\nWires\nTwist\nGrove\nImport\nAtomic\nAhab\nVirtual\nAccess\nTrance\nShadow\nRimshine\nClassic\nCutter\nSwitch\nDollar\n \nBack", "Apply", "Close"); } case 18: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_CSTEREO: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1086); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added. "); ShowPlayerDialog(playerid, DIALOG_TYPE_CSTEREO, DIALOG_STYLE_LIST, "Car Stereo", "Bass Boost\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_CSTEREO, DIALOG_STYLE_LIST, "Car Stereo", "Bass Boost\n \nBack", "Apply", "Close"); } } case 1: { ShowPlayerDialog(playerid, DIALOG_TYPE_CSTEREO, DIALOG_STYLE_LIST, "Car Stereo", "Bass Boost\n \nBack", "Apply", "Close"); } case 2: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_HYDRAULICS: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1087); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added. "); ShowPlayerDialog(playerid, DIALOG_TYPE_HYDRAULICS, DIALOG_STYLE_LIST, "Hydaulics", "Hydaulics\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_HYDRAULICS, DIALOG_STYLE_LIST, "Hydaulics", "Hydaulics\n \nBack", "Apply", "Close"); } } case 1: { ShowPlayerDialog(playerid, DIALOG_TYPE_HYDRAULICS, DIALOG_STYLE_LIST, "Hydaulics", "Hydaulics\n \nBack", "Apply", "Close"); } case 2: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_NITRO: { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1008); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added. "); ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } case 1: { if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1009); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } case 2: if(GetPlayerMoney(playerid) >= 0) { new car = GetPlayerVehicleID(playerid); AddVehicleComponent(car,1010); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added."); ShowPlayerDialog(playerid, DIALOG_TYPE_NITRO, DIALOG_STYLE_LIST, "Nitrous Oxide", "2x Nitrous\n5x Nitrous\n10x Nitrous\n \nBack", "Apply", "Close"); } else { SendClientMessage(playerid,COLOR_RED,"Not enough money!"); ShowPlayerDialog(playerid, DIALOG_TYPE_NITRO, DIALOG_STYLE_LIST, "Nitrous Oxide", "2x Nitrous\n5x Nitrous\n10x Nitrous\n \nBack", "Apply", "Close"); } case 3: { ShowPlayerDialog(playerid, DIALOG_TYPE_NITRO, DIALOG_STYLE_LIST, "Nitrous Oxide", "2x Nitrous\n5x Nitrous\n10x Nitrous\n \nBack", "Apply", "Close"); } case 4: { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } case DIALOG_TYPE_HOODS:// HOODS { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0:// fury { if( pmodelid[playerid] == 401 || pmodelid[playerid] == 518 || pmodelid[playerid] == 589 || pmodelid[playerid] == 492 || pmodelid[playerid] == 426 || pmodelid[playerid] == 550) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 401) // bravura { AddVehicleComponent(car,1005); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 518) // buccaneer { AddVehicleComponent(car,1005); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 589) // club { AddVehicleComponent(car,1005); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 492) // greenwood { AddVehicleComponent(car,1005); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 426) // premier { AddVehicleComponent(car,1005); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 550) // sunrise { AddVehicleComponent(car,1005); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } } case 1: // Champ { if( pmodelid[playerid] == 401 || pmodelid[playerid] == 492 || pmodelid[playerid] == 546 || pmodelid[playerid] == 426 || pmodelid[playerid] == 550) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 401) // bravura { AddVehicleComponent(car,1004); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 546) // intruder { AddVehicleComponent(car,1004); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 492) // greenwood { AddVehicleComponent(car,1004); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 426) // premier { AddVehicleComponent(car,1004); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 550) // sunrise { AddVehicleComponent(car,1004); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } } case 2: // Race { if( pmodelid[playerid] == 549) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 549) // tampa { AddVehicleComponent(car,1011); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } } case 3: // Worx { if( pmodelid[playerid] == 549) { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 549) // tampa { AddVehicleComponent(car,1012); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } } case 4: { ShowPlayerDialog(playerid, DIALOG_TYPE_HOODS, DIALOG_STYLE_LIST, "Hoods", "Fury\nChamp\nRace\nWorx\n \nBack", "Apply", "Close"); } case 5: // Back { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } ////////////////////////////////////////end of hoods/////////// case DIALOG_TYPE_VENTS://////////////////VENTS////////////////// { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0:// Oval { if( pmodelid[playerid] == 401 ||//bravura pmodelid[playerid] == 518 ||//buccaneer pmodelid[playerid] == 546 ||//intruder pmodelid[playerid] == 517 ||//majestic pmodelid[playerid] == 603 ||//phoenix pmodelid[playerid] == 547 ||//primo pmodelid[playerid] == 439 ||//stallion pmodelid[playerid] == 550 ||//sunrise pmodelid[playerid] == 549)//tampa { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 401) // bravura { AddVehicleComponent(car,1142); AddVehicleComponent(car,1143); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 518) // buccaneer { AddVehicleComponent(car,1142); AddVehicleComponent(car,1143); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 546) // intruder { AddVehicleComponent(car,1142); AddVehicleComponent(car,1143); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 517) // majestic { AddVehicleComponent(car,1142); AddVehicleComponent(car,1143); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 603) // phoenix { AddVehicleComponent(car,1142); AddVehicleComponent(car,1143); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 547) // primo { AddVehicleComponent(car,1142); AddVehicleComponent(car,1143); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 439) // stallion { AddVehicleComponent(car,1142); AddVehicleComponent(car,1143); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 550) // sunrise { AddVehicleComponent(car,1142); AddVehicleComponent(car,1143); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 549) // tampa { AddVehicleComponent(car,1142); AddVehicleComponent(car,1143); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } } case 1: // Square { if( pmodelid[playerid] == 401 ||//bravura pmodelid[playerid] == 518 ||//buccaneer pmodelid[playerid] == 589 ||//club pmodelid[playerid] == 546 ||//intruder pmodelid[playerid] == 517 ||//majestic pmodelid[playerid] == 603 ||//phoenix pmodelid[playerid] == 439 ||//stallion pmodelid[playerid] == 550 ||//sunrise pmodelid[playerid] == 549)//tampa { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 401) // bravura { AddVehicleComponent(car,1144); AddVehicleComponent(car,1145); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 518) // buccaneer { AddVehicleComponent(car,1144); AddVehicleComponent(car,1145); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 589) // club { AddVehicleComponent(car,1144); AddVehicleComponent(car,1145); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 546) // intruder { AddVehicleComponent(car,1144); AddVehicleComponent(car,1145); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 517) // majestic { AddVehicleComponent(car,1144); AddVehicleComponent(car,1145); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 603) // phoenix { AddVehicleComponent(car,1144); AddVehicleComponent(car,1145); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 439) // stallion { AddVehicleComponent(car,1144); AddVehicleComponent(car,1145); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 550) // sunrise { AddVehicleComponent(car,1144); AddVehicleComponent(car,1145); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 549) // tampa { AddVehicleComponent(car,1144); AddVehicleComponent(car,1145); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } } case 2: // _ { ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } case 3: // Back { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } } ///////////END OF VENTS/////////// case DIALOG_TYPE_LIGHTS://////////////////LIGTS////////////////// { if(!response) { SetCameraBehindPlayer(playerid); } if(response) { switch(listitem)// Checking which list item was selected { case 0:// round { if( pmodelid[playerid] == 401 ||//bravura pmodelid[playerid] == 518 ||//buccaneer pmodelid[playerid] == 589 ||//club pmodelid[playerid] == 400 ||//landstalker pmodelid[playerid] == 436 ||//previon pmodelid[playerid] == 439)//stallion { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 401) // bravura { AddVehicleComponent(car,1013); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO]Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_LIGHTS, DIALOG_STYLE_LIST, "Lights", "Round\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 518) // buccaneer { AddVehicleComponent(car,1013); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_LIGHTS, DIALOG_STYLE_LIST, "Lights", "Round\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 589) // club { AddVehicleComponent(car,1013); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_LIGHTS, DIALOG_STYLE_LIST, "Lights", "Round\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 400) // landstalker { AddVehicleComponent(car,1013); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_LIGHTS, DIALOG_STYLE_LIST, "Lights", "Round\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 436) // previon { AddVehicleComponent(car,1013); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_LIGHTS, DIALOG_STYLE_LIST, "Lights", "Round\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 439) // stallion { AddVehicleComponent(car,1013); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_LIGHTS, DIALOG_STYLE_LIST, "Lights", "Round\nSquare\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_LIGHTS, DIALOG_STYLE_LIST, "Lights", "Round\nSquare\n \nBack", "Apply", "Close"); } } case 1: // Square { if( pmodelid[playerid] == 589 ||//club pmodelid[playerid] == 603 ||//phoenix pmodelid[playerid] == 400)//landstalker { new car = GetPlayerVehicleID(playerid); if(pmodelid[playerid] == 589) // club { AddVehicleComponent(car,1024); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 603) // phoenix { AddVehicleComponent(car,1024); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } if(pmodelid[playerid] == 400) // landstalker { AddVehicleComponent(car,1024); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendClientMessage(playerid,COLOR_WHITE,"[INFO] Component successfully added"); ShowPlayerDialog(playerid, DIALOG_TYPE_VENTS, DIALOG_STYLE_LIST, "Vents", "Oval\nSquare\n \nBack", "Apply", "Close"); } } else { SendClientMessage(playerid,COLOR_YELLOW,"[WARNING] You cannot install this component on your car."); ShowPlayerDialog(playerid, DIALOG_TYPE_LIGHTS, DIALOG_STYLE_LIST, "Lights", "Round\nSquare\n \nBack", "Apply", "Close"); } } case 2: // _ { ShowPlayerDialog(playerid, DIALOG_TYPE_LIGHTS, DIALOG_STYLE_LIST, "Lights", "Round\nSquare\n \nBack", "Apply", "Close"); } case 3: // Back { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); } } } return 1; } case DIALOG_FINDDEALERSHIP: { if(response) { new str[200]; PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, dsData[listitem][dX], dsData[listitem][dY], dsData[listitem][dZ], 3.0); format(str, sizeof(str), "** Checkpoint marked at the location of %s %s dealership.", dsData[listitem][dName], GetTypeName(listitem)); SendClientMessage(playerid, COLOR_WHITE, str); } } case DIALOG_AHELP: { if(response) { new str[5000]; switch(listitem) { case 0: // lvl 1 { format(str, sizeof(str), "%s/a, /clearchat, /sjail, /pinfo, /spec, /admins, /flag, /removeflag, /listflags, /check, /dm\n", str); } case 1: // lvl 2 { format(str, sizeof(str), "%s/aduty, /adminname, /kick, /ban, /warn, /slap, /ar, /tr, /rr, /cr, /setint, /setvw.\n", str); format(str, sizeof(str), "%s/setskin, /revive, /heject, /goto, /gethere, /gotocar,/aheal, /getcar, /gotoco, /gotoint, /listen, /jetpack, /sendto.\n", str); format(str, sizeof(str), "%s/freeze, /unfreeze, /rwarn, /runmute, /nmute, /admute, /hmute, /gmute, /skiptut, /listguns, /disarm.\n", str); format(str, sizeof(str), "%s/jail, /listjailed, /lastactive, /checkinv, /afklist, /acceptname, /denyname, /namechanges, /nrn.\n", str); } case 2: // lvl 3 { format(str, sizeof(str), "%s/ban, /(o)getip, /iplookup\n", str); format(str, sizeof(str), "%s/prison, /sprison, /oprison, /release, /fine, /pfine, /ofine, /sethp, /setarmor, /mark, /gotomark.\n", str); format(str, sizeof(str), "%s/veh, /destroyveh, /respawncars, /broadcast, /fixveh, /healrange.\n", str); format(str, sizeof(str), "%s/resetadtimer, /baninfo, /banhistory, /togooc, /tognewbie, /togglobal, /listpvehs, /despawnpveh.\n", str); format(str, sizeof(str), "%s/aclearwanted, /removedm, /savevehicle, /editvehicle, /removevehicle, /vehicleinfo, /refillcars, /refilldrug.\n", str); format(str, sizeof(str), "%s/alock, /duel, /startchat, /invitechat, /kickchat, /endchat, /freezerange, /unfreezerange, /reviverange.\n", str); } case 3: // lvl 4 { format(str, sizeof(str), "%s/givegun, /setname, /setweather, /permaban, /oban, /unban, /unbanip, /banip, /lockaccount, /unlockaccount.\n", str); format(str, sizeof(str), "%s/explode, /event, /gplay, /gplayurl, /gstop, /sethpall, /setarmorall, /settime, /addtoevent, /eventkick.\n", str); } case 4: // lvl 5 { format(str, sizeof(str), "%s/setstat, /givecookie, /givecookieall, /saveaccounts.\n", str); format(str, sizeof(str), "%s/removevip, /rangeban, /previewint, /nearest, /dynamichelp, /listassets.\n", str); format(str, sizeof(str), "%s/adestroyboombox, /setbanktimer, /resetrobbery, /addtorobbery, /givepayday, /givepveh, /givedoublexp.\n", str); } case 5: // lvl 6 { format(str, sizeof(str), "%s/makehelper, /omakehelper, /setmotd, /forceaduty.\n", str); format(str, sizeof(str), "%s/olisthelpers, /sellinactive, /inactivecheck, /changelist, /fixplayerid, /giveachievement.\n", str); format(str, sizeof(str), "%s/settitle, /oadmins, /disablevpn, /landperms, /forcedeleteobject, /obscurent, /ovips.\n", str); } case 6: // lvl 7 { format(str, sizeof(str), "%s/placegiftbox, /giftall, /givebackpack, /removebackpack, /givemoney, /editbackpack\n", str); } case 7: // lvl 8 { format(str, sizeof(str), "%s/getip, /ogetip, /iplookup, <- Before u refund!\n", str); } } ShowPlayerDialog(playerid, DIALOG_ACMDS, DIALOG_STYLE_MSGBOX, "Admin commands:", str, "Back", "Close"); } } case DIALOG_ACMDS: { if(response) { return callcmd::adminhelp(playerid, ""); } } case DIALOG_RACKWEAPONS: { if (response) { new id = Rack_Nearest(playerid); if (id == -1) return 0; if (!RackData[id][rackWeapons][listitem]) { if (!GetScriptWeapon(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You must be holding a weapon to store it."); RackData[id][rackWeapons][listitem] = GetScriptWeapon(playerid); //RackData[id][rackAmmo][listitem] = GetPlayerAmmo(playerid); RemovePlayerWeapon(playerid, GetScriptWeapon(playerid)); Rack_RefreshGuns(id); Rack_Save(id); ApplyAnimationEx(playerid, "WEAPONS", "SHP_Ar_Lift", 4.1, 1, 0, 0, 0, 0); SendProximityMessage(playerid, 30.0, COLOR_PURPLE, "** %s has stored a %s on the weapon rack.", GetPlayerRPName(playerid), GetWeaponNameEx(RackData[id][rackWeapons][listitem])); } else { GivePlayerWeaponEx(playerid, RackData[id][rackWeapons][listitem]); SendProximityMessage(playerid, 30.0, COLOR_PURPLE, "** %s has taken a %s from the weapon rack.", GetPlayerRPName(playerid), GetWeaponNameEx(RackData[id][rackWeapons][listitem])); RackData[id][rackWeapons][listitem] = 0; //RackData[id][rackAmmo][listitem] = 0; Rack_RefreshGuns(id); Rack_Save(id); ApplyAnimationEx(playerid, "WEAPONS", "SHP_Tray_Out", 4.1, 1, 0, 0, 0, 0); } } } case DIALOG_GRAFFITICOLOR: { if (response) { new id = Graffiti_Nearest(playerid); if (id == -1) return 0; if (IsSprayingInProgress(id)) { return SendClientMessage(playerid, COLOR_GREY, "There is another player spraying at this point already."); } switch (listitem) { case 0: { PlayerInfo[playerid][pGraffitiColor] = 0xFFFFFFFF; } case 1: { PlayerInfo[playerid][pGraffitiColor] = 0xFFFF0000; } case 2: { PlayerInfo[playerid][pGraffitiColor] = 0xFFFFFF00; } case 3: { PlayerInfo[playerid][pGraffitiColor] = 0xFF33CC33; } case 4: { PlayerInfo[playerid][pGraffitiColor] = 0xFF33CCFF; } case 5: { PlayerInfo[playerid][pGraffitiColor] = 0xFFFFA500; } case 6: { PlayerInfo[playerid][pGraffitiColor] = 0xFF1394BF; } case 7: { PlayerInfo[playerid][pGraffitiColor] = 0x000000AA; } } ShowPlayerDialog(playerid, DIALOG_GRAFFITITEXT, DIALOG_STYLE_INPUT, "Graffiti Text", "Please enter the text you wish to spray below.\n\nNote: Your text input cannot exceed over 64 characters.", "Submit", "Cancel"); } } case DIALOG_GRAFFITITEXT: { if (response) { new id = Graffiti_Nearest(playerid); if (id == -1) return 0; if (isnull(inputtext)) { return ShowPlayerDialog(playerid, DIALOG_GRAFFITITEXT, DIALOG_STYLE_INPUT, "Graffiti Text", "Please enter the text you wish to spray below.\n\nNote: Your text input cannot exceed over 64 characters.", "Submit", "Cancel"); } if (strlen(inputtext) > 64) { return ShowPlayerDialog(playerid, DIALOG_GRAFFITITEXT, DIALOG_STYLE_INPUT, "Graffiti Text", "Error: Your input can't exceed 64 characters.\n\nPlease enter the text you wish to spray below.\n\nNote: Your text input cannot exceed over 64 characters.", "Submit", "Cancel"); } if (IsSprayingInProgress(id)) { return SendClientMessage(playerid, COLOR_GREY, "There is another player spraying at this point already."); } PlayerInfo[playerid][pGraffiti] = id; PlayerInfo[playerid][pGraffitiTime] = 15; strpack(PlayerInfo[playerid][pGraffitiText], inputtext, 64 char); ApplyAnimationEx(playerid, "GRAFFITI", "spraycan_fire", 4.1, 1, 0, 0, 0, 0); //ShowPlayerFooter(playerid, "You are now spraying your ~g~graffiti."); GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~n~~n~~n~~n~~b~Spraying...~w~ please wait!", 15000, 3); SendProximityMessage(playerid, 30.0, COLOR_PURPLE, "** %s takes out a can of spray paint and sprays the wall.", GetPlayerRPName(playerid)); } } case DIALOG_EDITMAINBACKPACK: { new bpstring[350], titlestring[64]; if(response) { new index = GetPVarInt(playerid, "BackpackID"); switch(listitem) { case 0: { // Cash format(titlestring, sizeof(titlestring), "Editing the Backpack Cash"); format(bpstring, sizeof(bpstring),"\ Input a Digit below to set the Cash of %s ($%s / $%s Cash)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); SetPVarInt(playerid, "Edit_Type", TYPE_CASH); } case 1: { // Pots format(titlestring, sizeof(titlestring), "Editing the Backpack Pot"); format(bpstring, sizeof(bpstring),"\ Input a Digit below to set the Pots of %s (%sg / %sg Pots)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); SetPVarInt(playerid, "Edit_Type", TYPE_POT); } case 2: { // Cracks format(titlestring, sizeof(titlestring), "Editing the Backpack Cracks", index); format(bpstring, sizeof(bpstring), "\ Input a Digit below to set the Cracks of %s (%sg / %sg Cracks)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); SetPVarInt(playerid, "Edit_Type", TYPE_CRACK); } case 3: { // Mats format(titlestring, sizeof(titlestring), "Editing the Backpack Mats"); format(bpstring, sizeof(bpstring), "\ Input a Digit below to set the Mats of %s (%s / %spound Mats)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); SetPVarInt(playerid, "Edit_Type", TYPE_MATS); } case 4: { // Gun 1 - Small to Large Backpack format(titlestring, sizeof(titlestring), "Editing the Backpack Gun1"); format(bpstring, sizeof(bpstring),"\ Input a Weapon ID below to set the Weapon of %s (%s)", GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][0]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); SetPVarInt(playerid, "Edit_Type", TYPE_GUN1); } case 5: { // Gun 2 - Small to Large Backpack format(titlestring, sizeof(titlestring), "Editing the Backpack Gun2"); format(bpstring, sizeof(bpstring),"\ Input a Weapon ID below to set the Weapon of %s (%s)", GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][1]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); SetPVarInt(playerid, "Edit_Type", TYPE_GUN2); } case 6: { // (Gun 3 Medium to Large) format(titlestring, sizeof(titlestring), "Editing the Backpack Gun3"); format(bpstring, sizeof(bpstring),"\ Input a Weapon ID below to set the Weapon of %s (%s)", GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][2]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); SetPVarInt(playerid, "Edit_Type", TYPE_GUN3); } case 7: { // (Gun 4 Large Backpack) format(titlestring, sizeof(titlestring), "Editing the Backpack Gun4"); format(bpstring, sizeof(bpstring),"\ Input a Weapon ID below to set the Weapon of %s (%s)", GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][3]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); SetPVarInt(playerid, "Edit_Type", TYPE_GUN4); } case 8: { // (Gun 5 Medium Large Backpack) format(titlestring, sizeof(titlestring), "Editing the Backpack Gun5"); format(bpstring, sizeof(bpstring),"\ Input a Weapon ID below to set the Weapon of %s (%s)", GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][4]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); SetPVarInt(playerid, "Edit_Type", TYPE_GUN5); } } } } case DIALOG_EDITITEMS: { new index = GetPVarInt(playerid, "BackpackID"), string[128]; if(response) { if(isnull(inputtext)) return ShowEditBackpackDialog(playerid, index),DeletePVar(playerid, "Edit_Type"); if(!GetPVarType(playerid, "Edit_Type")) return SendClientMessageEx(playerid, COLOR_GREY, "An Error Occurred while editing a Backpack"); new bpstring[230], titlestring[64]; switch(GetPVarInt(playerid, "Edit_Type")) { case TYPE_CASH: // Editing Backpack Cash { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Cash", index); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input a Digit below to set the Cash of %s ($%s / $%s Cash)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new cash = strval(inputtext); if(cash > BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Cash", index); format(bpstring, sizeof(bpstring)," \ WARNING: $%s / $%s Backpack is on Maximum Limit!\n\n\ Input a Digit below to set the Cash of %s ($%s / $%s Cash)", FormatNumber(cash), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new userid = -1; if(BackpackInfo[index][bBackpackOwner] != -1) { foreach(new i: Player) { if(backpackid[i] == MAX_BACKPACKS+1) continue; if(BackpackInfo[index][bBackpackOwner] == GetPlayerSQLId(i)) { userid = i; break; } } } if(userid != -1) { format(string, sizeof(string), "* Admin %s has edit your Cash in your $%s from %s to $%s Cash", GetPlayerNameEx(playerid), GetPlayerStorageType(userid), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(cash)); SendClientMessageEx(userid, COLOR_ROYALBLUE, string); format(bpstring, sizeof(bpstring), "* You have edit the Cash from $%s to $%s of Owner: %s %s", FormatNumber(BackpackInfo[index][bCash]), FormatNumber(cash), GetPlayerNameEx(userid) ,GetBackpackSize(index)); SendClientMessageEx(playerid, COLOR_WHITE, bpstring); } BackpackInfo[index][bCash] = cash; SaveBackpack(index); DeletePVar(playerid, "Edit_Type"); return ShowEditBackpackDialog(playerid, index); } case TYPE_POT: // Editing Backpack Pots { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Pots", index); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input a Digit below to set the Pots of %s (%sg / %sg Pots)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new pots = strval(inputtext); if(pots > BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Pots", index); format(bpstring, sizeof(bpstring)," \ WARNING: %sg / %sg Backpack is on Maximum Limit!\n\n\ Input a Digit below to set the Pots of %s (%sg / %sg Pots)", FormatNumber(pots), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new userid = -1; if(BackpackInfo[index][bBackpackOwner] != -1) { foreach(new i: Player) { if(backpackid[i] == MAX_BACKPACKS+1) continue; if(BackpackInfo[index][bBackpackOwner] == GetPlayerSQLId(i)) { userid = i; break; } } } if(userid != -1) { format(string, sizeof(string), "* Admin %s has edit your Pots in your %s from %sg to %sg Pots", GetPlayerNameEx(playerid), GetPlayerStorageType(userid), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(pots)); SendClientMessageEx(userid, COLOR_ROYALBLUE, string); format(bpstring, sizeof(bpstring), "* You have edit the Pots from %sg to %sg of Owner: %s %s", FormatNumber(BackpackInfo[index][bPot]), FormatNumber(pots) , GetPlayerNameEx(userid), GetBackpackSize(index)); SendClientMessageEx(playerid, COLOR_WHITE, bpstring); } BackpackInfo[index][bPot] = pots; SaveBackpack(index); DeletePVar(playerid, "Edit_Type"); return ShowEditBackpackDialog(playerid, index); } case TYPE_CRACK: // Editing Backpack Cracks { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Cracks", index); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input a Digit below to set the Cracks of %s (%sg / %sg Cracks)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new cracks = strval(inputtext); if(cracks > BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Cracks", index); format(bpstring, sizeof(bpstring)," \ WARNING: %sg / %sg Backpack is on Maximum Limit!\n\n\ Input a Digit below to set the Cracks of %s (%sg / %sg Cracks)", FormatNumber(cracks), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new userid = -1; if(BackpackInfo[index][bBackpackOwner] != -1) { foreach(new i: Player) { if(backpackid[i] == MAX_BACKPACKS+1) continue; if(BackpackInfo[index][bBackpackOwner] == GetPlayerSQLId(i)) { userid = i; break; } } } if(userid != -1) { format(string, sizeof(string), "* Admin %s has edit your Cracks in your %s from %sgg to %sg Cracks", GetPlayerNameEx(playerid), GetPlayerStorageType(userid), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(cracks)); SendClientMessageEx(userid, COLOR_ROYALBLUE, string); format(bpstring, sizeof(bpstring), "* You have edit the Cracks from %sg to %sg of Owner: %s %s", FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(cracks) , GetPlayerNameEx(userid), GetBackpackSize(index)); SendClientMessageEx(playerid, COLOR_WHITE, bpstring); } BackpackInfo[index][bCrack] = cracks; SaveBackpack(index); DeletePVar(playerid, "Edit_Type"); return ShowEditBackpackDialog(playerid, index); } case TYPE_MATS: // Editing Backpack Mats { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Mats", index); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input a Digit below to set the Mats of %s (%s / %s Mats)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new mats = strval(inputtext); if(mats > BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Mats", index); format(bpstring, sizeof(bpstring)," \ WARNING: %sg / %sg Backpack is on Maximum Limit!\n\n\ Input a Digit below to set the Mats of %s (%s / %s Mats)", FormatNumber(mats), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new userid = -1; if(BackpackInfo[index][bBackpackOwner] != -1) { foreach(new i: Player) { if(backpackid[i] == MAX_BACKPACKS+1) continue; if(BackpackInfo[index][bBackpackOwner] == GetPlayerSQLId(i)) { userid = i; break; } } } if(userid != -1) { format(string, sizeof(string), "* Admin %s has edit your Materials in your %s from %s to %s Mats", GetPlayerNameEx(playerid), GetPlayerStorageType(userid), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(mats)); SendClientMessageEx(userid, COLOR_ROYALBLUE, string); format(bpstring, sizeof(bpstring), "* You have edit the Mats from %s to %s of Owner: %s %s", FormatNumber(BackpackInfo[index][bMats]), FormatNumber(mats) , GetPlayerNameEx(userid), GetBackpackSize(index)); SendClientMessageEx(playerid, COLOR_WHITE, bpstring); } BackpackInfo[index][bMats] = mats; SaveBackpack(index); DeletePVar(playerid, "Edit_Type"); return ShowEditBackpackDialog(playerid, index); } case TYPE_GUN1: // Editing Backpack Gun1 { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Gun1", index); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input a Weapon ID below to set the Weapon of %s (%s)", GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][0]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new gunid = strval(inputtext); if(!IsRoleplayWeapon(gunid)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Gun1", index); format(bpstring, sizeof(bpstring)," \ WARNING: %s cannot be insert into the Backpack\n\n\ Input a Weapon ID below to set the Weapon of %s (%s)", GetWeaponNameEx(gunid), GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][0]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new userid = -1; if(BackpackInfo[index][bBackpackOwner] != -1) { foreach(new i: Player) { if(backpackid[i] == MAX_BACKPACKS+1) continue; if(BackpackInfo[index][bBackpackOwner] == GetPlayerSQLId(i)) { userid = i; break; } } } if(userid != -1) { format(string, sizeof(string), "* Admin %s has edit your Gun1 in your %s from %s to %s", GetPlayerNameEx(playerid), GetPlayerStorageType(userid), GetWeaponNameEx(BackpackInfo[index][bGun][0]), GetWeaponNameEx(gunid)); SendClientMessageEx(userid, COLOR_ROYALBLUE, string); format(bpstring, sizeof(bpstring), "* You have edit the Gun1 from %s to %s of Backpack Owner: %s %s", GetWeaponNameEx(BackpackInfo[index][bGun][0]), GetWeaponNameEx(gunid) , GetPlayerNameEx(userid), GetBackpackSize(index)); SendClientMessageEx(playerid, COLOR_WHITE, bpstring); } BackpackInfo[index][bGun][0] = gunid; SaveBackpack(index); DeletePVar(playerid, "Edit_Type"); return ShowEditBackpackDialog(playerid, index); } case TYPE_GUN2: // Editing Backpack Gun2 { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Gun2", index); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input a Weapon ID below to set the Weapon of %s (%s)", GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][1]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new gunid = strval(inputtext); if(!IsRoleplayWeapon(gunid)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Gun2", index); format(bpstring, sizeof(bpstring)," \ WARNING: %s cannot be insert into the Backpack\n\n\ Input a Weapon ID below to set the Weapon of %s (%s)", GetWeaponNameEx(gunid), GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][1]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new userid = -1; if(BackpackInfo[index][bBackpackOwner] != -1) { foreach(new i: Player) { if(backpackid[i] == MAX_BACKPACKS+1) continue; if(BackpackInfo[index][bBackpackOwner] == GetPlayerSQLId(i)) { userid = i; break; } } } if(userid != -1) { format(string, sizeof(string), "* Admin %s has edit your Gun2 in your %s from %s to %s", GetPlayerNameEx(playerid), GetPlayerStorageType(userid), GetWeaponNameEx(BackpackInfo[index][bGun][1]), GetWeaponNameEx(gunid)); SendClientMessageEx(userid, COLOR_ROYALBLUE, string); format(bpstring, sizeof(bpstring), "* You have edit the Gun2 from %s to %s of Backpack Owner: %s %s", GetWeaponNameEx(BackpackInfo[index][bGun][1]), GetWeaponNameEx(gunid) , GetPlayerNameEx(userid), GetBackpackSize(index)); SendClientMessageEx(playerid, COLOR_WHITE, bpstring); } BackpackInfo[index][bGun][1] = gunid; SaveBackpack(index); DeletePVar(playerid, "Edit_Type"); return ShowEditBackpackDialog(playerid, index); } case TYPE_GUN3: // Editing Backpack Gun3 { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Gun3", index); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input a Weapon ID below to set the Weapon of %s (%s)", GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][2]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new gunid = strval(inputtext); if(!IsRoleplayWeapon(gunid)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Gun3", index); format(bpstring, sizeof(bpstring)," \ WARNING: %s cannot be insert into the Backpack\n\n\ Input a Weapon ID below to set the Weapon of %s (%s)", GetWeaponNameEx(gunid), GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][2]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new userid = -1; if(BackpackInfo[index][bBackpackOwner] != -1) { foreach(new i: Player) { if(backpackid[i] == MAX_BACKPACKS+1) continue; if(BackpackInfo[index][bBackpackOwner] == GetPlayerSQLId(i)) { userid = i; break; } } } if(userid != -1) { format(string, sizeof(string), "* Admin %s has edit your Gun3 in your %s from %s to %s", GetPlayerNameEx(playerid), GetPlayerStorageType(userid), GetWeaponNameEx(BackpackInfo[index][bGun][2]), GetWeaponNameEx(gunid)); SendClientMessageEx(userid, COLOR_ROYALBLUE, string); format(bpstring, sizeof(bpstring), "* You have edit the Gun3 from %s to %s of Backpack Owner: %s %s", GetWeaponNameEx(BackpackInfo[index][bGun][2]), GetWeaponNameEx(gunid) , GetPlayerNameEx(userid), GetBackpackSize(index)); SendClientMessageEx(playerid, COLOR_WHITE, bpstring); } BackpackInfo[index][bGun][2] = gunid; SaveBackpack(index); DeletePVar(playerid, "Edit_Type"); return ShowEditBackpackDialog(playerid, index); } case TYPE_GUN4: // Editing Backpack Gun4 { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Gun4", index); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input a Weapon ID below to set the Weapon of %s (%s)", GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][3]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new gunid = strval(inputtext); if(!IsRoleplayWeapon(gunid)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Gun4", index); format(bpstring, sizeof(bpstring)," \ WARNING: %s cannot be insert into the Backpack\n\n\ Input a Weapon ID below to set the Weapon of %s (%s)", GetWeaponNameEx(gunid), GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][3]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new userid = -1; if(BackpackInfo[index][bBackpackOwner] != -1) { foreach(new i: Player) { if(backpackid[i] == MAX_BACKPACKS+1) continue; if(BackpackInfo[index][bBackpackOwner] == GetPlayerSQLId(i)) { userid = i; break; } } } if(userid != -1) { format(string, sizeof(string), "* Admin %s has edit your Gun4 in your %s from %s to %s", GetPlayerNameEx(playerid), GetPlayerStorageType(userid), GetWeaponNameEx(BackpackInfo[index][bGun][3]), GetWeaponNameEx(gunid)); SendClientMessageEx(userid, COLOR_ROYALBLUE, string); format(bpstring, sizeof(bpstring), "* You have edit the Gun4 from %s to %s of Backpack Owner: %s %s", GetWeaponNameEx(BackpackInfo[index][bGun][3]), GetWeaponNameEx(gunid) , GetPlayerNameEx(userid), GetBackpackSize(index)); SendClientMessageEx(playerid, COLOR_WHITE, bpstring); } BackpackInfo[index][bGun][3] = gunid; SaveBackpack(index); DeletePVar(playerid, "Edit_Type"); return ShowEditBackpackDialog(playerid, index); } case TYPE_GUN5: // Editing Backpack Gun5 { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Gun5", index); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input a Weapon ID below to set the Weapon of %s (%s)", GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][4]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new gunid = strval(inputtext); if(!IsRoleplayWeapon(gunid)) { format(titlestring, sizeof(titlestring), "Editing the Backpack Gun5", index); format(bpstring, sizeof(bpstring)," \ WARNING: %s cannot be insert into the Backpack\n\n\ Input a Weapon ID below to set the Weapon of %s (%s)", GetWeaponNameEx(gunid), GetBackpackSize(index), GetWeaponNameEx(BackpackInfo[index][bGun][4]) ); ShowPlayerDialog(playerid, DIALOG_EDITITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Edit", "Back"); return 1; } new userid = -1; if(BackpackInfo[index][bBackpackOwner] != -1) { foreach(new i: Player) { if(backpackid[i] == MAX_BACKPACKS+1) continue; if(BackpackInfo[index][bBackpackOwner] == GetPlayerSQLId(i)) { userid = i; break; } } } if(userid != -1) { format(string, sizeof(string), "* Admin %s has edit your Gun5 in your %s from %s to %s", GetPlayerNameEx(playerid), GetPlayerStorageType(userid), GetWeaponNameEx(BackpackInfo[index][bGun][4]), GetWeaponNameEx(gunid)); SendClientMessageEx(userid, COLOR_ROYALBLUE, string); format(bpstring, sizeof(bpstring), "* You have edit the Gun5 from %s to %s of Backpack Owner: %s %s", GetWeaponNameEx(BackpackInfo[index][bGun][4]), GetWeaponNameEx(gunid) , GetPlayerNameEx(userid), GetBackpackSize(index)); SendClientMessageEx(playerid, COLOR_WHITE, bpstring); } BackpackInfo[index][bGun][4] = gunid; SaveBackpack(index); DeletePVar(playerid, "Edit_Type"); return ShowEditBackpackDialog(playerid, index); } } } else ShowEditBackpackDialog(playerid, index), DeletePVar(playerid, "Edit_Type"); } case DIALOG_BACKPACKMENU: { if(response) { if(!PlayerHasBackpack(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have any Backpack"); SetPVarInt(playerid, "Listitem_Backpack", listitem); ShowBackpackActionChoice(playerid); } else DeletePVar(playerid, "Listitem_Backpack"); } case DIALOG_PUTAKEITEMS: { if(response) { new bpstring[300], titlestring[64], index = GetPlayerBackpackID(playerid), rpstring[128]; if(!GetPVarType(playerid, "Type_Action")) return SendClientMessageEx(playerid, COLOR_GREY, "An Error Occur during the Action Taking/Putting Items"); if(isnull(inputtext)) return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"), DeletePVar(playerid, "Type_Action"); switch(GetPVarInt(playerid, "Type_Action")) { case 1: // Put Items { switch(GetPVarInt(playerid, "Listitem_Backpack")) { case 0: // Cash { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Cash in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input the amount of Cash that you will put in your %s ($%s / $%s)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } new cash = strval(inputtext); if(cash < 1) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Cash in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: Must not be 0 or a Negative value!\n\n\ Input the amount of Cash that you will put in your %s ($%s / $%s)", FormatNumber(cash), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } if(GetPlayerCash(playerid) < cash) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Cash in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: You don't have enough $%s Cash to put\n\n\ Input the amount of Cash that you will put in your %s ($%s / $%s)", FormatNumber(cash), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } if((BackpackInfo[index][bCash]+cash) > BackpackLimit(BackpackInfo[index][bBackpackSize] , LIMIT_CASH)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Cash in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: $%s cannot be put,Cash in your Backpack is on Maximum Limit ($%s/$%s)\n\n\ Input the amount of Cash that you will put in your %s ($%s / $%s)", FormatNumber(cash), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } format(rpstring, sizeof(rpstring), "Take's out some cash and put it in his %s", GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); GivePlayerCash(playerid, -cash); BackpackInfo[index][bCash] +=cash; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"), DeletePVar(playerid, "Type_Action"); } case 1: // Pots { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Pots in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input the amount of Pots that you will put in your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } new pots = strval(inputtext); if(pots < 1) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Pots in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: Must not be 0 or a Negative value!\n\n\ Input the amount of Pots that you will put in your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } if(PlayerInfo[playerid][pWeed] < pots) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Pots in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: You don't have enough %sg Pots to put\n\n\ Input the amount of Pots that you will put in your %s (%sg / %sg)", FormatNumber(pots), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } if((BackpackInfo[index][bPot]+pots) > BackpackLimit(BackpackInfo[index][bBackpackSize] , LIMIT_POT)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Pots in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: %sg cannot be put,Pots in your Backpack is on Maximum Limit (%sg/%sg)\n\n\ Input the amount of Pots that you will put in your %s (%sg / %sg)", FormatNumber(pots), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } format(rpstring, sizeof(rpstring), "Take's out some pots and put it in his %s", GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); PlayerInfo[playerid][pWeed] -= pots; BackpackInfo[index][bPot] += pots; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"), DeletePVar(playerid, "Type_Action"); } case 2: // Cracks { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Cracks in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input the amount of Cracks that you will put in your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } new Cracks = strval(inputtext); if(Cracks < 1) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Cracks in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: Must not be 0 or a Negative value!\n\n\ Input the amount of Cracks that you will put in your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } if(PlayerInfo[playerid][pCocaine] < Cracks) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Cracks in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: You don't have enough %sg Pots to put\n\n\ Input the amount of Cracks that you will put in your %s (%sg / %sg)", FormatNumber(Cracks), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } if((BackpackInfo[index][bCrack]+Cracks) > BackpackLimit(BackpackInfo[index][bBackpackSize] , LIMIT_CRACK)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Cracks in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: %sg cannot be put,Cracks in your Backpack is on Maximum Limit (%sg/%sg)\n\n\ Input the amount of Cracks that you will put in your %s (%sg / %sg)", FormatNumber(Cracks), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } format(rpstring, sizeof(rpstring), "Take's out some cracks and put it in his %s", GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); PlayerInfo[playerid][pCocaine] -= Cracks; BackpackInfo[index][bCrack] += Cracks; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"), DeletePVar(playerid, "Type_Action"); } case 3: // Mats { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Mats in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input the amount of Mats that you will put in your %s (%s / %s)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } new Mats = strval(inputtext); if(Mats < 1) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Mats in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: Must not be 0 or a Negative value!\n\n\ Input the amount of Mats that you will put in your %s (%s / %s)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } if(PlayerInfo[playerid][ pMaterials] < Mats) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Mats in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: You don't have enough %sg Mats to put\n\n\ Input the amount of Mats that you will put in your %s (%s / %s)", FormatNumber(Mats), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } if((BackpackInfo[index][bMats]+Mats) > BackpackLimit(BackpackInfo[index][bBackpackSize] , LIMIT_MATS)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Pots in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: %sg cannot be put,Mats in your Backpack is on Maximum Limit (%sg/%sg)\n\n\ Input the amount of Mats that you will put in your %s (%sg / %sg)", FormatNumber(Mats), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); return 1; } format(rpstring, sizeof(rpstring), "Take's out some mats and put it in his %s", GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); PlayerInfo[playerid][ pMaterials] -= Mats; BackpackInfo[index][bMats] += Mats; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"), DeletePVar(playerid, "Type_Action"); } } } case 2: // Take Items { switch(GetPVarInt(playerid, "Listitem_Backpack")) { case 0: // Cash { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Cash in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input the amount of Cash that you will take from your %s ($%s / $%s)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } new amount = strval(inputtext); if(amount < 1) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Cash in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: Must not be 0 or a Negative value!\n\n\ Input the amount of Cash that you will take from your %s ($%s / $%s)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } if(BackpackInfo[index][bCash] < amount) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Cash in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: You don't have enough $%s Cash in your Backpack!\n\n\ Input the amount of Cash that you will take from your %s ($%s / $%s)", FormatNumber(amount), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } format(rpstring, sizeof(rpstring), "Take's out some cash from his %s", GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); GivePlayerCash(playerid, amount); BackpackInfo[index][bCash] -= amount; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"), DeletePVar(playerid, "Type_Action"); } case 1: // Pots { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Pots in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input the amount of Pots that you will take from your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } new amount = strval(inputtext); if(amount < 1) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Pots in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: Must not be 0 or a Negative value!\n\n\ Input the amount of Pots that you will take from your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } if(BackpackInfo[index][bPot] < amount) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Pots in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: You don't have enough %sg Pots in your Backpack!\n\n\ Input the amount of Pots that you will take from your %s (%sg / %sg)", FormatNumber(amount), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } format(rpstring, sizeof(rpstring), "Take's out some pots from his %s", GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); PlayerInfo[playerid][pWeed] += amount; BackpackInfo[index][bPot] -= amount; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"), DeletePVar(playerid, "Type_Action"); } case 2: // Cracks { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Cracks in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input the amount of Cracks that you will take from your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } new amount = strval(inputtext); if(amount < 1) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Cracks in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: Must not be 0 or a Negative value!\n\n\ Input the amount of Cracks that you will take from your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } if(BackpackInfo[index][bCrack] < amount) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Cracks in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: You don't have enough %sg Pots in your Backpack!\n\n\ Input the amount of Cracks that you will take from your %s (%sg / %sg)", FormatNumber(amount), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } format(rpstring, sizeof(rpstring), "Take's out some cracks from his %s", GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); PlayerInfo[playerid][pCocaine] += amount; BackpackInfo[index][bCrack] -= amount; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"), DeletePVar(playerid, "Type_Action"); } case 3: // Mats { if(!IsNumeric(inputtext)) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Mats in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: That's not a number!\n\n\ Input the amount of Mats that you will take from your %s (%s / %s)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } new amount = strval(inputtext); if(amount < 1) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Mats in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: Must not be 0 or a Negative value!\n\n\ Input the amount of Mats that you will take from your %s (%s / %s)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } if(BackpackInfo[index][bMats] < amount) { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Mats in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ WARNING: You don't have enough %sg Pots in your Backpack!\n\n\ Input the amount of Mats that you will take from your %s (%s / %s)", FormatNumber(amount), GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); return 1; } format(rpstring, sizeof(rpstring), "Take's out some mats from his %s", GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); PlayerInfo[playerid][ pMaterials] += amount; BackpackInfo[index][bMats] -= amount; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"), DeletePVar(playerid, "Type_Action"); } } } } } else ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"), DeletePVar(playerid, "Type_Action"); } case DIALOG_ACTIONBACKPACKMENU: { if(response) { new bpstring[230], titlestring[64], index = GetPlayerBackpackID(playerid), rpstring[128]; switch(listitem) { case 0: { // Put Items into Backpack switch(GetPVarInt(playerid, "Listitem_Backpack")) { case 0: { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Cash in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ Input the amount of Cash that you will put in your %s ($%s / $%s)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); SetPVarInt(playerid, "Type_Action", 1); } case 1: { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Pots in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ Input the amount of Pots that you will put in your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); SetPVarInt(playerid, "Type_Action", 1); } case 2: { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Cracks in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ Input the amount of Cracks that you will put in your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); SetPVarInt(playerid, "Type_Action", 1); } case 3: { format(titlestring, sizeof(titlestring), "{FFFFFF}Putting a Mats in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ Input the amount of Materials that you will put in your %s (%s / %s)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Put", "Back"); SetPVarInt(playerid, "Type_Action", 1); } case 4: { new gunid = GetPlayerWeapon(playerid); if(!gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have any Gun Equipped"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(!IsRoleplayWeapon(gunid)) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot put this kind of Weapon in your Backpack"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(BackpackInfo[index][bGun][0] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "There is already weapon in this Slot!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); format(rpstring, sizeof(rpstring), "Put his %s into their %s", GetWeaponNameEx(gunid),GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); BackpackInfo[index][bGun][0] = gunid; RemovePlayerWeapon(playerid, gunid); SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); } case 5: { new gunid = GetPlayerWeapon(playerid); if(!gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have any Gun Equipped"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(!IsRoleplayWeapon(gunid)) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot put this kind of Weapon in your Backpack"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(BackpackInfo[index][bGun][1] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "There is already weapon in this Slot!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); format(rpstring, sizeof(rpstring), "Put his %s into their %s", GetWeaponNameEx(gunid),GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); BackpackInfo[index][bGun][1] = gunid; RemovePlayerWeapon(playerid, gunid); SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); } case 6: { new gunid = GetPlayerWeapon(playerid); if(!gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have any Gun Equipped"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(!IsRoleplayWeapon(gunid)) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot put this kind of Weapon in your Backpack"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(BackpackInfo[index][bGun][2] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "There is already weapon in this Slot!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); format(rpstring, sizeof(rpstring), "Put his %s into their %s", GetWeaponNameEx(gunid),GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); BackpackInfo[index][bGun][2] = gunid; RemovePlayerWeapon(playerid, gunid); SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); } case 7: { new gunid = GetPlayerWeapon(playerid); if(!gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have any Gun Equipped"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(!IsRoleplayWeapon(gunid)) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot put this kind of Weapon in your Backpack"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(BackpackInfo[index][bGun][3] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "There is already weapon in this Slot!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); format(rpstring, sizeof(rpstring), "Put his %s into their %s", GetWeaponNameEx(gunid),GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); BackpackInfo[index][bGun][3] = gunid; RemovePlayerWeapon(playerid, gunid); SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); } case 8: { new gunid = GetPlayerWeapon(playerid); if(!gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have any Gun Equipped"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(!IsRoleplayWeapon(gunid)) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot put this kind of Weapon in your Backpack"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(BackpackInfo[index][bGun][4] != 0) return SendClientMessageEx(playerid, COLOR_GREY, "There is already weapon in this Slot!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); format(rpstring, sizeof(rpstring), "Put his %s into their %s", GetWeaponNameEx(gunid),GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); BackpackInfo[index][bGun][4] = gunid; RemovePlayerWeapon(playerid, gunid); SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); } } } case 1: { // Take Items from the Backpack switch(GetPVarInt(playerid, "Listitem_Backpack")) { case 0: { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Cash in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ Input the amount of Cash that you will take from your %s ($%s / $%s)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CASH)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); SetPVarInt(playerid, "Type_Action", 2); } case 1: { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Pots in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ Input the amount of Pots that you will put from your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_POT)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); SetPVarInt(playerid, "Type_Action", 2); } case 2: { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Cracks in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ Input the amount of Cracks that you will put from your %s (%sg / %sg)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_CRACK)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); SetPVarInt(playerid, "Type_Action", 2); } case 3: { format(titlestring, sizeof(titlestring), "{FFFFFF}Taking a Mats in your %s", GetBackpackSize(index)); format(bpstring, sizeof(bpstring)," \ Input the amount of Materials that you will put from your %s (%s / %s)", GetBackpackSize(index), FormatNumber(BackpackInfo[index][bMats]), FormatNumber(BackpackLimit(BackpackInfo[index][bBackpackSize], LIMIT_MATS)) ); ShowPlayerDialog(playerid, DIALOG_PUTAKEITEMS, DIALOG_STYLE_INPUT, titlestring, bpstring, "Take", "Back"); SetPVarInt(playerid, "Type_Action", 2); } case 4: { new gunid = BackpackInfo[index][bGun][0]; if(!gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You dont have any Weapon in this Slot!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(PlayerInfo[playerid][pWeapons][weaponSlotIDs[gunid]] == gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You already have this weapon in your hand!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); format(rpstring, sizeof(rpstring), "Take his %s from their %s", GetWeaponNameEx(gunid),GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); GivePlayerWeaponEx(playerid, gunid); BackpackInfo[index][bGun][0] = 0; SavePlayerVariables(playerid); ShowPlayerBackpack(playerid); DeletePVar(playerid, "Listitem_Backpack"); return 1; } case 5: { new gunid = BackpackInfo[index][bGun][1]; if(!gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You dont have any Weapon in this Slot!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(PlayerInfo[playerid][pWeapons][weaponSlotIDs[gunid]] == gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You already have this weapon in your hand!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); format(rpstring, sizeof(rpstring), "Take his %s from their %s", GetWeaponNameEx(gunid),GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); GivePlayerWeaponEx(playerid, gunid); BackpackInfo[index][bGun][1] = 0; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); } case 6: { new gunid = BackpackInfo[index][bGun][2]; if(!gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You dont have any Weapon in this Slot!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(PlayerInfo[playerid][pWeapons][weaponSlotIDs[gunid]] == gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You already have this weapon in your hand!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); format(rpstring, sizeof(rpstring), "Take his %s from their %s", GetWeaponNameEx(gunid),GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); GivePlayerWeaponEx(playerid, gunid); BackpackInfo[index][bGun][2] = 0; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); } case 7: { new gunid = BackpackInfo[index][bGun][3]; if(!gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You dont have any Weapon in this Slot!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(PlayerInfo[playerid][pWeapons][weaponSlotIDs[gunid]] == gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You already have this weapon in your hand!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); format(rpstring, sizeof(rpstring), "Take his %s from their %s", GetWeaponNameEx(gunid),GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); GivePlayerWeaponEx(playerid, gunid); BackpackInfo[index][bGun][3] = 0; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); } case 8: { new gunid = BackpackInfo[index][bGun][4]; if(!gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You dont have any Weapon in this Slot!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); if(PlayerInfo[playerid][pWeapons][weaponSlotIDs[gunid]] == gunid) return SendClientMessageEx(playerid, COLOR_GREY, "You already have this weapon in your hand!"), ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); format(rpstring, sizeof(rpstring), "Take his %s from their %s", GetWeaponNameEx(gunid),GetPlayerStorageType(playerid)); callcmd::me(playerid, rpstring); GivePlayerWeaponEx(playerid, gunid); BackpackInfo[index][bGun][4] = 0; SavePlayerVariables(playerid); return ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); } } } } } else ShowPlayerBackpack(playerid), DeletePVar(playerid, "Listitem_Backpack"); } case DIALOG_REGISTER: { if(response) { if(isnull(inputtext)) { ShowDialogToPlayer(playerid, DIALOG_REGISTER); return 1; } if(strlen(inputtext) < 4) { SendClientMessage(playerid, COLOR_LIGHTRED, "** Please choose a password containing at least 4 characters."); ShowDialogToPlayer(playerid, DIALOG_REGISTER); return 1; } WP_Hash(PlayerInfo[playerid][pPassword], 129, inputtext); ShowPlayerDialog(playerid, DIALOG_CONFIRMPASS, DIALOG_STYLE_PASSWORD, "Emerald City Roleplay - Confirm Pass", "Please repeat your account password for verification:", "Submit", "Back"); } else { KickPlayer(playerid); } } case DIALOG_CONFIRMPASS: { if(response) { new password[129]; if(isnull(inputtext)) { return ShowPlayerDialog(playerid, DIALOG_CONFIRMPASS, DIALOG_STYLE_PASSWORD, "Emerald City Roleplay - Confirm Pass", "Please repeat your account password for verification:", "Submit", "Back"); } WP_Hash(password, sizeof(password), inputtext); if(!strcmp(PlayerInfo[playerid][pPassword], password)) { gTotalRegistered++; SaveServerInfo(); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO users (username, password, regdate, lastlogin, ip, passwordchanged) VALUES('%s', '%s', NOW(), NOW(), '%s', 1)", GetPlayerNameEx(playerid), password, GetPlayerIP(playerid)); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_ACCOUNT_REGISTER, playerid); } else { ShowDialogToPlayer(playerid, DIALOG_REGISTER); SendClientMessage(playerid, COLOR_LIGHTRED, "** Your repeated password does not match your chosen password. Please try again."); } } else { ShowDialogToPlayer(playerid, DIALOG_REGISTER); } } case DIALOG_LOGIN: { if(response) { new specifiers[] = "%D of %M, %Y @ %k:%i", password[129]; if(isnull(inputtext)) { ShowDialogToPlayer(playerid, DIALOG_LOGIN); return 1; } WP_Hash(password, sizeof(password), inputtext); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT *, DATE_FORMAT(lastlogin, '%s') AS login_date FROM users WHERE username = '%s' AND password = '%s'", specifiers, GetPlayerNameEx(playerid), password); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_PROCESS_LOGIN, playerid); } else { KickPlayer(playerid); } } case DIALOG_GENDER: { if(response) { if(listitem == 0) { PlayerInfo[playerid][pGender] = 1; PlayerInfo[playerid][pSkin] = 299; SendClientMessage(playerid, COLOR_YELLOW, "Your character is a Male. Now you need to choose the age of your character."); } else if(listitem == 1) { PlayerInfo[playerid][pGender] = 2; PlayerInfo[playerid][pSkin] = 69; SendClientMessage(playerid, COLOR_YELLOW, "Your character is a Female. Now you need to choose the age of your character."); } else if(listitem == 2) { PlayerInfo[playerid][pGender] = 3; PlayerInfo[playerid][pSkin] = 157; SendClientMessage(playerid, COLOR_YELLOW, "Your character is a Shemale. Now you need to choose the age of your character."); } ShowDialogToPlayer(playerid, DIALOG_AGE); } else { ShowDialogToPlayer(playerid, DIALOG_GENDER); } } case DIALOG_AGE: { if(response) { new age = strval(inputtext); if(!(10 <= age <= 99)) { ShowDialogToPlayer(playerid, DIALOG_AGE); SendClientMessage(playerid, COLOR_GREY, "You may only enter a number from 10 to 99. Please try again."); return 1; } PlayerInfo[playerid][pAge] = age; PlayerInfo[playerid][pReferralUID] = 0; //PlayerInfo[playerid][pTutorial] = 1; //PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 3000, false, "ii", playerid, 1); //SendClientMessage(playerid, COLOR_GREEN, "** Good stuff! That's all we need right now. The tutorial will start in a moment."); //SetPlayerToSpawn(playerid); SendClientMessageEx(playerid, COLOR_YELLOW, "Wow! your character is %i years old. Have you been referred to the server by anyone?", age); ShowDialogToPlayer(playerid, DIALOG_REFERRAL); } else { ShowDialogToPlayer(playerid, DIALOG_AGE); } } case DIALOG_REFERRAL: { if(response) { if(isnull(inputtext) || strlen(inputtext) > 24) { return ShowDialogToPlayer(playerid, DIALOG_REFERRAL); } if(!strcmp(inputtext, GetPlayerNameEx(playerid))) { SendClientMessage(playerid, COLOR_GREY, "You can't put down your own name as a referral."); return ShowDialogToPlayer(playerid, DIALOG_REFERRAL); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT username, ip, uid FROM users WHERE username = '%e'", inputtext); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_CHECK_REFERRAL, playerid); } else { PlayerInfo[playerid][pTutorial] = 1; PlayerInfo[playerid][pTutorialTimer] = SetTimerEx("TutorialTimer", 3000, false, "ii", playerid, 11); //SendClientMessage(playerid, COLOR_YELLOW, "That's all the information we need right now. The tutorial will start in just a moment."); } } case DIALOG_INTERIORS: { if(response) { TeleportToCoords(playerid, interiorArray[listitem][intX], interiorArray[listitem][intY], interiorArray[listitem][intZ], interiorArray[listitem][intA], interiorArray[listitem][intID], GetPlayerVirtualWorld(playerid)); GameTextForPlayer(playerid, "~w~Teleported", 5000, 1); } } case DIALOG_BUYFURNITURETYPE: { new houseid = GetInsideHouse(playerid); if(houseid == -1 || !HasFurniturePerms(playerid, houseid)) { return 0; } if(response) { PlayerInfo[playerid][pMenuType] = listitem; ShowDialogToPlayer(playerid, DIALOG_BUYFURNITURE1); } } case DIALOG_BUYFURNITURE1: { new houseid = GetInsideHouse(playerid); if(houseid == -1 || !HasFurniturePerms(playerid, houseid)) { return 0; } if(response) { switch(PlayerInfo[playerid][pMenuType]) { case 0: // Model selection { PlayerInfo[playerid][pCategory] = listitem; ShowObjectSelectionMenu(playerid, MODEL_SELECTION_FURNITURE); } case 1: { PlayerInfo[playerid][pCategory] = listitem; ShowDialogToPlayer(playerid, DIALOG_BUYFURNITURE2); } } } else { ShowDialogToPlayer(playerid, DIALOG_BUYFURNITURETYPE); } } case DIALOG_BUYFURNITURE2: { new houseid = GetInsideHouse(playerid); if(houseid == -1 || !HasFurniturePerms(playerid, houseid)) { return 0; } if(response) { PurchaseFurniture(playerid, listitem + PlayerInfo[playerid][pFurnitureIndex]); } else { ShowDialogToPlayer(playerid, DIALOG_BUYFURNITURE1); } } case DIALOG_BUY: { if(response) { new businessid = GetInsideBusiness(playerid); if(BusinessInfo[businessid][bProducts] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "This business is out of stock."); } if(BusinessInfo[businessid][bType] == BUSINESS_STORE) { switch(listitem) { case 0: { new price = 300; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pPhone] = random(0) + 19999; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET phone = %i WHERE uid = %i", PlayerInfo[playerid][pPhone], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a mobile phone.", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_WHITE, "Mobile phone purchased. Your new phone number is %i.", PlayerInfo[playerid][pPhone]); } case 1: { new price = 200; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pWalkieTalkie]) { return SendClientMessage(playerid, COLOR_GREY, "You have a walkie talkie already."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pWalkieTalkie] = 1; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET walkietalkie = 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a walkie talkie.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Walkie talkie purchased. Use /wt to speak and /channel to change the frequency."); } case 2: { new price = 20; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pCigars] >= 20) { return SendClientMessage(playerid, COLOR_GREY, "You can't have more than 20 cigars."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pCigars] += 10; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cigars = %i WHERE uid = %i", PlayerInfo[playerid][pCigars], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a pack of cigars.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Cigars purchased. Use /usecigar to smoke a cigar."); } case 3: { new price = 250; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pMask]) { return SendClientMessage(playerid, COLOR_GREY, "You already have one."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 5)); SendClientMessageEx(playerid, COLOR_LIGHTORANGE, "** Trader perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } if(PlayerInfo[playerid][pMaskTime]) { return SendClientMessage(playerid, -1, "* You must wait at least 15 minutes before you can buy mask again."); } PlayerInfo[playerid][pMask] = 1; GivePlayerCash(playerid, -price); PlayerInfo[playerid][pMaskID] = (random(100000) + playerid); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET mask = 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a mask.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "** Mask purchased. /mask to hide your face."); SendClientMessage(playerid, 0x33CCFFFF, "HINT: A maskID will be assigned to you once you wear it on."); } case 4: { new price = 150; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pPhonebook]) { return SendClientMessage(playerid, COLOR_GREY, "You have a phonebook already."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pPhonebook] = 1; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET phonebook = 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a phonebook.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Phonebook purchased. Use /number to lookup a player's number."); } case 5: { new price = 2000; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerWeaponEx(playerid, 43); GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a camera.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Camera purchased."); } case 6: { new price = 200; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pMP3Player]) { return SendClientMessage(playerid, COLOR_GREY, "You have an MP3 player already."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pMP3Player] = 1; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET mp3player = 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received an MP3 player.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "MP3 player purchased. Use /mp3 for a list of options."); } case 7: { new price = 300; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pFishingRod]) { return SendClientMessage(playerid, COLOR_GREY, "You have a fishing rod already."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pFishingRod] = 1; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fishingrod = 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a fishing rod.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Fishing rod purchased. Use /fish at the pier or in a boat to begin fishing."); } case 8: { new price = 50; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pFishingBait] + 10 > 20) { return SendClientMessage(playerid, COLOR_GREY, "You can't have more than 20 pieces of bait."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pFishingBait] += 10; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fishingbait = %i WHERE uid = %i", PlayerInfo[playerid][pFishingBait], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received fish bait.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Fishing bait purchased. Bait increases the odds of catching bigger fish."); } case 9: { new price = 1500; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pMuriaticAcid] + 1 > 10) { return SendClientMessage(playerid, COLOR_GREY, "You can't have more than 10 bottles of muriatic acid."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pMuriaticAcid] += 1; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET muriaticacid = %i WHERE uid = %i", PlayerInfo[playerid][pMuriaticAcid], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a bottle of muriatic acid.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Muriatic acid purchased."); } case 10: { new price = 250; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pBakingSoda] + 1 > 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't have more than 3 bottles of baking soda."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pBakingSoda] += 1; GivePlayerCash(playerid, -price); if(PlayerInfo[playerid][pThirst] + 45 >= 100) PlayerInfo[playerid][pThirst] = 100; else PlayerInfo[playerid][pThirst] += 45; if(PlayerInfo[playerid][pLoseReason] == REASON_THIRST || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bakingsoda = %i WHERE uid = %i", PlayerInfo[playerid][pBakingSoda], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a bottle of baking soda.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Baking soda purchased."); } case 11: { new price = 300; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pWatch]) { return SendClientMessage(playerid, COLOR_GREY, "You have a pocket watch already."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pWatch] = 1; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET watch = 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a pocket watch.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Pocket watch purchased. Use /watch to toggle it."); } case 12: { new price = 250; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pGPS]) { return SendClientMessage(playerid, COLOR_GREY, "You have a GPS already."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pGPS] = 1; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gps = 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a GPS.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "GPS purchased. Use /gps to toggle it."); } case 13: { new price = 100; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pGasCan] + 5 > 20) { return SendClientMessage(playerid, COLOR_GREY, "You can't have more than 20 liters of gas."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pGasCan] += 5; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gascan = %i WHERE uid = %i", PlayerInfo[playerid][pGasCan], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received 5 liters of gasoline.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Gas can purchased. Use /gascan in a vehicle to refill its fuel."); } case 14: { new price = 50; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pRope] + 2 > 10) { return SendClientMessage(playerid, COLOR_GREY, "You can't have more than 10 ropes."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pRope] += 2; GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rope = %i WHERE uid = %i", PlayerInfo[playerid][pRope], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received 2 ropes.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Ropes purchased. Use /tie to tie people in your vehicle."); } case 15: { new price = 600; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pSpraycans] + 5 > 20) { return SendClientMessage(playerid, COLOR_GREY, "You can't have more than 20 spraycans."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } PlayerInfo[playerid][pSpraycans] += 5; // here GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET spraycans = %i WHERE uid = %i", PlayerInfo[playerid][pSpraycans], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received 5 spraycans.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Spraycans purchased. Spraycans can be used for graffiti"); } } } else if(BusinessInfo[businessid][bType] == BUSINESS_Ammunation) { if(PlayerInfo[playerid][pGunLicense] == 0) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a gun license. Request it from an officer IC'ly."); } if(PlayerInfo[playerid][pHours] < 10 || PlayerInfo[playerid][pWeaponRestricted]) { return SendClientMessage(playerid, COLOR_GREY, "You are either weapon restricted or you played less than 10 hours. You can't buy stuff here."); } switch(listitem) { case 0: { new price = 1500; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerHasWeapon(playerid, 22)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); GivePlayerWeaponEx(playerid, 22); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a 9mm pistol.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "9mm pistol purchased."); } case 1: { new price = 4000; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerHasWeapon(playerid, 25)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); GivePlayerWeaponEx(playerid, 25); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a shotgun.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Shotgun purchased."); } case 2: { new price = 5000; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerHasWeapon(playerid, 33)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); GivePlayerWeaponEx(playerid, 33); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a country rifle.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Country rifle purchased."); } case 3: { new price = 1500; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } SetScriptArmour(playerid, 35.0); GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received light armor.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Light armor of 35 armor points purchased."); } case 4: { new price = 2500; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } SetScriptArmour(playerid, 60.0); GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received medium armor.", GetPlayerRPName(playerid), price); SendClientMessage(playerid, COLOR_WHITE, "Light armor of 60 armor points purchased."); } } } else if(BusinessInfo[businessid][bType] == BUSINESS_CLOTHES) { new string[128]; format(string, sizeof(string), "%s's %s [%i products]", BusinessInfo[businessid][bOwner], bizInteriors[BusinessInfo[businessid][bType]][intType], BusinessInfo[businessid][bProducts]); if(listitem == 0) { //ShowDialogToPlayer(playerid, DIALOG_BUYCLOTHES); ShowPlayerSelectionMenu(playerid, MODEL_SELECTION_CLOTHES, "Clothes Shop", clothesShopSkins, sizeof(clothesShopSkins)); } else { PlayerInfo[playerid][pCategory] = listitem - 1; ShowDialogToPlayer(playerid, DIALOG_BUYCLOTHINGTYPE); } } else if(BusinessInfo[businessid][bType] == BUSINESS_GYM) { switch(listitem) { case 0: { if(PlayerInfo[playerid][pFightStyle] == FIGHT_STYLE_NORMAL) { return SendClientMessage(playerid, COLOR_GREY, "You already have this fighting style."); } PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_NORMAL; SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[playerid][pFightStyle], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_WHITE, "You have chosen the normal fighting style."); } case 1: { new price = 3000; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pFightStyle] == FIGHT_STYLE_BOXING) { return SendClientMessage(playerid, COLOR_GREY, "You already have this fighting style."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_BOXING; SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[playerid][pFightStyle], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_WHITE, "You have purchased the Boxing fighting style for $%i.", price); } case 2: { new price = 3000; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pFightStyle] == FIGHT_STYLE_KUNGFU) { return SendClientMessage(playerid, COLOR_GREY, "You already have this fighting style."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_KUNGFU; SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[playerid][pFightStyle], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_WHITE, "You have purchased the Kung-Fu fighting style for $%i.", price); } case 3: { new price = 3000; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pFightStyle] == FIGHT_STYLE_KNEEHEAD) { return SendClientMessage(playerid, COLOR_GREY, "You already have this fighting style."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_KNEEHEAD; SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[playerid][pFightStyle], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_WHITE, "You have purchased the Kneehead fighting style for $%i.", price); } case 4: { new price = 3000; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pFightStyle] == FIGHT_STYLE_GRABKICK) { return SendClientMessage(playerid, COLOR_GREY, "You already have this fighting style."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_GRABKICK; SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[playerid][pFightStyle], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_WHITE, "You have purchased the Grabkick fighting style for $%i.", price); } case 5: { new price = 3000; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pFightStyle] == FIGHT_STYLE_ELBOW) { return SendClientMessage(playerid, COLOR_GREY, "You already have this fighting style."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); BusinessInfo[businessid][bCash] += price; PlayerInfo[playerid][pFightStyle] = FIGHT_STYLE_ELBOW; SetPlayerFightingStyle(playerid, PlayerInfo[playerid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[playerid][pFightStyle], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_WHITE, "You have purchased the Elbow fighting style for $%i.", price); } } } else if(BusinessInfo[businessid][bType] == BUSINESS_RESTAURANT) { switch(listitem) { case 0: { new price = 4; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); //GivePlayerHealth(playerid, 10.0); if(PlayerInfo[playerid][pThirst] + 15 >= 100) PlayerInfo[playerid][pThirst] = 100; else PlayerInfo[playerid][pThirst] += 15; if(PlayerInfo[playerid][pLoseReason] == REASON_THIRST || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a bottled water.", GetPlayerRPName(playerid), price); } case 1: { new price = 5; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); //GivePlayerHealth(playerid, 15.0); if(PlayerInfo[playerid][pThirst] + 20 >= 100) PlayerInfo[playerid][pThirst] = 100; else PlayerInfo[playerid][pThirst] += 20; if(PlayerInfo[playerid][pLoseReason] == REASON_THIRST || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a can of sprunk.", GetPlayerRPName(playerid), price); } case 2: { new price = 30; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); GivePlayerHealth(playerid, 20.0); if(PlayerInfo[playerid][pHunger] + 25 >= 100) PlayerInfo[playerid][pHunger] = 100; else PlayerInfo[playerid][pHunger] += 25; if(PlayerInfo[playerid][pLoseReason] == REASON_HUNGER || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received french fries.", GetPlayerRPName(playerid), price); } case 3: { new price = 50; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); GivePlayerHealth(playerid, 25.0); if(PlayerInfo[playerid][pHunger] + 30 >= 100) PlayerInfo[playerid][pHunger] = 100; else PlayerInfo[playerid][pHunger] += 30; if(PlayerInfo[playerid][pLoseReason] == REASON_HUNGER || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a hamburger.", GetPlayerRPName(playerid), price); } case 4: { new price = 70; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); GivePlayerHealth(playerid, 30.0); if(PlayerInfo[playerid][pHunger] + 40 >= 100) PlayerInfo[playerid][pHunger] = 100; else PlayerInfo[playerid][pHunger] += 40; if(PlayerInfo[playerid][pLoseReason] == REASON_HUNGER || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a cheeseburger.", GetPlayerRPName(playerid), price); } case 5: { new price = 75; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); GivePlayerHealth(playerid, 25.0); if(PlayerInfo[playerid][pHunger] + 30 >= 100) PlayerInfo[playerid][pHunger] = 100; else PlayerInfo[playerid][pHunger] += 30; if(PlayerInfo[playerid][pLoseReason] == REASON_HUNGER || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a mac & cheese.", GetPlayerRPName(playerid), price); } case 6: { new price = 65; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); GivePlayerHealth(playerid, 35.0); if(PlayerInfo[playerid][pHunger] + 45 >= 100) PlayerInfo[playerid][pHunger] = 100; else PlayerInfo[playerid][pHunger] += 45; if(PlayerInfo[playerid][pLoseReason] == REASON_HUNGER || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a club sandwich.", GetPlayerRPName(playerid), price); } case 7: { new price = 120; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); GivePlayerHealth(playerid, 45.0); if(PlayerInfo[playerid][pHunger] + 50>= 100) PlayerInfo[playerid][pHunger] = 100; else PlayerInfo[playerid][pHunger] += 50; if(PlayerInfo[playerid][pLoseReason] == REASON_HUNGER || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received fish & chips.", GetPlayerRPName(playerid), price); } case 8: { new price = 180; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); GivePlayerHealth(playerid, 55.0); PlayerInfo[playerid][pHunger] = 100; PlayerInfo[playerid][pThirst] = 100; if(PlayerInfo[playerid][pLoseReason] != -1) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a big meal.", GetPlayerRPName(playerid), price); } } } else if(BusinessInfo[businessid][bType] == BUSINESS_BARCLUB) { switch(listitem) { case 0: { new price = 12; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); //GivePlayerHealth(playerid, 10.0); if(PlayerInfo[playerid][pThirst] + 15 >= 100) PlayerInfo[playerid][pThirst] = 100; else PlayerInfo[playerid][pThirst] += 15; if(PlayerInfo[playerid][pLoseReason] == REASON_THIRST || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a bottled water.", GetPlayerRPName(playerid), price); } case 1: { new price = 15; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_SPRUNK); if(PlayerInfo[playerid][pThirst] + 20 >= 100) PlayerInfo[playerid][pThirst] = 100; else PlayerInfo[playerid][pThirst] += 20; if(PlayerInfo[playerid][pLoseReason] == REASON_THIRST || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a can of sprunk.", GetPlayerRPName(playerid), price); } case 2: { new price = 20; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER); if(PlayerInfo[playerid][pThirst] + 30 >= 100) PlayerInfo[playerid][pThirst] = 100; else PlayerInfo[playerid][pThirst] += 30; if(PlayerInfo[playerid][pLoseReason] == REASON_THIRST || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a bottle of beer.", GetPlayerRPName(playerid), price); } case 3: { new price = 50; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE); if(PlayerInfo[playerid][pThirst] + 45 >= 100) PlayerInfo[playerid][pThirst] = 100; else PlayerInfo[playerid][pThirst] += 45; if(PlayerInfo[playerid][pLoseReason] == REASON_THIRST || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a bottle of wine.", GetPlayerRPName(playerid), price); } case 4: { new price = 75; if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money. You can't buy this."); } if(PlayerInfo[playerid][pTraderUpgrade] > 0) { price -= percent(price, (PlayerInfo[playerid][pTraderUpgrade] * 10)); SendClientMessageEx(playerid, COLOR_YELLOW3, "Trader Perk: Your level %i/3 trader perk reduced the price of this item to $%i.", PlayerInfo[playerid][pTraderUpgrade], price); } GivePlayerCash(playerid, -price); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_WINE); if(PlayerInfo[playerid][pThirst] + 55 >= 100) PlayerInfo[playerid][pThirst] = 100; else PlayerInfo[playerid][pThirst] += 55; if(PlayerInfo[playerid][pLoseReason] == REASON_THIRST || PlayerInfo[playerid][pLoseReason] == REASON_ALL) { PlayerInfo[playerid][pLoseReason] = -1; KillTimer(PlayerInfo[playerid][pLoseHealth]); } BusinessInfo[businessid][bCash] += price; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the shopkeeper and received a bottle of whiskey.", GetPlayerRPName(playerid), price); } } } else if(BusinessInfo[businessid][bType] == BUSINESS_TOOLSHOP) { //First aid kit\t500 materials\nBody repair kit\t1000 materials\nPolice scanner\t2000 materials\nRimkit\t4000 materials switch(listitem) { case 0: { if(PlayerInfo[playerid][pCash] < 1000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this."); } if(PlayerInfo[playerid][pFirstAid] + 1 > 20) { return SendClientMessage(playerid, COLOR_GREY, "You can't carry more than 20 first aid kits."); } PlayerInfo[playerid][pFirstAid]++; PlayerInfo[playerid][pCash] -= 1000; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET firstaid = %i, cash = %i WHERE uid = %i", PlayerInfo[playerid][pFirstAid], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); BusinessInfo[businessid][bCash] += 1000; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET materials = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid 1000 dollars to the shopkeeper and received a first aid kit.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_WHITE, "HINT: Use /firstaid to in order to use a first aid kit."); } case 1: { if(PlayerInfo[playerid][pCash] < 2000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this."); } if(PlayerInfo[playerid][pBodykits] + 1 > 10) { return SendClientMessage(playerid, COLOR_GREY, "You can't carry more than 10 bodywork kits."); } PlayerInfo[playerid][pBodykits]++; PlayerInfo[playerid][pCash] -= 2000; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bodykits = %i, cash = %i WHERE uid = %i", PlayerInfo[playerid][pBodykits], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); BusinessInfo[businessid][bCash] += 2000; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid 2000 dollars to the shopkeeper and received a bodywork kit.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_WHITE, "HINT: Use /bodykit in a vehicle to repair its bodywork and health."); } case 2: { if(PlayerInfo[playerid][pMaterials] < 8000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this."); } if(PlayerInfo[playerid][pPoliceScanner]) { return SendClientMessage(playerid, COLOR_GREY, "You already have this item."); } PlayerInfo[playerid][pPoliceScanner] = 1; PlayerInfo[playerid][pCash] -= 8000; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET policescanner = 1, cash = %i WHERE uid = %i", PlayerInfo[playerid][pCash], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); BusinessInfo[businessid][bCash] += 8000; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid 8000 dollars to the shopkeeper and received a police scanner.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_WHITE, "HINT: Use /scanner to listen to emergency and department chats."); } case 3: { if(PlayerInfo[playerid][pCash] < 4000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this."); } if(PlayerInfo[playerid][pRimkits] + 1 > 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't carry more than 5 rimkits."); } PlayerInfo[playerid][pRimkits]++; PlayerInfo[playerid][pCash] -= 4000; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rimkits = %i, cash = %i WHERE uid = %i", PlayerInfo[playerid][pRimkits], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); BusinessInfo[businessid][bCash] += 4000; BusinessInfo[businessid][bProducts]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i, products = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid 4000 dollars to the shopkeeper and received a rimkit.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_WHITE, "HINT: Use /rimkit in your vehicle to install a new set of rims."); } } } } } case DIALOG_BUYCLOTHES: { // Disabled. See OnPlayerSelectionMenuResponse for the new clothes shop code. } case DIALOG_PICKLOAD: { if(response) { if(!PlayerHasJob(playerid, JOB_COURIER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you are not a Courier."); } if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 414 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 498) { return SendClientMessage(playerid, COLOR_GREY, "You need to be driving a Mule or a Boxville."); } if(!IsPlayerInRangeOfPoint(playerid, 8.0, 572.9066,1215.9198,11.9283)) { return SendClientMessage(playerid, COLOR_GREY, "You are not at the loading dock."); } switch(listitem) { case 0: { SendClientMessage(playerid, COLOR_AQUA, "You selected {FF6347}Grocery supplies{33CCFF}. Use /deliver at any 24/7 to drop off this shipment."); PlayerInfo[playerid][pShipment] = BUSINESS_STORE; } case 1: { SendClientMessage(playerid, COLOR_AQUA, "You selected {FF6347}Ammunition{33CCFF}. Use /deliver at any Gun Shop to drop off this shipment."); PlayerInfo[playerid][pShipment] = BUSINESS_Ammunation; } case 2: { SendClientMessage(playerid, COLOR_AQUA, "You selected {FF6347}Clothing items{33CCFF}. Use /deliver at any Clothes Shop to drop off this shipment."); PlayerInfo[playerid][pShipment] = BUSINESS_CLOTHES; } case 3: { SendClientMessage(playerid, COLOR_AQUA, "You selected {FF6347}Food & drinks{33CCFF}. Use /deliver at any Restaurant to drop off this shipment."); PlayerInfo[playerid][pShipment] = BUSINESS_RESTAURANT; } case 4: { SendClientMessage(playerid, COLOR_AQUA, "You selected {FF6347}Beverages{33CCFF}. Use /deliver at any Club/Bar to drop off this shipment."); PlayerInfo[playerid][pShipment] = BUSINESS_BARCLUB; } case 5: { SendClientMessage(playerid, COLOR_AQUA, "You selected {FF6347}Tools & equipment{33CCFF}. Use /deliver at any Tool Shop to drop off this shipment."); PlayerInfo[playerid][pShipment] = BUSINESS_TOOLSHOP; } } PlayerInfo[playerid][pLastLoad] = gettime(); } } case DIALOG_UNREADTEXTS: { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM texts WHERE recipient_number = %i ORDER BY date DESC LIMIT 25", PlayerInfo[playerid][pPhone]); mysql_tquery(connectionID, queryBuffer); if(response) { callcmd::texts(playerid, "\1"); } } case DIALOG_ATM: { if(response) { if(listitem == 0) { ShowDialogToPlayer(playerid, DIALOG_ATMDEPOSIT); } else { ShowDialogToPlayer(playerid, DIALOG_ATMWITHDRAW); } } } case DIALOG_ATMDEPOSIT: { if(response) { new amount, fee; if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_ATM); } if(amount < 1 || amount > PlayerInfo[playerid][pCash]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount. Please try again."); ShowDialogToPlayer(playerid, DIALOG_ATMDEPOSIT); return 1; } if(amount > 1000000) { SendClientMessage(playerid, COLOR_GREY, "You can't deposit more than $1,000,000 at a time."); ShowDialogToPlayer(playerid, DIALOG_ATMDEPOSIT); return 1; } PlayerInfo[playerid][pBank] += amount; GivePlayerCash(playerid, -amount); if(PlayerInfo[playerid][pVIPPackage] == 0) { fee = percent(amount, 3); PlayerInfo[playerid][pBank] -= fee; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bank = %i WHERE uid = %i", PlayerInfo[playerid][pBank], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s presses a button and deposits some cash into the ATM.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have deposited %s into your account. Your new balance is %s.", FormatNumber(amount), FormatNumber(PlayerInfo[playerid][pBank])); if(fee) { SendClientMessageEx(playerid, COLOR_WHITE, "A 3 percent convenience fee of %s was deducted from your bank account.", FormatNumber(fee)); AddToTaxVault(fee); } else if(PlayerInfo[playerid][pVIPPackage] > 0) { SendClientMessage(playerid, COLOR_VIP, "VIP Perk: You do not pay the 3 percent convenience fee as you are a VIP!"); } } } case DIALOG_ATMWITHDRAW: { if(response) { new amount, fee; if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_ATMWITHDRAW); } if(amount < 1 || amount > PlayerInfo[playerid][pBank]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount. Please try again."); ShowDialogToPlayer(playerid, DIALOG_ATMWITHDRAW); return 1; } if(amount > 1000000) { SendClientMessage(playerid, COLOR_GREY, "You can't withdraw more than $1,000,000 at a time."); ShowDialogToPlayer(playerid, DIALOG_ATMWITHDRAW); return 1; } PlayerInfo[playerid][pBank] -= amount; GivePlayerCash(playerid, amount); if(PlayerInfo[playerid][pVIPPackage] == 0) { fee = percent(amount, 3); PlayerInfo[playerid][pBank] -= fee; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bank = %i WHERE uid = %i", PlayerInfo[playerid][pBank], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s presses a button and withdraws some cash from the ATM.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have withdrawn %s from your account. Your new balance is %s.", FormatNumber(amount), FormatNumber(PlayerInfo[playerid][pBank])); if(fee) { SendClientMessageEx(playerid, COLOR_WHITE, "A 3 percent convenience fee of %s was deducted from your bank account.", FormatNumber(fee)); AddToTaxVault(fee); } else if(PlayerInfo[playerid][pVIPPackage] > 0) { SendClientMessage(playerid, COLOR_VIP, "VIP Perk: You do not pay the 3 percent convenience fee as you are a VIP!"); } } } case DIALOG_CHANGEPASS: { if(response) { if(strlen(inputtext) < 4) { return SendClientMessage(playerid, COLOR_GREY, "You need to enter a password greater than 4 characters."); } new password[129]; WP_Hash(password, sizeof(password), inputtext); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET password = '%s', passwordchanged = '1' WHERE uid = %i", password, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_WHITE, "Your account password was changed successfully."); } } case DIALOG_BUYCLOTHINGTYPE: { if(response) { PlayerInfo[playerid][pMenuType] = listitem; if(listitem == 0) ShowClothingSelectionMenu(playerid); else ShowDialogToPlayer(playerid, DIALOG_BUYCLOTHING); } else { callcmd::buy(playerid, "\1"); } } case DIALOG_BUYCLOTHING: { if(response) { PreviewClothing(playerid, listitem + PlayerInfo[playerid][pClothingIndex]); } else { ShowDialogToPlayer(playerid, DIALOG_BUYCLOTHINGTYPE); } } case DIALOG_CLOTHING: { if(response) { if(!ClothingInfo[playerid][listitem][cExists]) { return SendClientMessage(playerid, COLOR_GREY, "The slot you've selected does not contain any item of clothing."); } if(ClothingInfo[playerid][listitem][cAttached]) { ShowPlayerDialog(playerid, DIALOG_CLOTHINGMENU, DIALOG_STYLE_LIST, ClothingInfo[playerid][listitem][cName], "Detach\nEdit\nDelete", "Select", "Cancel"); } else { ShowPlayerDialog(playerid, DIALOG_CLOTHINGMENU, DIALOG_STYLE_LIST, ClothingInfo[playerid][listitem][cName], "Attach\nEdit\nDelete", "Select", "Cancel"); } PlayerInfo[playerid][pSelected] = listitem; } } case DIALOG_CLOTHINGMENU: { if(response) { new clothingid = PlayerInfo[playerid][pSelected]; switch(listitem) { case 0: { if(!ClothingInfo[playerid][clothingid][cAttached]) { ClothingInfo[playerid][clothingid][cAttachedIndex] = GetAvailableAttachedSlot(playerid); if(ClothingInfo[playerid][clothingid][cAttachedIndex] >= 0) { ClothingInfo[playerid][clothingid][cAttached] = 1; SetPlayerAttachedObject(playerid, ClothingInfo[playerid][clothingid][cAttachedIndex], ClothingInfo[playerid][clothingid][cModel], ClothingInfo[playerid][clothingid][cBone], ClothingInfo[playerid][clothingid][cPosX], ClothingInfo[playerid][clothingid][cPosY], ClothingInfo[playerid][clothingid][cPosZ], ClothingInfo[playerid][clothingid][cRotX], ClothingInfo[playerid][clothingid][cRotY], ClothingInfo[playerid][clothingid][cRotZ], ClothingInfo[playerid][clothingid][cScaleX], ClothingInfo[playerid][clothingid][cScaleY], ClothingInfo[playerid][clothingid][cScaleZ]); SendClientMessageEx(playerid, COLOR_WHITE, "%s attached to slot %i/5.", ClothingInfo[playerid][clothingid][cName], ClothingInfo[playerid][clothingid][cAttachedIndex] + 1); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE clothing SET attached = 1 WHERE id = %i", ClothingInfo[playerid][clothingid][cID]); mysql_tquery(connectionID, queryBuffer); for(new i = 0, count = 0; i < MAX_PLAYER_CLOTHING; i ++) { if(ClothingInfo[playerid][i][cExists] && ClothingInfo[playerid][i][cAttached]) { count++; if(count == 5) { AwardAchievement(playerid, "Dress up"); } } } } else { SendClientMessage(playerid, COLOR_GREY, "No attachment slots available. You can only have up to five clothing items attached at once."); } } else { RemovePlayerAttachedObject(playerid, ClothingInfo[playerid][clothingid][cAttachedIndex]); ClothingInfo[playerid][clothingid][cAttached] = 0; ClothingInfo[playerid][clothingid][cAttachedIndex] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE clothing SET attached = 0 WHERE id = %i", ClothingInfo[playerid][clothingid][cID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_WHITE, "%s detached and added to inventory.", ClothingInfo[playerid][clothingid][cName]); } } case 1: { ShowPlayerDialog(playerid, DIALOG_CLOTHINGEDIT, DIALOG_STYLE_LIST, "Edition menu", "Edit offset\nChange bone", "Select", "Cancel"); } case 2: { RemovePlayerAttachedObject(playerid, ClothingInfo[playerid][clothingid][cAttachedIndex]); SendClientMessageEx(playerid, COLOR_WHITE, "%s deleted from your clothing inventory.", ClothingInfo[playerid][clothingid][cName]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM clothing WHERE id = %i", ClothingInfo[playerid][clothingid][cID]); mysql_tquery(connectionID, queryBuffer); ClothingInfo[playerid][clothingid][cAttached] = 0; ClothingInfo[playerid][clothingid][cAttachedIndex] = -1; ClothingInfo[playerid][clothingid][cExists] = 0; ClothingInfo[playerid][clothingid][cID] = 0; ClothingInfo[playerid][clothingid][cName] = 0; } } } } case DIALOG_CLOTHINGEDIT: { if(response) { switch(listitem) { case 0: { PlayerInfo[playerid][pEditType] = EDIT_CLOTHING; if(!ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cAttached]) { SetPlayerAttachedObject(playerid, 9, ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cModel], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cBone], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cPosX], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cPosY], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cPosZ], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cRotX], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cRotY], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cRotZ], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cScaleX], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cScaleY], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cScaleZ]); EditAttachedObject(playerid, 9); } else { EditAttachedObject(playerid, ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cAttachedIndex]); } GameTextForPlayer(playerid, "~w~Editing Mode~n~~g~Click disk to save~n~~r~Press ESC to cancel", 5000, 1); } case 1: { ShowPlayerDialog(playerid, DIALOG_CLOTHINGBONE, DIALOG_STYLE_LIST, "Choose a new bone for this clothing item.", "Spine\nHead\nLeft upper arm\nRight upper arm\nLeft hand\nRight hand\nLeft thigh\nRight thigh\nLeft foot\nRight foot\nRight calf\nLeft calf\nLeft forearm\nRight forearm\nLeft shoulder\nRight shoulder\nNeck\nJaw", "Select", "Cancel"); } } } } case DIALOG_CLOTHINGBONE: { if(response) { ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cBone] = listitem + 1; if(ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cAttached]) { RemovePlayerAttachedObject(playerid, ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cAttachedIndex]); SetPlayerAttachedObject(playerid, ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cAttachedIndex], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cModel], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cBone], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cPosX], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cPosY], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cPosZ], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cRotX], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cRotY], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cRotZ], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cScaleX], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cScaleY], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cScaleZ]); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE clothing SET boneid = %i WHERE id = %i", ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cBone], ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_WHITE, "Bone for {00AA00}%s{FFFFFF} changed to '%s'.", ClothingInfo[playerid][PlayerInfo[playerid][pSelected]][cName], inputtext); } } case DIALOG_BUYVEHICLE: { if(response) { if(PlayerInfo[playerid][pCash] < vehicleArray[listitem][carPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this vehicle."); } new string[128]; PlayerInfo[playerid][pSelected] = listitem; format(string, sizeof(string), "{FFD700}Confirmation:\nAre you sure you want to purchase this %s for {00AA00}$%i{FFD700}?", vehicleNames[vehicleArray[listitem][carModel] - 400], vehicleArray[listitem][carPrice]); ShowPlayerDialog(playerid, DIALOG_BUYVEHICLE2, DIALOG_STYLE_MSGBOX, "Purchase confirmation", string, "Yes", "No"); } } case DIALOG_BUYBOAT: { if(response) { for(new i = 0; i < sizeof(vehicleArray); i ++) { if(!strcmp(vehicleArray[i][carCategory], "Boats")) { listitem += i; if(PlayerInfo[playerid][pCash] < vehicleArray[listitem][carPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this vehicle."); } new string[128]; PlayerInfo[playerid][pSelected] = listitem; format(string, sizeof(string), "{FFD700}Confirmation:\nAre you sure you want to purchase this %s for {00AA00}$%i{FFD700}?", vehicleNames[vehicleArray[listitem][carModel] - 400], vehicleArray[listitem][carPrice]); ShowPlayerDialog(playerid, DIALOG_BUYVEHICLE2, DIALOG_STYLE_MSGBOX, "Purchase confirmation", string, "Yes", "No"); return 1; } } } } case DIALOG_BUYAIRCRAFT: { if(response) { for(new i = 0; i < sizeof(vehicleArray); i ++) { if(!strcmp(vehicleArray[i][carCategory], "Aircraft")) { listitem += i; if(PlayerInfo[playerid][pCash] < vehicleArray[listitem][carPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this vehicle."); } new string[128]; PlayerInfo[playerid][pSelected] = listitem; format(string, sizeof(string), "{FFD700}Confirmation:\nAre you sure you want to purchase this %s for {00AA00}$%i{FFD700}?", vehicleNames[vehicleArray[listitem][carModel] - 400], vehicleArray[listitem][carPrice]); ShowPlayerDialog(playerid, DIALOG_BUYVEHICLE2, DIALOG_STYLE_MSGBOX, "Purchase confirmation", string, "Yes", "No"); return 1; } } } } case DIALOG_BUYVEHICLE2: { if(response) { if(PlayerInfo[playerid][pGangCar]) { new string[20]; listitem = PlayerInfo[playerid][pSelected]; if(PlayerInfo[playerid][pCash] < vehicleArray[listitem][carPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this vehicle."); } if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You are not rank 5+ in any gang at the moment."); } if(GetGangVehicles(PlayerInfo[playerid][pGang]) >= GetGangVehicleLimit(PlayerInfo[playerid][pGang])) { return SendClientMessageEx(playerid, COLOR_GREY, "Your gang can't have more than %i vehicles at its level.", GetGangVehicleLimit(PlayerInfo[playerid][pGang])); } new Float:x, Float:y, Float:z, Float:angle; if(IsPlayerInRangeOfPoint(playerid, 3.0, 542.0433, -1293.5909, 17.2422)) { switch(random(3)) { case 0: x = 562.3970, y = -1283.8485, z = 17.0007, angle = 0.0000; case 1: x = 557.8670, y = -1283.9822, z = 17.0007, angle = 0.0000; case 2: x = 552.8177, y = -1284.1307, z = 17.0007, angle = 0.0000; } } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 154.2223, -1946.3030, 5.1920)) { switch(random(4)) { case 0: x = 138.0530, y = -1828.8923, z = -0.4000, angle = 90.0000; case 1: x = 138.0067, y = -1819.7065, z = -0.4000, angle = 90.0000; case 2: x = 137.9428, y = -1810.7821, z = -0.4000, angle = 90.0000; case 3: x = 137.0448, y = -1801.4567, z = -0.4000, angle = 90.0000; } } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 1892.6315, -2328.6721, 13.5469)) { switch(random(3)) { case 0: x = 1806.3048, y = -2424.4480, z = 15.0087, angle = 180.0000; case 1: x = 1847.3726, y = -2428.7100, z = 15.0087, angle = 180.0000; case 2: x = 1891.6610, y = -2433.3047, z = 15.0087, angle = 180.0000; } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO vehicles (modelid, price, pos_x, pos_y, pos_z, pos_a, gangid, respawndelay) VALUES(%i, %i, '%f', '%f', '%f', '%f', %i, 600)", vehicleArray[listitem][carModel], vehicleArray[listitem][carPrice], x, y, z, angle, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); AddPointMoney(POINT_AUTOEXPORT, percent(vehicleArray[listitem][carPrice], 3)); mysql_tquery(connectionID, "SELECT * FROM vehicles WHERE id = LAST_INSERT_ID()", "OnQueryFinished", "ii", THREAD_LOAD_VEHICLES, -1); format(string, sizeof(string), "~r~-$%i", vehicleArray[listitem][carPrice]); GameTextForPlayer(playerid, string, 5000, 1); GivePlayerCash(playerid, -vehicleArray[listitem][carPrice]); PlayerInfo[playerid][pGangCar] = 0; SendClientMessageEx(playerid, COLOR_GREEN, "%s purchased for your gang for $%i. /ganghelp for more commands.", vehicleNames[vehicleArray[listitem][carModel] - 400], vehicleArray[listitem][carPrice]); Log_Write("log_give", "%s (uid: %i) purchased a %s for %s for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], vehicleNames[vehicleArray[listitem][carModel] - 400], GangInfo[PlayerInfo[playerid][pGang]][gName], vehicleArray[listitem][carPrice]); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM vehicles WHERE ownerid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer, "OnPlayerAttemptBuyVehicle", "i", playerid); } } } case DIALOG_SPAWNCAR: { if(response) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM vehicles WHERE ownerid = %i LIMIT %i, 1", PlayerInfo[playerid][pID], listitem); mysql_tquery(connectionID, queryBuffer, "OnPlayerSpawnVehicle", "ii", playerid, false); } } case DIALOG_DESPAWNCAR: { if(response) { new count; foreach(new i: Vehicle) { if((VehicleInfo[i][vID] > 0 && IsVehicleOwner(playerid, i)) && (count++ == listitem)) { if(IsVehicleOccupied(i) && GetVehicleDriver(i) != playerid) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle is occupied."); } SendClientMessageEx(playerid, COLOR_AQUA, "Your {FF6347}%s{33CCFF} which is located in %s has been despawned.", GetVehicleName(i), GetVehicleZoneName(i)); DespawnVehicle(i); return 1; } } } } case DIALOG_CARSTORAGE: { if(response) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT id FROM vehicles WHERE ownerid = %i LIMIT %i, 1", PlayerInfo[playerid][pID], listitem); mysql_tquery(connectionID, queryBuffer, "OnPlayerUseCarStorage", "i", playerid); } } case DIALOG_FINDCAR: { if(response) { new count, garageid; foreach(new i: Vehicle) { if((VehicleInfo[i][vID] > 0 && IsVehicleOwner(playerid, i)) && (count++ == listitem)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; if((garageid = GetVehicleGarage(i)) >= 0) { SetPlayerCheckpoint(playerid, GarageInfo[garageid][gPosX], GarageInfo[garageid][gPosY], GarageInfo[garageid][gPosZ], 3.0); SendClientMessageEx(playerid, COLOR_YELLOW, "Your %s is located in a garage. Checkpoint marked at the garage's location.", GetVehicleName(i)); } else { new Float:x, Float:y, Float:z; GetVehiclePos(i, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 3.0); SendClientMessageEx(playerid, COLOR_YELLOW, "Your %s is located in %s. Checkpoint marked at the location.", GetVehicleName(i), GetZoneName(x, y, z)); } return 1; } } } } case DIALOG_BIZINTERIOR: { if(response) { new businessid = PlayerInfo[playerid][pSelected]; foreach(new i : Player) { if(GetInsideBusiness(i) == businessid) { SetPlayerPos(i, bizInteriorArray[listitem][intX], bizInteriorArray[listitem][intY], bizInteriorArray[listitem][intZ]); SetPlayerFacingAngle(i, bizInteriorArray[listitem][intA]); SetPlayerInterior(i, bizInteriorArray[listitem][intID]); SetCameraBehindPlayer(i); } } BusinessInfo[businessid][bIntX] = bizInteriorArray[listitem][intX]; BusinessInfo[businessid][bIntY] = bizInteriorArray[listitem][intY]; BusinessInfo[businessid][bIntZ] = bizInteriorArray[listitem][intZ]; BusinessInfo[businessid][bIntA] = bizInteriorArray[listitem][intA]; BusinessInfo[businessid][bInterior] = bizInteriorArray[listitem][intID]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET int_x = '%f', int_y = '%f', int_z = '%f', int_a = '%f', interior = %i WHERE id = %i", BusinessInfo[businessid][bIntX], BusinessInfo[businessid][bIntY], BusinessInfo[businessid][bIntZ], BusinessInfo[businessid][bIntA], BusinessInfo[businessid][bInterior], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_AQUA, "You've changed the interior of business %i to %s.", businessid, bizInteriorArray[listitem][intName]); } } case DIALOG_FACTIONLOCKER: { if((response) && PlayerInfo[playerid][pFaction] >= 0 && IsPlayerInRangeOfLocker(playerid, PlayerInfo[playerid][pFaction])) { switch(FactionInfo[PlayerInfo[playerid][pFaction]][fType]) { case FACTION_POLICE, FACTION_MEDIC, FACTION_FEDERAL, FACTION_ARMY: { if(listitem == 0) // Toggle duty { if(!PlayerInfo[playerid][pDuty]) { if(IsLawEnforcement(playerid)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s clocks in and grabs their police issued equipment from the locker.", GetPlayerRPName(playerid)); } else if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == FACTION_MEDIC) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s clocks in and grabs their medical supplies from the locker.", GetPlayerRPName(playerid)); } PlayerInfo[playerid][pDuty] = 1; SetPlayerHealth(playerid, 100.0); SetScriptArmour(playerid, 100.0); } else { PlayerInfo[playerid][pDuty] = 0; //ResetPlayerWeaponsEx(playerid); //SetScriptArmour(playerid, 0.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s clocks out and puts their equipment back in the locker.", GetPlayerRPName(playerid)); } } else if(listitem == 1) // Equipment { ShowDialogToPlayer(playerid, DIALOG_FACTIONEQUIPMENT); /*if(IsLawEnforcement(playerid)) { ShowPlayerDialog(playerid, DIALOG_FACTIONEQUIPMENT, DIALOG_STYLE_LIST, "Equipment", "Kevlar Vest\nMedkit\nNitestick\nSpraycan\nDesert Eagle\nShotgun\nMP5\nM4\nSPAS-12\nSniper Rifle", "Select", "Cancel"); } else { ShowPlayerDialog(playerid, DIALOG_FACTIONEQUIPMENT, DIALOG_STYLE_LIST, "Equipment", "Kevlar Vest\nMedkit\nFire Extinguisher\nDesert Eagle\nPainkillers", "Select", "Cancel"); }*/ } else if(listitem == 2) // Uniforms { if(!GetFactionSkinCount(PlayerInfo[playerid][pFaction])) { return SendClientMessage(playerid, COLOR_GREY, "There are no uniforms setup for your faction."); } if(PlayerInfo[playerid][pClothes] >= 0) { PlayerInfo[playerid][pSkin] = PlayerInfo[playerid][pClothes]; PlayerInfo[playerid][pClothes] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET skin = %i, clothes = -1 WHERE uid = %i", PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s switches back to their old outfit.", GetPlayerRPName(playerid)); } else { PlayerInfo[playerid][pSkinSelected] = -1; ShowPlayerDialog(playerid, DIALOG_FACTIONSKINS, DIALOG_STYLE_MSGBOX, "Uniform selection", "Press {00AA00}>> Next{A9C4E4} to browse through available uniforms.", ">> Next", "Confirm"); } } else if(listitem == 3 && FactionInfo[PlayerInfo[playerid][pFaction]][fType] != FACTION_MEDIC) { ShowCopClothingMenu(playerid); } } case FACTION_GOVERNMENT, FACTION_NEWS: { if(listitem == 0) // Equipment { ShowDialogToPlayer(playerid, DIALOG_FACTIONEQUIPMENT); /*if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == FACTION_GOVERNMENT) { ShowPlayerDialog(playerid, DIALOG_FACTIONEQUIPMENT, DIALOG_STYLE_LIST, "Equipment", "Kevlar Vest\nMedkit\nDesert Eagle\nShotgun\nMP5\nM4\nSPAS-12", "Select", "Cancel"); } else { ShowPlayerDialog(playerid, DIALOG_FACTIONEQUIPMENT, DIALOG_STYLE_LIST, "Equipment", "Kevlar Vest\nMedkit\nCamera", "Select", "Cancel"); }*/ } else if(listitem == 1) // Uniforms { if(!GetFactionSkinCount(PlayerInfo[playerid][pFaction])) { return SendClientMessage(playerid, COLOR_GREY, "There are no uniforms setup for your faction."); } if(PlayerInfo[playerid][pClothes] >= 0) { PlayerInfo[playerid][pSkin] = PlayerInfo[playerid][pClothes]; PlayerInfo[playerid][pClothes] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET skin = %i, clothes = -1 WHERE uid = %i", PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s switches back to their old outfit.", GetPlayerRPName(playerid)); } else { PlayerInfo[playerid][pSkinSelected] = -1; ShowPlayerDialog(playerid, DIALOG_FACTIONSKINS, DIALOG_STYLE_MSGBOX, "Uniform selection", "Press {00AA00}>> Next{A9C4E4} to browse through available uniforms.", ">> Next", "Confirm"); } } } case FACTION_HITMAN: { if(listitem == 0) // Order weapons { ShowPlayerDialog(playerid, DIALOG_FACTIONEQUIPMENT, DIALOG_STYLE_LIST, "Order weapons", "Kevlar Vest ($1,000)\nKnife ($1,500)\nSilenced pistol ($1,000)\nShotgun ($1,500)\nDesert Eagle ($2,000)\nMP5 ($2,500)\nCountry rifle ($4,000)\nAK-47 ($6,000)\nM4 ($8,000)\nSniper rifle ($9,000)\nBomb ($15,000)", "Order", "Cancel"); } else if(listitem == 1) // Change clothes { ShowPlayerDialog(playerid, DIALOG_HITMANCLOTHES, DIALOG_STYLE_INPUT, "Change clothes", "Please input the ID of the skin you wish to purchase.\n(( List of skins: http://wiki.sa-mp.com/wiki/Skins:All ))", "Submit", "Cancel"); } } } } } case DIALOG_FACTIONEQUIPMENT: { if((response) && PlayerInfo[playerid][pFaction] >= 0 && IsPlayerInRangeOfLocker(playerid, PlayerInfo[playerid][pFaction])) { switch(FactionInfo[PlayerInfo[playerid][pFaction]][fType]) { /*case FACTION_POLICE, FACTION_FEDERAL, FACTION_ARMY: { switch(listitem) { case 0: { SetScriptArmour(playerid, 100.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a kevlar vest from the locker and puts it on.", GetPlayerRPName(playerid)); } case 1: { SetPlayerHealth(playerid, 100.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a medkit from the locker and opens it.", GetPlayerRPName(playerid)); } case 2: { GivePlayerWeaponEx(playerid, 3); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a nitestick from the locker.", GetPlayerRPName(playerid)); } case 3: { GivePlayerWeaponEx(playerid, 41); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a can of pepper spray from the locker.", GetPlayerRPName(playerid)); } case 4: { GivePlayerWeaponEx(playerid, 24); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a Desert Eagle from the locker.", GetPlayerRPName(playerid)); } case 5: { GivePlayerWeaponEx(playerid, 25); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a Shotgun from the locker.", GetPlayerRPName(playerid)); } case 6: { GivePlayerWeaponEx(playerid, 29); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs an MP5 from the locker.", GetPlayerRPName(playerid)); } case 7: { GivePlayerWeaponEx(playerid, 31); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs an M4 from the locker.", GetPlayerRPName(playerid)); } case 8: { GivePlayerWeaponEx(playerid, 27); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a SPAS-12 from the locker.", GetPlayerRPName(playerid)); } case 9: { GivePlayerWeaponEx(playerid, 34); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a Sniper Rifle from the locker.", GetPlayerRPName(playerid)); } } } case FACTION_MEDIC: { switch(listitem) { case 0: { SetScriptArmour(playerid, 100.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a kevlar vest from the locker and puts it on.", GetPlayerRPName(playerid)); } case 1: { SetPlayerHealth(playerid, 100.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a medkit from the locker and opens it.", GetPlayerRPName(playerid)); } case 2: { GivePlayerWeaponEx(playerid, 42); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a fire extinguisher from the locker.", GetPlayerRPName(playerid)); } case 3: { GivePlayerWeaponEx(playerid, 24); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a Desert Eagle from the locker.", GetPlayerRPName(playerid)); } case 4: { PlayerInfo[playerid][pPainkillers] = 5; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a five pack of painkillers from the locker.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[playerid][pPainkillers], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } } } case FACTION_GOVERNMENT: { switch(listitem) { case 0: { SetScriptArmour(playerid, 100.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a kevlar vest from the locker and puts it on.", GetPlayerRPName(playerid)); } case 1: { SetPlayerHealth(playerid, 100.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a medkit from the locker and opens it.", GetPlayerRPName(playerid)); } case 2: { GivePlayerWeaponEx(playerid, 24); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a Desert Eagle from the locker.", GetPlayerRPName(playerid)); } case 3: { GivePlayerWeaponEx(playerid, 25); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a Shotgun from the locker.", GetPlayerRPName(playerid)); } case 4: { GivePlayerWeaponEx(playerid, 29); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs an MP5 from the locker.", GetPlayerRPName(playerid)); } case 5: { GivePlayerWeaponEx(playerid, 31); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs an M4 from the locker.", GetPlayerRPName(playerid)); } case 6: { GivePlayerWeaponEx(playerid, 27); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a SPAS-12 from the locker.", GetPlayerRPName(playerid)); } case 7: { GivePlayerWeaponEx(playerid, 34); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a Sniper Rifle from the locker.", GetPlayerRPName(playerid)); } } } case FACTION_NEWS: { switch(listitem) { case 0: { SetScriptArmour(playerid, 100.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a kevlar vest from the locker and puts it on.", GetPlayerRPName(playerid)); } case 1: { SetPlayerHealth(playerid, 100.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a medkit from the locker and opens it.", GetPlayerRPName(playerid)); } case 2: { GivePlayerWeaponEx(playerid, 43); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs a digital camera from the locker.", GetPlayerRPName(playerid)); } } }*/ case FACTION_HITMAN: { switch(listitem) { case 0: { if(PlayerInfo[playerid][pCash] < 1000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerCash(playerid, -1000); SetScriptArmour(playerid, 100.0); SendClientMessageEx(playerid, COLOR_AQUA, "** You ordered a kevlar vest for $1,000."); GameTextForPlayer(playerid, "~r~-$1000", 5000, 1); } case 1: { if(PlayerInfo[playerid][pCash] < 1500) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, 4); GivePlayerCash(playerid, -1500); SendClientMessageEx(playerid, COLOR_AQUA, "** You ordered a knife for $1,500."); GameTextForPlayer(playerid, "~r~-$1500", 5000, 1); } case 2: { if(PlayerInfo[playerid][pCash] < 1000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, 23); GivePlayerCash(playerid, -1000); SendClientMessageEx(playerid, COLOR_AQUA, "** You ordered a silenced pistol for $1,000."); GameTextForPlayer(playerid, "~r~-$1000", 5000, 1); } case 3: { if(PlayerInfo[playerid][pCash] < 1500) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, 25); GivePlayerCash(playerid, -1500); SendClientMessageEx(playerid, COLOR_AQUA, "** You ordered a shotgun for $1,500."); GameTextForPlayer(playerid, "~r~-$1500", 5000, 1); } case 4: { if(PlayerInfo[playerid][pCash] < 2000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, 24); GivePlayerCash(playerid, -2000); SendClientMessageEx(playerid, COLOR_AQUA, "** You ordered a Desert Eagle for $2,000."); GameTextForPlayer(playerid, "~r~-$2000", 5000, 1); } case 5: { if(PlayerInfo[playerid][pCash] < 2500) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, 29); GivePlayerCash(playerid, -2500); SendClientMessageEx(playerid, COLOR_AQUA, "** You ordered an MP5 for $2,500."); GameTextForPlayer(playerid, "~r~-$2500", 5000, 1); } case 6: { if(PlayerInfo[playerid][pCash] < 4000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, 33); GivePlayerCash(playerid, -4000); SendClientMessageEx(playerid, COLOR_AQUA, "** You ordered a country rifle for $4,000."); GameTextForPlayer(playerid, "~r~-$4000", 5000, 1); } case 7: { if(PlayerInfo[playerid][pCash] < 6000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, 30); GivePlayerCash(playerid, -6000); SendClientMessageEx(playerid, COLOR_AQUA, "** You ordered an AK-47 for $6,000."); GameTextForPlayer(playerid, "~r~-$6000", 5000, 1); } case 8: { if(PlayerInfo[playerid][pCash] < 8000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, 31); GivePlayerCash(playerid, -8000); SendClientMessageEx(playerid, COLOR_AQUA, "** You ordered an M4 for $8,000."); GameTextForPlayer(playerid, "~r~-$8000", 5000, 1); } case 9: { if(PlayerInfo[playerid][pCash] < 9000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, 34); GivePlayerCash(playerid, -9000); SendClientMessageEx(playerid, COLOR_AQUA, "** You ordered a sniper rifle for $9,000."); GameTextForPlayer(playerid, "~r~-$9000", 5000, 1); } case 10: { if(PlayerInfo[playerid][pCash] < 15000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } if(PlayerInfo[playerid][pBombs] > 3) { return SendClientMessage(playerid, COLOR_GREY, "You have more than 3 bombs. You can't buy anymore."); } PlayerInfo[playerid][pBombs]++; GivePlayerCash(playerid, -15000); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bombs = %i WHERE uid = %i", PlayerInfo[playerid][pBombs], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You ordered a bomb for $15,000. /plantbomb to place the bomb."); GameTextForPlayer(playerid, "~r~-$15000", 5000, 1); } } } default: { new amount, weapon, locker = GetNearbyLocker(playerid); if(strfind(inputtext, "Kevlar Vest", true) != -1) { amount = LockerInfo[locker][locKevlar][1]; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } SetScriptArmour(playerid, 100.0); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received a kevlar vest for $%i.", amount); } else if(strfind(inputtext, "Medkit", true) != -1) { amount = LockerInfo[locker][locMedKit][1]; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } SetPlayerHealth(playerid, 100.0); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received a medkit for $%i.", amount); } else if(strfind(inputtext, "Nitestick", true) != -1) { amount = LockerInfo[locker][locNitestick][1]; weapon = 3; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, weapon); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received a %s for $%i.", GetWeaponNameEx(weapon), amount); } else if(strfind(inputtext, "Mace", true) != -1) { amount = LockerInfo[locker][locMace][1]; weapon = 41; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, weapon); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received a %s for $%i.", GetWeaponNameEx(weapon), amount); } else if(strfind(inputtext, "Deagle", true) != -1) { amount = LockerInfo[locker][locDeagle][1]; weapon = 24; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, weapon); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received a %s for $%i.", GetWeaponNameEx(weapon), amount); } else if(strfind(inputtext, "Shotgun", true) != -1) { amount = LockerInfo[locker][locShotgun][1]; weapon = 25; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, weapon); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received a %s for $%i.", GetWeaponNameEx(weapon), amount); } else if(strfind(inputtext, "MP5", true) != -1) { amount = LockerInfo[locker][locMP5][1]; weapon = 29; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, weapon); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received a %s for $%i.", GetWeaponNameEx(weapon), amount); } else if(strfind(inputtext, "M4", true) != -1) { amount = LockerInfo[locker][locM4][1]; weapon = 31; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, weapon); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received a %s for $%i.", GetWeaponNameEx(weapon), amount); } else if(strfind(inputtext, "Sniper", true) != -1) { amount = LockerInfo[locker][locSniper][1]; weapon = 34; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, weapon); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received a %s for $%i.", GetWeaponNameEx(weapon), amount); } else if(strfind(inputtext, "Camera", true) != -1) { amount = LockerInfo[locker][locCamera][1]; weapon = 43; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, weapon); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received a %s for $%i.", GetWeaponNameEx(weapon), amount); } else if(strfind(inputtext, "Fire Extinguisher", true) != -1) { amount = LockerInfo[locker][locFireExt][1]; weapon = 42; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } GivePlayerWeaponEx(playerid, weapon); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received a %s for $%i.", GetWeaponNameEx(weapon), amount); } else if(strfind(inputtext, "Painkillers", true) != -1) { amount = LockerInfo[locker][locPainKillers][1]; if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford this weapon."); } PlayerInfo[playerid][pPainkillers] = 5; GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You received painkillers for $%i.", amount); } } } } } case DIALOG_FACTIONSKINS: { if(PlayerInfo[playerid][pFaction] >= 0 && IsPlayerInRangeOfLocker(playerid, PlayerInfo[playerid][pFaction])) { if(response) { new index = PlayerInfo[playerid][pSkinSelected] + 1; if(index >= MAX_FACTION_SKINS) { // When the player is shown the dialog for the first time, their skin isn't changed until they click >> Next. SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); PlayerInfo[playerid][pSkinSelected] = -1; } else { // Find the next skin in the array. for(new i = index; i < MAX_FACTION_SKINS; i ++) { if(FactionInfo[PlayerInfo[playerid][pFaction]][fSkins][i] != 0) { SetPlayerSkin(playerid, FactionInfo[PlayerInfo[playerid][pFaction]][fSkins][i]); PlayerInfo[playerid][pSkinSelected] = i; break; } } if(index == PlayerInfo[playerid][pSkinSelected] + 1) { // Looks like there was no skin found. So, we'll go back to the very first valid skin in the skin array. for(new i = 0; i < MAX_FACTION_SKINS; i ++) { if(FactionInfo[PlayerInfo[playerid][pFaction]][fSkins][i] != 0) { SetPlayerSkin(playerid, FactionInfo[PlayerInfo[playerid][pFaction]][fSkins][i]); PlayerInfo[playerid][pSkinSelected] = i; break; } } } } ShowPlayerDialog(playerid, DIALOG_FACTIONSKINS, DIALOG_STYLE_MSGBOX, "Uniform selection", "Press {00AA00}>> Next{A9C4E4} to browse through available uniforms.", ">> Next", "Confirm"); } else { PlayerInfo[playerid][pClothes] = PlayerInfo[playerid][pSkin]; PlayerInfo[playerid][pSkin] = GetPlayerSkin(playerid); PlayerInfo[playerid][pSkinSelected] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET skin = %i, clothes = %i WHERE uid = %i", PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pClothes], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes a uniform out of the locker and puts it on.", GetPlayerRPName(playerid)); } } } case DIALOG_HITMANCLOTHES: { if((response) && PlayerInfo[playerid][pFaction] >= 0 && IsPlayerInRangeOfLocker(playerid, PlayerInfo[playerid][pFaction])) { new skinid; if(sscanf(inputtext, "i", skinid)) { return ShowPlayerDialog(playerid, DIALOG_HITMANCLOTHES, DIALOG_STYLE_INPUT, "Change clothes", "Please input the ID of the skin you wish to purchase.\n(( List of skins: http://wiki.sa-mp.com/wiki/Skins:All ))", "Submit", "Cancel"); } if(!(0 <= skinid <= 311)) { SendClientMessage(playerid, COLOR_GREY, "Invalid skin."); return ShowPlayerDialog(playerid, DIALOG_HITMANCLOTHES, DIALOG_STYLE_INPUT, "Change clothes", "Please input the ID of the skin you wish to purchase.\n(( List of skins: http://wiki.sa-mp.com/wiki/Skins:All ))", "Submit", "Cancel"); } SetScriptSkin(playerid, skinid); GameTextForPlayer(playerid, "~w~Clothes changed for free", 3000, 3); } } case DIALOG_MDC: { if((response) && IsLawEnforcement(playerid)) { switch(listitem) { case 0: { static string[2048], count; string = "Suspect\tLocation\tWanted level"; count = 0; foreach(new i : Player) { if(PlayerInfo[i][pWantedLevel] > 0) { format(string, sizeof(string), "%s\n%s\t%s\t%i/6", string, GetPlayerRPName(i), GetPlayerZoneName(i), PlayerInfo[i][pWantedLevel]); count++; } } if(!count) { return SendClientMessage(playerid, COLOR_GREY, "There are currently no wanted suspects online."); } ShowPlayerDialog(playerid, DIALOG_MDCWANTED, DIALOG_STYLE_TABLIST_HEADERS, "Suspects wanted", string, "Track", "Cancel"); } case 1: { ShowPlayerDialog(playerid, DIALOG_PLAYERLOOKUP, DIALOG_STYLE_INPUT, "Player lookup", "Enter the full name of the player to lookup:", "Submit", "Cancel"); } case 2: { ShowPlayerDialog(playerid, DIALOG_VEHICLELOOKUP1, DIALOG_STYLE_INPUT, "Vehicle lookup", "Enter the ID of the vehicle to lookup.\n(( You can find out the ID of a vehicle by using /dl. ))", "Submit", "Cancel"); } } } } case DIALOG_MDCWANTED: { if((response) && IsLawEnforcement(playerid)) { foreach(new i : Player) { if(!strcmp(GetPlayerRPName(i), inputtext)) { new Float:x, Float:y, Float:z; GetPlayerPosEx(i, x, y, z); PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, x, y, z, 3.0); SendClientMessage(playerid, COLOR_WHITE, "Checkpoint marked at the suspect's last known location."); return 1; } } SendClientMessage(playerid, COLOR_GREY, "The suspect you've selected has went offline."); } } case DIALOG_PLAYERLOOKUP: { if((response) && IsLawEnforcement(playerid)) { new username[MAX_PLAYER_NAME]; if(sscanf(inputtext, "s[24]", username)) { return ShowPlayerDialog(playerid, DIALOG_PLAYERLOOKUP, DIALOG_STYLE_INPUT, "Player lookup", "Enter the full name of the player to lookup:", "Submit", "Cancel"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid, gender, age, wantedlevel, crimes, arrested, carlicense FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "MDC_PlayerLookup", "is", playerid, username); } } case DIALOG_MDCPLAYER1: { if((response) && IsLawEnforcement(playerid)) { ShowPlayerDialog(playerid, DIALOG_MDCPLAYER2, DIALOG_STYLE_LIST, "Options", "Show active charges\nClear charges", "Select", "Cancel"); } } case DIALOG_MDCPLAYER2: { if((response) && IsLawEnforcement(playerid)) { switch(listitem) { case 0: { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM charges WHERE uid = %i", PlayerInfo[playerid][pSelected]); mysql_tquery(connectionID, queryBuffer, "MDC_ListCharges", "i", playerid); } case 1: { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT username FROM users WHERE uid = %i", PlayerInfo[playerid][pSelected]); mysql_tquery(connectionID, queryBuffer, "MDC_ClearCharges", "i", playerid); } } } } case DIALOG_MDCCHARGES: { ShowPlayerDialog(playerid, DIALOG_MDCPLAYER2, DIALOG_STYLE_LIST, "Options", "Show active charges\nClear charges", "Select", "Cancel"); } case DIALOG_VEHICLELOOKUP1: { if((response) && IsLawEnforcement(playerid)) { new vehicleid, string[128]; if(sscanf(inputtext, "i", vehicleid)) { return ShowPlayerDialog(playerid, DIALOG_VEHICLELOOKUP1, DIALOG_STYLE_INPUT, "Vehicle lookup", "Enter the ID of the vehicle to lookup.\n(( You can find out the ID of a vehicle by using /dl. ))", "Submit", "Cancel"); } if(!IsValidVehicle(vehicleid) || !VehicleInfo[vehicleid][vOwnerID]) { SendClientMessage(playerid, COLOR_GREY, "The vehicle ID specified is not owned by any particular person."); return ShowPlayerDialog(playerid, DIALOG_VEHICLELOOKUP1, DIALOG_STYLE_INPUT, "Vehicle lookup", "Enter the ID of the vehicle to lookup.\n(( You can find out the ID of a vehicle by using /dl. ))", "Submit", "Cancel"); } PlayerInfo[playerid][pSelected] = vehicleid; format(string, sizeof(string), "Name: %s\nOwner: %s\nTickets: $%i\nLocation: %s", GetVehicleName(vehicleid), VehicleInfo[vehicleid][vOwner], VehicleInfo[vehicleid][vTickets], GetVehicleZoneName(vehicleid)); ShowPlayerDialog(playerid, DIALOG_VEHICLELOOKUP2, DIALOG_STYLE_MSGBOX, "Vehicle lookup", string, "Track", "Cancel"); } } case DIALOG_VEHICLELOOKUP2: { if((response) && IsLawEnforcement(playerid)) { new garageid, vehicleid = PlayerInfo[playerid][pSelected]; if((garageid = GetVehicleGarage(vehicleid)) >= 0) { SetPlayerCheckpoint(playerid, GarageInfo[garageid][gPosX], GarageInfo[garageid][gPosY], GarageInfo[garageid][gPosZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "Checkpoint marked at the garage this vehicle is inside of."); } else { new Float:x, Float:y, Float:z; SendClientMessage(playerid, COLOR_WHITE, "Checkpoint marked at the vehicle's last known location."); GetVehiclePos(vehicleid, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 3.0); } PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; } } case DIALOG_FACTIONPAY1: { if(response) { PlayerInfo[playerid][pSelected] = listitem; ShowPlayerDialog(playerid, DIALOG_FACTIONPAY2, DIALOG_STYLE_INPUT, "Change paycheck", "Enter the new paycheck amount for this rank:", "Submit", "Back"); } } case DIALOG_FACTIONPAY2: { if(GetFactionType(playerid) != FACTION_NONE) { if(response) { new amount, factionid = PlayerInfo[playerid][pFaction], rankid = PlayerInfo[playerid][pSelected]; if(sscanf(inputtext, "i", amount)) { return ShowPlayerDialog(playerid, DIALOG_FACTIONPAY2, DIALOG_STYLE_INPUT, "Change paycheck", "Enter the new paycheck amount for this rank:", "Submit", "Back"); } if(!(1 <= amount <= 50000)) { SendClientMessage(playerid, COLOR_GREY, "The specified amount must range from $1 to $50,000."); return ShowPlayerDialog(playerid, DIALOG_FACTIONPAY2, DIALOG_STYLE_INPUT, "Change paycheck", "Enter the new paycheck amount for this rank:", "Submit", "Back"); } if(GetTotalFactionPay(factionid) - FactionInfo[factionid][fPaycheck][rankid] + amount > FactionInfo[factionid][fBudget]) { return SendClientMessageEx(playerid, COLOR_GREY, "Your faction only has a budget of $%i left! might have to do some adjusting there.", (FactionInfo[factionid][fBudget] - GetTotalFactionPay(factionid))); } FactionInfo[factionid][fPaycheck][rankid] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO factionpay(id, rank, amount) VALUES(%i, %i, %i) ON DUPLICATE KEY UPDATE amount = %i", factionid, rankid, amount, amount); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the paycheck for rank %i to $%i.", rankid, amount); Log_Write("log_faction", "%s (uid: %i) set %s's (id: %i) paycheck for rank %i to $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], FactionInfo[factionid][fName], factionid, rankid, amount); } ShowDialogToPlayer(playerid, DIALOG_FACTIONPAY1); } } case DIALOG_PHONEBOOK: { if(response) { if(!strcmp(inputtext, ">> Next page", true)) { PlayerInfo[playerid][pPage]++; ShowDialogToPlayer(playerid, DIALOG_PHONEBOOK); } else if(!strcmp(inputtext, "<< Go back", true) && PlayerInfo[playerid][pPage] > 1) { PlayerInfo[playerid][pPage]--; ShowDialogToPlayer(playerid, DIALOG_PHONEBOOK); } } } case DIALOG_CREATEZONE: { if((response) && (PlayerInfo[playerid][pAdmin] >= 8 || PlayerInfo[playerid][pGangMod] || PlayerInfo[playerid][pDynamicAdmin])) { PlayerInfo[playerid][pMinX] = 0.0; PlayerInfo[playerid][pMinY] = 0.0; PlayerInfo[playerid][pMaxX] = 0.0; PlayerInfo[playerid][pMaxY] = 0.0; if(PlayerInfo[playerid][pZoneType] == ZONETYPE_LAND) { PlayerInfo[playerid][pZoneCreation] = ZONETYPE_LAND; SendClientMessage(playerid, COLOR_WHITE, "Your land needs to be within a square or rectangle. /confirm to set the four boundary points."); } else if(PlayerInfo[playerid][pZoneType] == ZONETYPE_TURF) { PlayerInfo[playerid][pZoneCreation] = ZONETYPE_TURF; SendClientMessage(playerid, COLOR_WHITE, "Your turf needs to be within a square or rectangle. /confirm to set the four boundary points."); } } } case DIALOG_CONFIRMZONE: { if(response) { if(PlayerInfo[playerid][pZoneCreation] == ZONETYPE_LAND) { for(new i = 0; i < MAX_LANDS; i ++) { if(!LandInfo[i][lExists]) { new Float:minx = PlayerInfo[playerid][pMinX], Float:miny = PlayerInfo[playerid][pMinY], Float:maxx = PlayerInfo[playerid][pMaxX], Float:maxy = PlayerInfo[playerid][pMaxY], Float:z; GetPlayerPos(playerid, z, z, z); if(minx > maxx) { PlayerInfo[playerid][pMinX] = maxx; PlayerInfo[playerid][pMaxX] = minx; } if(miny > maxy) { PlayerInfo[playerid][pMinY] = maxy; PlayerInfo[playerid][pMaxY] = miny; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO lands (price, min_x, min_y, max_x, max_y, height) VALUES(%i, '%f', '%f', '%f', '%f', '%f')", PlayerInfo[playerid][pLandCost], PlayerInfo[playerid][pMinX], PlayerInfo[playerid][pMinY], PlayerInfo[playerid][pMaxX], PlayerInfo[playerid][pMaxY], z); mysql_tquery(connectionID, queryBuffer, "OnAdminCreateLand", "iiifffff", playerid, i, PlayerInfo[playerid][pLandCost], PlayerInfo[playerid][pMinX], PlayerInfo[playerid][pMinY], PlayerInfo[playerid][pMaxX], PlayerInfo[playerid][pMaxY], z); CancelZoneCreation(playerid); return 1; } } SendClientMessage(playerid, COLOR_GREY, "Land slots are currently full. Ask developers to increase the internal limit."); CancelZoneCreation(playerid); } else if(PlayerInfo[playerid][pZoneCreation] == ZONETYPE_TURF) { for(new i = 0; i < MAX_TURFS; i ++) { if(!TurfInfo[i][tExists]) { new Float:minx = PlayerInfo[playerid][pMinX], Float:miny = PlayerInfo[playerid][pMinY], Float:maxx = PlayerInfo[playerid][pMaxX], Float:maxy = PlayerInfo[playerid][pMaxY], Float:z; GetPlayerPos(playerid, z, z, z); if(minx > maxx) { PlayerInfo[playerid][pMinX] = maxx; PlayerInfo[playerid][pMaxX] = minx; } if(miny > maxy) { PlayerInfo[playerid][pMinY] = maxy; PlayerInfo[playerid][pMaxY] = miny; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO turfs (id, name, type, min_x, min_y, max_x, max_y, height) VALUES(%i, '%e', %i, '%f', '%f', '%f', '%f', '%f')", i, PlayerInfo[playerid][pTurfName], PlayerInfo[playerid][pTurfType], PlayerInfo[playerid][pMinX], PlayerInfo[playerid][pMinY], PlayerInfo[playerid][pMaxX], PlayerInfo[playerid][pMaxY], z); mysql_tquery(connectionID, queryBuffer, "OnAdminCreateTurf", "iisifffff", playerid, i, PlayerInfo[playerid][pTurfName], PlayerInfo[playerid][pTurfType], PlayerInfo[playerid][pMinX], PlayerInfo[playerid][pMinY], PlayerInfo[playerid][pMaxX], PlayerInfo[playerid][pMaxY], z); CancelZoneCreation(playerid); return 1; } } SendClientMessage(playerid, COLOR_GREY, "Turf slots are currently full. Ask developers to increase the internal limit."); CancelZoneCreation(playerid); } } else { CancelZoneCreation(playerid); if(PlayerInfo[playerid][pZoneType] == ZONETYPE_LAND) { SendClientMessage(playerid, COLOR_WHITE, "Your land needs to be within a square or rectangle. /confirm to set the four boundary points."); SendClientMessage(playerid, COLOR_WHITE, "Note: You can use /landcancel to exit land creation mode."); PlayerInfo[playerid][pZoneCreation] = ZONETYPE_LAND; } else if(PlayerInfo[playerid][pZoneType] == ZONETYPE_TURF) { SendClientMessage(playerid, COLOR_WHITE, "Your turf needs to be within a square or rectangle. /confirm to set the four boundary points."); SendClientMessage(playerid, COLOR_WHITE, "Note: You can use /turfcancel to exit turf creation mode."); PlayerInfo[playerid][pZoneCreation] = ZONETYPE_TURF; } } } case DIALOG_LANDBUILDTYPE: { new landid = GetNearbyLand(playerid); if(landid == -1 || !HasLandPerms(playerid, landid)) { return 0; } if(response) { PlayerInfo[playerid][pMenuType] = listitem; ShowDialogToPlayer(playerid, DIALOG_LANDBUILD1); } else { ShowDialogToPlayer(playerid, DIALOG_LANDMENU); } } case DIALOG_LANDBUILD1: { new landid = GetNearbyLand(playerid); if(landid == -1 || !HasLandPerms(playerid, landid)) { return 0; } if(response) { switch(PlayerInfo[playerid][pMenuType]) { case 0: // Model selection { PlayerInfo[playerid][pCategory] = listitem; ShowObjectSelectionMenu(playerid, MODEL_SELECTION_LANDOBJECTS); } case 1: { PlayerInfo[playerid][pCategory] = listitem; ShowDialogToPlayer(playerid, DIALOG_LANDBUILD2); } } } else { ShowDialogToPlayer(playerid, DIALOG_LANDBUILDTYPE); } } case DIALOG_LANDBUILD2: { new landid = GetNearbyLand(playerid); if(landid == -1 || !HasLandPerms(playerid, landid)) { return 0; } if(response) { PurchaseLandObject(playerid, landid, listitem + PlayerInfo[playerid][pFurnitureIndex]); } else { ShowDialogToPlayer(playerid, DIALOG_LANDBUILD1); } } case DIALOG_LANDMENU: { new landid = GetNearbyLand(playerid); if(landid == -1 || !HasLandPerms(playerid, landid)) { return 1; } if(response) { switch(listitem) { case 0: { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM landobjects WHERE landid = %i", LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_COUNT_LANDOBJECTS, playerid); } case 1: { ShowPlayerDialog(playerid, DIALOG_LANDEDITOBJECT, DIALOG_STYLE_INPUT, "Edit object", "Please enter the object ID of the object to edit:\nYou can find out the ID of objects by toggling labels in the menu.", "Submit", "Back"); } case 2: { if(!LandInfo[landid][lLabels]) { LandInfo[landid][lLabels] = 1; SendClientMessage(playerid, COLOR_AQUA, "You will now see labels appear above the objects in your land."); } else { LandInfo[landid][lLabels] = 0; SendClientMessage(playerid, COLOR_AQUA, "You will no longer see any labels appear above your land objects."); } ReloadAllLandObjects(landid); ShowDialogToPlayer(playerid, DIALOG_LANDMENU); } case 3: { PlayerInfo[playerid][pPage] = 1; ShowDialogToPlayer(playerid, DIALOG_LANDOBJECTS); } case 4: { ShowPlayerDialog(playerid, DIALOG_LANDSELLALL, DIALOG_STYLE_MSGBOX, "Clear objects", "This option sells all the objects in your land. You will receive\n75 percent of the total cost of all your objects.\n\nPress {FF6347}Confirm{A9C4E4} to proceed with the operation.", "Confirm", "Back"); } case 5: { if(LandInfo[landid][lLevel] >= 3) { return SendClientMessage(playerid, COLOR_GREY, "Your land can't be upgraded any further."); } new string[224]; format(string, sizeof(string), "You are about to upgrade your land to level %i/5.\n\nThis upgrade will cost you {00AA00}$100,000{A9C4E4} and unlocks %i more\nobject slots for your land.\n\nAre you sure you want to upgrade your land?", LandInfo[landid][lLevel] + 1, GetLandObjectCapacity(LandInfo[landid][lLevel] + 1) - GetLandObjectCapacity(LandInfo[landid][lLevel])); ShowPlayerDialog(playerid, DIALOG_LANDUPGRADE, DIALOG_STYLE_MSGBOX, "Upgrade land", string, "Yes", "No"); } case 6: { ShowPlayerDialog(playerid, DIALOG_LANDPERMS, DIALOG_STYLE_INPUT, "Permissions", "Please enter the name or ID of the player to take or give permissions to:", "Submit", "Back"); } } } } case DIALOG_LANDUPGRADE: { new landid = GetNearbyLand(playerid); if(landid == -1 || !HasLandPerms(playerid, landid)) { return 1; } if(response) { if(LandInfo[landid][lLevel] < 5) { if(PlayerInfo[playerid][pCash] < 100000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to upgrade your land."); } LandInfo[landid][lLevel]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE lands SET level = level + 1 WHERE id = %i", LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -100000); GameTextForPlayer(playerid, "~r~-$100000", 5000, 1); SendClientMessageEx(playerid, COLOR_GREEN, "You paid $100,000 to upgrade your land to level %i/5. Your land can now have up to %i objects.", LandInfo[landid][lLevel], GetLandObjectCapacity(LandInfo[landid][lLevel])); } } else { ShowDialogToPlayer(playerid, DIALOG_LANDMENU); } } case DIALOG_LANDEDITOBJECT: { new landid = GetNearbyLand(playerid); if(landid == -1 || !HasLandPerms(playerid, landid)) { return 1; } if(response) { new objectid; if(sscanf(inputtext, "i", objectid)) { return ShowPlayerDialog(playerid, DIALOG_LANDEDITOBJECT, DIALOG_STYLE_INPUT, "Edit object", "Please enter the object ID of the object to edit:\nYou can find out the ID of objects by toggling labels in the menu.", "Submit", "Back"); } if(!IsValidDynamicObject(objectid) || Streamer_GetExtraInt(objectid, E_OBJECT_TYPE) != E_OBJECT_LAND) { SendClientMessage(playerid, COLOR_GREY, "Invalid object. You can find out an object's ID by enabling labels."); return ShowPlayerDialog(playerid, DIALOG_LANDEDITOBJECT, DIALOG_STYLE_INPUT, "Edit object", "Please enter the object ID of the object to edit:\nYou can find out the ID of objects by toggling labels in the menu.", "Submit", "Back"); } if(Streamer_GetExtraInt(objectid, E_OBJECT_EXTRA_ID) != LandInfo[landid][lID]) { SendClientMessage(playerid, COLOR_GREY, "Invalid object. This land object is not apart of your land."); return ShowPlayerDialog(playerid, DIALOG_LANDEDITOBJECT, DIALOG_STYLE_INPUT, "Edit object", "Please enter the object ID of the object to edit:\nYou can find out the ID of objects by toggling labels in the menu.", "Submit", "Back"); } PlayerInfo[playerid][pSelected] = objectid; ShowDialogToPlayer(playerid, DIALOG_LANDOBJECTMENU); } else { ShowDialogToPlayer(playerid, DIALOG_LANDMENU); } } case DIALOG_LANDOBJECTMENU: { new landid = GetNearbyLand(playerid); if(landid == -1 || !HasLandPerms(playerid, landid)) { return 1; } if(response) { new objectid = PlayerInfo[playerid][pSelected]; if(!strcmp(inputtext, "Edit object")) { if(Streamer_GetExtraInt(objectid, E_OBJECT_OPENED)) { return SendClientMessage(playerid, COLOR_GREY, "You can't edit your gate while it is opened."); } PlayerInfo[playerid][pEditType] = EDIT_LAND_OBJECT; PlayerInfo[playerid][pEditObject] = objectid; PlayerInfo[playerid][pObjectLand] = landid; EditDynamicObject(playerid, objectid); GameTextForPlayer(playerid, "~w~Editing Mode~n~~g~Click disk to save~n~~r~Press ESC to cancel", 5000, 1); } else if(!strcmp(inputtext, "Edit gate destination")) { if(Streamer_GetExtraInt(objectid, E_OBJECT_OPENED)) { return SendClientMessage(playerid, COLOR_GREY, "You can't edit your gate while it is opened."); } PlayerInfo[playerid][pEditType] = EDIT_LAND_GATE_MOVE; PlayerInfo[playerid][pEditObject] = objectid; PlayerInfo[playerid][pObjectLand] = landid; EditDynamicObject(playerid, objectid); SendClientMessage(playerid, COLOR_WHITE, "You are now editing the move-to position for your gate."); GameTextForPlayer(playerid, "~w~Editing Mode~n~~g~Click disk to save~n~~r~Press ESC to cancel", 5000, 1); } else if(!strcmp(inputtext, "Duplicate object")) { PlayerInfo[playerid][pSelected] = objectid; PlayerInfo[playerid][pObjectLand] = landid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM landobjects WHERE landid = %i", LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_DUPLICATE_LANDOBJ, playerid); } else if(!strcmp(inputtext, "Sell object")) { PlayerInfo[playerid][pSelected] = objectid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT name, price FROM landobjects WHERE id = %i", Streamer_GetExtraInt(objectid, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_SELL_LANDOBJECT, playerid); } } else { ShowDialogToPlayer(playerid, DIALOG_LANDMENU); //ShowPlayerDialog(playerid, DIALOG_LANDEDITOBJECT, DIALOG_STYLE_INPUT, "Edit object", "Please enter the object ID of the object to edit:\nYou can find out the ID of objects by toggling labels in the menu.", "Submit", "Back"); } } case DIALOG_LANDOBJECTS: { if(response) { if(!strcmp(inputtext, ">> Next page", true)) { PlayerInfo[playerid][pPage]++; ShowDialogToPlayer(playerid, DIALOG_LANDOBJECTS); } else if(!strcmp(inputtext, "<< Go back", true) && PlayerInfo[playerid][pPage] > 1) { PlayerInfo[playerid][pPage]--; ShowDialogToPlayer(playerid, DIALOG_LANDOBJECTS); } else { new objectid = strval(inputtext); if(IsValidDynamicObject(objectid) && Streamer_GetExtraInt(objectid, E_OBJECT_TYPE) == E_OBJECT_LAND) { PlayerInfo[playerid][pSelected] = objectid; ShowDialogToPlayer(playerid, DIALOG_LANDOBJECTMENU); } } } else { ShowDialogToPlayer(playerid, DIALOG_LANDMENU); } } case DIALOG_LANDSELLALL: { new landid = GetNearbyLand(playerid); if(landid == -1 || !HasLandPerms(playerid, landid)) { return 1; } if(response) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT price FROM landobjects WHERE landid = %i", LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_CLEAR_LANDOBJECTS, playerid); } else { ShowDialogToPlayer(playerid, DIALOG_LANDMENU); } } /*case DIALOG_LANDPERMS: { new landid = GetNearbyLand(playerid), targetid; if(landid == -1 || !HasLandPerms(playerid, landid)) { return 1; } if(response) { if(sscanf(inputtext, "u", targetid)) { return ShowPlayerDialog(playerid, DIALOG_LANDPERMS, DIALOG_STYLE_INPUT, "Permissions", "Please enter the name or ID of the player to take or give permissions to:", "Submit", "Back"); } if(!IsPlayerConnected(targetid)) { SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); return ShowPlayerDialog(playerid, DIALOG_LANDPERMS, DIALOG_STYLE_INPUT, "Permissions", "Please enter the name or ID of the player to take or give permissions to:", "Submit", "Back"); } if(targetid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You can't give permissions to yourself."); return ShowPlayerDialog(playerid, DIALOG_LANDPERMS, DIALOG_STYLE_INPUT, "Permissions", "Please enter the name or ID of the player to take or give permissions to:", "Submit", "Back"); } if(PlayerInfo[targetid][pLandPerms] == landid) { PlayerInfo[targetid][pLandPerms] = -1; SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your access to their land's objects.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's access to your land's objects.", GetPlayerRPName(targetid)); } else { PlayerInfo[targetid][pLandPerms] = landid; SendClientMessageEx(targetid, COLOR_AQUA, "%s has granted you access to their land's objects.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have granted %s access to your land's objects.", GetPlayerRPName(targetid)); } } ShowDialogToPlayer(playerid, DIALOG_LANDMENU); }*/ case DIALOG_LANDPERMS: { new landid = GetNearbyLand(playerid), targetid; if(landid == -1 || !IsLandOwner(playerid, landid)) { return 1; } if(response) { if(sscanf(inputtext, "u", targetid)) { return ShowPlayerDialog(playerid, DIALOG_LANDPERMS, DIALOG_STYLE_INPUT, "Permissions", "Please enter the name or ID of the player to take or give permissions to:", "Submit", "Back"); } if(!IsPlayerConnected(targetid)) { SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); return ShowPlayerDialog(playerid, DIALOG_LANDPERMS, DIALOG_STYLE_INPUT, "Permissions", "Please enter the name or ID of the player to take or give permissions to:", "Submit", "Back"); } if(targetid == playerid) { SendClientMessage(playerid, COLOR_GREY, "You can't give permissions to yourself."); return ShowPlayerDialog(playerid, DIALOG_LANDPERMS, DIALOG_STYLE_INPUT, "Permissions", "Please enter the name or ID of the player to take or give permissions to:", "Submit", "Back"); } if(PlayerInfo[targetid][pLandPerms] == landid) { PlayerInfo[targetid][pLandPerms] = -1; SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your access to their land's objects.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's access to your land's objects.", GetPlayerRPName(targetid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET landkeys = %i WHERE uid = %i", LandInfo[landid][lID], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(PlayerInfo[targetid][pLandPerms] == -1) { PlayerInfo[targetid][pLandPerms] = landid; SendClientMessageEx(targetid, COLOR_AQUA, "%s has granted you access to their land's objects.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have granted %s access to your land's objects.", GetPlayerRPName(targetid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET landkeys = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else { SendClientMessage(playerid, COLOR_AQUA, "That player already has access to someone's land. (/droplandkeys)"); } } ShowDialogToPlayer(playerid, DIALOG_LANDMENU); } case DIALOG_MP3PLAYER: { if(response) { switch(listitem) { case 0: { ShowPlayerDialog(playerid, DIALOG_MP3URL, DIALOG_STYLE_INPUT, "Custom URL", "Please enter the URL of the stream you want to play:", "Submit", "Back"); } case 1: { ShowPlayerDialog(playerid, DIALOG_MP3MUSIC, DIALOG_STYLE_INPUT, "Uploaded Music", "Please enter the name of the .mp3 file to play:\n(Use /music for a list of all music uploaded to the server.)", "Submit", "Back"); } case 2: { if(!radioConnectionID) { return SendClientMessage(playerid, COLOR_GREY, "The radio station database is currently unavailable."); } ShowDialogToPlayer(playerid, DIALOG_MP3RADIO); } case 3: { switch(PlayerInfo[playerid][pMusicType]) { case MUSIC_MP3PLAYER: { SetMusicStream(MUSIC_MP3PLAYER, playerid, ""); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s turns off their MP3 player.", GetPlayerRPName(playerid)); } case MUSIC_BOOMBOX: { SetMusicStream(MUSIC_BOOMBOX, playerid, ""); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s turns off their boombox.", GetPlayerRPName(playerid)); } case MUSIC_VEHICLE: { if(IsPlayerInAnyVehicle(playerid)) { SetMusicStream(MUSIC_VEHICLE, GetPlayerVehicleID(playerid), ""); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s turns off the radio in the vehicle.", GetPlayerRPName(playerid)); } } } } case 4: { if(PlayerInfo[playerid][pVIPPackage] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You must be a VIP to use this option"); } ShowPlayerDialog(playerid, DIALOG_VIPMUSIC, DIALOG_STYLE_INPUT, "VIP Uploaded Music", "Please enter the name of the .mp3 file to play:", "Submit", "Back"); } } } } case DIALOG_MP3MUSIC: { if(response) { new url[128]; if(isnull(inputtext) || strfind(inputtext, ".mp3", true) == -1) { return ShowPlayerDialog(playerid, DIALOG_MP3MUSIC, DIALOG_STYLE_INPUT, "Uploaded Music", "Please enter the name of the .mp3 file to play:\n(Use /music for a list of all music uploaded to the server.)", "Submit", "Back"); } for(new i = 0, l = strlen(inputtext); i < l; i ++) { switch(inputtext[i]) { case 'A'..'Z', 'a'..'z', '0'..'9', '_', '.', '\'', ' ': { continue; } default: { SendClientMessage(playerid, COLOR_GREY, "The name of the .mp3 contains invalid characters, please try again."); return ShowPlayerDialog(playerid, DIALOG_MP3MUSIC, DIALOG_STYLE_INPUT, "Uploaded Music", "Please enter the name of the .mp3 file to play:\n(Use /music for a list of all music uploaded to the server.)", "Submit", "Back"); } } } format(url, sizeof(url), "http://%s/%s", SERVER_MUSIC_URL, inputtext); switch(PlayerInfo[playerid][pMusicType]) { case MUSIC_MP3PLAYER: { SetMusicStream(MUSIC_MP3PLAYER, playerid, url); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the song on their MP3 player.", GetPlayerRPName(playerid)); } case MUSIC_BOOMBOX: { SetMusicStream(MUSIC_BOOMBOX, playerid, url); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the song on their boombox.", GetPlayerRPName(playerid)); } case MUSIC_VEHICLE: { if(IsPlayerInAnyVehicle(playerid)) { SetMusicStream(MUSIC_VEHICLE, GetPlayerVehicleID(playerid), url); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the song on the radio.", GetPlayerRPName(playerid)); } } } SendClientMessageEx(playerid, COLOR_AQUA, "You have started the playback of {00AA00}%s{33CCFF}.", inputtext); } else { ShowDialogToPlayer(playerid, DIALOG_MP3PLAYER); } } case DIALOG_VIPMUSIC: { if(response) { new url[128]; if(isnull(inputtext)) { return ShowPlayerDialog(playerid, DIALOG_VIPMUSIC, DIALOG_STYLE_INPUT, "VIP Uploaded Music", "Please enter the name of the .mp3 file to play:", "Submit", "Back"); } for(new i = 0, l = strlen(inputtext); i < l; i ++) { switch(inputtext[i]) { case 'A'..'Z', 'a'..'z', '0'..'9', '_', '.', '\'', ' ': { continue; } default: { SendClientMessage(playerid, COLOR_GREY, "The name of the .mp3 contains invalid characters, please try again."); return ShowPlayerDialog(playerid, DIALOG_VIPMUSIC, DIALOG_STYLE_INPUT, "VIP Uploaded Music", "Please enter the name of the .mp3 file to play:", "Submit", "Back"); } } } format(url, sizeof(url), "http://%s/%d/%s", VIP_MUSIC_URL, PlayerInfo[playerid][pID], inputtext); switch(PlayerInfo[playerid][pMusicType]) { case MUSIC_MP3PLAYER: { SetMusicStream(MUSIC_MP3PLAYER, playerid, url); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the song on their MP3 player.", GetPlayerRPName(playerid)); } case MUSIC_BOOMBOX: { SetMusicStream(MUSIC_BOOMBOX, playerid, url); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the song on their boombox.", GetPlayerRPName(playerid)); } case MUSIC_VEHICLE: { if(IsPlayerInAnyVehicle(playerid)) { SetMusicStream(MUSIC_VEHICLE, GetPlayerVehicleID(playerid), url); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the song on the radio.", GetPlayerRPName(playerid)); } } } SendClientMessageEx(playerid, COLOR_AQUA, "You have started the playback of {00AA00}%s{33CCFF}.", inputtext); } else { ShowDialogToPlayer(playerid, DIALOG_MP3PLAYER); } } case DIALOG_MP3URL: { if(response) { if(isnull(inputtext)) { return ShowPlayerDialog(playerid, DIALOG_MP3URL, DIALOG_STYLE_INPUT, "Custom URL", "Please enter the URL of the stream you want to play:", "Submit", "Back"); } if(!IsValidYoutubeUrl(inputtext) && strfind(inputtext, ".mp3", true) == -1) { return ShowPlayerDialog(playerid, DIALOG_MP3URL, DIALOG_STYLE_INPUT, "Custom URL", ".MP3 or Youtube Links only! Please enter another URL", "Submit", "Back"); } switch(PlayerInfo[playerid][pMusicType]) { case MUSIC_MP3PLAYER: { SetMusicStream(MUSIC_MP3PLAYER, playerid, inputtext); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the song on their MP3 player.", GetPlayerRPName(playerid)); } case MUSIC_BOOMBOX: { SetMusicStream(MUSIC_BOOMBOX, playerid, inputtext); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the song on their boombox.", GetPlayerRPName(playerid)); } case MUSIC_VEHICLE: { if(IsPlayerInAnyVehicle(playerid)) { SetMusicStream(MUSIC_VEHICLE, GetPlayerVehicleID(playerid), inputtext); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes the song on the radio.", GetPlayerRPName(playerid)); } } } } else { ShowDialogToPlayer(playerid, DIALOG_MP3PLAYER); } } case DIALOG_MP3RADIO: { if(response) { switch(listitem) { case 0: { ShowDialogToPlayer(playerid, DIALOG_MP3RADIOGENRES); } case 1: { ShowDialogToPlayer(playerid, DIALOG_MP3RADIOSEARCH); } /*case 2: { ShowDialogToPlayer(playerid, DIALOG_MP3APISEARCH); }*/ } } else { ShowDialogToPlayer(playerid, DIALOG_MP3PLAYER); } } case DIALOG_MP3RADIOGENRES: { if(response) { strcpy(PlayerInfo[playerid][pGenre], inputtext, 32); ShowDialogToPlayer(playerid, DIALOG_MP3RADIOSUBGENRES); } else { ShowDialogToPlayer(playerid, DIALOG_MP3RADIO); } } case DIALOG_MP3RADIOSUBGENRES: { if(response) { PlayerInfo[playerid][pPage] = 1; PlayerInfo[playerid][pSearch] = 0; strcpy(PlayerInfo[playerid][pSubgenre], inputtext, 32); if(!PlayerInfo[playerid][pStationEdit]) { ShowDialogToPlayer(playerid, DIALOG_MP3RADIORESULTS); } else { ShowDialogToPlayer(playerid, DIALOG_ADDSTATION); } } else { ShowDialogToPlayer(playerid, DIALOG_MP3RADIOGENRES); } } case DIALOG_MP3RADIORESULTS: { if(response) { if(!strcmp(inputtext, ">> Next page", true)) { PlayerInfo[playerid][pPage]++; ShowDialogToPlayer(playerid, DIALOG_MP3RADIORESULTS); } else if(!strcmp(inputtext, "<< Go back", true) && PlayerInfo[playerid][pPage] > 1) { PlayerInfo[playerid][pPage]--; ShowDialogToPlayer(playerid, DIALOG_MP3RADIORESULTS); } else { listitem = ((PlayerInfo[playerid][pPage] - 1) * MAX_LISTED_STATIONS) + listitem; if(PlayerInfo[playerid][pSearch]) { mysql_format(radioConnectionID, queryBuffer, sizeof(queryBuffer), "SELECT name, url FROM radiostations WHERE name LIKE '%%%e%%' OR subgenre LIKE '%%%e%%' ORDER BY name LIMIT %i, 1", PlayerInfo[playerid][pGenre], PlayerInfo[playerid][pGenre], listitem); mysql_tquery(radioConnectionID, queryBuffer, "Radio_PlayStation", "i", playerid); } else { mysql_format(radioConnectionID, queryBuffer, sizeof(queryBuffer), "SELECT name, url FROM radiostations WHERE genre = '%e' AND subgenre = '%e' ORDER BY name LIMIT %i, 1", PlayerInfo[playerid][pGenre], PlayerInfo[playerid][pSubgenre], listitem); mysql_tquery(radioConnectionID, queryBuffer, "Radio_PlayStation", "i", playerid); } } } else { if(PlayerInfo[playerid][pSearch]) { ShowDialogToPlayer(playerid, DIALOG_MP3RADIOSEARCH); } else { ShowDialogToPlayer(playerid, DIALOG_MP3RADIOSUBGENRES); } } } case DIALOG_MP3RADIOSEARCH: { if(response) { if(strlen(inputtext) < 3) { SendClientMessage(playerid, COLOR_GREY, "Your search query must contain 3 characters or more."); return ShowDialogToPlayer(playerid, DIALOG_MP3RADIOSEARCH); } PlayerInfo[playerid][pPage] = 1; PlayerInfo[playerid][pSearch] = 1; strcpy(PlayerInfo[playerid][pGenre], inputtext, 32); ShowDialogToPlayer(playerid, DIALOG_MP3RADIORESULTS); } else { ShowDialogToPlayer(playerid, DIALOG_MP3RADIO); } } case DIALOG_USECOOKIES: { if(response) { /* mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, '%s', NOW(), '%e')", PlayerInfo[targetid][pID], GetPlayerNameEx(playerid), desc); mysql_tquery(connectionID, queryBuffer); */ if(PlayerInfo[playerid][pJailType] > 0 && listitem != 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't redeem your cookies while in prison or jail."); } switch(listitem) { case 0: { if(PlayerInfo[playerid][pCookies] < 10) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough cookies. You can't redeem this item."); } ShowPlayerDialog(playerid, DIALOG_COOKIENUMBER, DIALOG_STYLE_INPUT, "Number change", "Enter your phone number of choice:", "Submit", "Cancel"); } case 1: { if(PlayerInfo[playerid][pCookies] < 10) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough cookies. You can't redeem this item."); } ShowPlayerDialog(playerid, DIALOG_COOKIEJOB, DIALOG_STYLE_LIST, "Choose a job to 1x level up.", "Courier\nFisherman\nBodyguard\nMechanic\nWeapons Dealer\nDrug Dealer\nLawyer\nDetective\nThief", "Select", "Cancel"); } case 2: { if(PlayerInfo[playerid][pCookies] < 20) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough cookies. You can't redeem this item."); } PlayerInfo[playerid][pCookies] -= 20; PlayerInfo[playerid][pDoubleXP] += 8; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, doublexp = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pDoubleXP], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_AQUA, "You have redeemed 20 cookies for {00AA00}8 hours of Double XP{33CCFF}."); } case 3: { if(PlayerInfo[playerid][pCookies] < 30) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough cookies. You can't redeem this item."); } PlayerInfo[playerid][pCookies] -= 30; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, 'cookie prize', NOW(), 'Free vehicle (up to $200k value)')", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_AQUA, "You have redeemed 30 cookies for a {00AA00}Free vehicle ticket{33CCFF}. /report for your prize."); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has a pending flag for a vehicle ticket (up to $200k value).", GetPlayerRPName(playerid), playerid); } case 4: { if(PlayerInfo[playerid][pCookies] < 60) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough cookies. You can't redeem this item."); } PlayerInfo[playerid][pCookies] -= 60; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, 'cookie prize', NOW(), 'Free house (up to $250k value)')", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_AQUA, "You have redeemed 60 cookies for a {00AA00}Free house ticket{33CCFF}. /report for your prize."); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has a pending flag for a house ticket (up to $250k value).", GetPlayerRPName(playerid), playerid); } case 5: { if(PlayerInfo[playerid][pCookies] < 100) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough cookies. You can't redeem this item."); } PlayerInfo[playerid][pCookies] -= 100; PlayerInfo[playerid][pVIPPackage] = 1; PlayerInfo[playerid][pVIPTime] = gettime() + 2592000; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, vippackage = 1, viptime = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pVIPTime], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_AQUA, "You have redeemed 100 cookies for {00AA00}1 month limited VIP{33CCFF}."); } case 6: { if(PlayerInfo[playerid][pCookies] < 200) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough cookies. You can't redeem this item."); } PlayerInfo[playerid][pCookies] -= 200; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, 'cookie prize', NOW(), 'Free business of any type')", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_AQUA, "You have redeemed 200 cookies for a {00AA00}Free business ticket{33CCFF}. /report for your prize."); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has a pending flag for a business ticket (any type).", GetPlayerRPName(playerid), playerid); } } } } case DIALOG_COOKIENUMBER: { if(response) { new number; if(sscanf(inputtext, "i", number)) { return ShowPlayerDialog(playerid, DIALOG_COOKIENUMBER, DIALOG_STYLE_INPUT, "Number change", "Enter your phone number of choice:", "Submit", "Cancel"); } if(number == 0 || number == 911) { SendClientMessage(playerid, COLOR_GREY, "Invalid number."); return ShowPlayerDialog(playerid, DIALOG_COOKIENUMBER, DIALOG_STYLE_INPUT, "Number change", "Enter your phone number of choice:", "Submit", "Cancel"); } if(PlayerInfo[playerid][pCookies] < 10) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough cookies. You can't redeem this item."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT phone FROM users WHERE phone = %i", number); mysql_tquery(connectionID, queryBuffer, "OnPlayerChangeNumber", "ii", playerid, number); } } case DIALOG_COOKIEJOB: { new job, level; if(response) { switch(listitem) { case 0: job = JOB_COURIER; case 1: job = JOB_FISHERMAN; case 2: job = JOB_BODYGUARD; case 3: job = JOB_MECHANIC; case 4: job = JOB_WEAPONDEALER; case 5: job = JOB_DRUGDEALER; case 6: job = JOB_LAWYER; case 7: job = JOB_DETECTIVE; case 8: job = JOB_THIEF; } if((level = GetJobLevel(playerid, job)) >= 5) { return SendClientMessage(playerid, COLOR_GREY, "Your level for this job is already at its maximum."); } if(PlayerInfo[playerid][pCookies] < 10) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough cookies. You can't redeem this item."); } PlayerInfo[playerid][pCookies] -= 10; switch(job) { case JOB_COURIER: { if(0 <= PlayerInfo[playerid][pCourierSkill] <= 49) { PlayerInfo[playerid][pCourierSkill] = 50; } else if(50 <= PlayerInfo[playerid][pCourierSkill] <= 99) { PlayerInfo[playerid][pCourierSkill] = 100; } else if(100 <= PlayerInfo[playerid][pCourierSkill] <= 199) { PlayerInfo[playerid][pCourierSkill] = 200; } else if(200 <= PlayerInfo[playerid][pCourierSkill] <= 349) { PlayerInfo[playerid][pCourierSkill] = 350; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, courierskill = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pCourierSkill], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } case JOB_FISHERMAN: { if(0 <= PlayerInfo[playerid][pFishingSkill] <= 49) { PlayerInfo[playerid][pFishingSkill] = 50; } else if(50 <= PlayerInfo[playerid][pFishingSkill] <= 99) { PlayerInfo[playerid][pFishingSkill] = 100; } else if(100 <= PlayerInfo[playerid][pFishingSkill] <= 199) { PlayerInfo[playerid][pFishingSkill] = 200; } else if(200 <= PlayerInfo[playerid][pFishingSkill] <= 349) { PlayerInfo[playerid][pFishingSkill] = 350; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, fishingskill = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pFishingSkill], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } case JOB_BODYGUARD: { if(0 <= PlayerInfo[playerid][pGuardSkill] <= 24) { PlayerInfo[playerid][pGuardSkill] = 25; } else if(25 <= PlayerInfo[playerid][pGuardSkill] <= 49) { PlayerInfo[playerid][pGuardSkill] = 50; } else if(50 <= PlayerInfo[playerid][pGuardSkill] <= 99) { PlayerInfo[playerid][pGuardSkill] = 100; } else if(100 <= PlayerInfo[playerid][pGuardSkill] <= 199) { PlayerInfo[playerid][pGuardSkill] = 200; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, guardskill = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pGuardSkill], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } case JOB_MECHANIC: { if(0 <= PlayerInfo[playerid][pMechanicSkill] <= 24) { PlayerInfo[playerid][pMechanicSkill] = 25; } else if(25 <= PlayerInfo[playerid][pMechanicSkill] <= 49) { PlayerInfo[playerid][pMechanicSkill] = 50; } else if(50 <= PlayerInfo[playerid][pMechanicSkill] <= 99) { PlayerInfo[playerid][pMechanicSkill] = 100; } else if(100 <= PlayerInfo[playerid][pMechanicSkill] <= 199) { PlayerInfo[playerid][pMechanicSkill] = 200; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, mechanicskill = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pMechanicSkill], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } case JOB_WEAPONDEALER: { if(0 <= PlayerInfo[playerid][pWeaponSkill] <= 49) { PlayerInfo[playerid][pWeaponSkill] = 50; } else if(50 <= PlayerInfo[playerid][pWeaponSkill] <= 99) { PlayerInfo[playerid][pWeaponSkill] = 100; } else if(100 <= PlayerInfo[playerid][pWeaponSkill] <= 199) { PlayerInfo[playerid][pWeaponSkill] = 200; } else if(200 <= PlayerInfo[playerid][pWeaponSkill] <= 499) { PlayerInfo[playerid][pWeaponSkill] = 500; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, weaponskill = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pWeaponSkill], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } case JOB_DRUGDEALER: { if(0 <= PlayerInfo[playerid][pSmugglerSkill] <= 24) { PlayerInfo[playerid][pSmugglerSkill] = 25; } else if(25 <= PlayerInfo[playerid][pSmugglerSkill] <= 49) { PlayerInfo[playerid][pSmugglerSkill] = 50; } else if(50 <= PlayerInfo[playerid][pSmugglerSkill] <= 74) { PlayerInfo[playerid][pSmugglerSkill] = 75; } else if(75 <= PlayerInfo[playerid][pSmugglerSkill] <= 99) { PlayerInfo[playerid][pSmugglerSkill] = 100; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, smugglerskill = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pSmugglerSkill], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } case JOB_LAWYER: { if(0 <= PlayerInfo[playerid][pLawyerSkill] <= 24) { PlayerInfo[playerid][pLawyerSkill] = 25; } else if(25 <= PlayerInfo[playerid][pLawyerSkill] <= 49) { PlayerInfo[playerid][pLawyerSkill] = 50; } else if(50 <= PlayerInfo[playerid][pLawyerSkill] <= 99) { PlayerInfo[playerid][pLawyerSkill] = 100; } else if(75 <= PlayerInfo[playerid][pLawyerSkill] <= 199) { PlayerInfo[playerid][pLawyerSkill] = 200; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, lawyerskill = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pLawyerSkill], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } case JOB_DETECTIVE: { if(0 <= PlayerInfo[playerid][pDetectiveSkill] <= 49) { PlayerInfo[playerid][pDetectiveSkill] = 50; } else if(50 <= PlayerInfo[playerid][pDetectiveSkill] <= 99) { PlayerInfo[playerid][pDetectiveSkill] = 100; } else if(100 <= PlayerInfo[playerid][pDetectiveSkill] <= 199) { PlayerInfo[playerid][pDetectiveSkill] = 200; } else if(200 <= PlayerInfo[playerid][pDetectiveSkill] <= 399) { PlayerInfo[playerid][pDetectiveSkill] = 400; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, detectiveskill = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pDetectiveSkill], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } case JOB_THIEF: { if(0 <= PlayerInfo[playerid][pThiefSkill] <= 49) { PlayerInfo[playerid][pThiefSkill] = 50; } else if(50 <= PlayerInfo[playerid][pThiefSkill] <= 99) { PlayerInfo[playerid][pThiefSkill] = 100; } else if(100 <= PlayerInfo[playerid][pThiefSkill] <= 199) { PlayerInfo[playerid][pThiefSkill] = 200; } else if(200 <= PlayerInfo[playerid][pThiefSkill] <= 499) { PlayerInfo[playerid][pThiefSkill] = 500; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i, thiefskill = %i WHERE uid = %i", PlayerInfo[playerid][pCookies], PlayerInfo[playerid][pThiefSkill], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } } SendClientMessageEx(playerid, COLOR_AQUA, "You have redeemed 10 cookies to advance your {00AA00}%s{33CCFF} level from %i to %i.", GetJobName(job), level, level + 1); } } case DIALOG_GANGSTASH: { if(PlayerInfo[playerid][pGang] == -1) { return 1; } if(response) { switch(listitem) { case 0: { ShowDialogToPlayer(playerid, DIALOG_GANGSTASHWEAPONS1); } case 1: { ShowDialogToPlayer(playerid, DIALOG_GANGSTASHVEST); } case 2: { ShowDialogToPlayer(playerid, DIALOG_GANGSTASHDRUGS1); } case 3: { if(!GetGangSkinCount(PlayerInfo[playerid][pGang])) { return SendClientMessage(playerid, COLOR_GREY, "There are no skins setup for your gang."); } PlayerInfo[playerid][pSkinSelected] = -1; ShowPlayerDialog(playerid, DIALOG_GANGSKINS, DIALOG_STYLE_MSGBOX, "Skin selection", "Press {00AA00}>> Next{A9C4E4} to browse through available gang skins.", ">> Next", "Confirm"); } case 4: { if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You must be at least rank 5+ to craft weapons."); } ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } case 5: { PlayerInfo[playerid][pSelected] = ITEM_MATERIALS; ShowDialogToPlayer(playerid, DIALOG_GANGSTASHMATS); } case 6: { PlayerInfo[playerid][pSelected] = ITEM_CASH; ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCASH); } } } } case DIALOG_GANGSTASHVEST: { if(PlayerInfo[playerid][pGang] == -1) { return 1; } if(response) { switch(listitem) { case 0: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gVestRank]) { return SendClientMessageEx(playerid, COLOR_GREY, "You must be at least rank %i+ to craft kevlar vests.", GangInfo[PlayerInfo[playerid][pGang]][gVestRank]); } if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 200) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe for kevlar vests."); } if(GetPlayerArmourEx(playerid) >= 100) { return SendClientMessage(playerid, COLOR_GREY, "You have a full vest already."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 200; SetScriptArmour(playerid, 100.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes a kevlar vest from the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You crafted a kevlar vest using 200 materials from the safe."); } case 1: { if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 6+ to change the vest rank."); } ShowPlayerDialog(playerid, DIALOG_GANGSTASHVESTRANK, DIALOG_STYLE_LIST, "Choose a rank to restrict vests to:", "R0+\nR1+\nR2+\nR3+\nR4+\nR5+\nR6", "Select", "Back"); } } } else { ShowDialogToPlayer(playerid, DIALOG_GANGSTASH); } } case DIALOG_GANGSTASHVESTRANK: { if(PlayerInfo[playerid][pGang] == -1) { return 1; } if(response) { GangInfo[PlayerInfo[playerid][pGang]][gVestRank] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}Kevlar vests{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_vest = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } ShowDialogToPlayer(playerid, DIALOG_GANGSTASHVEST); } case DIALOG_GANGSTASHWEAPONS1: { if(PlayerInfo[playerid][pGang] == -1) { return 1; } if(response) { PlayerInfo[playerid][pSelected] = listitem; ShowPlayerDialog(playerid, DIALOG_GANGSTASHWEAPONS2, DIALOG_STYLE_LIST, "Gang stash | Weapons", "Withdraw\nDeposit\nChange Rank", "Select", "Back"); } else { ShowDialogToPlayer(playerid, DIALOG_GANGSTASH); } } case DIALOG_GANGSTASHWEAPONS2: { if(PlayerInfo[playerid][pGang] == -1) { return 1; } if(response) { if(listitem == 0) { if(PlayerInfo[playerid][pGangRank] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You must be at least rank 1+ in order to withdraw weapons."); } if(PlayerInfo[playerid][pHours] < 2 || PlayerInfo[playerid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are either weapon restricted or you played less than two playing hours."); } switch(PlayerInfo[playerid][pSelected]) { case GANGWEAPON_9MM: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_9MM]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_9MM] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 22)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_9MM]--; GivePlayerWeaponEx(playerid, 22); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_9mm = weapon_9mm - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws a 9mm from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws a 9mm from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_SDPISTOL: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SDPISTOL]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SDPISTOL] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 23)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SDPISTOL]--; GivePlayerWeaponEx(playerid, 23); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_sdpistol = weapon_sdpistol - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws a silenced pistol from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws a silenced pistol from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_DEAGLE: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_DEAGLE]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_DEAGLE] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 24)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_DEAGLE]--; GivePlayerWeaponEx(playerid, 24); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_deagle = weapon_deagle - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws a Desert Eagle from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws a Desert Eagle from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_SHOTGUN: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SHOTGUN]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SHOTGUN] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 25)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SHOTGUN]--; GivePlayerWeaponEx(playerid, 25); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_shotgun = weapon_shotgun - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws a shotgun from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws a shotgun from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_SAWNOFF: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SAWNOFF]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SAWNOFF] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 26)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SAWNOFF]--; GivePlayerWeaponEx(playerid, 26); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_sawnoff = weapon_sawnoff - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws a sawnoff shotgun from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws a sawnoff shotgun from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_TEC9: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_TEC9]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_TEC9] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 32)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_TEC9]--; GivePlayerWeaponEx(playerid, 32); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_tec9 = weapon_tec9 - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws a Tec-9 from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws a Tec-9 from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_UZI: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_UZI]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_UZI] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 28)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_UZI]--; GivePlayerWeaponEx(playerid, 28); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_uzi = weapon_uzi - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws a Micro Uzi from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws a Micro Uzi from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_MP5: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_MP5]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MP5] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 29)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MP5]--; GivePlayerWeaponEx(playerid, 29); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_mp5 = weapon_mp5 - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws an MP5 from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws an MP5 from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_AK47: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_AK47]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_AK47] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 30)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_AK47]--; GivePlayerWeaponEx(playerid, 30); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_ak47 = weapon_ak47 - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws an AK-47 from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws an AK-47 from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_M4: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_M4]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_M4] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 31)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_M4]--; GivePlayerWeaponEx(playerid, 31); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_m4 = weapon_m4 - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws an M4 from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws an M4 from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_RIFLE: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_RIFLE]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_RIFLE] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 33)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_RIFLE]--; GivePlayerWeaponEx(playerid, 33); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_rifle = weapon_rifle - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws a rifle from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws a rifle from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_SNIPER: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SNIPER]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SNIPER] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 34)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SNIPER]--; GivePlayerWeaponEx(playerid, 34); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_sniper = weapon_sniper - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws a sniper rifle from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws a sniper rifle from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_MOLOTOV: { if(PlayerInfo[playerid][pGangRank] < GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_MOLOTOV]) { return SendClientMessage(playerid, COLOR_GREY, "Your rank isn't high enough to withdraw this weapon."); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MOLOTOV] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "The gang stash doesn't have any of this weapon left."); } if(PlayerHasWeapon(playerid, 18)) { return SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MOLOTOV]--; GivePlayerWeaponEx(playerid, 18); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_molotov = weapon_molotov - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws a molotov from the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) withdraws a molotov from the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } } } else if(listitem == 1) { if(IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "Law enforcement is prohibited from storing weapons."); } if(GetPlayerHealthEx(playerid) < 60) { return SendClientMessage(playerid, COLOR_GREY, "You can't store weapons as your health is below 60."); } switch(PlayerInfo[playerid][pSelected]) { case GANGWEAPON_9MM: { if(!PlayerHasWeapon(playerid, 22)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_9MM]++; RemovePlayerWeapon(playerid, 22); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_9mm = weapon_9mm + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits a 9mm in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits a 9mm in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_SDPISTOL: { if(!PlayerHasWeapon(playerid, 23)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SDPISTOL]++; RemovePlayerWeapon(playerid, 23); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_sdpistol = weapon_sdpistol + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits a silenced pistol in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits a silenced pistol in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_DEAGLE: { if(!PlayerHasWeapon(playerid, 24)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_DEAGLE]++; RemovePlayerWeapon(playerid, 24); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_deagle = weapon_deagle + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits a Desert Eagle in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits a Desert Eagle in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_SHOTGUN: { if(!PlayerHasWeapon(playerid, 25)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SHOTGUN]++; RemovePlayerWeapon(playerid, 25); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_shotgun = weapon_shotgun + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits a shotgun in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits a shotgun in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_SAWNOFF: { if(!PlayerHasWeapon(playerid, 26)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SAWNOFF]++; RemovePlayerWeapon(playerid, 26); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_sawnoff = weapon_sawnoff + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits a sawnoff shotgun in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits a sawnoff shotgun in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_TEC9: { if(!PlayerHasWeapon(playerid, 32)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_TEC9]++; RemovePlayerWeapon(playerid, 32); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_tec9 = weapon_tec9 + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits a Tec-9 in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits a Tec-9 in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_UZI: { if(!PlayerHasWeapon(playerid, 28)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_UZI]++; RemovePlayerWeapon(playerid, 28); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_uzi = weapon_uzi + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits a Micro Uzi in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits a Micro Uzi in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_MP5: { if(!PlayerHasWeapon(playerid, 29)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MP5]++; RemovePlayerWeapon(playerid, 29); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_mp5 = weapon_mp5 + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits an MP5 in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits an MP5 in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_AK47: { if(!PlayerHasWeapon(playerid, 30)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_AK47]++; RemovePlayerWeapon(playerid, 30); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_ak47 = weapon_ak47 + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits an AK-47 in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits an AK-47 in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_M4: { if(!PlayerHasWeapon(playerid, 31)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_M4]++; RemovePlayerWeapon(playerid, 31); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_m4 = weapon_m4 + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits an M4 in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits an M4 in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_RIFLE: { if(!PlayerHasWeapon(playerid, 33)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_RIFLE]++; RemovePlayerWeapon(playerid, 33); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_rifle = weapon_rifle + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits a rifle in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits a rifle in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_SNIPER: { if(!PlayerHasWeapon(playerid, 34)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SNIPER]++; RemovePlayerWeapon(playerid, 34); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_sniper = weapon_sniper + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits a sniper rifle in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits a sniper rifle in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case GANGWEAPON_MOLOTOV: { if(!PlayerHasWeapon(playerid, 18)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have this weapon."); } GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MOLOTOV]++; RemovePlayerWeapon(playerid, 18); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weapon_molotov = weapon_molotov + 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits a molotov in the gang stash.", GetPlayerRPName(playerid)); Log_Write("log_gang", "%s (uid: %i) deposits a molotov in the %s (id: %i) gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } } } else if(listitem == 2) { if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 6+ to edit weapon ranks."); } ShowPlayerDialog(playerid, DIALOG_GANGSTASHWEAPONRANK, DIALOG_STYLE_LIST, "Choose a rank to restrict withdrawals to:", "R0+\nR1+\nR2+\nR3+\nR4+\nR5+\nR6", "Select", "Back"); } } else { ShowDialogToPlayer(playerid, DIALOG_GANGSTASHWEAPONS1); } } case DIALOG_GANGSTASHWEAPONRANK: { if(PlayerInfo[playerid][pGang] == -1) { return 1; } if(response) { switch(PlayerInfo[playerid][pSelected]) { case GANGWEAPON_9MM: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_9MM] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}9mm{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_9mm = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_SDPISTOL: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SDPISTOL] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}Silenced pistol{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_9mm = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_DEAGLE: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_DEAGLE] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}Desert Eagle{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_deagle = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_SHOTGUN: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SHOTGUN] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}Shotgun{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_shotgun = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_SAWNOFF: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SAWNOFF] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}Sawnoff Shotgun{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_sawnoff = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_TEC9: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_TEC9] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}Tec-9{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_tec9 = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_UZI: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_UZI] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}Micro Uzi{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_uzi = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_MP5: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_MP5] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}MP5{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_mp5 = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_AK47: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_AK47] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}AK-47{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_ak47 = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_M4: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_M4] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}M4{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_m4 = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_RIFLE: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_RIFLE] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}Rifle{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_rifle = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_SNIPER: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_SNIPER] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}Sniper Rifle{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_sniper = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } case GANGWEAPON_MOLOTOV: { GangInfo[PlayerInfo[playerid][pGang]][gWeaponRanks][GANGWEAPON_MOLOTOV] = listitem; SendClientMessageEx(playerid, COLOR_AQUA, "You have set the rank restriction for {FF6347}Molotov{33CCFF} to rank %i+.", listitem); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET rank_molotov = %i WHERE id = %i", listitem, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } } ShowDialogToPlayer(playerid, DIALOG_GANGSTASHWEAPONS1); } else { ShowPlayerDialog(playerid, DIALOG_GANGSTASHWEAPONS2, DIALOG_STYLE_LIST, "Gang stash | Weapons", "Withdraw\nDeposit\nChange Rank", "Select", "Back"); } } case DIALOG_GANGSTASHDRUGS1: { if(PlayerInfo[playerid][pGang] == -1) { return 1; } if(response) { switch(listitem) { case 0: PlayerInfo[playerid][pSelected] = ITEM_WEED; case 1: PlayerInfo[playerid][pSelected] = ITEM_COCAINE; case 2: PlayerInfo[playerid][pSelected] = ITEM_METH; case 3: PlayerInfo[playerid][pSelected] = ITEM_PAINKILLERS; } ShowDialogToPlayer(playerid, DIALOG_GANGSTASHDRUGS2); } else { ShowDialogToPlayer(playerid, DIALOG_GANGSTASH); } } case DIALOG_GANGSTASHDRUGS2: { if(PlayerInfo[playerid][pGang] == -1) { return 1; } if(response) { if(listitem == 0) { if(PlayerInfo[playerid][pGangRank] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You must be at least rank 2+ in order to withdraw drugs."); } ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } else if(listitem == 1) { ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } } else { ShowDialogToPlayer(playerid, DIALOG_GANGSTASHDRUGS1); } } case DIALOG_GANGWITHDRAW: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 3) { return 1; } if(response) { new amount; if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } switch(PlayerInfo[playerid][pSelected]) { case ITEM_WEED: { if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pGang]][gWeed]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } if(PlayerInfo[playerid][pWeed] + amount > GetPlayerCapacity(playerid, CAPACITY_WEED)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i weed. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pWeed], GetPlayerCapacity(playerid, CAPACITY_WEED)); return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } GangInfo[PlayerInfo[playerid][pGang]][gWeed] -= amount; PlayerInfo[playerid][pWeed] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weed = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gWeed], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws some weed from the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have withdrawn %i grams of weed from the gang stash.", amount); Log_Write("log_gang", "%s (uid: %i) withdraws %i grams of weed from the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } case ITEM_COCAINE: { if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pGang]][gCocaine]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } if(PlayerInfo[playerid][pCocaine] + amount > GetPlayerCapacity(playerid, CAPACITY_COCAINE)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i cocaine. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pCocaine], GetPlayerCapacity(playerid, CAPACITY_COCAINE)); return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } GangInfo[PlayerInfo[playerid][pGang]][gCocaine] -= amount; PlayerInfo[playerid][pCocaine] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET cocaine = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gCocaine], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws some cocaine from the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have withdrawn %i grams of cocaine from the gang stash.", amount); Log_Write("log_gang", "%s (uid: %i) withdraws %i grams of cocaine from the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } case ITEM_METH: { if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pGang]][gMeth]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } if(PlayerInfo[playerid][pMeth] + amount > GetPlayerCapacity(playerid, CAPACITY_METH)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i meth. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMeth], GetPlayerCapacity(playerid, CAPACITY_METH)); return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } GangInfo[PlayerInfo[playerid][pGang]][gMeth] -= amount; PlayerInfo[playerid][pMeth] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET meth = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMeth], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws some meth from the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have withdrawn %i grams of meth from the gang stash.", amount); Log_Write("log_gang", "%s (uid: %i) withdraws %i grams of meth from the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } case ITEM_PAINKILLERS: { if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pGang]][gPainkillers]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } if(PlayerInfo[playerid][pPainkillers] + amount > GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i painkillers. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pPainkillers], GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS)); return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } GangInfo[PlayerInfo[playerid][pGang]][gPainkillers] -= amount; PlayerInfo[playerid][pPainkillers] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET painkillers = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gPainkillers], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[playerid][pPainkillers], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws some painkillers from the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have withdrawn %i painkillers from the gang stash.", amount); Log_Write("log_gang", "%s (uid: %i) withdraws %i painkillers from the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } case ITEM_MATERIALS: { if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pGang]][gMaterials]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } if(PlayerInfo[playerid][pMaterials] + amount > GetPlayerCapacity(playerid, CAPACITY_MATERIALS)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i materials. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMaterials], GetPlayerCapacity(playerid, CAPACITY_MATERIALS)); return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= amount; PlayerInfo[playerid][pMaterials] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws some materials from the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have withdrawn %i materials from the gang stash.", amount); Log_Write("log_gang", "%s (uid: %i) withdraws %i materials from the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } case ITEM_CASH: { if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pGang]][gCash]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } GangInfo[PlayerInfo[playerid][pGang]][gCash] -= amount; GivePlayerCash(playerid, amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gCash], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s withdraws some cash from the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have withdrawn %s from the gang stash.", FormatNumber(amount)); Log_Write("log_gang", "%s (uid: %i) withdraws $%i from the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } } } else { if(PlayerInfo[playerid][pSelected] == ITEM_MATERIALS) { ShowDialogToPlayer(playerid, DIALOG_GANGSTASHMATS); } else if(PlayerInfo[playerid][pSelected] == ITEM_CASH) { ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCASH); } else { ShowDialogToPlayer(playerid, DIALOG_GANGSTASHDRUGS2); } } } case DIALOG_GANGDEPOSIT: { if(PlayerInfo[playerid][pGang] == -1) { return 1; } if(response) { new amount; if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } switch(PlayerInfo[playerid][pSelected]) { case ITEM_WEED: { if(amount < 1 || amount > PlayerInfo[playerid][pWeed]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } if(GangInfo[PlayerInfo[playerid][pGang]][gWeed] + amount > GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_WEED)) { SendClientMessageEx(playerid, COLOR_GREY, "The gang stash can't contain more than %i grams of weed.", GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_WEED)); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } GangInfo[PlayerInfo[playerid][pGang]][gWeed] += amount; PlayerInfo[playerid][pWeed] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weed = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gWeed], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits some weed in the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have deposited %i grams of weed in the gang stash.", amount); Log_Write("log_gang", "%s (uid: %i) deposits %i grams of weed in the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } case ITEM_COCAINE: { if(amount < 1 || amount > PlayerInfo[playerid][pCocaine]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } if(GangInfo[PlayerInfo[playerid][pGang]][gCocaine] + amount > GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_COCAINE)) { SendClientMessageEx(playerid, COLOR_GREY, "The gang stash can't contain more than %i grams of cocaine.", GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_COCAINE)); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } GangInfo[PlayerInfo[playerid][pGang]][gCocaine] += amount; PlayerInfo[playerid][pCocaine] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET cocaine = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gCocaine], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits some cocaine in the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have deposited %i grams of cocaine in the gang stash.", amount); Log_Write("log_gang", "%s (uid: %i) deposits %i grams of cocaine in the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } case ITEM_METH: { if(amount < 1 || amount > PlayerInfo[playerid][pMeth]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } if(GangInfo[PlayerInfo[playerid][pGang]][gMeth] + amount > GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_METH)) { SendClientMessageEx(playerid, COLOR_GREY, "The gang stash can't contain more than %i grams of meth.", GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_METH)); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } GangInfo[PlayerInfo[playerid][pGang]][gMeth] += amount; PlayerInfo[playerid][pMeth] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET meth = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMeth], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits some meth in the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have deposited %i grams of meth in the gang stash.", amount); Log_Write("log_gang", "%s (uid: %i) deposits %i grams of meth in the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } case ITEM_PAINKILLERS: { if(amount < 1 || amount > PlayerInfo[playerid][pPainkillers]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } if(GangInfo[PlayerInfo[playerid][pGang]][gPainkillers] + amount > GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_PAINKILLERS)) { SendClientMessageEx(playerid, COLOR_GREY, "The gang stash can't contain more than %i painkillers.", GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_PAINKILLERS)); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } GangInfo[PlayerInfo[playerid][pGang]][gPainkillers] += amount; PlayerInfo[playerid][pPainkillers] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET painkillers = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gPainkillers], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[playerid][pPainkillers], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits some painkillers in the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have deposited %i painkillers in the gang stash.", amount); Log_Write("log_gang", "%s (uid: %i) deposits %i painkillers in the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } case ITEM_MATERIALS: { if(amount < 1 || amount > PlayerInfo[playerid][pMaterials]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] + amount > GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_MATERIALS)) { SendClientMessageEx(playerid, COLOR_GREY, "The gang stash can't contain more than %i materials.", GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_MATERIALS)); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] += amount; PlayerInfo[playerid][pMaterials] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits some materials in the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have deposited %i materials in the gang stash.", amount); Log_Write("log_gang", "%s (uid: %i) deposits %i materials in the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } case ITEM_CASH: { if(amount < 1 || amount > PlayerInfo[playerid][pCash]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } if(GangInfo[PlayerInfo[playerid][pGang]][gCash] + amount > GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_CASH)) { SendClientMessageEx(playerid, COLOR_GREY, "The gang stash can't contain more than $%i.", GetGangStashCapacity(PlayerInfo[playerid][pGang], STASH_CAPACITY_CASH)); return ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } GangInfo[PlayerInfo[playerid][pGang]][gCash] += amount; GivePlayerCash(playerid, -amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gCash], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s deposits some cash in the gang stash.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have deposited %i in the gang stash.", FormatNumber(amount)); Log_Write("log_gang", "%s (uid: %i) deposited $%i in the gang stash.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); } } } else { if(PlayerInfo[playerid][pSelected] == ITEM_MATERIALS) { ShowDialogToPlayer(playerid, DIALOG_GANGSTASHMATS); } else if(PlayerInfo[playerid][pSelected] == ITEM_CASH) { ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCASH); } else { ShowDialogToPlayer(playerid, DIALOG_GANGSTASHDRUGS2); } } } case DIALOG_GANGSTASHCRAFT: { if(response) { switch(listitem) { case 0: { if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 100) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 100; GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_9MM]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i, weapon_9mm = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_9MM], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crafts a 9mm and stores it to the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You used 100 materials from your gang stash to craft a 9mm."); Log_Write("log_gang", "%s (uid: %i) crafts a 9mm using 100 materials from the gang stash.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } case 1: { if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 150) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 150; GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SDPISTOL]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i, weapon_sdpistol = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SDPISTOL], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crafts a silenced pistol and stores it to the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You used 150 materials from your gang stash to craft a silenced pistol."); Log_Write("log_gang", "%s (uid: %i) crafts a silenced pistol using 150 materials from the gang stash.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } case 2: { if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 200) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 200; GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SHOTGUN]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i, weapon_shotgun = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SHOTGUN], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crafts a shotgun and stores it to the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You used 200 materials from your gang stash to craft a shotgun."); Log_Write("log_gang", "%s (uid: %i) crafts a shotgun using 200 materials from the gang stash.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } case 3: { if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 500) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 500; GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_UZI]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i, weapon_uzi = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_UZI], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crafts a Micro SMG and stores it to the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You used 500 materials from your gang stash to craft a Micro SMG."); Log_Write("log_gang", "%s (uid: %i) crafts a Micro SMG using 500 materials from the gang stash.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } case 4: { if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 500) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 500; GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_TEC9]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i, weapon_tec9 = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_TEC9], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crafts a Tec-9 and stores it to the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You used 500 materials from your gang stash to craft a Tec-9."); Log_Write("log_gang", "%s (uid: %i) crafts a Tec-9 using 500 materials from the gang stash.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } case 5: { if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 1000) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 1000; GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MP5]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i, weapon_mp5 = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MP5], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crafts an MP5 and stores it to the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You used 1000 materials from your gang stash to craft an MP5."); Log_Write("log_gang", "%s (uid: %i) crafts an MP5 using 1000 materials from the gang stash.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } case 6: { if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 1000) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 1000; GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_RIFLE]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i, weapon_rifle = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_RIFLE], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crafts a rifle and stores it to the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You used 1000 materials from your gang stash to craft a rifle."); Log_Write("log_gang", "%s (uid: %i) crafts a rifle using 1000 materials from the gang stash.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } case 7: { if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 2000) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 2000; GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_DEAGLE]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i, weapon_deagle = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_DEAGLE], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crafts a Desert Eagle and stores it to the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You used 2000 materials from your gang stash to craft a Desert Eagle."); Log_Write("log_gang", "%s (uid: %i) crafts a Desert Eagle using 2000 materials from the gang stash.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } case 8: { if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 5000) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 5000; GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MOLOTOV]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i, weapon_molotov = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_MOLOTOV], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crafts a molotov and stores it to the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You used 5000 materials from your gang stash to craft a molotov."); Log_Write("log_gang", "%s (uid: %i) crafts a molotov using 5000 materials from the gang stash.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } case 9: { if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 3000) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 3000; GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_AK47]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i, weapon_ak47 = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_AK47], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crafts an AK-47 and stores it to the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You used 3000 materials from your gang stash to craft an AK-47."); Log_Write("log_gang", "%s (uid: %i) crafts an AK-47 using 3000 materials from the gang stash.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } case 10: { if(GangInfo[PlayerInfo[playerid][pGang]][gMaterials] < 3000) { return SendClientMessage(playerid, COLOR_GREY, "There aren't enough materials in the safe."); } GangInfo[PlayerInfo[playerid][pGang]][gMaterials] -= 3000; GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SAWNOFF]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET materials = %i, weapon_sawnoff = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMaterials], GangInfo[PlayerInfo[playerid][pGang]][gWeapons][GANGWEAPON_SAWNOFF], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crafts a sawnoff shotgun and stores it to the gang stash.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_AQUA, "You used 3000 materials from your gang stash to craft a sawnoff shotgun."); Log_Write("log_gang", "%s (uid: %i) crafts a sawnoff shotgun using 3000 materials from the gang stash.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID]); ShowDialogToPlayer(playerid, DIALOG_GANGSTASHCRAFT); } } } else { ShowDialogToPlayer(playerid, DIALOG_GANGSTASH); } } case DIALOG_GANGSTASHMATS: { if(response) { if(listitem == 0) { if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You must be at least rank 6+ in order to withdraw materials."); } ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } else if(listitem == 1) { ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } } else { ShowDialogToPlayer(playerid, DIALOG_GANGSTASH); } } case DIALOG_GANGSTASHCASH: { if(response) { if(listitem == 0) { if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You must be at least rank 6+ in order to withdraw cash."); } ShowDialogToPlayer(playerid, DIALOG_GANGWITHDRAW); } else if(listitem == 1) { ShowDialogToPlayer(playerid, DIALOG_GANGDEPOSIT); } } else { ShowDialogToPlayer(playerid, DIALOG_GANGSTASH); } } case DIALOG_GANGSKINS: { if(PlayerInfo[playerid][pGang] >= 0) { if(response) { new index = PlayerInfo[playerid][pSkinSelected] + 1; if(index >= MAX_GANG_SKINS) { // When the player is shown the dialog for the first time, their skin isn't chnaged until they click >> Next. SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]); PlayerInfo[playerid][pSkinSelected] = -1; } else { // Find the next skin in the array. for(new i = index; i < MAX_GANG_SKINS; i ++) { if(GangInfo[PlayerInfo[playerid][pGang]][gSkins][i] != 0) { SetPlayerSkin(playerid, GangInfo[PlayerInfo[playerid][pGang]][gSkins][i]); PlayerInfo[playerid][pSkinSelected] = i; break; } } if(index == PlayerInfo[playerid][pSkinSelected] + 1) { // Looks like there was no skin found. So, we'll go back to the very first valid skin in the skin array. for(new i = 0; i < MAX_GANG_SKINS; i ++) { if(GangInfo[PlayerInfo[playerid][pGang]][gSkins][i] != 0) { SetPlayerSkin(playerid, GangInfo[PlayerInfo[playerid][pGang]][gSkins][i]); PlayerInfo[playerid][pSkinSelected] = i; break; } } } } ShowPlayerDialog(playerid, DIALOG_GANGSKINS, DIALOG_STYLE_MSGBOX, "Skin selection", "Press {00AA00}>> Next{A9C4E4} to browse through available gang skins.", ">> Next", "Confirm"); } else { PlayerInfo[playerid][pSkinSelected] = -1; SetScriptSkin(playerid, GetPlayerSkin(playerid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s changes their clothes.", GetPlayerRPName(playerid)); } } } case DIALOG_GANGFINDCAR: { if(response) { new count, garageid; foreach(new i: Vehicle) { if((VehicleInfo[i][vID] > 0 && VehicleInfo[i][vGang] == PlayerInfo[playerid][pGang]) && (count++ == listitem)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; if((garageid = GetVehicleGarage(i)) >= 0) { SetPlayerCheckpoint(playerid, GarageInfo[garageid][gPosX], GarageInfo[garageid][gPosY], GarageInfo[garageid][gPosZ], 3.0); SendClientMessageEx(playerid, COLOR_YELLOW, "This %s is located in a garage. Checkpoint marked at the garage's location.", GetVehicleName(i)); } else { new Float:x, Float:y, Float:z; GetVehiclePos(i, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 3.0); SendClientMessageEx(playerid, COLOR_YELLOW, "This %s is located in %s. Checkpoint marked at the location.", GetVehicleName(i), GetZoneName(x, y, z)); } return 1; } } } } case DIALOG_GANGPOINTSHOP: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 6) { return 1; } if(response) { switch(listitem) { case 0: { if(GangInfo[PlayerInfo[playerid][pGang]][gPoints] < 500) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have enough points."); } if(PlayerInfo[playerid][pCash] < 50000) { return SendClientMessage(playerid, COLOR_GREY, "You need $50,000 on hand to purchase this upgrade."); } if(GangInfo[PlayerInfo[playerid][pGang]][gDrugDealer]) { return SendClientMessage(playerid, COLOR_GREY, "Your gang already has this upgrade."); } GangInfo[PlayerInfo[playerid][pGang]][gDrugDealer] = 1; GangInfo[PlayerInfo[playerid][pGang]][gDrugX] = 0.0; GangInfo[PlayerInfo[playerid][pGang]][gDrugY] = 0.0; GangInfo[PlayerInfo[playerid][pGang]][gDrugZ] = 0.0; GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed] = 0; GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth] = 0; GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine] = 0; GangInfo[PlayerInfo[playerid][pGang]][gDrugPrices][0] = 500; GangInfo[PlayerInfo[playerid][pGang]][gDrugPrices][1] = 1000; GangInfo[PlayerInfo[playerid][pGang]][gDrugPrices][2] = 1500; GangInfo[PlayerInfo[playerid][pGang]][gPoints] -= 500; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET drugdealer = 1, drug_x = 0.0, drug_y = 0.0, drug_z = 0.0, drugweed = 0, drugcocaine = 0, drugmeth = 0, weed_price = 500, cocaine_price = 1000, meth_price = 1500, points = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gPoints], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -50000); SendClientMessage(playerid, COLOR_AQUA, "You have spent 500 GP & $50,000 on an {00AA00}NPC drug dealer{33CCFF}. '/gang npc' to edit your drug dealer."); Log_Write("log_gang", "%s (uid: %i) spent 500 GP & $50000 on an NPC drug dealer for %s (id: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case 1: { if(GangInfo[PlayerInfo[playerid][pGang]][gPoints] < 500) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have enough points."); } if(PlayerInfo[playerid][pCash] < 50000) { return SendClientMessage(playerid, COLOR_GREY, "You need $50,000 on hand to purchase this upgrade."); } if(GangInfo[PlayerInfo[playerid][pGang]][gArmsDealer]) { return SendClientMessage(playerid, COLOR_GREY, "Your gang already has this upgrade."); } GangInfo[PlayerInfo[playerid][pGang]][gArmsDealer] = 1; GangInfo[PlayerInfo[playerid][pGang]][gArmsX] = 0.0; GangInfo[PlayerInfo[playerid][pGang]][gArmsY] = 0.0; GangInfo[PlayerInfo[playerid][pGang]][gArmsZ] = 0.0; GangInfo[PlayerInfo[playerid][pGang]][gArmsMaterials] = 0; GangInfo[PlayerInfo[playerid][pGang]][gPoints] -= 500; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsdealer = 1, arms_x = 0.0, arms_y = 0.0, arms_z = 0.0, armsmaterials = 0, points = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gPoints], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -50000); SendClientMessage(playerid, COLOR_AQUA, "You have spent 500 GP & $50,000 on an {00AA00}NPC arms dealer{33CCFF}. '/gang npc' to edit your arms dealer."); Log_Write("log_gang", "%s (uid: %i) spent 500 GP & $50000 on an NPC arm dealer for %s (id: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case 2: { if(GangInfo[PlayerInfo[playerid][pGang]][gPoints] < 400) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have enough points."); } if(PlayerInfo[playerid][pCash] < 75000) { return SendClientMessage(playerid, COLOR_GREY, "You need $75,000 on hand to purchase this upgrade."); } GivePlayerCash(playerid, -75000); GiveGangPoints(PlayerInfo[playerid][pGang], -400); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, 'Gang point redemption', NOW(), 'Duel arena')", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_AQUA, "You have spent 400 GP & $75,000 on a {00AA00}Duel arena{33CCFF}. /report for an admin to set it up."); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has a pending flag for a duel arena for their gang.", GetPlayerRPName(playerid), playerid); } case 3: { if(GangInfo[PlayerInfo[playerid][pGang]][gPoints] < 4500) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have enough points."); } if(PlayerInfo[playerid][pCash] < 100000) { return SendClientMessage(playerid, COLOR_GREY, "You need $100,000 on hand to purchase this upgrade."); } GivePlayerCash(playerid, -100000); GiveGangPoints(PlayerInfo[playerid][pGang], -4500); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, 'Gang point redemption', NOW(), 'Gang mapping (up to 50 objects)')", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_AQUA, "You have spent 4500 GP & $100,000 on {00AA00}Mapping{33CCFF}. /report for an admin to set it up."); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has a pending flag for mapping for their gang.", GetPlayerRPName(playerid), playerid); } case 4: { if(GangInfo[PlayerInfo[playerid][pGang]][gPoints] < 5000) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have enough points."); } if(PlayerInfo[playerid][pCash] < 100000) { return SendClientMessage(playerid, COLOR_GREY, "You need $100,000 on hand to purchase this upgrade."); } GivePlayerCash(playerid, -100000); GiveGangPoints(PlayerInfo[playerid][pGang], -5000); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, 'Gang point redemption', NOW(), 'Custom gang interior')", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_AQUA, "You have spent 5000 GP & $100,000 on {00AA00}Custom gang interior{33CCFF}. /report for an admin to set it up."); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has a pending flag for a custom gang interior.", GetPlayerRPName(playerid), playerid); } case 5: { new cashNeeded = 100000 + (50000*GangInfo[PlayerInfo[playerid][pGang]][gMatLevel]); new pointsNeeded = 1500 + (500*GangInfo[PlayerInfo[playerid][pGang]][gMatLevel]); if(GangInfo[PlayerInfo[playerid][pGang]][gPoints] < pointsNeeded) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have enough points."); } if(PlayerInfo[playerid][pCash] < cashNeeded) { return SendClientMessageEx(playerid, COLOR_GREY, "You need $%i on hand to purchase this upgrade.", cashNeeded); } if(GangInfo[PlayerInfo[playerid][pGang]][gMatLevel] + 1 > 3) { return SendClientMessage(playerid, COLOR_GREY, "Your gang's materials upgrade is already maxed out. (3/3)"); } GangInfo[PlayerInfo[playerid][pGang]][gMatLevel]++; GangInfo[PlayerInfo[playerid][pGang]][gPoints] -= pointsNeeded; GivePlayerCash(playerid, -cashNeeded); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET matlevel = %i, points = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gMatLevel], GangInfo[PlayerInfo[playerid][pGang]][gPoints], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You have spent %i GP & $%i for materials upgrade %i/3", pointsNeeded, cashNeeded, GangInfo[PlayerInfo[playerid][pGang]][gMatLevel]); SendClientMessageEx(playerid, COLOR_GREEN, "Your gang will now receive %i materials from each material-class turf captured.", (10000+(5000*GangInfo[PlayerInfo[playerid][pGang]][gMatLevel]))); Log_Write("log_gang", "%s (uid: %i) spent %i GP & $%i for gang level %i/3 for %s (id: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], pointsNeeded, cashNeeded, GangInfo[PlayerInfo[playerid][pGang]][gMatLevel], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case 6: { new cashNeeded = 40000 + (20000 * GangInfo[PlayerInfo[playerid][pGang]][gGunLevel]); new pointsNeeded = 1500 + (250*GangInfo[PlayerInfo[playerid][pGang]][gGunLevel]); if(GangInfo[PlayerInfo[playerid][pGang]][gPoints] < pointsNeeded) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have enough points."); } if(PlayerInfo[playerid][pCash] < cashNeeded) { return SendClientMessageEx(playerid, COLOR_GREY, "You need $%i on hand to purchase this upgrade.", cashNeeded); } if(GangInfo[PlayerInfo[playerid][pGang]][gGunLevel] + 1 > 5) { return SendClientMessage(playerid, COLOR_GREY, "Your gang's gun upgrade is already maxed out. (5/5"); } GangInfo[PlayerInfo[playerid][pGang]][gGunLevel]++; GangInfo[PlayerInfo[playerid][pGang]][gPoints] -= pointsNeeded; GivePlayerCash(playerid, -cashNeeded); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET gunlevel = %i, points = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gGunLevel], GangInfo[PlayerInfo[playerid][pGang]][gPoints], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You have spent %i GP & $%i for guns upgrade %i/5", pointsNeeded, cashNeeded, GangInfo[PlayerInfo[playerid][pGang]][gGunLevel]); SendClientMessageEx(playerid, COLOR_GREEN, "Your gang will now receive %i guns from each weapon-class turf captured.", (10+GangInfo[PlayerInfo[playerid][pGang]][gGunLevel])); Log_Write("log_gang", "%s (uid: %i) spent %i GP & $%i for gang level %i/5 for %s (id: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], pointsNeeded, cashNeeded, GangInfo[PlayerInfo[playerid][pGang]][gGunLevel], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case 7: { switch(GangInfo[PlayerInfo[playerid][pGang]][gLevel]) { case 1: { if(GangInfo[PlayerInfo[playerid][pGang]][gPoints] < 6000) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have enough points."); } if(PlayerInfo[playerid][pCash] < 75000) { return SendClientMessage(playerid, COLOR_GREY, "You need $75,000 on hand to purchase this upgrade."); } GangInfo[PlayerInfo[playerid][pGang]][gLevel] = 2; GangInfo[PlayerInfo[playerid][pGang]][gPoints] -= 6000; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET level = 2, points = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gPoints], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -75000); ReloadGang(PlayerInfo[playerid][pGang]); SendClientMessageEx(playerid, COLOR_GREEN, "You have spent 6000 GP & $75,000 for gang level 2/3. Your gang can now have %i members & %i gang vehicles.", GetGangMemberLimit(PlayerInfo[playerid][pGang]), GetGangVehicleLimit(PlayerInfo[playerid][pGang])); SendClientMessage(playerid, COLOR_GREEN, "Your capacity for items in your gang stash has also been increased. Access your gang stash to learn more!"); Log_Write("log_gang", "%s (uid: %i) spent 6000 GP & $75000 for gang level 2/3 for %s (id: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } case 2: { if(GangInfo[PlayerInfo[playerid][pGang]][gPoints] < 12000) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have enough points."); } if(PlayerInfo[playerid][pCash] < 100000) { return SendClientMessage(playerid, COLOR_GREY, "You need $100,000 on hand to purchase this upgrade."); } GangInfo[PlayerInfo[playerid][pGang]][gLevel] = 3; GangInfo[PlayerInfo[playerid][pGang]][gPoints] -= 12000; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET level = 3, points = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gPoints], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -100000); ReloadGang(PlayerInfo[playerid][pGang]); SendClientMessageEx(playerid, COLOR_GREEN, "You have spent 12000 GP & $100,000 for gang level 3/3. Your gang can now have %i members & %i gang vehicles.", GetGangMemberLimit(PlayerInfo[playerid][pGang]), GetGangVehicleLimit(PlayerInfo[playerid][pGang])); SendClientMessage(playerid, COLOR_GREEN, "Your capacity for items in your gang stash has also been increased. Access your gang stash to learn more!"); Log_Write("log_gang", "%s (uid: %i) spent 12000 GP & $100000 for gang level 3/3 for %s (id: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang]); } } } } } } case DIALOG_GANGARMSPRICES: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return 1; } if(response) { PlayerInfo[playerid][pSelected] = listitem; ShowPlayerDialog(playerid, DIALOG_GANGARMSPRICE, DIALOG_STYLE_INPUT, "Arms dealer | Prices", "Enter the new price for this item:", "Submit", "Back"); } else { ShowDialogToPlayer(playerid, DIALOG_GANGARMSEDIT); } } case DIALOG_GANGARMSPRICE: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return 1; } if(response) { new amount; if(sscanf(inputtext, "i", amount)) { return ShowPlayerDialog(playerid, DIALOG_GANGARMSPRICE, DIALOG_STYLE_INPUT, "Arms dealer | Prices", "Enter the new price for this item", "Submit", "Back"); } if(amount < 0) { SendClientMessage(playerid, COLOR_GREY, "The amount can't be below $0."); return ShowPlayerDialog(playerid, DIALOG_GANGARMSPRICE, DIALOG_STYLE_INPUT, "Arms dealer | Prices", "Enter the new price for this item", "Submit", "Back"); } GangInfo[PlayerInfo[playerid][pGang]][gArmsPrices][PlayerInfo[playerid][pSelected]] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsprice_%i = %i WHERE id = %i", PlayerInfo[playerid][pSelected] + 1, amount, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); if(PlayerInfo[playerid][pSelected] == 0) { SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}Micro Uzi{33CCFF} to $%i.", amount); } else if(PlayerInfo[playerid][pSelected] == 1) { SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}Tec-9{33CCFF} to $%i.", amount); } else if(PlayerInfo[playerid][pSelected] == 2) { SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}MP5{33CCFF} to $%i.", amount); } else if(PlayerInfo[playerid][pSelected] == 3) { SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}Desert Eagle{33CCFF} to $%i.", amount); } else if(PlayerInfo[playerid][pSelected] == 4) { SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}Molotov{33CCFF} to $%i.", amount); } else if(PlayerInfo[playerid][pSelected] == 5) { SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}AK-47{33CCFF} to $%i.", amount); } else if(PlayerInfo[playerid][pSelected] == 6) { SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}M4{33CCFF} to $%i.", amount); } else if(PlayerInfo[playerid][pSelected] == 7) { SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}Sniper{33CCFF} to $%i.", amount); } else if(PlayerInfo[playerid][pSelected] == 8) { SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}Sawnoff Shotgun{33CCFF} to $%i.", amount); } } ShowDialogToPlayer(playerid, DIALOG_GANGARMSPRICES); } case DIALOG_GANGARMSDEALER: { if(!IsPlayerInRangeOfPoint(playerid, 3.0, GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsX], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsY], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsZ])) { return 1; } if(response) { if(listitem == 0) { ShowDialogToPlayer(playerid, DIALOG_GANGARMSWEAPONS); } else if(listitem == 1) { if(PlayerInfo[playerid][pGang] != PlayerInfo[playerid][pDealerGang]) { return SendClientMessage(playerid, COLOR_GREY, "This arms dealer doesn't belong to your gang."); } if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You need to be rank 6+ in order to edit."); } ShowDialogToPlayer(playerid, DIALOG_GANGARMSEDIT); } } } case DIALOG_GANGARMSWEAPONS: { if(!IsPlayerInRangeOfPoint(playerid, 3.0, GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsX], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsY], GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsZ])) { return 1; } if(response) { switch(listitem) { case 0: { if(GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] < 500) { return SendClientMessage(playerid, COLOR_GREY, "This gang's arms dealer doesn't have enough materials for this weapon."); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this weapon."); } GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] -= 500; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsmaterials = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); GivePlayerWeaponEx(playerid, 28); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the arms dealer and received a micro uzi.", GetPlayerRPName(playerid), GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased a {00AA00}micro uzi{33CCFF} for $%i.", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); } case 1: { if(GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] < 500) { return SendClientMessage(playerid, COLOR_GREY, "This gang's arms dealer doesn't have enough materials for this weapon."); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this weapon."); } GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] -= 500; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsmaterials = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); GivePlayerWeaponEx(playerid, 32); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the arms dealer and received a Tec-9.", GetPlayerRPName(playerid), GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased a {00AA00}Tec-9{33CCFF} for $%i.", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); } case 2: { if(GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] < 1000) { return SendClientMessage(playerid, COLOR_GREY, "This gang's arms dealer doesn't have enough materials for this weapon."); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this weapon."); } GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] -= 1000; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsmaterials = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); GivePlayerWeaponEx(playerid, 29); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the arms dealer and received an MP5.", GetPlayerRPName(playerid), GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased an {00AA00}MP5{33CCFF} for $%i.", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); } case 3: { if(GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] < 2000) { return SendClientMessage(playerid, COLOR_GREY, "This gang's arms dealer doesn't have enough materials for this weapon."); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this weapon."); } GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] -= 2000; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsmaterials = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); GivePlayerWeaponEx(playerid, 24); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the arms dealer and received a Desert Eagle.", GetPlayerRPName(playerid), GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased a {00AA00}Desert Eagle{33CCFF} for $%i.", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); } case 4: { if(GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] < 5000) { return SendClientMessage(playerid, COLOR_GREY, "This gang's arms dealer doesn't have enough materials for this weapon."); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this weapon."); } GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] -= 5000; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsmaterials = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); GivePlayerWeaponEx(playerid, 18); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the arms dealer and received a molotov.", GetPlayerRPName(playerid), GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased a {00AA00}molotov{33CCFF} for $%i.", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); } case 5: { if(GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] < 3000) { return SendClientMessage(playerid, COLOR_GREY, "This gang's arms dealer doesn't have enough materials for this weapon."); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this weapon."); } GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] -= 3000; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsmaterials = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); GivePlayerWeaponEx(playerid, 30); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the arms dealer and received an AK-47.", GetPlayerRPName(playerid), GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased an {00AA00}AK-47{33CCFF} for $%i.", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); } case 6: { if(GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] < 4000) { return SendClientMessage(playerid, COLOR_GREY, "This gang's arms dealer doesn't have enough materials for this weapon."); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this weapon."); } GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] -= 4000; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsmaterials = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); GivePlayerWeaponEx(playerid, 31); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the arms dealer and received an M4.", GetPlayerRPName(playerid), GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased an {00AA00}M4{33CCFF} for $%i.", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); } case 7: { if(GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] < 6500) { return SendClientMessage(playerid, COLOR_GREY, "This gang's arms dealer doesn't have enough materials for this weapon."); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this weapon."); } GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] -= 6500; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsmaterials = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); GivePlayerWeaponEx(playerid, 34); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the arms dealer and received a sniper.", GetPlayerRPName(playerid), GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased a {00AA00}sniper{33CCFF} for $%i.", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); } case 8: { if(GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] < 3000) { return SendClientMessage(playerid, COLOR_GREY, "This gang's arms dealer doesn't have enough materials for this weapon."); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this weapon."); } GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials] -= 3000; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsmaterials = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsMaterials], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); GivePlayerWeaponEx(playerid, 26); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the arms dealer and received a sawnoff shotgun.", GetPlayerRPName(playerid), GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased a {00AA00}sawnoff shotgun{33CCFF} for $%i.", GangInfo[PlayerInfo[playerid][pDealerGang]][gArmsPrices][listitem]); } } } else { ShowDialogToPlayer(playerid, DIALOG_GANGARMSDEALER); } } case DIALOG_GANGARMSEDIT: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 6) { return 1; } if(response) { switch(listitem) { case 0: ShowDialogToPlayer(playerid, DIALOG_GANGARMSPRICES); case 1: ShowDialogToPlayer(playerid, DIALOG_GANGARMSDEPOSITMATS); case 2: ShowDialogToPlayer(playerid, DIALOG_GANGARMSWITHDRAWMATS); } } else { ShowDialogToPlayer(playerid, DIALOG_GANGARMSDEALER); } } case DIALOG_GANGARMSDEPOSITMATS: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 6) { return 1; } if(response) { new amount; if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGARMSDEPOSITMATS); } if(amount < 1 || amount > PlayerInfo[playerid][pMaterials]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGARMSDEPOSITMATS); } GangInfo[PlayerInfo[playerid][pGang]][gArmsMaterials] += amount; PlayerInfo[playerid][pMaterials] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsmaterials = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gArmsMaterials], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have deposited %i materials in your arms dealer NPC.", amount); } ShowDialogToPlayer(playerid, DIALOG_GANGARMSEDIT); } case DIALOG_GANGARMSWITHDRAWMATS: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 6) { return 1; } if(response) { new amount; if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGARMSWITHDRAWMATS); } if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pGang]][gArmsMaterials]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGARMSWITHDRAWMATS); } GangInfo[PlayerInfo[playerid][pGang]][gArmsMaterials] -= amount; PlayerInfo[playerid][pMaterials] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET armsmaterials = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gArmsMaterials], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have withdrawn %i materials from your arms dealer NPC.", amount); } ShowDialogToPlayer(playerid, DIALOG_GANGARMSEDIT); } case DIALOG_GANGDRUGDEALER: { if(!IsPlayerInRangeOfPoint(playerid, 3.0, GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugX], GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugY], GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugZ])) { return 1; } if(response) { if(listitem == 0) { ShowDialogToPlayer(playerid, DIALOG_GANGDRUGSHOP); } else if(listitem == 1) { if(PlayerInfo[playerid][pGang] != PlayerInfo[playerid][pDealerGang]) { return SendClientMessage(playerid, COLOR_GREY, "This drug dealer doesn't belong to your gang."); } if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You need to be rank 6+ in order to edit."); } ShowDialogToPlayer(playerid, DIALOG_GANGDRUGEDIT); } } } case DIALOG_GANGDRUGSHOP: { if(!IsPlayerInRangeOfPoint(playerid, 3.0, GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugX], GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugY], GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugZ])) { return 1; } if(response) { PlayerInfo[playerid][pSelected] = listitem; ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } else { ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEALER); } } case DIALOG_GANGDRUGBUY: { if(!IsPlayerInRangeOfPoint(playerid, 3.0, GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugX], GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugY], GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugZ])) { return 1; } if(response) { new amount; switch(PlayerInfo[playerid][pSelected]) { case 0: // Weed { if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugWeed]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][0] * amount) { SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy that many grams."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } if(PlayerInfo[playerid][pWeed] + amount > GetPlayerCapacity(playerid, CAPACITY_WEED)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i weed. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pWeed], GetPlayerCapacity(playerid, CAPACITY_WEED)); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } new cost = GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][0] * amount; GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugWeed] -= amount; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += cost; PlayerInfo[playerid][pWeed] += amount; GivePlayerCash(playerid, -cost); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET drugweed = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugWeed], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the drug dealer and received %i grams of weed.", GetPlayerRPName(playerid), cost, amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased %i grams of {00AA00}weed{33CCFF} for $%i.", amount, cost); } case 1: // Cocaine { if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugCocaine]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][1] * amount) { SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy that many grams."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } if(PlayerInfo[playerid][pCocaine] + amount > GetPlayerCapacity(playerid, CAPACITY_COCAINE)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i cocaine. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pCocaine], GetPlayerCapacity(playerid, CAPACITY_COCAINE)); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } new cost = GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][1] * amount; GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugCocaine] -= amount; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += cost; PlayerInfo[playerid][pCocaine] += amount; GivePlayerCash(playerid, -cost); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET drugcocaine = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugCocaine], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the drug dealer and received %i grams of cocaine.", GetPlayerRPName(playerid), cost, amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased %i grams of {00AA00}cocaine{33CCFF} for $%i.", amount, cost); } case 2: // Meth { if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugMeth]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } if(PlayerInfo[playerid][pCash] < GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][2] * amount) { SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy that many grams."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } if(PlayerInfo[playerid][pMeth] + amount > GetPlayerCapacity(playerid, CAPACITY_METH)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i meth. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMeth], GetPlayerCapacity(playerid, CAPACITY_METH)); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGBUY); } new cost = GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugPrices][2] * amount; GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugMeth] -= amount; GangInfo[PlayerInfo[playerid][pDealerGang]][gCash] += cost; PlayerInfo[playerid][pMeth] += amount; GivePlayerCash(playerid, -cost); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET drugmeth = %i, cash = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pDealerGang]][gDrugMeth], GangInfo[PlayerInfo[playerid][pDealerGang]][gCash], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s paid $%i to the drug dealer and received %i grams of meth.", GetPlayerRPName(playerid), cost, amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased %i grams of {00AA00}meth{33CCFF} for $%i.", amount, cost); } } } else { ShowDialogToPlayer(playerid, DIALOG_GANGDRUGSHOP); } } case DIALOG_GANGDRUGEDIT: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 6) { return 1; } if(response) { switch(listitem) { case 0: ShowDialogToPlayer(playerid, DIALOG_GANGDRUGPRICES); case 1: ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEPOSITS); case 2: ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAWS); } } else { ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEALER); } } case DIALOG_GANGDRUGPRICES: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return 1; } if(response) { PlayerInfo[playerid][pSelected] = listitem; ShowPlayerDialog(playerid, DIALOG_GANGDRUGPRICE, DIALOG_STYLE_INPUT, "Drug dealer | Prices", "Enter the new price for this drug:", "Submit", "Back"); } else { ShowDialogToPlayer(playerid, DIALOG_GANGDRUGEDIT); } } case DIALOG_GANGDRUGPRICE: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return 1; } if(response) { new amount; if(sscanf(inputtext, "i", amount)) { return ShowPlayerDialog(playerid, DIALOG_GANGDRUGPRICE, DIALOG_STYLE_INPUT, "Drug dealer | Prices", "Enter the new price for this drug:", "Submit", "Back"); } if(amount < 0) { SendClientMessage(playerid, COLOR_GREY, "The amount can't be below $0."); return ShowPlayerDialog(playerid, DIALOG_GANGDRUGPRICE, DIALOG_STYLE_INPUT, "Drug dealer | Prices", "Enter the new price for this drug:", "Submit", "Back"); } GangInfo[PlayerInfo[playerid][pGang]][gDrugPrices][PlayerInfo[playerid][pSelected]] = amount; if(PlayerInfo[playerid][pSelected] == 0) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET weed_price = %i WHERE id = %i", amount, PlayerInfo[playerid][pGang]); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}weed{33CCFF} to $%i.", amount); } else if(PlayerInfo[playerid][pSelected] == 1) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET cocaine_price = %i WHERE id = %i", amount, PlayerInfo[playerid][pGang]); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}cocaine{33CCFF} to $%i.", amount); } else if(PlayerInfo[playerid][pSelected] == 2) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET meth_price = %i WHERE id = %i", amount, PlayerInfo[playerid][pGang]); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the price of {00AA00}meth{33CCFF} to $%i.", amount); } mysql_tquery(connectionID, queryBuffer); } ShowDialogToPlayer(playerid, DIALOG_GANGDRUGPRICES); } case DIALOG_GANGDRUGDEPOSITS: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return 1; } if(response) { PlayerInfo[playerid][pSelected] = listitem; ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEPOSIT); } else { ShowDialogToPlayer(playerid, DIALOG_GANGDRUGEDIT); } } case DIALOG_GANGDRUGWITHDRAWS: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return 1; } if(response) { PlayerInfo[playerid][pSelected] = listitem; ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAW); } else { ShowDialogToPlayer(playerid, DIALOG_GANGDRUGEDIT); } } case DIALOG_GANGDRUGDEPOSIT: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return 1; } if(response) { new amount; switch(PlayerInfo[playerid][pSelected]) { case 0: // Weed { if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEPOSIT); } if(amount < 1 || amount > PlayerInfo[playerid][pWeed]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEPOSIT); } GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed] += amount; PlayerInfo[playerid][pWeed] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET drugweed = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have deposited %i grams of {00AA00}weed{33CCFF} in your drug dealer NPC.", amount); } case 1: // Cocaine { if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEPOSIT); } if(amount < 1 || amount > PlayerInfo[playerid][pCocaine]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEPOSIT); } GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine] += amount; PlayerInfo[playerid][pCocaine] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET drugcocaine = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have deposited %i grams of {00AA00}cocaine{33CCFF} in your drug dealer NPC.", amount); } case 2: // Meth { if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEPOSIT); } if(amount < 1 || amount > PlayerInfo[playerid][pMeth]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEPOSIT); } GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth] += amount; PlayerInfo[playerid][pMeth] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET drugmeth = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth], PlayerInfo[playerid][pDealerGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have deposited %i grams of {00AA00}meth{33CCFF} in your drug dealer NPC.", amount); } } } ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEPOSITS); } case DIALOG_GANGDRUGWITHDRAW: { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return 1; } if(response) { new amount; switch(PlayerInfo[playerid][pSelected]) { case 0: // Weed { if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAW); } if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAW); } if(PlayerInfo[playerid][pWeed] + amount > GetPlayerCapacity(playerid, CAPACITY_WEED)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i weed. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pWeed], GetPlayerCapacity(playerid, CAPACITY_WEED)); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAW); } GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed] -= amount; PlayerInfo[playerid][pWeed] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET drugweed = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gDrugWeed], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have withdrawn %i grams of {00AA00}weed{33CCFF} from your drug dealer NPC.", amount); } case 1: // Cocaine { if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAW); } if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAW); } if(PlayerInfo[playerid][pCocaine] + amount > GetPlayerCapacity(playerid, CAPACITY_COCAINE)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i cocaine. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pCocaine], GetPlayerCapacity(playerid, CAPACITY_COCAINE)); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAW); } GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine] -= amount; PlayerInfo[playerid][pCocaine] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET drugcocaine = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gDrugCocaine], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have withdrawn %i grams of {00AA00}cocaine{33CCFF} from your drug dealer NPC.", amount); } case 2: // Meth { if(sscanf(inputtext, "i", amount)) { return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAW); } if(amount < 1 || amount > GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth]) { SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAW); } if(PlayerInfo[playerid][pMeth] + amount > GetPlayerCapacity(playerid, CAPACITY_METH)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i meth. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMeth], GetPlayerCapacity(playerid, CAPACITY_METH)); return ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAW); } GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth] -= amount; PlayerInfo[playerid][pMeth] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET drugmeth = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gDrugMeth], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have withdrawn %i grams of {00AA00}meth{33CCFF} from your drug dealer NPC.", amount); } } } ShowDialogToPlayer(playerid, DIALOG_GANGDRUGWITHDRAWS); } case DIALOG_FREENAMECHANGE: { if(response) { if(isnull(inputtext)) { if(!IsPlayerLoggedIn(playerid)) { SendClientMessage(playerid, COLOR_LIGHTRED, "Please reconnect with a proper roleplay name in the Firstname_Lastname format."); KickPlayer(playerid); return 1; } return ShowPlayerDialog(playerid, DIALOG_FREENAMECHANGE, DIALOG_STYLE_INPUT, "Non-RP Name", "An administrator has came to the conclusion that your name is non-RP.\nTherefore you have been given this free namechange in order to correct it.\n\nEnter a name in the Firstname_Lastname format in the box below:", "Submit", "Cancel"); } if(!(3 <= strlen(inputtext) <= 20)) { SendClientMessage(playerid, COLOR_GREY, "Your name must contain 3 to 20 characters."); return ShowPlayerDialog(playerid, DIALOG_FREENAMECHANGE, DIALOG_STYLE_INPUT, "Non-RP Name", "An administrator has came to the conclusion that your name is non-RP.\nTherefore you have been given this free namechange in order to correct it.\n\nEnter a name in the Firstname_Lastname format in the box below:", "Submit", "Cancel"); } if(strfind(inputtext, "_") == -1) { SendClientMessage(playerid, COLOR_GREY, "The name needs to contain at least one underscore."); return ShowPlayerDialog(playerid, DIALOG_FREENAMECHANGE, DIALOG_STYLE_INPUT, "Non-RP Name", "An administrator has came to the conclusion that your name is non-RP.\nTherefore you have been given this free namechange in order to correct it.\n\nEnter a name in the Firstname_Lastname format in the box below:", "Submit", "Cancel"); } if(!IsValidName(inputtext)) { SendClientMessage(playerid, COLOR_GREY, "That name is not supported by SA-MP."); return ShowPlayerDialog(playerid, DIALOG_FREENAMECHANGE, DIALOG_STYLE_INPUT, "Non-RP Name", "An administrator has came to the conclusion that your name is non-RP.\nTherefore you have been given this free namechange in order to correct it.\n\nEnter a name in the Firstname_Lastname format in the box below:", "Submit", "Cancel"); } PlayerInfo[playerid][pFreeNamechange] = 1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE username = '%e'", inputtext); mysql_tquery(connectionID, queryBuffer, "OnPlayerAttemptNameChange", "is", playerid, inputtext); } else { if(!PlayerInfo[playerid][pLogged]) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has been kicked for failing to change their name.", GetPlayerRPName(playerid), playerid); KickPlayer(playerid); } else { PlayerInfo[playerid][pJailType] = 2; PlayerInfo[playerid][pJailTime] = 20 * 60; ResetPlayerWeaponsEx(playerid); ResetPlayer(playerid); SetPlayerInJail(playerid); GameTextForPlayer(playerid, "~w~Welcome to~n~~r~admin jail", 5000, 3); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET prisonedby = 'Server', prisonreason = 'failing to change their name' WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); strins(PlayerInfo[playerid][pPrisonedBy], "Server", 0); strins(PlayerInfo[playerid][pPrisonReason], "failing to change their name", 0); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has been prisoned for failing to change their name.", GetPlayerRPName(playerid), playerid); Log_Write("log_punishments", "%s (uid: %i) has been prisoned for 20 minutes, reason: failing to change their name.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID]); } } } case DIALOG_REMOVEFLAG: { if(response) { new targetid = PlayerInfo[playerid][pRemoveFrom]; if(targetid == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "The player has disconnected. You can't remove their flags now."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT id, description FROM flags WHERE uid = %i LIMIT %i, 1", PlayerInfo[targetid][pID], listitem); mysql_tquery(connectionID, queryBuffer, "OnVerifyRemoveFlag", "ii", playerid, targetid); } } case DIALOG_NEWBIEUNMUTE: { if((response) && PlayerInfo[playerid][pNewbieMuted]) { switch(listitem) { case 0: { new fine = percent(PlayerInfo[playerid][pCash] + PlayerInfo[playerid][pBank], 5); GivePlayerCash(playerid, -fine); SendClientMessageEx(playerid, COLOR_AQUA, "You have chosen to pay a 5 percent fine of {FF6347}$%i{33CCFF} for a newbie unmute.", fine); } case 1: { if(PlayerInfo[playerid][pJailTime] > 600) { return SendClientMessage(playerid, COLOR_GREY, "This punishment is not available to you as you are jailed for more than 10 minutes."); } PlayerInfo[playerid][pJailType] = 1; PlayerInfo[playerid][pJailTime] += 600; ResetPlayerWeaponsEx(playerid); ResetPlayer(playerid); SetPlayerInJail(playerid); SendClientMessage(playerid, COLOR_AQUA, "You have chosen a 10 minute jail sentence for a newbie unmute."); } } PlayerInfo[playerid][pNewbieMuted] = 0; PlayerInfo[playerid][pNewbieMuteTime] = 0; } } case DIALOG_REPORTUNMUTE: { if((response) && PlayerInfo[playerid][pReportMuted]) { switch(listitem) { case 0: { new fine = percent(PlayerInfo[playerid][pCash] + PlayerInfo[playerid][pBank], 5); GivePlayerCash(playerid, -fine); SendClientMessageEx(playerid, COLOR_AQUA, "You have chosen to pay a 5 percent fine of {FF6347}$%i{33CCFF} for a report unmute.", fine); } case 1: { if(PlayerInfo[playerid][pJailTime] > 600) { return SendClientMessage(playerid, COLOR_GREY, "This punishment is not available to you as you are jailed for more than 10 minutes."); } PlayerInfo[playerid][pJailType] = 1; PlayerInfo[playerid][pJailTime] = 600; ResetPlayerWeaponsEx(playerid); ResetPlayer(playerid); SetPlayerInJail(playerid); SendClientMessage(playerid, COLOR_AQUA, "You have chosen a 10 minute jail sentence for a report unmute."); } } PlayerInfo[playerid][pReportMuted] = 0; PlayerInfo[playerid][pReportMuteTime] = 0; } } case DIALOG_GLOBALUNMUTE: { if((response) && PlayerInfo[playerid][pGlobalMuted]) { switch(listitem) { case 0: { new fine = percent(PlayerInfo[playerid][pCash] + PlayerInfo[playerid][pBank], 5); GivePlayerCash(playerid, -fine); SendClientMessageEx(playerid, COLOR_AQUA, "You have chosen to pay a 5 percent fine of {FF6347}$%i{33CCFF} for a global chat unmute.", fine); } case 1: { if(PlayerInfo[playerid][pJailTime] > 600) { return SendClientMessage(playerid, COLOR_GREY, "This punishment is not available to you as you are jailed for more than 10 minutes."); } PlayerInfo[playerid][pJailType] = 1; PlayerInfo[playerid][pJailTime] = 600; ResetPlayerWeaponsEx(playerid); ResetPlayer(playerid); SetPlayerInJail(playerid); SendClientMessage(playerid, COLOR_AQUA, "You have chosen a 10 minute jail sentence for a global chat unmute."); } } PlayerInfo[playerid][pGlobalMuted] = 0; PlayerInfo[playerid][pGlobalMuteTime] = 0; } } case DIALOG_REMOVEPVEH: { if(response) { new targetid = PlayerInfo[playerid][pRemoveFrom]; if(targetid == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "The player has disconnected. You can't remove their vehicles now."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT id, modelid FROM vehicles WHERE ownerid = %i LIMIT %i, 1", PlayerInfo[targetid][pID], listitem); mysql_tquery(connectionID, queryBuffer, "OnVerifyRemoveVehicle", "ii", playerid, targetid); } } case DIALOG_CRACKTRUNK: { if(response) { new vehicleid = PlayerInfo[playerid][pCocaineFrom], amount; if(!IsPlayerInRangeOfBoot(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't steal anything from the trunk now. You're not near it."); } if(VehicleInfo[vehicleid][vLocked]) { return SendClientMessage(playerid, COLOR_GREY, "You can't steal anything from the trunk now. The vehicle is locked!"); } if(strfind(inputtext, "Weed") != -1 && (amount = VehicleInfo[vehicleid][vWeed]/20) > 0) { if(PlayerInfo[playerid][pWeed] + amount > GetPlayerCapacity(playerid, CAPACITY_WEED)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i weed. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pWeed], GetPlayerCapacity(playerid, CAPACITY_WEED)); return ShowDialogToPlayer(playerid, DIALOG_CRACKTRUNK); } VehicleInfo[vehicleid][vWeed] -= amount; PlayerInfo[playerid][pWeed] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET weed = %i WHERE id = %i", VehicleInfo[vehicleid][vWeed], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s steals %i grams of weed from the trunk.", GetPlayerRPName(playerid), amount); } else if(strfind(inputtext, "Cocaine") != -1 && (amount = VehicleInfo[vehicleid][vCocaine]/20) > 0) { if(PlayerInfo[playerid][pCocaine] + amount > GetPlayerCapacity(playerid, CAPACITY_COCAINE)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i cocaine. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pCocaine], GetPlayerCapacity(playerid, CAPACITY_COCAINE)); return ShowDialogToPlayer(playerid, DIALOG_CRACKTRUNK); } VehicleInfo[vehicleid][vCocaine] -= amount; PlayerInfo[playerid][pCocaine] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET cocaine = %i WHERE id = %i", VehicleInfo[vehicleid][vCocaine], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s steals %i grams of cocaine from the trunk.", GetPlayerRPName(playerid), amount); } else if(strfind(inputtext, "Meth") != -1 && (amount = VehicleInfo[vehicleid][vMeth]/20) > 0) { if(PlayerInfo[playerid][pMeth] + amount > GetPlayerCapacity(playerid, CAPACITY_METH)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i meth. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMeth], GetPlayerCapacity(playerid, CAPACITY_METH)); return ShowDialogToPlayer(playerid, DIALOG_CRACKTRUNK); } VehicleInfo[vehicleid][vMeth] -= amount; PlayerInfo[playerid][pMeth] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET meth = %i WHERE id = %i", VehicleInfo[vehicleid][vMeth], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s steals %i grams of meth from the trunk.", GetPlayerRPName(playerid), amount); } else if(strfind(inputtext, "Painkillers") != -1 && (amount = VehicleInfo[vehicleid][vPainkillers]/20) > 0) { if(PlayerInfo[playerid][pPainkillers] + amount > GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i painkillers. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pPainkillers], GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS)); return ShowDialogToPlayer(playerid, DIALOG_CRACKTRUNK); } VehicleInfo[vehicleid][vPainkillers] -= amount; PlayerInfo[playerid][pPainkillers] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET painkillers = %i WHERE id = %i", VehicleInfo[vehicleid][vPainkillers], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[playerid][pPainkillers], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s steals %i painkillers from the trunk.", GetPlayerRPName(playerid), amount); } else if(strfind(inputtext, "Materials") != -1 && (amount = VehicleInfo[vehicleid][vMaterials]/20) > 0) { if(PlayerInfo[playerid][pMaterials] + amount > GetPlayerCapacity(playerid, CAPACITY_MATERIALS)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i materials. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMaterials], GetPlayerCapacity(playerid, CAPACITY_MATERIALS)); return ShowDialogToPlayer(playerid, DIALOG_CRACKTRUNK); } VehicleInfo[vehicleid][vMaterials] -= amount; PlayerInfo[playerid][pMaterials] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET materials = %i WHERE id = %i", VehicleInfo[vehicleid][vMaterials], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s steals %i materials from the trunk.", GetPlayerRPName(playerid), amount); } else if(strfind(inputtext, "Cash") != -1 && (amount = VehicleInfo[vehicleid][vCash]/20) > 0) { VehicleInfo[vehicleid][vCash] -= amount; PlayerInfo[playerid][pCash] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET cash = %i WHERE id = %i", VehicleInfo[vehicleid][vCash], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cash = %i WHERE uid = %i", PlayerInfo[playerid][pCash], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s steals %s worth of cash from the trunk.", GetPlayerRPName(playerid), FormatNumber(amount)); } else { for(new i = 0; i < 5; i ++) { if(VehicleInfo[vehicleid][vWeapons][i] != 0 && !strcmp(GetWeaponNameEx(VehicleInfo[vehicleid][vWeapons][i]), inputtext)) { if(PlayerHasWeapon(playerid, VehicleInfo[vehicleid][vWeapons][i])) { SendClientMessage(playerid, COLOR_GREY, "You have this weapon already."); return ShowDialogToPlayer(playerid, DIALOG_CRACKTRUNK); } GivePlayerWeaponEx(playerid, VehicleInfo[vehicleid][vWeapons][i]); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s steals a %s from the trunk.", GetPlayerRPName(playerid), GetWeaponNameEx(VehicleInfo[vehicleid][vWeapons][i])); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET weapon_%i = 0 WHERE id = %i", i + 1, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); VehicleInfo[vehicleid][vWeapons][i] = 0; break; } } } } PlayerInfo[playerid][pCocaineTrunk] = INVALID_PLAYER_ID; } case DIALOG_HOUSEINTERIORS: { if(response) { new houseid = GetNearbyHouseEx(playerid); if(houseid >= 0 && IsHouseOwner(playerid, houseid)) { SetPlayerPos(playerid, houseInteriors[listitem][intX], houseInteriors[listitem][intY], houseInteriors[listitem][intZ]); SetPlayerFacingAngle(playerid, houseInteriors[listitem][intA]); SetPlayerInterior(playerid, houseInteriors[listitem][intID]); SetCameraBehindPlayer(playerid); PlayerInfo[playerid][pPreviewHouse] = houseid; PlayerInfo[playerid][pPreviewType] = listitem; PlayerInfo[playerid][pPreviewTime] = 60; SendClientMessageEx(playerid, COLOR_AQUA, "This {FF6347}%s{33CCFF} interior costs %s. You have 60 seconds to look around and make up your mind.", houseInteriors[listitem][intClass], FormatNumber(houseInteriors[listitem][intPrice])); SendClientMessageEx(playerid, COLOR_AQUA, "Use /confirmupgrade if you wish to upgrade to this interior. Use /cancelupgrade to cancel preview mode."); } } } case DIALOG_LSELEVATOR: { if(!response) return 0; if(FloorRequestedBy[listitem] != INVALID_PLAYER_ID || IsFloorInQueue(listitem)) GameTextForPlayer(playerid, "~r~The floor is already in the queue", 3500, 4); else if(DidPlayerRequestElevator(playerid)) GameTextForPlayer(playerid, "~r~You already requested the elevator", 3500, 4); else CallElevator(playerid, listitem); return 1; } case DIALOG_NEWBWELCOME: { if(response) { new count; foreach(new i : Player) { if(PlayerInfo[i][pHelper] > 0) { count++; } } if(count > 0) { new string[30]; format(string, sizeof(string), "Show me around LS please, I am new."); strcpy(PlayerInfo[playerid][pHelpRequest], string, 128); SendHelperMessage(COLOR_AQUA, "** Help Request: New Player %s (ID:%d) is requesting a helper to show them around. **", GetPlayerRPName(playerid), playerid); PlayerInfo[playerid][pLastRequest] = gettime(); SendClientMessage(playerid, COLOR_GREEN, "Your help request was sent to all helpers. Please wait for a response."); } else { ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FF1AFF}ECRP{FFFFFF} | Failed", "{FFFFFF}Unfortunately there are no members of the {33CCFF}helper team{FFFFFF} online :(.\nYou can also try /newb, This is where most of the community can help you with simple questions such as \"Where is the Bank\".\nYou can also checkout {FF1AFF}ecrp.h0v1n8.nl{FFFFFF} for beginner tutorials.", "Cancel", ""); } } } case DIALOG_USERIMKIT: { if(response) { new vehicleid = GetPlayerVehicleID(playerid), componentid; if((vehicleid) && VehicleHasDoors(vehicleid) && PlayerInfo[playerid][pRimkits] > 0) { if(!IsVehicleOwner(playerid, vehicleid) && PlayerInfo[playerid][pVehicleKeys] != vehicleid && !(VehicleInfo[vehicleid][vGang] >= 0 && PlayerInfo[playerid][pGang] == VehicleInfo[vehicleid][vGang])) { return 1; } if(listitem == 0) { componentid = 1025; } else if(1 <= listitem <= 13) { componentid = (listitem - 1) + 1073; } else if(14 <= listitem <= 16) { componentid = (listitem - 14) + 1096; } VehicleInfo[vehicleid][vMods][CARMODTYPE_WHEELS] = componentid; PlayerInfo[playerid][pRimkits]--; AddVehicleComponent(vehicleid, componentid); SaveVehicleModifications(vehicleid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rimkits = %i WHERE uid = %i", PlayerInfo[playerid][pRimkits], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s installs a set of %s rims on the vehicle.", GetPlayerRPName(playerid), inputtext); } } } case DIALOG_TURFLIST: { if(response) { if(strlen(tsstring) < 5) { SendClientMessage(playerid, COLOR_AQUA, "Please use /showturfs to enable turf bounds"); } else { ShowPlayerDialog(playerid, DIALOG_TURFLIST2, DIALOG_STYLE_MSGBOX, "Turf list", tsstring, "Cancel", ""); } } } case DIALOG_TURFLIST2: { if(response) { SendClientMessage(playerid, COLOR_AQUA, "Please use /showturfs to enable turf bounds"); } } case DIALOG_LOCATE: { if(response) { switch(listitem) { case 0: // JOBS { ShowPlayerDialog(playerid, DIALOG_LOCATELIST1, DIALOG_STYLE_LIST, "GPS - Select Destination", "Pizzaman\nCourier\nFisherman\nBodyguard\nWeapon Dealer\nMechanic\nMiner\nSweeper\nTaxi Driver\nDrug Dealer\nLawyer\nDetective\nThief\nGarbage Man\nFarmer", "Select", "Close"); } case 1: // STORES { ShowPlayerDialog(playerid, DIALOG_LOCATELIST2, DIALOG_STYLE_LIST, "GPS - Select Destination", "24/7\nAmmunation\nClothing Store\nGymnasium\nRestaurant\nAdvertisement Store\nClub\nTool Shop", "Select", "Close"); } case 2: // GENERAL LOCATIONS { ShowPlayerDialog(playerid, DIALOG_LOCATELIST3, DIALOG_STYLE_LIST, "GPS - Select Destination", "DMV\nBank\nCasino\nVIP\nDrug Factory\nMaterials Pickup 1\nHeisenbergs", "Select", "Close"); } case 3: // Find Turfs { new string[34 * MAX_TURFS]; for(new x = 0; x < MAX_TURFS; x++) { if(TurfInfo[x][tExists]) { strcat(string, TurfInfo[x][tName]); strcat(string, "\n"); } } if(strlen(string) > 2) { ShowPlayerDialog(playerid, DIALOG_LOCATETURFS, DIALOG_STYLE_LIST, "GPS - Select Destination", string, "Select", "Close"); } else { ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "GPS - Signal Lost", "Unable to locate any new locations.", "Cancel", ""); } } case 4: // More locations { new string[MAX_LOCATIONS*34]; for(new x = 0; x < MAX_LOCATIONS; x++) { if(LocationInfo[x][locExists]) { strcat(string, LocationInfo[x][locName]); strcat(string, "\n"); } } if(strlen(string) > 2) { ShowPlayerDialog(playerid, DIALOG_LOCATELISTC, DIALOG_STYLE_LIST, "GPS - Select Destination", string, "Select", "Close"); } else { ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "GPS - Signal Lost", "Unable to locate any new locations.", "Cancel", ""); } } } } } case DIALOG_LOCATELIST1: { if(response) { switch(listitem) { case 0: LocateMethod(playerid,"Pizzaman"); case 1: LocateMethod(playerid,"Courier"); case 2: LocateMethod(playerid,"Fisherman"); case 3: LocateMethod(playerid,"Bodyguard"); case 4: LocateMethod(playerid,"WeaponDealer"); case 5: LocateMethod(playerid,"Mechanic"); case 6: LocateMethod(playerid,"Miner"); case 7: LocateMethod(playerid,"Sweeper"); case 8: LocateMethod(playerid,"TaxiDriver"); case 9: LocateMethod(playerid,"DrugDealer"); case 10: LocateMethod(playerid,"Lawyer"); case 11: LocateMethod(playerid,"Detective"); case 12: LocateMethod(playerid,"Thief"); case 13: LocateMethod(playerid,"GarbageMan"); case 14: LocateMethod(playerid,"Farmer"); } } } case DIALOG_LOCATELIST2: { if(response) { switch(listitem) { case 0: LocateMethod(playerid,"24/7"); case 1: LocateMethod(playerid,"Ammunation"); case 2: LocateMethod(playerid,"ClothesShop"); case 3: LocateMethod(playerid,"Gym"); case 4: LocateMethod(playerid,"Restaurant"); case 5: LocateMethod(playerid,"AdAgency"); case 6: LocateMethod(playerid,"Club"); case 7: LocateMethod(playerid,"ToolShop"); } } } case DIALOG_LOCATELIST3: { if(response) { switch(listitem) { case 0: LocateMethod(playerid,"DMV"); case 1: LocateMethod(playerid,"Bank"); /*case 2: LocateMethod(playerid,"Paintball");*/ case 2: LocateMethod(playerid,"Casino"); case 3: LocateMethod(playerid,"VIP"); case 4: LocateMethod(playerid,"Smuggledrugs"); case 5: LocateMethod(playerid,"MatPickup1"); case 6: LocateMethod(playerid,"MatPickup2"); case 7: LocateMethod(playerid,"MatFactory1"); case 8: LocateMethod(playerid,"MatFactory2"); case 9: LocateMethod(playerid,"Heisenbergs"); case 10: LocateMethod(playerid,"AirportDepot"); case 11: LocateMethod(playerid,"MarinaDepot"); } } } case DIALOG_LOCATELISTC: { if(response) { LocateMethod(playerid, inputtext); } } case DIALOG_LOCATETURFS: { if(response) { foreach(new i : Turf) { if(strfind(TurfInfo[i][tName], inputtext) != -1) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, TurfInfo[i][tMinX], TurfInfo[i][tMinY], TurfInfo[i][tHeight], 3.0); SendClientMessageEx(playerid, COLOR_WHITE, "** Checkpoint marked at the location of %s.", TurfInfo[i][tName]); break; } } } } case DIALOG_LOCATEPOINTS: { if(response) { if(PointInfo[listitem][pExists]) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, PointInfo[listitem][pPointX], PointInfo[listitem][pPointY], PointInfo[listitem][pPointZ], 3.0); SendClientMessageEx(playerid, COLOR_WHITE, "** Checkpoint marked at the location of %s.", PointInfo[listitem][pName]); } } } case DIALOG_RULES: { if(response) { switch(listitem) { case 0: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on cheats & unfair advantage", "All types of cheating, hacking, and unfair advantages are prohibited on this server", "Close", ""); case 1: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on exploits", "Any and all exploits, such as QS, CS, NJ, script exploits, etc.\nIS STRICLY PROHIBITED!", "Close", ""); case 2: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on advertisments", "Advertising anything other than in-game entities/items is prohibited", "Close", ""); case 3: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on death-match", "Deathmatching is when you kill another player for an invalid (non-RP) reason.\nThis is strictly prohibited on this server", "Close", ""); case 4: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on spawn-killing", "Spawn-killing is similar to deathmatch, with worse punishments.\nDo not kill anyone that has just spawned!", "Close", ""); case 5: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on revenge-killing", "Killing a player because you got killed by them is not allowed!\nThis rule is expected to be followed during turfs.", "Close", ""); case 6: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on car raming", "Ramming player without a valid in character reason is not allowed\nThis includes car-parking", "Close", ""); case 7: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on heli-blading", "Heli-blading people is not allowed.", "Close", ""); case 8: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on meta-gaming", "Using out of character information for in character purposes is not allowed.", "Close", ""); case 9: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on money-farming", "Money-farming is when you create new accounts to leech spawn money\nThis will always result in a permanant ban.", "Close", ""); case 10: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on lying to admins", "Intentionally lying to an administrator is not allowed.", "Close", ""); case 11: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on robbery", "You can only rob the same player ONCE in 24 hours.\nPlease follow regulations regarding max. robbery, etc (available at ecrp.h0v1n8.nl)", "Close", ""); case 12: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "{FFFF00}Policy on scamming", "Donation scams are prohibited\nPlease follow regulations regarding max. scamming, etc (available at ecrp.h0v1n8.nl)", "Close", ""); case 13: ShowPlayerDialog(playerid, DIALOG_NONE, DIALOG_STYLE_MSGBOX, "Full list of rules", "{FFFFFF}Please visit {FF1AFF}ecrp.h0v1n8.nl{FFFFFF} for a complete list of rules.", "Close", ""); } } } case DIALOG_PAYCHECK: { if(!response) return 1; new szMessage[150]; if(strlen(inputtext) < 1) { format(szMessage, sizeof(szMessage), "You must enter the check code before signing.\n\nCheck code: %d\n\nEnter your check code to receive your paycheck:", PayCheckCode[playerid]); ShowPlayerDialog(playerid, DIALOG_PAYCHECK, DIALOG_STYLE_INPUT, "Sign check", szMessage, "Sign check","Cancel"); return 1; } if(!IsNumeric(inputtext)) { format(szMessage, sizeof(szMessage), "Wrong check code. The check code consists out of numbers only.\n\nCheck code: %d\n\nEnter your check code to receive your paycheck:", PayCheckCode[playerid]); ShowPlayerDialog(playerid, DIALOG_PAYCHECK, DIALOG_STYLE_INPUT, "Sign check", szMessage, "Sign check","Cancel"); return 1; } if(strlen(inputtext) > 6 || (strlen(inputtext) > 0 && strlen(inputtext) < 6)) { format(szMessage, sizeof(szMessage), "Wrong check code. The check code consists out of 6 digits.\n\nCheck code: %d\n\nEnter your check code to receive your paycheck:", PayCheckCode[playerid]); ShowPlayerDialog(playerid, DIALOG_PAYCHECK, DIALOG_STYLE_INPUT, "Sign check", szMessage, "Sign check","Cancel"); return 1; } new code = strval(inputtext); if(code == PayCheckCode[playerid]) { SendPaycheck(playerid); PayCheckCode[playerid] = 0; } else { SendClientMessage(playerid, COLOR_WHITE, "Wrong check code."); } } case DIALOG_CREATEQUIZ: { if(CreateQuiz == 0) { strcpy(quizQuestion, inputtext); CreateQuiz = 1; ShowDialogToPlayer(playerid, DIALOG_CREATEQUIZ); } else if(CreateQuiz == 1) { strcpy(quizAnswer, inputtext); CreateQuiz = -1; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has started a quiz.", GetPlayerRPName(playerid)); SendClientMessageToAllEx(COLOR_RETIRED, "QUIZ: %s (/quiz answer to answer)", quizQuestion); } } case DIALOG_DELETEOBJECT: { if(response) { if(IsValidDynamicObject(PlayerInfo[playerid][pSelected])) { new Text3D:textid = Text3D:Streamer_GetExtraInt(PlayerInfo[playerid][pSelected], E_OBJECT_3DTEXT_ID); if(IsValidDynamic3DTextLabel(textid)) { DestroyDynamic3DTextLabel(textid); } DestroyDynamicObject(PlayerInfo[playerid][pSelected]); /*if(Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_LAND) { Iter_Remove(PlayerInfo[playerid][pSelected], LandObjects); }*/ SendClientMessageEx(playerid, COLOR_AQUA, "You have successfully deleted object id %i.", PlayerInfo[playerid][pSelected]); new Float: x, Float: y, Float: z; GetPlayerPos(playerid, x, y, z); foreach(new i : Player) { if(IsPlayerInRangeOfPoint(i, 100.0, x, y ,z)) { Streamer_UpdateEx(i, x, y, z); } } } else { SendClientMessage(playerid, COLOR_AQUA, "Unable to destroy that object, ERROR #1: Not a valid streamer object."); } } else { SendClientMessageEx(playerid, COLOR_AQUA, "You cancelled deleting object id %i.", PlayerInfo[playerid][pSelected]); } } case DIALOG_ADDSTATION: { if(response) { new name; mysql_format(radioConnectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO radiostations VALUES ('%e', '%e', '%e', '%e')", name, inputtext, PlayerInfo[playerid][pSubgenre], PlayerInfo[playerid][pGenre]); mysql_tquery(radioConnectionID, queryBuffer); PlayerInfo[playerid][pStationEdit] = 0; } } case DIALOG_NONE: { // does nothing } } return 1; } // --------------------------------------- stock PlaySoundForPlayersInRange(soundid, Float:range, Float:x, Float:y, Float:z) { for(new i=0; i MAX_SPLIT_LENGTH) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s %.*s...", GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** ...%s", params[MAX_SPLIT_LENGTH]); } else if(PlayerInfo[playerid][pMaskOn]) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** Stranger %.*s", MAX_SPLIT_LENGTH, params); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s %s", GetPlayerRPName(playerid), params); } return 1; } CMD:do(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /do [describe]"); } if(strlen(params) > MAX_SPLIT_LENGTH) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %.*s...", MAX_SPLIT_LENGTH, params); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** ...%s (( %s ))", params[MAX_SPLIT_LENGTH], GetPlayerRPName(playerid)); } else if(PlayerInfo[playerid][pMaskOn]) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** ...%s (( Stranger ))", params); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s (( %s ))", params, GetPlayerRPName(playerid)); } return 1; } CMD:stats(playerid, params[]) { DisplayStats(playerid); return 1; } CMD:l(playerid, params[]) { return callcmd::low(playerid, params); } CMD:low(playerid, params[]) { new string[144]; if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /(l)ow [text]"); } SetPlayerBubbleText(playerid, 5.0, COLOR_WHITE, "[low]: %s", params); format(string, sizeof(string), "%s says [low]: %s", GetPlayerRPName(playerid), params); if(PlayerInfo[playerid][pMaskOn]) { SetPlayerBubbleText(playerid, 5.0, COLOR_WHITE, "[low]: %s", params); format(string, sizeof(string), "Stranger says [low]: %s", params); SendProximityFadeMessage(playerid, 5.0, string, COLOR_GREY1, COLOR_GREY2, COLOR_GREY3, COLOR_GREY4, COLOR_GREY5); } if(PlayerInfo[playerid][pBugged]) { foreach(new i : Player) { if(GetFactionType(i) == FACTION_FEDERAL) { SendClientMessageEx(i, 0x9ACD3200, "(bug) %s says [low]: %s", GetPlayerRPName(playerid), params); } } } SendProximityFadeMessage(playerid, 5.0, string, COLOR_GREY1, COLOR_GREY2, COLOR_GREY3, COLOR_GREY4, COLOR_GREY5); return 1; } CMD:w(playerid, params[]) { return callcmd::whisper(playerid, params); } CMD:whisper(playerid, params[]) { new targetid, text[128]; if(sscanf(params, "us[128]", targetid, text)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /(w)hisper [playerid] [text]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!IsPlayerInRangeOfPlayer(playerid, targetid, 5.0) && (!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6)) { return SendClientMessage(playerid, COLOR_GREY, "You must be near that player to whisper them."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't whisper to yourself."); } if(PlayerInfo[targetid][pToggleWhisper]) { return SendClientMessage(playerid, COLOR_GREY, "That player has disabled incoming whispers."); } SendClientMessageEx(targetid, COLOR_YELLOW, "** Whisper from %s: %s **", GetPlayerRPName(playerid), text); SendClientMessageEx(playerid, COLOR_YELLOW, "** Whisper to %s: %s **", GetPlayerRPName(targetid), text); if(PlayerInfo[playerid][pBugged]) { foreach(new i : Player) { if(GetFactionType(i) == FACTION_FEDERAL) { SendClientMessageEx(i, 0x9ACD3200, "(bug) %s whispers: %s", GetPlayerRPName(playerid), text); } } } if(PlayerInfo[targetid][pWhisperFrom] == INVALID_PLAYER_ID) { SendClientMessage(targetid, COLOR_WHITE, "** You can use '/rw [message]' to reply to this whisper."); } PlayerInfo[targetid][pWhisperFrom] = playerid; return 1; } CMD:rw(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /rw [text]"); } if(PlayerInfo[playerid][pWhisperFrom] == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't been whispered by anyone since you joined the server."); } if(!IsPlayerInRangeOfPlayer(playerid, PlayerInfo[playerid][pWhisperFrom], 5.0) && (!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6)) { return SendClientMessage(playerid, COLOR_GREY, "You must be near that player to whisper them."); } SendClientMessageEx(PlayerInfo[playerid][pWhisperFrom], COLOR_YELLOW, "** Whisper from %s: %s **", GetPlayerRPName(playerid), params); SendClientMessageEx(playerid, COLOR_YELLOW, "** Whisper to %s: %s **", GetPlayerRPName(PlayerInfo[playerid][pWhisperFrom]), params); return 1; } CMD:lights(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!vehicleid || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You must be driving a vehicle to use this command."); } if(!VehicleHasEngine(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no lights which can be turned on."); } if(!GetVehicleParams(vehicleid, VEHICLE_LIGHTS)) { SetVehicleParams(vehicleid, VEHICLE_LIGHTS, true); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s turns on the headlights of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); } else { SetVehicleParams(vehicleid, VEHICLE_LIGHTS, false); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s turns off the headlights of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); } return 1; } CMD:hood(playerid, params[]) { new vehicleid = GetNearbyVehicle(playerid); if(vehicleid == INVALID_VEHICLE_ID) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any vehicle."); } if(!VehicleHasDoors(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no hood."); } if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command in the passenger seat."); } if(!GetVehicleParams(vehicleid, VEHICLE_BONNET)) { SetVehicleParams(vehicleid, VEHICLE_BONNET, true); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s opens the hood of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); } else { SetVehicleParams(vehicleid, VEHICLE_BONNET, false); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s closes the hood of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); } return 1; } CMD:trunk(playerid, params[]) { return callcmd::boot(playerid, params); } CMD:boot(playerid, params[]) { new vehicleid = GetNearbyVehicle(playerid); if(vehicleid == INVALID_VEHICLE_ID) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any vehicle."); } if(!VehicleHasDoors(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no boot."); } if(GetPlayerState(playerid) == PLAYER_STATE_PASSENGER) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command in the passenger seat."); } if(!GetVehicleParams(vehicleid, VEHICLE_BOOT)) { SetVehicleParams(vehicleid, VEHICLE_BOOT, true); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s opens the boot of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); } else { SetVehicleParams(vehicleid, VEHICLE_BOOT, false); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s closes the boot of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); } return 1; } CMD:registervehicle(playerid, params[]) { new vehid; if((!IsPlayerInRangeOfPoint(playerid, 50.0, 1229.3544, -1311.8627, 796.7859))) { return SendClientMessage(playerid, COLOR_GREY, "You are not the police station."); } if(sscanf(params, "i", vehid)) { return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /registervehicle [vehicleid]"); } if(!VehicleHasEngine(vehid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no license plate, therefore it can't be registered."); } if(PlayerInfo[playerid][pFactionRank] < 2) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to be at least rank 2+ to use this command."); } if(strcmp(VehicleInfo[vehid][vPlate], "None") != 0) { return SendClientMessageEx(playerid, COLOR_GREY, "This vehicle is already registered."); } if(!VehicleInfo[vehid][vOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle isn't owned by any particular person."); } GetUniquePlate(vehid); // GivePlayerCash(playerid, -500); // GameTextForPlayer(playerid, "-$500", 5000, 1); SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_ROYALBLUE, "** HQ: %s has registered a %s with the plate: %s.", GetPlayerRPName(playerid), GetVehicleName(vehid), VehicleInfo[vehid][vPlate]); printf("%s %s has registered a car %s with the plate: %s.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), GetVehicleName(vehid), VehicleInfo[vehid][vPlate]); SendClientMessageEx(playerid, COLOR_GREY3, "Added plates to vehicle id %d", vehid); SendClientMessageEx(playerid, COLOR_GREY3, "Vehicle ID: %d, Plates: %s", vehid, VehicleInfo[vehid][vPlate]); foreach(new i: Player) { if(IsVehicleOwner(i, vehid)) { SendClientMessageEx(i, COLOR_AQUA, "Officer %s has registered your vehicle plate to %s", GetPlayerRPName(playerid), VehicleInfo[vehid][vPlate]); break; } } // SendClientMessageEx(VehicleInfo[vehid][vOwnerID], VehicleInfo[vehid][vOwner], Car Dealership: %s has registered your vehicle plate to $i", GetPlayerNameRP(playerid), GetUniquePlate(vehid)); // someone should do this, i cant find the right code :( - Pedro return 1; // i didnt commented new string so you can check this command HAHAHAHHA whoever are you watching this word, fuck you again!. } CMD:revokeregistration(playerid, params[]) { new vehid; if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if((!IsPlayerInRangeOfPoint(playerid, 50.0, 1229.3544, -1311.8627, 796.7859)) && !(596 <= GetVehicleModel(GetPlayerVehicleID(playerid)) <= 599) && GetVehicleModel(GetPlayerVehicleID(playerid)) != 415 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 490) { return SendClientMessage(playerid, COLOR_GREY, "You are not the police station or in a police car."); } if(sscanf(params, "i", vehid)) { return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /revokeregistration [vehicleid]"); } if(PlayerInfo[playerid][pFactionRank] < 3) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to be at least rank 3+ to use this command."); } SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_ROYALBLUE, "** HQ: %s %s has cancelled the registration of a %s with the plate: %s.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), GetVehicleName(vehid), VehicleInfo[vehid][vPlate]); printf("%s %s has cancelled the registration of car %s with the plate: %s.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), GetVehicleName(vehid), VehicleInfo[vehid][vPlate]); format(VehicleInfo[vehid][vPlate],32, "None"); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET plate = '%e' WHERE id = %i", VehicleInfo[vehid][vPlate], VehicleInfo[vehid][vID]); mysql_tquery(connectionID, queryBuffer); ReloadVehicle(vehid); SetVehicleToRespawn(vehid); return 1; } CMD:resetupgrades(playerid, params[]) { if(strcmp(params, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /resetupgrades [confirm]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "This command resets all of your upgrades and give you back %i upgrade points.", (PlayerInfo[playerid][pLevel] - 1) * 2); return 1; } if(PlayerInfo[playerid][pLevel] == 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't level 2+."); } if(PlayerInfo[playerid][pInventoryUpgrade] == 0 && PlayerInfo[playerid][pTraderUpgrade] == 0 && PlayerInfo[playerid][pAddictUpgrade] == 0 && PlayerInfo[playerid][pAssetUpgrade] == 0 && PlayerInfo[playerid][pLaborUpgrade] == 0 && PlayerInfo[playerid][pSpawnHealth] == 50.0 && PlayerInfo[playerid][pSpawnArmor] == 0.0 && PlayerInfo[playerid][pUpgradePoints] == (PlayerInfo[playerid][pLevel] - 1) * 2) { return SendClientMessage(playerid, COLOR_GREY, "You haven't spent any upgrade points on upgrades. Therefore you can't reset them."); } if(GetPlayerAssetCount(playerid, LIMIT_HOUSES) > 1) { return SendClientMessageEx(playerid, COLOR_GREY, "You own %i/%i houses at the moment. Please sell one of them before using this command.", GetPlayerAssetCount(playerid, LIMIT_HOUSES), GetPlayerAssetLimit(playerid, LIMIT_HOUSES)); } if(GetPlayerAssetCount(playerid, LIMIT_BUSINESSES) > 1) { return SendClientMessageEx(playerid, COLOR_GREY, "You own %i/%i businesses at the moment. Please sell one of them before using this command.", GetPlayerAssetCount(playerid, LIMIT_BUSINESSES), GetPlayerAssetLimit(playerid, LIMIT_BUSINESSES)); } if(GetPlayerAssetCount(playerid, LIMIT_GARAGES) > 1) { return SendClientMessageEx(playerid, COLOR_GREY, "You own %i/%i garages at the moment. Please sell one of them before using this command.", GetPlayerAssetCount(playerid, LIMIT_GARAGES), GetPlayerAssetLimit(playerid, LIMIT_GARAGES)); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM vehicles WHERE ownerid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer, "OnPlayerAttemptResetUpgrades", "i", playerid); return 1; } CMD:upgrades(playerid, params[]) { return callcmd::myupgrades(playerid, params); } CMD:myupgrades(playerid, params[]) { SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_____ %s's upgrades (%i points available) _____", GetPlayerRPName(playerid), PlayerInfo[playerid][pUpgradePoints]); SendClientMessageEx(playerid, COLOR_YELLOW, "[Shealth: %.0f/100]{C8C8C8} You spawn with %.1f health at the hospital after death.", PlayerInfo[playerid][pSpawnHealth], PlayerInfo[playerid][pSpawnHealth]); SendClientMessageEx(playerid, COLOR_YELLOW, "[Sarmor: %.0f/100]{C8C8C8} You spawn with %.1f armor at the hospital after death.", PlayerInfo[playerid][pSpawnArmor], PlayerInfo[playerid][pSpawnArmor]); SendClientMessageEx(playerid, COLOR_YELLOW, "[Inventory: %i/5]{C8C8C8} This upgrade increases the capacity for your items. [/inv]", PlayerInfo[playerid][pInventoryUpgrade]); SendClientMessageEx(playerid, COLOR_YELLOW, "[Trader: %i/3]{C8C8C8} You save an extra %i percent on all items purchased in businesses.", PlayerInfo[playerid][pTraderUpgrade], PlayerInfo[playerid][pTraderUpgrade] * 10); SendClientMessageEx(playerid, COLOR_YELLOW, "[Addict: %i/3]{C8C8C8} You gain an extra %.1f health and armor when using drugs.", PlayerInfo[playerid][pAddictUpgrade], PlayerInfo[playerid][pAddictUpgrade] * 5.0); SendClientMessageEx(playerid, COLOR_YELLOW, "[Asset: %i/4]{C8C8C8} You can own %i houses, %i businesses, %i garages & %i vehicles.", PlayerInfo[playerid][pAssetUpgrade], GetPlayerAssetLimit(playerid, LIMIT_HOUSES), GetPlayerAssetLimit(playerid, LIMIT_BUSINESSES), GetPlayerAssetLimit(playerid, LIMIT_GARAGES), GetPlayerAssetLimit(playerid, LIMIT_VEHICLES)); SendClientMessageEx(playerid, COLOR_YELLOW, "[Labor: %i/5]{C8C8C8} You earn an extra %i percent cash to your paycheck when working.", PlayerInfo[playerid][pLaborUpgrade], PlayerInfo[playerid][pLaborUpgrade] * 2); return 1; } CMD:getlevel(playerid, params[]) { new exp = (PlayerInfo[playerid][pLevel] * 4), cost = (PlayerInfo[playerid][pLevel] + 1) * 0, string[64]; if(PlayerInfo[playerid][pEXP] < exp) { return SendClientMessageEx(playerid, COLOR_GREY, "You need %i more respect points in order to level up.", exp - PlayerInfo[playerid][pEXP]); } if(PlayerInfo[playerid][pCash] < cost) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to have at least %s on hand to buy your next level.", FormatNumber(cost)); } if(PlayerInfo[playerid][pPassport]) { return SendClientMessage(playerid, COLOR_GREY, "You have an active passport. You can't level up at the moment."); } PlayerInfo[playerid][pEXP] -= exp; PlayerInfo[playerid][pCash] -= cost; PlayerInfo[playerid][pLevel]++; PlayerInfo[playerid][pUpgradePoints] += 2; if(PlayerInfo[playerid][pLevel] == 3 && PlayerInfo[playerid][pReferralUID] > 0) { ReferralCheck(playerid); } if(PlayerInfo[playerid][pLevel] >= 5) { AwardAchievement(playerid, "Five stars"); } if(PlayerInfo[playerid][pLevel] >= 10) { AwardAchievement(playerid, "Top tier"); } format(string, sizeof(string), "~g~Level Up~n~~w~You are now level %i", PlayerInfo[playerid][pLevel]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET exp = exp - %i, cash = cash - %i, level = level + 1, upgradepoints = upgradepoints + 2 WHERE uid = %i", exp, cost, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You have moved up to level %i. This costed you %s.", PlayerInfo[playerid][pLevel], FormatNumber(cost)); SendClientMessageEx(playerid, COLOR_GREEN, "You now have %i upgrade points. Use /upgrade to learn more.", PlayerInfo[playerid][pUpgradePoints]); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); return 1; } CMD:engine(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), Float:health; if(!vehicleid || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_GREY, "You must be driving a vehicle to use this command."); if(!VehicleHasEngine(vehicleid)) return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no engine which can be turned on."); if(vehicleFuel[vehicleid] <= 0) return SendClientMessage(playerid, COLOR_GREY, "There is no fuel left in this vehicle."); if(PlayerInfo[playerid][pRefuel] == vehicleid) return SendClientMessage(playerid, COLOR_GREY, "You can't do this right now"); if(GetPlayerDealerVehID(playerid) != -1) return SendClientMessage(playerid, COLOR_GREY, "You don't have the keys of this vehicle."); if(!GetVehicleParams(vehicleid, VEHICLE_ENGINE)) if(!vehicleid || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You must be driving a vehicle to use this command."); } if(!VehicleHasEngine(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no engine which can be turned on."); } if(vehicleFuel[vehicleid] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "There is no fuel left in this vehicle."); } if(!GetVehicleParams(vehicleid, VEHICLE_ENGINE)) { if(PlayerInfo[playerid][pEngine]) { return SendClientMessage(playerid, COLOR_GREY, "You are already attempting to turn your engine on."); } GetVehicleHealth(vehicleid, health); if(health <= 300.0) { return SendClientMessage(playerid, COLOR_GREY , "The engine is totalled and cannot be started until it's repaired."); } PlayerInfo[playerid][pEngine] = 1; SetTimerEx("SetVehicleEngine", 1010, 0, "dd", vehicleid, playerid); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s Turns the key into the ignition, attempting to start the engine.", GetPlayerRPName(playerid)); SendClientMessage(playerid,COLOR_GREY,"The engine is starting.."); } else { SetVehicleParams(vehicleid, VEHICLE_ENGINE, false); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s Turns the key into the ignition, Turning the engine OFF", GetPlayerRPName(playerid)); SendClientMessage(playerid,COLOR_GREY,"The engine is now OFF"); } return 1; } CMD:createspeed(playerid, params[]) { static Float:limit, Float:range; if (sscanf(params, "ff", limit, range)) return SendClientMessage(playerid, COLOR_GREY, "/createspeed [speed limit] [range] (default range: 30)"); if (limit < 5.0 || limit > 150.0) return SendClientMessage(playerid, COLOR_GREY, "The speed limit can't be below 5 or above 150."); if (range < 5.0 || range > 50.0) return SendClientMessage(playerid, COLOR_GREY, "The range can't be below 5 or above 50."); if (Speed_Nearest(playerid) != -1) return SendClientMessage(playerid, COLOR_GREY, "You can't do this in range another speed camera."); new id = Speed_Create(playerid, limit, range); if (id == -1) return SendClientMessage(playerid, COLOR_GREY, "The server has reached the limit for speed cameras."); SendClientMessageEx(playerid, COLOR_GREY, "You have created speed camera ID: %d.", id); return 1; } CMD:destroyspeed(playerid, params[]) { static id = 0; if (PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); if (sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_GREY, "/destroyspeed [speed id]"); if ((id < 0 || id >= MAX_SPEED_CAMERAS) || !SpeedData[id][speedExists]) return SendClientMessage(playerid, COLOR_GREY, "You have specified an invalid speed camera ID."); Speed_Delete(id); SendClientMessageEx(playerid, COLOR_GREY, "You have successfully destroyed speed camera ID: %d.", id); return 1; } CMD:creategangtag(playerid, params[]) { static id = -1, Float:x, Float:y, Float:z, Float:angle; if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any gang at the moment."); } if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can only create graffiti points outside interiors."); } if(PlayerInfo[playerid][pSpraycans] < 0) { return SendClientMessage(playerid, COLOR_GREY, "You don't have any spraycans"); } GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, angle); id = Graffiti_Create(x, y, z, angle); if(id == -1) { return SendClientMessage(playerid, COLOR_GREY, "The server has reached the limit for graffiti points."); } EditDynamicObject(playerid, GraffitiData[id][graffitiObject]); PlayerInfo[playerid][pEditGraffiti] = id; SendClientMessageEx(playerid, COLOR_GREY, "You have successfully created graffiti ID: %d.", id); return 1; } CMD:destroygangtag(playerid, params[]) { static id = 0; if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any gang at the moment."); } if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(sscanf(params, "d", id)) { return SendClientMessage(playerid, COLOR_GREY, "/destroygraffiti [graffiti id]"); } if((id < 0 || id >= MAX_GRAFFITI_POINTS) || !GraffitiData[id][graffitiExists]) { return SendClientMessage(playerid, COLOR_GREY, "You have specified an invalid graffiti ID."); } Graffiti_Delete(id); SendClientMessageEx(playerid, COLOR_GREY, "You have successfully destroyed graffiti ID: %d.", id); return 1; } CMD:gspray(playerid, params[]) { new id = Graffiti_Nearest(playerid); if (id == -1) return SendClientMessage(playerid, COLOR_GREY, "You are not near any graffiti point."); if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any gang at the moment."); } if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You must be at least rank 5 to tag a wall"); } if(PlayerInfo[playerid][pSpraycans] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough spraycans for this."); } ShowPlayerDialog(playerid, DIALOG_GRAFFITICOLOR, DIALOG_STYLE_LIST, "Select Color", "{FFFFFF}White\n{FF0000}Red\n{FFFF00}Yellow\n{33CC33}Green\n{33CCFF}Light Blue\n{FFA500}Orange\n{1394BF}Dark Blue\n{000000}Black", "Select", "Cancel"); return 1; } CMD:buyrack(playerid, params[]) { new houseid = GetInsideHouse(playerid); if (houseid == -1 || !HasFurniturePerms(playerid, houseid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in range of your house interior."); if (isnull(params) || (!isnull(params) && strcmp(params, "confirm", true) != 0)) return SendClientMessage(playerid, COLOR_GREY, "/buyrack [confirm] ($1,000 fee)"); if (Rack_Count(playerid) >= 4) return SendClientMessage(playerid, COLOR_GREY, "Your house can only have up to 4 weapon racks."); if (Rack_Nearest(playerid) != -1) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command near another rack."); if (GetPlayerCash(playerid) < 1000) return SendClientMessage(playerid, COLOR_GREY, "You have insufficient funds for the purchase."); new id = Rack_Create(playerid, houseid); if (id == -1) return SendClientMessage(playerid, COLOR_GREY, "The server has reached the limit for weapon racks."); ResetEditing(playerid); PlayerInfo[playerid][pEditRack] = id; EditDynamicObject(playerid, RackData[id][rackObjects][4]); GivePlayerCash(playerid, -1000); SendClientMessage(playerid, COLOR_GREY, "You have purchased a weapon rack for $1,000."); return 1; } CMD:gunrack(playerid, params[]) { new id = Rack_Nearest(playerid); if (id == -1) return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any weapon rack."); Rack_ShowGuns(playerid, id); return 1; } CMD:deleterack(playerid, params[]) { new id = -1, houseid = GetInsideHouse(playerid); if (houseid == -1 || !HasFurniturePerms(playerid, houseid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in range of your house interior."); if ((id = Rack_Nearest(playerid)) == -1) return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any weapon rack."); Rack_Delete(id); SendClientMessage(playerid, COLOR_GREY, "You have deleted the weapon rack from your house."); return 1; } CMD:createrack(playerid, params[]) { static id = -1; if (PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); id = Rack_Create(playerid, -1); if (id == -1) return SendClientMessage(playerid, COLOR_GREY, "The server has reached the limit for weapon racks."); ResetEditing(playerid); PlayerInfo[playerid][pEditRack] = id; EditDynamicObject(playerid, RackData[id][rackObjects][4]); SendClientMessageEx(playerid, COLOR_GREY, "You have successfully created rack ID: %d.", id); return 1; } CMD:editrack(playerid, params[]) { static id = 0; if (PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); if (sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_GREY, "/editrack [rack id]"); if ((id < 0 || id >= MAX_WEAPON_RACKS) || !RackData[id][rackExists]) return SendClientMessage(playerid, COLOR_GREY, "You have specified an invalid rack ID."); ResetEditing(playerid); PlayerInfo[playerid][pEditRack] = id; EditDynamicObject(playerid, RackData[id][rackObjects][4]); SendClientMessageEx(playerid, COLOR_GREY, "You are now editing weapon rack ID: %d.", id); return 1; } CMD:destroyrack(playerid, params[]) { static id = 0; if (PlayerInfo[playerid][pAdmin] < 5) return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); if (sscanf(params, "d", id)) return SendClientMessage(playerid, COLOR_GREY, "/destroyrack [rack id]"); if ((id < 0 || id >= MAX_WEAPON_RACKS) || !RackData[id][rackExists]) return SendClientMessage(playerid, COLOR_GREY, "You have specified an invalid rack ID."); Rack_Delete(id); SendClientMessageEx(playerid, COLOR_GREY, "You have successfully destroyed weapon rack ID: %d.", id); return 1; } /* CMD:help(playerid, params[]) { SendClientMessage(playerid, COLOR_NAVYBLUE, "[EC:RP Commands] {C8C8C8}/stats, /buylevel, /b, /g, /me, /do, /(o)oc, /(s)hout, /(l)ow, /(w)hisper, /(n)ewbie."); SendClientMessage(playerid, COLOR_NAVYBLUE, "[EC:RP Commands] {C8C8C8}/pay, /id, /time, /report, /upgrade, /charity, /stopmusic, /joinevent, /quitevent."); SendClientMessage(playerid, COLOR_NAVYBLUE, "[EC:RP Commands] {C8C8C8}/dice, /flipcoin, /accent, /helpers, /requesthelp, /accept, /activity, /skill, /quitjob."); SendClientMessage(playerid, COLOR_NAVYBLUE, "[EC:RP Commands] {C8C8C8}/give, /sell, /toggle, /cancelcp, /afk, /(ad)vertise, /buy, /refuel, /call, /sms."); SendClientMessage(playerid, COLOR_NAVYBLUE, "[EC:RP Commands] {C8C8C8}/clothing, /gps, /frisk, /contract, /number, /boombox, /switchspeedo, /stuck."); SendClientMessage(playerid, COLOR_NAVYBLUE, "[EC:RP Commands] {C8C8C8}/shakehand, /dropgun, /grabgun, /usecookies, /usecigar, /usedrug, /showid."); SendClientMessage(playerid, COLOR_NAVYBLUE, "[EC:RP Commands] {C8C8C8}/(inv)entory, /guninv, /changename, /drop, /eject, /dicebet, /gangs, /factions."); SendClientMessage(playerid, COLOR_NAVYBLUE, "[EC:RP Commands] {C8C8C8}/calculate, /serverstats, /resetupgrades, /turfs, /lands, /watch, /gps, /fixvw."); SendClientMessage(playerid, COLOR_NAVYBLUE, "[EC:RP Commands] {C8C8C8}/myupgrades, /unmute, /breakin, /achievements, /buyinsurance, /tie, /untie."); SendClientMessage(playerid, COLOR_NAVYBLUE, "[EC:RP Commands] {C8C8C8}/househelp, /garagehelp, /bizhelp, /jobhelp, /animhelp, /vehiclehelp, /viphelp."); SendClientMessage(playerid, COLOR_NAVYBLUE, "[EC:RP Commands] {C8C8C8}/bankhelp, /factionhelp, /ganghelp, /landhelp, /helperhelp."); if(PlayerInfo[playerid][pFactionMod]) { SendClientMessage(playerid, COLOR_LIGHTRED, "[Faction Mod]{C8C8C8} /createfaction, /editfaction, /setfaction, /purgefaction, /createlocker, /movelocker, /removelocker."); } if(PlayerInfo[playerid][pGangMod]) { SendClientMessage(playerid, COLOR_LIGHTRED, "[Gang Mod]{C8C8C8} /creategang, /editgang, /removegang, /gangstrike, /setgang, /nearest."); SendClientMessage(playerid, COLOR_LIGHTRED, "[Gang Mod]{C8C8C8} /createpoint, /editpoint, /removepoint, /createturf, /editturf, /removeturf."); } if(PlayerInfo[playerid][pBanAppealer]) { SendClientMessage(playerid, COLOR_LIGHTRED, "[Ban Appealer]{C8C8C8} /banip, /baninfo, /banhistory, /unbanip, /unban."); } if(PlayerInfo[playerid][pDeveloper]) { SendClientMessage(playerid, COLOR_LIGHTRED, "[Developer]{C8C8C8} /a, /e, /ha, /ooc, /admins, /gmx, /changelist, /setmotd, /fixplayerid, /showrcon."); } if(PlayerInfo[playerid][pAdmin] > 0) { SendClientMessage(playerid, COLOR_LIGHTRED, "[Admin Commands]{C8C8C8} /a, /adminhelp."); } return 1; } */ CMD:help(playerid, params[]) { new string[2048]; format(string, sizeof(string), "{7514F6}General Commands: {FFFFFF}/stats, /buylevel, /b, /g, /me, /do, /(o)oc, /(s)hout, /(l)ow, /(w)hisper, /(n)ewbie.\n{089DCE}General Commands: {FFFFFF}/pay, /id, /time, /report, /upgrade, /charity, /stopmusic, /joinevent, /quitevent.\n{7514F6}General Commands: {FFFFFF}/dice, /flipcoin, /accent, /helpers, /requesthelp, /accept, /activity, /skill, /quitjob.\n{089DCE}General Commands: {FFFFFF}/give, /sell, /toggle, /cancelcp, /afk, /(ad)vertise, /buy, /refuel, /call, /sms."); strcat(string, "\n{FFFF00}General Commands: {FFFFFF}/clothing, /gps, /frisk, /contract, /number, /boombox, /switchspeedo, /stuck."); strcat(string, "\n{7514F6}General Commands: {FFFFFF}/shakehand, /dropgun, /grabgun, /usecookies, /usecigar, /usedrug, /showid.\n{089DCE}General Commands: {FFFFFF}/(inv)entory, /guninv, /changename, /drop, /eject, /dicebet, /gangs, /factions.\n{7514F6}General Commands: {FFFFFF}/calculate, /serverstats, /resetupgrades, /turfs, /lands, /watch, /gps, /fixvw.\n{089DCE}General Commands: {FFFFFF}/myupgrades, /unmute, /lockpick, /achievements, /buyinsurance, /tie, /untie."); strcat(string, "\n{FFFF00}General Commands: {FFFFFF}/firstaid, /scanner, /bodykit, /rimkit, /buylock."); strcat(string, "\n{089DCE}General Commands: {FFFFFF}/househelp, /garagehelp, /bizhelp, /jobhelp, /animhelp, /vehiclehelp, /viphelp.\n{7514F6}General Commands: {FFFFFF}/bankhelp, /factionhelp, /ganghelp, /landhelp, /helperhelp."); if(PlayerInfo[playerid][pHelperManager]) { strcat(string, "\n{FF6347}Public Relations Commands:{FFFFFF} /(o)makehelper, /setmotd (helper), /olisthelpers."); } if(PlayerInfo[playerid][pFactionMod]) { strcat(string, "\n{FF6347}Faction Mod Commands:{FFFFFF} /createfaction, /editfaction, /switchfaction, /purgefaction, /createlocker, /movelocker, /removelocker."); } if(PlayerInfo[playerid][pGangMod]) { strcat(string, "\n{FF6347}Gang Mod Commands:{FFFFFF} /creategang, /editgang, /removegang, /gangstrike, /setgang, /nearest, /caplimit, /setcooldown."); strcat(string, "\n{FF6347}Gang Mod Commands:{FFFFFF} /createpoint, /editpoint, /removepoint, /createturf, /editturf, /removeturf."); } if(PlayerInfo[playerid][pGraphic]) { strcat(string, "\n{FFFF00}Multimedia:{FFFFFF} /makedesigner (/md), /graphicchat (/gc, /mm)"); } if(PlayerInfo[playerid][pGameAffairs]) { strcat(string, "\n{FF6347}Game Affairs Commands:{FFFFFF} /createfaction, /editfaction, /switchfaction, /purgefaction, /createlocker, /movelocker, /removelocker."); strcat(string, "\n{FF6347}Game Affairs Commands:{FFFFFF} /creategang, /editgang, /removegang, /gangstrike, /setgang, /nearest, /caplimit, /setcooldown."); strcat(string, "\n{FF6347}Game Affairs Commands:{FFFFFF} /createpoint, /editpoint, /removepoint, /createturf, /editturf, /removeturf."); } if(PlayerInfo[playerid][pBanAppealer]) { strcat(string, "\n{FF6347}Ban Appealer Commands:{FFFFFF} /banip, /baninfo, /banhistory, /unbanip, /unban."); } if(PlayerInfo[playerid][pDeveloper]) { strcat(string, "\n{FF6347}Developer Commands:{FFFFFF} /changelist, /gmx, /renamecmd, /createalias"); } if(PlayerInfo[playerid][pDynamicAdmin]) { strcat(string, "\n{FF6347}Dynamic Admin Commands:{FFFFFF} /dynamichelp, /setvip, /setstat."); } if(PlayerInfo[playerid][pAdminPersonnel]) { strcat(string, "\n{FF6347}Admin Personnel Commands:{FFFFFF} /setstaff, /oadmins, /makeadmin, /makeformeradmin, /forceaduty."); } if(PlayerInfo[playerid][pHumanResources]) { strcat(string, "\n{FF6347}Human Resources Commands:{FFFFFF} /banhistory, /oadmins, /ocheck."); } if(PlayerInfo[playerid][pAdmin] > 0) { strcat(string, "\n{FF6347}Administrative Commands:{FFFFFF} /a, /adminhelp."); } ShowPlayerDialog(playerid, DIALOG_HELP, DIALOG_STYLE_MSGBOX, "{FFFFFF}Current commands on {FF1AFF}Emerald City Roleplay", string, "Ok",""); return 1; } CMD:jobhelp(playerid, params[]) { if(PlayerInfo[playerid][pJob] == JOB_NONE && PlayerInfo[playerid][pSecondJob] == JOB_NONE) { return SendClientMessage(playerid, COLOR_GREY, "You have no job and therefore no job commands to view."); } SendClientMessage(playerid, COLOR_NAVYBLUE, "__________________ Job Help __________________"); SendClientMessage(playerid, COLOR_WHITE, "*** JOB HELP *** type a command for more information."); switch(PlayerInfo[playerid][pJob]) { //case JOB_NONE: SendClientMessage(playerid, COLOR_GREY, "You have no job and therefore no job commands to view."); case JOB_PIZZAMAN: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /getpizza, /cancelcp."); case JOB_COURIER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /load, /deliver, /cancelcp."); case JOB_FISHERMAN: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /fish, /myfish, /sellfish."); case JOB_BODYGUARD: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /sellvest, /frisk."); case JOB_WEAPONDEALER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /smugglemats, /sellgun."); case JOB_MECHANIC: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /buycomps, /repair, /refill, /nos, /hyd, /takecall."); case JOB_MINER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /mine, /cancelcp."); case JOB_SWEEPER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /startsweeping, /stopsweeping."); case JOB_TAXIDRIVER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /setfare, /takecall."); case JOB_DRUGDEALER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /buydrug, /planthelp, /cookmeth, /smuggledrugs."); case JOB_LAWYER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /defend, /free, /wanted."); case JOB_DETECTIVE: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /find."); case JOB_THIEF: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /cracktrunk, /dropcar, /carvalue."); case JOB_GARBAGEMAN: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /garbage"); case JOB_FARMER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /harvest"); } if(PlayerInfo[playerid][pSecondJob] != JOB_NONE) { switch(PlayerInfo[playerid][pSecondJob]) { //case JOB_NONE: SendClientMessage(playerid, COLOR_GREY, "You have no job and therefore no job commands to view."); case JOB_PIZZAMAN: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /getpizza."); case JOB_COURIER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /load, /deliver."); case JOB_FISHERMAN: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /fish, /myfish, /sellfish."); case JOB_BODYGUARD: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /sellvest, /frisk."); case JOB_WEAPONDEALER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /smugglemats, /sellgun."); case JOB_MECHANIC: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /buycomps, /repair, /refill, /nos, /hyd."); case JOB_MINER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /mine."); case JOB_SWEEPER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /startsweeping, /stopsweeping."); case JOB_TAXIDRIVER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /setfare."); case JOB_DRUGDEALER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /buydrug, /planthelp, /cookmeth, /smuggledrugs."); case JOB_LAWYER: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /defend, /free, /wanted."); case JOB_DETECTIVE: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /find."); case JOB_GARBAGEMAN: SendClientMessage(playerid, COLOR_GREY, "*** JOB *** /garbage"); } } return 1; } CMD:fixcar(playerid, params[]) { if(!IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't fix a vehicle if you're not sitting in one."); } if(!IsPlayerInRangeOfPoint(playerid, 8.0, -100.8865,1109.4929,19.7422)) { return SendClientMessage(playerid, COLOR_GREY, "You are not near the repair range."); } if(PlayerInfo[playerid][pCash] < 750) { return SendClientMessage(playerid, COLOR_GREY, "You need $750 to repair your vehicle."); } GivePlayerCash(playerid, -750); RepairVehicle(GetPlayerVehicleID(playerid)); SendClientMessage(playerid, COLOR_YELLOW, "You've paid $750 to repair your car."); return 1; } CMD:vehiclehelp(playerid, params[]) { SendClientMessage(playerid, COLOR_NAVYBLUE, "________________ Vehicle Help ________________"); SendClientMessage(playerid, COLOR_WHITE, "*** VEHICLE HELP *** type a command for more information."); SendClientMessage(playerid, COLOR_GREY, "*** VEHICLE *** /lights /hood /boot /buyvehicle /carstorage /park /lock /findcar"); SendClientMessage(playerid, COLOR_GREY, "*** VEHICLE *** /vstash /neon /unmod /colorcar /paintcar /upgradevehicle /sellcar /sellmyvehicle"); SendClientMessage(playerid, COLOR_GREY, "*** VEHICLE *** /givekeys /takekeys /setradio /paytickets /carinfo /gascan /lockpick"); return 1; } CMD:bankhelp(playerid, params[]) { SendClientMessage(playerid, COLOR_NAVYBLUE, "__________________ Banking Help __________________"); SendClientMessage(playerid, COLOR_WHITE, "*** BANKING HELP *** type a command for more information."); SendClientMessage(playerid, COLOR_GREY, "*** BANKING *** /withdraw /deposit /wiretransfer /balance /robbank /robinvite /bombvault /robbers"); return 1; } CMD:viphelp(playerid, params[]) { if(!PlayerInfo[playerid][pVIPPackage]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you don't have a VIP subscription."); } SendClientMessage(playerid, COLOR_NAVYBLUE, "__________________ VIP Help __________________"); SendClientMessage(playerid, COLOR_WHITE, "*** VIP HELP *** type a command for more information."); SendClientMessage(playerid, COLOR_GREY, "*** VIP *** /(v)ip /vipinfo /viptag /vipcolor /vipinvite /vipnumber /vipmusic"); if(PlayerInfo[playerid][pVIPPackage] == 3) { SendClientMessage(playerid, COLOR_GREY, "*** VIP *** /repair /nos /hyd"); } return 1; } CMD:fmembers(playerid, params[]) { if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not apart of any faction."); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_____________ Members Online _____________"); new string[128], color = FactionInfo[PlayerInfo[playerid][pFaction]][fColor]; foreach(new i : Player) { if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && !PlayerInfo[i][pAdminHide]) { format(string, sizeof(string), "(ID: %i) %s {%06x}%s{FFFFFF}", i, FactionRanks[PlayerInfo[i][pFaction]][PlayerInfo[i][pFactionRank]], color >>> 8, GetPlayerRPName(i)); if(PlayerInfo[i][pDivision] >= 0) { format(string, sizeof(string), "%s | Division: %s", string, FactionDivisions[PlayerInfo[i][pFaction]][PlayerInfo[i][pDivision]]); } if(PlayerInfo[i][pFactionLeader]) { format(string, sizeof(string), "%s | {06FF00}Leader{FFFFFF}", string); } if(FactionInfo[PlayerInfo[i][pFaction]][fType] == FACTION_MEDIC) { SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), "| Total Patients: %i | Total Fires: %i", string, PlayerInfo[i][pTotalPatients], PlayerInfo[i][pTotalFires]); } format(string, sizeof(string), "%s | Location: %s", string, GetPlayerZoneName(i)); if(PlayerInfo[i][pAFK]) { format(string, sizeof(string), "%s | {FFA500}AFK{FFFFFF} (%d secs)", string, PlayerInfo[i][pAFKTime]); } SendClientMessage(playerid, COLOR_WHITE, string); } } return 1; } CMD:gmembers(playerid, params[]) { if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of a gang at the moment."); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_____________ Members Online _____________"); new string[128], color = GangInfo[PlayerInfo[playerid][pGang]][gColor]; foreach(new i : Player) { if(PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && !PlayerInfo[i][pAdminHide]) { format(string, sizeof(string), "(%i) %s {%06x}%s{FFFFFF}", PlayerInfo[i][pGangRank], GangRanks[PlayerInfo[i][pGang]][PlayerInfo[i][pGangRank]], color >>> 8, GetPlayerRPName(i)); if(PlayerInfo[i][pCrew] >= 0) { format(string, sizeof(string), "%s | Crew: %s", string, GangCrews[PlayerInfo[i][pGang]][PlayerInfo[i][pCrew]]); } format(string, sizeof(string), "%s | Location: %s", string, GetPlayerZoneName(i)); if(PlayerInfo[i][pAFK]) { format(string, sizeof(string), "%s | {FFA500}AFK{FFFFFF} (%d secs)", string, PlayerInfo[i][pAFKTime]); } SendClientMessage(playerid, COLOR_WHITE, string); } } return 1; } CMD:members(playerid, params[]) { if(PlayerInfo[playerid][pGang] != -1) { callcmd::gmembers(playerid, params); } if(PlayerInfo[playerid][pFaction] != -1) { callcmd::fmembers(playerid, params); } return 1; } /* wtf is this crap CMD:fmembers(playerid, params[]) { if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not apart of any faction."); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ Members Online _____"); foreach(new i : Player) { if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction]) { if(FactionInfo[PlayerInfo[i][pFaction]][fType] == FACTION_MEDIC) { if(PlayerInfo[i][pDivision] == -1) { if(PlayerInfo[i][pFactionLeader]) SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s %s - (Total Patients: %i) - (Total Fires: %i) {00AA00}(Leaderflags)", i, FactionRanks[PlayerInfo[i][pFaction]][PlayerInfo[i][pFactionRank]], GetPlayerRPName(i), PlayerInfo[i][pTotalPatients], PlayerInfo[i][pTotalFires]); else SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s %s - (Total Patients: %i) - (Total Fires: %i)", i, FactionRanks[PlayerInfo[i][pFaction]][PlayerInfo[i][pFactionRank]], GetPlayerRPName(i), PlayerInfo[i][pTotalPatients], PlayerInfo[i][pTotalFires]); } else { if(PlayerInfo[i][pFactionLeader]) SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) [%s] %s %s - (Total Patients: %i) - (Total Fires: %i) {00AA00}(Leaderflags)", i, FactionDivisions[PlayerInfo[i][pFaction]][PlayerInfo[i][pDivision]], FactionRanks[PlayerInfo[i][pFaction]][PlayerInfo[i][pFactionRank]], GetPlayerRPName(i), PlayerInfo[i][pTotalPatients], PlayerInfo[i][pTotalFires]); else SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) [%s] %s %s - (Total Patients: %i) - (Total Fires: %i)", i, FactionDivisions[PlayerInfo[i][pFaction]][PlayerInfo[i][pDivision]], FactionRanks[PlayerInfo[i][pFaction]][PlayerInfo[i][pFactionRank]], GetPlayerRPName(i), PlayerInfo[i][pTotalPatients], PlayerInfo[i][pTotalFires]); } } else { if(PlayerInfo[i][pDivision] == -1) { if(PlayerInfo[i][pFactionLeader]) SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s %s {00AA00}(Leaderflags)", i, FactionRanks[PlayerInfo[i][pFaction]][PlayerInfo[i][pFactionRank]], GetPlayerRPName(i)); else SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s %s", i, FactionRanks[PlayerInfo[i][pFaction]][PlayerInfo[i][pFactionRank]], GetPlayerRPName(i)); } else { if(PlayerInfo[i][pFactionLeader]) SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) [%s] %s %s {00AA00}(Leaderflags)", i, FactionDivisions[PlayerInfo[i][pFaction]][PlayerInfo[i][pDivision]], FactionRanks[PlayerInfo[i][pFaction]][PlayerInfo[i][pFactionRank]], GetPlayerRPName(i)); else SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) [%s] %s %s", i, FactionDivisions[PlayerInfo[i][pFaction]][PlayerInfo[i][pDivision]], FactionRanks[PlayerInfo[i][pFaction]][PlayerInfo[i][pFactionRank]], GetPlayerRPName(i)); } } } } return 1; }*/ CMD:factionhelp(playerid, params[]) { if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not apart of any faction."); } SendClientMessage(playerid, COLOR_GREEN, "_______________________________________"); SendClientMessage(playerid, COLOR_WHITE, "*** FACTION HELP *** type a command for more information."); SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /fc /d /(r)adio /div /faction /division /locker /showbadge /(m)egaphone"); switch(FactionInfo[PlayerInfo[playerid][pFaction]][fType]) { case FACTION_POLICE, FACTION_FEDERAL, FACTION_ARMY: { SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /gate /door /cell /tazer /cuff /uncuff /drag /detain /charge /arrest"); SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /wanted /frisk /take /ticket /gov /ram /deploy /undeploy /undeployall /backup"); SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /mdc /clearwanted /siren /badge /vticket /vfrisk /vtake /seizeplant /mir"); if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == FACTION_FEDERAL) SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /listcallers /trackcall /cells /passport /callsign /bug /listbugs /tog bugged"); else SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /listcallers /trackcall /cells /claim /callsign"); } case FACTION_MEDIC: { SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /heal /drag /stretcher /deliverpt /getpt /listpt /injuries /deploy /undeploy /undeployall"); SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /badge /gov /backup /listcallers /trackcall /callsign"); } case FACTION_NEWS: { SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /news /live /endlive /liveban /badge /addeposit /adwithdraw"); } case FACTION_GOVERNMENT: { SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /gov /settax /factionpay /tazer /cuff /uncuff /detain /taxdeposit /taxwithdraw"); SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /backup /badge"); } case FACTION_HITMAN: { SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /contracts /takehit /profile /passport /plantbomb /pickupbomb /detonate"); SendClientMessage(playerid, COLOR_GREY, "*** FACTION *** /hfind /noknife"); } } return 1; } CMD:ganghelp(playerid, params[]) { if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a gang member."); } SendClientMessage(playerid, COLOR_GREEN, "_______________________________________"); SendClientMessage(playerid, COLOR_WHITE, "*** GANG HELP *** type a command for more information."); SendClientMessage(playerid, COLOR_GREY, "*** GANG *** /f /gang /gstash /gbackup /bandana /capture /claim /reclaim /turfinfo /points"); SendClientMessage(playerid, COLOR_GREY, "*** GANG *** /gbuyvehicle /gpark /gfindcar /grespawncars /gsellcar /gunmod /lock, /endalliance, /gspray"); SendClientMessage(playerid, COLOR_GREY, "*** CREW *** /managecrew /crew"); return 1; } CMD:landhelp(playerid, params[]) { SendClientMessage(playerid, COLOR_GREEN, "_______________________________________"); SendClientMessage(playerid, COLOR_WHITE, "*** LAND HELP *** type a command for more information."); SendClientMessage(playerid, COLOR_GREY, "*** LAND *** /buyland /lock /door /landinfo /land /sellmyland /sellland /droplandkeys"); SendClientMessage(playerid, COLOR_GREY, "*** LAND *** '/toggle lands' to show or hide lands on your mini-map."); return 1; } CMD:planthelp(playerid, params[]) { SendClientMessage(playerid, COLOR_GREEN, "_______________________________________"); SendClientMessage(playerid, COLOR_WHITE, "*** PLANT HELP *** type a command for more information."); SendClientMessage(playerid, COLOR_GREY, "*** PLANT *** /plantweed /plantinfo /pickplant /seizeplant"); return 1; } CMD:o(playerid, params[]) { return callcmd::ooc(playerid, params); } CMD:ooc(playerid, params[]) { new string[64]; if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /(o)oc [global OOC]"); } if(!enabledOOC && PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "The global OOC channel is disabled at the moment."); } if(PlayerInfo[playerid][pToggleOOC]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the OOC chat as you have it toggled."); } if((!isnull(PlayerInfo[playerid][pCustomTitle]) && strcmp(PlayerInfo[playerid][pCustomTitle], "None", true) != 0) && PlayerInfo[playerid][pAdminHide] == 0) { new color; if(PlayerInfo[playerid][pCustomTColor] == -1 || PlayerInfo[playerid][pCustomTColor] == -256) { color = 0xC8C8C8FF; } else { color = PlayerInfo[playerid][pCustomTColor]; } format(string, sizeof(string), "{%06x}%s{FFFFFF} %s", color >>> 8, PlayerInfo[playerid][pCustomTitle], GetPlayerRPName(playerid)); } else if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdminHide] == 0) { format(string, sizeof(string), "%s %s", GetAdminRank(playerid), GetPlayerRPName(playerid)); } else if(PlayerInfo[playerid][pHelper] > 0) { format(string, sizeof(string), "%s %s", GetHelperRank(playerid), GetPlayerRPName(playerid)); } else if(PlayerInfo[playerid][pFormerAdmin]) { format(string, sizeof(string), "{FF69B5}Former Admin{FFFFFF} %s", GetPlayerRPName(playerid)); } else if(PlayerInfo[playerid][pVIPPackage] > 0) { format(string, sizeof(string), "{D909D9}%s VIP{FFFFFF} %s", GetVIPRank(PlayerInfo[playerid][pVIPPackage]), GetPlayerRPName(playerid)); } else { format(string, sizeof(string), "%s", GetPlayerRPName(playerid)); } foreach(new i : Player) { if(!PlayerInfo[i][pToggleOOC]) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_WHITE, "(( %s: %.*s... ))", string, MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, COLOR_WHITE, "(( %s: ...%s ))", string, params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_WHITE, "(( %s: %s ))", string, params); } } } return 1; } CMD:newb(playerid, params[]) { return callcmd::newbie(playerid, params); } CMD:n(playerid, params[]) { return callcmd::newbie(playerid, params); } CMD:newbie(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /(n)ewbie [newbie chat]"); } if(!enabledNewbie && PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "The newbie channel is disabled at the moment."); } if(PlayerInfo[playerid][pNewbieMuted]) { return SendClientMessage(playerid, COLOR_GREY, "You are muted from speaking in this channel. /unmute to unmute yourself."); } if(gettime() - PlayerInfo[playerid][pLastNewbie] < 30) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only speak in this channel every 30 seconds. Please wait %i more seconds.", 30 - (gettime() - PlayerInfo[playerid][pLastNewbie])); } if(PlayerInfo[playerid][pToggleNewbie]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the newbie chat as you have it toggled."); } SendNewbieChatMessage(playerid, params); PlayerInfo[playerid][pNewbies] ++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET newbies = %i WHERE uid = %i", PlayerInfo[playerid][pNewbies], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); return 1; } CMD:level(playerid, params[]) { new count, color; if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /level [level]"); } if(IsNumeric(params)) { foreach(new i : Player) { if(PlayerInfo[i][pLevel] == strval(params)) { if((color = GetPlayerColor(i)) == 0xFFFFFF00) color = 0xAAAAAAFF; SendClientMessageEx(playerid, COLOR_GREY3, "(ID: %i) {%06x}%s{AAAAAA} - (Level: %i) - (Ping: %i)", i, color >>> 8, GetPlayerNameEx(i), PlayerInfo[i][pLevel], GetPlayerPing(i)); count++; } } if(!count) { SendClientMessageEx(playerid, COLOR_GREY, "There are no level %s players online.", params); } } else { SendClientMessage(playerid, COLOR_GREY, "Please use a numerical value!"); } return 1; } CMD:id(playerid, params[]) { new count, color, name[MAX_PLAYER_NAME], targetid = strval(params); if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /id [playerid/partial name]"); } if(IsNumeric(params)) { if(IsPlayerConnected(targetid)) { if((color = GetPlayerColor(targetid)) == 0xFFFFFF00) { color = 0xAAAAAAFF; } GetPlayerName(targetid, name, sizeof(name)); SendClientMessageEx(playerid, COLOR_GREY3, "(ID: %i) {%06x}%s{AAAAAA} - (Level: %i) - (Ping: %i)", targetid, color >>> 8, name, PlayerInfo[targetid][pLevel], GetPlayerPing(targetid)); } else { SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } } else if(strlen(params) < 2) { SendClientMessage(playerid, COLOR_GREY, "Please input at least two characters to search."); } else { foreach(new i : Player) { GetPlayerName(i, name, sizeof(name)); if(strfind(name, params, true) != -1) { if((color = GetPlayerColor(i)) == 0xFFFFFF00) { color = 0xAAAAAAFF; } SendClientMessageEx(playerid, COLOR_GREY3, "(ID: %i) {%06x}%s{AAAAAA} - (Level: %i) - (Ping: %i)", i, color >>> 8, name, PlayerInfo[i][pLevel], GetPlayerPing(i)); count++; } } if(!count) { SendClientMessageEx(playerid, COLOR_GREY, "No results found for \"%s\". Please narrow your search.", params); } } return 1; } CMD:pay(playerid, params[]) { new targetid, amount; if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /pay [playerid] [amount]"); } if(gettime() - PlayerInfo[playerid][pLastPay] < 3) { return SendClientMessage(playerid, COLOR_GREY, "Please wait three seconds between each transaction."); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't pay yourself."); } if(amount < 1) { return SendClientMessage(playerid, COLOR_GREY, "You must specify an amount above zero."); } if(amount > PlayerInfo[playerid][pCash]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have that much."); } if(amount > 1000 && PlayerInfo[playerid][pLevel] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can only pay up to $1,000 at a time as a level 1."); } if(amount > 100000) { return SendClientMessage(playerid, COLOR_GREY, "You are only allowed to pay up to $100,000 at a time."); } if(PlayerInfo[playerid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while on admin duty"); } PlayerInfo[playerid][pLastPay] = gettime(); GivePlayerCash(playerid, -amount); GivePlayerCash(targetid, amount); PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0); PlayerPlaySound(targetid, 1052, 0.0, 0.0, 0.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes out %s and gives it to %s.", GetPlayerRPName(playerid), FormatNumber(amount), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) (IP: %s) gives $%i to %s (uid: %i) (IP: %s)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerIP(playerid), amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], GetPlayerIP(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "You have been given {00AA00}%s{33CCFF} by %s.", FormatNumber(amount), GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have given {FF6347}%s{33CCFF} to %s.", FormatNumber(amount), GetPlayerRPName(targetid)); if(!strcmp(GetPlayerIP(playerid), GetPlayerIP(targetid))) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s (IP: %s) has given %s to %s (IP: %s).", GetPlayerRPName(playerid), GetPlayerIP(playerid), FormatNumber(amount), GetPlayerRPName(targetid), GetPlayerIP(targetid)); } return 1; } CMD:give(playerid, params[]) { new targetid, option[14], param[32], amount; if(sscanf(params, "us[14]S()[32]", targetid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Weapon, Materials, Weed, Cocaine, Meth, Painkillers, Cigars, Spraycans"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: GasCan, Seeds, Ephedrine, FirstAid, Bodykits, Rimkits, Diamonds"); return 1; } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0 || PlayerInfo[playerid][pJoinedEvent] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(!strcmp(option, "weapon", true)) { new weaponid = GetScriptWeapon(playerid); if(!weaponid) { return SendClientMessage(playerid, COLOR_GREY, "You must be holding the weapon you're willing to give away."); } if(PlayerInfo[playerid][pWeapons][weaponSlotIDs[weaponid]] != weaponid) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell this weapon as you don't have it."); } if(PlayerInfo[targetid][pWeapons][weaponSlotIDs[weaponid]] > 0) { return SendClientMessage(playerid, COLOR_GREY, "That player already has a weapon in that slot."); } if(PlayerInfo[targetid][pHours] < 2 || PlayerInfo[targetid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is either weapon restricted or played less than two playing hours."); } if(PlayerInfo[playerid][pFaction] >= 0 && PlayerInfo[targetid][pFaction] != PlayerInfo[playerid][pFaction]) { return SendClientMessage(playerid, COLOR_GREY, "You can only give away weapons to your own faction members."); } if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command from inside a vehicle."); } if(IsPlayerInAnyVehicle(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell weapons to players inside a vehicle."); } if(GetPlayerHealthEx(playerid) < 60) { return SendClientMessage(playerid, COLOR_GREY, "You can't give weapons as your health is below 60."); } GivePlayerWeaponEx(targetid, weaponid); RemovePlayerWeapon(playerid, weaponid); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you their %s.", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %s your %s.", GetPlayerRPName(targetid), GetWeaponNameEx(weaponid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s passes over their %s to %s.", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives their %s to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetWeaponNameEx(weaponid), GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "materials", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [materials] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pMaterials]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[targetid][pMaterials] + amount > GetPlayerCapacity(targetid, CAPACITY_MATERIALS)) { return SendClientMessageEx(playerid, COLOR_GREY, "That player can't carry that much more materials."); } PlayerInfo[playerid][pMaterials] -= amount; PlayerInfo[targetid][pMaterials] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[targetid][pMaterials], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i materials.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i materials to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some materials to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i materials to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "weed", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [weed] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pWeed]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[targetid][pWeed] + amount > GetPlayerCapacity(targetid, CAPACITY_WEED)) { return SendClientMessageEx(playerid, COLOR_GREY, "That player can't carry that much more weed."); } PlayerInfo[playerid][pWeed] -= amount; PlayerInfo[targetid][pWeed] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[targetid][pWeed], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i grams of weed.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i grams of weed to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some weed to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i grams of weed to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "cocaine", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [cocaine] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pCocaine]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[targetid][pCocaine] + amount > GetPlayerCapacity(targetid, CAPACITY_COCAINE)) { return SendClientMessageEx(playerid, COLOR_GREY, "That player can't carry that much more cocaine."); } PlayerInfo[playerid][pCocaine] -= amount; PlayerInfo[targetid][pCocaine] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[targetid][pCocaine], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i grams of cocaine.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i grams of cocaine to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some cocaine to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i grams of cocaine to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "meth", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [meth] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pMeth]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[targetid][pMeth] + amount > GetPlayerCapacity(targetid, CAPACITY_METH)) { return SendClientMessageEx(playerid, COLOR_GREY, "That player can't carry that much more meth."); } PlayerInfo[playerid][pMeth] -= amount; PlayerInfo[targetid][pMeth] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[targetid][pMeth], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i grams of meth.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i grams of meth to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some meth to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i grams of meth to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "painkillers", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [painkillers] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pPainkillers]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[targetid][pPainkillers] + amount > GetPlayerCapacity(targetid, CAPACITY_PAINKILLERS)) { return SendClientMessageEx(playerid, COLOR_GREY, "That player can't carry that much more painkillers."); } PlayerInfo[playerid][pPainkillers] -= amount; PlayerInfo[targetid][pPainkillers] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[playerid][pPainkillers], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[targetid][pPainkillers], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i painkillers.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i painkillers to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some painkillers to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i painkillers to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "cigars", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [cigars] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pCigars]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } PlayerInfo[playerid][pCigars] -= amount; PlayerInfo[targetid][pCigars] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cigars = %i WHERE uid = %i", PlayerInfo[playerid][pCigars], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cigars = %i WHERE uid = %i", PlayerInfo[targetid][pCigars], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i cigars.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i cigars to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some cigars to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i cigars to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "spraycans", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [spraycans] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pSpraycans]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } PlayerInfo[playerid][pSpraycans] -= amount; PlayerInfo[targetid][pSpraycans] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET spraycans = %i WHERE uid = %i", PlayerInfo[playerid][pSpraycans], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET spraycans = %i WHERE uid = %i", PlayerInfo[targetid][pSpraycans], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i spraycans.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i spraycans to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some spraycans to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i spraycans to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "gascan", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [gascan] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pGasCan]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } PlayerInfo[playerid][pGasCan] -= amount; PlayerInfo[targetid][pGasCan] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gascan = %i WHERE uid = %i", PlayerInfo[playerid][pGasCan], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gascan = %i WHERE uid = %i", PlayerInfo[targetid][pGasCan], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i liters of gasoline.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i liters of gasoline to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some gasoline to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i liters of gasoline to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "seeds", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [seeds] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pSeeds]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[targetid][pSeeds] + amount > GetPlayerCapacity(targetid, CAPACITY_SEEDS)) { return SendClientMessageEx(playerid, COLOR_GREY, "That player can't carry that much more seeds."); } PlayerInfo[playerid][pSeeds] -= amount; PlayerInfo[targetid][pSeeds] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET seeds = %i WHERE uid = %i", PlayerInfo[playerid][pSeeds], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET seeds = %i WHERE uid = %i", PlayerInfo[targetid][pSeeds], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i seeds.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i seeds to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some seeds to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i seeds to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "ephedrine", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [ephedrine] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pEphedrine]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[targetid][pEphedrine] + amount > GetPlayerCapacity(targetid, CAPACITY_EPHEDRINE)) { return SendClientMessageEx(playerid, COLOR_GREY, "That player can't carry that much more ephedrine."); } PlayerInfo[playerid][pEphedrine] -= amount; PlayerInfo[targetid][pEphedrine] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET ephedrine = %i WHERE uid = %i", PlayerInfo[playerid][pEphedrine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET ephedrine = %i WHERE uid = %i", PlayerInfo[targetid][pEphedrine], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i grams of ephedrine.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i grams of ephedrine to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some ephedrine to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i grams of ephedrine to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "firstaid", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [firstaid] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pFirstAid]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[targetid][pFirstAid] + amount > 20) { return SendClientMessageEx(playerid, COLOR_GREY, "That player can't carry that much more first aid kits."); } PlayerInfo[playerid][pFirstAid] -= amount; PlayerInfo[targetid][pFirstAid] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET firstaid = %i WHERE uid = %i", PlayerInfo[playerid][pFirstAid], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET firstaid = %i WHERE uid = %i", PlayerInfo[targetid][pFirstAid], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i first aid kits.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i first aid kits to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some first aid kits to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i first aid kits to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "bodykits", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [bodykits] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pBodykits]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[targetid][pBodykits] + amount > 10) { return SendClientMessageEx(playerid, COLOR_GREY, "That player can't carry that much more bodykits."); } PlayerInfo[playerid][pBodykits] -= amount; PlayerInfo[targetid][pBodykits] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bodykits = %i WHERE uid = %i", PlayerInfo[playerid][pBodykits], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bodykits = %i WHERE uid = %i", PlayerInfo[targetid][pBodykits], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i bodywork kits.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i bodywork kits to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some bodywork kits to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i bodywork kits to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "rimkits", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [rimkits] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pRimkits]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[targetid][pRimkits] + amount > 5) { return SendClientMessageEx(playerid, COLOR_GREY, "That player can't carry that much more rimkits."); } PlayerInfo[playerid][pRimkits] -= amount; PlayerInfo[targetid][pRimkits] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rimkits = %i WHERE uid = %i", PlayerInfo[playerid][pRimkits], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rimkits = %i WHERE uid = %i", PlayerInfo[targetid][pRimkits], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i rimkits.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i rimkits to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some rimkits to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i rimkits to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "diamonds", true)) { if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /give [playerid] [diamonds] [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pDiamonds]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[targetid][pDiamonds] + amount > 5) { return SendClientMessageEx(playerid, COLOR_GREY, "That player can't carry that much more diamonds."); } PlayerInfo[playerid][pDiamonds] -= amount; PlayerInfo[targetid][pDiamonds] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET diamonds = %i WHERE uid = %i", PlayerInfo[playerid][pDiamonds], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET diamonds = %i WHERE uid = %i", PlayerInfo[targetid][pDiamonds], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you %i diamonds.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %i diamonds to %s.", amount, GetPlayerRPName(targetid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives some rimkits to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_give", "%s (uid: %i) gives %i diamonds to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } return 1; } CMD:sell(playerid, params[]) { new targetid, option[14], param[32], amount, price; if(sscanf(params, "us[14]S()[32]", targetid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sell [playerid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Weapon, Materials, Weed, Cocaine, Meth, Painkillers, Seeds, Ephedrine"); return 1; } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0 || PlayerInfo[playerid][pJoinedEvent] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(gettime() - PlayerInfo[playerid][pLastSell] < 10) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only use this command every 10 seconds. Please wait %i more seconds.", 10 - (gettime() - PlayerInfo[playerid][pLastSell])); } if(!strcmp(option, "weapon", true)) { new weaponid; if(sscanf(param, "ii", weaponid, price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sell [playerid] [weapon] [weaponid] [price] (/guninv for weapon IDs)"); } if(!(1 <= weaponid <= 46) || PlayerInfo[playerid][pWeapons][weaponSlotIDs[weaponid]] != weaponid) { return SendClientMessage(playerid, COLOR_GREY, "You don't have that weapon. /guninv for a list of your weapons."); } if(PlayerInfo[targetid][pWeapons][weaponSlotIDs[weaponid]] > 0) { return SendClientMessage(playerid, COLOR_GREY, "That player already has a weapon in that slot."); } if(PlayerInfo[targetid][pHours] < 2 || PlayerInfo[targetid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is either weapon restricted or played less than two playing hours."); } if(PlayerInfo[playerid][pFaction] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell weapons as a faction member."); } if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell weapons from inside a vehicle."); } if(IsPlayerInAnyVehicle(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell weapons to players inside a vehicle."); } if(GetPlayerHealthEx(playerid) < 60) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell weapons as your health is below 60."); } PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_WEAPON; PlayerInfo[targetid][pSellExtra] = weaponid; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you their %s for $%i. (/accept item)", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s your %s for $%i.", GetPlayerRPName(targetid), GetWeaponNameEx(weaponid), price); } else if(!strcmp(option, "materials", true)) { if(sscanf(param, "ii", amount, price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sell [playerid] [materials] [amount] [price]"); } if(amount < 1 || amount > PlayerInfo[playerid][pMaterials]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_MATERIALS; PlayerInfo[targetid][pSellExtra] = amount; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you %i materials for $%i. (/accept item)", GetPlayerRPName(playerid), amount, price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s your %i materials for $%i.", GetPlayerRPName(targetid), amount, price); } else if(!strcmp(option, "weed", true)) { if(sscanf(param, "ii", amount, price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sell [playerid] [weed] [amount] [price]"); } if(amount < 1 || amount > PlayerInfo[playerid][pWeed]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_WEED; PlayerInfo[targetid][pSellExtra] = amount; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you %i grams of weed for $%i. (/accept item)", GetPlayerRPName(playerid), amount, price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s your %i grams of weed for $%i.", GetPlayerRPName(targetid), amount, price); } else if(!strcmp(option, "cocaine", true)) { if(sscanf(param, "ii", amount, price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sell [playerid] [cocaine] [amount] [price]"); } if(amount < 1 || amount > PlayerInfo[playerid][pCocaine]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_COCAINE; PlayerInfo[targetid][pSellExtra] = amount; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you %i grams of cocaine for $%i. (/accept item)", GetPlayerRPName(playerid), amount, price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s your %i grams of cocaine for $%i.", GetPlayerRPName(targetid), amount, price); } else if(!strcmp(option, "meth", true)) { if(sscanf(param, "ii", amount, price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sell [playerid] [meth] [amount] [price]"); } if(amount < 1 || amount > PlayerInfo[playerid][pMeth]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_METH; PlayerInfo[targetid][pSellExtra] = amount; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you %i grams of meth for $%i. (/accept item)", GetPlayerRPName(playerid), amount, price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s your %i grams of meth for $%i.", GetPlayerRPName(targetid), amount, price); } else if(!strcmp(option, "painkillers", true)) { if(sscanf(param, "ii", amount, price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sell [playerid] [painkillers] [amount] [price]"); } if(amount < 1 || amount > PlayerInfo[playerid][pPainkillers]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_PAINKILLERS; PlayerInfo[targetid][pSellExtra] = amount; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you %i painkillers for $%i. (/accept item)", GetPlayerRPName(playerid), amount, price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s your %i painkillers for $%i.", GetPlayerRPName(targetid), amount, price); } else if(!strcmp(option, "seeds", true)) { if(sscanf(param, "ii", amount, price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sell [playerid] [seeds] [amount] [price]"); } if(amount < 1 || amount > PlayerInfo[playerid][pSeeds]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SEEDS; PlayerInfo[targetid][pSellExtra] = amount; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you %i seeds for $%i. (/accept item)", GetPlayerRPName(playerid), amount, price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s your %i seeds for $%i.", GetPlayerRPName(targetid), amount, price); } else if(!strcmp(option, "ephedrine", true)) { if(sscanf(param, "ii", amount, price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sell [playerid] [ephedrine] [amount] [price]"); } if(amount < 1 || amount > PlayerInfo[playerid][pEphedrine]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_EPHEDRINE; PlayerInfo[targetid][pSellExtra] = amount; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you %i grams of ephedrine for $%i. (/accept item)", GetPlayerRPName(playerid), amount, price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s your %i grams of ephedrine for $%i.", GetPlayerRPName(targetid), amount, price); } return 1; } CMD:accent(playerid, params[]) { new type; if(sscanf(params, "i", type)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /accent [type]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of accents: (0) None - (1) English - (2) American - (3) British - (4) Chinese - (5) Korean - (6) Japanese - (7) Asian"); SendClientMessage(playerid, COLOR_SYNTAX, "List of accents: (8) Canadian - (9) Australian - (10) Southern - (11) Russian - (12) Ukrainian - (13) German - (14) French"); SendClientMessage(playerid, COLOR_SYNTAX, "List of accents: (15) Portguese - (16) Polish - (17) Estonian - (18) Latvian - (19) Dutch - (20) Jamaican - (21) Turkish"); SendClientMessage(playerid, COLOR_SYNTAX, "List of accents: (22) Mexican - (23) Spanish - (24) Arabic - (25) Israeli - (26) Romanian - (27) Italian - (28) Gangsta"); SendClientMessage(playerid, COLOR_SYNTAX, "List of accents: (29) Greek - (30) Serbian - (31) Balkin - (32) Danish - (33) Scottish - (34) Irish - (35) Indian"); SendClientMessage(playerid, COLOR_SYNTAX, "List of accents: (36) Ilyrian - (37) Swedish - (38) Finnish - (39) Hungarian - (40) Bulgarian - (41) Pakistani"); SendClientMessage(playerid, COLOR_SYNTAX, "List of accents: (42) Cuban - (43) Slavic - (44) Indonesian - (45) Filipino - (46) Hawaiian - (47) Somalian"); SendClientMessage(playerid, COLOR_SYNTAX, "List of accents: (48) Armenian - (49) Persian - (50) Vietnamese - (51) Slovenian - (52) Kiwi - (53) Brazilian - (54) Georgian"); return 1; } switch(type) { case 0: strcpy(PlayerInfo[playerid][pAccent], "None", 16); case 1: strcpy(PlayerInfo[playerid][pAccent], "English", 16); case 2: strcpy(PlayerInfo[playerid][pAccent], "American", 16); case 3: strcpy(PlayerInfo[playerid][pAccent], "British", 16); case 4: strcpy(PlayerInfo[playerid][pAccent], "Chinese", 16); case 5: strcpy(PlayerInfo[playerid][pAccent], "Korean", 16); case 6: strcpy(PlayerInfo[playerid][pAccent], "Japanese", 16); case 7: strcpy(PlayerInfo[playerid][pAccent], "Asian", 16); case 8: strcpy(PlayerInfo[playerid][pAccent], "Canadian", 16); case 9: strcpy(PlayerInfo[playerid][pAccent], "Australian", 16); case 10: strcpy(PlayerInfo[playerid][pAccent], "Southern", 16); case 11: strcpy(PlayerInfo[playerid][pAccent], "Russian", 16); case 12: strcpy(PlayerInfo[playerid][pAccent], "Ukrainian", 16); case 13: strcpy(PlayerInfo[playerid][pAccent], "German", 16); case 14: strcpy(PlayerInfo[playerid][pAccent], "French", 16); case 15: strcpy(PlayerInfo[playerid][pAccent], "Portuguese", 16); case 16: strcpy(PlayerInfo[playerid][pAccent], "Polish", 16); case 17: strcpy(PlayerInfo[playerid][pAccent], "Estonian", 16); case 18: strcpy(PlayerInfo[playerid][pAccent], "Latvian", 16); case 19: strcpy(PlayerInfo[playerid][pAccent], "Dutch", 16); case 20: strcpy(PlayerInfo[playerid][pAccent], "Jamaican", 16); case 21: strcpy(PlayerInfo[playerid][pAccent], "Turkish", 16); case 22: strcpy(PlayerInfo[playerid][pAccent], "Mexican", 16); case 23: strcpy(PlayerInfo[playerid][pAccent], "Spanish", 16); case 24: strcpy(PlayerInfo[playerid][pAccent], "Arabic", 16); case 25: strcpy(PlayerInfo[playerid][pAccent], "Israeli", 16); case 26: strcpy(PlayerInfo[playerid][pAccent], "Romanian", 16); case 27: strcpy(PlayerInfo[playerid][pAccent], "Italian", 16); case 28: strcpy(PlayerInfo[playerid][pAccent], "Gangsta", 16); case 29: strcpy(PlayerInfo[playerid][pAccent], "Greek", 16); case 30: strcpy(PlayerInfo[playerid][pAccent], "Serbian", 16); case 31: strcpy(PlayerInfo[playerid][pAccent], "Balkin", 16); case 32: strcpy(PlayerInfo[playerid][pAccent], "Danish", 16); case 33: strcpy(PlayerInfo[playerid][pAccent], "Scottish", 16); case 34: strcpy(PlayerInfo[playerid][pAccent], "Irish", 16); case 35: strcpy(PlayerInfo[playerid][pAccent], "Indian", 16); case 36: strcpy(PlayerInfo[playerid][pAccent], "Ilyrian", 16); case 37: strcpy(PlayerInfo[playerid][pAccent], "Swedish", 16); case 38: strcpy(PlayerInfo[playerid][pAccent], "Finnish", 16); case 39: strcpy(PlayerInfo[playerid][pAccent], "Hungarian", 16); case 40: strcpy(PlayerInfo[playerid][pAccent], "Bulgarian", 16); case 41: strcpy(PlayerInfo[playerid][pAccent], "Pakistani", 16); case 42: strcpy(PlayerInfo[playerid][pAccent], "Cuban", 16); case 43: strcpy(PlayerInfo[playerid][pAccent], "Slavic", 16); case 44: strcpy(PlayerInfo[playerid][pAccent], "Indonesian", 16); case 45: strcpy(PlayerInfo[playerid][pAccent], "Filipino", 16); case 46: strcpy(PlayerInfo[playerid][pAccent], "Hawaiian", 16); case 47: strcpy(PlayerInfo[playerid][pAccent], "Somalian", 16); case 48: strcpy(PlayerInfo[playerid][pAccent], "Armenian", 16); case 49: strcpy(PlayerInfo[playerid][pAccent], "Persian", 16); case 50: strcpy(PlayerInfo[playerid][pAccent], "Vietnamese", 16); case 51: strcpy(PlayerInfo[playerid][pAccent], "Slovenian", 16); case 52: strcpy(PlayerInfo[playerid][pAccent], "Kiwi", 16); case 53: strcpy(PlayerInfo[playerid][pAccent], "Brazilian", 16); case 54: strcpy(PlayerInfo[playerid][pAccent], "Georgian", 16); default: SendClientMessage(playerid, COLOR_GREY, "Invalid accent. Valid types range from 0 to 53."); } SendClientMessageEx(playerid, COLOR_WHITE, "You set your accent to '%s'.", PlayerInfo[playerid][pAccent]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET accent = '%e' WHERE uid = %i", PlayerInfo[playerid][pAccent], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); return 1; } CMD:dice(playerid, params[]) { SendProximityMessage(playerid, 20.0, COLOR_WHITE, "** %s rolls a dice which lands on the number %i.", GetPlayerRPName(playerid), random(6) + 1); return 1; } CMD:flipcoin(playerid, params[]) { SendProximityMessage(playerid, 20.0, COLOR_WHITE, "** %s flips a coin which lands on %s.", GetPlayerRPName(playerid), (random(2)) ? ("Heads") : ("Tails")); return 1; } CMD:time(playerid, params[]) { new string[128], date[6]; getdate(date[0], date[1], date[2]); gettime(date[3], date[4], date[5]); switch(date[1]) { case 1: string = "January"; case 2: string = "February"; case 3: string = "March"; case 4: string = "April"; case 5: string = "May"; case 6: string = "June"; case 7: string = "July"; case 8: string = "August"; case 9: string = "September"; case 10: string = "October"; case 11: string = "November"; case 12: string = "December"; } format(string, sizeof(string), "~y~%s %02d, %i~n~~g~|~w~%02d:%02d:%02d~g~|", string, date[2], date[0], date[3], date[4], date[5]); if(PlayerInfo[playerid][pJailTime] > 0) { format(string, sizeof(string), "%s~n~~w~Jail Time: ~y~%i seconds", string, PlayerInfo[playerid][pJailTime]); } GameTextForPlayer(playerid, string, 5000, 1); SendClientMessageEx(playerid, COLOR_WHITE, "** Paychecks occur at every 60 min. The next paycheck is at %02d:00 which is in %i minutes.", date[3]+1, (20 - date[4])); return 1; } CMD:report(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /report [playerid (optional)] [text]"); } if(PlayerInfo[playerid][pAdmin] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You cannot report as you are an administrator, use /a moron."); } if(!enabledReports) { return SendClientMessage(playerid, COLOR_GREY, "The report channel is disabled at the moment."); } if(PlayerInfo[playerid][pReportMuted]) { if(PlayerInfo[playerid][pReportMuted] > 1000) { return SendClientMessageEx(playerid, COLOR_GREY, "You are indefinitely muted from submitting reports. /unmute to unmute yourself."); } else { return SendClientMessageEx(playerid, COLOR_GREY, "You are muted from submitting reports. Your mute is lifted in %i hours.", PlayerInfo[playerid][pReportMuted]); } } if(gettime() - PlayerInfo[playerid][pLastReport] < 50) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only submit one report every 50 seconds. Please wait %i more seconds.", 50 - (gettime() - PlayerInfo[playerid][pLastReport])); } if(PlayerInfo[playerid][pActiveReport] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "You have an active report which needs to be closed first. Use /cr to close it."); } if(!AddReportToQueue(playerid, params)) { return SendClientMessage(playerid, COLOR_GREY, "The report queue is currently full. Please try again later."); } SendClientMessage(playerid, COLOR_GREEN, "Your report was sent to all online admins. Please wait for a response."); return 1; } CMD:assistance(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /requesthelp [help request]"); } if(PlayerInfo[playerid][pHelper] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are a helper and therefore can't use this command."); } if(PlayerInfo[playerid][pHelpMuted]) { return SendClientMessage(playerid, COLOR_GREY, "You are muted from submitting help requests."); } if(gettime() - PlayerInfo[playerid][pLastRequest] < 30) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only submit one help request every 30 seconds. Please wait %i more seconds.", 30 - (gettime() - PlayerInfo[playerid][pLastRequest])); } strcpy(PlayerInfo[playerid][pHelpRequest], params, 128); SendHelperMessage(COLOR_AQUA, "** Help Request from %s[%i]: %s **", GetPlayerRPName(playerid), playerid, params); PlayerInfo[playerid][pLastRequest] = gettime(); SendClientMessage(playerid, COLOR_GREEN, "Your help request was sent to all helpers. Please wait for a response."); return 1; } CMD:accept(playerid, params[]) { if(!strcmp(params, "house", true)) { new offeredby = PlayerInfo[playerid][pHouseOffer], houseid = PlayerInfo[playerid][pHouseOffered], price = PlayerInfo[playerid][pHousePrice]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for a house."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(!IsHouseOwner(offeredby, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "That player no longer is the owner of this house."); } if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy this player's house."); } if(GetPlayerAssetCount(playerid, LIMIT_HOUSES) >= GetPlayerAssetLimit(playerid, LIMIT_HOUSES)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently own %i/%i houses. You can't own anymore unless you upgrade your asset perk.", GetPlayerAssetCount(playerid, LIMIT_HOUSES), GetPlayerAssetLimit(playerid, LIMIT_HOUSES)); } SetHouseOwner(houseid, playerid); GivePlayerCash(offeredby, price); GivePlayerCash(playerid, -price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's house offer and paid %s for their house.", GetPlayerRPName(offeredby), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s accepted your house offer and paid %s for your house.", GetPlayerRPName(playerid), FormatNumber(price)); Log_Write("log_property", "%s (uid: %i) (IP: %s) sold their house (id: %i) for $%i to %s (uid: %i) (IP: %s)", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], GetPlayerIP(offeredby), HouseInfo[houseid][hID], price, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerIP(playerid)); PlayerInfo[playerid][pHouseOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "garage", true)) { new offeredby = PlayerInfo[playerid][pGarageOffer], garageid = PlayerInfo[playerid][pGarageOffered], price = PlayerInfo[playerid][pGaragePrice]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for a garage."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(!IsGarageOwner(offeredby, garageid)) { return SendClientMessage(playerid, COLOR_GREY, "That player no longer is the owner of this garage."); } if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy this player's garage."); } if(GetPlayerAssetCount(playerid, LIMIT_GARAGES) >= GetPlayerAssetLimit(playerid, LIMIT_GARAGES)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently own %i/%i garages. You can't own anymore unless you upgrade your asset perk.", GetPlayerAssetCount(playerid, LIMIT_GARAGES), GetPlayerAssetLimit(playerid, LIMIT_GARAGES)); } SetGarageOwner(garageid, playerid); GivePlayerCash(offeredby, price); GivePlayerCash(playerid, -price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's garage offer and paid %s for their garage.", GetPlayerRPName(offeredby), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s accepted your garage offer and paid %s for your garage.", GetPlayerRPName(playerid), FormatNumber(price)); Log_Write("log_property", "%s (uid: %i) (IP: %s) sold their %s garage (id: %i) for $%i to %s (uid: %i) (IP: %s)", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], GetPlayerIP(offeredby), garageInteriors[GarageInfo[garageid][gType]][intName], GarageInfo[garageid][gID], price, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerIP(playerid)); PlayerInfo[playerid][pGarageOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "business", true)) { new offeredby = PlayerInfo[playerid][pBizOffer], businessid = PlayerInfo[playerid][pBizOffered], price = PlayerInfo[playerid][pBizPrice]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for a business."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(!IsBusinessOwner(offeredby, businessid)) { return SendClientMessage(playerid, COLOR_GREY, "That player no longer is the owner of this business."); } if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy this player's business."); } if(GetPlayerAssetCount(playerid, LIMIT_BUSINESSES) >= GetPlayerAssetLimit(playerid, LIMIT_BUSINESSES)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently own %i/%i businesses. You can't own anymore unless you upgrade your asset perk.", GetPlayerAssetCount(playerid, LIMIT_BUSINESSES), GetPlayerAssetLimit(playerid, LIMIT_BUSINESSES)); } SetBusinessOwner(businessid, playerid); GivePlayerCash(offeredby, price); GivePlayerCash(playerid, -price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's business offer and paid %s for their %s.", GetPlayerRPName(offeredby), FormatNumber(price), bizInteriors[BusinessInfo[businessid][bType]][intType]); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s accepted your business offer and paid %s for your %s.", GetPlayerRPName(playerid), FormatNumber(price), bizInteriors[BusinessInfo[businessid][bType]][intType]); Log_Write("log_property", "%s (uid: %i) (IP: %s) sold their %s business (id: %i) for $%i to %s (uid: %i) (IP: %s)", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], GetPlayerIP(offeredby), bizInteriors[BusinessInfo[businessid][bType]][intType], BusinessInfo[businessid][bID], price, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerIP(playerid)); PlayerInfo[playerid][pBizOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "land", true)) { new offeredby = PlayerInfo[playerid][pLandOffer], landid = PlayerInfo[playerid][pLandOffered], price = PlayerInfo[playerid][pLandPrice]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for a land."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(!IsLandOwner(offeredby, landid)) { return SendClientMessage(playerid, COLOR_GREY, "That player no longer is the owner of this land."); } if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy this player's land."); } SetLandOwner(landid, playerid); GivePlayerCash(offeredby, price); GivePlayerCash(playerid, -price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's land offer and paid %s for their land.", GetPlayerRPName(offeredby), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s accepted your land offer and paid %s for your land.", GetPlayerRPName(playerid), FormatNumber(price)); Log_Write("log_property", "%s (uid: %i) (IP: %s) sold their land (id: %i) for $%i to %s (uid: %i) (IP: %s)", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], GetPlayerIP(offeredby), LandInfo[landid][lID], price, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerIP(playerid)); PlayerInfo[playerid][pLandOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "death", true)) { if(IsPlayerConnected(PlayerInfo[playerid][pAcceptedEMS]) && !PlayerInfo[PlayerInfo[playerid][pAcceptedEMS]][pAFK]) { return SendClientMessage(playerid, COLOR_GREY, "There is a medic online and on-the way to rescue you."); } if(!PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You are not injured and can't accept your death."); } SendClientMessage(playerid, COLOR_GREY, "You have given up and accepted your fate."); SetPlayerHealth(playerid, 0.0); } else if(!strcmp(params, "vest", true)) { new offeredby = PlayerInfo[playerid][pVestOffer], price = PlayerInfo[playerid][pVestPrice]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for a vest."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy the vest."); } new Float:armor = 50.0 + (GetJobLevel(offeredby, JOB_BODYGUARD) * 5); SetScriptArmour(playerid, armor); GivePlayerCash(offeredby, price); GivePlayerCash(playerid, -price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's vest and paid %s for %.1f armor points.", GetPlayerRPName(offeredby), FormatNumber(price), armor); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s accepted your vest offer and paid %s for %.1f armor points.", GetPlayerRPName(playerid), FormatNumber(price), armor); TurfTaxCheck(offeredby, price); IncreaseJobSkill(offeredby, JOB_BODYGUARD); PlayerInfo[playerid][pVestOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "vehicle", true)) { new offeredby = PlayerInfo[playerid][pCarOffer], vehicleid = PlayerInfo[playerid][pCarOffered], price = PlayerInfo[playerid][pCarPrice]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for a vehicle."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(!IsVehicleOwner(offeredby, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "That player no longer is the owner of this vehicle."); } if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy this player's vehicle."); } if(GetSpawnedVehicles(playerid) >= MAX_SPAWNED_VEHICLES) { return SendClientMessageEx(playerid, COLOR_GREY, "You can't have more than %i vehicles spawned at a time.", MAX_SPAWNED_VEHICLES); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM vehicles WHERE ownerid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer, "OnPlayerAttemptBuyVehicleEx", "iiii", playerid, offeredby, vehicleid, price); PlayerInfo[playerid][pCarOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "faction", true)) { new offeredby = PlayerInfo[playerid][pFactionOffer], factionid = PlayerInfo[playerid][pFactionOffered]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any invites to a faction."); } if(PlayerInfo[offeredby][pFaction] != factionid || !PlayerInfo[offeredby][pFactionLeader]) { return SendClientMessage(playerid, COLOR_GREY, "That player is no longer allowed to invite you."); } SetPlayerFaction(playerid, factionid, 0); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's faction offer to join {00AA00}%s{33CCFF}.", GetPlayerRPName(offeredby), FactionInfo[factionid][fName]); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s accepted your faction offer and is now apart of your faction.", GetPlayerRPName(playerid)); Log_Write("log_faction", "%s (uid: %i) has invited %s (uid: %i) to %s (id: %i).", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], FactionInfo[factionid][fName], factionid); PlayerInfo[playerid][pFactionOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "gang", true)) { new offeredby = PlayerInfo[playerid][pGangOffer], gangid = PlayerInfo[playerid][pGangOffered]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any invites to a gang."); } if(PlayerInfo[offeredby][pGang] != gangid || PlayerInfo[offeredby][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "That player is no longer allowed to invite you."); } PlayerInfo[playerid][pGang] = gangid; PlayerInfo[playerid][pGangRank] = 0; PlayerInfo[playerid][pCrew] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gang = %i, gangrank = 0, crew = -1 WHERE uid = %i", gangid, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's gang offer to join {00AA00}%s{33CCFF}.", GetPlayerRPName(offeredby), GangInfo[gangid][gName]); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s accepted your gang offer and is now apart of your gang.", GetPlayerRPName(playerid)); if(gacooldown) { GangInfo[gangid][gInvCooldown] = gacooldown; SendClientMessageEx(offeredby, COLOR_GREEN, "A invite cooldown has been placed on your gang. You cannot invite anyone for the next %i minutes!", GangInfo[gangid][gInvCooldown]); } Log_Write("log_gang", "%s (uid: %i) has invited %s (uid: %i) to %s (id: %i).", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[gangid][gName], gangid); PlayerInfo[playerid][pGangOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "frisk", true)) { new offeredby = PlayerInfo[playerid][pFriskOffer]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers to be frisked."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } FriskPlayer(offeredby, playerid); PlayerInfo[playerid][pFriskOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "ticket", true)) { new offeredby = PlayerInfo[playerid][pTicketOffer], price = PlayerInfo[playerid][pTicketPrice]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for a ticket."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to pay this ticket."); } //GivePlayerCash(offeredby, price); AddToTaxVault(price); GivePlayerCash(playerid, -price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have paid the %s ticket written by %s.", FormatNumber(price), GetPlayerRPName(offeredby)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has paid the %s ticket which was written to them.", GetPlayerRPName(playerid), FormatNumber(price)); Log_Write("log_faction", "%s (uid: %i) has given %s (uid: %i) a ticket for $%i.", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], price); PlayerInfo[playerid][pTicketOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "live", true)) { new offeredby = PlayerInfo[playerid][pLiveOffer]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for a live interview."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(PlayerInfo[playerid][pCallLine] != INVALID_PLAYER_ID || PlayerInfo[offeredby][pCallLine] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You or the offerer can't be on a phone call during a live interview."); } SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's live interview offer. Speak in IC chat to begin the interview!", GetPlayerRPName(offeredby)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has accepted your live interview offer. Speak in IC chat to begin the interview!", GetPlayerRPName(playerid)); Log_Write("log_faction", "%s (uid: %i) has started a live interview with %s (uid: %i)", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], GetPlayerNameEx(playerid), PlayerInfo[playerid][pID]); PlayerInfo[playerid][pLiveBroadcast] = offeredby; PlayerInfo[offeredby][pLiveBroadcast] = playerid; PlayerInfo[playerid][pLiveOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "handshake", true)) { new offeredby = PlayerInfo[playerid][pShakeOffer]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for a handshake."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } ClearAnimations(playerid); ClearAnimations(offeredby); SetPlayerToFacePlayer(playerid, offeredby); SetPlayerToFacePlayer(offeredby, playerid); switch(PlayerInfo[playerid][pShakeType]) { case 1: { ApplyAnimation(playerid, "GANGS", "hndshkaa", 4.0, 0, 0, 0, 0, 0, 1); ApplyAnimation(offeredby, "GANGS", "hndshkaa", 4.0, 0, 0, 0, 0, 0, 1); } case 2: { ApplyAnimation(playerid, "GANGS", "hndshkba", 4.0, 0, 0, 0, 0, 0, 1); ApplyAnimation(offeredby, "GANGS", "hndshkba", 4.0, 0, 0, 0, 0, 0, 1); } case 3: { ApplyAnimation(playerid, "GANGS", "hndshkda", 4.0, 0, 0, 0, 0, 0, 1); ApplyAnimation(offeredby, "GANGS", "hndshkda", 4.0, 0, 0, 0, 0, 0, 1); } case 4: { ApplyAnimation(playerid, "GANGS", "hndshkea", 4.0, 0, 0, 0, 0, 0, 1); ApplyAnimation(offeredby, "GANGS", "hndshkea", 4.0, 0, 0, 0, 0, 0, 1); } case 5: { ApplyAnimation(playerid, "GANGS", "hndshkfa", 4.0, 0, 0, 0, 0, 0, 1); ApplyAnimation(offeredby, "GANGS", "hndshkfa", 4.0, 0, 0, 0, 0, 0, 1); } case 6: { ApplyAnimation(playerid, "GANGS", "prtial_hndshk_biz_01", 4.0, 0, 0, 0, 0, 0); ApplyAnimation(offeredby, "GANGS", "prtial_hndshk_biz_01", 4.0, 0, 0, 0, 0, 0); } } AwardAchievement(playerid, "Meeting people"); AwardAchievement(offeredby, "Meeting people"); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's handshake offer.", GetPlayerRPName(offeredby)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has accepted your handshake offer.", GetPlayerRPName(playerid)); PlayerInfo[playerid][pShakeOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "item", true)) { new offeredby = PlayerInfo[playerid][pSellOffer], type = PlayerInfo[playerid][pSellType], amount = PlayerInfo[playerid][pSellExtra], price = PlayerInfo[playerid][pSellPrice]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for an item."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to accept the offer."); } switch(type) { case ITEM_WEAPON: { new weaponid = PlayerInfo[playerid][pSellExtra]; if(!PlayerHasWeapon(offeredby, weaponid)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer no longer has that item."); } GivePlayerCash(playerid, -price); GivePlayerCash(offeredby, price); GivePlayerWeaponEx(playerid, weaponid); RemovePlayerWeapon(offeredby, weaponid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have purchased %s's %s for %s.", GetPlayerRPName(offeredby), GetWeaponNameEx(weaponid), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has purchased your %s for %s.", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid), FormatNumber(price)); Log_Write("log_give", "%s (uid: %i) has sold their %s to %s (uid: %i) for $%i.", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], GetWeaponNameEx(weaponid), GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], price); TurfTaxCheck(offeredby, price); PlayerInfo[playerid][pSellOffer] = INVALID_PLAYER_ID; } case ITEM_MATERIALS: { if(PlayerInfo[offeredby][pMaterials] < amount) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer no longer has that item."); } if(PlayerInfo[playerid][pMaterials] + amount > GetPlayerCapacity(playerid, CAPACITY_MATERIALS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i materials. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMaterials], GetPlayerCapacity(playerid, CAPACITY_MATERIALS)); } GivePlayerCash(playerid, -price); GivePlayerCash(offeredby, price); PlayerInfo[playerid][pMaterials] += amount; PlayerInfo[offeredby][pMaterials] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[offeredby][pMaterials], PlayerInfo[offeredby][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have purchased %i materials from %s for %s.", amount, GetPlayerRPName(offeredby), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has purchased your %i materials for %s.", GetPlayerRPName(playerid), amount, FormatNumber(price)); Log_Write("log_give", "%s (uid: %i) has sold their %i materials to %s (uid: %i) for $%i.", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], amount, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], price); TurfTaxCheck(offeredby, price); PlayerInfo[playerid][pSellOffer] = INVALID_PLAYER_ID; } case ITEM_WEED: { if(PlayerInfo[offeredby][pWeed] < amount) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer no longer has that item."); } if(PlayerInfo[playerid][pWeed] + amount > GetPlayerCapacity(playerid, CAPACITY_WEED)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i weed. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pWeed], GetPlayerCapacity(playerid, CAPACITY_WEED)); } AwardAchievement(playerid, "Dirty deeds"); AwardAchievement(offeredby, "Dirty deeds"); GivePlayerCash(playerid, -price); GivePlayerCash(offeredby, price); PlayerInfo[playerid][pWeed] += amount; PlayerInfo[offeredby][pWeed] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[offeredby][pWeed], PlayerInfo[offeredby][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have purchased %i grams of weed from %s for %s.", amount, GetPlayerRPName(offeredby), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has purchased your %i grams of weed for %s.", GetPlayerRPName(playerid), amount, FormatNumber(price)); Log_Write("log_give", "%s (uid: %i) has sold their %i grams of weed to %s (uid: %i) for $%i.", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], amount, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], price); TurfTaxCheck(offeredby, price); PlayerInfo[playerid][pSellOffer] = INVALID_PLAYER_ID; } case ITEM_COCAINE: { if(PlayerInfo[offeredby][pCocaine] < amount) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer no longer has that item."); } if(PlayerInfo[playerid][pCocaine] + amount > GetPlayerCapacity(playerid, CAPACITY_COCAINE)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i cocaine. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pCocaine], GetPlayerCapacity(playerid, CAPACITY_COCAINE)); } AwardAchievement(playerid, "Dirty deeds"); AwardAchievement(offeredby, "Dirty deeds"); GivePlayerCash(playerid, -price); GivePlayerCash(offeredby, price); PlayerInfo[playerid][pCocaine] += amount; PlayerInfo[offeredby][pCocaine] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[offeredby][pCocaine], PlayerInfo[offeredby][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have purchased %i grams of cocaine from %s for %s.", amount, GetPlayerRPName(offeredby), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has purchased your %i grams of cocaine for %s.", GetPlayerRPName(playerid), amount, FormatNumber(price)); Log_Write("log_give", "%s (uid: %i) has sold their %i grams of cocaine to %s (uid: %i) for $%i.", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], amount, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], price); TurfTaxCheck(offeredby, price); PlayerInfo[playerid][pSellOffer] = INVALID_PLAYER_ID; } case ITEM_METH: { if(PlayerInfo[offeredby][pMeth] < amount) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer no longer has that item."); } if(PlayerInfo[playerid][pMeth] + amount > GetPlayerCapacity(playerid, CAPACITY_METH)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i meth. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMeth], GetPlayerCapacity(playerid, CAPACITY_METH)); } AwardAchievement(playerid, "Dirty deeds"); AwardAchievement(offeredby, "Dirty deeds"); GivePlayerCash(playerid, -price); GivePlayerCash(offeredby, price); PlayerInfo[playerid][pMeth] += amount; PlayerInfo[offeredby][pMeth] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[offeredby][pMeth], PlayerInfo[offeredby][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have purchased %i grams of meth from %s for %s.", amount, GetPlayerRPName(offeredby), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has purchased your %i grams of meth for %s.", GetPlayerRPName(playerid), amount, FormatNumber(price)); Log_Write("log_give", "%s (uid: %i) has sold their %i grams of meth to %s (uid: %i) for $%i.", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], amount, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], price); TurfTaxCheck(offeredby, price); PlayerInfo[playerid][pSellOffer] = INVALID_PLAYER_ID; } case ITEM_PAINKILLERS: { if(PlayerInfo[offeredby][pPainkillers] < amount) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer no longer has that item."); } if(PlayerInfo[playerid][pPainkillers] + amount > GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i painkillers. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pPainkillers], GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS)); } AwardAchievement(playerid, "Dirty deeds"); AwardAchievement(offeredby, "Dirty deeds"); GivePlayerCash(playerid, -price); GivePlayerCash(offeredby, price); PlayerInfo[playerid][pPainkillers] += amount; PlayerInfo[offeredby][pPainkillers] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[playerid][pPainkillers], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[offeredby][pPainkillers], PlayerInfo[offeredby][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have purchased %i painkillers from %s for %s.", amount, GetPlayerRPName(offeredby), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has purchased your %i painkillers for %s.", GetPlayerRPName(playerid), amount, FormatNumber(price)); Log_Write("log_give", "%s (uid: %i) has sold their %i painkillers to %s (uid: %i) for $%i.", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], amount, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], price); TurfTaxCheck(offeredby, price); PlayerInfo[playerid][pSellOffer] = INVALID_PLAYER_ID; } case ITEM_SEEDS: { if(PlayerInfo[offeredby][pSeeds] < amount) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer no longer has that item."); } if(PlayerInfo[playerid][pSeeds] + amount > GetPlayerCapacity(playerid, CAPACITY_SEEDS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i seeds. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pSeeds], GetPlayerCapacity(playerid, CAPACITY_SEEDS)); } AwardAchievement(playerid, "Dirty deeds"); AwardAchievement(offeredby, "Dirty deeds"); GivePlayerCash(playerid, -price); GivePlayerCash(offeredby, price); PlayerInfo[playerid][pSeeds] += amount; PlayerInfo[offeredby][pSeeds] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET seeds = %i WHERE uid = %i", PlayerInfo[playerid][pSeeds], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET seeds = %i WHERE uid = %i", PlayerInfo[offeredby][pSeeds], PlayerInfo[offeredby][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have purchased %i seeds from %s for %s.", amount, GetPlayerRPName(offeredby), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has purchased your %i seeds for %s.", GetPlayerRPName(playerid), amount, FormatNumber(price)); Log_Write("log_give", "%s (uid: %i) has sold their %i seeds to %s (uid: %i) for $%i.", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], amount, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], price); TurfTaxCheck(offeredby, price); PlayerInfo[playerid][pSellOffer] = INVALID_PLAYER_ID; } case ITEM_EPHEDRINE: { if(PlayerInfo[offeredby][pEphedrine] < amount) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer no longer has that item."); } if(PlayerInfo[playerid][pEphedrine] + amount > GetPlayerCapacity(playerid, CAPACITY_EPHEDRINE)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i ephedrine. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pEphedrine], GetPlayerCapacity(playerid, CAPACITY_EPHEDRINE)); } AwardAchievement(playerid, "Dirty deeds"); AwardAchievement(offeredby, "Dirty deeds"); GivePlayerCash(playerid, -price); GivePlayerCash(offeredby, price); PlayerInfo[playerid][pEphedrine] += amount; PlayerInfo[offeredby][pEphedrine] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET ephedrine = %i WHERE uid = %i", PlayerInfo[playerid][pEphedrine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET ephedrine = %i WHERE uid = %i", PlayerInfo[offeredby][pEphedrine], PlayerInfo[offeredby][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have purchased %i grams of ephedrine from %s for %s.", amount, GetPlayerRPName(offeredby), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has purchased your %i grams of ephedrine for %s.", GetPlayerRPName(playerid), amount, FormatNumber(price)); Log_Write("log_give", "%s (uid: %i) has sold their %i grams of ephedrine to %s (uid: %i) for $%i.", GetPlayerNameEx(offeredby), PlayerInfo[offeredby][pID], amount, GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], price); TurfTaxCheck(offeredby, price); PlayerInfo[playerid][pSellOffer] = INVALID_PLAYER_ID; } } } else if(!strcmp(params, "weapon", true)) { if(PlayerInfo[playerid][pSellOffer] == INVALID_PLAYER_ID || PlayerInfo[playerid][pSellType] != ITEM_SELLGUN) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for a weapon."); } if(PlayerInfo[playerid][pCash] < PlayerInfo[playerid][pSellPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase the weapon."); } SellWeapon(PlayerInfo[playerid][pSellOffer], playerid, PlayerInfo[playerid][pSellExtra], PlayerInfo[playerid][pSellPrice]); PlayerInfo[playerid][pSellOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "lawyer", true)) { new offeredby = PlayerInfo[playerid][pDefendOffer], price = PlayerInfo[playerid][pDefendPrice]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers from a lawyer."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(PlayerInfo[playerid][pCash] < price) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to accept the offer."); } if(!PlayerInfo[playerid][pWantedLevel]) { return SendClientMessage(playerid, COLOR_GREY, "You are no longer wanted. You can't accept this offer anymore."); } PlayerInfo[playerid][pWantedLevel]--; GivePlayerCash(playerid, -price); GivePlayerCash(offeredby, price); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET wantedlevel = wantedlevel - 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's offer to reduce your wanted level for %s.", GetPlayerRPName(offeredby), FormatNumber(price)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has accepted your offer to reduce their wanted level for %s.", GetPlayerRPName(playerid), FormatNumber(price)); IncreaseJobSkill(offeredby, JOB_LAWYER); PlayerInfo[playerid][pDefendOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "dicebet", true)) { new offeredby = PlayerInfo[playerid][pDiceOffer], amount = PlayerInfo[playerid][pDiceBet]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers for dice betting."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to accept this bet."); } if(PlayerInfo[offeredby][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "That player can't afford to accept this bet."); } new rand[2]; if(PlayerInfo[playerid][pDiceRigged]) { rand[0] = 4 + random(3); rand[1] = random(3) + 1; } else { for(new x = 0; x < random(50)*random(50)+30; x++) { rand[0] = random(6) + 1; } for(new x = 0; x < random(50)*random(50)+30; x++) { rand[1] = random(6) + 1; } } SendProximityMessage(offeredby, 20.0, COLOR_WHITE, "** %s rolls a dice which lands on the number %i.", GetPlayerRPName(offeredby), rand[0]); SendProximityMessage(playerid, 20.0, COLOR_WHITE, "** %s rolls a dice which lands on the number %i.", GetPlayerRPName(playerid), rand[1]); if(rand[0] > rand[1]) { new tax = (amount / 200) * gTax; AddToTaxVault(tax); GivePlayerCash(offeredby, amount - tax); GivePlayerCash(playerid, -amount); SendClientMessageEx(offeredby, COLOR_AQUA, "** You have won %s from your dice bet with %s.", FormatNumber(amount), GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_RED, "** You have lost %s from your dice bet with %s.", FormatNumber(amount), GetPlayerRPName(offeredby)); SendClientMessageEx(offeredby, COLOR_GREY, "You paid %s in taxes & fees.", FormatNumber(tax)); if(amount > 10000 && !strcmp(GetPlayerIP(offeredby), GetPlayerIP(playerid))) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s (IP: %s) won a $%i dice bet against %s (IP: %s).", GetPlayerRPName(offeredby), GetPlayerIP(offeredby), amount, GetPlayerRPName(playerid), GetPlayerIP(playerid)); } Log_Write("log_dicebet", "%s (uid: %i) won a dice bet against %s (uid: %i) for $%i.", GetPlayerRPName(offeredby), PlayerInfo[offeredby][pID], GetPlayerRPName(playerid), PlayerInfo[playerid][pID], amount); } else if(rand[0] == rand[1]) { SendClientMessageEx(offeredby, COLOR_AQUA, "** The bet of %s was a tie. You kept your money as a result!", FormatNumber(amount)); SendClientMessageEx(playerid, COLOR_AQUA, "** The bet of %s was a tie. You kept your money as a result!", FormatNumber(amount)); } else { new tax = (amount / 200) * gTax; AddToTaxVault(tax); GivePlayerCash(offeredby, -amount); GivePlayerCash(playerid, amount - tax); SendClientMessageEx(playerid, COLOR_AQUA, "** You have won %s from your dice bet with %s.", FormatNumber(amount), GetPlayerRPName(offeredby)); SendClientMessageEx(offeredby, COLOR_RED, "** You have lost %s from your dice bet with %s.", FormatNumber(amount), GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_GREY, "You paid %s in taxes & fees.", FormatNumber(tax)); if(amount > 10000 && !strcmp(GetPlayerIP(offeredby), GetPlayerIP(playerid))) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s (IP: %s) won a $%i dice bet against %s (IP: %s).", GetPlayerRPName(playerid), GetPlayerIP(playerid), amount, GetPlayerRPName(offeredby), GetPlayerIP(offeredby)); } Log_Write("log_dicebet", "%s (uid: %i) won a dice bet against %s (uid: %i) for $%i.", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], GetPlayerRPName(offeredby), PlayerInfo[offeredby][pID], amount); } PlayerInfo[playerid][pDiceOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "invite", true)) { new offeredby = PlayerInfo[playerid][pInviteOffer], houseid = PlayerInfo[playerid][pInviteHouse]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any invitations to a house."); } PlayerInfo[playerid][pCP] = CHECKPOINT_HOUSE; SetPlayerCheckpoint(playerid, HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ], 3.0); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's invitation to their house.", GetPlayerRPName(offeredby)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has accepted your invitation to your house.", GetPlayerRPName(playerid)); PlayerInfo[playerid][pInviteOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "robbery", true)) { new offeredby = PlayerInfo[playerid][pRobberyOffer]; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any invitations to a bank heist."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(RobberyInfo[rRobbers][0] != offeredby || RobberyInfo[rStarted]) { return SendClientMessage(playerid, COLOR_GREY, "The robbery invite is no longer available."); } if(GetBankRobbers() >= MAX_BANK_ROBBERS) { return SendClientMessageEx(playerid, COLOR_GREY, "This bank robbery has reached its limit of %i robbers.", MAX_BANK_ROBBERS); } AddToBankRobbery(playerid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's bank robbery invitation.", GetPlayerRPName(offeredby)); SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has accepted your bank robbery invitation.", GetPlayerRPName(playerid)); PlayerInfo[playerid][pRobberyOffer] = INVALID_PLAYER_ID; } /*else if(!strcmp(params, "duel", true)) { new offeredby = PlayerInfo[playerid][pDuelOffer], entranceid = GetInsideEntrance(playerid); if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received any offers to duel."); } if(!IsPlayerInRangeOfPlayer(playerid, offeredby, 15.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is out of range."); } if(entranceid == -1 || EntranceInfo[entranceid][eType] != 1) { return SendClientMessage(playerid, COLOR_GREY, "You are not in a duel arena."); } if(PlayerInfo[playerid][pDueling] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You are already participating in a duel at the moment."); } if(PlayerInfo[offeredby][pDueling] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "The player who initiated the offer is in a duel at the moment."); } foreach(new i : Player) { if(GetInsideEntrance(i) == entranceid && PlayerInfo[i][pDueling] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "There is a duel in progress already. Wait until the current one has ended."); } } SavePlayerVariables(playerid); SavePlayerVariables(offeredby); ResetPlayerWeapons(playerid); ResetPlayerWeapons(offeredby); SetPlayerPos(playerid, 1370.3395, -15.4556, 1000.9219); SetPlayerPos(offeredby, 1414.4841, -15.1239, 1000.9253); SetPlayerFacingAngle(playerid, 270.0000); SetPlayerFacingAngle(offeredby, 90.0000); SetPlayerInterior(playerid, 1); SetPlayerInterior(offeredby, 1); SetPlayerVirtualWorld(playerid, EntranceInfo[entranceid][eWorld]); SetPlayerVirtualWorld(offeredby, EntranceInfo[entranceid][eWorld]); SetPlayerHealth(playerid, 100.0); SetPlayerArmour(playerid, 100.0); SetPlayerHealth(offeredby, 100.0); SetPlayerArmour(offeredby, 100.0); GivePlayerWeaponEx(playerid, 24, true); GivePlayerWeaponEx(playerid, 27, true); GivePlayerWeaponEx(playerid, 29, true); GivePlayerWeaponEx(playerid, 31, true); GivePlayerWeaponEx(playerid, 34, true); GivePlayerWeaponEx(offeredby, 24, true); GivePlayerWeaponEx(offeredby, 27, true); GivePlayerWeaponEx(offeredby, 29, true); GivePlayerWeaponEx(offeredby, 31, true); GivePlayerWeaponEx(offeredby, 34, true); GameTextForPlayer(playerid, "~r~Duel time!", 3000, 3); GameTextForPlayer(offeredby, "~r~Duel time!", 3000, 3); PlayerInfo[playerid][pDueling] = offeredby; PlayerInfo[offeredby][pDueling] = playerid; SendClientMessageEx(offeredby, COLOR_AQUA, "** %s has accepted the duel offer.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's duel offer.", GetPlayerRPName(offeredby)); PlayerInfo[playerid][pDuelOffer] = INVALID_PLAYER_ID; }*/ else if(!strcmp(params, "alliance", true)) { new offeredby = PlayerInfo[playerid][pAllianceOffer], color, color2; if(offeredby == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't been offered an alliance."); } if(offeredby == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't accept offers from yourself."); } new gangid = PlayerInfo[playerid][pGang], allyid = PlayerInfo[offeredby][pGang]; SendClientMessageEx(offeredby, COLOR_AQUA, "%s has accepted your offer to form a gang alliance.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You've accepted the offer from %s to form a gang alliance.", GetPlayerRPName(offeredby)); GangInfo[gangid][gAlliance] = allyid; GangInfo[allyid][gAlliance] = gangid; PlayerInfo[playerid][pAllianceOffer] = INVALID_PLAYER_ID; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET alliance = %i WHERE id = %i", allyid, gangid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET alliance = %i WHERE id = %i", gangid, allyid); mysql_tquery(connectionID, queryBuffer); if(GangInfo[gangid][gColor] == -1 || GangInfo[gangid][gColor] == -256) { color = 0xC8C8C8FF; } else { color = GangInfo[gangid][gColor]; } if(GangInfo[allyid][gColor] == -1 || GangInfo[allyid][gColor] == -256) { color2 = 0xC8C8C8FF; } else { color2 = GangInfo[allyid][gColor]; } SendClientMessageToAllEx(COLOR_WHITE, "(( Gang News: {%06x}%s{FFFFFF} has formed an alliance with {%06x}%s{FFFFFF} ))", color >>> 8, GangInfo[gangid][gName], color2 >>> 8, GangInfo[allyid][gName]); } else if(!strcmp(params, "marriage", true)) { new offeredby = PlayerInfo[playerid][pMarriageOffer]; /*if((id = GetInsideBusiness(playerid)) == -1 || BusinessInfo[id][bType] != BUSINESS_RESTAURANT) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at a restaurant to commence a wedding."); } if(PlayerInfo[playerid][pCash] < 25000 || PlayerInfo[offeredby][pCash] < 25000) { return SendClientMessage(playerid, COLOR_GREY, "You both need to have $25,000 in hand to commence a wedding."); }*/ if(!IsPlayerConnected(offeredby) || !IsPlayerInRangeOfPlayer(playerid, offeredby, 15.0)) { return SendClientMessage(playerid, COLOR_GREY, "You aren't in range of anyone who has offered to marry you."); } //GivePlayerCash(playerid, -25000); //GivePlayerCash(offeredby, -25000); //BusinessInfo[id][bCash] += 50000; SendClientMessageToAllEx(COLOR_WHITE, "%s and %s have just married! Congratulations to them.", GetPlayerRPName(offeredby), GetPlayerRPName(playerid)); PlayerInfo[playerid][pMarriedTo] = PlayerInfo[offeredby][pID]; PlayerInfo[offeredby][pMarriedTo] = PlayerInfo[playerid][pID]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET marriedto = %i WHERE uid = %i", PlayerInfo[playerid][pMarriedTo], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET marriedto = %i WHERE uid = %i", PlayerInfo[offeredby][pMarriedTo], PlayerInfo[offeredby][pID]); mysql_tquery(connectionID, queryBuffer); strcpy(PlayerInfo[playerid][pMarriedName], GetPlayerNameEx(offeredby), MAX_PLAYER_NAME); strcpy(PlayerInfo[offeredby][pMarriedName], GetPlayerNameEx(playerid), MAX_PLAYER_NAME); PlayerInfo[playerid][pMarriageOffer] = INVALID_PLAYER_ID; } else if(!strcmp(params, "divorce", true)) { new offeredby = PlayerInfo[playerid][pMarriageOffer]; if(!IsPlayerConnected(offeredby) || !IsPlayerInRangeOfPlayer(playerid, offeredby, 15.0)) { return SendClientMessage(playerid, COLOR_GREY, "You aren't in range of anyone who has offered to divorce you."); } if(PlayerInfo[playerid][pMarriedTo] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You aren't even married."); } if(PlayerInfo[playerid][pMarriedTo] != PlayerInfo[offeredby][pID]) { return SendClientMessage(playerid, COLOR_GREY, "That isn't the person you're married to."); } PlayerInfo[playerid][pMarriedTo] = -1; PlayerInfo[offeredby][pMarriedTo] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET marriedto = -1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET marriedto = -1 WHERE uid = %i", PlayerInfo[offeredby][pID]); mysql_tquery(connectionID, queryBuffer); strcpy(PlayerInfo[playerid][pMarriedName], "Nobody", MAX_PLAYER_NAME); strcpy(PlayerInfo[offeredby][pMarriedName], "Nobody", MAX_PLAYER_NAME); PlayerInfo[playerid][pMarriageOffer] = INVALID_PLAYER_ID; } else { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /accept [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: House, Garage, Business, Land, Death, Vest, Vehicle, Faction, Gang, Ticket, Live, Marriage"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Item, Frisk, Handshake, Weapon, Lawyer, Dicebet, Invite, Robbery, Duel, Alliance"); } return 1; } CMD:togtp(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 8) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command"); } if(!PlayerInfo[playerid][pToggleTP]) { PlayerInfo[playerid][pToggleTP] = 1; } else { PlayerInfo[playerid][pToggleTP] = 0; } return 1; } CMD:e(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /e [Management chat]"); } if(PlayerInfo[playerid][pToggleAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the executive chat as you have admin chats toggled."); } foreach(new i : Player) { if((PlayerInfo[i][pAdmin] > 5) && !PlayerInfo[i][pToggleAdmin]) { SendClientMessageEx(i, 0xA077BFFF, "** [%s] %s: %s **", GetAdminRank(playerid), GetPlayerRPName(playerid), params); } } return 1; } CMD:ha(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /ha [head admin chat]"); } if(PlayerInfo[playerid][pToggleAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the head administrator chat as you have admin chats toggled."); } foreach(new i : Player) { if((PlayerInfo[i][pAdmin] > 4) && !PlayerInfo[i][pToggleAdmin]) { SendClientMessageEx(i, 0x5C80FFFF, "** [%s] %s: %s **", GetAdminRank(playerid), GetPlayerRPName(playerid), params); } } return 1; } CMD:a(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1 && !PlayerInfo[playerid][pDeveloper]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /a [admin chat]"); } if(PlayerInfo[playerid][pToggleAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the admin chat as you have it toggled."); } foreach(new i : Player) { if((PlayerInfo[i][pAdmin] > 0 || PlayerInfo[i][pDeveloper]) && !PlayerInfo[i][pToggleAdmin]) { new adminname[24]; strcpy(adminname, GetPlayerRPName(playerid)); if(PlayerInfo[playerid][pUndercover][0]) { if(strcmp(PlayerInfo[playerid][pAdminName], "None", true)) { strcpy(adminname, PlayerInfo[playerid][pAdminName]); } } if(strlen(params) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_YELLOW, "** [%s %s{FFFF00}] %s: %.*s... **", GetAdminDivision(playerid), GetAdminRank1(playerid), adminname, MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, COLOR_YELLOW, "** [%s %s{FFFF00}] %s: ...%s **", GetAdminDivision(playerid), GetAdminRank1(playerid), adminname, params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_YELLOW, "** [%s %s{FFFF00}] %s: %s **", GetAdminDivision(playerid), GetAdminRank1(playerid), adminname, params); } } } return 1; } CMD:fa(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1 && !PlayerInfo[playerid][pFormerAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /fa [Former Admin chat]"); } if(PlayerInfo[playerid][pToggleAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the Former Admin chat as you have it toggled."); } foreach(new i : Player) { if((PlayerInfo[i][pAdmin] > 0 || PlayerInfo[i][pFormerAdmin]) && !PlayerInfo[i][pToggleAdmin]) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_RETIRED, "** [%s] %s: %.*s... **", GetAdminRank(playerid), GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, COLOR_RETIRED, "** [%s] %s: ...%s **", GetAdminRank(playerid), GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_RETIRED, "** [%s] %s: %s **", GetAdminRank(playerid), GetPlayerRPName(playerid), params); } } } return 1; } new const randFirstname[][] = { "Alex", "Blake", "Hayden", "Devin", "Jane", "John", "Austin", "Richy", "Richard", "Alexander", "Salem", "Daisy", "Janey", "Casey", "Orlando", "Jake", "Kevin", "Faze", "India", "Vene", "Demorgan", "Jazzy", "Dori", "Jess", "Linda", "Dave", "Jessica", "Masey", "Rose", "Romeo", "Juliet", "Ben", "Lenny", "Kayle", "Emily", "Tori", "Michael", "Mike", "Mikey", "Christian", "Josh", "Travis", "Dulles", "William", "Stephen", "Peter", "Quin", "Raze", "Morgan", "Oliver", "Madison", "Mark", "Robin", "Tyler", "Sophie", "Sophia", "Brianna", "Azure", "Steely", "Lee", "Ray", "Harry", "Ralph", "Anthony", "Alan", "Shawn", "Kanye", "Kane", "Stephanie", "Kimmy", "Kim" "Fox", "Bob", "Adore", "Lexi", "Rex", "Hex", "Xav", "Wally", "Stone", "Kate", "Katie", "Patrick", "James", "Thomas", "Hank", "George", "David", "Dori", "Dante", "Jordan", "Arnold" }; new const randLastname[][] = { "Craig", "Jones", "Johnson", "Kennedy", "Hinson", "Doe", "Silva", "Nigeria", "Branche", "Erickson", "Defolt", "Morgan", "Stalovsky", "Box", "Wards", "Sanders", "Williams", "Trump", "Nixon", "Jackson", "Houston", "Hilfiger", "Gucci", "Washington", "Clinton", "Cromwell", "Prime", "Connor", "ONeil", "Rose", "Ginger", "Dodge", "McKing", "Guerreo", "Jackson", "Cartel", "Devil", "Rolex", "Street", "Molintino", "Martin", "Stone", "Henderson", "Brady", "Wilkinson" }; // keep adding names if u want getRandomRPName() { new rand[2], name[60]; rand[0] = random(sizeof(randFirstname)); rand[1] = random(sizeof(randLastname)); if(strcmp(randFirstname[rand[0]], randLastname[rand[1]], true) != 0) { format(name, sizeof(name), "%s_%s", randFirstname[rand[0]], randLastname[rand[1]]); if(strlen(name) < MAX_PLAYER_NAME) { return name; } } return getRandomRPName(); } forward OnUndercover(playerid, tog, name[], level, Float:hp, Float:armor); public OnUndercover(playerid, tog, name[], level, Float:hp, Float:armor) { if(tog) { if(cache_get_row_count(connectionID)) { SendClientMessage(playerid, COLOR_GREY, "The name specified is taken already."); } else { Log_Write("log_admin", "(undercover) %s (uid: %i) changed their name to %s.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], name); SendClientMessageEx(playerid, COLOR_WHITE, "** You changed your name from %s to %s.", GetPlayerRPName(playerid), name); PlayerInfo[playerid][pUndercover][0] = 1; PlayerInfo[playerid][pUndercover][1] = PlayerInfo[playerid][pLevel]; PlayerInfo[playerid][pUndercoverHP] = PlayerInfo[playerid][pHealth]; PlayerInfo[playerid][pUndercoverAR] = PlayerInfo[playerid][pArmor]; PlayerInfo[playerid][pLevel] = level; SetPlayerHealth(playerid, hp); SetScriptArmour(playerid, armor); SetPlayerName(playerid, name); PlayerInfo[playerid][pAdminHide] = 1; SendClientMessage(playerid, COLOR_AQUA, "You are now hidden in /admins and your admin rank no longer shows in /a, /g or /o."); } } else { SetPlayerName(playerid, PlayerInfo[playerid][pUsername]); PlayerInfo[playerid][pUndercover][0] = 0; PlayerInfo[playerid][pLevel] = PlayerInfo[playerid][pUndercover][1]; SetPlayerHealth(playerid, PlayerInfo[playerid][pUndercoverHP]); SetScriptArmour(playerid, PlayerInfo[playerid][pUndercoverAR]); PlayerInfo[playerid][pAdminHide] = 0; SendClientMessage(playerid, COLOR_AQUA, "You are no longer hidden as an administrator."); } return 1; } CMD:undercover(playerid, params[]) { new name[MAX_PLAYER_NAME], level, Float:ar; if(PlayerInfo[playerid][pAdmin] >= 1 && !PlayerInfo[playerid][pAdminDuty]) { if(sscanf(params, "s[24]", name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /undercover [name | random | off]"); } if(PlayerInfo[playerid][pUndercover][0]) { OnUndercover(playerid, 0, "", 0, 0.0, 0.0); SendClientMessageEx(playerid, COLOR_WHITE, "** You are no longer undercover.", GetPlayerRPName(playerid), name); } else if(!strcmp(name, "random", true)) { strcpy(name, getRandomRPName()); level = random(9) + 1; ar = float(random(50)+50); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE username = '%e'", name); mysql_tquery(connectionID, queryBuffer, "OnUndercover", "iisiff", playerid, 1, name, level, 100.0, ar); } else if(strfind(name, "_") != -1) { //format(name, MAX_PLAYER_NAME, params); level = random(9) + 1; ar = float(random(50)+50); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE username = '%e'", name); mysql_tquery(connectionID, queryBuffer, "OnUndercover", "iisiff", playerid, 1, name, level, 100.0, ar); } else { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /undercover [Firstname_Lastname | random]"); } } else SendClientMessage(playerid, COLOR_GREY, "Not Authorized / You need to be off duty to use this command."); return 1; } CMD:ah(playerid, params[]) { return callcmd::adminhelp(playerid, params); } CMD:ahelp(playerid, params[]) { return callcmd::adminhelp(playerid, params); } CMD:adminhelp(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command."); } new str[1400]; switch(PlayerInfo[playerid][pAdmin]) { case 1: { format(str, sizeof(str), "%sTrial Admin\n", str); } case 2: { format(str, sizeof(str), "%sTrial Admin\n", str); format(str, sizeof(str), "%sJunior Admin\n", str); } case 3: { format(str, sizeof(str), "%sTrial Admin\n", str); format(str, sizeof(str), "%sJunior Admin\n", str); format(str, sizeof(str), "%sGeneral Admin\n", str); } case 4: { format(str, sizeof(str), "%sTrial Admin\n", str); format(str, sizeof(str), "%sJunior Admin\n", str); format(str, sizeof(str), "%sGeneral Admin\n", str); format(str, sizeof(str), "%sSenior Admin\n", str); } case 5: { format(str, sizeof(str), "%sTrial Admin\n", str); format(str, sizeof(str), "%sJunior Admin\n", str); format(str, sizeof(str), "%sGeneral Admin\n", str); format(str, sizeof(str), "%sSenior Admin\n", str); format(str, sizeof(str), "%sHead Admin\n", str); } case 6: { format(str, sizeof(str), "%sTrial Admin\n", str); format(str, sizeof(str), "%sJunior Admin\n", str); format(str, sizeof(str), "%sGeneral Admin\n", str); format(str, sizeof(str), "%sSenior Admin\n", str); format(str, sizeof(str), "%sHead Admin\n", str); format(str, sizeof(str), "%sGeneral Manager\n", str); } case 7: { format(str, sizeof(str), "%sTrial Admin\n", str); format(str, sizeof(str), "%sJunior Admin\n", str); format(str, sizeof(str), "%sGeneral Admin\n", str); format(str, sizeof(str), "%sSenior Admin\n", str); format(str, sizeof(str), "%sHead Admin\n", str); format(str, sizeof(str), "%sGeneral Manager\n", str); format(str, sizeof(str), "%sAssistant Management\n", str); } case 8: { format(str, sizeof(str), "%sTrial Admin\n", str); format(str, sizeof(str), "%sJunior Admin\n", str); format(str, sizeof(str), "%sGeneral Admin\n", str); format(str, sizeof(str), "%sSenior Admin\n", str); format(str, sizeof(str), "%sHead Admin\n", str); format(str, sizeof(str), "%sGeneral Manager\n", str); format(str, sizeof(str), "%sAssistant Management\n", str); format(str, sizeof(str), "%sManagement\n", str); } case 9: { format(str, sizeof(str), "%sTrial Admin\n", str); format(str, sizeof(str), "%sJunior Admin\n", str); format(str, sizeof(str), "%sGeneral Admin\n", str); format(str, sizeof(str), "%sSenior Admin\n", str); format(str, sizeof(str), "%sHead Admin\n", str); format(str, sizeof(str), "%sGeneral Manager\n", str); format(str, sizeof(str), "%sAssistant Management\n", str); format(str, sizeof(str), "%sManagement\n", str); } } ShowPlayerDialog(playerid, DIALOG_AHELP, DIALOG_STYLE_LIST, "Admin Help:",str, "Choose", "close"); //print("Command executed"); return 1; } CMD:reports(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } SendClientMessage(playerid, COLOR_NAVYBLUE, "__________ Pending Reports __________"); for(new i = 0; i < MAX_REPORTS; i ++) { if(ReportInfo[i][rExists] && !ReportInfo[i][rAccepted]) { SendClientMessageEx(playerid, COLOR_GREY2, "(RID: %i) %s[%i] reports: %s", i, GetPlayerRPName(ReportInfo[i][rReporter]), ReportInfo[i][rReporter], ReportInfo[i][rText]); } } SendClientMessage(playerid, COLOR_YELLOW, "** Use /ar [rid] or /tr [rid] to handle these reports."); return 1; } CMD:rtnc(playerid, params[]) { new reportid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", reportid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /rtnc [reportid] (Sends to newbie chat)"); } if(!(0 <= reportid < MAX_REPORTS) || !ReportInfo[reportid][rExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid report ID."); } if(ReportInfo[reportid][rAccepted]) { return SendClientMessage(playerid, COLOR_GREY, "The report specified is being handled by another admin."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has sent report %i to newbie chat.", GetPlayerRPName(playerid), reportid); SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_GREEN, "%s has redirected your report to the newbie chat.", GetPlayerRPName(playerid)); SendNewbieChatMessage(ReportInfo[reportid][rReporter], ReportInfo[reportid][rText]); ReportInfo[reportid][rExists] = 0; return 1; } CMD:sth(playerid, params[]) { new reportid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", reportid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sth [reportid] (Sends to helpers)"); } if(!(0 <= reportid < MAX_REPORTS) || !ReportInfo[reportid][rExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid report ID."); } if(ReportInfo[reportid][rAccepted]) { return SendClientMessage(playerid, COLOR_GREY, "The report specified is being handled by another admin."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has sent report %i to helpers.", GetPlayerRPName(playerid), reportid); SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_GREEN, "%s has redirected your report to all helpers online.", GetPlayerRPName(playerid)); strcpy(PlayerInfo[ReportInfo[reportid][rReporter]][pHelpRequest], ReportInfo[reportid][rText], 128); SendHelperMessage(COLOR_AQUA, "** Help Request from %s[%i]: %s **", GetPlayerRPName(ReportInfo[reportid][rReporter]), ReportInfo[reportid][rReporter], ReportInfo[reportid][rText]); PlayerInfo[playerid][pLastRequest] = gettime(); ReportInfo[reportid][rExists] = 0; return 1; } CMD:ar(playerid, params[]) { new reportid, chat; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "iI(1)", reportid, chat)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /ar [reportid] [chat (optional - 0/1)]"); } if(!(0 <= reportid < MAX_REPORTS) || !ReportInfo[reportid][rExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid report ID."); } if(ReportInfo[reportid][rAccepted]) { return SendClientMessage(playerid, COLOR_GREY, "The report specified is being handled by another admin."); } if(PlayerInfo[playerid][pActiveReport] >= 0) { callcmd::cr(playerid, params); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has accepted report %i from %s.", GetPlayerRPName(playerid), reportid, GetPlayerRPName(ReportInfo[reportid][rReporter])); if(chat) { SendClientMessage(playerid, COLOR_WHITE, "You can use /rr to speak with the reporter and /cr to close the report."); SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_GREEN, "%s has accepted your report and is now reviewing it.", GetPlayerRPName(playerid)); SendClientMessage(ReportInfo[reportid][rReporter], COLOR_GREEN, "You can use /rr to reply to the admin handling your report."); PlayerInfo[playerid][pActiveReport] = reportid; PlayerInfo[ReportInfo[reportid][rReporter]][pActiveReport] = reportid; ReportInfo[reportid][rHandledBy] = playerid; ReportInfo[reportid][rAccepted] = 1; } else { SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_GREEN, "%s has accepted your report and is now reviewing it.", GetPlayerRPName(playerid)); ReportInfo[reportid][rExists] = 0; } PlayerInfo[playerid][pReports]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET reports = %i WHERE uid = %i", PlayerInfo[playerid][pReports], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); return 1; } CMD:tr(playerid, params[]) { new reportid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "iS(N/A)[128]", reportid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /tr [reportid] [reason (optional)]"); } if(!(0 <= reportid < MAX_REPORTS) || !ReportInfo[reportid][rExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid report ID."); } if(ReportInfo[reportid][rAccepted]) { return SendClientMessage(playerid, COLOR_GREY, "The report specified is being handled by another admin."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has trashed report %i from %s, reason: %s", GetPlayerRPName(playerid), reportid, GetPlayerRPName(ReportInfo[reportid][rReporter]), reason); SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_LIGHTRED, "** %s has trashed your report, reason: %s", GetPlayerRPName(playerid), reason); ReportInfo[reportid][rExists] = 0; return 1; } CMD:nro(playerid, params[]) { new reportid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", reportid)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /nro [reportid]"); SendClientMessage(playerid, COLOR_SYNTAX, "This command will clear a report for not being a rulebreaking offense."); return 1; } if(!(0 <= reportid < MAX_REPORTS) || !ReportInfo[reportid][rExists]) { return SendClientMessage(playerid, COLOR_GREY, "There's not a report that currently exists with this ID."); } if(ReportInfo[reportid][rAccepted]) { return SendClientMessage(playerid, COLOR_GREY, "This report is already being handled by another administrator."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has trashed report %i from %s as their report involves a non-rulebreaking offense.", GetPlayerRPName(playerid), reportid, GetPlayerRPName(ReportInfo[reportid][rReporter])); SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_LIGHTRED, "%s has trashed your report as it involves a non-rulebreaking offense", GetPlayerRPName(playerid)); SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_LIGHTRED, "Please visit our rules page at ecrp.h0v1n8.nl for a full list of rulebreaking offenses."); ReportInfo[reportid][rExists] = 0; return 1; } CMD:nao(playerid, params[]) { new reportid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", reportid)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /nao [reportid]"); SendClientMessage(playerid, COLOR_SYNTAX, "This command will clear a report if there isn't a high enough administrator online."); return 1; } if(!(0 <= reportid < MAX_REPORTS) || !ReportInfo[reportid][rExists]) { return SendClientMessage(playerid, COLOR_GREY, "There's not a report that currently exists with this ID."); } if(ReportInfo[reportid][rAccepted]) { return SendClientMessage(playerid, COLOR_GREY, "This report is already being handled by another administrator."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has trashed report %i from %s as there are no admins online to handle it.", GetPlayerRPName(playerid), reportid, GetPlayerRPName(ReportInfo[reportid][rReporter])); SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_LIGHTRED, "%s has trashed your report as there no admins online with the authority to handle it.", GetPlayerRPName(playerid)); ReportInfo[reportid][rExists] = 0; return 1; } CMD:ic(playerid, params[]) { new reportid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", reportid)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /ic [reportid]"); SendClientMessage(playerid, COLOR_SYNTAX, "This command will clear a report for being an IC issue"); return 1; } if(!(0 <= reportid < MAX_REPORTS) || !ReportInfo[reportid][rExists]) { return SendClientMessage(playerid, COLOR_GREY, "There's not a report that currently exists with this ID."); } if(ReportInfo[reportid][rAccepted]) { return SendClientMessage(playerid, COLOR_GREY, "This report is already being handled by another administrator."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has trashed report %i from %s as it is an in-character issue.", GetPlayerRPName(playerid), reportid, GetPlayerRPName(ReportInfo[reportid][rReporter])); SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_LIGHTRED, "%s has trashed your report as it is an in-character issue.", GetPlayerRPName(playerid)); ReportInfo[reportid][rExists] = 0; return 1; } CMD:nor(playerid, params[]) { new reportid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", reportid)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /nor [reportid]"); SendClientMessage(playerid, COLOR_SYNTAX, "This command will clear a report if the reporters revive request is invalid."); return 1; } if(!(0 <= reportid < MAX_REPORTS) || !ReportInfo[reportid][rExists]) { return SendClientMessage(playerid, COLOR_GREY, "There's not a report that currently exists with this ID."); } if(ReportInfo[reportid][rAccepted]) { return SendClientMessage(playerid, COLOR_GREY, "This report is already being handled by another administrator."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has trashed report %i from %s as their request for a revive is invalid.", GetPlayerRPName(playerid), reportid, GetPlayerRPName(ReportInfo[reportid][rReporter])); SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_LIGHTRED, "%s has trashed your report as your request for a revive is invalid. (/call 911)", GetPlayerRPName(playerid)); ReportInfo[reportid][rExists] = 0; return 1; } CMD:post(playerid, params[]) { new reportid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", reportid)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /post [reportid]"); SendClientMessage(playerid, COLOR_SYNTAX, "This command will clear a report and notify the player to post an admin request."); return 1; } if(!(0 <= reportid < MAX_REPORTS) || !ReportInfo[reportid][rExists]) { return SendClientMessage(playerid, COLOR_GREY, "There's not a report that currently exists with this ID."); } if(ReportInfo[reportid][rAccepted]) { return SendClientMessage(playerid, COLOR_GREY, "This report is already being handled by another administrator."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has trashed report %i from %s as it needs to be handled on the forums.", GetPlayerRPName(playerid), reportid, GetPlayerRPName(ReportInfo[reportid][rReporter])); SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_LIGHTRED, "%s has trashed your report as your issue at hand must be handled on our forums.", GetPlayerRPName(playerid)); SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_LIGHTRED, "Please visit our website at ecrp.h0v1n8.nl in order to to resolve this issue."); ReportInfo[reportid][rExists] = 0; return 1; } CMD:norevive(playerid, params[]) { return callcmd::nor(playerid, params); } CMD:er(playerid, params[]) { return callcmd::cr(playerid, params); } CMD:bigears(playerid, params[]) { return callcmd::listen(playerid, params); } CMD:rr(playerid, params[]) { new reportid = PlayerInfo[playerid][pActiveReport]; if(reportid == -1) { return SendClientMessage(playerid, COLOR_GREY, "You have no active report to reply to."); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /rr [reply text]"); } if(ReportInfo[reportid][rReporter] == playerid) { SendClientMessageEx(ReportInfo[reportid][rHandledBy], COLOR_YELLOW, "** Player %s (ID %i): %s **", GetPlayerRPName(playerid), playerid, params); SendClientMessageEx(playerid, COLOR_YELLOW, "** Reply to %s (ID %i): %s **", GetPlayerRPName(ReportInfo[reportid][rHandledBy]), ReportInfo[reportid][rHandledBy], params); } else { SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_YELLOW, "** Admin %s (ID %i): %s **", GetPlayerRPName(playerid), playerid, params); SendClientMessageEx(playerid, COLOR_YELLOW, "** Reply to %s (ID %i): %s **", GetPlayerRPName(ReportInfo[reportid][rReporter]), ReportInfo[reportid][rReporter], params); } return 1; } CMD:cr(playerid, params[]) { new reportid = PlayerInfo[playerid][pActiveReport]; if(reportid == -1) { return SendClientMessage(playerid, COLOR_GREY, "You have no active report which you can close."); } if(ReportInfo[reportid][rReporter] == playerid) { SendClientMessageEx(ReportInfo[reportid][rHandledBy], COLOR_YELLOW, "** Player %s has closed the report. **", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_GREEN, "You have closed the report and ended your conversation with the admin."); } else { SendClientMessageEx(ReportInfo[reportid][rReporter], COLOR_YELLOW, "** Administrator %s has closed the report. **", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_GREEN, "You have closed the report and ended your conversation with the reporter."); } if(ReportInfo[reportid][rReporter] != INVALID_PLAYER_ID) { PlayerInfo[ReportInfo[reportid][rReporter]][pActiveReport] = -1; } if(ReportInfo[reportid][rHandledBy] != INVALID_PLAYER_ID) { PlayerInfo[ReportInfo[reportid][rHandledBy]][pActiveReport] = -1; } ReportInfo[reportid][rExists] = 0; ReportInfo[reportid][rAccepted] = 0; ReportInfo[reportid][rReporter] = INVALID_PLAYER_ID; ReportInfo[reportid][rHandledBy] = INVALID_PLAYER_ID; PlayerInfo[playerid][pActiveReport] = -1; return 1; } CMD:skick(playerid, params[]) { new targetid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /skick [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be kicked."); } Log_Write("log_punishments", "%s (uid: %i) silently kicked %s (uid: %i), reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], reason); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has silently kicked %s, reason: %s", GetPlayerRPName(playerid), GetPlayerRPName(targetid), reason); KickPlayer(targetid); return 1; } CMD:sban(playerid, params[]) { new targetid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sban [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be banned."); } Log_Write("log_punishments", "%s (uid: %i) silently banned %s (uid: %i), reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], reason); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was silently banned by %s, reason: %s", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason); BanPlayer(targetid, GetPlayerNameEx(playerid), reason, false); return 1; } CMD:sjail(playerid, params[]) { new targetid, minutes, reason[128]; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "uis[128]", targetid, minutes, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sjail [playerid] [minutes] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be jailed."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(minutes < 0) { return SendClientMessage(playerid, COLOR_GREY, "The amount of minutes specified cannot be below zero."); } PlayerInfo[targetid][pJailType] = 1; PlayerInfo[targetid][pJailTime] = minutes * 60; ResetPlayerWeaponsEx(targetid); ResetPlayer(targetid); SetPlayerInJail(targetid); Log_Write("log_punishments", "%s (uid: %i) silently jailed %s (uid: %i) for %i minutes, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], minutes, reason); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was jailed for %i minutes by an Admin, reason: %s", GetPlayerRPName(targetid), minutes, reason); SendClientMessageEx(targetid, COLOR_AQUA, "** You have been jailed for %i minutes by an admin.", minutes); return 1; } CMD:pinfo(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /pinfo [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } SendClientMessageEx(playerid, COLOR_GREY1, "(ID: %i) - (Name: %s) - (Ping: %i) - (FPS: %i) - (Packet Loss: %.1f%c)", targetid, GetPlayerRPName(targetid), GetPlayerPing(targetid), PlayerInfo[targetid][pFPS], NetStats_PacketLossPercent(targetid), '%'); return 1; } CMD:admins(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1 && !PlayerInfo[playerid][pDeveloper]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_________ Admins Online _________"); foreach(new i : Player) { if(PlayerInfo[i][pAdmin] > 0 && !PlayerInfo[i][pUndercover][0] || PlayerInfo[playerid][pAdmin] >= 6 && PlayerInfo[i][pUndercover][0]) { new division[5]; strcpy(division, GetAdminDivision(i)); if(strlen(division) < 1) division = "None"; if(!strcmp(PlayerInfo[i][pAdminName], "None", true)) SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s %s - Division: %s - Status: %s{C8C8C8} - Reports Handled: %i - Tabbed: %s", i, GetAdminRank(i), PlayerInfo[i][pUsername], division, (PlayerInfo[i][pAdminDuty]) ? ("{00AA00}On Duty") : ("Off Duty"), PlayerInfo[i][pReports], (PlayerInfo[i][pAFK]) ? ("Yes") : ("No")); else SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s %s (%s) - Division: %s - Status: %s{C8C8C8} - Reports Handled: %i - Tabbed: %s", i, GetAdminRank(i), PlayerInfo[i][pUsername], PlayerInfo[i][pAdminName], division, (PlayerInfo[i][pAdminDuty]) ? ("{00AA00}On Duty") : ("Off Duty"), PlayerInfo[i][pReports], (PlayerInfo[i][pAFK]) ? ("Yes") : ("No")); } } return 1; } CMD:checknewbies(playerid, params[]) { new targetid; if(!PlayerInfo[playerid][pAdmin] && PlayerInfo[playerid][pHelper] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /checknewbies [playerid]"); } SendClientMessageEx(playerid, COLOR_GREY, "Level %i Player %s has used newbie {00FF00}%s times.", PlayerInfo[targetid][pLevel], GetPlayerRPName(targetid), FormatNumber(PlayerInfo[targetid][pNewbies], 0)); return 1; } CMD:helpers(playerid, params[]) { SendClientMessage(playerid, COLOR_NAVYBLUE, "_________ Helpers Online _________"); foreach(new i : Player) { if(PlayerInfo[i][pHelper] > 0 && !PlayerInfo[i][pPassport] && !PlayerInfo[i][pUndercover][0]) { if(PlayerInfo[playerid][pAdmin] > 0 || PlayerInfo[playerid][pHelper] > 0) SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s %s - Help Requests: %s - Newbies: %s", i, GetHelperRank(i), GetPlayerRPName(i), FormatNumber(PlayerInfo[i][pHelpRequests], 0), FormatNumber(PlayerInfo[i][pNewbies], 0)); else SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s %s", i, GetHelperRank(i), GetPlayerRPName(i)); } } return 1; } CMD:flag(playerid, params[]) { new targetid, desc[128]; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, desc)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /flag [playerid] [description]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, '%s', NOW(), '%e')", PlayerInfo[targetid][pID], GetPlayerNameEx(playerid), desc); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s flagged %s's account for '%s'.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), desc); return 1; } CMD:oflag(playerid, params[]) { new name[24], desc[128]; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]s[128]", name, desc)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /oflag [username] [description]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE username = '%e'", name); mysql_tquery(connectionID, queryBuffer, "OnAdminOfflineFlag", "iss", playerid, name, desc); return 1; } CMD:listflagged(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } mysql_tquery(connectionID, "SELECT b.username FROM flags a, users b WHERE a.uid = b.uid ORDER BY b.username", "OnQueryFinished", "ii", THREAD_LIST_FLAGGED, playerid); return 1; } CMD:ocheck(playerid, params[]) { new name[24]; if(PlayerInfo[playerid][pAdmin] < 1 && !PlayerInfo[playerid][pHumanResources]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]", name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /ocheck [username]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM users WHERE username = '%e'", name); mysql_tquery(connectionID, queryBuffer, "OnAdminOfflineCheck", "is", playerid, name); return 1; } CMD:removeflag(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removeflag [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM flags WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer, "OnAdminListFlagsForRemoval", "ii", playerid, targetid); return 1; } CMD:listflags(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /listflags [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM flags WHERE uid = %i ORDER BY date DESC", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer, "OnListPlayerFlags", "ii", playerid, targetid); return 1; } CMD:hhcheck(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /hhcheck [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pHHCheck]) { return SendClientMessage(playerid, COLOR_GREY, "That player is already being checked for health hacks."); } if(gettime() - PlayerInfo[playerid][pLastUpdate] >= 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't initiate this check on a tabbed player."); } GetPlayerHealth(targetid, PlayerInfo[targetid][pHealth]); PlayerInfo[targetid][pHHCheck] = 1; PlayerInfo[targetid][pHHTime] = 5; PlayerInfo[targetid][pHHRounded] = GetPlayerHealthEx(targetid); PlayerInfo[targetid][pHHCount] = 0; SetPlayerHealth(targetid, random(100) + 1); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has started the health hack check on %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:spec(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!strcmp(params, "off", true) && GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) { SendClientMessageEx(playerid, COLOR_ORANGE, "You are no longer spectating %s (ID %i).", GetPlayerRPName(PlayerInfo[playerid][pSpectating]), PlayerInfo[playerid][pSpectating]); PlayerInfo[playerid][pSpectating] = INVALID_PLAYER_ID; SetPlayerToSpawn(playerid); if(PlayerInfo[playerid][pAdmin] == 1) { PlayerInfo[playerid][pTogglePhone] = 0; } return 1; } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /spec [playerid/off]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't spectate yourself."); } if(!IsPlayerSpawned(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is either not spawned, or spectating."); } if(PlayerInfo[playerid][pAdmin] == 1) { PlayerInfo[playerid][pTogglePhone] = 1; } SavePlayerVariables(playerid); TogglePlayerSpectating(playerid, 1); SetPlayerInterior(playerid, GetPlayerInterior(targetid)); SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid)); if(IsPlayerInAnyVehicle(targetid)) { PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid)); } else { PlayerSpectatePlayer(playerid, targetid); } RefreshPlayerTextdraws(playerid); PlayerInfo[playerid][pSpectating] = targetid; SendClientMessageEx(playerid, COLOR_ORANGE, "You are now spectating %s (ID %i).", GetPlayerRPName(PlayerInfo[playerid][pSpectating]), PlayerInfo[playerid][pSpectating]); return 1; } CMD:poll(playerid, params[]) { new option[10]; if(sscanf(params, "s[10]", option)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /poll [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of Options: Create, End, View, Answer"); return 1; } if(!strcmp(params, "create", true)) { if(PlayerInfo[playerid][pAdmin] < 2) return 1; if(isnull(pollQuestion)) { if(!PlayerInfo[playerid][pCreatingPoll]) { ShowDialogToPlayer(playerid, DIALOG_CREATEPOLL); } } else { SendClientMessage(playerid, COLOR_GREY, "There is already an active poll!"); } } else if(!strcmp(params, "end", true)) { if(PlayerInfo[playerid][pAdmin] < 2) return 1; if(!isnull(pollQuestion)) { pollQuestion[0] = EOS; for(new i; i < 2; i ++) { pollAnswers[i][0] = EOS; } SendClientMessageToAllEx(COLOR_RETIRED, "The poll was ended by %s, results %s: %i, %s: %i", GetPlayerRPName(playerid), pollAnswers[0], pollAnswerCount[0], pollAnswers[1], pollAnswerCount[1]); } } else if(!strcmp(params, "view", true)) { if(!PlayerInfo[playerid][pAnsweredPoll]) { return SendClientMessage(playerid, COLOR_GREY, "You haven't answered the poll yet."); } ShowDialogToPlayer(playerid, DIALOG_POLLVIEW); } else if(!strcmp(params, "answer", true)) { if(PlayerInfo[playerid][pAnsweredPoll]) { return SendClientMessage(playerid, COLOR_GREY, "You've already answered the poll."); } ShowDialogToPlayer(playerid, DIALOG_POLLANSWER); } return 1; } CMD:allhunt(playerid, params[]) { new targetid, weaponid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid, weaponid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /allhunt [targetid] [weapon (0 for wepset)]"); } if(PlayerInfo[targetid][pHours] < 2 || PlayerInfo[targetid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is either weapon restricted or played less than two playing hours."); } if(weaponid == 38 && PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "The minigun was disabled due to abuse."); } SavePlayerVariables(targetid); ResetPlayerWeapons(targetid); if(weaponid != 0 && (1 <= weaponid <= 46)) { GivePlayerWeaponEx(weaponid, weaponid, true); } else { GivePlayerWeaponEx(targetid, 24, true); GivePlayerWeaponEx(targetid, 29, true); GivePlayerWeaponEx(targetid, 31, true); GivePlayerWeaponEx(targetid, 34, true); } PlayerInfo[targetid][pJoinedEvent] = 1; PlayerInfo[targetid][pHunted] = 1; foreach(new i : Player) { if(PlayerInfo[i][pLogged] && GetPlayerInterior(i) == GetPlayerInterior(targetid)) { SetPlayerMarkerForPlayer(i, targetid, COLOR_RETIRED); } } SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s has made %s a hunted. Kill them to win a prize!", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:quiz(playerid, params[]) { new option[10], param[32]; if(sscanf(params, "s[10]S()[32]", option, param)) { if(PlayerInfo[playerid][pAdmin] >= 2) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /quiz [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of Options: Create, End, Edit, Answer"); } else { //SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /quiz answer [text]"); strcpy(option, "answer"); } return 1; } if(!strcmp(option, "create", true)) { if(PlayerInfo[playerid][pAdmin] < 2) return 1; if(isnull(quizQuestion)) { if(CreateQuiz == -1) { ShowDialogToPlayer(playerid, DIALOG_CREATEQUIZ); } } else { SendClientMessage(playerid, COLOR_GREY, "There is already an on-going quiz!"); } return 1; } else if(!strcmp(option, "end", true)) { if(PlayerInfo[playerid][pAdmin] < 2) return 1; if(!isnull(quizQuestion)) { quizQuestion[0] = EOS; SendClientMessageToAllEx(COLOR_RETIRED, "The quiz was ended by %s, answer: %s", GetPlayerRPName(playerid), quizAnswer); quizAnswer[0] = EOS; } return 1; } else if(!strcmp(option, "edit", true)) { if(PlayerInfo[playerid][pAdmin] < 2) return 1; if(strlen(param) > 0) { strcpy(quizAnswer, param); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s changed the quiz answer to %s.", GetPlayerRPName(playerid), quizAnswer); } else { SendClientMessage(playerid, COLOR_GREY, "USAGE: /quiz edit [answer]"); } } else if(!strcmp(option, "answer", true)) { if(isnull(quizAnswer)) { return SendClientMessage(playerid, COLOR_GREY, "There is no active quiz!"); } if(!isnull(param)) { if(!strcmp(quizAnswer, param, true)) { SendClientMessageToAllEx(COLOR_RETIRED, "%s has answered the quiz correctly. answer: %s", GetPlayerRPName(playerid), quizAnswer); quizQuestion[0] = EOS; quizAnswer[0] = EOS; } else { SendClientMessage(playerid, COLOR_GREY, "Sorry bud, that ain't the right answer."); } } else { SendClientMessage(playerid, COLOR_GREY, "USAGE: /quiz answer [answer]"); } } return 1; } CMD:forcedeleteobject(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 6 || PlayerInfo[playerid][pDeveloper]) { new mode[32]; if(sscanf(params, "s[32]", mode)) return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /forcedeleteobject [enable/disable]"); if(!strcmp(mode, "enable", true)) { PlayerInfo[playerid][pDeleteMode] = 1; } else if(!strcmp(mode, "disable", true)) { PlayerInfo[playerid][pDeleteMode] = 0; } else { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /forcedeleteobject [enable/disable]"); } SendClientMessageEx(playerid, COLOR_GREY, "Object deletetion mode was %sd (%i)", mode, PlayerInfo[playerid][pDeleteMode]); } return 1; } CMD:godshand(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 8) { new targetid; if(sscanf(params, "u", targetid)) return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /godshand [playerid]"); if(PlayerInfo[playerid][pGodshand] == 1) { SendClientMessage(playerid, COLOR_GREY, "Aww, that's sad as fuck."); PlayerInfo[targetid][pGodshand] = 0; } else { SendClientMessage(playerid, COLOR_GREY, "Granted it is."); PlayerInfo[targetid][pGodshand] = 1; } return 1; } return -1; } CMD:choke(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 2) { new targetid; if(sscanf(params, "u", targetid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /choke [playerid] "); ApplyAnimation(targetid,"ped","gas_cwr",4.1,1,1,1,0,0,0); if(PlayerInfo[playerid][pAdmin] <= PlayerInfo[targetid][pAdmin]) return SendClientMessageEx(playerid, COLOR_GREY, "You cannot choke higher level administrators."); SendProximityMessage(targetid, 30.0, COLOR_PURPLE, "* %s bends over as he chokes by god's hand.", GetPlayerRPName(targetid)); } else SendClientMessageEx(playerid, COLOR_GREY, "Your not authorized to use that command!"); return 1; } CMD:kick(playerid, params[]) { new targetid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /kick [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be kicked."); } Log_Write("log_punishments", "%s (uid: %i) kicked %s (uid: %i), reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], reason); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was kicked by %s, reason: %s", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason); KickPlayer(targetid); return 1; } CMD:ban(playerid, params[]) { new targetid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /ban [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be banned."); } Log_Write("log_punishments", "%s (uid: %i) banned %s (uid: %i), reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], reason); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was banned by %s, reason: %s", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason); BanPlayer(targetid, GetPlayerNameEx(playerid), reason); return 1; } CMD:warn(playerid, params[]) { new targetid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /warn [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be warned."); } PlayerInfo[targetid][pWarnings]++; Log_Write("log_punishments", "%s (uid: %i) warned %s (uid: %i), reason: %s (%i/3)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], reason, PlayerInfo[targetid][pWarnings]); if(PlayerInfo[targetid][pWarnings] < 3) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was warned by %s, reason: %s", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason); SendClientMessageEx(targetid, COLOR_LIGHTRED, "%s has warned you, reason: %s", GetPlayerRPName(playerid), reason); } else { PlayerInfo[targetid][pWarnings] = 0; SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was banned by %s, reason: %s (3/3 warnings)", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason); BanPlayer(targetid, GetPlayerNameEx(playerid), reason); } return 1; } CMD:check(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /check [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } ShowStats(playerid, targetid); return 1; } ShowStats(playerid, targetid = INVALID_PLAYER_ID) { if(targetid == INVALID_PLAYER_ID) targetid = playerid; new name[24], gender[8], faction[48], facrank[32], gang[32], gangrank[32], gangcrew[32], division[32], insurance[24], Float:health, Float:armor; new job[32], secondjob[32], jailtype[32]; new hungerlvl, thirstlvl; if(targetid == MAX_PLAYERS) { strcpy(name, PlayerInfo[targetid][pUsername]); } else { strcat(name, GetPlayerRPName(targetid)); } if(PlayerInfo[targetid][pGender] == 1) gender = "Male"; else if(PlayerInfo[targetid][pGender] == 2) gender = "Female"; else if(PlayerInfo[targetid][pGender] == 3) gender = "Shemale"; switch(PlayerInfo[targetid][pInsurance]) { case HOSPITAL_COUNTY: insurance = "Fort Carson Hospital"; default: insurance = "None"; } if(PlayerInfo[targetid][pFaction] >= 0) { if(!strcmp(FactionInfo[PlayerInfo[targetid][pFaction]][fShortName], "None", true)) { strcpy(faction, FactionInfo[PlayerInfo[targetid][pFaction]][fName]); } else { strcpy(faction, FactionInfo[PlayerInfo[targetid][pFaction]][fShortName]); } format(facrank, sizeof(facrank), "%s (%i)", FactionRanks[PlayerInfo[targetid][pFaction]][PlayerInfo[targetid][pFactionRank]], PlayerInfo[targetid][pFactionRank]); if(PlayerInfo[targetid][pDivision] >= 0) { strcpy(division, FactionDivisions[PlayerInfo[targetid][pFaction]][PlayerInfo[targetid][pDivision]]); } else { division = "None"; } } else { faction = "None"; facrank = "N/A (0)"; division = "None"; } if(PlayerInfo[targetid][pGang] >= 0) { strcpy(gang, GangInfo[PlayerInfo[targetid][pGang]][gName]); format(gangrank, sizeof(gangrank), "%s (%i)", GangRanks[PlayerInfo[targetid][pGang]][PlayerInfo[targetid][pGangRank]], PlayerInfo[targetid][pGangRank]); if(PlayerInfo[targetid][pCrew] >= 0) { strcpy(gangcrew, GangCrews[PlayerInfo[targetid][pGang]][PlayerInfo[targetid][pCrew]]); } } else { gang = "None"; gangrank = "N/A (0)"; gangcrew = "None"; } /*switch(PlayerInfo[targetid][pVIPPackage]) { case 0: maxarmor = 100.0; case 1, 2: maxarmor = 125.0; case 3: maxarmor = 150.0; }*/ if(targetid == MAX_PLAYERS) { health = PlayerInfo[targetid][pHealth]; armor = PlayerInfo[targetid][pArmor]; } else { GetPlayerHealth(targetid, health); GetPlayerArmour(targetid, armor); } hungerlvl = PlayerInfo[targetid][pHunger]; thirstlvl = PlayerInfo[targetid][pThirst]; if(PlayerInfo[targetid][pJob] != JOB_NONE) { format(job, sizeof(job), "%s (%i)", GetJobName(PlayerInfo[targetid][pJob]), GetJobLevel(targetid, PlayerInfo[targetid][pJob])); } else { job = "None"; } if(PlayerInfo[targetid][pSecondJob] != JOB_NONE) { format(secondjob, sizeof(secondjob), "%s (%i)", GetJobName(PlayerInfo[targetid][pSecondJob]), GetJobLevel(targetid, PlayerInfo[targetid][pSecondJob])); } else { secondjob = "None"; } new totalwealth = PlayerInfo[targetid][pCash] + PlayerInfo[targetid][pBank]; foreach(new i : House) { if(HouseInfo[i][hExists] && PlayerInfo[targetid][pID] == HouseInfo[i][hOwnerID]) { totalwealth += HouseInfo[i][hCash]; } } foreach(new i : Business) { if(BusinessInfo[i][bExists] && PlayerInfo[targetid][pID] == BusinessInfo[i][bOwnerID]) { totalwealth += BusinessInfo[i][bCash]; } } switch(PlayerInfo[targetid][pJailType]) { case 0: jailtype = "None"; case 1: jailtype = "OOC jail"; case 2: jailtype = "OOC prison"; case 3: jailtype = "IC prison"; } /* SendClientMessageEx(targetid, 0x7514F6FF, "____________________ %s [%s] ____________________", name, GetDate()); SendClientMessageEx(targetid, COLOR_WHITE, "Level: %i - Gender: %s - Age: %i - Cash: %s - Bank: %s - Hours: %s - Ph: %i", ); SendClientMessageEx(targetid, COLOR_NAVYBLUE, "Total Wealth: %s - Experience: %s/%s - Next Level: %s - Upgrade Points: %i", ); SendClientMessageEx(targetid, COLOR_WHITE, "Inventory Skill: %i/5 - Addict Skill: %i/3 - Trader Skill: %i/3 - Asset Skill: %i/4 - Labor Skill: %i/5", ); SendClientMessageEx(targetid, COLOR_NAVYBLUE, "Job: %s - Job 2: %s - Crimes Commited: %s - Times Arrested: %s - Wanted Level: %i", job, secondjob, FormatNumber(PlayerInfo[targetid][pCrimes], 0), FormatNumber(PlayerInfo[targetid][pArrested], 0), PlayerInfo[targetid][pWantedLevel]); SendClientMessageEx(targetid, COLOR_WHITE, "Warnings: %i - DM Warnings: %i/3 - Report Warnings: %i/3 - Weapon Restriction: %i hours", ); SendClientMessageEx(targetid, COLOR_NAVYBLUE, "Faction: %s - Rank: %s - Division: %s - Gang: %s - Rank: %s - Crew: %s", faction, facrank, division, gang, gangrank, gangcrew); SendClientMessageEx(targetid, COLOR_WHITE, "Paycheck: %s - Insurance: %s - Channel: %i - cookies: %s - VIP Package: %s", FormatNumber(PlayerInfo[targetid][pPaycheck]), insurance, PlayerInfo[targetid][pChannel], FormatNumber(PlayerInfo[targetid][pCookies], 0), GetVIPRank(PlayerInfo[targetid][pVIPPackage])); SendClientMessageEx(targetid, COLOR_NAVYBLUE, "Playing Time: %i/60 mins - Jail Type: %s - Jail Time: %s sec - Double XP: %i hours", PlayerInfo[targetid][pMinutes], jailtype, FormatNumber(PlayerInfo[targetid][pJailTime], 0), PlayerInfo[targetid][pDoubleXP]); SendClientMessageEx(targetid, COLOR_WHITE, "Married To: %s", PlayerInfo[targetid][pMarriedName]); if(PlayerInfo[targetid][pAdmin] > 0) { SendClientMessageEx(targetid, COLOR_LIGHTRED, "Interior: %i - Virtual: %i - FPS: %i - AFK: %s - Reports: %s - Help Requests: %s - Newbie Replies: %s", (targetid == MAX_PLAYERS) ? (PlayerInfo[targetid][pInterior]) : (GetPlayerInterior(targetid)), (targetid == MAX_PLAYERS) ? (PlayerInfo[targetid][pWorld]) : (GetPlayerVirtualWorld(targetid)), (targetid == MAX_PLAYERS) ? (0) : (PlayerInfo[targetid][pFPS]), (targetid == MAX_PLAYERS) ? ("No") : ((PlayerInfo[targetid][pAFK]) ? ("Yes") : ("No")), FormatNumber(PlayerInfo[targetid][pReports], 0), FormatNumber(PlayerInfo[targetid][pHelpRequests], 0), FormatNumber(PlayerInfo[targetid][pNewbies], 0)); } */ new str[2000]; format(str, sizeof(str), "%s{FFFFFF}Name: %s\n", str, name); format(str, sizeof(str), "%s{378AC8}\n_________________________________________________________________________________\n\n", str); format(str, sizeof(str), "%s{FFFFFF}Total Wealth: %s{378AC8}|{FFFFFF}Experience: %s / %s {378AC8}|{FFFFFF} Upgrade Points: %i\n", str,FormatNumber(totalwealth), FormatNumber(PlayerInfo[targetid][pEXP], 0), FormatNumber((PlayerInfo[targetid][pLevel] * 4), 0), FormatNumber((PlayerInfo[targetid][pLevel] + 1) * 5000), PlayerInfo[targetid][pUpgradePoints]); format(str, sizeof(str), "%s{FFFFFF}Level: %i {378AC8}|{FFFFFF} Gender: %s {378AC8}|{FFFFFF} Age: %i {378AC8}|{FFFFFF} Cash: %s {378AC8}|{FFFFFF} Bank: %s {378AC8}|{FFFFFF} Hours: %s {378AC8}|{FFFFFF} Ph: %i\n", str,PlayerInfo[targetid][pLevel], gender, PlayerInfo[targetid][pAge], FormatNumber(PlayerInfo[targetid][pCash]), FormatNumber(PlayerInfo[targetid][pBank]), FormatNumber(PlayerInfo[targetid][pHours], 0), PlayerInfo[targetid][pPhone]); format(str, sizeof(str), "%s{FFFFFF}Inventory Skill: %i/5 {378AC8}|{FFFFFF} Addict Skill: %i/3 {378AC8}|{FFFFFF} Trader Skill: %i/3 {378AC8}|{FFFFFF} Asset Skill: %i/4 {378AC8}|{FFFFFF} Labor Skill: %i/5\n", str,PlayerInfo[targetid][pInventoryUpgrade], PlayerInfo[targetid][pAddictUpgrade], PlayerInfo[targetid][pTraderUpgrade], PlayerInfo[targetid][pAssetUpgrade], PlayerInfo[targetid][pLaborUpgrade]); format(str, sizeof(str), "%s{378AC8}\n_________________________________________________________________________________\n\n", str); format(str, sizeof(str), "%s{FFFFFF}Job: %s {378AC8}|{FFFFFF} Job 2: %s {378AC8}|{FFFFFF} Crimes Commited: %s {378AC8}|{FFFFFF} Times Arrested: %s {378AC8}|{FFFFFF} Wanted Level: %i\n", str,job, secondjob, FormatNumber(PlayerInfo[targetid][pCrimes], 0), FormatNumber(PlayerInfo[targetid][pArrested], 0), PlayerInfo[targetid][pWantedLevel]); format(str, sizeof(str), "%s{FFFFFF}Warnings: %i {378AC8}|{FFFFFF} DM Warnings: %i/3 {378AC8}|{FFFFFF} Report Warnings: %i/3 {378AC8}|{FFFFFF} Weapon Restriction: %i hours\n", str,PlayerInfo[targetid][pWarnings], PlayerInfo[targetid][pDMWarnings], PlayerInfo[targetid][pReportWarns], PlayerInfo[targetid][pWeaponRestricted] ); format(str, sizeof(str), "%s{378AC8}\n_________________________________________________________________________________\n\n", str); format(str, sizeof(str), "%s{FFFFFF}Faction: %s {378AC8}|{FFFFFF} Rank: %s {378AC8}|{FFFFFF} Division: %s {378AC8}|{FFFFFF} Gang: %s {378AC8}|{FFFFFF} Rank: %s {378AC8}|{FFFFFF} Crew: %s\n", str,faction, facrank, division, gang, gangrank, gangcrew); format(str, sizeof(str), "%s{FFFFFF}Paycheck: %s {378AC8}|{FFFFFF} Insurance: %s {378AC8}|{FFFFFF} Channel: %i {378AC8}|{FFFFFF} cookies: %s {378AC8}|{FFFFFF} VIP Package: %s\n", str,FormatNumber(PlayerInfo[targetid][pPaycheck]), insurance, PlayerInfo[targetid][pChannel], FormatNumber(PlayerInfo[targetid][pCookies], 0), GetVIPRank(PlayerInfo[targetid][pVIPPackage]) ); format(str, sizeof(str), "%s{378AC8}\n_________________________________________________________________________________\n\n", str); format(str, sizeof(str), "%s{FFFFFF}Playing Time: %i/60 mins {378AC8}|{FFFFFF} Jail Type: %s {378AC8}|{FFFFFF} Jail Time: %s sec {378AC8}|{FFFFFF} Double XP: %i hours\n", str,PlayerInfo[targetid][pMinutes], jailtype, FormatNumber(PlayerInfo[targetid][pJailTime], 0), PlayerInfo[targetid][pDoubleXP] ); format(str, sizeof(str), "%s{FFFFFF}Hunger: %i | Thirst: %i | %s Marriage: %s\n", str, hungerlvl, thirstlvl, PlayerInfo[targetid][pMarriedName] ); format(str, sizeof(str), "%s{378AC8}\n_________________________________________________________________________________\n\n", str); if(PlayerInfo[targetid][pAdmin] > 0) { format(str, sizeof(str), "%s{FFFFFF}Interior: %i - Virtual: %i - FPS: %i - AFK: %s - Reports: %s - Help Requests: %s - Newbie Replies: %s", str,(targetid == MAX_PLAYERS) ? (PlayerInfo[targetid][pInterior]) : (GetPlayerInterior(targetid)), (targetid == MAX_PLAYERS) ? (PlayerInfo[targetid][pWorld]) : (GetPlayerVirtualWorld(targetid)), (targetid == MAX_PLAYERS) ? (0) : (PlayerInfo[targetid][pFPS]), (targetid == MAX_PLAYERS) ? ("No") : ((PlayerInfo[targetid][pAFK]) ? ("Yes") : ("No")), FormatNumber(PlayerInfo[targetid][pReports], 0), FormatNumber(PlayerInfo[targetid][pHelpRequests], 0), FormatNumber(PlayerInfo[targetid][pNewbies], 0) ); } ShowPlayerDialog(playerid, DIALOG_STATS, DIALOG_STYLE_MSGBOX, "{FCCE3C}Countryside{FFFFFF} Stats:",str, "Close",""); } CMD:checkinv(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /checkinv [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } DisplayInventory(targetid, playerid); return 1; } CMD:slap(playerid, params[]) { new targetid, Float:height; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "uF(5.0)", targetid, height)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /slap [playerid] [height (optional)]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!IsPlayerSpawned(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is not spawned and therefore cannot be slapped."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be slapped."); } new Float:x, Float:y, Float:z; GetPlayerPos(targetid, x, y, z); SetPlayerPos(targetid, x, y, z + height); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was slapped by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); PlayerPlaySound(targetid, 1130, 0.0, 0.0, 0.0); return 1; } CMD:upgrade(playerid, params[]) { if(isnull(params)) { SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /upgrade [option] (%i points available)", PlayerInfo[playerid][pUpgradePoints]); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Inventory, Addict, Trader, Asset, Labor, SpawnHealth, SpawnArmor"); return 1; } if(PlayerInfo[playerid][pUpgradePoints] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You have no upgrade points available which you can spend."); } if(!strcmp(params, "inventory", true)) { if(PlayerInfo[playerid][pInventoryUpgrade] >= 5) { return SendClientMessage(playerid, COLOR_GREY, "Your inventory skill is already upgraded to its maximum level of 5."); } PlayerInfo[playerid][pInventoryUpgrade]++; PlayerInfo[playerid][pUpgradePoints]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET inventoryupgrade = %i, upgradepoints = %i WHERE uid = %i", PlayerInfo[playerid][pInventoryUpgrade], PlayerInfo[playerid][pUpgradePoints], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You upgraded your inventory skill to %i/5. Your inventory capacity was increased.", PlayerInfo[playerid][pInventoryUpgrade]); } else if(!strcmp(params, "addict", true)) { if(PlayerInfo[playerid][pAddictUpgrade] >= 3) { return SendClientMessage(playerid, COLOR_GREY, "Your addict skill is already upgraded to its maximum level of 3."); } PlayerInfo[playerid][pAddictUpgrade]++; PlayerInfo[playerid][pUpgradePoints]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET addictupgrade = %i, upgradepoints = %i WHERE uid = %i", PlayerInfo[playerid][pAddictUpgrade], PlayerInfo[playerid][pUpgradePoints], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You upgraded your addict skill to level %i/3. You now gain %.1f more health & armor when using drugs.", PlayerInfo[playerid][pAddictUpgrade], PlayerInfo[playerid][pAddictUpgrade] * 5.0); } else if(!strcmp(params, "trader", true)) { if(PlayerInfo[playerid][pTraderUpgrade] >= 3) { return SendClientMessage(playerid, COLOR_GREY, "Your trader skill is already upgraded to its maximum level of 3."); } PlayerInfo[playerid][pTraderUpgrade]++; PlayerInfo[playerid][pUpgradePoints]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET traderupgrade = %i, upgradepoints = %i WHERE uid = %i", PlayerInfo[playerid][pTraderUpgrade], PlayerInfo[playerid][pUpgradePoints], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You upgraded your trader skill to level %i/3. You now pay %i percent less for items in shops.", PlayerInfo[playerid][pTraderUpgrade], PlayerInfo[playerid][pTraderUpgrade] * 10); } else if(!strcmp(params, "asset", true)) { if(PlayerInfo[playerid][pAssetUpgrade] >= 4) { return SendClientMessage(playerid, COLOR_GREY, "Your asset skill is already upgraded to its maximum level of 4."); } PlayerInfo[playerid][pAssetUpgrade]++; PlayerInfo[playerid][pUpgradePoints]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET assetupgrade = %i, upgradepoints = %i WHERE uid = %i", PlayerInfo[playerid][pAssetUpgrade], PlayerInfo[playerid][pUpgradePoints], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You upgraded your asset skill to level %i/4. You can now own %i/%i houses and garages and %i/%i businesses and vehicles.", PlayerInfo[playerid][pAssetUpgrade], GetPlayerAssetLimit(playerid, LIMIT_HOUSES), GetPlayerAssetLimit(playerid, LIMIT_GARAGES), GetPlayerAssetLimit(playerid, LIMIT_BUSINESSES), GetPlayerAssetLimit(playerid, LIMIT_VEHICLES)); } else if(!strcmp(params, "labor", true)) { if(PlayerInfo[playerid][pLaborUpgrade] >= 5) { return SendClientMessage(playerid, COLOR_GREY, "Your labor skill is already upgraded to its maximum level of 5."); } PlayerInfo[playerid][pLaborUpgrade]++; PlayerInfo[playerid][pUpgradePoints]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET laborupgrade = %i, upgradepoints = %i WHERE uid = %i", PlayerInfo[playerid][pLaborUpgrade], PlayerInfo[playerid][pUpgradePoints], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You upgraded your labor skill to level %i/5. You now earn %i percent more extra cash when you work.", PlayerInfo[playerid][pLaborUpgrade], PlayerInfo[playerid][pLaborUpgrade] * 2); } else if(!strcmp(params, "spawnhealth", true)) { if(PlayerInfo[playerid][pSpawnHealth] >= 100) { return SendClientMessage(playerid, COLOR_GREY, "Your spawn health is at maximum (100)."); } PlayerInfo[playerid][pSpawnHealth] += 5.0; PlayerInfo[playerid][pUpgradePoints]--; SendClientMessageEx(playerid, COLOR_GREEN, "You have upgraded your spawn health. You will now spawn with %.1f health after death.", PlayerInfo[playerid][pSpawnHealth]); } else if(!strcmp(params, "spawnarmor", true)) { if(PlayerInfo[playerid][pSpawnArmor] > 100 && PlayerInfo[playerid][pVIPPackage] == 0) { return SendClientMessage(playerid, COLOR_GREY, "Your spawn armor is at maximum (100)."); } else if(PlayerInfo[playerid][pSpawnArmor] > 125 && PlayerInfo[playerid][pVIPPackage] <= 2) { return SendClientMessage(playerid, COLOR_GREY, "Your spawn armor is at maximum (125)."); } else if(PlayerInfo[playerid][pSpawnArmor] > 150 && PlayerInfo[playerid][pVIPPackage] == 3) { return SendClientMessage(playerid, COLOR_GREY, "Your spawn armor is at maximum (150)."); } PlayerInfo[playerid][pSpawnArmor] += 2.0; PlayerInfo[playerid][pUpgradePoints]--; SendClientMessageEx(playerid, COLOR_GREEN, "You have upgraded your spawn armor. You will now spawn with %.1f armor after death.", PlayerInfo[playerid][pSpawnArmor]); } else { SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /upgrade [option] (%i points available)", PlayerInfo[playerid][pUpgradePoints]); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Inventory, Addict, Trader, Asset, Labor, SpawnHealth, SpawnArmor"); return 1; } if(PlayerInfo[playerid][pInventoryUpgrade] == 5 || PlayerInfo[playerid][pAddictUpgrade] == 3 || PlayerInfo[playerid][pTraderUpgrade] == 3 || PlayerInfo[playerid][pAssetUpgrade] == 4 || PlayerInfo[playerid][pLaborUpgrade] == 5 || PlayerInfo[playerid][pSpawnHealth] == 100 || PlayerInfo[playerid][pSpawnArmor] == 100) { AwardAchievement(playerid, "Benefits"); } return 1; } CMD:charity(playerid, params[]) { new option[10], param[64]; if(PlayerInfo[playerid][pLevel] < 5) { return SendClientMessage(playerid, COLOR_SYNTAX, "You cannot donate to charity if you're under level 5. /buylevel to level up."); } if(sscanf(params, "s[10]S()[64]", option, param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /charity [info | health | armor | song]"); } if(!strcmp(option, "info", true)) { SendClientMessage(playerid, COLOR_NAVYBLUE, "_______ Charity _______"); SendClientMessage(playerid, COLOR_GREY3, "If you have at least $1,000 on hand you can donate to charity."); SendClientMessage(playerid, COLOR_GREY3, "You can donate to give health or armor for the entire server using '{FFD700}/charity health/armor{AAAAAA}'."); SendClientMessage(playerid, COLOR_GREY3, "You can also donate to globally play a song of your choice using '{FFD700}/charity song{AAAAAA}'."); SendClientMessage(playerid, COLOR_GREY3, "You can also donate your money the traditional way using '{FFD700}/charity [amount]{AAAAAA}'."); SendClientMessage(playerid, COLOR_GREY3, "Once the charity bank hits a milestone, some of it will be given back to the community!"); SendClientMessageEx(playerid, COLOR_AQUA, "** %s has been donated to charity so far.", FormatNumber(gCharity)); return 1; } else if(!strcmp(option, "health", true)) { if(PlayerInfo[playerid][pCash] < 150000) { return SendClientMessage(playerid, COLOR_GREY, "You need at least $150,000 on hand for this option."); } if(gCharityHealth) { return SendClientMessage(playerid, COLOR_GREY, "Players can only donate for this perk each hour. Try again after payday."); } foreach(new i : Player) { if(!PlayerInfo[i][pAdminDuty]) { SetPlayerHealth(i, 150.0); } } gCharity += 150000; gCharityHealth = 1; AddToTaxVault(150000); SendClientMessageToAllEx(COLOR_ROYALBLUE, "Charity: %s has generously donated $150,000 to heal everyone to 150 health!", GetPlayerRPName(playerid)); GivePlayerCash(playerid, -150000); } else if(!strcmp(option, "armor", true)) { if(PlayerInfo[playerid][pCash] < 200000) { return SendClientMessage(playerid, COLOR_GREY, "You need at least $200,000 on hand for this option."); } if(gCharityArmor) { return SendClientMessage(playerid, COLOR_GREY, "Players can only donate for this perk each hour. Try again after payday."); } foreach(new i : Player) { if(!PlayerInfo[i][pAdminDuty]) { SetScriptArmour(i, 100.0); } } gCharity += 200000; gCharityArmor = 1; AddToTaxVault(200000); SendClientMessageToAllEx(COLOR_ROYALBLUE, "Charity: %s has generously donated $200,000 to give full armor to everyone!", GetPlayerRPName(playerid)); GivePlayerCash(playerid, -10000); } else if(!strcmp(option, "song", true)) { if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /charity [song] [songfolder/name.mp3]"); } if(PlayerInfo[playerid][pCash] < 25000) { return SendClientMessage(playerid, COLOR_GREY, "You need at least $25,000 on hand for this option."); } if(gettime() - gLastMusic < 300) { return SendClientMessage(playerid, COLOR_GREY, "Music can only be played globally every 5 minutes."); } new url[144]; format(url, sizeof(url), "http://%s/%s", SERVER_MUSIC_URL, param); foreach(new i : Player) { if(!PlayerInfo[i][pToggleMusic] && PlayerInfo[i][pStreamType] == MUSIC_NONE) { PlayAudioStreamForPlayer(i, url); } } gLastMusic = gettime(); gCharity += 25000; AddToTaxVault(25000); SendClientMessageToAllEx(COLOR_ROYALBLUE, "Charity: %s has generously donated $25,000 to play %s for the entire server!", GetPlayerRPName(playerid), param); GivePlayerCash(playerid, -25000); } else if(IsNumeric(option)) { new amount = strval(option); if(amount < 1 || amount > PlayerInfo[playerid][pCash]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } gCharity += amount; AddToTaxVault(amount); GivePlayerCash(playerid, -amount); if(amount > 100000) { SendClientMessageToAllEx(COLOR_ROYALBLUE, "Charity: %s has generously donated %s to charity!", GetPlayerRPName(playerid), FormatNumber(amount)); } } return 1; } CMD:music(playerid, params[]) { SendClientMessage(playerid, COLOR_NAVYBLUE, "_____________________ List of Music _____________________"); HTTP(playerid, HTTP_GET, SERVER_FETCH_URL, "", "HTTP_OnMusicFetchResponse"); return 1; } CMD:stopmusic(playerid, params[]) { SendClientMessage(playerid, COLOR_YELLOW, "You have stopped all active audio streams playing for yourself."); PlayerInfo[playerid][pStreamType] = MUSIC_NONE; StopAudioStreamForPlayer(playerid); return 1; } CMD:gplay(playerid, params[]) { new url[144]; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gplay [songfolder/name.mp3]"); } format(url, sizeof(url), "http://%s/%s", SERVER_MUSIC_URL, params); foreach(new i : Player) { if(!PlayerInfo[i][pToggleMusic] && PlayerInfo[i][pStreamType] == MUSIC_NONE) { PlayAudioStreamForPlayer(i, url); SendClientMessageEx(i, COLOR_LIGHTRED, "AdmCmd: %s has started the global playback of %s.", GetPlayerRPName(playerid), params); SendClientMessageEx(i, COLOR_YELLOW, "Use /stopmusic to stop playback and '/toggle streams' to disable global playback."); } } return 1; } CMD:gplayurl(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gplayurl [link]"); } if(strfind(params, ".php", true) != -1) { return SendClientMessage(playerid, COLOR_SYNTAX, "No .php links allowed!"); } foreach(new i : Player) { if(!PlayerInfo[i][pToggleMusic] && PlayerInfo[i][pStreamType] == MUSIC_NONE) { PlayAudioStreamForPlayer(i, params); SendClientMessageEx(i, COLOR_LIGHTRED, "AdmCmd: %s has started the global playback of a custom URL.", GetPlayerRPName(playerid)); SendClientMessageEx(i, COLOR_YELLOW, "Use /stopmusic to stop playback and '/toggle streams' to disable global playback."); } } return 1; } CMD:gstop(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } foreach(new i: Player) { if(!PlayerInfo[i][pToggleMusic] && PlayerInfo[i][pStreamType] == MUSIC_NONE) { StopAudioStreamForPlayer(i); SendClientMessageEx(i, COLOR_LIGHTRED, "AdmCmd: %s has stopped all active audio streams.", GetPlayerRPName(playerid)); } } return 1; } CMD:dm(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /dm [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be punished."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet. You can wait until they login or use /oprison."); } PlayerInfo[targetid][pDMWarnings]++; if(PlayerInfo[targetid][pDMWarnings] < 3) { new minutes = PlayerInfo[targetid][pDMWarnings] * 30; PlayerInfo[targetid][pJailType] = 2; PlayerInfo[targetid][pJailTime] = PlayerInfo[targetid][pDMWarnings] * 1800; PlayerInfo[targetid][pWeaponRestricted] = PlayerInfo[targetid][pDMWarnings] * 4; ResetPlayer(targetid); ResetPlayerWeapons(targetid); SetPlayerInJail(targetid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was DM Warned & Prisoned for %i minutes by %s, reason: DM (%i/3)", GetPlayerRPName(targetid), minutes, GetPlayerRPName(playerid), PlayerInfo[targetid][pDMWarnings]); GetPlayerName(playerid, PlayerInfo[targetid][pPrisonedBy], MAX_PLAYER_NAME); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET prisonedby = '%e', prisonreason = 'DM' WHERE uid = %i", PlayerInfo[targetid][pPrisonedBy], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); strcpy(PlayerInfo[targetid][pPrisonReason], "DM", 128); GameTextForPlayer(targetid, "~w~Welcome to~n~~r~admin jail", 5000, 3); SendClientMessageEx(targetid, COLOR_WHITE, "You have been admin prisoned for %i minutes, reason: DM.", minutes); SendClientMessageEx(targetid, COLOR_WHITE, "Your punishment is %i hours of weapon restriction and %i/5 DM warning.", PlayerInfo[targetid][pWeaponRestricted], PlayerInfo[targetid][pDMWarnings]); Log_Write("log_punishments", "%s (uid: %i) prisoned %s (uid: %i) for %i minutes, reason: DM [/dm]", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], minutes); } else { Log_Write("log_punishments", "%s (uid: %i) banned %s (uid: %i), reason: DM (3/3 warnings)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); PlayerInfo[targetid][pDMWarnings] = 0; BanPlayer(targetid, GetPlayerNameEx(playerid), "DM (3/3 warnings)"); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was banned by %s, reason: DM (3/3 warnings)", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET jailtype = %i, jailtime = %i, dmwarnings = %i, weaponrestricted = %i WHERE uid = %i", PlayerInfo[targetid][pJailType], PlayerInfo[targetid][pJailTime], PlayerInfo[targetid][pDMWarnings], PlayerInfo[targetid][pWeaponRestricted], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); return 1; } CMD:cleardm(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 6 || PlayerInfo[playerid][pAdminDuty]) { ClearDeathList(playerid); SendClientMessage(playerid, COLOR_WHITE, "Death messages cleared."); } else { SendClientMessage(playerid, COLOR_GREY, "You are either not authorized to use this command or not on admin duty."); } return 1; } ClearDeathList(playerid) { for(new i = 0; i < 5; i ++) { SendDeathMessageToPlayer(playerid, 1001, 1001, 255); } return 1; } CMD:aduty(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty]) { if(PlayerInfo[playerid][pUndercover][0]) { OnUndercover(playerid, 0, "", 0, 0.0, 0.0); } SetPlayerSpecialTag(playerid, TAG_ADMIN); SavePlayerVariables(playerid); ResetPlayerWeapons(playerid); SetPlayerHealth(playerid, 32767); SetScriptArmour(playerid, 0.0); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s is now on admin duty.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_WHITE, "You are now on admin duty. Your stats will not be saved until you're off duty."); PlayerInfo[playerid][pAdminDuty] = 1; PlayerInfo[playerid][pTogglePhone] = 1; if(strcmp(PlayerInfo[playerid][pAdminName], "None", true) != 0) { SetPlayerName(playerid, PlayerInfo[playerid][pAdminName]); } } else { new savecheck = 0; SetPlayerSpecialTag(playerid, TAG_NONE); if(PlayerInfo[playerid][pPaycheck] > 1) { savecheck = PlayerInfo[playerid][pPaycheck]; } if(PlayerInfo[playerid][pNoDamage]) { PlayerInfo[playerid][pNoDamage] = 0; SendClientMessage(playerid, COLOR_GREY, "Your god mode was turned off."); } ClearDeathList(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM users WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_PROCESS_LOGIN, playerid); PlayerInfo[playerid][pPaycheck] = savecheck; } return 1; } CMD:adminname(playerid, params[]) { new name[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]", name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /adminname [name ('none' to reset)]"); } if(!IsValidName(name)) { return SendClientMessage(playerid, COLOR_GREY, "The name specified is not supported by the SA-MP client."); } strcpy(PlayerInfo[playerid][pAdminName], name, MAX_PLAYER_NAME); if(PlayerInfo[playerid][pAdminDuty]) { SetPlayerName(playerid, name); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET adminname = '%e' WHERE uid = %i", name, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s changed their administrator name to %s.", PlayerInfo[playerid][pUsername], name); return 1; } CMD:getip(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /getip [playerid]"); } if(PlayerInfo[playerid][pAdmin] < 5 && PlayerInfo[targetid][pAdmin] > 1) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command on another administrator"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } SendClientMessageEx(playerid, COLOR_WHITE, "** %s[%i]'s IP: %s **", GetPlayerRPName(targetid), targetid, GetPlayerIP(targetid)); return 1; } CMD:ogetip(playerid, params[]) { new name[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]", name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /ogetip [username]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT username, ip FROM users WHERE username = '%e'", name); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_OFFLINE_IP, playerid); return 1; } CMD:iplookup(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!IsAnIP(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /iplookup [ip address]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT username, lastlogin FROM users WHERE ip = '%s' ORDER BY lastlogin DESC", params); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_TRACE_IP, playerid); return 1; } CMD:lastactive(playerid, params[]) { new username[24], specifiers[] = "%D of %M, %Y @ %k:%i"; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]", username)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /lastactive [username]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT DATE_FORMAT(lastlogin, '%s') FROM users WHERE username = '%e'", specifiers, username); mysql_tquery(connectionID, queryBuffer, "OnAdminCheckLastActive", "is", playerid, username); return 1; } CMD:listjailed(playerid, params[]) { new type[14]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Jailed Players ______"); foreach(new i : Player) { if(PlayerInfo[i][pJailType] > 0) { switch(PlayerInfo[i][pJailType]) { case 1: type = "OOC jailed"; case 2: type = "OOC prisoned"; case 3: type = "IC prisoned"; } SendClientMessageEx(playerid, COLOR_GREY1, "(ID: %i) %s - Status: %s - Time: %i seconds", i, GetPlayerRPName(i), type, PlayerInfo[i][pJailTime]); } } return 1; } CMD:prisoninfo(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /prisoninfo [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pJailType] != 2) { return SendClientMessage(playerid, COLOR_GREY, "That player is not in OOC prison."); } SendClientMessageEx(playerid, COLOR_WHITE, "** %s was prisoned by %s, reason: %s (%i seconds left.) **", GetPlayerRPName(targetid), PlayerInfo[targetid][pPrisonedBy], PlayerInfo[targetid][pPrisonReason], PlayerInfo[targetid][pJailTime]); return 1; } CMD:relog(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /relog [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has forced %s to relog.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SavePlayerVariables(targetid); ResetPlayer(targetid); PlayerInfo[targetid][pLogged] = 0; CallLocalFunction("OnPlayerRequestClass", "ii", targetid, 0); return 1; } CMD:setint(playerid, params[]) { new targetid, interiorid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "ui", targetid, interiorid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setint [playerid] [int]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!(0 <= interiorid <= 19)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid interior. Valid interiors range from 0 to 19."); } SetPlayerInterior(targetid, interiorid); SendClientMessageEx(playerid, COLOR_GREY2, "%s's interior set to ID %i.", GetPlayerRPName(targetid), interiorid); return 1; } CMD:setvw(playerid, params[]) { new targetid, worldid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "ui", targetid, worldid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setvw [playerid] [vw]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } SetPlayerVirtualWorld(targetid, worldid); SendClientMessageEx(playerid, COLOR_GREY2, "%s's virtual world set to ID %i.", GetPlayerRPName(targetid), worldid); return 1; } CMD:setskin(playerid, params[]) { new targetid, skinid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "ui", targetid, skinid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setskin [playerid] [skinid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!(0 <= skinid <= 311)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid skin specified."); } if(!IsPlayerSpawned(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is either not spawned, or spectating."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "That player has a higher admin level than you. You can't change their skin."); } SetScriptSkin(targetid, skinid); SendClientMessageEx(playerid, COLOR_GREY2, "%s's skin set to ID %i.", GetPlayerRPName(targetid), skinid); return 1; } CMD:revive(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /revive [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is not injured."); } PlayerInfo[targetid][pInjured] = 0; SetPlayerHealth(targetid, 100.0); ClearAnimations(targetid, 1); SendClientMessage(targetid, COLOR_YELLOW, "You have been revived by an admin!"); if(PlayerInfo[targetid][pAcceptedEMS] != INVALID_PLAYER_ID) { SendClientMessageEx(PlayerInfo[targetid][pAcceptedEMS], COLOR_YELLOW, "Your patient %s has somehow found the strength to get up.", GetPlayerRPName(targetid)); PlayerInfo[targetid][pAcceptedEMS] = INVALID_PLAYER_ID; } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has revived %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:heject(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /heject [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pHospital]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is not in hospital."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s ejected %s from the hospital.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); PlayerInfo[targetid][pHospitalTime] = 1; SendClientMessage(targetid, COLOR_YELLOW, "You have been ejected from hospital by an admin!"); return 1; } CMD:goto(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(PlayerInfo[targetid][pToggleTP] == 1) { return SendClientMessage(playerid, COLOR_GREY, "Target id has togged teleports"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "u", targetid)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /goto [playerid/location]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: FC, SF, LV, Bank, DMV, Casino, VIP, SD, Hospital, Cityhall, Prison"); return 1; } if(!strcmp(params, "fc", true)) { TeleportToCoords(playerid, -72.1449,1183.1022,19.7422, 90.0000, 0, 0); SendClientMessage(playerid, COLOR_GREY2, "Teleported to Fort Carson"); } else if(!strcmp(params, "sf", true)) { TeleportToCoords(playerid, -1421.5629, -288.9972, 14.1484, 135.0000, 0, 0); SendClientMessage(playerid, COLOR_GREY2, "Teleported to San Fierro."); } else if(!strcmp(params, "lv", true)) { TeleportToCoords(playerid, 1670.6908, 1423.5240, 10.7811, 270.0000, 0, 0); SendClientMessage(playerid, COLOR_GREY2, "Teleported to Las Venturas."); } else if(!strcmp(params, "bank", true)) { TeleportToCoords(playerid, -183.7134,1132.8501,19.7422,270.5191, 0, 0); SendClientMessage(playerid, COLOR_GREY2, "Teleported to bank."); } else if(!strcmp(params, "prison", true)) { TeleportToCoords(playerid, 135.3039,1950.1998,19.3892,176.4928, 0, 0); SendClientMessage(playerid, COLOR_GREY, "Teleported to prison."); } else if(!strcmp(params, "vip", true)) { TeleportToCoords(playerid, -93.8151,1191.5658,19.7422,175.4064, 0, 0); SendClientMessage(playerid, COLOR_GREY2, "Teleported to VIP Casino."); } else if(!strcmp(params, "dmv", true)) { TeleportToCoords(playerid, -199.1727,1215.2516,19.7422,23.2968, 0, 0); SendClientMessage(playerid, COLOR_GREY2, "Teleported to DMV."); } else if(!strcmp(params, "Cityhall", true)) { TeleportToCoords(playerid, -203.4524,1119.0845,19.7422,88.2989, 0, 0); SendClientMessage(playerid, COLOR_GREY2, "Teleported to City hall."); } else if(!strcmp(params, "SD", true)) { TeleportToCoords(playerid, -208.0543,978.4137,19.1200,104.2791, 0, 0); SendClientMessage(playerid, COLOR_GREY2, "Teleported to SD."); } else if(!strcmp(params, "casino", true)) { TeleportToCoords(playerid, -305.7215,1303.1820,53.6657,85.1656, 0, 0); SendClientMessage(playerid, COLOR_GREY2, "Teleported to Casino."); } else if(!strcmp(params, "hospital", true)) { TeleportToCoords(playerid, -316.0492,1059.1923,19.7422,171.6464, 0, 0); SendClientMessage(playerid, COLOR_GREY2, "Teleported to hospital."); } else if(!strcmp(params, "Blueberry", true)) { TeleportToCoords(playerid, 0.0, 0.0, 1.50, 0, 0, 0); SendClientMessage(playerid, COLOR_GREY2, "Teleported to Blueberry."); } else { if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!IsPlayerSpawned(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is either not spawned, or spectating."); } TeleportToPlayer(playerid, targetid); SendClientMessageEx(playerid, COLOR_GREY2, "Teleported to %s's position.", GetPlayerRPName(targetid)); } return 1; } CMD:gethere(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gethere [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!IsPlayerSpawned(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is either not spawned, or spectating."); } /*if(PlayerInfo[targetid][pPaintball] > 0 && PlayerInfo[playerid][pPaintball] == 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently in the paintball arena."); }*/ if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't teleport an admin who has a higher admin level than you."); } /*if(PlayerInfo[targetid][pJoinedEvent]) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently in the event."); }*/ TeleportToPlayer(targetid, playerid); SendClientMessageEx(playerid, COLOR_GREY2, "Teleported %s to your position.", GetPlayerRPName(targetid)); return 1; } CMD:gotocar(playerid, params[]) { new vehicleid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "i", vehicleid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gotocar [vehicleid]"); } if(!IsValidVehicle(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle specified."); } TeleportToVehicle(playerid, vehicleid); SendClientMessageEx(playerid, COLOR_GREY2, "Teleported to vehicle ID %i.", vehicleid); return 1; } CMD:getcar(playerid, params[]) { new vehicleid, driverid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "i", vehicleid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /getcar [vehicleid]"); } if(!IsValidVehicle(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle specified."); } if((driverid = GetVehicleDriver(vehicleid)) != INVALID_PLAYER_ID && PlayerInfo[driverid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't teleport the vehicle of an admin who has a higher admin level than you."); } new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetVehiclePos(vehicleid, x + 1, y + 1, z + 2.0); SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid)); LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid)); SendClientMessageEx(playerid, COLOR_GREY2, "Teleported vehicle ID %i to your position.", vehicleid); return 1; } CMD:gotoco(playerid, params[]) { new Float:x, Float:y, Float:z, interiorid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "fffI(0)", x, y, z, interiorid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gotoco [x] [y] [z] [int (optional)]"); } SetPlayerPos(playerid, x, y, z); SetPlayerInterior(playerid, interiorid); return 1; } CMD:gotoint(playerid, params[]) { static list[4096]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(isnull(list)) { for(new i = 0; i < sizeof(interiorArray); i ++) { format(list, sizeof(list), "%s\n%s", list, interiorArray[i][intName]); } } ShowPlayerDialog(playerid, DIALOG_INTERIORS, DIALOG_STYLE_LIST, "Choose an interior to teleport to.", list, "Select", "Cancel"); return 1; } CMD:jetpack(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } PlayerInfo[playerid][pJetpack] = 1; SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USEJETPACK); GameTextForPlayer(playerid, "~g~Jetpack", 3000, 3); switch(random(4)) { case 0: SendClientMessage(playerid, COLOR_WHITE, "** Random Fact: The jetpack is part of an experiment conducted at the Area 69 facility."); case 1: SendClientMessage(playerid, COLOR_WHITE, "** Random Fact: You stole this from Area 69 in that one single player mission. Remember?"); case 2: SendClientMessage(playerid, COLOR_WHITE, "** Random Fact: You probably don't need this anyway. All you admins seem to do is airbreak around the map."); case 3: SendClientMessage(playerid, COLOR_WHITE, "** Random Fact: You probably aren't reading this anyway. Fuck you."); } return 1; } CMD:sendto(playerid, params[]) { new targetid, option[12], param[32]; if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pHelper] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "us[12]S()[32]", targetid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sendto [playerid] [location]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Player, Vehicle, FC, SF, LV, DMV, Casino, Bank,"); return 1; } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!IsPlayerSpawned(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is either not spawned, or spectating."); } if(PlayerInfo[targetid][pJailType]) { return SendClientMessage(playerid, COLOR_GREY, "This player is in jail so you can't teleport them."); } if(PlayerInfo[targetid][pJoinedEvent]) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently in the event."); } if(PlayerInfo[playerid][pAdmin] < 2 && isnull(PlayerInfo[targetid][pHelpRequest]) && PlayerInfo[playerid][pAcceptedHelp] == 0) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't submitted a help request. Therefore you can't teleport them."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't teleport an admin who has a higher admin level than you."); } if(!strcmp(option, "FC", true)) { TeleportToCoords(targetid, -72.1449,1183.1022,19.7422, 90.0000, 0, 0); SendClientMessageEx(playerid, COLOR_GREY2, "You have sent %s to Fort Carson.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_GREY2, "%s has sent you to Fort Carson.", GetPlayerRPName(playerid)); } else if(!strcmp(option, "sf", true)) { TeleportToCoords(targetid, -1421.5629, -288.9972, 14.1484, 135.0000, 0, 0); SendClientMessageEx(playerid, COLOR_GREY2, "You have sent %s to San Fierro.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_GREY2, "%s has sent you to San Fierro.", GetPlayerRPName(playerid)); } else if(!strcmp(option, "lv", true)) { TeleportToCoords(targetid, 1670.6908, 1423.5240, 10.7811, 270.0000, 0, 0); SendClientMessageEx(playerid, COLOR_GREY2, "You have sent %s to Las Venturas.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_GREY2, "%s has sent you to Las Venturas.", GetPlayerRPName(playerid)); } else if(!strcmp(option, "bank", true)) { TeleportToCoords(targetid, -183.7134,1132.8501,19.7422,270.5191, 0, 0); SendClientMessageEx(playerid, COLOR_GREY2, "You have sent %s to the Bank.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_GREY2, "%s has sent you to the Bank.", GetPlayerRPName(playerid)); } else if(!strcmp(option, "vip", true)) { TeleportToCoords(targetid, -93.8151,1191.5658,19.7422,175.4064, 0, 0); SendClientMessageEx(playerid, COLOR_GREY2, "You have sent %s to the VIP Casino.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_GREY2, "%s has sent you to the VIP Casino.", GetPlayerRPName(playerid)); } else if(!strcmp(option, "dmv", true)) { TeleportToCoords(targetid, -199.1727,1215.2516,19.7422,23.2968, 0, 0); SendClientMessageEx(playerid, COLOR_GREY2, "You have sent %s to the DMV.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_GREY2, "%s has sent you to the DMV.", GetPlayerRPName(playerid)); } else if(!strcmp(option, "casino", true)) { TeleportToCoords(targetid, -305.7215,1303.1820,53.6657,85.1656, 0, 0); SendClientMessageEx(playerid, COLOR_GREY2, "You have sent %s to Casino.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_GREY2, "%s has sent you to Casino.", GetPlayerRPName(playerid)); } else if(!strcmp(option, "player", true)) { new sendtargetid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "Only level 2+ admins can do this."); } if(sscanf(param, "u", sendtargetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sendto [playerid] [player] [targetid]"); } if(!IsPlayerConnected(sendtargetid)) { return SendClientMessage(playerid, COLOR_GREY, "The target specified is disconnected."); } if(!IsPlayerSpawned(sendtargetid)) { return SendClientMessage(playerid, COLOR_GREY, "The target specified is either not spawned, or spectating."); } TeleportToPlayer(targetid, sendtargetid); SendClientMessageEx(playerid, COLOR_GREY2, "You have sent %s to %s's location.", GetPlayerRPName(targetid), GetPlayerRPName(sendtargetid)); SendClientMessageEx(targetid, COLOR_GREY2, "%s has sent you to %s's location.", GetPlayerRPName(playerid), GetPlayerRPName(sendtargetid)); } else if(!strcmp(option, "vehicle", true)) { new vehicleid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "Only level 2+ admins can do this."); } if(sscanf(param, "i", vehicleid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sendto [playerid] [vehicle] [vehicleid]"); } if(!IsValidVehicle(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle specified."); } TeleportToVehicle(targetid, vehicleid); SendClientMessageEx(playerid, COLOR_GREY2, "You have sent %s to vehicle ID %i.", GetPlayerRPName(targetid), vehicleid); SendClientMessageEx(targetid, COLOR_GREY2, "%s has sent you to vehicle ID %i.", GetPlayerRPName(playerid), vehicleid); } return 1; } CMD:listen(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(!PlayerInfo[playerid][pListen]) { PlayerInfo[playerid][pListen] = 1; SendClientMessage(playerid, COLOR_AQUA, "You are now listening to all IC & local OOC chats."); } else { PlayerInfo[playerid][pListen] = 0; SendClientMessage(playerid, COLOR_AQUA, "You are no longer listening to IC & local OOC chats."); } return 1; } CMD:jail(playerid, params[]) { new targetid, minutes, reason[128]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "uis[128]", targetid, minutes, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /jail [playerid] [minutes] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be jailed."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet. You can wait until they login or use /ojail."); } if(minutes < 1) { return SendClientMessage(playerid, COLOR_GREY, "The amount of minutes cannot be below one. /unjail to release a player."); } PlayerInfo[targetid][pJailType] = 1; PlayerInfo[targetid][pJailTime] = minutes * 60; ResetPlayerWeaponsEx(targetid); ResetPlayer(targetid); SetPlayerInJail(targetid); Log_Write("log_punishments", "%s (uid: %i) jailed %s (uid: %i) for %i minutes, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], minutes, reason); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was jailed for %i minutes by %s, reason: %s", GetPlayerRPName(targetid), minutes, GetPlayerRPName(playerid), reason); SendClientMessageEx(targetid, COLOR_AQUA, "** You have been admin jailed for %i minutes by %s.", minutes, GetPlayerRPName(playerid)); return 1; } CMD:rwarn(playerid, params[]) { new targetid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /rwarn [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pReportMuted]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is muted from reports."); } PlayerInfo[targetid][pReportWarns]++; SendClientMessageEx(targetid, COLOR_LIGHTRED, "** %s issued you a report warning, reason: %s (%i/3)", GetPlayerRPName(playerid), reason, PlayerInfo[targetid][pReportWarns]); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was given a report warning by %s, reason: %s", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason); if(PlayerInfo[targetid][pReportWarns] >= 3) { PlayerInfo[targetid][pReportMuted] = 12; SendClientMessage(targetid, COLOR_LIGHTRED, "** You have been muted from reports for 12 playing hours."); } return 1; } CMD:runmute(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /runmute [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pReportMuted]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is not muted from reports."); } PlayerInfo[targetid][pReportWarns] = 0; PlayerInfo[targetid][pReportMuted] = 0; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was unmuted from reports by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_YELLOW, "Your report mute has been lifted by %s. Your report warnings were reset.", GetPlayerRPName(playerid)); return 1; } CMD:nmute(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pHelper] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /nmute [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pNewbieMuted]) { PlayerInfo[targetid][pNewbieMuted] = 1; PlayerInfo[targetid][pNewbieMuteTime] = gettime() + 14400; SendStaffMessage(COLOR_LIGHTRED, "AdmCmd: %s was muted from newbie chat by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_LIGHTRED, "You have been muted from newbie chat by %s.", GetPlayerRPName(playerid)); } else { PlayerInfo[targetid][pNewbieMuted] = 0; PlayerInfo[targetid][pNewbieMuteTime] = 0; SendStaffMessage(COLOR_LIGHTRED, "AdmCmd: %s was unmuted from newbie chat by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_WHITE, "You have been unmuted from newbie chat by %s.", GetPlayerRPName(playerid)); } return 1; } CMD:hmute(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2 && PlayerInfo[playerid][pHelper] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /hmute [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pHelpMuted]) { PlayerInfo[targetid][pHelpMuted] = 1; SendStaffMessage(COLOR_LIGHTRED, "AdmCmd: %s was muted from help requests by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_LIGHTRED, "You have been muted from help requests by %s.", GetPlayerRPName(playerid)); } else { PlayerInfo[targetid][pHelpMuted] = 0; SendStaffMessage(COLOR_LIGHTRED, "AdmCmd: %s was unmuted from help requests by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_WHITE, "You have been unmuted from help requests by %s.", GetPlayerRPName(playerid)); } return 1; } CMD:admute(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /admute [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pAdMuted]) { PlayerInfo[targetid][pAdMuted] = 1; SendStaffMessage(COLOR_LIGHTRED, "AdmCmd: %s was muted from advertisements by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_LIGHTRED, "You have been muted from advertisements by %s.", GetPlayerRPName(playerid)); } else { PlayerInfo[targetid][pAdMuted] = 0; SendStaffMessage(COLOR_LIGHTRED, "AdmCmd: %s was unmuted from advertisements by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_WHITE, "You have been unmuted from advertisements by %s.", GetPlayerRPName(playerid)); } return 1; } CMD:gmute(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 1 && PlayerInfo[playerid][pHelper] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gmute [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pGlobalMuted]) { PlayerInfo[targetid][pGlobalMuted] = 1; PlayerInfo[targetid][pGlobalMuteTime] = gettime() + 14400; SendStaffMessage(COLOR_LIGHTRED, "AdmCmd: %s was muted from global chat by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_LIGHTRED, "You have been muted from global chat by %s.", GetPlayerRPName(playerid)); } else { PlayerInfo[targetid][pGlobalMuted] = 0; PlayerInfo[targetid][pGlobalMuteTime] = 0; SendStaffMessage(COLOR_LIGHTRED, "AdmCmd: %s was unmuted from global chat by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_WHITE, "You have been unmuted from global chat by %s.", GetPlayerRPName(playerid)); } return 1; } CMD:rmute(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /rmute [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pReportMuted]) { PlayerInfo[targetid][pReportMuted] = 99999; PlayerInfo[targetid][pReportMuteTime] = gettime() + 14400; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was muted from submitting reports by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_LIGHTRED, "You have been muted from submitting reports by %s.", GetPlayerRPName(playerid)); } else { PlayerInfo[targetid][pReportMuted] = 0; PlayerInfo[targetid][pReportMuteTime] = 0; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was unmuted from submitting reports by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_WHITE, "You have been unmuted from submitting reports by %s.", GetPlayerRPName(playerid)); } return 1; } CMD:freeze(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /freeze [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } TogglePlayerControllable(targetid, 0); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was frozen by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); return 1; } CMD:unfreeze(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /unfreeze [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pTazedTime]) { ClearAnimations(targetid, 1); PlayerInfo[targetid][pTazedTime] = 0; } PlayerInfo[targetid][pTied] = 0; TogglePlayerControllable(targetid, 1); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s was unfrozen by %s.", GetPlayerRPName(targetid), GetPlayerRPName(playerid)); return 1; } CMD:skiptut(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /skiptut [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pTutorial]) { return SendClientMessage(playerid, COLOR_GREY, "That player isn't currently watching the tutorial."); } SendClientMessageEx(targetid, COLOR_WHITE, "%s has forced you out of the tutorial.", GetPlayerRPName(playerid)); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s forced %s out of the tutorial.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); KillTimer(PlayerInfo[targetid][pTutorialTimer]); TutorialTimer(targetid, 11); return 1; } CMD:listguns(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /listguns [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_______ %s's Weapons _______", GetPlayerRPName(targetid)); for(new i = 0; i < 13; i ++) { new weapon, ammo; GetPlayerWeaponData(targetid, i, weapon, ammo); if(weapon) { if(!PlayerHasWeapon(targetid, weapon, true)) { SendClientMessageEx(playerid, COLOR_GREY2, "-> %s {FFD700}(Desynced){C8C8C8}", GetWeaponNameEx(weapon)); } else { SendClientMessageEx(playerid, COLOR_GREY2, "-> %s", GetWeaponNameEx(weapon)); } } } return 1; } CMD:disarm(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /disarm [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } ResetPlayerWeaponsEx(targetid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has disarmed %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:nrn(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /nrn [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } /* if(PlayerInfo[targetid][pLevel] > 3) { return SendClientMessage(playerid, COLOR_GREY, "That player is level 3 or above and doesn't need a free namechange."); } */ if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } ShowPlayerDialog(targetid, DIALOG_FREENAMECHANGE, DIALOG_STYLE_INPUT, "Non-RP Name", "An administrator has came to the conclusion that your name is non-RP.\nTherefore you have been given this free namechange in order to correct it.\n\nEnter a name in the Firstname_Lastname format in the box below:", "Submit", ""); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has forced %s to change their name for being Non-RP.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:odm(playerid, params[]) { new name[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]", name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /odm [username]"); } if(IsPlayerOnline(name)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already online and logged in. Use /dm instead."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid, ip, adminlevel, dmwarnings FROM users WHERE username = '%e'", name); mysql_tquery(connectionID, queryBuffer, "OnAdminOfflineDM", "is", playerid, name); return 1; } CMD:prison(playerid, params[]) { new targetid, minutes, reason[128]; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "uis[128]", targetid, minutes, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /prison [playerid] [minutes] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be prisoned."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet. You can wait until they login or use /oprison."); } if(minutes < 1) { return SendClientMessage(playerid, COLOR_GREY, "The amount of minutes cannot be below one. /unjail to release a player."); } PlayerInfo[targetid][pJailType] = 2; PlayerInfo[targetid][pJailTime] = minutes * 60; ResetPlayerWeaponsEx(targetid); ResetPlayer(targetid); SetPlayerInJail(targetid); GameTextForPlayer(targetid, "~w~Welcome to~n~~r~admin jail", 5000, 3); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET prisonedby = '%e', prisonreason = '%e' WHERE uid = %i", GetPlayerNameEx(playerid), reason, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); GetPlayerName(playerid, PlayerInfo[targetid][pPrisonedBy], MAX_PLAYER_NAME); strcpy(PlayerInfo[targetid][pPrisonReason], reason, 128); Log_Write("log_punishments", "%s (uid: %i) prisoned %s (uid: %i) for %i minutes, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], minutes, reason); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was prisoned for %i minutes by %s, reason: %s", GetPlayerRPName(targetid), minutes, GetPlayerRPName(playerid), reason); SendClientMessageEx(targetid, COLOR_AQUA, "** You have been admin prisoned for %i minutes by %s.", minutes, GetPlayerRPName(playerid)); return 1; } CMD:oprison(playerid, params[]) { new username[MAX_PLAYERS], minutes, reason[128]; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]is[128]", username, minutes, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /oprison [username] [minutes] [reason]"); } if(minutes < 1) { return SendClientMessage(playerid, COLOR_GREY, "The amount of minutes cannot be below one. /unjail to release a player."); } if(IsPlayerOnline(username)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already online and logged in. Use /prison instead."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT adminlevel, uid FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "OnAdminOfflinePrison", "isis", playerid, username, minutes, reason); return 1; } CMD:release(playerid, params[]) { new targetid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /release [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pJailType]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not jailed."); } PlayerInfo[targetid][pJailTime] = 1; SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was released from jail/prison by %s, reason: %s", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason); return 1; } CMD:fine(playerid, params[]) { new targetid, amount, reason[128]; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "uis[128]", targetid, amount, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /fine [playerid] [amount] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be fined."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(amount < 1) { return SendClientMessage(playerid, COLOR_GREY, "Invalid amount."); } GivePlayerCash(targetid, -amount); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was fined %s by %s, reason: %s", GetPlayerRPName(targetid), FormatNumber(amount), GetPlayerRPName(playerid), reason); Log_Write("log_admin", "%s (uid: %i) fined %s (uid: %i) for $%i, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], amount, reason); return 1; } CMD:pfine(playerid, params[]) { new targetid, percent, reason[128]; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "uis[128]", targetid, percent, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /pfine [playerid] [percent] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(!(1 <= percent <= 100)) { return SendClientMessage(playerid, COLOR_GREY, "The percentage value must be between 1 and 100."); } new amount = ((PlayerInfo[targetid][pCash] + PlayerInfo[targetid][pBank]) / 100) * percent; GivePlayerCash(targetid, -amount); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was fined %s by %s, reason: %s", GetPlayerRPName(targetid), FormatNumber(amount), GetPlayerRPName(playerid), reason); Log_Write("log_admin", "%s (uid: %i) fined %s (uid: %i) for $%i (%i percent), reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], amount, percent, reason); return 1; } CMD:ofine(playerid, params[]) { new username[MAX_PLAYERS], amount, reason[128]; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]is[128]", username, amount, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /ofine [username] [amount] [reason]"); } if(amount < 1) { return SendClientMessage(playerid, COLOR_GREY, "Invalid amount."); } if(IsPlayerOnline(username)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already online and logged in. Use /fine instead."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT adminlevel FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "OnAdminOfflineFine", "isis", playerid, username, amount, reason); return 1; } CMD:sethp(playerid, params[]) { new targetid, Float:amount; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "uf", targetid, amount)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sethp [playerid] [amount]"); SendClientMessage(playerid, COLOR_SYNTAX, "Warning: Values above 255.0 may not work properly with the server-sided damage system."); return 1; } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(amount < 1.0 && PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't do this to an admin with a higher level than you."); } SetPlayerHealth(targetid, amount); SendClientMessageEx(playerid, COLOR_GREY2, "%s's health set to %.1f.", GetPlayerRPName(targetid), amount); return 1; } CMD:setarmor(playerid, params[]) { new targetid, Float:amount; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "uf", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setarmor [playerid] [amount]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } SetScriptArmour(targetid, amount); SendClientMessageEx(playerid, COLOR_GREY2, "%s's armor set to %.1f.", GetPlayerRPName(targetid), amount); return 1; } CMD:refillcars(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } foreach(new i: Vehicle) { vehicleFuel[i] = 100; } SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s refilled all vehicles to maximum fuel.", GetPlayerRPName(playerid)); return 1; } CMD:refilldrug(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /refilldrug [seeds | cocaine | ephedrine]"); SendClientMessage(playerid, COLOR_SYNTAX, "This command refills the specified drug stock to maximum value."); return 1; } if(!strcmp(params, "seeds", true)) { gSeedsStock = 1000; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has refilled the seeds in the drug den.", GetPlayerRPName(playerid)); } else if(!strcmp(params, "cocaine", true)) { gCocaineStock = 500; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has refilled the cocaine in the crack house.", GetPlayerRPName(playerid)); } else if(!strcmp(params, "ephedrine", true)) { gEphedrineStock = 250; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has refilled the ephedrine in the drug den.", GetPlayerRPName(playerid)); } return 1; } CMD:togooc(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!enabledOOC) { enabledOOC = 1; SendClientMessageToAllEx(COLOR_WHITE, "(( Administrator %s enabled the OOC channel. ))", GetPlayerRPName(playerid)); } else { enabledOOC = 0; SendClientMessageToAllEx(COLOR_WHITE, "(( Administrator %s disabled the OOC channel. ))", GetPlayerRPName(playerid)); } return 1; } CMD:tognewbie(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!enabledNewbie) { enabledNewbie = 1; SendClientMessageToAllEx(COLOR_NEWBIE, "** Administrator %s enabled the newbie channel.", GetPlayerRPName(playerid)); } else { enabledNewbie = 0; SendClientMessageToAllEx(COLOR_NEWBIE, "** Administrator %s disabled the newbie channel.", GetPlayerRPName(playerid)); } return 1; } CMD:god(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 6 || PlayerInfo[playerid][pAdminDuty]) { if(!PlayerInfo[playerid][pNoDamage]) { PlayerInfo[playerid][pNoDamage] = 1; SendClientMessage(playerid, COLOR_GREY, "You are now in GODMODE, you will no longer take damage from ANYTHING."); } else { PlayerInfo[playerid][pNoDamage] = 0; SendClientMessage(playerid, COLOR_GREY, "You've turned off GODMODE, you will now take damage normally."); } return 1; } return 0; } CMD:togglobal(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!enabledGlobal) { enabledGlobal = 1; SendClientMessageToAllEx(COLOR_GLOBAL, "(( Administrator %s enabled the global channel. ))", GetPlayerRPName(playerid)); } else { enabledGlobal = 0; SendClientMessageToAllEx(COLOR_GLOBAL, "(( Administrator %s disabled the global channel. ))", GetPlayerRPName(playerid)); } return 1; } CMD:togreports(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!enabledReports) { enabledReports = 1; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has enabled the report channel.", GetPlayerRPName(playerid)); } else { enabledReports = 0; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has disabled the report channel.", GetPlayerRPName(playerid)); } return 1; } CMD:listpvehs(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /listpvehs [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT id, modelid, pos_x, pos_y, pos_z, interior FROM vehicles WHERE ownerid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer, "OnAdminListVehicles", "ii", playerid, targetid); return 1; } CMD:removepveh(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removepveh [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT id, modelid, pos_x, pos_y, pos_z, interior FROM vehicles WHERE ownerid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer, "OnAdminListVehiclesForRemoval", "ii", playerid, targetid); return 1; } CMD:despawnpveh(playerid, params[]) { new vehicleid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", vehicleid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /despawnpveh [vehicleid]"); } if(!IsValidVehicle(vehicleid) || !VehicleInfo[vehicleid][vOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "The vehicle specified is invalid or not owned by any player."); } SendClientMessageEx(playerid, COLOR_WHITE, "You have despawned %s's %s.", VehicleInfo[vehicleid][vOwner], GetVehicleName(vehicleid)); DespawnVehicle(vehicleid); return 1; } CMD:veh(playerid, params[]) { new model[20], modelid, color1, color2, Float:x, Float:y, Float:z, Float:a, vehicleid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "s[20]I(-1)I(-1)", model, color1, color2)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /veh [modelid/name] [color1 (optional)] [color2 (optional)]"); } if((modelid = GetVehicleModelByName(model)) == 0) { return SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle model."); } if(!(-1 <= color1 <= 255) || !(-1 <= color2 <= 255)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid color. Valid colors range from -1 to 255."); } GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); vehicleid = AddStaticVehicleEx(modelid, x, y, z, a, color1, color2, -1); if(vehicleid == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "Cannot spawn vehicle. The vehicle pool is currently full."); } ResetVehicleObjects(vehicleid); adminVehicle{vehicleid} = true; vehicleFuel[vehicleid] = 100; vehicleColors[vehicleid][0] = color1; vehicleColors[vehicleid][1] = color2; SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid)); LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid)); PutPlayerInVehicle(playerid, vehicleid, 0); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s spawned a %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); SendClientMessageEx(playerid, COLOR_WHITE, "%s (ID %i) spawned. Use '/savevehicle %i' to save this vehicle to the database.", GetVehicleName(vehicleid), vehicleid, vehicleid); return 1; } CMD:savevehicle(playerid, params[]) { new vehicleid, gangid, type, delay, vip, Float:x, Float:y, Float:z, Float:a; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "iiiiI(0)", vehicleid, gangid, type, delay, vip)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /savevehicle [vehicleid] [gangid (-1 = none)] [faction type] [respawn delay (seconds)] [vip level (optional)]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (0) None (1) Police (2) Medic (3) News (4) Government (5) Hitman (6) Federal (7) Army"); return 1; } if(!IsValidVehicle(vehicleid) || !adminVehicle{vehicleid}) { return SendClientMessage(playerid, COLOR_GREY, "The vehicle specified is either invalid or not an admin spawned vehicle."); } if(!(-1 <= gangid < MAX_GANGS) || (gangid >= 0 && !GangInfo[gangid][gSetup])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid gang."); } if(!(0 <= type <= 7)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } if(!(0 <= vip <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } SendClientMessageEx(playerid, COLOR_WHITE, "%s saved. This vehicle will now spawn here from now on.", GetVehicleName(vehicleid)); GetVehiclePos(vehicleid, x, y, z); GetVehicleZAngle(vehicleid, a); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO vehicles (modelid, pos_x, pos_y, pos_z, pos_a, color1, color2, gangid, factiontype, vippackage, respawndelay, interior, world) VALUES(%i, '%f', '%f', '%f', '%f', %i, %i, %i, %i, %i, %i, %i, %i)", GetVehicleModel(vehicleid), x, y, z, a, vehicleColors[vehicleid][0], vehicleColors[vehicleid][1], gangid, type, vip, delay, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid)); mysql_tquery(connectionID, queryBuffer); mysql_tquery(connectionID, "SELECT * FROM vehicles WHERE id = LAST_INSERT_ID()", "OnQueryFinished", "ii", THREAD_LOAD_VEHICLES, 0); adminVehicle{vehicleid} = false; DestroyVehicleEx(vehicleid); return 1; } CMD:editvehicle(playerid, params[]) { new vehicleid, option[14], param[32], value; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[14]S()[32]", vehicleid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Spawn, Price, Tickets, Locked, Plate, Color, Paintjob, Neon, Trunk, Health"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Gang, Faction, Job, VIP, Respawndelay, Siren, Rank"); return 1; } if(!IsValidVehicle(vehicleid) || !VehicleInfo[vehicleid][vID]) { return SendClientMessage(playerid, COLOR_GREY, "The vehicle specified is invalid or a static vehicle."); } if(!strcmp(option, "spawn", true)) { new id = VehicleInfo[vehicleid][vID]; /*if(VehicleInfo[vehicleid][vFactionType] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't set the spawn of a faction vehicle indoors."); }*/ if(IsPlayerInAnyVehicle(playerid)) { GetVehiclePos(vehicleid, VehicleInfo[vehicleid][vPosX], VehicleInfo[vehicleid][vPosY], VehicleInfo[vehicleid][vPosZ]); GetVehicleZAngle(vehicleid, VehicleInfo[vehicleid][vPosA]); } else { GetPlayerPos(playerid, VehicleInfo[vehicleid][vPosX], VehicleInfo[vehicleid][vPosY], VehicleInfo[vehicleid][vPosZ]); GetPlayerFacingAngle(playerid, VehicleInfo[vehicleid][vPosA]); } if(VehicleInfo[vehicleid][vGang] >= 0 || VehicleInfo[vehicleid][vOwnerID] > 0) { VehicleInfo[vehicleid][vInterior] = GetPlayerInterior(playerid); VehicleInfo[vehicleid][vWorld] = GetPlayerVirtualWorld(playerid); SaveVehicleModifications(vehicleid); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET pos_x = '%f', pos_y = '%f', pos_z = '%f', pos_a = '%f', interior = %i, world = %i WHERE id = %i", VehicleInfo[vehicleid][vPosX], VehicleInfo[vehicleid][vPosY], VehicleInfo[vehicleid][vPosZ], VehicleInfo[vehicleid][vPosA], VehicleInfo[vehicleid][vInterior], VehicleInfo[vehicleid][vWorld], id); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have moved the spawn point for %s (ID %i).", GetVehicleName(vehicleid), vehicleid); SendClientMessage(playerid, COLOR_WHITE, "Note: The vehicle's ID may have changed in the mean time."); DespawnVehicle(vehicleid, false); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM vehicles WHERE id = %i", id); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOAD_VEHICLES, -1); } else if(!strcmp(option, "price", true)) { if(!VehicleInfo[vehicleid][vOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This option can only be adjusted on player owned vehicles."); } if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [price] [value]"); } VehicleInfo[vehicleid][vPrice] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET price = %i WHERE id = %i", VehicleInfo[vehicleid][vPrice], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the price of %s's %s (ID %i) to $%i.", VehicleInfo[vehicleid][vOwner], GetVehicleName(vehicleid), vehicleid, value); } else if(!strcmp(option, "tickets", true)) { if(!VehicleInfo[vehicleid][vOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This option can only be adjusted on player owned vehicles."); } if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [tickets] [value]"); } VehicleInfo[vehicleid][vTickets] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET tickets = %i WHERE id = %i", VehicleInfo[vehicleid][vTickets], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the tickets of %s's %s (ID %i) to $%i.", VehicleInfo[vehicleid][vOwner], GetVehicleName(vehicleid), vehicleid, value); } else if(!strcmp(option, "locked", true)) { if(sscanf(param, "i", value) || !(0 <= value <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [locked] [0/1]"); } if(VehicleInfo[vehicleid][vFactionType] > 0) { return SendClientMessage(playerid, COLOR_GREY, "Faction vehicles can't be locked."); } VehicleInfo[vehicleid][vLocked] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET locked = %i WHERE id = %i", VehicleInfo[vehicleid][vLocked], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SetVehicleParams(vehicleid, VEHICLE_DOORS, value); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the locked state of %s (ID %i) to %i.", GetVehicleName(vehicleid), vehicleid, value); } else if(!strcmp(option, "plate", true)) { if(!VehicleInfo[vehicleid][vOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This option can only be adjusted on player owned vehicles."); } if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [plate] [text]"); } strcpy(VehicleInfo[vehicleid][vPlate], param, 32); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET plate = '%e' WHERE id = %i", VehicleInfo[vehicleid][vPlate], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); ResyncVehicle(vehicleid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the license plate of %s's %s (ID %i) to %s.", VehicleInfo[vehicleid][vOwner], GetVehicleName(vehicleid), vehicleid, param); SendClientMessage(playerid, COLOR_WHITE, "Note: The vehicle will need to be respawned for changes to take effect."); } else if(!strcmp(option, "color", true)) { new color1, color2; if(sscanf(param, "ii", color1, color2)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [color] [color 1] [color 2]"); } if(!(0 <= color1 <= 255) || !(0 <= color2 <= 255)) { return SendClientMessage(playerid, COLOR_GREY, "The colors must range from 0 to 255."); } VehicleInfo[vehicleid][vColor1] = color1; VehicleInfo[vehicleid][vColor2] = color2; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET color1 = %i, color2 = %i WHERE id = %i", VehicleInfo[vehicleid][vColor1], VehicleInfo[vehicleid][vColor2], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); ChangeVehicleColor(vehicleid, color1, color2); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the colors of %s (ID %i) to %i, %i.", GetVehicleName(vehicleid), vehicleid, color1, color2); } else if(!strcmp(option, "paintjob", true)) { new paintjobid; if(sscanf(param, "i", paintjobid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [paintjobid] [value (-1 = none)]"); } if(!(-1 <= paintjobid <= 5)) { return SendClientMessage(playerid, COLOR_GREY, "The paintjob must range from -1 to 5."); } if(VehicleInfo[vehicleid][vFactionType] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't change the paintjob on a faction vehicle."); } VehicleInfo[vehicleid][vPaintjob] = paintjobid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET paintjob = %i WHERE id = %i", VehicleInfo[vehicleid][vPaintjob], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); ChangeVehiclePaintjob(vehicleid, paintjobid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the paintjob of %s (ID %i) to %i.", GetVehicleName(vehicleid), vehicleid, paintjobid); } else if(!strcmp(option, "neon", true)) { if(!VehicleInfo[vehicleid][vOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This option can only be adjusted on player owned vehicles."); } if(isnull(param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [neon] [color]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of colors: None, Red, Blue, Green, Yellow, Pink, White"); return 1; } if(!strcmp(param, "neon", true)) { SetVehicleNeon(vehicleid, 0); } else if(!strcmp(param, "red", true)) { SetVehicleNeon(vehicleid, 18647); } else if(!strcmp(param, "blue", true)) { SetVehicleNeon(vehicleid, 18648); } else if(!strcmp(param, "green", true)) { SetVehicleNeon(vehicleid, 18649); } else if(!strcmp(param, "yellow", true)) { SetVehicleNeon(vehicleid, 18650); } else if(!strcmp(param, "pink", true)) { SetVehicleNeon(vehicleid, 18651); } else if(!strcmp(param, "white", true)) { SetVehicleNeon(vehicleid, 18652); } else { return SendClientMessage(playerid, COLOR_GREY, "Invalid color."); } SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the neon type of %s's %s (ID %i) to %s.", VehicleInfo[vehicleid][vOwner], GetVehicleName(vehicleid), vehicleid, param); } else if(!strcmp(option, "trunk", true)) { if(!VehicleInfo[vehicleid][vOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This option can only be adjusted on player owned vehicles."); } if(sscanf(param, "i", value) || !(0 <= value <= 3)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [trunk] [level (0-3)]"); } VehicleInfo[vehicleid][vTrunk] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET trunk = %i WHERE id = %i", VehicleInfo[vehicleid][vTrunk], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the trunk of %s's %s (ID %i) to level %i/3.", VehicleInfo[vehicleid][vOwner], GetVehicleName(vehicleid), vehicleid, value); } else if(!strcmp(option, "health", true)) { new Float:amount; if(sscanf(param, "f", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [health] [amount]"); } if(!(300.0 <= amount <= 10000.0)) { return SendClientMessage(playerid, COLOR_GREY, "The health value must range from 300.0 to 10000.0."); } VehicleInfo[vehicleid][vHealth] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET health = '%f' WHERE id = %i", VehicleInfo[vehicleid][vHealth], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SetVehicleHealth(vehicleid, amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the health of %s (ID %i) to %.2f.", GetVehicleName(vehicleid), vehicleid, amount); } else if(!strcmp(option, "gang", true)) { new gangid; if(VehicleInfo[vehicleid][vOwnerID] > 0) { return SendClientMessage(playerid, COLOR_GREY, "This option cannot be adjusted on player owned vehicles."); } if(sscanf(param, "i", gangid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [gang] [gangid (-1 = none)]"); } if(!(-1 <= gangid < MAX_GANGS) || (gangid >= 0 && !GangInfo[gangid][gSetup])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid gang."); } VehicleInfo[vehicleid][vGang] = gangid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET gangid = %i WHERE id = %i", VehicleInfo[vehicleid][vGang], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); if(gangid == -1) SendClientMessageEx(playerid, COLOR_AQUA, "** You have reset the gang for %s (ID %i).", GetVehicleName(vehicleid), vehicleid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the gang of %s (ID %i) to %s (%i).", GetVehicleName(vehicleid), vehicleid, GangInfo[gangid][gName], gangid); } else if(!strcmp(option, "faction", true)) { new type; if(VehicleInfo[vehicleid][vOwnerID] > 0) { return SendClientMessage(playerid, COLOR_GREY, "This option cannot be adjusted on player owned vehicles."); } if(sscanf(param, "i", type)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [faction] [type]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (0) None (1) Police (2) Medic (3) News (4) Government (5) Hitman (6) Federal"); return 1; } if(!(0 <= type <= 6)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } VehicleInfo[vehicleid][vFactionType] = type; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET factiontype = %i WHERE id = %i", VehicleInfo[vehicleid][vFactionType], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); if(type == FACTION_NONE) SendClientMessageEx(playerid, COLOR_AQUA, "** You've reset the faction type for %s (ID %i).", GetVehicleName(vehicleid), vehicleid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You've set the faction type of %s (ID %i) to %s (%i).", GetVehicleName(vehicleid), vehicleid, factionTypes[type], type); } else if(!strcmp(option, "job", true)) { if(VehicleInfo[vehicleid][vOwnerID] > 0) { return SendClientMessage(playerid, COLOR_GREY, "This option cannot be adjusted on player owned vehicles."); } if(sscanf(param, "i", value)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [job] [type]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of jobs: (-1) None (0) Pizzaman (1) Courier (2) Fisherman (3) Bodyguard (4) Weapon Dealer (5) Mechanic"); SendClientMessage(playerid, COLOR_SYNTAX, "List of jobs: (6) Miner (7) Sweeper (8) Taxi Driver (9) Drug Dealer (10) Lawyer (11) Detective (12) Thief"); return 1; } if(!(-1 <= value <= 12)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid job."); } VehicleInfo[vehicleid][vJob] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET job = %i WHERE id = %i", VehicleInfo[vehicleid][vJob], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); if(value == JOB_NONE) SendClientMessageEx(playerid, COLOR_AQUA, "** You've reset the job type for %s (ID %i).", GetVehicleName(vehicleid), vehicleid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You've set the job type of %s (ID %i) to %s (%i).", GetVehicleName(vehicleid), vehicleid, GetJobName(value), value); } else if(!strcmp(option, "vip", true)) { if(VehicleInfo[vehicleid][vOwnerID] > 0) { return SendClientMessage(playerid, COLOR_GREY, "This option cannot be adjusted on player owned vehicles."); } if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [vip] [level (0-3)]"); } if(!(0 <= value <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid level."); } VehicleInfo[vehicleid][vVIP] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET vippackage = %i WHERE id = %i", VehicleInfo[vehicleid][vVIP], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); if(value == 0) SendClientMessageEx(playerid, COLOR_AQUA, "** You've reset the VIP restriction for %s (ID %i).", GetVehicleName(vehicleid), vehicleid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You've set the VIP restriction of %s (ID %i) to %s (%i).", GetVehicleName(vehicleid), vehicleid, GetVIPRank(value), value); } else if(!strcmp(option, "respawndelay", true)) { new id = VehicleInfo[vehicleid][vID]; if(VehicleInfo[vehicleid][vOwnerID] > 0) { return SendClientMessage(playerid, COLOR_GREY, "This option cannot be adjusted on player owned vehicles."); } if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [respawndelay] [seconds (-1 = none)]"); } VehicleInfo[vehicleid][vRespawnDelay] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET respawndelay = %i WHERE id = %i", VehicleInfo[vehicleid][vRespawnDelay], id); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the respawn delay of %s (ID %i) to %i seconds.", GetVehicleName(vehicleid), vehicleid, value); SendClientMessage(playerid, COLOR_WHITE, "Note: The vehicle's ID may have changed in the mean time."); DespawnVehicle(vehicleid, false); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM vehicles WHERE id = %i", id); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOAD_VEHICLES, -1); } else if(!strcmp(option, "siren", true)) { new id = VehicleInfo[vehicleid][vID]; if(VehicleInfo[vehicleid][vFactionType] == FACTION_NONE) { return SendClientMessage(playerid, COLOR_GREY, "This option can only be adjusted on faction vehicles."); } if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [siren] [1/0]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET siren = %i WHERE id = %i", value, id); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the siren of %s (ID %i) to %i.", GetVehicleName(vehicleid), vehicleid, value); SendClientMessage(playerid, COLOR_WHITE, "Note: The vehicle's ID may have changed in the mean time."); DespawnVehicle(vehicleid, false); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM vehicles WHERE id = %i", id); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOAD_VEHICLES, -1); } else if(!strcmp(option, "rank", true)) { if(VehicleInfo[vehicleid][vOwnerID] > 0) { return SendClientMessage(playerid, COLOR_GREY, "This option cannot be adjusted on player owned vehicles."); } if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editvehicle [vehicleid] [rank] [rank(0-12)]"); } if(!(0 <= value <= 12)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid rank."); } VehicleInfo[vehicleid][vRank] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET rank = %i WHERE id = %i", VehicleInfo[vehicleid][vRank], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); if(value == 0) SendClientMessageEx(playerid, COLOR_AQUA, "** You've reset the rank restriction for %s (ID %i).", GetVehicleName(vehicleid), vehicleid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You've set the rank restriction of %s (ID %i) to %i (%i).", GetVehicleName(vehicleid), vehicleid, VehicleInfo[vehicleid][vRank], value); } return 1; } CMD:removevehicle(playerid, params[]) { new vehicleid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", vehicleid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removevehicle [vehicleid]"); } if(!IsValidVehicle(vehicleid) || !VehicleInfo[vehicleid][vID]) { return SendClientMessage(playerid, COLOR_GREY, "The vehicle specified is invalid or a static vehicle."); } if(VehicleInfo[vehicleid][vOwnerID]) { SendClientMessageEx(playerid, COLOR_WHITE, "You have deleted %s's %s.", VehicleInfo[vehicleid][vOwner], GetVehicleName(vehicleid)); } else { SendClientMessageEx(playerid, COLOR_WHITE, "You have deleted %s (ID %i).", GetVehicleName(vehicleid), vehicleid); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM vehicles WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); DespawnVehicle(vehicleid, false); return 1; } CMD:vehicleinfo(playerid, params[]) { new vehicleid, neon[12], gang[32], Float:health; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", vehicleid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vehicleinfo [vehicleid]"); } if(!IsValidVehicle(vehicleid) || !VehicleInfo[vehicleid][vID]) { return SendClientMessage(playerid, COLOR_GREY, "The vehicle specified is invalid or a static vehicle."); } GetVehicleHealth(vehicleid, health); switch(VehicleInfo[vehicleid][vNeon]) { case 18647: neon = "Red"; case 18648: neon = "Blue"; case 18649: neon = "Green"; case 18650: neon = "Yellow"; case 18651: neon = "Pink"; case 18652: neon = "White"; default: neon = "None"; } if(VehicleInfo[vehicleid][vGang] >= 0) { strcat(gang, GangInfo[VehicleInfo[vehicleid][vGang]][gName]); } else { gang = "None"; } SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_______ %s Stats _______", GetVehicleName(vehicleid)); SendClientMessageEx(playerid, COLOR_GREY2, "Owner: %s - Value: %s - Tickets: %s - License Plate: %s", VehicleInfo[vehicleid][vOwner], FormatNumber(VehicleInfo[vehicleid][vPrice]), FormatNumber(VehicleInfo[vehicleid][vTickets]), VehicleInfo[vehicleid][vPlate]); SendClientMessageEx(playerid, COLOR_GREY2, "Neon: %s - Trunk Level: %i/3 - Alarm Level: %i/3 - Health: %.1f - Fuel: %i/100", neon, VehicleInfo[vehicleid][vTrunk], VehicleInfo[vehicleid][vAlarm], health, vehicleFuel[vehicleid]); SendClientMessageEx(playerid, COLOR_GREY2, "Gang: %s - Faction: %s - Rank: %i - Job Type: %s - Respawn Delay: %i seconds", gang, factionTypes[VehicleInfo[vehicleid][vFactionType]], VehicleInfo[vehicleid][vRank], GetJobName(VehicleInfo[vehicleid][vJob]), VehicleInfo[vehicleid][vRespawnDelay]); return 1; } CMD:aclearwanted(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /aclearwanted [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pWantedLevel]) { return SendClientMessage(playerid, COLOR_GREY, "That player has no active charges to clear."); } PlayerInfo[targetid][pWantedLevel] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM charges WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET wantedlevel = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_WHITE, "Your crimes were cleared by %s.", GetPlayerRPName(playerid)); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has cleared %s's crimes and wanted level.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:removedm(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removedm [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pDMWarnings] && !PlayerInfo[targetid][pWeaponRestricted]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't been punished for DM recently."); } PlayerInfo[targetid][pDMWarnings]--; PlayerInfo[targetid][pWeaponRestricted] = 0; if(PlayerInfo[targetid][pJailType] == 2) { PlayerInfo[targetid][pJailType] = 0; PlayerInfo[targetid][pJailTime] = 0; SetPlayerPos(targetid, 1544.4407, -1675.5522, 13.5584); SetPlayerFacingAngle(targetid, 90.0000); SetPlayerInterior(targetid, 0); SetPlayerVirtualWorld(targetid, 0); SetCameraBehindPlayer(targetid); SetPlayerWeapons(targetid); } SendClientMessageEx(targetid, COLOR_AQUA, "** Your DM punishment has been reversed by %s.", GetPlayerRPName(playerid)); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has reversed %s's DM punishment.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) reversed %s's (uid: %i) DM punishment.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET jailtype = 0, jailtime = 0, dmwarnings = %i, weaponrestricted = 0 WHERE uid = %i", PlayerInfo[targetid][pDMWarnings], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); return 1; } CMD:destroyveh(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(adminVehicle{vehicleid}) { DestroyVehicleEx(vehicleid); adminVehicle{vehicleid} = false; return SendClientMessage(playerid, COLOR_GREY, "Admin vehicle destroyed."); } for(new i = 0; i < MAX_VEHICLES; i++) { if(adminVehicle{i}) { if(IsValidDynamicObject(vehicleSiren[i])) { DestroyDynamicObject(vehicleSiren[i]); vehicleSiren[i] = INVALID_OBJECT_ID; } DestroyVehicleEx(i); adminVehicle{i} = false; } } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s destroyed all admin spawned vehicles.", GetPlayerRPName(playerid)); return 1; } CMD:respawncars(playerid, params[]) { new option[10], param[12]; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[10]S()[12]", option, param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /respawncars [job | faction | nearby | all]"); } if(!strcmp(option, "job", true)) { foreach(new i: Vehicle) { if(!IsVehicleOccupied(i) && !adminVehicle{i}) { if((pizzaVehicles[0] <= i <= pizzaVehicles[5]) || (courierVehicles[0] <= i <= courierVehicles[3]) || (sweeperVehicles[0] <= i <= sweeperVehicles[3]) || (taxiVehicles[0] <= i <= taxiVehicles[3]) || (garbageVehicles[0] <= i <= garbageVehicles[5]) || (VehicleInfo[i][vJob] != JOB_NONE)) { SetVehicleToRespawn(i); } } } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s respawned all unoccupied job vehicles.", GetPlayerRPName(playerid)); } else if(!strcmp(option, "faction", true)) { new type; if(sscanf(param, "i", type)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /respawncars [faction] [type]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (1) Police (2) Medic (3) News (4) Government (5) Hitman (6) Federal"); return 1; } if(!(1 <= type <= 5)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid faction type."); } foreach(new i: Vehicle) { if(!IsVehicleOccupied(i) && !adminVehicle{i} && VehicleInfo[i][vFactionType] == type) { SetVehicleToRespawn(i); } } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s respawned all unoccupied {F7A763}%s{FF6347} vehicles.", GetPlayerRPName(playerid), factionTypes[type]); } else if(!strcmp(option, "nearby", true)) { foreach(new i: Vehicle) { if(!IsVehicleOccupied(i) && !adminVehicle{i} && IsVehicleStreamedIn(i, playerid)) { SetVehicleToRespawn(i); } } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s respawned all unoccupied vehicles in %s.", GetPlayerRPName(playerid), GetPlayerZoneName(playerid)); } else if(!strcmp(option, "all", true)) { foreach(new i: Vehicle) { if(!IsVehicleOccupied(i) && !adminVehicle{i}) { SetVehicleToRespawn(i); } } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s respawned all unoccupied vehicles.", GetPlayerRPName(playerid)); } return 1; } CMD:broadcast(playerid, params[]) { new style, text[128]; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[128]", style, text)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /broadcast [style (0-6)] [text]"); } if(!(0 <= style <= 6)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid style."); } if(style == 2) { return SendClientMessage(playerid, COLOR_GREY, "Style 2 only disappears after death and is therefore disabled."); } GameTextForAll(text, 6000, style); return 1; } CMD:fixveh(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't fix a vehicle if you're not sitting in one."); } RepairVehicle(GetPlayerVehicleID(playerid)); SendClientMessage(playerid, COLOR_GREY, "Vehicle fixed."); return 1; } CMD:clearchat(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } foreach(new i : Player) { ClearChat(i); } return 1; } CMD:healrange(playerid, params[]) { new Float:radius; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "f", radius)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /healrange [radius]"); } if(!(1.0 <= radius <= 50.0)) { return SendClientMessage(playerid, COLOR_GREY, "The radius can't be below 1.0 or above 50.0."); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } foreach(new i : Player) { if(IsPlayerInRangeOfPlayer(i, playerid, radius)) { if(!PlayerInfo[i][pAdminDuty]) { SetPlayerHealth(i, 100.0); if(GetPlayerArmourEx(i) < 100.0) { SetScriptArmour(i, 100.0); } } SendClientMessage(i, COLOR_WHITE, "An admin has healed everyone nearby."); } } return 1; } CMD:freezerange(playerid, params[]) { new Float:radius; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "f", radius)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /freezerange [radius]"); } if(!(1.0 <= radius <= 50.0)) { return SendClientMessage(playerid, COLOR_GREY, "The radius can't be below 1.0 or above 50.0."); } foreach(new i : Player) { if(IsPlayerInRangeOfPlayer(i, playerid, radius)) { if(!PlayerInfo[i][pAdminDuty]) { TogglePlayerControllable(i, false); } SendClientMessage(i, COLOR_WHITE, "An admin has frozen everyone nearby."); } } return 1; } CMD:unfreezerange(playerid, params[]) { new Float:radius; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "f", radius)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /unfreezerange [radius]"); } if(!(1.0 <= radius <= 50.0)) { return SendClientMessage(playerid, COLOR_GREY, "The radius can't be below 1.0 or above 50.0."); } foreach(new i : Player) { if(IsPlayerInRangeOfPlayer(i, playerid, radius)) { if(!PlayerInfo[i][pAdminDuty]) { TogglePlayerControllable(i, true); } SendClientMessage(i, COLOR_WHITE, "An admin has unfrozen everyone nearby."); } } return 1; } CMD:reviverange(playerid, params[]) { new Float:radius; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "f", radius)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /reviverange [radius]"); } if(!(1.0 <= radius <= 50.0)) { return SendClientMessage(playerid, COLOR_GREY, "The radius can't be below 1.0 or above 50.0."); } foreach(new i : Player) { if(IsPlayerInRangeOfPlayer(i, playerid, radius) && PlayerInfo[i][pInjured]) { PlayerInfo[i][pInjured] = 0; if(PlayerInfo[i][pAcceptedEMS] != INVALID_PLAYER_ID) { SendClientMessageEx(PlayerInfo[i][pAcceptedEMS], COLOR_YELLOW, "Your patient %s has somehow found the strength to get up.", GetPlayerRPName(i)); PlayerInfo[i][pAcceptedEMS] = INVALID_PLAYER_ID; } SetPlayerHealth(i, 100.0); ClearAnimations(i, 1); SendClientMessage(i, COLOR_WHITE, "An admin has revived everyone nearby."); } } return 1; } CMD:shots(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /shots [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM shots WHERE playerid = %i ORDER BY id DESC LIMIT 20", targetid); mysql_tquery(connectionID, queryBuffer, "OnAdminListShots", "ii", playerid, targetid); return 1; } CMD:damages(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /damages [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT weaponid, playerid, timestamp FROM shots WHERE hitid = %i AND hittype = 1 ORDER BY id DESC LIMIT 20", targetid); mysql_tquery(connectionID, queryBuffer, "OnAdminListDamages", "ii", playerid, targetid); return 1; } CMD:kills(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /kills [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM kills WHERE killer_uid = %i OR target_uid = %i ORDER BY date DESC LIMIT 20", PlayerInfo[targetid][pID], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer, "OnAdminListKills", "ii", playerid, targetid); return 1; } CMD:resetadtimer(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } gLastAd = 0; SendClientMessage(playerid, COLOR_GREY, "Advertisement timer reset."); return 1; } CMD:setname(playerid, params[]) { new targetid, name[24]; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "us[24]", targetid, name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setname [playerid] [name]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(PlayerInfo[targetid][pAdminDuty] && strcmp(PlayerInfo[targetid][pAdminName], "None", true) != 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't change the name of a player on admin duty. They're using their admin name."); } if(!IsValidName(name)) { return SendClientMessage(playerid, COLOR_GREY, "The name specified is not supported by the SA-MP client."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE username = '%e'", name); mysql_tquery(connectionID, queryBuffer, "OnAdminChangeName", "iis", playerid, targetid, name); return 1; } CMD:explode(playerid, params[]) { new targetid, damage; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "ui", targetid, damage)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /explode [playerid] [damage(amount)]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } new Float:x, Float:y, Float:z; GetPlayerPos(targetid, x, y, z); CreateExplosionForPlayer(targetid, x, y, z, 6, 20.0); DamagePlayer(targetid, damage, playerid, WEAPON_EXPLOSION, BODY_PART_UNKNOWN, false); SendClientMessageEx(playerid, COLOR_WHITE, "You exploded %s for their client only.", GetPlayerRPName(targetid)); return 1; } CMD:event(playerid, params[]) { new option[10], param[128]; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "s[10]S()[128]", option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /event [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Position, JoinText, Type, Health, Armor, Weapon, Skin, Rules"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Ready, Start, Lock, Countdown, Balance, End"); return 1; } if(!strcmp(option, "position", true)) { if(EventInfo[eType] == 2) { if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /event [position] [red/blue]"); } else if(!strcmp(param, "red", true)) { GetPlayerPos(playerid, EventInfo[ePosX][RED_TEAM], EventInfo[ePosY][RED_TEAM], EventInfo[ePosZ][RED_TEAM]); GetPlayerFacingAngle(playerid, EventInfo[ePosA][RED_TEAM]); EventInfo[eInterior] = GetPlayerInterior(playerid); EventInfo[eWorld] = GetPlayerVirtualWorld(playerid); SendClientMessage(playerid, COLOR_AQUA, "You have set the spawn point for {FF0000}Red{33CCFF} team."); } else if(!strcmp(param, "blue", true)) { GetPlayerPos(playerid, EventInfo[ePosX][BLUE_TEAM], EventInfo[ePosY][BLUE_TEAM], EventInfo[ePosZ][BLUE_TEAM]); GetPlayerFacingAngle(playerid, EventInfo[ePosA][BLUE_TEAM]); EventInfo[eInterior] = GetPlayerInterior(playerid); EventInfo[eWorld] = GetPlayerVirtualWorld(playerid); SendClientMessage(playerid, COLOR_AQUA, "You have set the spawn point for {0000FF}Blue{33CCFF} team."); } } else { GetPlayerPos(playerid, EventInfo[ePosX][0], EventInfo[ePosY][0], EventInfo[ePosZ][0]); GetPlayerFacingAngle(playerid, EventInfo[ePosA][0]); EventInfo[eInterior] = GetPlayerInterior(playerid); EventInfo[eWorld] = GetPlayerVirtualWorld(playerid); SendClientMessage(playerid, COLOR_AQUA, "You have set the event spawn point."); } } else if(!strcmp(option, "type", true)) { new type; if(sscanf(param, "i", type)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /event [type] [1=DM 2=TDM 3=Race 4=Other]"); } if(!(1 <= type <= 4)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } /*if(EventInfo[eReady]) { return SendClientMessage(playerid, COLOR_GREY3, "The type can only be adjusted during event setup."); }*/ EventInfo[eType] = type; switch(type) { case 1: { SendClientMessage(playerid, COLOR_AQUA, "You have set the event type to {FF6347}Deathmatch{33CCFF}."); } case 2: { SendClientMessage(playerid, COLOR_AQUA, "You have set the event type to {FF6347}Team Deathmatch{33CCFF}."); EventInfo[eNext] = RED_TEAM; if(EventInfo[ePosX][RED_TEAM] == 0.0 && EventInfo[ePosY][RED_TEAM] == 0.0 && EventInfo[ePosZ][RED_TEAM] == 0.0) SendClientMessage(playerid, COLOR_LIGHTRED, "** Red Team position not set. '/event position red' to set position."); if(EventInfo[ePosX][BLUE_TEAM] == 0.0 && EventInfo[ePosY][BLUE_TEAM] == 0.0 && EventInfo[ePosZ][BLUE_TEAM] == 0.0) SendClientMessage(playerid, COLOR_LIGHTRED, "** Blue Team position not set. '/event position blue' to set position."); } case 3: { SendClientMessage(playerid, COLOR_AQUA, "You have set the event type to {FF6347}Race{33CCFF}. /veh to spawn the vehicles."); } case 4: { SendClientMessage(playerid, COLOR_AQUA, "You have set the event type to {FF6347}Other{33CCFF}."); } } } else if(!strcmp(option, "health", true)) { new Float:amount; if(sscanf(param, "f", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /event [health] [amount]"); } EventInfo[eHealth] = amount; SendClientMessageEx(playerid, COLOR_AQUA, "You set the event health to %.1f.", amount); } else if(!strcmp(option, "armor", true)) { new Float:amount; if(sscanf(param, "f", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /event [armor] [amount]"); } EventInfo[eArmor] = amount; SendClientMessageEx(playerid, COLOR_AQUA, "You set the event armor to %.1f.", amount); } else if(!strcmp(option, "jointext", true)) { if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /event [jointext] [text]"); } strcpy(EventInfo[eJoinText], param, 128); SendClientMessageEx(playerid, COLOR_AQUA, "You set the join text to '%s'.", param); } else if(!strcmp(option, "weapon", true)) { new slot, weaponid; if(sscanf(param, "ii", slot, weaponid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /event [weapon] [slot (1-5)] [weaponid]"); } if(!(1 <= slot <= 5)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid slot."); } if(!(0 <= weaponid <= 46)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid weapon."); } EventInfo[eWeapons][slot-1] = weaponid; SendClientMessageEx(playerid, COLOR_AQUA, "You set the weapon in slot %i to %s.", slot, GetWeaponNameEx(weaponid)); } else if(!strcmp(option, "skin", true)) { new team[6], skinid; if(EventInfo[eType] == 2) { if(sscanf(param, "s[6]i", team, skinid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /event [skin] [red/blue] [skinid]"); } if(!(0 <= skinid <= 311)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID."); } if(!strcmp(team, "red", true)) { EventInfo[eSkin][RED_TEAM] = skinid; SendClientMessageEx(playerid, COLOR_AQUA, "You set the skin for {FF0000}Red{33CCFF} team to %i.", skinid); } else if(!strcmp(team, "blue", true)) { EventInfo[eSkin][BLUE_TEAM] = skinid; SendClientMessageEx(playerid, COLOR_AQUA, "You set the skin for {0000FF}Blue{33CCFF} team to %i.", skinid); } } else { if(sscanf(param, "i", skinid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /event [skin] [skinid (0 = reset)]"); } if(!(0 <= skinid <= 311)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid skin ID."); } EventInfo[eSkin][0] = skinid; SendClientMessageEx(playerid, COLOR_AQUA, "You set the event skin to %i.", skinid); } } else if(!strcmp(option, "rules", true)) { new rule[8], toggle; if(sscanf(param, "s[8]i", rule, toggle) || !(0 <= toggle <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /event [rules] [cs/qs/healing] [0/1]"); } if(EventInfo[eType] != 1 && EventInfo[eType] != 2) { return SendClientMessage(playerid, COLOR_GREY, "You can only set rules for DM & TDM events."); } if(!strcmp(rule, "cs", true)) { EventInfo[eCS] = toggle; if(toggle) SendClientMessage(playerid, COLOR_AQUA, "You have {00AA00}allowed{33CCFF} crackshooting in the event."); else SendClientMessage(playerid, COLOR_AQUA, "You have {FF6347}disallowed{33CCFF} crackshooting in the event."); } else if(!strcmp(rule, "qs", true)) { EventInfo[eQS] = toggle; if(toggle) SendClientMessage(playerid, COLOR_AQUA, "You have {00AA00}allowed{33CCFF} quickswapping in the event."); else SendClientMessage(playerid, COLOR_AQUA, "You have {FF6347}disallowed{33CCFF} quickswapping in the event."); } else if(!strcmp(rule, "healing", true)) { EventInfo[eHeal] = toggle; if(toggle) SendClientMessage(playerid, COLOR_AQUA, "You have {00AA00}allowed{33CCFF} healing in the event."); else SendClientMessage(playerid, COLOR_AQUA, "You have {FF6347}disallowed{33CCFF} healing in the event."); } } else if(!strcmp(option, "ready", true)) { if(isnull(param) || strcmp(param, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /event [ready] [confirm]"); SendClientMessage(playerid, COLOR_SYNTAX, "This command will announce to the whole server that an event is ready to join."); return 1; } if(EventInfo[eReady]) { return SendClientMessage(playerid, COLOR_GREY, "The event is already marked as ready."); } if(EventInfo[eType] == 2) { if(EventInfo[ePosX][RED_TEAM] == 0.0 && EventInfo[ePosY][RED_TEAM] == 0.0 && EventInfo[ePosZ][RED_TEAM] == 0.0) { return SendClientMessage(playerid, COLOR_GREY, "There is no spawn point set for red team."); } if(EventInfo[ePosX][BLUE_TEAM] == 0.0 && EventInfo[ePosY][BLUE_TEAM] == 0.0 && EventInfo[ePosZ][BLUE_TEAM] == 0.0) { return SendClientMessage(playerid, COLOR_GREY, "There is no spawn point set for blue team."); } if(!EventInfo[eSkin][RED_TEAM]) { return SendClientMessage(playerid, COLOR_GREY, "There is no skin set for red team."); } if(!EventInfo[eSkin][BLUE_TEAM]) { return SendClientMessage(playerid, COLOR_GREY, "There is no skin set for blue team."); } } else { if(!EventInfo[eType]) { return SendClientMessage(playerid, COLOR_GREY, "The event type has not been set."); } if(EventInfo[ePosX][0] == 0.0 && EventInfo[ePosY][0] == 0.0 && EventInfo[ePosZ][0] == 0.0) { return SendClientMessage(playerid, COLOR_GREY, "The spawn point has not been set."); } } EventInfo[eReady] = 1; switch(EventInfo[eType]) { case 1: SendClientMessageToAllEx(COLOR_AQUA, "%s has started a DM event, use /joinevent to join!", GetPlayerRPName(playerid)); case 2: SendClientMessageToAllEx(COLOR_AQUA, "%s has started a TDM event, use /joinevent to join!", GetPlayerRPName(playerid)); case 3: SendClientMessageToAllEx(COLOR_AQUA, "%s has started a Race event, use /joinevent to join!", GetPlayerRPName(playerid)); case 4: SendClientMessageToAllEx(COLOR_AQUA, "%s has started an event, use /joinevent to join!", GetPlayerRPName(playerid)); } SendClientMessage(playerid, COLOR_WHITE, "Use '/event lock' to lock the event and '/event start' to start."); } else if(!strcmp(option, "lock", true)) { if(!EventInfo[eReady]) { return SendClientMessage(playerid, COLOR_GREY, "There is no event ready. Please set one up first."); } if(!EventInfo[eLocked]) { EventInfo[eLocked] = 1; SendClientMessageToAllEx(COLOR_AQUA, "The event has been locked by %s.", GetPlayerRPName(playerid)); } else { EventInfo[eLocked] = 0; SendClientMessageToAllEx(COLOR_AQUA, "The event was unlocked by %s.", GetPlayerRPName(playerid)); } } else if(!strcmp(option, "start", true)) { if(!EventInfo[eReady]) { return SendClientMessage(playerid, COLOR_GREY, "There is no event ready. Please set one up first."); } if(EventInfo[eStarted]) { return SendClientMessage(playerid, COLOR_GREY, "The event has already started."); } foreach(new i : Player) { if(PlayerInfo[i][pJoinedEvent]) SendClientMessage(i, COLOR_AQUA, "The event has started. Good luck!"); else SendClientMessage(i, COLOR_AQUA, "The event has started. Better luck next time!"); } EventInfo[eStarted] = 1; } else if(!strcmp(option, "countdown", true)) { if(!EventInfo[eReady]) { return SendClientMessage(playerid, COLOR_GREY, "There is no event ready. Please set one up first."); } SetTimerEx("Countdown", 1000, false, "ii", playerid, 3); SendClientMessage(playerid, COLOR_AQUA, "You have initiated a countdown for all players in the event."); } else if(!strcmp(option, "balance", true)) { new teamid = RED_TEAM; if(!EventInfo[eReady]) { return SendClientMessage(playerid, COLOR_GREY, "There is no event ready. Please set one up first."); } if(EventInfo[eType] != 2) { return SendClientMessage(playerid, COLOR_GREY, "The event currently active is not a TDM event."); } foreach(new i : Player) { if(PlayerInfo[i][pJoinedEvent]) { PlayerInfo[i][pEventTeam] = teamid; SetTimerEx("teamBalance", 300+random(500), false, "ii", playerid, teamid); teamid = teamid == RED_TEAM ? BLUE_TEAM : RED_TEAM; if(PlayerInfo[i][pEventTeam] == RED_TEAM) { GameTextForPlayer(i, "~w~You are on~n~~r~Red Team", 3000, 4); } else if(PlayerInfo[i][pEventTeam] == BLUE_TEAM) { GameTextForPlayer(i, "~w~You are on~n~~b~Blue Team", 3000, 6); } SendClientMessageEx(i, COLOR_AQUA, "%s has balanced the teams. You are now in %s{33CCFF} team.", GetPlayerRPName(playerid), (PlayerInfo[i][pEventTeam] == RED_TEAM) ? ("{FF0000}Red") : ("{0000FF}Blue")); } } SendClientMessage(playerid, COLOR_AQUA, "You have balanced the event teams."); } else if(!strcmp(option, "end", true)) { if(!EventInfo[eReady]) { return SendClientMessage(playerid, COLOR_GREY, "There is no event ready. Please set one up first."); } ResetEvent(); SendClientMessageToAllEx(COLOR_AQUA, "The event was ended by %s.", GetPlayerRPName(playerid)); } return 1; } CMD:oban(playerid, params[]) { new username[MAX_PLAYERS], reason[128], targetid; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]s[128]", username, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /oban [username] [reason]"); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be kicked."); } if(IsPlayerOnline(username)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already online and logged in. Use /ban instead."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT adminlevel, ip, uid FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "OnAdminOfflineBan", "iss", playerid, username, reason); return 1; } CMD:joinevent(playerid, params[]) { if(PlayerInfo[playerid][pJailType]) { return SendClientMessage(playerid, COLOR_GREY, "You are in jail and therefore cannot participate in an event."); } if(PlayerInfo[playerid][pJoinedEvent]) { return SendClientMessage(playerid, COLOR_GREY, "You already joined the event. /quitevent to leave."); } if(!EventInfo[eReady]) { return SendClientMessage(playerid, COLOR_GREY, "There are no events you can join at the moment."); } if(EventInfo[eLocked]) { return SendClientMessage(playerid, COLOR_GREY, "The event is locked. Better luck next time!"); } /*if(PlayerInfo[playerid][pPaintball] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't join the event while you are playing paintball."); } if(PlayerInfo[playerid][pDueling] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You can't join the event while you are in a duel."); }*/ if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pAcceptedHelp] || GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY) { return SendClientMessage(playerid, COLOR_GREY, "You can't join the event at the moment."); } if((PlayerInfo[playerid][pWeaponRestricted] > 0) && (1 <= EventInfo[eType] <= 2)) { return SendClientMessage(playerid, COLOR_GREY, "You are restricted from weapons and therefore can't join this type of event."); } SetPlayerInEvent(playerid); return 1; } CMD:quitevent(playerid, params[]) { if(!PlayerInfo[playerid][pJoinedEvent] || PlayerInfo[playerid][pHunted]) { return SendClientMessage(playerid, COLOR_GREY, "You are not in an event which you can quit."); } foreach(new i : Player) { if(PlayerInfo[i][pJoinedEvent]) { SendClientMessageEx(i, COLOR_LIGHTORANGE, "(( %s has left the event. ))", GetPlayerNameEx(playerid)); } } ResetPlayerWeapons(playerid); PlayerInfo[playerid][pJoinedEvent] = 0; SetPlayerToSpawn(playerid); return 1; } CMD:permaban(playerid, params[]) { new targetid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /permaban [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be banned."); } Log_Write("log_punishments", "%s (uid: %i) permabanned %s (uid: %i), reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], reason); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was permanently banned by %s, reason: %s", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason); BanPlayer(targetid, GetPlayerNameEx(playerid), reason, true); return 1; } CMD:baninfo(playerid, params[]) { new string[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pAdmin] < 3 && !PlayerInfo[playerid][pBanAppealer]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]", string)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /baninfo [username/ip]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM bans WHERE username = '%e' OR ip = '%e'", string, string); mysql_tquery(connectionID, queryBuffer, "OnAdminCheckBan", "is", playerid, string); return 1; } CMD:banhistory(playerid, params[]) { new name[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pAdmin] < 3 && !PlayerInfo[playerid][pBanAppealer] && !PlayerInfo[playerid][pHumanResources]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]", name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /banhistory [username]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT a.date, a.description FROM log_bans a, users b WHERE a.uid = b.uid AND b.username = '%e' ORDER BY a.date DESC", name); mysql_tquery(connectionID, queryBuffer, "OnAdminCheckBanHistory", "is", playerid, name); return 1; } CMD:unban(playerid, params[]) { new username[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pBanAppealer]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]", username)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /unban [username]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT id, permanent FROM bans WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "OnAdminUnbanUser", "is", playerid, username); return 1; } CMD:unbanip(playerid, params[]) { new string[25]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pBanAppealer]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!IsAnIP(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /unbanip [ip address]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM bans WHERE ip = '%s'", params); mysql_tquery(connectionID, queryBuffer); format(string, sizeof(string), "unbanip %s", params); SendRconCommand(string); SendRconCommand("reloadbans"); UnBlockIpAddress(params); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has unbanned IP '%s'.", GetPlayerRPName(playerid), params); return 1; } CMD:banip(playerid, params[]) { new ip[16], reason[128], targetid; if(PlayerInfo[playerid][pAdmin] < 4 && !PlayerInfo[playerid][pBanAppealer]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[16]S(N/A)[128]", ip, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /banip [ip address] [reason (optional)]"); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be banned."); } if(!IsAnIP(ip)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid IP address."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT id FROM bans WHERE ip = '%s'", ip); mysql_tquery(connectionID, queryBuffer, "OnAdminBanIP", "iss", playerid, ip, reason); return 1; } CMD:lockaccount(playerid, params[]) { new username[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]", username)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /lockaccount [username]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT locked, adminlevel FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "OnAdminLockAccount", "is", playerid, username); return 1; } CMD:unlockaccount(playerid, params[]) { new username[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]", username)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /unlockaccount [username]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE username = '%e' AND locked = 1", username); mysql_tquery(connectionID, queryBuffer, "OnAdminUnlockAccount", "is", playerid, username); return 1; } CMD:sprison(playerid, params[]) { new targetid, minutes, reason[128]; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "uis[128]", targetid, minutes, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sprison [playerid] [minutes] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be prisoned."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet. You can wait until they login or use /oprison."); } if(minutes < 1) { return SendClientMessage(playerid, COLOR_GREY, "The amount of minutes cannot be below one. /unjail to release a player."); } PlayerInfo[targetid][pJailType] = 2; PlayerInfo[targetid][pJailTime] = minutes * 60; ResetPlayerWeaponsEx(targetid); ResetPlayer(targetid); SetPlayerInJail(targetid); Log_Write("log_punishments", "%s (uid: %i) silently prisoned %s (uid: %i) for %i minutes, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], minutes, reason); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was prisoned for %i minutes by an Admin, reason: %s", GetPlayerRPName(targetid), minutes, reason); SendClientMessageEx(targetid, COLOR_AQUA, "** You have been admin prisoned for %i minutes by an admin.", minutes); return 1; } CMD:sethpall(playerid, params[]) { new Float:amount; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "f", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sethpall [amount]"); } if(amount < 1.0) { return SendClientMessage(playerid, COLOR_GREY, "Health can't be under 1.0."); } foreach(new i : Player) { if(!PlayerInfo[i][pAdminDuty] && !PlayerInfo[i][pJoinedEvent]) { SetPlayerHealth(i, amount); } } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s set everyone's health to %.1f.", GetPlayerRPName(playerid), amount); return 1; } CMD:setarmorall(playerid, params[]) { new Float:amount; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "f", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setarmorall [amount]"); } if(amount < 0.0 || amount > 150.0) { return SendClientMessage(playerid, COLOR_GREY, "Armor can't be under 0.0 or above 150.0."); } foreach(new i : Player) { if(!PlayerInfo[i][pAdminDuty] && !PlayerInfo[i][pJoinedEvent]) { SetScriptArmour(i, amount); } } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s set everyone's armor to %.1f.", GetPlayerRPName(playerid), amount); return 1; } CMD:fwsall(playerid, params[]) { if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 8) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(PlayerInfo[playerid][pAdmin] >= 4) { if(sscanf(params, "s", "confirm")) { SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /fwsall [confirm]"); return 1; } foreach(new targetid : Player) { if(!PlayerInfo[playerid][pLogged]) continue; GivePlayerWeaponEx(targetid, 12); GivePlayerWeaponEx(targetid, 24); GivePlayerWeaponEx(targetid, 25); GivePlayerWeaponEx(targetid, 31); GivePlayerWeaponEx(targetid, 34); SendClientMessageEx(targetid, COLOR_AQUA, "You have received a {00AA00}full weapon set{33CCFF} from %s.", GetPlayerRPName(playerid)); } SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s gave a full weapon set to everyone.", GetPlayerRPName(playerid)); } else { SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } return 1; } CMD:fws(playerid, params[]) { if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 7) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(PlayerInfo[playerid][pAdmin] >= 4) { new targetid; if(sscanf(params, "ud", targetid)) { SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /fws [playerid]"); return 1; } GivePlayerWeaponEx(targetid, 12); GivePlayerWeaponEx(targetid, 24); GivePlayerWeaponEx(targetid, 25); GivePlayerWeaponEx(targetid, 31); GivePlayerWeaponEx(targetid, 34); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s gave a full weapon set to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "You have received a {00AA00}full weapon set{33CCFF} from %s.", GetPlayerRPName(playerid)); } else { SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } return 1; } CMD:healup(playerid, params[]) { if(PlayerInfo[playerid][pVIPPackage] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You are not {D909D9}Legendary VIP."); } if(!IsPlayerInRangeOfPoint(playerid, 3.0, 3090.76, 221.60, 1053.48)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in the {D909D9}Legendary VIP{afafaf} Lounge"); } SetScriptArmour(playerid, 100); SetPlayerHealth(playerid, 100); return 1; } CMD:getboombox(playerid, params[]) { if(PlayerInfo[playerid][pVIPPackage] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You are not {D909D9}Legendary VIP."); } if(!IsPlayerInRangeOfPoint(playerid, 3.0, 3087.65, 221.65, 1053.48)) { return SendClientMessage(playerid, 0xAFAFAFAA, "You are not in the {D909D9}Legendary VIP{Afafaf} Lounge."); } if(!strcmp(params, "confirm", true)) { PlayerInfo[playerid][pBoombox] = 1; SendClientMessageEx(playerid, COLOR_WHITE, "You have earned a free {D909D9}Legendary VIP{FFFFFF} boombox."); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET boombox = 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } return 1; } CMD:placegiftbox(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 8) { if(IsPlayerInAnyVehicle(playerid)) { SendClientMessageEx(playerid, COLOR_GREY, "You must be on foot to use this command."); return 1; } new Float:Position[4]; if(mysteryegg == 0) { GetPlayerPos(playerid, Position[0], Position[1], Position[2]); GetPlayerFacingAngle(playerid, Position[3]); mysteryegg = CreateDynamicObject(19056, Position[0], Position[1], Position[2]-0.4, 0.0, 0.0, Position[3], -1, -1, -1, 200.0); mysteryegg3DText = CreateDynamic3DTextLabel("Gift Box\n{FF0000}/claimgift{FFFFFF}\nTo get your gift ",COLOR_WHITE,Position[0], Position[1], Position[2]+0.25,8.0); SetPlayerPos(playerid, Position[0], Position[1], Position[2]+3); SendAdminMessage(COLOR_YELLOW, "ADMWarn: %s has placed the Gift Box.", GetPlayerRPName(playerid)); SendClientMessageToAllEx(COLOR_AQUA, "{FFFF00}GiftBox:{33CCFF} Management %s has placed the giftbox. Staff will give hints where to find it", GetPlayerRPName(playerid)); } else { DestroyDynamicObject(mysteryegg); mysteryegg = 0; DestroyDynamic3DTextLabel( Text3D:mysteryegg3DText ); SendAdminMessage(COLOR_YELLOW, "ADMWARN: %s has destroyed the Gift Box.", GetPlayerRPName(playerid)); } } else { SendClientMessageEx(playerid, COLOR_GREY, "You can't use this command"); } return 1; } CMD:giftall(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 8) { if(GiftAllowed) { SendAdminMessage(COLOR_YELLOW, "{AA3333}AdmWarning{FFFF00}: %s has just sent a Gift to all players.", GetPlayerNameEx(playerid)); GiftAllowed = 0; foreach(Player, i) { GiftBox(playerid, i); } } else { return SendClientMessageEx(playerid, COLOR_GREY, "This command has already been used, wait until the next paycheck!"); } } return 1; } CMD:claimgift(playerid, params[]) { if(mysteryegg != 0) { new Float:Position[3]; GetDynamicObjectPos(mysteryegg, Position[0], Position[1], Position[2]); if(IsPlayerInRangeOfPoint(playerid, 3.0, Position[0], Position[1], Position[2])) { if(PlayerInfo[playerid][pCookies] >= 5) { PlayerInfo[playerid][pCookies] -= 5; GiftBox(MAX_PLAYERS, playerid); SendClientMessage(playerid, COLOR_YELLOW, "Server: You have traded your 5 cookies for the Gift Box"); } else if(PlayerInfo[playerid][pVIPPackage] == 3) { GiftBox(MAX_PLAYERS, playerid); SendClientMessage(playerid, COLOR_YELLOW, "VIP: You got a random gift for free as a {D909D9}Legendary VIP"); } else { SendClientMessage(playerid, COLOR_WHITE, "You do not have enough cookies for that Gift Box."); } } else { SendClientMessage(playerid, COLOR_GREY, "You are not at the Gift Box please follow the check point to exchange your cookies"); SetPlayerCheckpoint(playerid, Position[0], Position[1], Position[2], 5); } } return 1; } stock GiftBox(playerid, giveplayerid) { if(PlayerInfo[playerid][pAdmin] >= 1 || playerid == MAX_PLAYERS) { new randgift = Random(1, 100); if(randgift >= 1 && randgift <= 83) { new gift = Random(1, 8); if(gift == 1) { if(PlayerInfo[giveplayerid][pHours] < 2) { return GiftBox(playerid, giveplayerid); } GivePlayerWeaponEx(giveplayerid, 27); GivePlayerWeaponEx(giveplayerid, 24); GivePlayerWeaponEx(giveplayerid, 31); GivePlayerWeaponEx(giveplayerid, 34); GivePlayerWeaponEx(giveplayerid, 29); SendClientMessage(giveplayerid, COLOR_GREY2, " Congratulations! - You won Full Weapon Set"); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward a full weapon set, enjoy!", GetPlayerNameEx(giveplayerid)); } else if(gift == 2) { PlayerInfo[giveplayerid][pFirstAid]++; SendClientMessageEx(giveplayerid, COLOR_GREY2, "Congratulations, you have won a first aid kit!"); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward a first aid kit, enjoy!", GetPlayerNameEx(giveplayerid)); } else if(gift == 3) { PlayerInfo[giveplayerid][pMaterials] += 2000; SendClientMessageEx(giveplayerid, COLOR_GREY2, "Congratulations, you have won 2,000 materials!"); } else if(gift == 4) { if(PlayerInfo[giveplayerid][pDMWarnings] != 0) { PlayerInfo[giveplayerid][pDMWarnings]--; SendClientMessageEx(giveplayerid, COLOR_GREY, "Congratulations, you have won a single warning removal!"); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward a single warning removal, enjoy!", GetPlayerNameEx(giveplayerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET dmwarnings = %i, WHERE uid = %i", PlayerInfo[giveplayerid][pDMWarnings], PlayerInfo[giveplayerid][pID]); mysql_tquery(connectionID, queryBuffer); } else { SendClientMessageEx(playerid, COLOR_GREY, "Random Reward ended up in a removal of one warning - let's try again!"); GiftBox(playerid, giveplayerid); return 1; } } else if(gift == 5) { PlayerInfo[giveplayerid][pWeed] += 50; SendClientMessageEx(giveplayerid, COLOR_GREY, "Congratulations, you have won 50 grams of weed!"); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward 50 grams of pot, enjoy!", GetPlayerNameEx(giveplayerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[giveplayerid][pWeed], PlayerInfo[giveplayerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(gift == 6) { PlayerInfo[giveplayerid][pCocaine] += 25; SendClientMessageEx(giveplayerid, COLOR_GREY, "Congratulations, you have won 25 grams of cocaine!"); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward 25 grams of cocaine, enjoy!", GetPlayerNameEx(giveplayerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[giveplayerid][pCocaine], PlayerInfo[giveplayerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(gift == 7) { GivePlayerCash(giveplayerid, 20000); SendClientMessageEx(giveplayerid, COLOR_GREY, "Congratulations, you have won $20,000!"); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward $20,000, enjoy!", GetPlayerNameEx(giveplayerid)); } } else if(randgift > 83 && randgift <= 98) { new gift = Random(1, 5); if(gift == 1) { GivePlayerCash(giveplayerid, 15000); SendClientMessageEx(giveplayerid, COLOR_GREY, "Congratulations, you have won $15000!"); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward $15000, enjoy!", GetPlayerNameEx(giveplayerid)); } else if(gift == 2) { PlayerInfo[giveplayerid][pMaterials] += 15000; SendClientMessageEx(giveplayerid, COLOR_GREY, "Congratulations, you have won 15,000 materials!"); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward 15,000 materials, enjoy!", GetPlayerNameEx(giveplayerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[giveplayerid][pMaterials], PlayerInfo[giveplayerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(gift == 3) { PlayerInfo[giveplayerid][pUpgradePoints] += 10; SendClientMessageEx(giveplayerid, COLOR_GREY, " Congratulations, you have won 10 upgrade points!"); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward 10 upgrade points, enjoy!", GetPlayerNameEx(giveplayerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET upgradepoints = %i WHERE uid = %i", PlayerInfo[giveplayerid][pUpgradePoints], PlayerInfo[giveplayerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(gift == 4) { SendClientMessageEx(giveplayerid, COLOR_GREY, " Congratulations, you have won a free car!"); SendClientMessageEx(giveplayerid, COLOR_GREY, " Note: This rare reward may take up to 48 hours to be rewarded, contact Shop Techs."); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, 'Giftbox', NOW(), 'Free Car')", PlayerInfo[giveplayerid][pID]); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_YELLOW, "{AA3333}AdmWarning{FFFF00}: %s has just won a free car from giftbox.", GetPlayerNameEx(giveplayerid)); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward a free car, enjoy!", GetPlayerNameEx(giveplayerid)); } } else if(randgift > 98 && randgift <= 100) { new gift = Random(1, 4); if(gift == 1 && PlayerInfo[giveplayerid][pVIPPackage] <= 2) { SendClientMessageEx(giveplayerid, COLOR_GREY, "Congratulations, you have won one month of Gold VIP!"); SendClientMessageEx(giveplayerid, COLOR_GREY, " Note: This rare reward may take up to 48 hours to be rewarded."); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, 'Giftbox', NOW(), 'Gold VIP')", PlayerInfo[giveplayerid][pID]); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_YELLOW, "{AA3333}AdmWarning{FFFF00}: %s has just won one month of {D909D9}Gold VIP{FFFF00} from giftbox.", GetPlayerNameEx(giveplayerid)); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward one month of Gold VIP, enjoy!", GetPlayerNameEx(giveplayerid)); } if(gift == 1) { SendClientMessageEx(giveplayerid, COLOR_GREY, "Congratulations, you have won a free house!"); SendClientMessageEx(giveplayerid, COLOR_GREY, " Note: This rare reward may take up to 48 hours to be rewarded."); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO flags VALUES(null, %i, 'Giftbox', NOW(), 'Free House')", PlayerInfo[giveplayerid][pID]); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_YELLOW, "{AA3333}AdmWarning{FFFF00}: %s has just won a free house from giftbox.", GetPlayerNameEx(giveplayerid)); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward a free house, enjoy!", GetPlayerNameEx(giveplayerid)); } else if(gift == 2) { GivePlayerCash(giveplayerid, 500000); SendClientMessageEx(giveplayerid, COLOR_GREY, "Congratulations, you have won $500,000!"); SendAdminMessage(COLOR_YELLOW, "{AA3333}AdmWarning{FFFF00}:%s has just won $500,000 from the giftbox.", GetPlayerNameEx(giveplayerid)); SendProximityMessage(playerid, 20.0, COLOR_YELLOW, "* %s was just given a reward $500,000, enjoy!", GetPlayerNameEx(giveplayerid)); } } } return 1; } CMD:vweapons(playerid, params[]) { if(PlayerInfo[playerid][pVIPPackage] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You are not {D909D9}Legendary VIP."); } if(!IsPlayerInRangeOfPoint(playerid, 3.0, 3093.50, 221.60, 1053.48)) { return SendClientMessage(playerid, 0xAFAFAFAA, "You are not in the {D909D9}Legendary VIP{Afafaf} Lounge."); } GivePlayerWeaponEx(playerid, 12); GivePlayerWeaponEx(playerid, 24); GivePlayerWeaponEx(playerid, 25); GivePlayerWeaponEx(playerid, 27); GivePlayerWeaponEx(playerid, 31); GivePlayerWeaponEx(playerid, 34); SendClientMessageEx(playerid, COLOR_AQUA, "You have received a {00AA00}full weapon set{33CCFF} from your vip weapons."); return 1; } CMD:givegun(playerid, params[]) { new targetid, weaponid; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "ui", targetid, weaponid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /givegun [playerid] [weaponid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pHours] < 2 || PlayerInfo[targetid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is either weapon restricted or played less than two playing hours."); } if(!(1 <= weaponid <= 46)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid weapon."); } if(weaponid == 38 && PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "The minigun was disabled due to abuse."); } GivePlayerWeaponEx(targetid, weaponid); SendClientMessageEx(targetid, COLOR_AQUA, "You have received a {00AA00}%s{33CCFF} from %s.", GetWeaponNameEx(weaponid), GetPlayerRPName(playerid)); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has given a %s to %s.", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid), GetPlayerRPName(targetid)); Log_Write("log_givegun", "%s (uid: %i) gives a %s to %s (uid: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetWeaponNameEx(weaponid), GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); return 1; } CMD:setweather(playerid, params[]) { new weatherid; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", weatherid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setweather [weatherid]"); } gWeather = weatherid; SetWeather(weatherid); SendClientMessageEx(playerid, COLOR_GREY2, "Weather changed to %i.", weatherid); return 1; } CMD:settime(playerid, params[]) { new hour; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", hour)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /settime [hour]"); } if(!(0 <= hour <= 23)) { return SendClientMessage(playerid, COLOR_GREY, "The hour must range from 0 to 23."); } gWorldTime = hour; SetWorldTime(hour); SendClientMessageToAllEx(COLOR_GREY2, "Time of day changed to %i hours.", hour); return 1; } CMD:setstat(playerid, params[]) { new targetid, option[24], param[32], value; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "us[24]S()[32]", targetid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [option]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "List of options: Gender, Age, Cash, Bank, Level, Respect, UpgradePoints, Hours, Warnings"); SendClientMessageEx(playerid, COLOR_SYNTAX, "List of options: SpawnHealth, SpawnArmor, FightStyle, Accent, cookies, Phone, Crimes, Arrested"); SendClientMessageEx(playerid, COLOR_SYNTAX, "List of options: WantedLevel, Materials, Weed, Cocaine, Meth, Painkillers, Cigars, WalkieTalkie"); SendClientMessageEx(playerid, COLOR_SYNTAX, "List of options: Channel, Spraycans, Boombox, Phonebook, Paycheck, CarLicense, Seeds, Ephedrine"); SendClientMessageEx(playerid, COLOR_SYNTAX, "List of options: InventoryUpgrade, AddictUpgrade, TraderUpgrade, AssetUpgrade, LaborUpgrade"); SendClientMessageEx(playerid, COLOR_SYNTAX, "List of options: MP3Player, Job, MuriaticAcid, BakingSoda, Components, Watch, GPS, GasCan"); SendClientMessageEx(playerid, COLOR_SYNTAX, "List of options: DMWarnings, WeaponRestricted, CourierSkill, FishingSkill, GuardSkill, WeaponSkill"); SendClientMessageEx(playerid, COLOR_SYNTAX, "List of options: MechanicSkill, LawyerSkill, SmugglerSkill, DetectiveSkill, ThiefSkill"); SendClientMessageEx(playerid, COLOR_SYNTAX, "List of options: Bombs, FirstAid, PoliceScanner, Bodykits, Rimkits, Diamonds, Marriage, Skates"); return 1; } if(!strcmp(option, "gender", true)) { if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [gender] [male | female | shemale]"); } if(!strcmp(param, "male", true)) { PlayerInfo[targetid][pGender] = 1; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's gender to Male.", GetPlayerRPName(targetid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gender = 1 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(param, "female", true)) { PlayerInfo[targetid][pGender] = 2; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's gender to Female.", GetPlayerRPName(targetid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gender = 2 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(param, "shemale", true)) { PlayerInfo[targetid][pGender] = 3; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's gender to Shemale.", GetPlayerRPName(targetid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gender = 3 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } } else if(!strcmp(option, "age", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [age] [value]"); } if(!(0 <= value <= 128)) { return SendClientMessage(playerid, COLOR_GREY3, "The value specified can't be under 0 or above 128."); } PlayerInfo[targetid][pAge] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's age to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET age = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "cash", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [cash] [value]"); } PlayerInfo[targetid][pCash] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's cash to $%i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cash = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "bank", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [bank] [value]"); } PlayerInfo[targetid][pBank] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's bank money to $%i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bank = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "level", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [level] [value]"); } PlayerInfo[targetid][pLevel] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's level to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET level = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "respect", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [respect] [value]"); } PlayerInfo[targetid][pEXP] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's respect points to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET exp = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "upgradepoints", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [upgradepoints] [value]"); } PlayerInfo[targetid][pUpgradePoints] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's upgrade points to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET upgradepoints = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "hours", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [hours] [value]"); } PlayerInfo[targetid][pHours] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's playing hours to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET hours = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "warnings", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [warnings] [value]"); } if(!(0 <= value <= 3)) { return SendClientMessage(playerid, COLOR_GREY3, "The value specified can't be under 0 or above 3."); } PlayerInfo[targetid][pWarnings] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's warnings to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET warnings = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "spawnhealth", true)) { new Float:amount; if(sscanf(param, "f", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [spawnhealth] [value]"); } PlayerInfo[targetid][pSpawnHealth] = amount; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's spawn health to %.1f.", GetPlayerRPName(targetid), amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET spawnhealth = '%f' WHERE uid = %i", amount, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "spawnarmor", true)) { new Float:amount; if(sscanf(param, "f", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [spawnarmor] [value]"); } PlayerInfo[targetid][pSpawnArmor] = amount; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's spawn armor to %.1f.", GetPlayerRPName(targetid), amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET spawnarmor = '%f' WHERE uid = %i", amount, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "fightstyle", true)) { if(isnull(param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [fightstyle] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Normal, Boxing, Kungfu, Kneehead, Grabkick, Elbow"); return 1; } if(!strcmp(param, "normal", true)) { PlayerInfo[targetid][pFightStyle] = FIGHT_STYLE_NORMAL; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's fight style to Normal.", GetPlayerRPName(targetid)); SetPlayerFightingStyle(targetid, PlayerInfo[targetid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[targetid][pFightStyle], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(param, "boxing", true)) { PlayerInfo[targetid][pFightStyle] = FIGHT_STYLE_BOXING; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's fight style to Boxing.", GetPlayerRPName(targetid)); SetPlayerFightingStyle(targetid, PlayerInfo[targetid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[targetid][pFightStyle], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(param, "kungfu", true)) { PlayerInfo[targetid][pFightStyle] = FIGHT_STYLE_KUNGFU; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's fight style to Kung Fu.", GetPlayerRPName(targetid)); SetPlayerFightingStyle(targetid, PlayerInfo[targetid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[targetid][pFightStyle], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(param, "kneehead", true)) { PlayerInfo[targetid][pFightStyle] = FIGHT_STYLE_KNEEHEAD; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's fight style to Kneehead.", GetPlayerRPName(targetid)); SetPlayerFightingStyle(targetid, PlayerInfo[targetid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[targetid][pFightStyle], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(param, "grabkick", true)) { PlayerInfo[targetid][pFightStyle] = FIGHT_STYLE_GRABKICK; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's fight style to Grabkick.", GetPlayerRPName(targetid)); SetPlayerFightingStyle(targetid, PlayerInfo[targetid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[targetid][pFightStyle], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(param, "elbow", true)) { PlayerInfo[targetid][pFightStyle] = FIGHT_STYLE_ELBOW; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's fight style to Elbow.", GetPlayerRPName(targetid)); SetPlayerFightingStyle(targetid, PlayerInfo[targetid][pFightStyle]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fightstyle = %i WHERE uid = %i", PlayerInfo[targetid][pFightStyle], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } } else if(!strcmp(option, "accent", true)) { new accent[16]; if(sscanf(param, "s[16]", accent)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [accent] [text]"); } strcpy(PlayerInfo[targetid][pAccent], accent, 16); SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's accent to '%s'.", GetPlayerRPName(targetid), accent); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET accent = '%e' WHERE uid = %i", accent, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "cookies", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [cookies] [value]"); } PlayerInfo[targetid][pCookies] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's cookies to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cookies = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "phone", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [phone] [number]"); } if(value == 911) { return SendClientMessage(playerid, COLOR_GREY, "Invalid number."); } if(value == 0) { PlayerInfo[targetid][pPhone] = 0; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's phone number to 0.", GetPlayerRPName(targetid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET phone = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE phone = %i", value); mysql_tquery(connectionID, queryBuffer, "OnAdminSetPhoneNumber", "iii", playerid, targetid, value); return 1; } } else if(!strcmp(option, "crimes", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [crimes] [value]"); } PlayerInfo[targetid][pCrimes] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's commited crimes to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET crimes = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "arrested", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [arrested] [value]"); } PlayerInfo[targetid][pArrested] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's arrested count to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET arrested = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "wantedlevel", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [wantedlevel] [value]"); } if(!(0 <= value <= 6)) { return SendClientMessage(playerid, COLOR_GREY3, "The value specified can't be under 0 or above 6."); } PlayerInfo[targetid][pWantedLevel] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's wanted level to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET wantedlevel = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "materials", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [materials] [value]"); } PlayerInfo[targetid][pMaterials] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's materials to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "weed", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [weed] [value]"); } PlayerInfo[targetid][pWeed] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's weed to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "cocaine", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [cocaine] [value]"); } PlayerInfo[targetid][pCocaine] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's cocaine to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "meth", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [meth] [value]"); } PlayerInfo[targetid][pMeth] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's meth to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "painkillers", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [painkillers] [value]"); } PlayerInfo[targetid][pPainkillers] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's painkillers to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "cigars", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [cigars] [value]"); } PlayerInfo[targetid][pCigars] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's cigars to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cigars = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "walkietalkie", true)) { if(sscanf(param, "i", value) || !(0 <= value <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [walkietalkie] [0/1]"); } PlayerInfo[targetid][pWalkieTalkie] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's walkie talkie to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET walkietalkie = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "channel", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [channel] [value]"); } PlayerInfo[targetid][pChannel] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's radio channel to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET channel = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "mask", true)) { if(sscanf(param, "i", value) || !(0 <= value <= 1)) { return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /setstat [playerid] [mask] [0/1]"); } PlayerInfo[targetid][pMask] = value; SendClientMessageEx(playerid, COLOR_WHITE, "** You have set %s's mask to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET mask = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "boombox", true)) { if(sscanf(param, "i", value) || !(0 <= value <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [boombox] [0/1]"); } if((value == 0) && PlayerInfo[targetid][pBoomboxPlaced]) { DestroyBoombox(targetid); } PlayerInfo[targetid][pBoombox] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's boombox to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET boombox = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "phonebook", true)) { if(sscanf(param, "i", value) || !(0 <= value <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [phonebook] [0/1]"); } PlayerInfo[targetid][pPhonebook] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's phonebook to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET phonebook = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "paycheck", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [paycheck] [value]"); } PlayerInfo[targetid][pPaycheck] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's paycheck to $%i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET paycheck = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "carlicense", true)) { if(sscanf(param, "i", value) || !(0 <= value <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [carlicense] [0/1]"); } PlayerInfo[targetid][pCarLicense] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's car license to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET carlicense = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "seeds", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [seeds] [value]"); } PlayerInfo[targetid][pSeeds] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's seeds to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET seeds = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "ephedrine", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [ephedrine] [value]"); } PlayerInfo[targetid][pEphedrine] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's ephedrine to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET ephedrine = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "job", true)) { if(sscanf(param, "i", value)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [job] [value (-1 = none)]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of jobs: (0) Pizzaman (1) Courier (2) Fisherman (3) Bodyguard (4) Weapon Dealer (5) Mechanic (6) Miner"); SendClientMessage(playerid, COLOR_SYNTAX, "List of jobs: (7) Sweeper (8) Taxi Driver (9) Drug Dealer (10) Lawyer (11) Detective (12) Thief (13) Garbage Man (14) Farmer"); return 1; } if(!(-1 <= value <= 14)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid job."); } PlayerInfo[targetid][pJob] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's job to %s.", GetPlayerRPName(targetid), GetJobName(value)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET job = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "inventoryupgrade", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [inventoryupgrade] [value]"); } if(!(0 <= value <= 5)) { return SendClientMessage(playerid, COLOR_GREY, "The value must range from 0 to 5."); } PlayerInfo[targetid][pInventoryUpgrade] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's inventory upgrade to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET inventoryupgrade = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "addictupgrade", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [addictupgrade] [value]"); } if(!(0 <= value <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "The value must range from 0 to 3."); } PlayerInfo[targetid][pAddictUpgrade] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's addict upgrade to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET addictupgrade = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "traderupgrade", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [traderupgrade] [value]"); } if(!(0 <= value <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "The value must range from 0 to 3."); } PlayerInfo[targetid][pTraderUpgrade] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's trader upgrade to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET traderupgrade = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "assetupgrade", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [assetupgrade] [value]"); } if(!(0 <= value <= 4)) { return SendClientMessage(playerid, COLOR_GREY, "The value must range from 0 to 4."); } PlayerInfo[targetid][pAssetUpgrade] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's asset upgrade to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET assetupgrade = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "laborupgrade", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [laborupgrade] [value]"); } if(!(0 <= value <= 5)) { return SendClientMessage(playerid, COLOR_GREY, "The value must range from 0 to 5."); } PlayerInfo[targetid][pLaborUpgrade] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's labor upgrade to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET laborupgrade = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "mp3player", true)) { if(sscanf(param, "i", value) || !(0 <= value <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [mp3player] [0/1]"); } PlayerInfo[targetid][pMP3Player] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's MP3 player to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET mp3player = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "muriaticacid", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [muriaticacid] [value]"); } PlayerInfo[targetid][pMuriaticAcid] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's muriatic acid to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET muriaticacid = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "bakingsoda", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [bakingsoda] [value]"); } PlayerInfo[targetid][pBakingSoda] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's baking soda to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bakingsoda = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "dmwarnings", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [dmwarnings] [value]"); } if(!(0 <= value <= 4)) { return SendClientMessage(playerid, COLOR_GREY, "The value must range from 0 to 4."); } PlayerInfo[targetid][pDMWarnings] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's DM warnings to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET dmwarnings = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "weaponrestricted", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [weaponrestricted] [hours]"); } PlayerInfo[targetid][pWeaponRestricted] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's weapon restriction to %i hours.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weaponrestricted = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "components", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [components] [value]"); } PlayerInfo[targetid][pComponents] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's components to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET components = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "watch", true)) { if(sscanf(param, "i", value) || !(0 <= value <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [watch] [0/1]"); } PlayerInfo[targetid][pWatch] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's watch to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET watch = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "gps", true)) { if(sscanf(param, "i", value) || !(0 <= value <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [gps] [0/1]"); } PlayerInfo[targetid][pGPS] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's GPS to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gps = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "gascan", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [gascan] [value]"); } PlayerInfo[targetid][pGasCan] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's gas can to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gascan = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "courierskill", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [courierskill] [value]"); } PlayerInfo[targetid][pCourierSkill] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's courier skill to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET courierskill = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "fishingskill", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [fishingskill] [value]"); } PlayerInfo[targetid][pFishingSkill] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's fishing skill to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fishingskill = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "guardskill", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [guardskill] [value]"); } PlayerInfo[targetid][pGuardSkill] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's bodyguard skill to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET guardskill = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "weaponskill", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [weaponskill] [value]"); } PlayerInfo[targetid][pWeaponSkill] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's weapon skill to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weaponskill = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "mechanicskill", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [mechanicskill] [value]"); } PlayerInfo[targetid][pMechanicSkill] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's mechanic skill to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET mechanicskill = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "lawyerskill", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [lawyerskill] [value]"); } PlayerInfo[targetid][pLawyerSkill] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's lawyer skill to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET lawyerskill = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "detectiveskill", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [detectiveskill] [value]"); } PlayerInfo[targetid][pDetectiveSkill] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's detective skill to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET detectiveskill = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "thiefskill", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [thiefskill] [value]"); } PlayerInfo[targetid][pThiefSkill] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's thief skill to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET thiefskill = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "bombs", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [bombs] [value]"); } PlayerInfo[targetid][pBombs] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's bombs to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bombs = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "firstaid", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [firstaid] [value]"); } PlayerInfo[targetid][pFirstAid] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's first aid kits to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET firstaid = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "policescanner", true)) { if(sscanf(param, "i", value) || !(0 <= value <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [policescanner] [0/1]"); } PlayerInfo[targetid][pPoliceScanner] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's police scanner to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET policescanner = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "bodykits", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [bodykits] [value]"); } PlayerInfo[targetid][pBodykits] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's bodykits to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bodykits = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "rimkits", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [rimkits] [value]"); } PlayerInfo[targetid][pRimkits] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's rimkits to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rimkits = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "diamonds", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [diamonds] [value]"); } PlayerInfo[targetid][pDiamonds] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's diamonds to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET diamonds = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "marriage", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [marriedto] [playerid(-1 to reset)]"); } if(IsPlayerConnected(value)) { PlayerInfo[targetid][pMarriedTo] = PlayerInfo[value][pID]; strcpy(PlayerInfo[targetid][pMarriedName], GetPlayerNameEx(value), MAX_PLAYER_NAME); SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's marriage to %s.", GetPlayerRPName(targetid), GetPlayerRPName(value)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET marriedto = %i WHERE uid = %i", PlayerInfo[value][pID], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(value == -1) { PlayerInfo[targetid][pMarriedTo] = -1; strcpy(PlayerInfo[targetid][pMarriedName], "Nobody", MAX_PLAYER_NAME); SendClientMessageEx(playerid, COLOR_WHITE, "You have reset %s's marriage.", GetPlayerRPName(targetid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET marriedto = -1 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } } else if(!strcmp(option, "skates", true)) { if(sscanf(param, "i", value) || !(0<=value<=1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstat [playerid] [skates] [1/0]"); } else { PlayerInfo[targetid][pSkates] = value; SendClientMessageEx(playerid, COLOR_WHITE, "You have set %s's skates to %i.", GetPlayerRPName(targetid), value); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rollerskates = %i WHERE uid = %i", value, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } } else { return 1; } Log_Write("log_setstat", "%s (uid: %i) set %s's (uid: %i) %s to %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], option, param); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s set %s's %s to %s", GetPlayerNameEx(playerid), GetPlayerNameEx(targetid), option, param); return 1; } CMD:givemoney(playerid, params[]) { new targetid, amount; if(PlayerInfo[playerid][pAdmin] < 7) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /givemoney [playerid] [amount]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } GivePlayerCash(targetid, amount); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has given %s to %s.", GetPlayerRPName(playerid), FormatNumber(amount), GetPlayerRPName(targetid)); Log_Write("log_givemoney", "%s (uid: %i) has used /givemoney to give $%i to %s (uid: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); return 1; } CMD:givecookie(playerid, params[]) { new targetid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us", targetid, reason)) { return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /givecookie [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } /*if(PlayerInfo[targetid][pCookies] > 500) { return SendClientMessage(playerid, COLOR_GREY, "That player already has 400 cookies!"); }*/ SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has given a {089DCE}cookie{FF6347} to %s, reason: %s", GetPlayerRPName(playerid), GetPlayerRPName(targetid), reason); SendClientMessageEx(targetid, COLOR_LIGHTRED, "You have been awarded a {089DCE}cookie{FF6347} by %s for %s", GetPlayerRPName(playerid), reason); PlayerInfo[targetid][pCookies]++; if(PlayerInfo[targetid][pCookies] >= 5) { AwardAchievement(targetid, "cookie jar"); } Log_Write("log_givecookie", "%s (uid: %i) has given a cookie to %s (uid: %i) for reason %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], reason); return 1; } CMD:givecookieall(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } foreach(new i : Player) { if(PlayerInfo[i][pLogged]) { if(PlayerInfo[i][pCookies] > 500) { continue; } PlayerInfo[i][pCookies]++; if(PlayerInfo[i][pCookies] >= 5) { AwardAchievement(i, "cookie jar"); } } } SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s has given a {089DCE}cookie{FF6347} to every player online.", GetPlayerRPName(playerid)); Log_Write("log_givecookie", "%s (uid: %i) has given a cookie to every player online", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID]); return 1; } CMD:osetvip(playerid, params[]) { new username[MAX_PLAYER_NAME], level, time; if(PlayerInfo[playerid][pAdmin] < 9) // Owner { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]iI(0)", username, level, time)) { SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /osetvip [username] [level(0-3)] [days]"); SendClientMessage(playerid, COLOR_GREY3, "List of ranks: (0) None (1) Limited (2) Gold (3) Legendary"); return 1; } if(!(0 <= level <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid level. Valid levels range from 0 to 3."); } if(!(1 <= time <= 365)) { return SendClientMessage(playerid, COLOR_GREY, "The amount of days must range from 1 to 365."); } if(IsPlayerOnline(username)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already online and logged in. Use /setvip instead."); } if(level == 0) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's donator package.", GetPlayerRPName(playerid), username); time = 0; } else if(time >= 30) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has given a {A028AD}%s{FF6347} donator package to %s for %i months.", GetPlayerRPName(playerid), GetVIPRank(level), username, time / 30); time = gettime() + (time * 86400); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has given a {A028AD}%s{FF6347} donator package to %s for %i days.", GetPlayerRPName(playerid), GetVIPRank(level), username, time); time = gettime() + (time * 86400); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET vippackage = %i, viptime = %i, vipcooldown = 0 WHERE username = '%e'", level, time, username); mysql_tquery(connectionID, queryBuffer); return 1; } CMD:setvip(playerid, params[]) { new targetid, rank, days, drugs, weed, cocaine, meth, painkillers, seeds; if(PlayerInfo[playerid][pAdmin] < 9 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "uiii", targetid, rank, days)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setvip [playerid] [rank] [days]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of ranks: (1) VIP 1 (2) VIP 2 (3) VIP 3"); return 1; } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(!(1 <= rank <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid rank."); } if(!(1 <= days <= 365)) { return SendClientMessage(playerid, COLOR_GREY, "The amount of days must range from 1 to 365."); } weed = GetPlayerCapacity(playerid, CAPACITY_WEED); cocaine = GetPlayerCapacity(playerid, CAPACITY_COCAINE); meth = GetPlayerCapacity(playerid, CAPACITY_METH); painkillers = GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS); seeds = GetPlayerCapacity(playerid, CAPACITY_SEEDS); if(drugs) { PlayerInfo[targetid][pWeed] = weed; PlayerInfo[targetid][pCocaine] = cocaine; PlayerInfo[targetid][pMeth] = meth; PlayerInfo[targetid][pPainkillers] = painkillers; PlayerInfo[targetid][pSeeds] = seeds; PlayerInfo[targetid][pBoombox] = 1; PlayerInfo[targetid][pMP3Player] = 1; SendClientMessageEx(targetid, COLOR_VIP, "%s %s has given you a full load of drugs with your %s VIP Package", GetAdminRank(playerid), GetPlayerRPName(playerid), GetVIPRank(rank)); } PlayerInfo[targetid][pVIPPackage] = rank; PlayerInfo[targetid][pVIPTime] = gettime() + (days * 86400); PlayerInfo[targetid][pVIPCooldown] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET vippackage = %i, viptime = %i, vipcooldown = 0, weed = %i, cocaine = %i, meth = %i, painkillers = %i, seeds = %i WHERE uid = %i", PlayerInfo[targetid][pVIPPackage], PlayerInfo[targetid][pVIPTime], PlayerInfo[targetid][pWeed], PlayerInfo[targetid][pCocaine], PlayerInfo[targetid][pMeth], PlayerInfo[targetid][pPainkillers], PlayerInfo[targetid][pSeeds], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(days >= 30) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has given a {D909D9}%s{FF6347} donator package to %s for %i months.", GetPlayerRPName(playerid), GetVIPRank(rank), GetPlayerRPName(targetid), days / 30); SendClientMessageEx(playerid, COLOR_AQUA, "** You have given %s a {D909D9}%s{33CCFF} donator package for %i months.", GetPlayerRPName(targetid), GetVIPRank(rank), days / 30); SendClientMessageEx(targetid, COLOR_AQUA, "** %s has given you a {D909D9}%s{33CCFF} donator package for %i months.", GetPlayerRPName(playerid), GetVIPRank(rank), days / 30); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has given a {D909D9}%s{FF6347} donator package to %s for %i days.", GetPlayerRPName(playerid), GetVIPRank(rank), GetPlayerRPName(targetid), days); SendClientMessageEx(playerid, COLOR_AQUA, "** You have given %s a {D909D9}%s{33CCFF} donator package for %i days.", GetPlayerRPName(targetid), GetVIPRank(rank), days); SendClientMessageEx(targetid, COLOR_AQUA, "** %s has given you a {D909D9}%s{33CCFF} donator package for %i days.", GetPlayerRPName(playerid), GetVIPRank(rank), days); } Log_Write("log_vip", "%s (uid: %i) has given %s (uid: %i) a %s donator package for %i days.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], GetVIPRank(rank), days); return 1; } CMD:removevip(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 9) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removevip [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(!PlayerInfo[targetid][pVIPPackage]) { return SendClientMessage(playerid, COLOR_GREY, "That player doesn't have a VIP subscription which you can remove."); } if(PlayerInfo[targetid][pTagType] == TAG_VIP) { SetPlayerSpecialTag(targetid, TAG_NONE); } Log_Write("log_vip", "%s (uid: %i) has removed %s's (uid: %i) %s donator package.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], GetVIPRank(PlayerInfo[targetid][pVIPPackage])); PlayerInfo[targetid][pVIPPackage] = 0; PlayerInfo[targetid][pVIPTime] = 0; PlayerInfo[targetid][pVIPColor] = 0; PlayerInfo[targetid][pSecondJob] = JOB_NONE; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET vippackage = 0, viptime = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has revoked %s's VIP subscription.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "** %s has revoked your VIP subscription.", GetPlayerRPName(playerid)); return 1; } CMD:rangeban(playerid, params[]) { new targetid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /rangeban [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be banned."); } Log_Write("log_punishments", "%s (uid: %i) rangebanned %s (uid: %i), reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], reason); SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was rangebanned by %s, reason: %s", GetPlayerRPName(targetid), GetPlayerRPName(playerid), reason); Rangeban(targetid, GetPlayerNameEx(playerid), reason); return 1; } CMD:forcepayday(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s", "confirm")) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /forcepayday [confirm] (gives everyone a paycheck)"); } foreach(new i : Player) { SendPaycheck(i); } return 1; } CMD:setpassword(playerid, params[]) { new username[MAX_PLAYER_NAME], password[128]; if(PlayerInfo[playerid][pAdmin] < 8) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]s[128]", username, password)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setpassword [username] [new password]"); } if(IsPlayerOnline(username)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already online and logged in. You can't change their password."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "OnAdminChangePassword", "iss", playerid, username, password); return 1; } CMD:deleteaccount(playerid, params[]) { new username[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pAdmin] < 9) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]", username)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /deleteaccount [username]"); } if(IsPlayerOnline(username)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already online and logged in. You can't delete their account."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT adminlevel FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "OnAdminDeleteAccount", "is", playerid, username); return 1; } CMD:doublexp(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!gDoubleXP) { SetDoubleXP(true); SendClientMessageToAllEx(COLOR_AQUA, "** %s enabled double XP. You will now gain double the respect points and job skill points.", GetPlayerRPName(playerid)); } else { SetDoubleXP(false); SendClientMessageToAllEx(COLOR_AQUA, "** %s disabled double XP.", GetPlayerRPName(playerid)); } return 1; } CMD:createhouse(playerid, params[]) { new type, Float:x, Float:y, Float:z, Float:a; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", type)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /createhouse [type (1-%i)]", sizeof(houseInteriors)); } if(!(1 <= type <= sizeof(houseInteriors))) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } if(GetNearbyHouse(playerid) >= 0) { return SendClientMessage(playerid, COLOR_GREY, "There is a house in range. Find somewhere else to create this one."); } GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); type--; for(new i = 0; i < MAX_HOUSES; i++) { if(!HouseInfo[i][hExists]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO houses (type, price, pos_x, pos_y, pos_z, pos_a, int_x, int_y, int_z, int_a, interior, outsideint, outsidevw) VALUES(%i, %i, '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f', %i, %i, %i)", type, houseInteriors[type][intPrice], x, y, z, a - 180.0, houseInteriors[type][intX], houseInteriors[type][intY], houseInteriors[type][intZ], houseInteriors[type][intA], houseInteriors[type][intID], GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid)); mysql_tquery(connectionID, queryBuffer, "OnAdminCreateHouse", "iiiffff", playerid, i, type, x, y, z, a); return 1; } } SendClientMessage(playerid, COLOR_GREY, "House slots are currently full. Ask developers to increase the internal limit."); return 1; } CMD:edithouse(playerid, params[]) { new houseid, option[10], param[32]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[10]S()[32]", houseid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /edithouse [houseid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Entrance, Exit, World, Type, Owner, Price, RentPrice, Level, Locked, Delivery"); return 1; } if(!(0 <= houseid < MAX_HOUSES) || !HouseInfo[houseid][hExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid house."); } if(!strcmp(option, "entrance", true)) { GetPlayerPos(playerid, HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ]); GetPlayerFacingAngle(playerid, HouseInfo[houseid][hPosA]); HouseInfo[houseid][hOutsideInt] = GetPlayerInterior(playerid); HouseInfo[houseid][hOutsideVW] = GetPlayerVirtualWorld(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET pos_x = '%f', pos_y = '%f', pos_z = '%f', pos_a = '%f', outsideint = %i, outsidevw = %i WHERE id = %i", HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ], HouseInfo[houseid][hPosA], HouseInfo[houseid][hOutsideInt], HouseInfo[houseid][hOutsideVW], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the entrance of house %i.", houseid); } else if(!strcmp(option, "exit", true)) { new type = -1; for(new i = 0; i < sizeof(houseInteriors); i ++) { if(IsPlayerInRangeOfPoint(playerid, 100.0, houseInteriors[i][intX], houseInteriors[i][intY], houseInteriors[i][intZ])) { type = i; } } GetPlayerPos(playerid, HouseInfo[houseid][hIntX], HouseInfo[houseid][hIntY], HouseInfo[houseid][hIntZ]); GetPlayerFacingAngle(playerid, HouseInfo[houseid][hIntA]); HouseInfo[houseid][hInterior] = GetPlayerInterior(playerid); HouseInfo[houseid][hType] = type; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET type = %i, int_x = '%f', int_y = '%f', int_z = '%f', int_a = '%f', interior = %i WHERE id = %i", type, HouseInfo[houseid][hIntX], HouseInfo[houseid][hIntY], HouseInfo[houseid][hIntZ], HouseInfo[houseid][hIntA], HouseInfo[houseid][hInterior], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the exit of house %i.", houseid); } else if(!strcmp(option, "world", true)) { new worldid; if(sscanf(param, "i", worldid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /edithouse [houseid] [world] [vw]"); } HouseInfo[houseid][hWorld] = worldid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET world = %i WHERE id = %i", HouseInfo[houseid][hWorld], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the virtual world of house %i to %i.", houseid, worldid); } else if(!strcmp(option, "type", true)) { new type; if(sscanf(param, "i", type)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /edithouse [houseid] [type] [value (1-%i)]", sizeof(houseInteriors)); } if(!(1 <= type <= sizeof(houseInteriors))) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } type--; HouseInfo[houseid][hType] = type; HouseInfo[houseid][hInterior] = houseInteriors[type][intID]; HouseInfo[houseid][hIntX] = houseInteriors[type][intX]; HouseInfo[houseid][hIntY] = houseInteriors[type][intY]; HouseInfo[houseid][hIntZ] = houseInteriors[type][intZ]; HouseInfo[houseid][hIntA] = houseInteriors[type][intA]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET type = %i, int_x = '%f', int_y = '%f', int_z = '%f', int_a = '%f', interior = %i, world = %i WHERE id = %i", type, HouseInfo[houseid][hIntX], HouseInfo[houseid][hIntY], HouseInfo[houseid][hIntZ], HouseInfo[houseid][hIntA], HouseInfo[houseid][hInterior], HouseInfo[houseid][hWorld], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the type of house %i to %i.", houseid, type + 1); } else if(!strcmp(option, "owner", true)) { new targetid; if(sscanf(param, "u", targetid)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /edithouse [houseid] [owner] [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } SetHouseOwner(houseid, targetid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the owner of house %i to %s.", houseid, GetPlayerRPName(targetid)); } else if(!strcmp(option, "price", true)) { new price; if(sscanf(param, "i", price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /edithouse [houseid] [price] [value]"); } if(price < 0) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $0."); } HouseInfo[houseid][hPrice] = price; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET price = %i WHERE id = %i", HouseInfo[houseid][hPrice], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the price of house %i to $%i.", houseid, price); } else if(!strcmp(option, "rentprice", true)) { new price; if(sscanf(param, "i", price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /edithouse [houseid] [rentprice] [value]"); } if(price < 0) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $0."); } HouseInfo[houseid][hRentPrice] = price; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET rentprice = %i WHERE id = %i", HouseInfo[houseid][hRentPrice], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the rent price of house %i to $%i.", houseid, price); } else if(!strcmp(option, "level", true)) { new level; if(sscanf(param, "i", level)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /edithouse [houseid] [level] [value (0-5)]"); } if(!(0 <= level <= 6)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid level. Valid levels range from 0 to 5."); } HouseInfo[houseid][hLevel] = level; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET level = %i WHERE id = %i", HouseInfo[houseid][hLevel], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the level of house %i to %i.", houseid, level); } else if(!strcmp(option, "locked", true)) { new locked; if(sscanf(param, "i", locked) || !(0 <= locked <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /edithouse [houseid] [locked] [0/1]"); } HouseInfo[houseid][hLocked] = locked; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET locked = %i WHERE id = %i", HouseInfo[houseid][hLocked], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the lock state of house %i to %i.", houseid, locked); } else if(!strcmp(option, "delivery", true)) { new delivery; if(sscanf(param, "i", delivery) || !(0 <= delivery <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /edithouse [houseid] [locked] [0/1]"); } HouseInfo[houseid][hDelivery] = delivery; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET delivery = %i WHERE id = %i", HouseInfo[houseid][hDelivery], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the ability to be to delivered of house %i to %i.", houseid, delivery); } return 1; } CMD:removefurniture(playerid, params[]) { new houseid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", houseid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removefurniture [houseid]"); } if(!(0 <= houseid < MAX_HOUSES) || !HouseInfo[houseid][hExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid house."); } RemoveAllFurniture(houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have removed all furniture for house %i.", houseid); return 1; } CMD:removehouse(playerid, params[]) { new houseid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", houseid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removehouse [houseid]"); } if(!(0 <= houseid < MAX_HOUSES) || !HouseInfo[houseid][hExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid house."); } RemoveAllFurniture(houseid); DestroyDynamic3DTextLabel(HouseInfo[houseid][hText]); DestroyDynamicPickup(HouseInfo[houseid][hPickup]); // DestroyDynamicMapIcon(HouseInfo[houseid][hMapIcon]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM houses WHERE id = %i", HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); HouseInfo[houseid][hExists] = 0; HouseInfo[houseid][hID] = 0; HouseInfo[houseid][hOwnerID] = 0; Iter_Remove(House, houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have removed house %i.", houseid); return 1; } CMD:gotohouse(playerid, params[]) { new houseid; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "i", houseid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gotohouse [houseid]"); } if(!(0 <= houseid < MAX_HOUSES) || !HouseInfo[houseid][hExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid house."); } GameTextForPlayer(playerid, "~w~Teleported", 5000, 1); SetPlayerPos(playerid, HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ]); SetPlayerFacingAngle(playerid, HouseInfo[houseid][hPosA]); SetPlayerInterior(playerid, HouseInfo[houseid][hOutsideInt]); SetPlayerVirtualWorld(playerid, HouseInfo[houseid][hOutsideVW]); SetCameraBehindPlayer(playerid); return 1; } CMD:previewint(playerid, params[]) { new type, string[32]; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "i", type)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /previewint [1-%i]", sizeof(houseInteriors)); } if(!(1 <= type <= sizeof(houseInteriors))) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } type--; format(string, sizeof(string), "~w~%s", houseInteriors[type][intClass]); GameTextForPlayer(playerid, string, 5000, 1); SetPlayerPos(playerid, houseInteriors[type][intX], houseInteriors[type][intY], houseInteriors[type][intZ]); SetPlayerFacingAngle(playerid, houseInteriors[type][intA]); SetPlayerInterior(playerid, houseInteriors[type][intID]); SetCameraBehindPlayer(playerid); return 1; } CMD:nearest(playerid, params[]) { new id; if(PlayerInfo[playerid][pAdmin] < 5 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_______ Nearest Items _______"); if((id = GetNearbyHouse(playerid)) >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "You are in range of house ID %i.", id); } if((id = GetNearbyGarage(playerid)) >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "You are in range of garage ID %i.", id); } if((id = GetNearbyBusiness(playerid)) >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "You are in range of business ID %i.", id); } if((id = GetNearbyEntrance(playerid)) >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "You are in range of entrance ID %i.", id); } if((id = GetNearbyLand(playerid)) >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "You are in range of land ID %i.", id); } if((id = GetNearbyPoint(playerid)) >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "You are in range of point ID %i.", id); } if((id = GetNearbyTurf(playerid)) >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "You are in range of turf ID %i.", id); } if((id = GetNearbyLocker(playerid)) >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "You are in range of locker ID %i.", id); } if((id = GetNearbyLocation(playerid, 20.0)) >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "You are in range of (location) %s [%i].", LocationInfo[id][locName], id); } if((id = GetNearbyAtm(playerid)) >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "You are in range of atm ID %i", id); } if((id = GetNearestDealerShip(playerid, -1)) >= 0) { SendClientMessageEx(playerid, COLOR_GREY2, "You are in range of dealership id %i", id); } return 1; } CMD:dynamichelp(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } SendClientMessage(playerid, COLOR_GREEN, "HOUSES:{DDDDDD} /createhouse, /edithouse, /removehouse, /gotohouse, /asellhouse, /removefurniture."); SendClientMessage(playerid, COLOR_GREEN, "GARAGES:{DDDDDD} /creategarage, /editgarage, /removegarage, /gotogarage, /asellgarage."); SendClientMessage(playerid, COLOR_GREEN, "BUSINESSES:{DDDDDD} /createbiz, /editbiz, /removebiz, /gotobiz, /asellbiz."); SendClientMessage(playerid, COLOR_GREEN, "ENTRANCES:{DDDDDD} /createentrance, /editentrance, /removeentrance, /gotoentrance."); SendClientMessage(playerid, COLOR_GREEN, "LANDS:{DDDDDD} /createland, /landcancel, /removeland, /gotoland, /asellland, /removelandobjects."); SendClientMessage(playerid, COLOR_GREEN, "FACTIONS:{DDDDDD} /createfaction, /editfaction, /removefaction, /switchfaction, /purgefaction."); SendClientMessage(playerid, COLOR_GREEN, "GANGS:{DDDDDD} /creategang, /editgang, /removegang, /gangstrike, /switchgang, /caplimit, /setcooldown."); SendClientMessage(playerid, COLOR_GREEN, "POINTS:{DDDDDD} /createpoint, /editpoint, /removepoint, /gotopoint."); SendClientMessage(playerid, COLOR_GREEN, "TURFS:{DDDDDD} /createturf, /turfcancel, /editturf, /removeturf, /gototurf."); SendClientMessage(playerid, COLOR_GREEN, "FIRES:{DDDDDD} /randomfire, /killfire, /spawnfire."); SendClientMessage(playerid, COLOR_GREEN, "LOCKERS:{DDDDDD} /createlocker, /editlocker, /removelocker."); SendClientMessage(playerid, COLOR_GREEN, "LOCATIONS:{DDDDDD} /createlocation, /editlocation, /removelocation."); SendClientMessage(playerid, COLOR_GREEN, "ATMS:{DDDDDD} /createatm, /editatm, /removeatm"); SendClientMessage(playerid, COLOR_GREEN, "Gun Racks:{DDDDDD} /createrack, /editrack, /destroyrack"); SendClientMessage(playerid, COLOR_GREEN, "Gang Tags:{DDDDDD} /creategangtag, /destroygangtag"); SendClientMessage(playerid, COLOR_GREEN, "Speed Camers:{DDDDDD} /createspeed, /destroyspeed"); return 1; } CMD:listassets(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /listassets [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_____ %s's Assets _____", GetPlayerRPName(targetid)); foreach(new i : House) { if(HouseInfo[i][hExists] && IsHouseOwner(targetid, i)) { SendClientMessageEx(playerid, COLOR_GREY2, "** {33CC33}House{C8C8C8} | ID: %i | Location: %s | Status: %s", i, GetZoneName(HouseInfo[i][hPosX], HouseInfo[i][hPosY], HouseInfo[i][hPosZ]), (gettime() - HouseInfo[i][hTimestamp]) > 2592000 ? ("{FF6347}Inactive") : ("{00AA00}Active")); } } foreach(new i : Business) { if(BusinessInfo[i][bExists] && IsBusinessOwner(targetid, i)) { SendClientMessageEx(playerid, COLOR_GREY2, "** {FFD700}Business{C8C8C8} | ID: %i | Location: %s | Status: %s", i, GetZoneName(BusinessInfo[i][bPosX], BusinessInfo[i][bPosY], BusinessInfo[i][bPosZ]), (gettime() - BusinessInfo[i][bTimestamp]) > 2592000 ? ("{FF6347}Inactive") : ("{00AA00}Active")); } } foreach(new i : Garage) { if(GarageInfo[i][gExists] && IsGarageOwner(targetid, i)) { SendClientMessageEx(playerid, COLOR_GREY2, "** {004CFF}Garage{C8C8C8} | ID: %i | Location: %s | Status: %s", i, GetZoneName(GarageInfo[i][gPosX], GarageInfo[i][gPosY], GarageInfo[i][gPosZ]), (gettime() - GarageInfo[i][gTimestamp]) > 2592000 ? ("{FF6347}Inactive") : ("{00AA00}Active")); } } foreach(new i : Land) { if(LandInfo[i][lExists] && IsLandOwner(targetid, i)) { SendClientMessageEx(playerid, COLOR_GREY2, "** {33CCFF}Land{C8C8C8} | ID: %i | Location: %s", i, GetZoneName(LandInfo[i][lMaxX], LandInfo[i][lMaxY], LandInfo[i][lHeight])); } } return 1; } CMD:asellhouse(playerid, params[]) { new houseid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", houseid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /asellhouse [houseid]"); } if(!(0 <= houseid < MAX_HOUSES) || !HouseInfo[houseid][hExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid house."); } SetHouseOwner(houseid, INVALID_PLAYER_ID); SendClientMessageEx(playerid, COLOR_AQUA, "** You have admin sold house %i.", houseid); return 1; } CMD:asellgarage(playerid, params[]) { new garageid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", garageid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /asellgarage [garageid]"); } if(!(0 <= garageid < MAX_GARAGES) || !GarageInfo[garageid][gExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid garage."); } SetGarageOwner(garageid, INVALID_PLAYER_ID); SendClientMessageEx(playerid, COLOR_AQUA, "** You have admin sold garage %i.", garageid); return 1; } CMD:asellbiz(playerid, params[]) { new businessid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", businessid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /asellbiz [businessid]"); } if(!(0 <= businessid < MAX_BUSINESSES) || !BusinessInfo[businessid][bExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid business."); } SetBusinessOwner(businessid, INVALID_PLAYER_ID); SendClientMessageEx(playerid, COLOR_AQUA, "** You have admin sold business %i.", businessid); return 1; } CMD:asellland(playerid, params[]) { new landid; if(PlayerInfo[playerid][pAdmin] < 8 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", landid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /asellland [landid]"); } if(!(0 <= landid < MAX_LANDS) || !LandInfo[landid][lExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid land."); } SetLandOwner(landid, INVALID_PLAYER_ID); SendClientMessageEx(playerid, COLOR_AQUA, "** You have admin sold land %i.", landid); return 1; } CMD:enter(playerid, params[]) { if(PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pCuffed] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(IsPlayerInRangeOfPoint(playerid, 3.0, -9999.9999,9999.9922,9999.7422)) { if(PlayerInfo[playerid][pAcceptedHelp]) { return SendClientMessage(playerid, COLOR_GREY, "You can not enter the paintball arena while on helper duty!"); } if(PlayerInfo[playerid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are restricted from weapons and therefore can't join paintball."); } SendClientMessage(playerid, COLOR_GREY, "You are restricted from weapons and therefore can't join paintball."); } else { EnterCheck(playerid); } return 1; } CMD:exit(playerid, params[]) { if(PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pCuffed] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } ExitCheck(playerid); return 1; } CMD:buyhouse(playerid, params[]) { new houseid, type[16]; if((houseid = GetNearbyHouse(playerid)) == -1) { return SendClientMessage(playerid, COLOR_GREY, "There is no house in range. You must be near a house."); } if(strcmp(params, "confirm", true) != 0) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /buyhouse [confirm]"); } if(HouseInfo[houseid][hOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This house already has an owner."); } if(PlayerInfo[playerid][pCash] < HouseInfo[houseid][hPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this house."); } if(GetPlayerAssetCount(playerid, LIMIT_HOUSES) >= GetPlayerAssetLimit(playerid, LIMIT_HOUSES)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently own %i/%i houses. You can't own anymore unless you upgrade your asset perk.", GetPlayerAssetCount(playerid, LIMIT_HOUSES), GetPlayerAssetLimit(playerid, LIMIT_HOUSES)); } if(HouseInfo[houseid][hType]) { type = "House"; } else { strcpy(type, houseInteriors[HouseInfo[houseid][hType]][intClass]); } SetHouseOwner(houseid, playerid); GivePlayerCash(playerid, -HouseInfo[houseid][hPrice]); SendClientMessageEx(playerid, COLOR_GREEN, "You paid %s to make this house yours! /househelp for a list of commands.", FormatNumber(HouseInfo[houseid][hPrice])); Log_Write("log_property", "%s (uid: %i) purchased %s (id: %i) for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], type, HouseInfo[houseid][hID], HouseInfo[houseid][hPrice]); return 1; } CMD:lock(playerid, params[]) { new id, houseid = GetInsideHouse(playerid), landid = GetNearbyLand(playerid); for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && IsPlayerInRangeOfDynamicObject(playerid, i, 2.5) && IsDoorObject(i)) { if(houseid >= 0 && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_FURNITURE && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == HouseInfo[houseid][hID]) { if(!(IsHouseOwner(playerid, houseid) || PlayerInfo[playerid][pRentingHouse] == HouseInfo[houseid][hID] || PlayerInfo[playerid][pFurniturePerms] == houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission from the house owner to lock this door."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT door_locked FROM furniture WHERE id = %i", Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnPlayerLockFurnitureDoor", "ii", playerid, Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); return 1; } else if(landid >= 0 && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_LAND && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == LandInfo[landid][lID]) { if(!(IsLandOwner(playerid, landid) || PlayerInfo[playerid][pLandPerms] == landid)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission from the land owner to lock this door."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT door_locked FROM landobjects WHERE id = %i", Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnPlayerLockLandDoor", "ii", playerid, Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); return 1; } } } if((id = GetNearbyVehicle(playerid)) != INVALID_VEHICLE_ID && (IsVehicleOwner(playerid, id) || PlayerInfo[playerid][pVehicleKeys] == id || (VehicleInfo[id][vGang] >= 0 && VehicleInfo[id][vGang] == PlayerInfo[playerid][pGang]))) { if(!VehicleInfo[id][vLocked]) { new string[24]; VehicleInfo[id][vLocked] = 1; format(string, sizeof(string), "~r~%s locked", GetVehicleName(id)); GameTextForPlayer(playerid, string, 3000, 3); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s locks their %s.", GetPlayerRPName(playerid), GetVehicleName(id)); } else { VehicleInfo[id][vLocked] = 0; new string[24]; format(string, sizeof(string), "~b~%s unlocked", GetVehicleName(id)); GameTextForPlayer(playerid, string, 3000, 3); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s unlocks their %s.", GetPlayerRPName(playerid), GetVehicleName(id)); } SetVehicleParams(id, VEHICLE_DOORS, VehicleInfo[id][vLocked]); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET locked = %i WHERE id = %i", VehicleInfo[id][vLocked], VehicleInfo[id][vID]); mysql_tquery(connectionID, queryBuffer); return 1; } else if((id = GetNearbyHouseEx(playerid)) >= 0 && (IsHouseOwner(playerid, id) || PlayerInfo[playerid][pRentingHouse] == HouseInfo[id][hID])) { if(!HouseInfo[id][hLocked]) { HouseInfo[id][hLocked] = 1; GameTextForPlayer(playerid, "~r~House locked", 3000, 6); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s locks their house door.", GetPlayerRPName(playerid)); } else { HouseInfo[id][hLocked] = 0; GameTextForPlayer(playerid, "~g~House unlocked", 3000, 6); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s unlocks their house door.", GetPlayerRPName(playerid)); } PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET locked = %i WHERE id = %i", HouseInfo[id][hLocked], HouseInfo[id][hID]); mysql_tquery(connectionID, queryBuffer); return 1; } else if((id = GetNearbyGarageEx(playerid)) >= 0 && IsGarageOwner(playerid, id)) { if(!GarageInfo[id][gLocked]) { GarageInfo[id][gLocked] = 1; GameTextForPlayer(playerid, "~r~Garage locked", 3000, 6); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s locks their garage door.", GetPlayerRPName(playerid)); } else { GarageInfo[id][gLocked] = 0; GameTextForPlayer(playerid, "~g~Garage unlocked", 3000, 6); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s unlocks their garage door.", GetPlayerRPName(playerid)); } PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET locked = %i WHERE id = %i", GarageInfo[id][gLocked], GarageInfo[id][gID]); mysql_tquery(connectionID, queryBuffer); return 1; } else if((id = GetNearbyBusinessEx(playerid)) >= 0 && IsBusinessOwner(playerid, id)) { if(!BusinessInfo[id][bLocked]) { BusinessInfo[id][bLocked] = 1; GameTextForPlayer(playerid, "~r~Business locked", 3000, 6); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s locks their business door.", GetPlayerRPName(playerid)); } else { BusinessInfo[id][bLocked] = 0; GameTextForPlayer(playerid, "~g~Business unlocked", 3000, 6); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s unlocks their business door.", GetPlayerRPName(playerid)); } PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET locked = %i WHERE id = %i", BusinessInfo[id][bLocked], BusinessInfo[id][bID]); mysql_tquery(connectionID, queryBuffer); return 1; } else if((id = GetNearbyEntranceEx(playerid)) >= 0) { new correct_pass; if(!IsEntranceOwner(playerid, id) && strcmp(EntranceInfo[id][ePassword], "None", true) != 0) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /lock [password]"); } else if(strcmp(params, EntranceInfo[id][ePassword]) != 0) { return SendClientMessage(playerid, COLOR_GREY, "Incorrect password."); } else { correct_pass = true; } } if((correct_pass) || IsEntranceOwner(playerid, id)) { if(!EntranceInfo[id][eLocked]) { EntranceInfo[id][eLocked] = 1; GameTextForPlayer(playerid, "~r~Entrance locked", 3000, 6); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s locks their entrance door.", GetPlayerRPName(playerid)); } else { EntranceInfo[id][eLocked] = 0; GameTextForPlayer(playerid, "~g~Entrance unlocked", 3000, 6); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s unlocks their entrance door.", GetPlayerRPName(playerid)); } PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET locked = %i WHERE id = %i", EntranceInfo[id][eLocked], EntranceInfo[id][eID]); mysql_tquery(connectionID, queryBuffer); } return 1; } SendClientMessage(playerid, COLOR_GREY, "You are not close to anything which you can lock."); return 1; } CMD:alock(playerid, params[]) { new id; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && IsPlayerInRangeOfDynamicObject(playerid, i, 2.5) && IsDoorObject(i)) { if((id = GetInsideHouse(playerid)) >= 0 && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_FURNITURE && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == HouseInfo[id][hID]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT door_locked FROM furniture WHERE id = %i", Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnPlayerLockFurnitureDoor", "ii", playerid, Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); return 1; } else if((id = GetNearbyLand(playerid)) >= 0 && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_LAND && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == LandInfo[id][lID]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT door_locked FROM landobjects WHERE id = %i", Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnPlayerLockLandDoor", "ii", playerid, Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); return 1; } } } if((id = GetNearbyVehicle(playerid)) != INVALID_VEHICLE_ID) { if(!VehicleInfo[id][vLocked]) { VehicleInfo[id][vLocked] = 1; GameTextForPlayer(playerid, "~r~Vehicle locked", 3000, 6); } else { VehicleInfo[id][vLocked] = 0; GameTextForPlayer(playerid, "~g~Vehicle unlocked", 3000, 6); } SetVehicleParams(id, VEHICLE_DOORS, VehicleInfo[id][vLocked]); PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET locked = %i WHERE id = %i", VehicleInfo[id][vLocked], VehicleInfo[id][vID]); mysql_tquery(connectionID, queryBuffer); return 1; } else if((id = GetNearbyHouseEx(playerid)) >= 0) { if(!HouseInfo[id][hLocked]) { HouseInfo[id][hLocked] = 1; GameTextForPlayer(playerid, "~r~House locked", 3000, 6); } else { HouseInfo[id][hLocked] = 0; GameTextForPlayer(playerid, "~g~House unlocked", 3000, 6); } PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET locked = %i WHERE id = %i", HouseInfo[id][hLocked], HouseInfo[id][hID]); mysql_tquery(connectionID, queryBuffer); return 1; } else if((id = GetNearbyGarageEx(playerid)) >= 0) { if(!GarageInfo[id][gLocked]) { GarageInfo[id][gLocked] = 1; GameTextForPlayer(playerid, "~r~Garage locked", 3000, 6); } else { GarageInfo[id][gLocked] = 0; GameTextForPlayer(playerid, "~g~Garage unlocked", 3000, 6); } PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET locked = %i WHERE id = %i", GarageInfo[id][gLocked], GarageInfo[id][gID]); mysql_tquery(connectionID, queryBuffer); return 1; } else if((id = GetNearbyBusinessEx(playerid)) >= 0) { if(!BusinessInfo[id][bLocked]) { BusinessInfo[id][bLocked] = 1; GameTextForPlayer(playerid, "~r~Business locked", 3000, 6); } else { BusinessInfo[id][bLocked] = 0; GameTextForPlayer(playerid, "~g~Business unlocked", 3000, 6); } PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET locked = %i WHERE id = %i", BusinessInfo[id][bLocked], BusinessInfo[id][bID]); mysql_tquery(connectionID, queryBuffer); return 1; } else if((id = GetNearbyEntranceEx(playerid)) >= 0) { if(!EntranceInfo[id][eLocked]) { EntranceInfo[id][eLocked] = 1; GameTextForPlayer(playerid, "~r~Entrance locked", 3000, 6); } else { EntranceInfo[id][eLocked] = 0; GameTextForPlayer(playerid, "~g~Entrance unlocked", 3000, 6); } PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET locked = %i WHERE id = %i", EntranceInfo[id][eLocked], EntranceInfo[id][eID]); mysql_tquery(connectionID, queryBuffer); return 1; } SendClientMessage(playerid, COLOR_GREY, "You are not close to anything which you can lock."); return 1; } CMD:househelp(playerid, params[]) { SendClientMessage(playerid, COLOR_GREEN, "_______________________________________"); SendClientMessage(playerid, COLOR_WHITE, "*** HOUSE HELP *** type a command for more information."); SendClientMessage(playerid, COLOR_GREY, "*** HOUSE *** /buyhouse /lock /stash /furniture /upgradehouse /sellhouse /sellmyhouse"); SendClientMessage(playerid, COLOR_GREY, "*** HOUSE *** /door /renthouse /unrent /setrent /tenants /evict /evictall /houseinfo"); SendClientMessage(playerid, COLOR_GREY, "*** HOUSE *** /houseinvite /hlights"); return 1; } CMD:stash(playerid, params[]) { new houseid; if((houseid = GetInsideHouse(playerid)) >= 0 && IsHouseOwner(playerid, houseid)) { new option[14], param[32]; if(!HouseInfo[houseid][hLevel]) { return SendClientMessage(playerid, COLOR_GREY, "This house has no stash upgrade. '/upgradehouse level' to purchase one."); } if(sscanf(params, "s[14]S()[32]", option, param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [balance | deposit | withdraw]"); } if(PlayerInfo[playerid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while on admin duty"); } if(!strcmp(option, "balance", true)) { new count; for(new i = 0; i < 10; i ++) { if(HouseInfo[houseid][hWeapons][i]) { count++; } } SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Stash Balance ______"); SendClientMessageEx(playerid, COLOR_GREY2, "Cash: $%i/$%i", HouseInfo[houseid][hCash], GetHouseStashCapacity(houseid, STASH_CAPACITY_CASH)); SendClientMessageEx(playerid, COLOR_GREY2, "Materials: %i/%i | Weapons: %i/%i", HouseInfo[houseid][hMaterials], GetHouseStashCapacity(houseid, STASH_CAPACITY_MATERIALS), count, GetHouseStashCapacity(houseid, STASH_CAPACITY_WEAPONS)); SendClientMessageEx(playerid, COLOR_GREY2, "Weed: %i/%i grams | Cocaine: %i/%i grams", HouseInfo[houseid][hWeed], GetHouseStashCapacity(houseid, STASH_CAPACITY_WEED), HouseInfo[houseid][hCocaine], GetHouseStashCapacity(houseid, STASH_CAPACITY_COCAINE)); SendClientMessageEx(playerid, COLOR_GREY2, "Meth: %i/%i grams | Painkillers: %i/%i pills", HouseInfo[houseid][hMeth], GetHouseStashCapacity(houseid, STASH_CAPACITY_METH), HouseInfo[houseid][hPainkillers], GetHouseStashCapacity(houseid, STASH_CAPACITY_PAINKILLERS)); if(count > 0) { SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Stash Weapons ______"); for(new i = 0; i < 10; i ++) { if(HouseInfo[houseid][hWeapons][i]) { SendClientMessageEx(playerid, COLOR_GREY2, "[%i] Weapon: %s", i + 1, GetWeaponNameEx(HouseInfo[houseid][hWeapons][i])); } } } } else if(!strcmp(option, "deposit", true)) { new value; if(sscanf(param, "s[14]S()[32]", option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [deposit] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Cash, Materials, Weed, Cocaine, Meth, Painkillers, Weapon"); return 1; } if(!strcmp(option, "cash", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [deposit] [cash] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pCash]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(GetHouseStashCapacity(houseid, STASH_CAPACITY_CASH) < HouseInfo[houseid][hCash] + value) { return SendClientMessageEx(playerid, COLOR_GREY, "Your stash can only hold up to %s at your house's level.", FormatNumber(GetHouseStashCapacity(houseid, STASH_CAPACITY_CASH))); } GivePlayerCash(playerid, -value); HouseInfo[houseid][hCash] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET cash = %i WHERE id = %i", HouseInfo[houseid][hCash], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %s in your house stash.", FormatNumber(value)); } else if(!strcmp(option, "materials", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [deposit] [materials] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pMaterials]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(GetHouseStashCapacity(houseid, STASH_CAPACITY_MATERIALS) < HouseInfo[houseid][hMaterials] + value) { return SendClientMessageEx(playerid, COLOR_GREY, "Your stash can only hold up to %i materials at your house's level.", GetHouseStashCapacity(houseid, STASH_CAPACITY_MATERIALS)); } PlayerInfo[playerid][pMaterials] -= value; HouseInfo[houseid][hMaterials] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET materials = %i WHERE id = %i", HouseInfo[houseid][hMaterials], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %i materials in your house stash.", value); } else if(!strcmp(option, "weed", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [deposit] [weed] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pWeed]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(GetHouseStashCapacity(houseid, STASH_CAPACITY_WEED) < HouseInfo[houseid][hWeed] + value) { return SendClientMessageEx(playerid, COLOR_GREY, "Your stash can only hold up to %i grams of weed at your house's level.", GetHouseStashCapacity(houseid, STASH_CAPACITY_WEED)); } PlayerInfo[playerid][pWeed] -= value; HouseInfo[houseid][hWeed] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET weed = %i WHERE id = %i", HouseInfo[houseid][hWeed], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %ig of weed in your house stash.", value); } else if(!strcmp(option, "cocaine", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [deposit] [cocaine] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pCocaine]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(GetHouseStashCapacity(houseid, STASH_CAPACITY_COCAINE) < HouseInfo[houseid][hCocaine] + value) { return SendClientMessageEx(playerid, COLOR_GREY, "Your stash can only hold up to %i grams of cocaine at your house's level.", GetHouseStashCapacity(houseid, STASH_CAPACITY_COCAINE)); } PlayerInfo[playerid][pCocaine] -= value; HouseInfo[houseid][hCocaine] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET cocaine = %i WHERE id = %i", HouseInfo[houseid][hCocaine], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %ig of cocaine in your house stash.", value); } else if(!strcmp(option, "meth", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [deposit] [meth] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pMeth]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(GetHouseStashCapacity(houseid, STASH_CAPACITY_METH) < HouseInfo[houseid][hMeth] + value) { return SendClientMessageEx(playerid, COLOR_GREY, "Your stash can only hold up to %i grams of meth at your house's level.", GetHouseStashCapacity(houseid, STASH_CAPACITY_METH)); } PlayerInfo[playerid][pMeth] -= value; HouseInfo[houseid][hMeth] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET meth = %i WHERE id = %i", HouseInfo[houseid][hMeth], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %ig of meth in your house stash.", value); } else if(!strcmp(option, "painkillers", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [deposit] [painkillers] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pPainkillers]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(GetHouseStashCapacity(houseid, STASH_CAPACITY_PAINKILLERS) < HouseInfo[houseid][hPainkillers] + value) { return SendClientMessageEx(playerid, COLOR_GREY, "Your stash can only hold up to %i painkillers at your house's level.", GetHouseStashCapacity(houseid, STASH_CAPACITY_PAINKILLERS)); } PlayerInfo[playerid][pPainkillers] -= value; HouseInfo[houseid][hPainkillers] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET painkillers = %i WHERE id = %i", HouseInfo[houseid][hPainkillers], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[playerid][pPainkillers], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %i painkillers in your house stash.", value); } else if(!strcmp(option, "weapon", true)) { new weaponid; if(sscanf(param, "i", weaponid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [deposit] [weapon] [weaponid] (/guninv for weapon IDs)"); } if(!(1 <= weaponid <= 46) || PlayerInfo[playerid][pWeapons][weaponSlotIDs[weaponid]] != weaponid) { return SendClientMessage(playerid, COLOR_GREY, "You don't have that weapon. /guninv for a list of your weapons."); } if(IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "Law enforcement is prohibited from storing weapons."); } if(GetPlayerHealthEx(playerid) < 60) { return SendClientMessage(playerid, COLOR_GREY, "You can't store weapons as your health is below 60."); } for(new i = 0; i < GetHouseStashCapacity(houseid, STASH_CAPACITY_WEAPONS); i ++) { if(!HouseInfo[houseid][hWeapons][i]) { HouseInfo[houseid][hWeapons][i] = weaponid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET weapon_%i = %i WHERE id = %i", i + 1, HouseInfo[houseid][hWeapons][i], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); RemovePlayerWeapon(playerid, weaponid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored a %s in slot %i of your house stash.", GetWeaponNameEx(HouseInfo[houseid][hWeapons][i]), i + 1); return 1; } } SendClientMessage(playerid, COLOR_GREY, "Your house stash has no more slots available for weapons."); } } else if(!strcmp(option, "withdraw", true)) { new value; if(sscanf(param, "s[14]S()[32]", option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [withdraw] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Cash, Weed, Cocaine, Meth, Painkillers, Weapon"); return 1; } if(!strcmp(option, "cash", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [withdraw] [cash] [amount]"); } if(value < 1 || value > HouseInfo[houseid][hCash]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } GivePlayerCash(playerid, value); HouseInfo[houseid][hCash] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET cash = %i WHERE id = %i", HouseInfo[houseid][hCash], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %s from your house stash.", FormatNumber(value)); } else if(!strcmp(option, "materials", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [withdraw] [materials] [amount]"); } if(value < 1 || value > HouseInfo[houseid][hMaterials]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pMaterials] + value > GetPlayerCapacity(playerid, CAPACITY_MATERIALS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i materials. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMaterials], GetPlayerCapacity(playerid, CAPACITY_MATERIALS)); } PlayerInfo[playerid][pMaterials] += value; HouseInfo[houseid][hMaterials] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET materials = %i WHERE id = %i", HouseInfo[houseid][hMaterials], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %i materials from your house stash.", value); } else if(!strcmp(option, "weed", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [withdraw] [weed] [amount]"); } if(value < 1 || value > HouseInfo[houseid][hWeed]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pWeed] + value > GetPlayerCapacity(playerid, CAPACITY_WEED)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i weed. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pWeed], GetPlayerCapacity(playerid, CAPACITY_WEED)); } PlayerInfo[playerid][pWeed] += value; HouseInfo[houseid][hWeed] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET weed = %i WHERE id = %i", HouseInfo[houseid][hWeed], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %ig of weed from your house stash.", value); } else if(!strcmp(option, "cocaine", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [withdraw] [cocaine] [amount]"); } if(value < 1 || value > HouseInfo[houseid][hCocaine]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pCocaine] + value > GetPlayerCapacity(playerid, CAPACITY_COCAINE)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i cocaine. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pCocaine], GetPlayerCapacity(playerid, CAPACITY_COCAINE)); } PlayerInfo[playerid][pCocaine] += value; HouseInfo[houseid][hCocaine] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET cocaine = %i WHERE id = %i", HouseInfo[houseid][hCocaine], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %ig of cocaine from your house stash.", value); } else if(!strcmp(option, "meth", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [withdraw] [meth] [amount]"); } if(value < 1 || value > HouseInfo[houseid][hMeth]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pMeth] + value > GetPlayerCapacity(playerid, CAPACITY_METH)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i meth. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMeth], GetPlayerCapacity(playerid, CAPACITY_METH)); } PlayerInfo[playerid][pMeth] += value; HouseInfo[houseid][hMeth] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET meth = %i WHERE id = %i", HouseInfo[houseid][hMeth], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %ig of meth from your house stash.", value); } else if(!strcmp(option, "painkillers", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stash [withdraw] [painkillers] [amount]"); } if(value < 1 || value > HouseInfo[houseid][hPainkillers]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pPainkillers] + value > GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i painkillers. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pPainkillers], GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS)); } PlayerInfo[playerid][pPainkillers] += value; HouseInfo[houseid][hPainkillers] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET painkillers = %i WHERE id = %i", HouseInfo[houseid][hPainkillers], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[playerid][pPainkillers], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %i painkillers from your house stash.", value); } else if(!strcmp(option, "weapon", true)) { new slots = GetHouseStashCapacity(houseid, STASH_CAPACITY_WEAPONS); if(sscanf(param, "i", value)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /stash [withdraw] [weapon] [slot (1-%i)]", slots); } if(value < 1 || value > slots) { return SendClientMessage(playerid, COLOR_GREY, "Invalid slot, or the slot specified is locked."); } if(!HouseInfo[houseid][hWeapons][value-1]) { return SendClientMessage(playerid, COLOR_GREY, "The slot specified contains no weapon which you can take."); } if(PlayerInfo[playerid][pHours] < 2 || PlayerInfo[playerid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are either weapon restricted or you played less than two playing hours."); } GivePlayerWeaponEx(playerid, HouseInfo[houseid][hWeapons][value-1]); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken a %s from slot %i of your house stash.", GetWeaponNameEx(HouseInfo[houseid][hWeapons][value-1]), value); HouseInfo[houseid][hWeapons][value-1] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET weapon_%i = 0 WHERE id = %i", value, HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); } } } else { SendClientMessage(playerid, COLOR_GREY, "You are not in range of any stash which you can use."); } return 1; } CMD:upgradehouse(playerid, params[]) { new houseid = GetNearbyHouseEx(playerid), option[10], param[12], string[20]; if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any house of yours."); } if(sscanf(params, "s[10]S()[12]", option, param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /upgradehouse [level/interior]"); } if(!strcmp(option, "level", true)) { new cost = (HouseInfo[houseid][hLevel] * 25000) + 25000; if(HouseInfo[houseid][hLevel] >= 5) { return SendClientMessage(playerid, COLOR_GREY, "Your house is already at the maximum level possible."); } if(isnull(param) || strcmp(param, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /upgradehouse [level] [confirm]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "You are about to upgrade to level %i/5 which will cost you $%i.", HouseInfo[houseid][hLevel] + 1, cost); return 1; } if(PlayerInfo[playerid][pCash] < cost) { return SendClientMessage(playerid, COLOR_GREY, "You don't have that much cash."); } HouseInfo[houseid][hLevel]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET level = level + 1 WHERE id = %i", HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); format(string, sizeof(string), "~r~-$%i", cost); GameTextForPlayer(playerid, string, 5000, 1); GivePlayerCash(playerid, -cost); ReloadHouse(houseid); if(HouseInfo[houseid][hLevel] == 1) { SendClientMessageEx(playerid, COLOR_GREEN, "You have upgraded your house to level %i/5. You unlocked a stash for your house! (/stash)", HouseInfo[houseid][hLevel]); } else { SendClientMessageEx(playerid, COLOR_GREEN, "You have upgraded your house to level %i/5. Your stash capacity was increased.", HouseInfo[houseid][hLevel]); } SendClientMessageEx(playerid, COLOR_GREEN, "Your tenant and furniture capacity were also both increased to %i/%i.", GetHouseTenantCapacity(houseid), GetHouseFurnitureCapacity(houseid)); Log_Write("log_property", "%s (uid: %i) upgraded their house (id: %i) to level %i for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], HouseInfo[houseid][hID], HouseInfo[houseid][hLevel], cost); } else if(!strcmp(option, "interior", true)) { static interiors[sizeof(houseInteriors) * 64]; if(isnull(interiors)) { interiors = "#\tClass\tPrice"; for(new i = 0; i < sizeof(houseInteriors); i ++) { format(interiors, sizeof(interiors), "%s\n%i\t%s\t{00AA00}$%i{FFFFFF}", interiors, i + 1, houseInteriors[i][intClass], houseInteriors[i][intPrice]); } } ShowPlayerDialog(playerid, DIALOG_HOUSEINTERIORS, DIALOG_STYLE_TABLIST_HEADERS, "Choose an interior to preview.", interiors, "Preview", "Cancel"); } return 1; } CMD:sellhouse(playerid, params[]) { new houseid = GetNearbyHouseEx(playerid), targetid, amount; if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any house of yours."); } if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellhouse [playerid] [amount]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell to yourself."); } if(amount < 1) { return SendClientMessage(playerid, COLOR_GREY, "You must specify an amount above zero."); } PlayerInfo[targetid][pHouseOffer] = playerid; PlayerInfo[targetid][pHouseOffered] = houseid; PlayerInfo[targetid][pHousePrice] = amount; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered you their house for %s (/accept house).", GetPlayerRPName(playerid), FormatNumber(amount)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered %s to buy your house for %s.", GetPlayerRPName(targetid), FormatNumber(amount)); return 1; } CMD:sellmyhouse(playerid, params[]) { new houseid = GetNearbyHouseEx(playerid); if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any house of yours."); } if(strcmp(params, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellmyhouse [confirm]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "This command sells your house back to the state. You will receive %s back.", FormatNumber(percent(HouseInfo[houseid][hPrice], 75))); return 1; } SetHouseOwner(houseid, INVALID_PLAYER_ID); GivePlayerCash(playerid, percent(HouseInfo[houseid][hPrice], 75)); SendClientMessageEx(playerid, COLOR_GREEN, "You have sold your house to the state and received %s back.", FormatNumber(percent(HouseInfo[houseid][hPrice], 75))); Log_Write("log_property", "%s (uid: %i) sold their house (id: %i) to the state for $%i", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], HouseInfo[houseid][hID], percent(HouseInfo[houseid][hPrice], 75)); return 1; } CMD:houseinfo(playerid, params[]) { new houseid = GetNearbyHouseEx(playerid); if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any house of yours."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT (SELECT COUNT(*) FROM furniture WHERE houseid = %i) AS furnitureCount, (SELECT COUNT(*) FROM users WHERE rentinghouse = %i) AS tenantCount", HouseInfo[houseid][hID], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_HOUSE_INFORMATION, playerid); return 1; } CMD:makeadmin(playerid, params[]) { new targetid, level; if(PlayerInfo[playerid][pAdmin] < 9 && !PlayerInfo[playerid][pAdminPersonnel]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "ui", targetid, level)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /makeadmin [playerid] [level]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(!(0 <= level <= 9)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid level. Valid levels range from 0 to 7."); } if(PlayerInfo[playerid][pAdminPersonnel] && level > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "Level cannot be higher than your admin level."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin] && level < PlayerInfo[targetid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be demoted."); } if(level <= 1 && PlayerInfo[targetid][pAdminDuty]) { SetPlayerName(targetid, PlayerInfo[targetid][pUsername]); SetPlayerSpecialTag(targetid, TAG_NONE); PlayerInfo[targetid][pAdminDuty] = 0; } PlayerInfo[targetid][pAdmin] = level; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a %s (%i).", GetPlayerRPName(playerid), GetPlayerRPName(targetid), GetAdminRank(targetid), level); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET adminlevel = %i WHERE uid = %i", level, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(level == 0) { SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's administrator powers.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your administrator powers.", GetPlayerRPName(playerid)); PlayerInfo[playerid][pDeveloper] = 0; PlayerInfo[playerid][pFactionMod] = 0; PlayerInfo[playerid][pWebDev] = 0; PlayerInfo[playerid][pBanAppealer] = 0; PlayerInfo[playerid][pGangMod] = 0; PlayerInfo[playerid][pHelperManager] = 0; PlayerInfo[playerid][pDynamicAdmin] = 0; PlayerInfo[playerid][pAdminPersonnel] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET scripter = 0, gangmod = 0, banappealer = 0, factionmod = 0, webdev = 0, helpermanager = 0, dynamicadmin = 0, adminpersonnel = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else { SendClientMessageEx(playerid, COLOR_AQUA, "You have set %s's admin level to {FF6347}%s{33CCFF} (%i).", GetPlayerRPName(targetid), GetAdminRank(targetid), level); SendClientMessageEx(targetid, COLOR_AQUA, "%s has set your admin level to {FF6347}%s{33CCFF} (%i).", GetPlayerRPName(playerid), GetAdminRank(targetid), level); } Log_Write("log_makeadmin", "%s (uid: %i) set %s's (uid: %i) admin level to %i", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], level); return 1; } /*CMD:ufah(playerid, params[]) { new targetid, level; if(sscanf(params, "ui", targetid, level)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /makeadmin [playerid] [level]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(!(0 <= level <= 9)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid level. Valid levels range from 0 to 9."); } if(PlayerInfo[playerid][pAdminPersonnel] && level > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "Level cannot be higher than your admin level."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin] && level < PlayerInfo[targetid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be demoted."); } if(level <= 1 && PlayerInfo[targetid][pAdminDuty]) { SetPlayerName(targetid, PlayerInfo[targetid][pUsername]); SetPlayerSpecialTag(targetid, TAG_NONE); PlayerInfo[targetid][pAdminDuty] = 0; } PlayerInfo[targetid][pAdmin] = level; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a %s (%i).", GetPlayerRPName(playerid), GetPlayerRPName(targetid), GetAdminRank(targetid), level); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET adminlevel = %i WHERE uid = %i", level, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(level == 0) { SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's administrator powers.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your administrator powers.", GetPlayerRPName(playerid)); PlayerInfo[playerid][pDeveloper] = 0; PlayerInfo[playerid][pFactionMod] = 0; PlayerInfo[playerid][pWebDev] = 0; PlayerInfo[playerid][pBanAppealer] = 0; PlayerInfo[playerid][pGangMod] = 0; PlayerInfo[playerid][pHelperManager] = 0; PlayerInfo[playerid][pDynamicAdmin] = 0; PlayerInfo[playerid][pAdminPersonnel] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET scripter = 0, gangmod = 0, banappealer = 0, factionmod = 0, webdev = 0, helpermanager = 0, dynamicadmin = 0, adminpersonnel = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else { SendClientMessageEx(playerid, COLOR_AQUA, "You have set %s's admin level to {FF6347}%s{33CCFF} (%i).", GetPlayerRPName(targetid), GetAdminRank(targetid), level); SendClientMessageEx(targetid, COLOR_AQUA, "%s has set your admin level to {FF6347}%s{33CCFF} (%i).", GetPlayerRPName(playerid), GetAdminRank(targetid), level); } Log_Write("log_makeadmin", "%s (uid: %i) set %s's (uid: %i) admin level to %i", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], level); return 1; }*/ CMD:makehelper(playerid, params[]) { new targetid, level; if(PlayerInfo[playerid][pAdmin] < 7 && PlayerInfo[playerid][pHelper] < 4 && !PlayerInfo[playerid][pHelperManager]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "ui", targetid, level)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /makehelper [playerid] [level]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(!(0 <= level <= 4)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid level. Valid levels range from 0 to 4."); } if((PlayerInfo[playerid][pAdmin] < 6) && PlayerInfo[targetid][pHelper] > PlayerInfo[playerid][pHelper] && level < PlayerInfo[targetid][pHelper]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher helper level than you. They cannot be demoted."); } if(level == 0) { if(PlayerInfo[targetid][pTagType] == TAG_HELPER) { SetPlayerSpecialTag(targetid, TAG_NONE); } if(PlayerInfo[targetid][pAcceptedHelp]) { callcmd::return(targetid, "\1"); } } SendStaffMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a level %i helper.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), level); PlayerInfo[targetid][pHelper] = level; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET helperlevel = %i WHERE uid = %i", level, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a {00AA00}%s{33CCFF} (%i).", GetPlayerRPName(targetid), GetHelperRank(targetid), level); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {00AA00}%s{33CCFF} (%i).", GetPlayerRPName(playerid), GetHelperRank(targetid), level); Log_Write("log_makehelper", "%s (uid: %i) set %s's (uid: %i) helper level to %i", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], level); return 1; } CMD:omakeadmin(playerid, params[]) { new username[MAX_PLAYER_NAME], level; if(PlayerInfo[playerid][pAdmin] < 9) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]i", username, level)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /omakeadmin [username] [level]"); } if(!(0 <= level <= 6)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid level. Valid levels range from 0 to 6."); } if(IsPlayerOnline(username)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already online and logged in. Use /makeadmin instead."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT adminlevel FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "OnAdminSetAdminLevel", "isi", playerid, username, level); return 1; } CMD:omakehelper(playerid, params[]) { new username[MAX_PLAYER_NAME], level; if(PlayerInfo[playerid][pAdmin] < 7 && PlayerInfo[playerid][pHelper] < 4 && !PlayerInfo[playerid][pHelperManager]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[24]i", username, level)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /omakehelper [username] [level]"); } if(!(0 <= level <= 4)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid level. Valid levels range from 0 to 4."); } if(IsPlayerOnline(username)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already online and logged in. Use /makehelper instead."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT helperlevel FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "OnAdminSetHelperLevel", "isi", playerid, username, level); return 1; } CMD:addtoevent(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /addtoevent [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!IsPlayerSpawned(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is either not spawned, or spectating."); } if(!EventInfo[eReady]) { return SendClientMessage(playerid, COLOR_GREY, "There are no active events which you can add this player to."); } if(PlayerInfo[targetid][pJoinedEvent]) { return SendClientMessage(playerid, COLOR_GREY, "This player is already in the event."); } /*if(PlayerInfo[playerid][pPaintball] > 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently playing paintball."); }*/ SetPlayerInEvent(targetid); SendClientMessageEx(targetid, COLOR_WHITE, "%s has added you to the event.", GetPlayerRPName(playerid)); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has added %s to the event.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:eventkick(playerid, params[]) { new targetid, reason[128]; if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /eventkick [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pJoinedEvent]) { return SendClientMessage(playerid, COLOR_GREY, "This player is currently not in the event."); } foreach(new i : Player) { if(PlayerInfo[i][pJoinedEvent]) { SendClientMessageEx(i, COLOR_LIGHTORANGE, "(( %s was kicked from the event, reason: %s ))", GetPlayerNameEx(targetid), reason); } } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has kicked %s from the event, reason: %s", GetPlayerRPName(playerid), GetPlayerRPName(targetid), reason); SendClientMessageEx(targetid, COLOR_WHITE, "%s has kicked you from the event, reason: %s", GetPlayerRPName(playerid), reason); ResetPlayerWeapons(targetid); PlayerInfo[targetid][pJoinedEvent] = 0; SetPlayerToSpawn(targetid); return 1; } CMD:olisthelpers(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 6 && PlayerInfo[playerid][pHelper] < 3 && !PlayerInfo[playerid][pHelperManager]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } mysql_tquery(connectionID, "SELECT username, lastlogin, helperlevel FROM users WHERE helperlevel > 0 ORDER BY lastlogin DESC", "OnQueryFinished", "ii", THREAD_LIST_HELPERS, playerid); return 1; } CMD:oadmins(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pAdminPersonnel] && !PlayerInfo[playerid][pHumanResources]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } mysql_tquery(connectionID, "SELECT username, lastlogin, adminlevel FROM users WHERE adminlevel > 0 ORDER BY adminlevel DESC", "OnQueryFinished", "ii", THREAD_LIST_ADMINS, playerid); return 1; } CMD:ovips(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } mysql_tquery(connectionID, "SELECT username, lastlogin, vippackage, viptime FROM users WHERE vippackage > 0 ORDER BY vippackage DESC", "OnQueryFinished", "ii", THREAD_LIST_VIPS, playerid); return 1; } CMD:sellinactive(playerid, params[]) { new houses, garages, businesses; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } foreach(new i : House) { if(HouseInfo[i][hExists] && HouseInfo[i][hOwnerID] > 0 && (gettime() - HouseInfo[i][hTimestamp]) > 2592000) { SetHouseOwner(i, INVALID_PLAYER_ID); houses++; } } foreach(new i : Garage) { if(GarageInfo[i][gExists] && GarageInfo[i][gOwnerID] > 0 && (gettime() - GarageInfo[i][gTimestamp]) > 2592000) { SetGarageOwner(i, INVALID_PLAYER_ID); garages++; } } foreach(new i : Business) { if(BusinessInfo[i][bExists] && BusinessInfo[i][bOwnerID] > 0 && (gettime() - BusinessInfo[i][bTimestamp]) > 2592000) { SetBusinessOwner(i, INVALID_PLAYER_ID); businesses++; } } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has sold all inactive properties.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_WHITE, "** You have sold %i inactive houses, %i inactive garages and %i inactive businesses.", houses, garages, businesses); return 1; } CMD:inactivecheck(playerid, params[]) { new houses, garages, businesses; if(PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } foreach(new i : House) if(HouseInfo[i][hExists] && HouseInfo[i][hOwnerID] > 0 && (gettime() - HouseInfo[i][hTimestamp]) > 2592000) houses++; foreach(new i : Garage) if(GarageInfo[i][gExists] && GarageInfo[i][gOwnerID] > 0 && (gettime() - GarageInfo[i][gTimestamp]) > 2592000) garages++; foreach(new i : Business) if(BusinessInfo[i][bExists] && BusinessInfo[i][bOwnerID] > 0 && (gettime() - BusinessInfo[i][bTimestamp]) > 2592000) businesses++; SendClientMessageEx(playerid, COLOR_WHITE, "** There are currently %i inactive houses, %i inactive garages and %i inactive businesses.", houses, garages, businesses); return 1; } CMD:setcooldown(playerid, params[]) { new option[12], amount; if(PlayerInfo[playerid][pAdmin] < 7 && PlayerInfo[playerid][pGangMod] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[12]i", option, amount)) { return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /setcooldown [ganginvite] [minutes]"); } if(!strcmp(option, "ganginvite", true)) { if(-1 > amount > gacooldown) { return SendClientMessageEx(playerid, COLOR_GREY, "Amount must be above -1 and less then %i", gacooldown); } gacooldown = amount; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the invite cooldown for gangs to %i.", GetPlayerRPName(playerid), amount); } return 1; } CMD:caplimit(playerid, params[]) { new option[8], amount; if(PlayerInfo[playerid][pAdmin] < 7 && PlayerInfo[playerid][pGangMod] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[8]i", option, amount)) { return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /caplimit [turfs/points] [amount]"); } if(!strcmp(option, "turfs", true)) { if(0 > amount > MAX_TURFS) { return SendClientMessageEx(playerid, COLOR_GREY, "Amount must be above 0 and less then %i.", MAX_TURFS); } MaxCapCount[0] = amount; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the max active turf claim limit for gangs to %i.", GetPlayerRPName(playerid), amount); } if(!strcmp(option, "points", true)) { if(0 > amount > MAX_POINTS) { return SendClientMessageEx(playerid, COLOR_GREY, "Amount must be above 0 and less then %i.", MAX_POINTS); } MaxCapCount[1] = amount; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the max active point cap limit for gangs to %i.", GetPlayerRPName(playerid), amount); } SaveServerInfo(); return 1; } CMD:setmotd(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 6 && !PlayerInfo[playerid][pHelperManager] && PlayerInfo[playerid][pHelper] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } new option[8], newval[128]; if(sscanf(params, "s[8]s[128]", option, newval)) { return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /setmotd [admin/helper/global] [text ('none' to reset)]"); } if(strfind(newval, "|") != -1) { return SendClientMessage(playerid, COLOR_GREY, "You may not include the '|' character in the MOTD."); } if(!strcmp(option, "global", true)) { if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); if(!strcmp(newval, "none", true)) { gServerMOTD[0] = 0; SendClientMessage(playerid, COLOR_WHITE, "** You have reset the Global MOTD text."); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has reset the global MOTD.", GetPlayerRPName(playerid)); } else { strcpy(gServerMOTD, newval, 128); SendClientMessageEx(playerid, COLOR_WHITE, "** You have changed the Global MOTD text to '%s'.", gServerMOTD); SendAdminMessage(COLOR_YELLOW, "AdmCmd: %s has set the global MOTD to '%s'", GetPlayerRPName(playerid), gServerMOTD); } } if(!strcmp(option, "admin", true)) { if(PlayerInfo[playerid][pAdmin] < 6) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); if(!strcmp(newval, "none", true)) { adminMOTD[0] = 0; SendClientMessage(playerid, COLOR_WHITE, "** You have reset the Admin MOTD text."); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has reset the admin MOTD.", GetPlayerRPName(playerid)); } else { strcpy(adminMOTD, newval, 128); SendClientMessageEx(playerid, COLOR_WHITE, "** You have changed the Admin MOTD text to '%s'.", adminMOTD); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the admin MOTD to '%s'", GetPlayerRPName(playerid), adminMOTD); } } if(!strcmp(option, "helper", true)) { if(!strcmp(newval, "none", true)) { helperMOTD[0] = 0; SendClientMessage(playerid, COLOR_WHITE, "** You have reset the Helper MOTD text."); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has reset the helper MOTD.", GetPlayerRPName(playerid)); } else { strcpy(helperMOTD, newval, 128); SendClientMessageEx(playerid, COLOR_WHITE, "** You have changed the Helper MOTD text to '%s'.", helperMOTD); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the helper MOTD to '%s'", GetPlayerRPName(playerid), helperMOTD); } } SaveServerInfo(); return 1; } /*CMD:setmotd(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 6 && !PlayerInfo[playerid][pDeveloper]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setmotd [text ('none' to reset)]"); } if(strfind(params, "|") != -1) { return SendClientMessage(playerid, COLOR_GREY, "You may not include the '|' character in the MOTD."); } if(!strcmp(params, "none", true)) { gServerMOTD[0] = 0; SendClientMessage(playerid, COLOR_WHITE, "You have reset the MOTD text."); } else { strcpy(gServerMOTD, params, 128); SendClientMessageEx(playerid, COLOR_WHITE, "You have changed the MOTD text to '%s'.", gServerMOTD); } SaveServerInfo(); return 1; }*/ CMD:makeformeradmin(playerid, params[]) { new targetid, status; if(PlayerInfo[playerid][pAdmin] < 9 && !PlayerInfo[playerid][pAdminPersonnel]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "ui", targetid, status) || !(0 <= status <= 1)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /makeformeradmin [playerid] [status (0/1)]"); return 1; } PlayerInfo[targetid][pFormerAdmin] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET FormerAdmin = %i WHERE uid = %i", PlayerInfo[targetid][pFormerAdmin], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a Former Admin.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) a Former Admin.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a {FF6347}Former Admin{33CCFF}.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {FF6347}Former Admin{33CCFF}.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's Former Admin status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) Former Admin status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}Former Admin{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}Former Admin{33CCFF} status.", GetPlayerRPName(playerid)); } return 1; } CMD:setstaff(playerid, params[]) { new targetid, option[16], status; if(PlayerInfo[playerid][pAdmin] < 9) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[16]i", targetid, option, status) || !(0 <= status <= 1)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setstaff [playerid] [option] [status (0/1)]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: FactionMod, GangMod, BanAppealer, AdminPersonnel, PublicRelations, GameAffairs"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: DynamicAdmin, Scripter, ComplaintMod, HumanResources, WebDev"); return 1; } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(PlayerInfo[targetid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "Target player must be an administrator!"); } if(!strcmp(option, "webdev", true)) { PlayerInfo[targetid][pWebDev] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET webdev = %i WHERE uid = %i", PlayerInfo[targetid][pWebDev], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a website developer.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) a website developer.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a {FF6347}website developer{33CCFF}.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {FF6347}website developer{33CCFF}.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's website developer status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) website developer status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}website developer{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}website developer{33CCFF} status.", GetPlayerRPName(playerid)); } } if(!strcmp(option, "factionmod", true)) { PlayerInfo[targetid][pFactionMod] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET factionmod = %i WHERE uid = %i", PlayerInfo[targetid][pFactionMod], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a faction moderator.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) a faction moderator.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a {FF6347}faction moderator{33CCFF}.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {FF6347}faction moderator{33CCFF}.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's faction moderator status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) faction moderator status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}faction moderator{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}faction moderator{33CCFF} status.", GetPlayerRPName(playerid)); } } else if(!strcmp(option, "gangmod", true)) { PlayerInfo[targetid][pGangMod] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gangmod = %i WHERE uid = %i", PlayerInfo[targetid][pGangMod], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a gang moderator.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) a gang moderator.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a {FF6347}gang moderator{33CCFF}.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {FF6347}gang moderator{33CCFF}.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's gang moderator status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) gang moderator status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}gang moderator{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}gang moderator{33CCFF} status.", GetPlayerRPName(playerid)); } } else if(!strcmp(option, "banappealer", true)) { PlayerInfo[targetid][pBanAppealer] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET banappealer = %i WHERE uid = %i", PlayerInfo[targetid][pBanAppealer], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a ban appealer.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) a ban appealer.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a {FF6347}ban appealer{33CCFF}.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {FF6347}ban appealer{33CCFF}.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's ban appealer status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) ban appealer status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}ban appealer{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}ban appealer{33CCFF} status.", GetPlayerRPName(playerid)); } } else if(!strcmp(option, "scripter", true)) { if(PlayerInfo[playerid][pAdmin] < 8) return SendClientMessage(playerid, COLOR_GREY, "You must be server management to set someone as a scripter."); PlayerInfo[targetid][pDeveloper] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET scripter = %i WHERE uid = %i", PlayerInfo[targetid][pDeveloper], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a developer.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) a developer.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a {FF6347}developer{33CCFF}.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {FF6347}developer{33CCFF}.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's developer status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) developer status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}developer{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}developer{33CCFF} status.", GetPlayerRPName(playerid)); } } else if(!strcmp(option, "publicrelations", true)) { PlayerInfo[targetid][pHelperManager] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET helpermanager = %i WHERE uid = %i", PlayerInfo[targetid][pHelperManager], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a Public Relations.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) a Public Relations.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a {FF6347}Public Relations{33CCFF}.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {FF6347}Public Relations{33CCFF}.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's Public Relations status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) Public Relations status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}Public Relations{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}PR{33CCFF} status.", GetPlayerRPName(playerid)); } } else if(!strcmp(option, "dynamicadmin", true)) { PlayerInfo[targetid][pDynamicAdmin] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET dynamicadmin = %i WHERE uid = %i", PlayerInfo[targetid][pDynamicAdmin], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a dynamic admin.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) a dynamic admin.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a {FF6347}dynamic admin{33CCFF}.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {FF6347}dynamic admin{33CCFF}.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's dynamic admin status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) dynamic admin status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}dynamic admin{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}dynamic admin{33CCFF} status.", GetPlayerRPName(playerid)); } } else if(!strcmp(option, "adminpersonnel", true)) { if(PlayerInfo[playerid][pAdmin] < 8) return SendClientMessage(playerid, COLOR_GREY, "You must be server management to set someone as AP."); PlayerInfo[targetid][pAdminPersonnel] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET adminpersonnel = %i WHERE uid = %i", PlayerInfo[targetid][pAdminPersonnel], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s admin personnel.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) admin perosnnel.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s {FF6347}admin personnel{33CCFF}.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you {FF6347}admin personnel{33CCFF}.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's admin personnel status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) admin personnel status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}admin personnel{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}admin personnel{33CCFF} status.", GetPlayerRPName(playerid)); } } else if(!strcmp(option, "gameaffairs", true)) { PlayerInfo[targetid][pGameAffairs] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gameaffairs = %i WHERE uid = %i", PlayerInfo[targetid][pGameAffairs], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a part of the department of game affairs.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) a part of the department of game affairs.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a part of the department of {FF6347}game affairs{33CCFF}.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a part of the department of{FF6347}game affairs{33CCFF}.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's game affairs status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) game affairs status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}game affairs{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}game affairs{33CCFF} status.", GetPlayerRPName(playerid)); } } else if(!strcmp(option, "humanresources", true)) { PlayerInfo[targetid][pHumanResources] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET humanresources = %i WHERE uid = %i", PlayerInfo[targetid][pHumanResources], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a part of the human resources.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) a part of the human resources.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a part of the {FF6347}human resources{33CCFF}.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a part of the {FF6347}human resources{33CCFF}.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's human resources status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) human resources status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}human resources{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}human resources{33CCFF} status.", GetPlayerRPName(playerid)); } } else if(!strcmp(option, "complaintmod", true)) { PlayerInfo[targetid][pComplaintMod] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET complaintmod = %i WHERE uid = %i", PlayerInfo[targetid][pComplaintMod], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a complaint moderator status.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has made %s (uid: %i) a complaint moderator status.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have made %s a {FF6347}complaint moderator{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {FF6347}complaint moderator{33CCFF} status.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s's complaint moderator.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); Log_Write("log_admin", "%s (uid: %i) has removed %s's (uid: %i) complaint moderator.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's {FF6347}complaint moderator{33CCFF} status.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your {FF6347}complaint moderator{33CCFF} status.", GetPlayerRPName(playerid)); } } return 1; } CMD:renamecmd(playerid, params[]) { new cmd[64], newcmd[64]; if(PlayerInfo[playerid][pAdmin] < 9 && !PlayerInfo[playerid][pDeveloper]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[64]s[64]", cmd, newcmd)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /renamecmd [old] [new] (64 chars)"); } if(PC_CommandExists(cmd)) { PC_RenameCommand(cmd, newcmd); SendClientMessageEx(playerid, COLOR_AQUA, "You've renamed command %s to %s.", cmd, newcmd); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s renamed /%s to /%s", GetPlayerRPName(playerid), cmd, newcmd); } return 1; } CMD:createalliance(playerid, params[]) { new cmd[64], alias[64]; if(PlayerInfo[playerid][pAdmin] < 8 && !PlayerInfo[playerid][pDeveloper]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[64]s[64]", cmd, alias)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /createalias [cmd] [newcmd] (64 chars)"); } if(PC_CommandExists(cmd)) { PC_RegAlias(cmd, alias); SendClientMessageEx(playerid, COLOR_AQUA, "You've created alias %s for %s.", alias, cmd); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s created a alias for /%s (/%s)", GetPlayerRPName(playerid), cmd, alias); } return 1; } /*CMD:deletecmd(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 8 && !PlayerInfo[playerid][pDeveloper]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(param, "s[64]s[64]", oldcmd, "confirm")) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /deletecmd [name] [confirm]"); } if(PC_CommandExists(oldcmd)) { PC_DeleteCommand(oldcmd); } }*/ CMD:changelist(playerid, params[]) { new slot, option[10], param[64]; if(PlayerInfo[playerid][pAdmin] < 6 && !PlayerInfo[playerid][pDeveloper]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[10]S()[64]", option, param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /changelist [view | edit | clear]"); } if(!strcmp(option, "view", true)) { mysql_tquery(connectionID, "SELECT * FROM changes ORDER BY slot", "OnQueryFinished", "ii", THREAD_LIST_CHANGES, playerid); } else if(!strcmp(option, "edit", true)) { if(sscanf(param, "is[64]", slot, param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /changelist [edit] [slot (1-10)] [text]"); } if(!(1 <= slot <= 10)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid slot."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO changes VALUES(%i, '%e') ON DUPLICATE KEY UPDATE text = '%e'", slot, param, param); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** Change text for slot %i changed to '%s'.", slot, param); } else if(!strcmp(option, "clear", true)) { if(sscanf(param, "i", slot)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /changelist [clear] [slot (1-10)]"); } if(!(1 <= slot <= 10)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid slot."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM changes WHERE slot = %i", slot); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** Change text for slot %i cleared.", slot); } return 1; } CMD:forceaduty(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 6 && !PlayerInfo[playerid][pAdminPersonnel]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /forceaduty [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "That player needs to be at least a level 2 administrator."); } if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified has a higher admin level than you. They cannot be forced into admin duty."); } if(!PlayerInfo[targetid][pAdminDuty]) { SendClientMessageEx(targetid, COLOR_WHITE, "%s has forced you to be on admin duty.", GetPlayerRPName(playerid)); } else { SendClientMessageEx(targetid, COLOR_WHITE, "%s has forced you to be off admin duty.", GetPlayerRPName(playerid)); } callcmd::aduty(targetid, "\1"); return 1; } CMD:listhelp(playerid, params[]) { if(PlayerInfo[playerid][pHelper] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ Help Requests _____"); foreach(new i : Player) { if(!isnull(PlayerInfo[i][pHelpRequest])) { SendClientMessageEx(playerid, COLOR_GREY2, "** %s[%i] asks: %s", GetPlayerRPName(i), i, PlayerInfo[i][pHelpRequest]); } } SendClientMessage(playerid, COLOR_AQUA, "** Use /accepthelp [id] or /denyhelp [id] to handle help requests."); SendClientMessage(playerid, COLOR_AQUA, "** Use /answerhelp [id] [msg] to PM an answer without the need to teleport."); return 1; } CMD:accepthelp(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pHelper] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } /*if(PlayerInfo[playerid][pPaintball] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You need to leave the paintball arena first."); }*/ if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /accepthelp [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(isnull(PlayerInfo[targetid][pHelpRequest])) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't requested any help since they connected."); } if(PlayerInfo[playerid][pTagType] == TAG_NONE) { SetPlayerSpecialTag(playerid, TAG_HELPER); } if(!PlayerInfo[playerid][pAcceptedHelp]) { SavePlayerVariables(playerid); } TeleportToPlayer(playerid, targetid, false); TogglePlayerControllable(targetid, 0); SetTimerEx("UnfreezeNewbie", 5000, false, "i", targetid); SetPlayerHealth(playerid, 32767); //SetScriptArmour(playerid, 0.0); PlayerInfo[playerid][pHelpRequests]++; PlayerInfo[playerid][pAcceptedHelp] = 1; PlayerInfo[targetid][pHelpRequest][0] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET helprequests = %i WHERE uid = %i", PlayerInfo[playerid][pHelpRequests], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendHelperMessage(COLOR_LIGHTRED, "Helper: %s has accepted %s's help request.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(playerid, COLOR_WHITE, "You accepted %s's help request and were sent to their position. /return to go back.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_GREEN, "%s has accepted your help request. They are now assisting you.", GetPlayerRPName(playerid)); return 1; } CMD:denyhelp(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pHelper] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /denyhelp [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(isnull(PlayerInfo[targetid][pHelpRequest])) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't requested any help since they connected."); } PlayerInfo[targetid][pHelpRequest][0] = 0; SendHelperMessage(COLOR_LIGHTRED, "Helper: %s has denied %s's help request.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(playerid, COLOR_WHITE, "You denied %s's help request.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_LIGHTRED, "** %s has denied your help request.", GetPlayerRPName(playerid)); return 1; } CMD:sta(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pHelper] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sta [playerid] (Sends /requesthelp to admins)"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(isnull(PlayerInfo[targetid][pHelpRequest])) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't requested any help since they connected."); } AddReportToQueue(targetid, PlayerInfo[targetid][pHelpRequest]); PlayerInfo[targetid][pHelpRequest][0] = 0; SendHelperMessage(COLOR_LIGHTRED, "Helper: %s has sent %s's help request to all online admins.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(playerid, COLOR_WHITE, "You sent %s's help request to all online admins.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "** %s has sent your help request to all online admins.", GetPlayerRPName(playerid)); return 1; } CMD:return(playerid, params[]) { if(PlayerInfo[playerid][pHelper] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAcceptedHelp]) { return SendClientMessage(playerid, COLOR_GREY, "You haven't accepted any help requests."); } if(PlayerInfo[playerid][pTagType] == TAG_HELPER) { SetPlayerSpecialTag(playerid, TAG_NONE); } SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]); SetScriptArmour(playerid, PlayerInfo[playerid][pArmor]); SetPlayerPos(playerid, PlayerInfo[playerid][pPosX], PlayerInfo[playerid][pPosY], PlayerInfo[playerid][pPosZ]); SetPlayerFacingAngle(playerid, PlayerInfo[playerid][pPosA]); SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]); SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pWorld]); SetCameraBehindPlayer(playerid); SendClientMessage(playerid, COLOR_WHITE, "You were returned to your previous position."); PlayerInfo[playerid][pAcceptedHelp] = 0; return 1; } CMD:answerhelp(playerid, params[]) { new targetid, msg[128]; if(PlayerInfo[playerid][pHelper] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[128]", targetid, msg)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /answerhelp [playerid] [message]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(isnull(PlayerInfo[targetid][pHelpRequest])) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't requested any help since they connected."); } PlayerInfo[playerid][pHelpRequests]++; PlayerInfo[targetid][pHelpRequest][0] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET helprequests = %i WHERE uid = %i", PlayerInfo[playerid][pHelpRequests], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(strlen(msg) > MAX_SPLIT_LENGTH) { SendClientMessageEx(targetid, COLOR_YELLOW, "** Answer from %s: %.*s... **", GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, msg); SendClientMessageEx(targetid, COLOR_YELLOW, "** Answer from %s: ...%s **", GetPlayerRPName(playerid), msg[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(targetid, COLOR_YELLOW, "** Answer from %s: %s **", GetPlayerRPName(playerid), msg); } SendHelperMessage(COLOR_LIGHTRED, "Helper: %s has answered %s's help request.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:hc(playerid, params[]) { if(PlayerInfo[playerid][pHelper] < 1 && PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /hc [helper chat]"); } if(PlayerInfo[playerid][pToggleHelper]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the helper chat as you have it toggled."); } foreach(new i : Player) { if((PlayerInfo[i][pHelper] > 0 || PlayerInfo[playerid][pAdmin] > 0) && !PlayerInfo[i][pToggleHelper]) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendStaffMessage(0xBDF38BFF, "** %s %s: %.*s... **", GetStaffRank(playerid), GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendStaffMessage(0xBDF38BFF, "** %s %s: ...%s **", GetStaffRank(playerid), GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } else { SendStaffMessage(0xBDF38BFF, "** %s %s: %s **", GetStaffRank(playerid), GetPlayerRPName(playerid), params); } return 1; } /*if(PlayerInfo[playerid][pAdmin] > 0 && !PlayerInfo[i][pToggleHelper]) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendStaffMessage(0xBDF38BFF, "** %s %s: %.*s... **", GetAdminRank(playerid), GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendStaffMessage(0xBDF38BFF, "** %s %s: ...%s **", GetAdminRank(playerid), GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } else { SendStaffMessage(0xBDF38BFF, "** %s %s: %s **", GetAdminRank(playerid), GetPlayerRPName(playerid), params); } return 1; }*/ } return 1; } CMD:hh(playerid, params[]) { return callcmd::helperhelp(playerid, params); } CMD:hhelp(playerid, params[]) { return callcmd::helperhelp(playerid, params); } CMD:helperhelp(playerid, params[]) { if(PlayerInfo[playerid][pHelper] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(PlayerInfo[playerid][pHelper] >= 1) { SendClientMessage(playerid, COLOR_AQUA, "LEVEL 1:{DDDDDD} /hc, /listhelp, /accepthelp, /answerhelp, /denyhelp, /sta, /return."); } if(PlayerInfo[playerid][pHelper] >= 2) { SendClientMessage(playerid, COLOR_AQUA, "LEVEL 2:{DDDDDD} /nmute, /hmute, /gmute"); } if(PlayerInfo[playerid][pHelper] >= 3) { SendClientMessage(playerid, COLOR_AQUA, "LEVEL 3:{DDDDDD} /olisthelpers, /checknewbie."); } if(PlayerInfo[playerid][pHelper] >= 4) { SendClientMessage(playerid, COLOR_AQUA, "LEVEL 4:{DDDDDD} /setmotd."); } return 1; } CMD:activity(playerid, params[]) { new type[16]; SendClientMessage(playerid, COLOR_NAVYBLUE, "_______ My Properties _______"); foreach(new i : House) { if(HouseInfo[i][hExists] && IsHouseOwner(playerid, i)) { if(HouseInfo[i][hType] == -1) { type = "Other"; } else { strcpy(type, houseInteriors[HouseInfo[i][hType]][intClass]); } if((gettime() - HouseInfo[i][hTimestamp]) > 2592000) { SendClientMessageEx(playerid, COLOR_GREY2, "Your %s house in %s is currently marked as {FF6347}Inactive{C8C8C8}.", type, GetZoneName(HouseInfo[i][hPosX], HouseInfo[i][hPosY], HouseInfo[i][hPosZ])); } else { SendClientMessageEx(playerid, COLOR_GREY2, "Your %s house in %s is currently marked as {00AA00}Active{C8C8C8}.", type, GetZoneName(HouseInfo[i][hPosX], HouseInfo[i][hPosY], HouseInfo[i][hPosZ])); } } } foreach(new i : Garage) { if(GarageInfo[i][gExists] && IsGarageOwner(playerid, i)) { if((gettime() - GarageInfo[i][gTimestamp]) > 2592000) { SendClientMessageEx(playerid, COLOR_GREY2, "Your %s garage in %s is currently marked as {FF6347}Inactive{C8C8C8}.", garageInteriors[GarageInfo[i][gType]][intName], GetZoneName(GarageInfo[i][gPosX], GarageInfo[i][gPosY], GarageInfo[i][gPosZ])); } else { SendClientMessageEx(playerid, COLOR_GREY2, "Your %s garage in %s is currently marked as {00AA00}Active{C8C8C8}.", garageInteriors[GarageInfo[i][gType]][intName], GetZoneName(GarageInfo[i][gPosX], GarageInfo[i][gPosY], GarageInfo[i][gPosZ])); } } } foreach(new i : Business) { if(BusinessInfo[i][bExists] && IsBusinessOwner(playerid, i)) { if((gettime() - BusinessInfo[i][bTimestamp]) > 2592000) { SendClientMessageEx(playerid, COLOR_GREY2, "Your %s business in %s is currently marked as {FF6347}Inactive{C8C8C8}.", bizInteriors[BusinessInfo[i][bType]][intType], GetZoneName(BusinessInfo[i][bPosX], BusinessInfo[i][bPosY], BusinessInfo[i][bPosZ])); } else { SendClientMessageEx(playerid, COLOR_GREY2, "Your %s business in %s is currently marked as {00AA00}Active{C8C8C8}.", bizInteriors[BusinessInfo[i][bType]][intType], GetZoneName(BusinessInfo[i][bPosX], BusinessInfo[i][bPosY], BusinessInfo[i][bPosZ])); } } } SendClientMessage(playerid, COLOR_YELLOW, "** Your properties become inactive if you don't enter them for 30+ days."); return 1; } CMD:hlights(playerid, params[]) { new option, houseid = GetNearbyHouseEx(playerid); if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any house of yours."); } if(sscanf(params, "i", option) || !(0 <= option <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /hlights [lights (1/0)]"); } if(option) { SendClientMessage(playerid, COLOR_AQUA, "** You've turned on the lights to this house."); } else { SendClientMessage(playerid, COLOR_AQUA, "** You've turned off the lights to this house."); } HouseInfo[houseid][hLights] = option; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET lights = %i WHERE id = %i", option, HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); foreach(new i : Player) { if(GetInsideHouse(i) == houseid) { if(HouseInfo[houseid][hLights] == 1) { TextDrawHideForPlayer(i, houseLights); } else { TextDrawShowForPlayer(i, houseLights); } } } return 1; } CMD:setrent(playerid, params[]) { new price, houseid = GetNearbyHouseEx(playerid); if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any house of yours."); } if(sscanf(params, "i", price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setrent [price ('0' to disable)]"); } if(!(0 <= price <= 10000)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid price. The price must range between $0 and $10,000."); } HouseInfo[houseid][hRentPrice] = price; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET rentprice = %i WHERE id = %i", price, HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); ReloadHouse(houseid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've set the rental price to $%i.", price); return 1; } CMD:renthouse(playerid, params[]) { new houseid; if((houseid = GetNearbyHouse(playerid)) == -1) { return SendClientMessage(playerid, COLOR_GREY, "There is no house in range. You must be near a house."); } /*if(strcmp(params, "confirm", true) != 0) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /renthouse [confirm]"); }*/ if(!HouseInfo[houseid][hOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This house is not owned and therefore cannot be rented."); } if(!HouseInfo[houseid][hRentPrice]) { return SendClientMessage(playerid, COLOR_GREY, "This house's owner has chosen to disable renting for this house."); } if(PlayerInfo[playerid][pCash] < HouseInfo[houseid][hRentPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to rent here."); } if(IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are the owner of this house. You can't rent here."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM users WHERE rentinghouse = %i", HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer, "OnPlayerRentHouse", "ii", playerid, houseid); return 1; } CMD:unrent(playerid, params[]) { if(!PlayerInfo[playerid][pRentingHouse]) { return SendClientMessage(playerid, COLOR_GREY, "You are not renting at any property. You can't use this command."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rentinghouse = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[playerid][pRentingHouse] = 0; SendClientMessage(playerid, COLOR_WHITE, "You have ripped up your rental contract."); return 1; } CMD:tenants(playerid, params[]) { new houseid = GetNearbyHouseEx(playerid); if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any house of yours."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT username, lastlogin FROM users WHERE rentinghouse = %i ORDER BY lastlogin DESC", HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LIST_TENANTS, playerid); return 1; } CMD:evict(playerid, params[]) { new username[MAX_PLAYER_NAME], houseid = GetNearbyHouseEx(playerid); if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any house of yours."); } if(sscanf(params, "s[24]", username)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /evict [username]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE username = '%e' AND rentinghouse = %i", username, HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer, "OnPlayerEvict", "is", playerid, username); return 1; } CMD:evictall(playerid, params[]) { new houseid = GetNearbyHouseEx(playerid); if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any house of yours."); } foreach(new i : Player) { if(PlayerInfo[i][pLogged] && PlayerInfo[i][pRentingHouse] == HouseInfo[houseid][hID]) { PlayerInfo[i][pRentingHouse] = 0; SendClientMessage(i, COLOR_RED, "You have been evicted from your home by the owner."); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rentinghouse = 0 WHERE rentinghouse = %i", HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_WHITE, "You have evicted all tenants from your home."); return 1; } CMD:houseinvite(playerid, params[]) { new targetid, houseid = GetNearbyHouseEx(playerid); if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any house of yours."); } if(sscanf(params, "i", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /houseinvite [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { //return SendClientMessage(playerid, COLOR_GREY, "You can't invite yourself to your own home."); } PlayerInfo[targetid][pInviteOffer] = playerid; PlayerInfo[targetid][pInviteHouse] = houseid; SendClientMessageEx(targetid, COLOR_AQUA, "** %s has offered you an invitation to their house in %s. (/accept invite)", GetPlayerRPName(playerid), GetZoneName(HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ])); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered %s an invitation to your house.", GetPlayerRPName(targetid)); return 1; } CMD:furniture(playerid, params[]) { new houseid = GetInsideHouse(playerid), option[14], param[32]; if(houseid == -1 || !HasFurniturePerms(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any house of yours."); } if(sscanf(params, "s[14]S()[32]", option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /furniture [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Buy, Edit, Duplicate, Sell, Clear, Allow, Disallow, Labels"); return 1; } if(!strcmp(option, "buy", true)) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM furniture WHERE houseid = %i", HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_COUNT_FURNITURE, playerid); } else if(!strcmp(option, "edit", true)) { new objectid; if(sscanf(param, "i", objectid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /furniture [edit] [objectid]"); } if(!IsValidDynamicObject(objectid) || Streamer_GetExtraInt(objectid, E_OBJECT_TYPE) != E_OBJECT_FURNITURE) { return SendClientMessage(playerid, COLOR_GREY, "Invalid object. You can find the object IDs for your furniture by enabling labels. [/furniture labels]"); } if(Streamer_GetExtraInt(objectid, E_OBJECT_EXTRA_ID) != HouseInfo[houseid][hID]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid object. This furniture object is not inside of your house."); } PlayerInfo[playerid][pEditType] = EDIT_FURNITURE; PlayerInfo[playerid][pEditObject] = objectid; PlayerInfo[playerid][pFurnitureHouse] = houseid; EditDynamicObject(playerid, objectid); GameTextForPlayer(playerid, "~w~Editing Mode~n~~g~Click disk to save~n~~r~Press ESC to cancel", 5000, 1); } else if(!strcmp(option, "duplicate", true)) { new objectid; if(sscanf(param, "i", objectid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /furniture [duplicate] [objectid]"); } if(!IsValidDynamicObject(objectid) || Streamer_GetExtraInt(objectid, E_OBJECT_TYPE) != E_OBJECT_FURNITURE) { return SendClientMessage(playerid, COLOR_GREY, "Invalid object. You can find the object IDs for your furniture by enabling labels. [/furniture labels]"); } if(Streamer_GetExtraInt(objectid, E_OBJECT_EXTRA_ID) != HouseInfo[houseid][hID]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid object. This furniture object is not inside of your house."); } PlayerInfo[playerid][pSelected] = objectid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM furniture WHERE houseid = %i", HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_CHECKDUPE_FURNITURE, playerid); } else if(!strcmp(option, "sell", true)) { new objectid; if(sscanf(param, "i", objectid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /furniture [sell] [objectid] (75%% refund)"); } if(!IsValidDynamicObject(objectid) || Streamer_GetExtraInt(objectid, E_OBJECT_TYPE) != E_OBJECT_FURNITURE) { return SendClientMessage(playerid, COLOR_GREY, "Invalid object. You can find the object IDs for your furniture by enabling labels. [/furniture labels]"); } if(Streamer_GetExtraInt(objectid, E_OBJECT_EXTRA_ID) != HouseInfo[houseid][hID]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid object. This furniture object is not inside of your house."); } PlayerInfo[playerid][pSelected] = objectid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT name, price FROM furniture WHERE id = %i", Streamer_GetExtraInt(objectid, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_SELL_FURNITURE, playerid); } else if(!strcmp(option, "clear", true)) { if(isnull(param) || strcmp(param, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /furniture [clear] [confirm]"); SendClientMessage(playerid, COLOR_SYNTAX, "This sells all of your furniture in your house. This action is irreversible."); return 1; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT price FROM furniture WHERE houseid = %i", HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_CLEAR_FURNITURE, playerid); } else if(!strcmp(option, "allow", true)) { new targetid; if(sscanf(param, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /furniture [allow] [playerid]"); } if(!IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "This can only be done by the house owner."); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(PlayerInfo[targetid][pFurniturePerms] == houseid) { return SendClientMessage(playerid, COLOR_GREY, "You already allowed that player to access your furniture."); } PlayerInfo[targetid][pFurniturePerms] = houseid; SendClientMessageEx(targetid, COLOR_AQUA, "%s has allowed you to access their home's furniture.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have allowed %s to access your home's furniture.", GetPlayerRPName(targetid)); } else if(!strcmp(option, "disallow", true)) { new targetid; if(sscanf(param, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /furniture [disallow] [playerid]"); } if(!IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "This can only be done by the house owner."); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(PlayerInfo[targetid][pFurniturePerms] != houseid) { return SendClientMessage(playerid, COLOR_GREY, "You haven't allowed that player to access your furniture."); } PlayerInfo[targetid][pFurniturePerms] = -1; SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed your access to their home's furniture.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s's access to your home's furniture.", GetPlayerRPName(targetid)); } else if(!strcmp(option, "labels", true)) { if(!HouseInfo[houseid][hLabels]) { HouseInfo[houseid][hLabels] = 1; SendClientMessage(playerid, COLOR_AQUA, "You will now see labels appear above all of your furniture."); } else { HouseInfo[houseid][hLabels] = 0; SendClientMessage(playerid, COLOR_AQUA, "You will no longer see any labels appear above your furniture."); } ReloadAllFurniture(houseid); } return 1; } CMD:creategarage(playerid, params[]) { new size[8], type = -1, Float:x, Float:y, Float:z, Float:a; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[8]", size)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /creategarage [small/medium/large]"); } if(GetNearbyGarage(playerid) >= 0) { return SendClientMessage(playerid, COLOR_GREY, "There is a garage in range. Find somewhere else to create this one."); } if(GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) { return SendClientMessage(playerid, COLOR_GREY, "You cannot create garages indoors."); } if(!strcmp(size, "small", true)) { type = 0; } else if(!strcmp(size, "medium", true)) { type = 1; } else if(!strcmp(size, "large", true)) { type = 2; } if(type == -1) { SendClientMessage(playerid, COLOR_GREY, "Invalid size. Valid sizes range from Small, Medium and Large."); } else { GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); for(new i = 0; i < MAX_GARAGES; i ++) { if(!GarageInfo[i][gExists]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO garages (type, price, pos_x, pos_y, pos_z, pos_a, exit_x, exit_y, exit_z, exit_a) VALUES(%i, %i, '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f')", type, garageInteriors[type][intPrice], x, y, z, a, x - 3.0 * floatsin(-a, degrees), y - 3.0 * floatcos(-a, degrees), z, a - 180.0); mysql_tquery(connectionID, queryBuffer, "OnAdminCreateGarage", "iiiffff", playerid, i, type, x, y, z, a); return 1; } } SendClientMessage(playerid, COLOR_GREY, "Garage slots are currently full. Ask developers to increase the internal limit."); } return 1; } CMD:editgarage(playerid, params[]) { new garageid, option[10], param[32]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[10]S()[32]", garageid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgarage [garageid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Entrance, Exit, Type, Owner, Price, Locked, Freeze"); return 1; } if(!(0 <= garageid < MAX_GARAGES) || !GarageInfo[garageid][gExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid garage."); } if(!strcmp(option, "entrance", true)) { if(GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) { return SendClientMessage(playerid, COLOR_GREY, "You cannot create garages indoors."); } GetPlayerPos(playerid, GarageInfo[garageid][gPosX], GarageInfo[garageid][gPosY], GarageInfo[garageid][gPosZ]); GetPlayerFacingAngle(playerid, GarageInfo[garageid][gPosA]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET pos_x = '%f', pos_y = '%f', pos_z = '%f', pos_a = '%f' WHERE id = %i", GarageInfo[garageid][gPosX], GarageInfo[garageid][gPosY], GarageInfo[garageid][gPosZ], GarageInfo[garageid][gPosA], GarageInfo[garageid][gID]); mysql_tquery(connectionID, queryBuffer); ReloadGarage(garageid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the entrance of garage %i.", garageid); } else if(!strcmp(option, "freeze", true)) { new status; if(sscanf(param, "i", status) || !(0 <= status <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgarage [garageid] [freeze] [0/1]"); } GarageInfo[garageid][gFreeze] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET freeze = %i WHERE id = %i", GarageInfo[garageid][gFreeze], GarageInfo[garageid][gID]); mysql_tquery(connectionID, queryBuffer); ReloadGarage(garageid); if(status) SendClientMessageEx(playerid, COLOR_AQUA, "** You've enabled freeze & object loading for entrance %i.", garageid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You've disabled freeze & object loading for entrance %i.", garageid); } else if(!strcmp(option, "exit", true)) { if(GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) { return SendClientMessage(playerid, COLOR_GREY, "You cannot create garages indoors."); } GetPlayerPos(playerid, GarageInfo[garageid][gExitX], GarageInfo[garageid][gExitY], GarageInfo[garageid][gExitZ]); GetPlayerFacingAngle(playerid, GarageInfo[garageid][gExitA]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET exit_x = '%f', exit_y = '%f', exit_z = '%f', exit_a = '%f' WHERE id = %i", GarageInfo[garageid][gExitX], GarageInfo[garageid][gExitY], GarageInfo[garageid][gExitZ], GarageInfo[garageid][gExitA], GarageInfo[garageid][gID]); mysql_tquery(connectionID, queryBuffer); ReloadGarage(garageid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the vehicle exit spawn of garage %i.", garageid); } else if(!strcmp(option, "type", true)) { new size[8], type = -1; if(sscanf(param, "s[8]", size)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgarage [garageid] [type] [small/medium/large]"); } if(!strcmp(size, "small", true)) { type = 0; } else if(!strcmp(size, "medium", true)) { type = 1; } else if(!strcmp(size, "large", true)) { type = 2; } if(type == -1) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } GarageInfo[garageid][gType] = type; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET type = %i WHERE id = %i", type, GarageInfo[garageid][gID]); mysql_tquery(connectionID, queryBuffer); ReloadGarage(garageid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the type of garage %i to %s.", garageid, size); } else if(!strcmp(option, "owner", true)) { new targetid; if(sscanf(param, "u", targetid)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editgarage [garageid] [owner] [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } SetGarageOwner(garageid, targetid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the owner of garage %i to %s.", garageid, GetPlayerRPName(targetid)); } else if(!strcmp(option, "price", true)) { new price; if(sscanf(param, "i", price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgarage [garageid] [price] [value]"); } if(price < 0) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $0."); } GarageInfo[garageid][gPrice] = price; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET price = %i WHERE id = %i", GarageInfo[garageid][gPrice], GarageInfo[garageid][gID]); mysql_tquery(connectionID, queryBuffer); ReloadGarage(garageid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the price of garage %i to $%i.", garageid, price); } else if(!strcmp(option, "locked", true)) { new locked; if(sscanf(param, "i", locked) || !(0 <= locked <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgarage [garageid] [locked] [0/1]"); } GarageInfo[garageid][gLocked] = locked; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET locked = %i WHERE id = %i", GarageInfo[garageid][gLocked], GarageInfo[garageid][gID]); mysql_tquery(connectionID, queryBuffer); ReloadGarage(garageid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the lock state of garage %i to %i.", garageid, locked); } return 1; } CMD:removegarage(playerid, params[]) { new garageid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", garageid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removegarage [garageid]"); } if(!(0 <= garageid < MAX_GARAGES) || !GarageInfo[garageid][gExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid garage."); } DestroyDynamic3DTextLabel(GarageInfo[garageid][gText]); DestroyDynamicPickup(GarageInfo[garageid][gPickup]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM garages WHERE id = %i", GarageInfo[garageid][gID]); mysql_tquery(connectionID, queryBuffer); GarageInfo[garageid][gExists] = 0; GarageInfo[garageid][gID] = 0; GarageInfo[garageid][gOwnerID] = 0; Iter_Remove(Garage, garageid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have removed garage %i.", garageid); return 1; } CMD:gotogarage(playerid, params[]) { new garageid; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "i", garageid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gotogarage [garageid]"); } if(!(0 <= garageid < MAX_GARAGES) || !GarageInfo[garageid][gExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid garage."); } GameTextForPlayer(playerid, "~w~Teleported", 5000, 1); SetPlayerPos(playerid, GarageInfo[garageid][gPosX], GarageInfo[garageid][gPosY], GarageInfo[garageid][gPosZ]); SetPlayerFacingAngle(playerid, GarageInfo[garageid][gPosA]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetCameraBehindPlayer(playerid); return 1; } CMD:garagehelp(playerid, params[]) { SendClientMessage(playerid, COLOR_GREEN, "_______________________________________"); SendClientMessage(playerid, COLOR_WHITE, "*** GARAGE HELP *** type a command for more information."); SendClientMessage(playerid, COLOR_GREY, "*** GARAGE *** /buygarage /lock /upgradegarage /sellgarage /sellmygarage /garageinfo"); SendClientMessage(playerid, COLOR_GREY, "*** GARAGE *** /repair /refuel"); return 1; } CMD:buygarage(playerid, params[]) { new garageid; if((garageid = GetNearbyGarage(playerid)) == -1) { return SendClientMessage(playerid, COLOR_GREY, "There is no garage in range. You must be near a garage."); } if(strcmp(params, "confirm", true) != 0) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /buygarage [confirm]"); } if(GarageInfo[garageid][gOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This garage already has an owner."); } if(PlayerInfo[playerid][pCash] < GarageInfo[garageid][gPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this garage."); } if(GetPlayerAssetCount(playerid, LIMIT_GARAGES) >= GetPlayerAssetLimit(playerid, LIMIT_GARAGES)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently own %i/%i garages. You can't own anymore unless you upgrade your asset perk.", GetPlayerAssetCount(playerid, LIMIT_GARAGES), GetPlayerAssetLimit(playerid, LIMIT_GARAGES)); } SetGarageOwner(garageid, playerid); GivePlayerCash(playerid, -GarageInfo[garageid][gPrice]); SendClientMessageEx(playerid, COLOR_GREEN, "You paid %s to make this garage yours! /garagehelp for a list of commands.", FormatNumber(GarageInfo[garageid][gPrice])); Log_Write("log_property", "%s (uid: %i) purchased %s garage (id: %i) for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], garageInteriors[GarageInfo[garageid][gType]][intName], GarageInfo[garageid][gID], GarageInfo[garageid][gPrice]); return 1; } CMD:upgradegarage(playerid, params[]) { new garageid = GetNearbyGarageEx(playerid); if(garageid == -1 || !IsGarageOwner(playerid, garageid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any garage of yours."); } if(GarageInfo[garageid][gType] >= 2) { return SendClientMessage(playerid, COLOR_GREY, "Your garage is already at its maximum possible size. You cannot upgrade it further."); } if(isnull(params) || strcmp(params, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /upgradegarage [confirm]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "The next garage size available is %s and costs %s to upgrade to.", garageInteriors[GarageInfo[garageid][gType] + 1][intName], FormatNumber(garageInteriors[GarageInfo[garageid][gType] + 1][intPrice])); return 1; } if(PlayerInfo[playerid][pCash] < garageInteriors[GarageInfo[garageid][gType] + 1][intPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to upgrade your garage."); } foreach(new i: Vehicle) { if(IsVehicleInGarage(i, garageid)) { return SendClientMessage(playerid, COLOR_GREY, "You must remove all vehicles from your garage before proceeding."); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT id FROM vehicles WHERE ownerid = %i AND interior > 0 AND world = %i", PlayerInfo[playerid][pID], GarageInfo[garageid][gWorld]); mysql_tquery(connectionID, queryBuffer, "OnPlayerUpgradeGarage", "ii", playerid, garageid); return 1; } CMD:sellgarage(playerid, params[]) { new garageid = GetNearbyGarageEx(playerid), targetid, amount; if(garageid == -1 || !IsGarageOwner(playerid, garageid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any garage of yours."); } if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellgarage [playerid] [amount]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell to yourself."); } if(amount < 1) { return SendClientMessage(playerid, COLOR_GREY, "You must specify an amount above zero."); } PlayerInfo[targetid][pGarageOffer] = playerid; PlayerInfo[targetid][pGarageOffered] = garageid; PlayerInfo[targetid][pGaragePrice] = amount; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered you their garage for %s (/accept garage).", GetPlayerRPName(playerid), FormatNumber(amount)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered %s to buy your garage for %s.", GetPlayerRPName(targetid), FormatNumber(amount)); return 1; } CMD:sellmygarage(playerid, params[]) { new garageid = GetNearbyGarageEx(playerid); if(garageid == -1 || !IsGarageOwner(playerid, garageid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any garage of yours."); } if(strcmp(params, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellmygarage [confirm]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "This command sells your garage back to the state. You will receive %s back.", FormatNumber(percent(GarageInfo[garageid][gPrice], 75))); return 1; } SetGarageOwner(garageid, INVALID_PLAYER_ID); GivePlayerCash(playerid, percent(GarageInfo[garageid][gPrice], 75)); SendClientMessageEx(playerid, COLOR_GREEN, "You have sold your garage to the state and received %s back.", FormatNumber(percent(GarageInfo[garageid][gPrice], 75))); Log_Write("log_property", "%s (uid: %i) sold their %s garage (id: %i) to the state for $%i", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], garageInteriors[GarageInfo[garageid][gType]][intName], GarageInfo[garageid][gID], percent(GarageInfo[garageid][gPrice], 75)); return 1; } CMD:garageinfo(playerid, params[]) { new garageid = GetNearbyGarageEx(playerid); if(garageid == -1 || !IsGarageOwner(playerid, garageid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any garage of yours."); } SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_______ Garage ID %i _______", garageid); SendClientMessageEx(playerid, COLOR_GREY2, "Value: %s - Size: %s - Location: %s - Active: %s - Locked: %s", FormatNumber(GarageInfo[garageid][gPrice]), garageInteriors[GarageInfo[garageid][gType]][intName], GetZoneName(GarageInfo[garageid][gPosX], GarageInfo[garageid][gPosY], GarageInfo[garageid][gPosZ]), (gettime() - GarageInfo[garageid][gTimestamp] > 2592000) ? ("{FF6347}No{C8C8C8}") : ("Yes"), (GarageInfo[garageid][gLocked]) ? ("Yes") : ("No")); return 1; } CMD:createbiz(playerid, params[]) { new type, Float:x, Float:y, Float:z, Float:a; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", type)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /createbiz [type]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: (1) 24/7 (2) Gun Shop (3) Clothes Shop (4) Gym (5) Restaurant (6) Ad Agency (7) Club/Bar (8) Tool Shop"); return 1; } if(!(1 <= type <= sizeof(bizInteriors))) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } if(GetNearbyBusiness(playerid) >= 0) { return SendClientMessage(playerid, COLOR_GREY, "There is a business in range. Find somewhere else to create this one."); } GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); type--; for(new i = 0; i < MAX_BUSINESSES; i ++) { if(!BusinessInfo[i][bExists]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO businesses (type, price, pos_x, pos_y, pos_z, pos_a, int_x, int_y, int_z, int_a, interior, outsideint, outsidevw) VALUES(%i, %i, '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f', %i, %i, %i)", type, bizInteriors[type][intPrice], x, y, z, a - 180.0, bizInteriors[type][intX], bizInteriors[type][intY], bizInteriors[type][intZ], bizInteriors[type][intA], bizInteriors[type][intID], GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid)); mysql_tquery(connectionID, queryBuffer, "OnAdminCreateBusiness", "iiiffff", playerid, i, type, x, y, z, a); return 1; } } SendClientMessage(playerid, COLOR_GREY, "Business slots are currently full. Ask developers to increase the internal limit."); return 1; } CMD:editbiz(playerid, params[]) { new businessid, option[14], param[32]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[14]S()[32]", businessid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editbiz [businessid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Entrance, Exit, Interior, World, Type, Owner, Price, EntryFee, Products, Materials, Locked"); return 1; } if(!(0 <= businessid < MAX_BUSINESSES) || !BusinessInfo[businessid][bExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid business."); } if(!strcmp(option, "entrance", true)) { GetPlayerPos(playerid, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ]); GetPlayerFacingAngle(playerid, BusinessInfo[businessid][bPosA]); BusinessInfo[businessid][bOutsideInt] = GetPlayerInterior(playerid); BusinessInfo[businessid][bOutsideVW] = GetPlayerVirtualWorld(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET pos_x = '%f', pos_y = '%f', pos_z = '%f', pos_a = '%f', outsideint = %i, outsidevw = %i WHERE id = %i", BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], BusinessInfo[businessid][bPosA], BusinessInfo[businessid][bOutsideInt], BusinessInfo[businessid][bOutsideVW], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the entrance of business %i.", businessid); } else if(!strcmp(option, "exit", true)) { new type = -1; for(new i = 0; i < sizeof(bizInteriors); i ++) { if(IsPlayerInRangeOfPoint(playerid, 100.0, bizInteriors[i][intX], bizInteriors[i][intY], bizInteriors[i][intZ])) { type = i; } } GetPlayerPos(playerid, BusinessInfo[businessid][bIntX], BusinessInfo[businessid][bIntY], BusinessInfo[businessid][bIntZ]); GetPlayerFacingAngle(playerid, BusinessInfo[businessid][bIntA]); BusinessInfo[businessid][bInterior] = GetPlayerInterior(playerid); BusinessInfo[businessid][bType] = type; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET type = %i, int_x = '%f', int_y = '%f', int_z = '%f', int_a = '%f', interior = %i WHERE id = %i", type, BusinessInfo[businessid][bIntX], BusinessInfo[businessid][bIntY], BusinessInfo[businessid][bIntZ], BusinessInfo[businessid][bIntA], BusinessInfo[businessid][bInterior], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the exit of business %i.", businessid); } else if(!strcmp(option, "interior", true)) { new string[1024]; for(new i = 0; i < sizeof(bizInteriorArray); i ++) { format(string, sizeof(string), "%s\n%s", string, bizInteriorArray[i][intName]); } PlayerInfo[playerid][pSelected] = businessid; ShowPlayerDialog(playerid, DIALOG_BIZINTERIOR, DIALOG_STYLE_LIST, "Choose an interior to set for this business.", string, "Select", "Cancel"); } else if(!strcmp(option, "world", true)) { new worldid; if(sscanf(param, "i", worldid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editbiz [businessid] [world] [vw]"); } BusinessInfo[businessid][bWorld] = worldid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET world = %i WHERE id = %i", BusinessInfo[businessid][bWorld], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the virtual world of business %i to %i.", businessid, worldid); } else if(!strcmp(option, "type", true)) { new type; if(sscanf(param, "i", type)) { SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editbiz [businessid] [type] [value (1-%i)]", sizeof(bizInteriors)); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: (1) 24/7 (2) Gun Shop (3) Clothes Shop (4) Gym (5) Restaurant (6) Ad Agency (7) Club/Bar (8) Tool Shop"); return 1; } if(!(1 <= type <= sizeof(bizInteriors))) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } BusinessInfo[businessid][bType] = type-1; BusinessInfo[businessid][bInterior] = bizInteriors[type][intID]; BusinessInfo[businessid][bIntX] = bizInteriors[type][intX]; BusinessInfo[businessid][bIntY] = bizInteriors[type][intY]; BusinessInfo[businessid][bIntZ] = bizInteriors[type][intZ]; BusinessInfo[businessid][bIntA] = bizInteriors[type][intA]; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET type = %i, int_x = '%f', int_y = '%f', int_z = '%f', int_a = '%f', interior = %i, world = %i WHERE id = %i", type-1, BusinessInfo[businessid][bIntX], BusinessInfo[businessid][bIntY], BusinessInfo[businessid][bIntZ], BusinessInfo[businessid][bIntA], BusinessInfo[businessid][bInterior], BusinessInfo[businessid][bWorld], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the type of business %i to %i.", businessid, type); } else if(!strcmp(option, "owner", true)) { new targetid; if(sscanf(param, "u", targetid)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editbiz [businessid] [owner] [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } SetBusinessOwner(businessid, targetid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the owner of business %i to %s.", businessid, GetPlayerRPName(targetid)); } else if(!strcmp(option, "price", true)) { new price; if(sscanf(param, "i", price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editbiz [businessid] [price] [value]"); } if(price < 0) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $0."); } BusinessInfo[businessid][bPrice] = price; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET price = %i WHERE id = %i", BusinessInfo[businessid][bPrice], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the price of business %i to $%i.", businessid, price); } else if(!strcmp(option, "entryfee", true)) { new price; if(sscanf(param, "i", price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editbiz [businessid] [entryfee] [value]"); } if(price < 0) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $0."); } BusinessInfo[businessid][bEntryFee] = price; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET entryfee = %i WHERE id = %i", BusinessInfo[businessid][bEntryFee], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the entry fee of business %i to $%i.", businessid, price); } else if(!strcmp(option, "products", true)) { new amount; if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editbiz [businessid] [products] [value]"); } BusinessInfo[businessid][bProducts] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET products = %i WHERE id = %i", BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the products amount of business %i to %i.", businessid, amount); } else if(!strcmp(option, "materials", true)) { new amount; if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editbiz [businessid] [materials] [value]"); } BusinessInfo[businessid][bMaterials] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET materials = %i WHERE id = %i", BusinessInfo[businessid][bMaterials], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the materials amount of business %i to %i.", businessid, amount); } else if(!strcmp(option, "locked", true)) { new locked; if(sscanf(param, "i", locked) || !(0 <= locked <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editbiz [businessid] [locked] [0/1]"); } BusinessInfo[businessid][bLocked] = locked; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET locked = %i WHERE id = %i", BusinessInfo[businessid][bLocked], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the lock state of business %i to %i.", businessid, locked); } return 1; } CMD:removebiz(playerid, params[]) { new businessid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", businessid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removebiz [businessid]"); } if(!(0 <= businessid < MAX_HOUSES) || !BusinessInfo[businessid][bExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid business."); } RemoveAllFurniture(businessid); DestroyDynamic3DTextLabel(BusinessInfo[businessid][bText]); DestroyDynamicPickup(BusinessInfo[businessid][bPickup]); DestroyDynamicMapIcon(BusinessInfo[businessid][bMapIcon]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM businesses WHERE id = %i", BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); BusinessInfo[businessid][bExists] = 0; BusinessInfo[businessid][bID] = 0; BusinessInfo[businessid][bOwnerID] = 0; Iter_Remove(Business, businessid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have removed business %i.", businessid); return 1; } CMD:gotobiz(playerid, params[]) { new businessid; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "i", businessid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gotobiz [businessid]"); } if(!(0 <= businessid < MAX_HOUSES) || !BusinessInfo[businessid][bExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid business."); } GameTextForPlayer(playerid, "~w~Teleported", 5000, 1); SetPlayerPos(playerid, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ]); SetPlayerFacingAngle(playerid, BusinessInfo[businessid][bPosA]); SetPlayerInterior(playerid, BusinessInfo[businessid][bOutsideInt]); SetPlayerVirtualWorld(playerid, BusinessInfo[businessid][bOutsideVW]); SetCameraBehindPlayer(playerid); return 1; } CMD:bizhelp(playerid, params[]) { SendClientMessage(playerid, COLOR_GREEN, "_______________________________________"); SendClientMessage(playerid, COLOR_WHITE, "*** BUSINESS HELP *** type a command for more information."); SendClientMessage(playerid, COLOR_GREY, "*** BUSINESS *** /buybiz /lock /bwithdraw /bdeposit /entryfee /sellbiz /sellmybiz /bizinfo"); SendClientMessage(playerid, COLOR_GREY, "*** BUSINESS *** /bdepositmats /bwithdrawmats"); return 1; } CMD:buybiz(playerid, params[]) { new businessid; if((businessid = GetNearbyBusiness(playerid)) == -1) { return SendClientMessage(playerid, COLOR_GREY, "There is no business in range. You must be near a business."); } if(strcmp(params, "confirm", true) != 0) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /buybiz [confirm]"); } if(BusinessInfo[businessid][bOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This business already has an owner."); } if(PlayerInfo[playerid][pCash] < BusinessInfo[businessid][bPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this business."); } if(GetPlayerAssetCount(playerid, LIMIT_BUSINESSES) >= GetPlayerAssetLimit(playerid, LIMIT_BUSINESSES)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently own %i/%i businesses. You can't own anymore unless you upgrade your asset perk.", GetPlayerAssetCount(playerid, LIMIT_BUSINESSES), GetPlayerAssetLimit(playerid, LIMIT_BUSINESSES)); } SetBusinessOwner(businessid, playerid); GivePlayerCash(playerid, -BusinessInfo[businessid][bPrice]); SendClientMessageEx(playerid, COLOR_GREEN, "You paid $%i for this %s. /bizhelp for a list of commands.", BusinessInfo[businessid][bPrice], bizInteriors[BusinessInfo[businessid][bType]][intType]); Log_Write("log_property", "%s (uid: %i) purchased %s (id: %i) for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], bizInteriors[BusinessInfo[businessid][bType]][intType], BusinessInfo[businessid][bID], BusinessInfo[businessid][bPrice]); return 1; } CMD:bwithdraw(playerid, params[]) { new businessid = GetInsideBusiness(playerid), amount; if(businessid == -1 || !IsBusinessOwner(playerid, businessid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any business of yours."); } if(sscanf(params, "i", amount)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /bwithdraw [amount] (%s available)", FormatNumber(BusinessInfo[businessid][bCash])); } if(amount < 1 || amount > BusinessInfo[businessid][bCash]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } BusinessInfo[businessid][bCash] -= amount; GivePlayerCash(playerid, amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have withdrawn %s from the business vault. There is now %s remaining.", FormatNumber(amount), FormatNumber(BusinessInfo[businessid][bCash])); return 1; } CMD:bdeposit(playerid, params[]) { new businessid = GetInsideBusiness(playerid), amount; if(businessid == -1 || !IsBusinessOwner(playerid, businessid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any business of yours."); } if(sscanf(params, "i", amount)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /bdeposit [amount] (%s available)", FormatNumber(BusinessInfo[businessid][bCash])); } if(amount < 1 || amount > PlayerInfo[playerid][pCash]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while on admin duty"); } BusinessInfo[businessid][bCash] += amount; GivePlayerCash(playerid, -amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have deposited %s in the business vault. There is now %s available.", FormatNumber(amount), FormatNumber(BusinessInfo[businessid][bCash])); return 1; } /*CMD:bwithdrawmats(playerid, params[]) { new businessid = GetInsideBusiness(playerid), amount; if(businessid == -1 || !IsBusinessOwner(playerid, businessid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any business of yours."); } if(BusinessInfo[businessid][bType] != BUSINESS_TOOLSHOP) { return SendClientMessage(playerid, COLOR_GREY, "This command can only be used in tool shops."); } if(sscanf(params, "i", amount)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /bwithdrawmats [amount] (%i available)", BusinessInfo[businessid][bMaterials]); } if(amount < 1 || amount > BusinessInfo[businessid][bMaterials]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pMaterials] + amount > GetPlayerCapacity(playerid, CAPACITY_MATERIALS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i materials. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMaterials], GetPlayerCapacity(playerid, CAPACITY_MATERIALS)); } BusinessInfo[businessid][bMaterials] -= amount; PlayerInfo[playerid][pMaterials] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET materials = %i WHERE id = %i", BusinessInfo[businessid][bMaterials], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have withdrawn %i materials from the business vault. There is now %i remaining.", amount, BusinessInfo[businessid][bMaterials]); return 1; } CMD:bdepositmats(playerid, params[]) { new businessid = GetInsideBusiness(playerid), amount; if(businessid == -1 || !IsBusinessOwner(playerid, businessid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any business of yours."); } if(BusinessInfo[businessid][bType] != BUSINESS_TOOLSHOP) { return SendClientMessage(playerid, COLOR_GREY, "This command can only be used in tool shops."); } if(sscanf(params, "i", amount)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /bdepositmats [amount] (%i available)", BusinessInfo[businessid][bMaterials]); } if(amount < 1 || amount > PlayerInfo[playerid][pMaterials]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } BusinessInfo[businessid][bMaterials] += amount; PlayerInfo[playerid][pMaterials] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET materials = %i WHERE id = %i", BusinessInfo[businessid][bMaterials], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have deposited %i materials in the business vault. There is now %i available.", amount, BusinessInfo[businessid][bMaterials]); return 1; }*/ CMD:sellbiz(playerid, params[]) { new businessid = GetNearbyBusinessEx(playerid), targetid, amount; if(businessid == -1 || !IsBusinessOwner(playerid, businessid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any business of yours."); } if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellbiz [playerid] [amount]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell to yourself."); } if(amount < 1) { return SendClientMessage(playerid, COLOR_GREY, "You must specify an amount above zero."); } PlayerInfo[targetid][pBizOffer] = playerid; PlayerInfo[targetid][pBizOffered] = businessid; PlayerInfo[targetid][pBizPrice] = amount; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered you their business for %s (/accept business).", GetPlayerRPName(playerid), FormatNumber(amount)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered %s to buy your business for %s.", GetPlayerRPName(targetid), FormatNumber(amount)); return 1; } CMD:sellmybiz(playerid, params[]) { new businessid = GetNearbyBusinessEx(playerid); if(businessid == -1 || !IsBusinessOwner(playerid, businessid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any business of yours."); } if(strcmp(params, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellmybiz [confirm]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "This command sells your business back to the state. You will receive %s back.", FormatNumber(percent(BusinessInfo[businessid][bPrice], 75))); return 1; } SetBusinessOwner(businessid, INVALID_PLAYER_ID); GivePlayerCash(playerid, percent(BusinessInfo[businessid][bPrice], 75)); SendClientMessageEx(playerid, COLOR_GREEN, "You have sold your business to the state and received %s back.", FormatNumber(percent(BusinessInfo[businessid][bPrice], 75))); Log_Write("log_property", "%s (uid: %i) sold their %s business (id: %i) to the state for %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], bizInteriors[BusinessInfo[businessid][bType]][intType], BusinessInfo[businessid][bID], percent(BusinessInfo[businessid][bPrice], 75)); return 1; } CMD:bizinfo(playerid, params[]) { new businessid = GetNearbyBusinessEx(playerid); if(businessid == -1 || !IsBusinessOwner(playerid, businessid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any business of yours."); } SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_______ Business ID %i _______", businessid); SendClientMessageEx(playerid, COLOR_GREY2, "Value: %s - Type: %s - Location: %s - Active: %s - Status: %s", FormatNumber(BusinessInfo[businessid][bPrice]), bizInteriors[BusinessInfo[businessid][bType]][intType], GetZoneName(BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ]), (gettime() - BusinessInfo[businessid][bTimestamp] > 2592000) ? ("{FF6347}No{C8C8C8}") : ("Yes"), (BusinessInfo[businessid][bLocked]) ? ("Closed") : ("Opened")); SendClientMessageEx(playerid, COLOR_GREY2, "Vault: %s - Entry Fee: %s - Products: %i - Materials: %i", FormatNumber(BusinessInfo[businessid][bCash]), FormatNumber(BusinessInfo[businessid][bEntryFee]), BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bMaterials]); return 1; } CMD:entryfee(playerid, params[]) { new businessid = GetNearbyBusinessEx(playerid), amount; if(businessid == -1 || !IsBusinessOwner(playerid, businessid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any business of yours."); } if(sscanf(params, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /entryfee [amount]"); } if(amount < 0 || amount > 5000) { return SendClientMessage(playerid, COLOR_GREY, "The entry fee can't be below $0 or above $5,000."); } BusinessInfo[businessid][bEntryFee] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET entryfee = %i WHERE id = %i", BusinessInfo[businessid][bEntryFee], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); ReloadBusiness(businessid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the entry fee to $%i.", amount); return 1; } CMD:buy(playerid, params[]) { new businessid = GetInsideBusiness(playerid), title[64]; if(businessid == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any business where you can buy stuff."); } if(BusinessInfo[businessid][bProducts] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "This business is out of stock."); } format(title, sizeof(title), "%s's %s [%i products]", BusinessInfo[businessid][bOwner], bizInteriors[BusinessInfo[businessid][bType]][intType], BusinessInfo[businessid][bProducts]); switch(BusinessInfo[businessid][bType]) { case BUSINESS_STORE: { ShowPlayerDialog(playerid, DIALOG_BUY, DIALOG_STYLE_LIST, title, "Mobile phone ($525)\nWalkie talkie ($5000)\nCigars ($125)\nMask ($400)\nPhonebook ($200)\nCamera ($200)\nMP3 player ($2400)\nFishing rod ($1000)\nFish bait ($790)\nMuriatic acid ($1500)\nBaking soda ($250)\nPocket watch ($1000)\nGPS system ($750)\nGasoline can ($500)\nRope ($175)\nSpraycans ($400)", "Select", "Cancel"); } case BUSINESS_Ammunation: { ShowPlayerDialog(playerid, DIALOG_BUY, DIALOG_STYLE_LIST, title, "9mm pistol ($1500)\nShotgun ($2000)\nRifle ($4000)\nLight armor ($1500)\nMedium Armor($2500)", "Select", "Cancel"); } case BUSINESS_CLOTHES: { ShowPlayerDialog(playerid, DIALOG_BUY, DIALOG_STYLE_LIST, title, "Clothes ($1000)\nGlasses ($500)\nBandanas & masks ($375)\nHats & caps ($240)\nMisc clothing ($500)", "Select", "Cancel"); } case BUSINESS_GYM: { ShowPlayerDialog(playerid, DIALOG_BUY, DIALOG_STYLE_LIST, title, "Normal (Free)\nBoxing ($3000)\nKung Fu ($3000)\nKneehead ($3000)\nGrabkick ($3000)\nElbow ($3000)", "Select", "Cancel"); } case BUSINESS_RESTAURANT: // 7 20 60 120 145 150 200 240 300 { ShowPlayerDialog(playerid, DIALOG_BUY, DIALOG_STYLE_LIST, title, "Water ($7)\nSprunk ($20)\nFrench fries ($60)\nHamburger ($120)\nCheeseburger ($145)\nMac & cheese ($150)\nClub sandwich ($200)\nFish & chips ($240)\nBig meal ($300)", "Select", "Cancel"); } case BUSINESS_BARCLUB: // 7 20 35 50 75 { ShowPlayerDialog(playerid, DIALOG_BUY, DIALOG_STYLE_LIST, title, "Water ($7)\nSprunk ($20)\nBeer ($35)\nWine ($50)\nWhiskey ($75)", "Select", "Cancel"); } case BUSINESS_TOOLSHOP: { ShowPlayerDialog(playerid, DIALOG_BUY, DIALOG_STYLE_LIST, title, "First Aid Kit ($1000)\nBody Repair Kit ($2000)\nPolice Scanner ($8000)\nRimkit ($4000)", "Select", "Cancel"); } } return 1; } CMD:advertise(playerid, params[]) { return callcmd::ad(playerid, params); } CMD:ad(playerid, params[]) { new businessid = GetInsideBusiness(playerid), price = strlen(params) * 25; if((PlayerInfo[playerid][pVIPPackage] == 0) && (businessid == -1 || BusinessInfo[businessid][bType] != 5)) { if(GetClosestBusiness(playerid, BUSINESS_AGENCY) == -1) { SendClientMessage(playerid, COLOR_GREY, "There are no advertisement agencies in town."); return 1; } businessid = GetClosestBusiness(playerid, BUSINESS_AGENCY); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /(ad)vertise [advertisement] ($25/char)"); } if(PlayerInfo[playerid][pAdMuted]) { return SendClientMessage(playerid, COLOR_GREY, "You are muted from submitting advertisements. /report for an unmute."); } if(!PlayerInfo[playerid][pPhone]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a mobile phone. You need a phone so people can contact you."); } if(PlayerInfo[playerid][pHours] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You need to play at least 2 hours in order to post an advertisement."); } if(gettime() - gLastAd < 30) { return SendClientMessage(playerid, COLOR_GREY, "Advertisements can only be posted every 30 seconds."); } if(PlayerInfo[playerid][pVIPPackage] < 3 && PlayerInfo[playerid][pCash] < price) { return SendClientMessageEx(playerid, COLOR_GREY, "You need %s in order to place the advertisement. You can't afford that.", FormatNumber(price)); } new string[20]; gLastAd = gettime(); if(PlayerInfo[playerid][pVIPPackage] == 3) { SendClientMessage(playerid, COLOR_VIP, "VIP Perk: Your advertisement was posted free of charge!"); } else { format(string, sizeof(string), "~r~-$%i", price); GameTextForPlayer(playerid, string, 5000, 1); GivePlayerCash(playerid, -price); if(businessid >= 0) { if(BusinessInfo[businessid][bProducts] > 0) { BusinessInfo[businessid][bCash] += (price/100) * 75; } BusinessInfo[businessid][bProducts]--; gNewsVault += (price/100)*5; SaveServerInfo(); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET cash = %i WHERE id = %i", BusinessInfo[businessid][bCash], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); } } SendClientMessageToAllEx((PlayerInfo[playerid][pVIPPackage] > 0) ? (COLOR_LIGHTORANGE) : (COLOR_DARKGREEN), "Advertisement: %s, Contact: %s, Ph: %i", params, GetPlayerRPName(playerid), PlayerInfo[playerid][pPhone]); return 1; } CMD:mark(playerid, params[]) { new slot; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", slot)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /mark [slot (1-3)]"); } if(!(1 <= slot <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid slot."); } slot--; GetPlayerPos(playerid, MarkedPositions[playerid][slot][mPosX], MarkedPositions[playerid][slot][mPosY], MarkedPositions[playerid][slot][mPosZ]); GetPlayerFacingAngle(playerid, MarkedPositions[playerid][slot][mPosA]); MarkedPositions[playerid][slot][mInterior] = GetPlayerInterior(playerid); MarkedPositions[playerid][slot][mWorld] = GetPlayerVirtualWorld(playerid); SendClientMessageEx(playerid, COLOR_AQUA, "** Position saved in slot %i.", slot + 1); return 1; } CMD:gotomark(playerid, params[]) { new slot; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", slot)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gotomark [slot (1-3)]"); } if(!(1 <= slot <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid slot."); } if(MarkedPositions[playerid][slot-1][mPosX] == 0.0 && MarkedPositions[playerid][slot-1][mPosY] == 0.0 && MarkedPositions[playerid][slot-1][mPosZ] == 0.0) { return SendClientMessage(playerid, COLOR_GREY, "There is no position in the slot selected."); } slot--; GameTextForPlayer(playerid, "~w~Teleported", 5000, 1); SetPlayerPos(playerid, MarkedPositions[playerid][slot][mPosX], MarkedPositions[playerid][slot][mPosY], MarkedPositions[playerid][slot][mPosZ]); SetPlayerFacingAngle(playerid, MarkedPositions[playerid][slot][mPosA]); SetPlayerInterior(playerid, MarkedPositions[playerid][slot][mInterior]); SetPlayerVirtualWorld(playerid, MarkedPositions[playerid][slot][mWorld]); SetCameraBehindPlayer(playerid); return 1; } CMD:createentrance(playerid, params[]) { new name[40], Float:x, Float:y, Float:z, Float:a; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[40]", name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /createentrance [name]"); } if(GetNearbyEntrance(playerid) >= 0) { return SendClientMessage(playerid, COLOR_GREY, "There is an entrance in range. Find somewhere else to create this one."); } GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); for(new i = 0; i < MAX_ENTRANCES; i ++) { if(!EntranceInfo[i][eExists]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO entrances (name, pos_x, pos_y, pos_z, pos_a, outsideint, outsidevw) VALUES('%e', '%f', '%f', '%f', '%f', %i, %i)", name, x, y, z, a - 180.0, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid)); mysql_tquery(connectionID, queryBuffer, "OnAdminCreateEntrance", "iisffff", playerid, i, name, x, y, z, a); return 1; } } SendClientMessage(playerid, COLOR_GREY, "Entrance slots are currently full. Ask developers to increase the internal limit."); return 1; } CMD:editentrance(playerid, params[]) { new entranceid, option[14], param[64]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[14]S()[64]", entranceid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Entrance, Exit, Name, Icon, World, Owner, Locked, Radius, AdminLevel"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Faction, Gang, VIP, Vehicles, Freeze, Label, Password, Type, MapIcon, Color"); return 1; } if(!(0 <= entranceid < MAX_ENTRANCES) || !EntranceInfo[entranceid][eExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid entrance."); } if(!strcmp(option, "entrance", true)) { GetPlayerPos(playerid, EntranceInfo[entranceid][ePosX], EntranceInfo[entranceid][ePosY], EntranceInfo[entranceid][ePosZ]); GetPlayerFacingAngle(playerid, EntranceInfo[entranceid][ePosA]); EntranceInfo[entranceid][eOutsideInt] = GetPlayerInterior(playerid); EntranceInfo[entranceid][eOutsideVW] = GetPlayerVirtualWorld(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET pos_x = '%f', pos_y = '%f', pos_z = '%f', pos_a = '%f', outsideint = %i, outsidevw = %i WHERE id = %i", EntranceInfo[entranceid][ePosX], EntranceInfo[entranceid][ePosY], EntranceInfo[entranceid][ePosZ], EntranceInfo[entranceid][ePosA], EntranceInfo[entranceid][eOutsideInt], EntranceInfo[entranceid][eOutsideVW], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the entrance of entrance %i.", entranceid); } else if(!strcmp(option, "exit", true)) { GetPlayerPos(playerid, EntranceInfo[entranceid][eIntX], EntranceInfo[entranceid][eIntY], EntranceInfo[entranceid][eIntZ]); GetPlayerFacingAngle(playerid, EntranceInfo[entranceid][eIntA]); EntranceInfo[entranceid][eInterior] = GetPlayerInterior(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET int_x = '%f', int_y = '%f', int_z = '%f', int_a = '%f', interior = %i WHERE id = %i", EntranceInfo[entranceid][eIntX], EntranceInfo[entranceid][eIntY], EntranceInfo[entranceid][eIntZ], EntranceInfo[entranceid][eIntA], EntranceInfo[entranceid][eInterior], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the exit of entrance %i.", entranceid); } else if(!strcmp(option, "name", true)) { new name[32]; if(sscanf(param, "s[32]", name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [name] [text]"); } strcpy(EntranceInfo[entranceid][eName], name, 32); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET name = '%e' WHERE id = %i", EntranceInfo[entranceid][eName], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the name of entrance %i to '%s'.", entranceid, name); } else if(!strcmp(option, "icon", true)) { new iconid; if(sscanf(param, "i", iconid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [icon] [iconid (19300 = hide)]"); } if(!IsValidModel(iconid)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid model ID."); } EntranceInfo[entranceid][eIcon] = iconid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET iconid = %i WHERE id = %i", EntranceInfo[entranceid][eIcon], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the pickup icon model of entrance %i to %i.", entranceid, iconid); } else if(!strcmp(option, "world", true)) { new worldid; if(sscanf(param, "i", worldid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [world] [vw]"); } EntranceInfo[entranceid][eWorld] = worldid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET world = %i WHERE id = %i", EntranceInfo[entranceid][eWorld], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the virtual world of entrance %i to %i.", entranceid, worldid); } else if(!strcmp(option, "owner", true)) { new targetid; if(!isnull(param) && !strcmp(param, "none", true)) { SetEntranceOwner(entranceid, INVALID_PLAYER_ID); return SendClientMessageEx(playerid, COLOR_AQUA, "** You've reset the owner of entrance %i.", entranceid); } if(sscanf(param, "u", targetid)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [owner] [playerid/none]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } SetEntranceOwner(entranceid, targetid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the owner of entrance %i to %s.", entranceid, GetPlayerRPName(targetid)); } else if(!strcmp(option, "locked", true)) { new locked; if(sscanf(param, "i", locked) || !(0 <= locked <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [locked] [0/1]"); } EntranceInfo[entranceid][eLocked] = locked; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET locked = %i WHERE id = %i", EntranceInfo[entranceid][eLocked], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the lock state of entrance %i to %i.", entranceid, locked); } else if(!strcmp(option, "radius", true)) { new Float:radius; if(sscanf(param, "f", radius)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [radius] [range]"); } if(!(1.0 <= radius <= 20.0)) { return SendClientMessage(playerid, COLOR_GREY, "The entry radius must range between 1.0 and 20.0."); } EntranceInfo[entranceid][eRadius] = radius; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET radius = '%f' WHERE id = %i", EntranceInfo[entranceid][eRadius], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the entry radius of entrance %i to %.1f.", entranceid, radius); } else if(!strcmp(option, "adminlevel", true)) { new level; if(sscanf(param, "i", level)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [adminlevel] [level]"); } if(!(0 <= level <= 7)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid level. Valid levels range from 0 to 7."); } EntranceInfo[entranceid][eAdminLevel] = level; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET adminlevel = %i WHERE id = %i", EntranceInfo[entranceid][eAdminLevel], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the admin level of entrance %i to %i.", entranceid, level); } else if(!strcmp(option, "faction", true)) { new type; if(sscanf(param, "i", type)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [faction] [type]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (0) None (1) Police (2) Medic (3) News (4) Government (5) Hitman (6) Federal"); return 1; } if(!(0 <= type <= 6)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } EntranceInfo[entranceid][eFactionType] = type; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET factiontype = %i WHERE id = %i", EntranceInfo[entranceid][eFactionType], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); if(type == FACTION_NONE) SendClientMessageEx(playerid, COLOR_AQUA, "** You've reset the faction type of entrance %i.", entranceid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the faction type of entrance %i to %s (%i).", entranceid, factionTypes[type], type); } else if(!strcmp(option, "gang", true)) { new gangid; if(sscanf(param, "i", gangid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [gang] [gangid]"); } if(!(-1 <= gangid < MAX_GANGS) || (gangid >= 0 && !GangInfo[gangid][gSetup])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid gang."); } EntranceInfo[entranceid][eGang] = gangid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET gang = %i WHERE id = %i", EntranceInfo[entranceid][eGang], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); if(gangid == -1) SendClientMessageEx(playerid, COLOR_AQUA, "** You've reset the gang of entrance %i.", entranceid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the gang of entrance %i to %s (%i).", entranceid, GangInfo[gangid][gName], gangid); } else if(!strcmp(option, "vip", true)) { new rankid; if(sscanf(param, "i", rankid)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [vip] [rankid]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of ranks: (0) None (1) Limited (2) Gold (3) Legendary"); return 1; } if(!(0 <= rankid <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid VIP rank."); } EntranceInfo[entranceid][eVIP] = rankid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET vip = %i WHERE id = %i", EntranceInfo[entranceid][eVIP], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the VIP rank of entrance %i to {D909D9}%s{33CCFF} (%i).", entranceid, GetVIPRank(rankid), rankid); } else if(!strcmp(option, "vehicles", true)) { new status; if(sscanf(param, "i", status) || !(0 <= status <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [vehicles] [0/1]"); } EntranceInfo[entranceid][eVehicles] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET vehicles = %i WHERE id = %i", EntranceInfo[entranceid][eVehicles], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); if(status) SendClientMessageEx(playerid, COLOR_AQUA, "** You've allowed vehicle entry for entrance %i.", entranceid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You've disallowed vehicle entry for entrance %i.", entranceid); } else if(!strcmp(option, "freeze", true)) { new status; if(sscanf(param, "i", status) || !(0 <= status <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [freeze] [0/1]"); } EntranceInfo[entranceid][eFreeze] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET freeze = %i WHERE id = %i", EntranceInfo[entranceid][eFreeze], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); if(status) SendClientMessageEx(playerid, COLOR_AQUA, "** You've enabled freeze & object loading for entrance %i.", entranceid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You've disabled freeze & object loading for entrance %i.", entranceid); } else if(!strcmp(option, "label", true)) { new status; if(sscanf(param, "i", status) || !(0 <= status <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [label] [0/1]"); } EntranceInfo[entranceid][eLabel] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET label = %i WHERE id = %i", EntranceInfo[entranceid][eLabel], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); if(status) SendClientMessageEx(playerid, COLOR_AQUA, "** You've enabled the 3D text label for entrance %i.", entranceid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You've disabled the 3D text label for entrance %i.", entranceid); } else if(!strcmp(option, "password", true)) { if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [password] [text ('none' to reset)]"); } strcpy(EntranceInfo[entranceid][ePassword], param, 64); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET password = '%e' WHERE id = %i", EntranceInfo[entranceid][ePassword], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the password of entrance %i to '%s'.", entranceid, param); } else if(!strcmp(option, "type", true)) { new type; if(sscanf(param, "i", type)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [type] [type id]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (0) None (1) Duel Arena (2) Repair"); return 1; } if(!(0 <= type <= 2)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } EntranceInfo[entranceid][eType] = type; if(type == 1) { EntranceInfo[entranceid][eIntX] = 1419.6472; EntranceInfo[entranceid][eIntY] = 4.0132; EntranceInfo[entranceid][eIntZ] = 1002.3906; EntranceInfo[entranceid][eIntA] = 90.0000; EntranceInfo[entranceid][eInterior] = 1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET int_x = '%f', int_y = '%f', int_z = '%f', int_a = '%f', interior = %i, type = %i WHERE id = %i", EntranceInfo[entranceid][eIntX], EntranceInfo[entranceid][eIntY], EntranceInfo[entranceid][eIntZ], EntranceInfo[entranceid][eIntA], EntranceInfo[entranceid][eInterior], EntranceInfo[entranceid][eType], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET type = %i WHERE id = %i", EntranceInfo[entranceid][eType], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); } ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've set the special type for entrance %i to %i.", entranceid, type); } else if(!strcmp(option, "mapicon", true)) { new type; if(sscanf(param, "i", type)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [mapicon] [type (0-63)]"); } if(!(0 <= type <= 63)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid map icon."); } EntranceInfo[entranceid][eMapIcon] = type; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET mapicon = %i WHERE id = %i", EntranceInfo[entranceid][eMapIcon], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the map icon of entrance %i to %i.", entranceid, type); } else if(!strcmp(option, "color", true)) { new color; if(sscanf(param, "h", color)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editentrance [entranceid] [color] [0xRRGGBBAA]"); } EntranceInfo[entranceid][eColor] = (color & ~0xFF) | 0xFF; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE entrances SET color = %i WHERE id = %i", EntranceInfo[entranceid][eColor], EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); ReloadEntrance(entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have set the {%06x}color{33CCFF} of entrance ID %i.", color >>> 8, entranceid); } return 1; } CMD:removeentrance(playerid, params[]) { new entranceid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", entranceid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removeentrance [entranceid]"); } if(!(0 <= entranceid < MAX_ENTRANCES) || !EntranceInfo[entranceid][eExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid entrance."); } DestroyDynamic3DTextLabel(EntranceInfo[entranceid][eText]); DestroyDynamicPickup(EntranceInfo[entranceid][ePickup]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM entrances WHERE id = %i", EntranceInfo[entranceid][eID]); mysql_tquery(connectionID, queryBuffer); EntranceInfo[entranceid][eExists] = 0; EntranceInfo[entranceid][eID] = 0; EntranceInfo[entranceid][eOwnerID] = 0; Iter_Remove(Entrance, entranceid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have removed entrance %i.", entranceid); return 1; } CMD:gotoentrance(playerid, params[]) { new entranceid; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "i", entranceid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gotoentrance [entranceid]"); } if(!(0 <= entranceid < MAX_ENTRANCES) || !EntranceInfo[entranceid][eExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid entrance."); } GameTextForPlayer(playerid, "~w~Teleported", 5000, 1); SetPlayerPos(playerid, EntranceInfo[entranceid][ePosX], EntranceInfo[entranceid][ePosY], EntranceInfo[entranceid][ePosZ]); SetPlayerFacingAngle(playerid, EntranceInfo[entranceid][ePosA]); SetPlayerInterior(playerid, EntranceInfo[entranceid][eOutsideInt]); SetPlayerVirtualWorld(playerid, EntranceInfo[entranceid][eOutsideVW]); SetCameraBehindPlayer(playerid); return 1; } CMD:join(playerid, params[]) { for(new i = 0; i < sizeof(jobLocations); i ++) { if(IsPlayerInRangeOfPoint(playerid, 3.0, jobLocations[i][jobX], jobLocations[i][jobY], jobLocations[i][jobZ])) { if(PlayerInfo[playerid][pJob] != JOB_NONE) { if(PlayerInfo[playerid][pVIPPackage] >= 2) { if(PlayerInfo[playerid][pSecondJob] != JOB_NONE) { return SendClientMessage(playerid, COLOR_GREY, "You have two jobs already. Please quit one of them before getting another one."); } if(PlayerInfo[playerid][pJob] == i) { return SendClientMessage(playerid, COLOR_GREY, "You have this job already."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET secondjob = %i WHERE uid = %i", i, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[playerid][pSecondJob] = i; SendClientMessageEx(playerid, COLOR_AQUA, "You are now a {FF6347}%s{33CCFF}. Use /jobhelp for a list of commands related to your new job.", jobLocations[i][jobName]); } else { SendClientMessage(playerid, COLOR_GREY, "You have a job already. Please quit your current job before getting another one."); } return 1; } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET job = %i WHERE uid = %i", i, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[playerid][pJob] = i; SendClientMessageEx(playerid, COLOR_AQUA, "You are now a {FF6347}%s{33CCFF}. Use /jobhelp for a list of commands related to your new job.", jobLocations[i][jobName]); return 1; } } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any job icon."); return 1; } CMD:quitjob(playerid, params[]) { new slot; if(PlayerInfo[playerid][pVIPPackage] >= 2 && sscanf(params, "i", slot)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /quitjob [1/2]"); } if((PlayerInfo[playerid][pVIPPackage] < 2) || (PlayerInfo[playerid][pVIPPackage] >= 2 && slot == 1)) { if(PlayerInfo[playerid][pJob] == JOB_NONE) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a job which you can quit."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET job = -1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have quit your job as a {00AA00}%s{33CCFF}.", GetJobName(PlayerInfo[playerid][pJob])); PlayerInfo[playerid][pJob] = JOB_NONE; } else if(slot == 2 && PlayerInfo[playerid][pVIPPackage] >= 2) { if(PlayerInfo[playerid][pSecondJob] == JOB_NONE) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a job in this slot which you can quit."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET secondjob = -1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have quit your secondary job as a {00AA00}%s{33CCFF}.", GetJobName(PlayerInfo[playerid][pSecondJob])); PlayerInfo[playerid][pSecondJob] = JOB_NONE; } return 1; } CMD:getpizza(playerid, params[]) { new houseid; if(!PlayerHasJob(playerid, JOB_PIZZAMAN)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you are not a Pizzaman."); } if(PlayerInfo[playerid][pPizzaCooldown] > 0) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to wait %i more seconds before you can load another pizza.", PlayerInfo[playerid][pPizzaCooldown]); } if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 448) { return SendClientMessage(playerid, COLOR_GREY, "You need to be driving a pizza bike."); } /*if(PlayerInfo[playerid][pPizzas] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You have pizzas already. Deliver them first."); }*/ if(!IsPlayerInRangeOfPoint(playerid, 8.0, -45.3334,1189.8395,19.3594)) { return SendClientMessage(playerid, COLOR_GREY, "You must be closer to the job icon at the pizza stacks."); } if((houseid = GetRandomHouse(playerid)) == -1) { return SendClientMessage(playerid, COLOR_GREY, "There are no houses in the server to deliver pizza to. Ask an admin to set them up."); } PlayerInfo[playerid][pDistance] = GetPlayerDistanceFromPoint(playerid, HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ]); PlayerInfo[playerid][pPizzas] = 1; PlayerInfo[playerid][pLastPizza] = gettime(); PlayerInfo[playerid][pPizzaTime] = 0; PlayerInfo[playerid][pPizzaCooldown] = 60; SetPlayerCheckpoint(playerid, HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ], 2.0); PlayerInfo[playerid][pCP] = CHECKPOINT_PIZZA; GameTextForPlayer(playerid, "~w~Deliver to ~r~marker", 5000, 1); SendClientMessageEx(playerid, COLOR_AQUA, "** You loaded your bike with a hot and ready pizza. Deliver it to %s.", GetZoneName(HouseInfo[houseid][hPosX], HouseInfo[houseid][hPosY], HouseInfo[houseid][hPosZ])); return 1; } CMD:load(playerid, params[]) { if(!PlayerHasJob(playerid, JOB_COURIER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you are not a Courier."); } if(PlayerInfo[playerid][pCourierCooldown] > 0) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to wait %i more seconds before you can load another delivery.", PlayerInfo[playerid][pCourierCooldown]); } if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 414 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 498 && GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You need to be driving a Mule or a Boxville."); } if(!IsPlayerInRangeOfPoint(playerid, 8.0, 572.9066,1215.9198,11.9283)) { return SendClientMessage(playerid, COLOR_GREY, "You are not at the loading dock."); } if(PlayerInfo[playerid][pShipment] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "You have a shipment loaded already. You need to deliver it first."); } ShowPlayerDialog(playerid, DIALOG_PICKLOAD, DIALOG_STYLE_LIST, "Choose the load you want to deliver.", "Grocery supplies\nAmmunition\nClothing items\nFood & drinks\nBeverages\nTools & equipment", "Select", "Cancel"); return 1; } CMD:deliver(playerid, params[]) { new businessid, products, amount; if(!PlayerHasJob(playerid, JOB_COURIER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you are not a Courier."); } if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 414 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 498 && GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You need to be driving a Mule or a Boxville."); } if(PlayerInfo[playerid][pShipment] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You have no shipment loaded which you can deliver."); } if((businessid = GetNearbyBusiness(playerid, 7.0)) == -1 || BusinessInfo[businessid][bType] != PlayerInfo[playerid][pShipment]) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of a business which accepts this type of load."); } if(gettime() - PlayerInfo[playerid][pLastLoad] < 20 && PlayerInfo[playerid][pAdmin] < 2 && !PlayerInfo[playerid][pKicked]) { PlayerInfo[playerid][pACWarns]++; if(PlayerInfo[playerid][pACWarns] < MAX_ANTICHEAT_WARNINGS) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] is possibly teleport delivering (time: %i).", GetPlayerRPName(playerid), playerid, gettime() - PlayerInfo[playerid][pLastLoad]); } else { SendClientMessageToAllEx(COLOR_LIGHTRED, "AdmCmd: %s was autobanned by %s, reason: Teleport delivering", GetPlayerRPName(playerid), SERVER_ANTICHEAT); BanPlayer(playerid, SERVER_ANTICHEAT, "Teleport delivering"); } } products = (GetJobLevel(playerid, JOB_COURIER) * 5) + 5; if(PlayerInfo[playerid][pShipment] == BUSINESS_STORE) { amount = (GetJobLevel(playerid, JOB_COURIER) * 100) + 200; // 470 >> 200 } else if(PlayerInfo[playerid][pShipment] == BUSINESS_Ammunation) { amount = (GetJobLevel(playerid, JOB_COURIER) * 100) + 230; // 525 >> 230 } else if(PlayerInfo[playerid][pShipment] == BUSINESS_CLOTHES) { amount = (GetJobLevel(playerid, JOB_COURIER) * 100) + 260; // 545 >> 260 } else if(PlayerInfo[playerid][pShipment] == BUSINESS_RESTAURANT) { amount = (GetJobLevel(playerid, JOB_COURIER) * 100) + 220; // 490 >> 220 } else if(PlayerInfo[playerid][pShipment] == BUSINESS_BARCLUB) { amount = (GetJobLevel(playerid, JOB_COURIER) * 100) + 175; // 440 >> 190 } else if(PlayerInfo[playerid][pShipment] == BUSINESS_TOOLSHOP) { amount = (GetJobLevel(playerid, JOB_COURIER) * 100) + 295; // 560 >> 295 } amount += floatround(GetPlayerDistanceFromPoint(playerid, 572.9066,1215.9198,11.9283) / 4.0); if(PlayerInfo[playerid][pLaborUpgrade] > 0) { amount += percent(amount, PlayerInfo[playerid][pLaborUpgrade]); } SendClientMessageEx(playerid, COLOR_AQUA, "** You have earned {00AA00}$%i{33CCFF} on your paycheck for delivering %i products.", amount, products); AddToPaycheck(playerid, amount); BusinessInfo[businessid][bProducts] += products; PlayerInfo[playerid][pShipment] = -1; PlayerInfo[playerid][pCourierCooldown] = 120; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET products = %i WHERE id = %i", BusinessInfo[businessid][bProducts], BusinessInfo[businessid][bID]); mysql_tquery(connectionID, queryBuffer); IncreaseJobSkill(playerid, JOB_COURIER); return 1; } CMD:skill(playerid, params[]) { if(isnull(params)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /skill [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Courier, Fishing, Bodyguard, WeaponDealer, Mechanic, DrugSmuggler, Lawyer, Detective, Thief"); return 1; } if(!strcmp(params, "courier", true)) { SendClientMessageEx(playerid, COLOR_GREEN, "Your courier skill level is %i/5.", GetJobLevel(playerid, JOB_COURIER)); if(GetJobLevel(playerid, JOB_COURIER) < 5) { if(PlayerInfo[playerid][pCourierSkill] < 50) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to deliver %i more shipments in order to level up.", 50 - PlayerInfo[playerid][pCourierSkill]); } else if(PlayerInfo[playerid][pCourierSkill] < 100) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to deliver %i more shipments in order to level up.", 100 - PlayerInfo[playerid][pCourierSkill]); } else if(PlayerInfo[playerid][pCourierSkill] < 200) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to deliver %i more shipments in order to level up.", 200 - PlayerInfo[playerid][pCourierSkill]); } else if(PlayerInfo[playerid][pCourierSkill] < 350) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to deliver %i more shipments in order to level up.", 350 - PlayerInfo[playerid][pCourierSkill]); } } else { SendClientMessage(playerid, COLOR_GREEN, "You have reached the maximum skill level for this job."); } } else if(!strcmp(params, "fishing", true)) { SendClientMessageEx(playerid, COLOR_GREEN, "Your fishing skill level is %i/5.", GetJobLevel(playerid, JOB_FISHERMAN)); if(GetJobLevel(playerid, JOB_FISHERMAN) < 5) { if(PlayerInfo[playerid][pFishingSkill] < 50) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to catch %i more fish in order to level up.", 50 - PlayerInfo[playerid][pFishingSkill]); } else if(PlayerInfo[playerid][pFishingSkill] < 100) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to catch %i more fish in order to level up.", 100 - PlayerInfo[playerid][pFishingSkill]); } else if(PlayerInfo[playerid][pFishingSkill] < 200) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to catch %i more fish in order to level up.", 200 - PlayerInfo[playerid][pFishingSkill]); } else if(PlayerInfo[playerid][pFishingSkill] < 350) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to catch %i more fish in order to level up.", 350 - PlayerInfo[playerid][pFishingSkill]); } } else { SendClientMessage(playerid, COLOR_GREEN, "You have reached the maximum skill level for this job."); } } else if(!strcmp(params, "bodyguard", true)) { SendClientMessageEx(playerid, COLOR_GREEN, "Your bodyguard skill level is %i/5.", GetJobLevel(playerid, JOB_BODYGUARD)); if(GetJobLevel(playerid, JOB_BODYGUARD) < 5) { if(PlayerInfo[playerid][pGuardSkill] < 25) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to sell %i more vests in order to level up.", 25 - PlayerInfo[playerid][pGuardSkill]); } else if(PlayerInfo[playerid][pGuardSkill] < 50) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to sell %i more vests in order to level up.", 50 - PlayerInfo[playerid][pGuardSkill]); } else if(PlayerInfo[playerid][pGuardSkill] < 100) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to sell %i more vests in order to level up.", 100 - PlayerInfo[playerid][pGuardSkill]); } else if(PlayerInfo[playerid][pGuardSkill] < 200) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to sell %i more vests in order to level up.", 200 - PlayerInfo[playerid][pGuardSkill]); } } else { SendClientMessage(playerid, COLOR_GREEN, "You have reached the maximum skill level for this job."); } } else if(!strcmp(params, "weapondealer", true)) { SendClientMessageEx(playerid, COLOR_GREEN, "Your weapons dealer skill level is %i/5.", GetJobLevel(playerid, JOB_WEAPONDEALER)); if(GetJobLevel(playerid, JOB_WEAPONDEALER) < 5) { if(PlayerInfo[playerid][pWeaponSkill] < 50) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to sell %i more weapons in order to level up.", 50 - PlayerInfo[playerid][pWeaponSkill]); } else if(PlayerInfo[playerid][pWeaponSkill] < 100) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to sell %i more weapons in order to level up.", 100 - PlayerInfo[playerid][pWeaponSkill]); } else if(PlayerInfo[playerid][pWeaponSkill] < 200) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to sell %i more weapons in order to level up.", 200 - PlayerInfo[playerid][pWeaponSkill]); } else if(PlayerInfo[playerid][pWeaponSkill] < 500) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to sell %i more weapons in order to level up.", 500 - PlayerInfo[playerid][pWeaponSkill]); } } else { SendClientMessage(playerid, COLOR_GREEN, "You have reached the maximum skill level for this job."); } } else if(!strcmp(params, "mechanic", true)) { SendClientMessageEx(playerid, COLOR_GREEN, "Your mechanic skill level is %i/5.", GetJobLevel(playerid, JOB_MECHANIC)); if(GetJobLevel(playerid, JOB_MECHANIC) < 5) { if(PlayerInfo[playerid][pMechanicSkill] < 25) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to fix & refuel %i more vehicles in order to level up.", 25 - PlayerInfo[playerid][pMechanicSkill]); } else if(PlayerInfo[playerid][pMechanicSkill] < 50) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to fix & refuel %i more vehicles in order to level up.", 50 - PlayerInfo[playerid][pMechanicSkill]); } else if(PlayerInfo[playerid][pMechanicSkill] < 100) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to fix & refuel %i more vehicles in order to level up.", 100 - PlayerInfo[playerid][pMechanicSkill]); } else if(PlayerInfo[playerid][pMechanicSkill] < 200) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to fix & refuel %i more vehicles in order to level up.", 200 - PlayerInfo[playerid][pMechanicSkill]); } } else { SendClientMessage(playerid, COLOR_GREEN, "You have reached the maximum skill level for this job."); } } else if(!strcmp(params, "drugsmuggler", true)) { SendClientMessageEx(playerid, COLOR_GREEN, "Your drug smuggler skill level is %i/5.", GetJobLevel(playerid, JOB_DRUGDEALER)); if(GetJobLevel(playerid, JOB_DRUGDEALER) < 5) { if(PlayerInfo[playerid][pSmugglerSkill] < 25) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to smuggle %i more packages in order to level up.", 25 - PlayerInfo[playerid][pSmugglerSkill]); } else if(PlayerInfo[playerid][pSmugglerSkill] < 50) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to smuggle %i more packages in order to level up.", 50 - PlayerInfo[playerid][pSmugglerSkill]); } else if(PlayerInfo[playerid][pSmugglerSkill] < 75) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to smuggle %i more packages in order to level up.", 75 - PlayerInfo[playerid][pSmugglerSkill]); } else if(PlayerInfo[playerid][pSmugglerSkill] < 100) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to smuggle %i more packages in order to level up.", 100 - PlayerInfo[playerid][pSmugglerSkill]); } } else { SendClientMessage(playerid, COLOR_GREEN, "You have reached the maximum skill level for this job."); } } else if(!strcmp(params, "lawyer", true)) { SendClientMessageEx(playerid, COLOR_GREEN, "Your lawyer skill level is %i/5.", GetJobLevel(playerid, JOB_LAWYER)); if(GetJobLevel(playerid, JOB_LAWYER) < 5) { if(PlayerInfo[playerid][pLawyerSkill] < 25) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to defend %i more clients in order to level up.", 25 - PlayerInfo[playerid][pLawyerSkill]); } else if(PlayerInfo[playerid][pLawyerSkill] < 50) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to defend %i more clients in order to level up.", 50 - PlayerInfo[playerid][pLawyerSkill]); } else if(PlayerInfo[playerid][pLawyerSkill] < 100) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to defend %i more clients in order to level up.", 100 - PlayerInfo[playerid][pLawyerSkill]); } else if(PlayerInfo[playerid][pLawyerSkill] < 200) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to defend %i more clients in order to level up.", 200 - PlayerInfo[playerid][pLawyerSkill]); } } else { SendClientMessage(playerid, COLOR_GREEN, "You have reached the maximum skill level for this job."); } } else if(!strcmp(params, "detective", true)) { SendClientMessageEx(playerid, COLOR_GREEN, "Your detective skill level is %i/5.", GetJobLevel(playerid, JOB_DETECTIVE)); if(GetJobLevel(playerid, JOB_DETECTIVE) < 5) { if(PlayerInfo[playerid][pDetectiveSkill] < 50) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to find %i more people in order to level up.", 50 - PlayerInfo[playerid][pDetectiveSkill]); } else if(PlayerInfo[playerid][pDetectiveSkill] < 100) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to find %i more people in order to level up.", 100 - PlayerInfo[playerid][pDetectiveSkill]); } else if(PlayerInfo[playerid][pDetectiveSkill] < 200) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to find %i more people in order to level up.", 200 - PlayerInfo[playerid][pDetectiveSkill]); } else if(PlayerInfo[playerid][pDetectiveSkill] < 400) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to find %i more people in order to level up.", 400 - PlayerInfo[playerid][pDetectiveSkill]); } } else { SendClientMessage(playerid, COLOR_GREEN, "You have reached the maximum skill level for this job."); } } else if(!strcmp(params, "thief", true)) { SendClientMessageEx(playerid, COLOR_GREEN, "Your thief skill level is %i/5.", GetJobLevel(playerid, JOB_THIEF)); if(GetJobLevel(playerid, JOB_THIEF) < 5) { if(PlayerInfo[playerid][pThiefSkill] < 50) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to drop off or crack into %i more cars in order to level up.", 50 - PlayerInfo[playerid][pThiefSkill]); } else if(PlayerInfo[playerid][pThiefSkill] < 100) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to drop off or crack into %i more cars in order to level up.", 100 - PlayerInfo[playerid][pThiefSkill]); } else if(PlayerInfo[playerid][pThiefSkill] < 200) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to drop off or crack into %i more cars in order to level up.", 200 - PlayerInfo[playerid][pThiefSkill]); } else if(PlayerInfo[playerid][pThiefSkill] < 500) { SendClientMessageEx(playerid, COLOR_GREEN, "You need to drop off or crack into %i more cars in order to level up.", 500 - PlayerInfo[playerid][pThiefSkill]); } } else { SendClientMessage(playerid, COLOR_GREEN, "You have reached the maximum skill level for this job."); } } else { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /skill [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Courier, Fishing, Bodyguard, WeaponDealer, Mechanic, DrugSmuggler, Lawyer, Detective, Thief"); } return 1; } CMD:fish(playerid, params[]) { if(!PlayerHasJob(playerid, JOB_FISHERMAN)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Fisherman."); } if(!PlayerInfo[playerid][pFishingRod]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a fishing rod. You need a fishing rod to fish!"); } if(PlayerInfo[playerid][pFishTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are fishing already. Wait for your line to be reeled in first."); } if(PlayerInfo[playerid][pFishWeight] >= 1500) { return SendClientMessage(playerid, COLOR_GREY, "You have too much fish and can't fish any longer."); } if(IsABoat(GetPlayerVehicleID(playerid))) { //return SendClientMessage(playerid, COLOR_GREY, "You are not close to anywhere where you can fish."); } else if(!IsPlayerAtFishingPlace(playerid) && GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) { return SendClientMessage(playerid, COLOR_GREY, "You must be onfoot in order to use this command."); } ApplyAnimation(playerid, "SAMP", "FishingIdle", 4.1, 0, 0, 0, 1, 0, 1); SetPlayerAttachedObject(playerid, 9, 18632, 6, 0.112999, 0.024000, 0.000000, -172.999954, 28.499994, 0.000000); //SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s reels the line of their fishing rod into the water.", GetPlayerRPName(playerid)); GameTextForPlayer(playerid, "~w~Fishing...", 6000, 3); PlayerInfo[playerid][pFishTime] = 6; if(PlayerInfo[playerid][pFishingBait] > 0) { PlayerInfo[playerid][pFishingBait]--; PlayerInfo[playerid][pUsedBait] = 1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fishingbait = fishingbait - 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); //SendClientMessage(playerid, COLOR_AQUA, "** You used one fish bait. Your odds of catching a bigger fish are increased!"); } else { PlayerInfo[playerid][pUsedBait] = 0; } return 1; } CMD:sellfish(playerid, params[]) { new businessid; if(!PlayerHasJob(playerid, JOB_FISHERMAN)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Fisherman."); } if((businessid = GetInsideBusiness(playerid)) == -1 || BusinessInfo[businessid][bType] != BUSINESS_STORE) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any 24/7 business."); } if(!PlayerInfo[playerid][pFishWeight]) { return SendClientMessage(playerid, COLOR_GREY, "You have no fish which you can sell."); } new amount = (PlayerInfo[playerid][pFishWeight] * 1) + random(300)+50; if(PlayerInfo[playerid][pLaborUpgrade] > 0) { amount += percent(amount, PlayerInfo[playerid][pLaborUpgrade]); } SendClientMessageEx(playerid, COLOR_AQUA, "** You earned {00AA00}$%i{33CCFF} on your paycheck for selling %i kg of fish.", amount, PlayerInfo[playerid][pFishWeight]); AddToPaycheck(playerid, amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET fishweight = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[playerid][pFishWeight] = 0; return 1; } CMD:myfish(playerid, params[]) { if(!PlayerHasJob(playerid, JOB_FISHERMAN)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Fisherman."); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_______ My Fish _______"); SendClientMessageEx(playerid, COLOR_GREY2, "You have %i/1500 kg of fish in your inventory.", PlayerInfo[playerid][pFishWeight]); return 1; } CMD:sellvest(playerid, params[]) { new targetid, amount; if(!PlayerHasJob(playerid, JOB_BODYGUARD)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Bodyguard."); } if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellvest [playerid] [amount]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell to yourself."); } if(amount < 1000 || amount > 5000) { return SendClientMessage(playerid, COLOR_GREY, "The amount specified must range between $1000 and $5000."); } if(gettime() - PlayerInfo[playerid][pLastSell] < 10) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only use this command every 10 seconds. Please wait %i more seconds.", 10 - (gettime() - PlayerInfo[playerid][pLastSell])); } if(GetPlayerArmourEx(targetid) >= 50.0 + (GetJobLevel(playerid, JOB_BODYGUARD) * 5)) { return SendClientMessage(playerid, COLOR_GREY, "That player already has a vest."); } PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pVestOffer] = playerid; PlayerInfo[targetid][pVestPrice] = amount; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered you a vest with %.1f points of armor for %s (/accept vest).", GetPlayerRPName(playerid), 50.0 + (GetJobLevel(playerid, JOB_BODYGUARD) * 5), FormatNumber(amount)); SendClientMessageEx(playerid, COLOR_AQUA, "** You offered %s a vest with %.1f points of armor for %s.", GetPlayerRPName(targetid), 50.0 + (GetJobLevel(playerid, JOB_BODYGUARD) * 5), FormatNumber(amount)); return 1; } /*CMD:smugglemats(playerid, params[]) { if(!PlayerHasJob(playerid, JOB_WEAPONDEALER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Weapons Dealer."); } if(!IsPlayerInRangeOfPoint(playerid, 3.0, 118.7502,-183.5144,1.5206) && !IsPlayerInRangeOfPoint(playerid, 3.0, 2393.4885, -2008.5726, 13.3467)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any materials pickup."); } if(PlayerInfo[playerid][pCP] != CHECKPOINT_NONE) { return SendClientMessage(playerid, COLOR_GREY, "You must cancel your active checkpoint first. /cancelcp to cancel it."); } if(PlayerInfo[playerid][pCash] < 150) { return SendClientMessage(playerid, COLOR_GREY, "You need at least $300 in cash to smuggle materials."); } if(PlayerInfo[playerid][pMaterials] + 250 > GetPlayerCapacity(playerid, CAPACITY_MATERIALS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i materials. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMaterials], GetPlayerCapacity(playerid, CAPACITY_MATERIALS)); } PlayerInfo[playerid][pCP] = CHECKPOINT_MATS; PlayerInfo[playerid][pSmuggleTime] = gettime(); PlayerInfo[playerid][pDedication] = 1; GivePlayerCash(playerid, -150); SendClientMessage(playerid, COLOR_AQUA, "** You paid $150 for a load of materials. Smuggle them to the depot to collect them."); if(IsPlayerInRangeOfPoint(playerid, 3.0, 118.7502,-183.5144,1.5206)) { AddPointMoney(POINT_MATPICKUP1, 75); SetPlayerCheckpoint(playerid, 1198.9027,246.9536,19.5547, 3.0); PlayerInfo[playerid][pSmuggleMats] = 1; } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 2393.4885, -2008.5726, 13.3467)) { AddPointMoney(POINT_MATPICKUP2, 75); SetPlayerCheckpoint(playerid, 2288.0918, -1105.6555, 37.9766, 3.0); PlayerInfo[playerid][pSmuggleMats] = 2; } return 1; }*/ CMD:smugglemats(playerid, params[]) { if(!PlayerHasJob(playerid, JOB_WEAPONDEALER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Weapons Dealer."); } if(!IsPlayerInRangeOfPoint(playerid, 3.0, 118.7502,-183.5144,1.5206) && !IsPlayerInRangeOfPoint(playerid, 3.0, 2393.4885, -2008.5726, 13.3467) && !IsPlayerInRangeOfPoint(playerid, 20.0, 714.5344, -1565.1694, 1.7680) && !IsPlayerInRangeOfPoint(playerid, 20.0, 2112.3240,-2432.8130,13.5469)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any materials pickup."); } if(PlayerInfo[playerid][pCP] != CHECKPOINT_NONE) { return SendClientMessage(playerid, COLOR_GREY, "You must cancel your active checkpoint first. /cancelcp to cancel it."); } if(PlayerInfo[playerid][pCash] < 50) { return SendClientMessage(playerid, COLOR_GREY, "You need at least $50 in cash to smuggle materials."); } if(PlayerInfo[playerid][pMaterials] + 250 > GetPlayerCapacity(playerid, CAPACITY_MATERIALS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i materials. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMaterials], GetPlayerCapacity(playerid, CAPACITY_MATERIALS)); } PlayerInfo[playerid][pCP] = CHECKPOINT_MATS; PlayerInfo[playerid][pSmuggleTime] = gettime(); GivePlayerCash(playerid, -150); SendClientMessage(playerid, COLOR_AQUA, "** You paid $150 for a load of materials. Smuggle them to the depot to collect them."); if(IsPlayerInRangeOfPoint(playerid, 3.0, 118.7502,-183.5144,1.5206)) { AddPointMoney(POINT_MATPICKUP1, 25); SetPlayerCheckpoint(playerid, 1198.9027,246.9536,19.5547, 3.0); PlayerInfo[playerid][pSmuggleMats] = 1; } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 2393.4885, -2008.5726, 13.3467)) { AddPointMoney(POINT_MATPICKUP2, 25); SetPlayerCheckpoint(playerid, 2288.0918, -1105.6555, 37.9766, 3.0); PlayerInfo[playerid][pSmuggleMats] = 2; } else if(IsPlayerInRangeOfPoint(playerid, 20.0, 714.5344, -1565.1694, 1.76807)) { //AddPointMoney(POINT_MATPICKUP2, 25); SetPlayerCheckpoint(playerid, 29.0318,-1399.3555,1.7680, 20.0); PlayerInfo[playerid][pSmuggleMats] = 3; } else if(IsPlayerInRangeOfPoint(playerid, 20.0, 2112.3240, -2432.8130, 13.5469)) { // get random checkpoint new rand = random(5); switch(rand) { case 0: { SetPlayerCheckpoint(playerid, -1368.1206,-203.7393,14.1484, 30.0); } case 1: { SetPlayerCheckpoint(playerid, 310.8307,2033.6459,17.6406, 30.0); } case 2: { SetPlayerCheckpoint(playerid, 401.2192,2502.6482,16.4844, 30.0); } case 3: { SetPlayerCheckpoint(playerid, 1582.8756,1356.8186,10.8556, 30.0); } case 4: { SetPlayerCheckpoint(playerid, 1574.8552,1505.5690,10.8361, 30.0); } } PlayerInfo[playerid][pSmuggleMats] = 4; } return 1; } CMD:getmats(playerid, params[]) { return callcmd::smugglemats(playerid, params); } CMD:sellgun(playerid, params[]) { new targetid, weapon[10], price; if(!PlayerHasJob(playerid, JOB_WEAPONDEALER) && PlayerInfo[playerid][pVIPPackage] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Weapons Dealer."); } if(PlayerInfo[playerid][pHours] < 2 || PlayerInfo[playerid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are either weapon restricted or you played less than two playing hours."); } if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell weapons from within a vehicle."); } if(sscanf(params, "us[10]I(0)", targetid, weapon, price)) { SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_______ Weapons Crafting _______"); if(GetJobLevel(playerid, JOB_WEAPONDEALER) >= 1) { SendClientMessage(playerid, COLOR_WHITE, "Level 1: Bat [50], Shovel [50], Golfclub [50], Poolcue [50]"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: Katana [50], Dildo [50], Flowers [50], Cane [50]"); SendClientMessage(playerid, COLOR_WHITE, "Level 1: 9mm [100], Sdpistol [150], Shotgun [200]"); } if(GetJobLevel(playerid, JOB_WEAPONDEALER) >= 2) { SendClientMessage(playerid, COLOR_WHITE, "Level 2: MP5 [1000], Deagle [2000]"); } if(GetJobLevel(playerid, JOB_WEAPONDEALER) >= 3) { SendClientMessage(playerid, COLOR_WHITE, "Level 3: Uzi [500], Tec9 [500], Rifle [1000]"); } if(GetJobLevel(playerid, JOB_WEAPONDEALER) >= 4) { SendClientMessage(playerid, COLOR_WHITE, "Level 4: Ak47 [3500], M4 [4500]"); } if(GetJobLevel(playerid, JOB_WEAPONDEALER) >= 5 || PlayerInfo[playerid][pVIPPackage] >= 3) { if(PlayerInfo[playerid][pVIPPackage] >= 3) { SendClientMessage(playerid, COLOR_VIP, "(VIP){FFFFFF} Level 5:Sniper [5000]"); } else { SendClientMessage(playerid, COLOR_WHITE, "Level 5: Sniper [7500]"); } } SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellgun [playerid] [name] [price]"); return 1; } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(PlayerInfo[targetid][pHours] < 2 || PlayerInfo[targetid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is either weapon restricted or played less than two playing hours."); } if(gettime() - PlayerInfo[playerid][pLastSell] < 10) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only use this command every 10 seconds. Please wait %i more seconds.", 10 - (gettime() - PlayerInfo[playerid][pLastSell])); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are unable to use this command at the moment."); } if(price < 0) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $0."); } if(!strcmp(weapon, "bat", true)) { if(PlayerInfo[playerid][pMaterials] < 50) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 5)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 5); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 5; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a baseball bat for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a baseball bat for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "shovel", true)) { if(PlayerInfo[playerid][pMaterials] < 50) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 6)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 6); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 6; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a shovel for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a shovel for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "golfclub", true)) { if(PlayerInfo[playerid][pMaterials] < 50) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 2)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 2); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 2; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a golf club for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a golf club for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "poolcue", true)) { if(PlayerInfo[playerid][pMaterials] < 50) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 7)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 7); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 7; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a pool cue for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a pool cue for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "katana", true)) { if(PlayerInfo[playerid][pMaterials] < 50) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 8)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 8); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 8; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a katana for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a katana for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "dildo", true)) { if(PlayerInfo[playerid][pMaterials] < 50) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 10)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 10); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 10; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a dildo for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a dildo for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "flowers", true)) { if(PlayerInfo[playerid][pMaterials] < 50) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 14)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 14); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 14; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you flowers for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s flowers for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "cane", true)) { if(PlayerInfo[playerid][pMaterials] < 50) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 15)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 15); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 15; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a cane for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a cane for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "9mm", true)) { if(PlayerInfo[playerid][pMaterials] < 100) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 22)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 22); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[playerid][pLastSell] = gettime(); PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 22; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a 9mm for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a 9mm for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "sdpistol", true)) { if(PlayerInfo[playerid][pMaterials] < 150) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 23)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 23); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 23; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a silenced pistol for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a silenced pistol for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "shotgun", true)) { if(PlayerInfo[playerid][pMaterials] < 200) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 25)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 25); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 25; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a shotgun for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a shotgun for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "mp5", true)) { if(GetJobLevel(playerid, JOB_WEAPONDEALER) < 2) { return SendClientMessage(playerid, COLOR_GREY, "Your skill level is not high enough to craft this weapon."); } if(PlayerInfo[playerid][pMaterials] < 1000) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 29)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 29); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 29; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you an MP5 for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s an MP5 for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "deagle", true)) { if(GetJobLevel(playerid, JOB_WEAPONDEALER) < 2) { return SendClientMessage(playerid, COLOR_GREY, "Your skill level is not high enough to craft this weapon."); } if(PlayerInfo[playerid][pMaterials] < 2000) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 24)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 24); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 24; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a Desert Eagle for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a Desert Eagle for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "uzi", true)) { if(GetJobLevel(playerid, JOB_WEAPONDEALER) < 3) { return SendClientMessage(playerid, COLOR_GREY, "Your skill level is not high enough to craft this weapon."); } if(PlayerInfo[playerid][pMaterials] < 500) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 28)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 28); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 28; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a Micro Uzi for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a Micro Uzi for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "tec9", true)) { if(GetJobLevel(playerid, JOB_WEAPONDEALER) < 3) { return SendClientMessage(playerid, COLOR_GREY, "Your skill level is not high enough to craft this weapon."); } if(PlayerInfo[playerid][pMaterials] < 500) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 32)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 32); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 32; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a Tec-9 for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a Tec-9 for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "ak47", true)) { if(GetJobLevel(playerid, JOB_WEAPONDEALER) < 4) { return SendClientMessage(playerid, COLOR_GREY, "Your skill level is not high enough to craft this weapon."); } if(PlayerInfo[playerid][pMaterials] < 3500) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 30)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 30); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 30; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you an AK-47 for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s an AK-47 for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "m4", true)) { if(GetJobLevel(playerid, JOB_WEAPONDEALER) < 4) { return SendClientMessage(playerid, COLOR_GREY, "Your skill level is not high enough to craft this weapon."); } if(PlayerInfo[playerid][pMaterials] < 4500) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 31)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 31); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 31; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you an M4 for $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s an M4 for $%i.", GetPlayerRPName(targetid), price); } } else if(!strcmp(weapon, "sniper", true)) { new cost; if(PlayerInfo[playerid][pVIPPackage] == 3) cost = 5000; else cost = 7500; if(GetJobLevel(playerid, JOB_WEAPONDEALER) < 5 && PlayerInfo[playerid][pVIPPackage] < 3) { return SendClientMessage(playerid, COLOR_GREY, "Your skill level is not high enough to craft this weapon."); } if(PlayerInfo[playerid][pMaterials] < cost) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough materials to craft this weapon."); } if(PlayerHasWeapon(targetid, 34)) { return SendClientMessage(playerid, COLOR_GREY, "That player has this weapon already."); } if(targetid == playerid) { SellWeapon(playerid, targetid, 34); } else if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } else { PlayerInfo[targetid][pSellOffer] = playerid; PlayerInfo[targetid][pSellType] = ITEM_SELLGUN; PlayerInfo[targetid][pSellExtra] = 34; PlayerInfo[targetid][pSellPrice] = price; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered to sell you a sniper rifle or $%i. (/accept weapon)", GetPlayerRPName(playerid), price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to sell %s a sniper rifle for $%i.", GetPlayerRPName(targetid), price); } } return 1; } CMD:buycomps(playerid, params[]) { new amount, price, cost = 1200 - (GetJobLevel(playerid, JOB_MECHANIC) * 200); if(!PlayerHasJob(playerid, JOB_MECHANIC)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command unless you're a Mechanic."); } if(!IsPlayerInRangeOfPoint(playerid, 3.0, -90.6911,1118.5070,20.7860)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the component shop."); } if(sscanf(params, "i", amount)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /buycomps [amount]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "You are paying $%i per component at your current skill level.", cost); return 1; } if(!(1 <= amount <= 10)) { return SendClientMessage(playerid, COLOR_GREY, "The amount must range between 1 and 10."); } if(PlayerInfo[playerid][pComponents] + amount > 50) { return SendClientMessage(playerid, COLOR_GREY, "You can't carry more than 50 components."); } price = amount * cost; if(PlayerInfo[playerid][pCash] < price) { SendClientMessageEx(playerid, COLOR_GREY, "You can't afford to purchase %i components for $%i.", amount, price); } else { PlayerInfo[playerid][pComponents] += amount; GivePlayerCash(playerid, -price); SendClientMessageEx(playerid, COLOR_AQUA, "** You have purchased %i components for $%i.", amount, price); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET components = %i WHERE uid = %i", PlayerInfo[playerid][pComponents], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } return 1; } CMD:repair(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), Float:health; if(!PlayerHasJob(playerid, JOB_MECHANIC) && PlayerInfo[playerid][pVIPPackage] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You must either be a mechanic, or a Legendary VIP to use this command."); } if(GetInsideGarage(playerid) >= 0) { if(gettime() - PlayerInfo[playerid][pLastRepair] < 20) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only repair a vehicle every 20 seconds. Please wait %i more seconds.", 20 - (gettime() - PlayerInfo[playerid][pLastRepair])); } if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any vehicle."); } if(!VehicleHasEngine(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no engine which can be repaired."); } GetVehicleHealth(vehicleid, health); if(health >= 1000.0) { SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't need to be repaired."); } else { PlayerInfo[playerid][pLastRepair] = gettime(); SetVehicleHealth(vehicleid, 1000.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s repairs the vehicle.", GetPlayerRPName(playerid)); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); } } else if(PlayerHasJob(playerid, JOB_MECHANIC) && PlayerInfo[playerid][pVIPPackage] < 3) { if(PlayerInfo[playerid][pVIPPackage] < 3 && PlayerInfo[playerid][pComponents] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "You have no components left."); } if(gettime() - PlayerInfo[playerid][pLastRepair] < 20) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only repair a vehicle every 20 seconds. Please wait %i more seconds.", 20 - (gettime() - PlayerInfo[playerid][pLastRepair])); } if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any vehicle."); } if(!VehicleHasEngine(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no engine which can be repaired."); } GetVehicleHealth(vehicleid, health); if(health >= 1000.0) { SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't need to be repaired."); } else { PlayerInfo[playerid][pComponents]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET components = %i WHERE uid = %i", PlayerInfo[playerid][pComponents], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[playerid][pLastRepair] = gettime(); SetVehicleHealth(vehicleid, 1000.0); if(GetJobLevel(playerid, JOB_MECHANIC) == 5) { RepairVehicle(vehicleid); SendClientMessage(playerid, COLOR_WHITE, "You have repaired the health and bodywork on this vehicle.."); } else { SendClientMessage(playerid, COLOR_WHITE, "You have repaired this vehicle to maximum health."); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s repairs the vehicle.", GetPlayerRPName(playerid)); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); IncreaseJobSkill(playerid, JOB_MECHANIC); } } else if(PlayerInfo[playerid][pVIPPackage] == 3) { if(PlayerInfo[playerid][pVIPPackage] < 3 && !PlayerInfo[playerid][pComponents]) { return SendClientMessage(playerid, COLOR_GREY, "You have no components left."); } if(gettime() - PlayerInfo[playerid][pLastRepair] < 20) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only repair a vehicle every 20 seconds. Please wait %i more seconds.", 20 - (gettime() - PlayerInfo[playerid][pLastRepair])); } if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any vehicle."); } if(!VehicleHasEngine(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no engine which can be repaired."); } GetVehicleHealth(vehicleid, health); if(health >= 1000.0) { SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't need to be repaired."); } else { SendClientMessage(playerid, COLOR_VIP, "VIP Perk: You repaired this vehicle free of charge."); PlayerInfo[playerid][pLastRepair] = gettime(); SetVehicleHealth(vehicleid, 1000.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s repairs the vehicle.", GetPlayerRPName(playerid)); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); IncreaseJobSkill(playerid, JOB_MECHANIC); } } return 1; } CMD:refill(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!PlayerHasJob(playerid, JOB_MECHANIC)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command unless you're a Mechanic."); } if(!PlayerInfo[playerid][pComponents]) { return SendClientMessage(playerid, COLOR_GREY, "You have no components left."); } if(gettime() - PlayerInfo[playerid][pLastRefuel] < 20) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only refuel a vehicle every 20 seconds. Please wait %i more seconds.", 20 - (gettime() - PlayerInfo[playerid][pLastRefuel])); } if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any vehicle."); } if(!VehicleHasEngine(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no engine which can be refueled."); } if(vehicleFuel[vehicleid] >= 100) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't need to be refueled."); } if(vehicleFuel[vehicleid] + 10 >= 100) { vehicleFuel[vehicleid] = 100; } else { vehicleFuel[vehicleid] += 10; } PlayerInfo[playerid][pComponents]--; PlayerInfo[playerid][pLastRefuel] = gettime(); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s pours some gasoline to the vehicle.", GetPlayerRPName(playerid)); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET components = %i WHERE uid = %i", PlayerInfo[playerid][pComponents], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); IncreaseJobSkill(playerid, JOB_MECHANIC); return 1; } CMD:nos(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!PlayerHasJob(playerid, JOB_MECHANIC) && PlayerInfo[playerid][pVIPPackage] != 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command unless you're a Mechanic."); } if(PlayerInfo[playerid][pVIPPackage] == 0 && !PlayerInfo[playerid][pComponents]) { return SendClientMessage(playerid, COLOR_GREY, "You have no components left."); } if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any vehicle."); } switch(GetVehicleModel(vehicleid)) { case 581, 523, 462, 521, 463, 522, 461, 448, 468, 586, 509, 481, 510, 472, 473, 493, 595, 484, 430, 453, 452, 446, 454, 590, 569, 537, 538, 570, 449: return SendClientMessage(playerid, COLOR_GREY, "This vehicle can't be modified with nitrous."); } if(PlayerInfo[playerid][pVIPPackage] < 3) { PlayerInfo[playerid][pComponents]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET components = %i WHERE uid = %i", PlayerInfo[playerid][pComponents], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else { SendClientMessage(playerid, COLOR_VIP, "VIP Perk: You added nitrous to this vehicle free of charge."); } AddVehicleComponent(vehicleid, 1009); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s attaches a 2x NOS Canister on the engine feed.", GetPlayerRPName(playerid)); return 1; } CMD:hyd(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!PlayerHasJob(playerid, JOB_MECHANIC) && PlayerInfo[playerid][pVIPPackage] != 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command unless you're a Mechanic."); } if(PlayerInfo[playerid][pMechanicSkill] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You must be a skill level 2 mechanic to use this command."); } if(PlayerInfo[playerid][pVIPPackage] == 0 && !PlayerInfo[playerid][pComponents]) { return SendClientMessage(playerid, COLOR_GREY, "You have no components left."); } if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any vehicle."); } if(PlayerInfo[playerid][pVIPPackage] < 3) { PlayerInfo[playerid][pComponents]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET components = %i WHERE uid = %i", PlayerInfo[playerid][pComponents], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else { SendClientMessage(playerid, COLOR_VIP, "VIP Perk: You added hydraulics to this vehicle free of charge."); } AddVehicleComponent(vehicleid, 1087); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s attaches a set of hydraulics to the vehicle.", GetPlayerRPName(playerid)); return 1; } CMD:tow(playerid, params[]) { if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 525) { return SendClientMessage(playerid, COLOR_GREY, "You must be in a tow truck to use this command."); } if(!PlayerHasJob(playerid, JOB_MECHANIC) && !IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You must be a Mechanic or a Law Enforcement Officer to use this command."); } if(PlayerInfo[playerid][pMechanicSkill] < 3 && !IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You must be a skill level 3 mechanic to use this command."); } new Float:pX, Float:pY, Float:pZ; GetPlayerPos(playerid, pX, pY, pZ); new Float:vX, Float:vY, Float:vZ; new Found = 0; new vid = 0; while ((vid= 100) { return SendClientMessage(playerid, COLOR_GREY, "The fuel tank in this vehicle is already full."); } if(PlayerInfo[playerid][pCash] < (100 - vehicleFuel[vehicleid]) * 2) { return SendClientMessageEx(playerid, COLOR_GREY, "You don't have enough cash. It will cost you at least $%i.", (100 - vehicleFuel[vehicleid]) * 2); } if(PlayerInfo[playerid][pRefuel] != INVALID_VEHICLE_ID) { GivePlayerCash(playerid, -PlayerInfo[playerid][pRefuelAmount]); SetVehicleParams(vehicleid, VEHICLE_ENGINE, 1); SendClientMessageEx(playerid, COLOR_AQUA, "** You've refilled your vehicle's gas tank for $%i.", PlayerInfo[playerid][pRefuelAmount]); PlayerInfo[playerid][pRefuel] = INVALID_VEHICLE_ID; PlayerInfo[playerid][pRefuelAmount] = 0; } else { PlayerInfo[playerid][pRefuel] = vehicleid; SetVehicleParams(vehicleid, VEHICLE_ENGINE, 0); PlayerInfo[playerid][pRefuelAmount] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s begins to refuel their vehicle's gas tank.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_WHITE, "This will take about %i seconds. You will be notified once completed.", 100 - vehicleFuel[vehicleid]); } return 1; } CMD:withdraw(playerid, params[]) { new amount; if(!IsPlayerInRangeOfPoint(playerid, 10.0, -180.1077,1132.3331,-19.6455)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the bank."); } if(sscanf(params, "i", amount)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /withdraw [amount] ($%i available)", PlayerInfo[playerid][pBank]); } if(amount < 1 || amount > PlayerInfo[playerid][pBank]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } PlayerInfo[playerid][pBank] -= amount; GivePlayerCash(playerid, amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bank = %i WHERE uid = %i", PlayerInfo[playerid][pBank], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have withdrawn {00AA00}%s{33CCFF} from your bank account. Your new balance is %s.", FormatNumber(amount), FormatNumber(PlayerInfo[playerid][pBank])); return 1; } CMD:deposit(playerid, params[]) { new amount; if(!IsPlayerInRangeOfPoint(playerid, 10.0, -180.1077,1132.3331,-19.6455)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the bank."); } if(sscanf(params, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /deposit [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pCash]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while on admin duty"); } PlayerInfo[playerid][pBank] += amount; GivePlayerCash(playerid, -amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bank = %i WHERE uid = %i", PlayerInfo[playerid][pBank], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have deposited {00AA00}%s{33CCFF} into your bank account. Your new balance is %s.", FormatNumber(amount), FormatNumber(PlayerInfo[playerid][pBank])); return 1; } CMD:wiretransfer(playerid, params[]) { new targetid, amount; if(!IsPlayerInRangeOfPoint(playerid, 10.0, -180.1077,1132.3331,-19.6455)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the bank."); } if(PlayerInfo[playerid][pLevel] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can only use this command if you are level 2+."); } if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /wiretransfer [playerid] [amount]"); } if(!IsPlayerConnected(targetid) || !PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or hasn't logged in yet."); } if(amount < 1 || amount > PlayerInfo[playerid][pBank]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't transfer funds to yourself."); } if(PlayerInfo[playerid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while on admin duty"); } PlayerInfo[targetid][pBank] += amount; PlayerInfo[playerid][pBank] -= amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bank = %i WHERE uid = %i", PlayerInfo[playerid][pBank], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bank = %i WHERE uid = %i", PlayerInfo[targetid][pBank], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have transferred {00AA00}%s{33CCFF} to %s. Your new balance is %s.", FormatNumber(amount), GetPlayerRPName(targetid), FormatNumber(PlayerInfo[playerid][pBank])); SendClientMessageEx(targetid, COLOR_AQUA, "%s has transferred {00AA00}%s{33CCFF} to your bank account.", GetPlayerRPName(playerid), FormatNumber(amount)); Log_Write("log_give", "%s (uid: %i) (IP: %s) transferred $%i to %s (uid: %i) (IP: %s)", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], GetPlayerIP(playerid), amount, GetPlayerRPName(targetid), PlayerInfo[targetid][pID], GetPlayerIP(targetid)); if(!strcmp(GetPlayerIP(playerid), GetPlayerIP(targetid))) { SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s (IP: %s) has transferred %s to %s (IP: %s).", GetPlayerRPName(playerid), GetPlayerIP(playerid), FormatNumber(amount), GetPlayerRPName(targetid), GetPlayerIP(targetid)); } return 1; } CMD:balance(playerid, params[]) { if(!IsPlayerInRangeOfPoint(playerid, 10.0, -180.1077,1132.3331,-19.6455)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the bank."); } SendClientMessageEx(playerid, COLOR_GREEN, "Your bank account balance is $%i.", PlayerInfo[playerid][pBank]); return 1; } CMD:rt(playerid, params[]) { return callcmd::rsms(playerid, params); } //CMD:rs(playerid, params[]) //{ //return callcmd::rsms(playerid, params); //} CMD:rsms(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /rsms [text]"); } if(PlayerInfo[playerid][pTextFrom] == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You haven't received a text by anyone since you joined the server."); } if(PlayerInfo[PlayerInfo[playerid][pTextFrom]][pJailType] > 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently imprisoned and cannot use their phone."); } if(PlayerInfo[PlayerInfo[playerid][pTextFrom]][pTogglePhone]) { return SendClientMessage(playerid, COLOR_GREY, "That player has their mobile phone switched off."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are unable to use your cellphone at the moment."); } PlayerInfo[PlayerInfo[playerid][pTextFrom]][pTextFrom] = playerid; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes out a cellphone and sends a message.", GetPlayerRPName(playerid)); SendClientMessageEx(PlayerInfo[playerid][pTextFrom], COLOR_YELLOW, "** SMS from %s: %s, Ph: %i **", GetPlayerRPName(playerid), params, PlayerInfo[playerid][pPhone]); SendClientMessageEx(playerid, COLOR_YELLOW, "** SMS to %s: %s, Ph: %i **", GetPlayerRPName(PlayerInfo[playerid][pTextFrom]), params, PlayerInfo[PlayerInfo[playerid][pTextFrom]][pPhone]); GivePlayerCash(playerid, -1); GameTextForPlayer(playerid, "~w~Text sent!~n~~r~-$1", 5000, 1); return 1; } CMD:t(playerid, params[]) { return callcmd::sms(playerid, params); } CMD:sms(playerid, params[]) { new number, msg[128]; if(sscanf(params, "is[128]", number, msg)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sms [number] [message]"); } if(!PlayerInfo[playerid][pPhone]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a cellphone and therefore can't use this command."); } if(PlayerInfo[playerid][pTogglePhone]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use your mobile phone right now as you have it toggled."); } if(number == 0 || number == PlayerInfo[playerid][pPhone]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid number."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are unable to use your cellphone at the moment."); } foreach(new i : Player) { if(PlayerInfo[i][pPhone] == number) { if(PlayerInfo[i][pJailType] > 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently imprisoned and cannot use their phone."); } if(PlayerInfo[i][pTogglePhone]) { return SendClientMessage(playerid, COLOR_GREY, "That player has their mobile phone switched off."); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes out a cellphone and sends a message.", GetPlayerRPName(playerid)); if(strlen(msg) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_YELLOW, "** SMS from %s: %.*s..., Ph: %i **", GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, msg, PlayerInfo[playerid][pPhone]); SendClientMessageEx(i, COLOR_YELLOW, "** SMS from %s: ...%s, Ph: %i **", GetPlayerRPName(playerid), msg[MAX_SPLIT_LENGTH], PlayerInfo[playerid][pPhone]); SendClientMessageEx(playerid, COLOR_YELLOW, "** SMS to %s: %.*s..., Ph: %i **", GetPlayerRPName(i), MAX_SPLIT_LENGTH, msg, PlayerInfo[i][pPhone]); SendClientMessageEx(playerid, COLOR_YELLOW, "** SMS to %s: ...%s, Ph: %i **", GetPlayerRPName(i), msg[MAX_SPLIT_LENGTH], PlayerInfo[i][pPhone]); } else { SendClientMessageEx(i, COLOR_YELLOW, "** SMS from %s: %s, Ph: %i **", GetPlayerRPName(playerid), msg, PlayerInfo[playerid][pPhone]); SendClientMessageEx(playerid, COLOR_YELLOW, "** SMS to %s: %s, Ph: %i **", GetPlayerRPName(i), msg, PlayerInfo[i][pPhone]); } if(PlayerInfo[i][pTextFrom] == INVALID_PLAYER_ID) { SendClientMessage(i, COLOR_WHITE, "** You can use '/rsms [message]' to reply to this text message."); } PlayerInfo[i][pTextFrom] = playerid; GivePlayerCash(playerid, -1); GameTextForPlayer(playerid, "~w~Text sent!~n~~r~-$1", 5000, 1); return 1; } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT username, jailtype, togglephone FROM users WHERE phone = %i", number); mysql_tquery(connectionID, queryBuffer, "OnPlayerSendTextMessage", "iis", playerid, number, msg); return 1; } CMD:texts(playerid, params[]) { if(!PlayerInfo[playerid][pPhone]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a cellphone and therefore can't use this command."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM texts WHERE recipient_number = %i ORDER BY date DESC", PlayerInfo[playerid][pPhone]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_VIEW_TEXTS, playerid); return 1; } CMD:call(playerid, params[]) { new number = strval(params); if(isnull(params)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /call [number]"); SendClientMessage(playerid, COLOR_SYNTAX, "Special numbers: 911, News, Mechanic, Taxi"); return 1; } if(!PlayerInfo[playerid][pPhone]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a phone, You can buy one at a 24/7 Shop"); } if(PlayerInfo[playerid][pTogglePhone]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use your mobile phone right now as you have it toggled."); } if(PlayerInfo[playerid][pCallLine] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You have a call in session. /(h)angup to end that call."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are unable to use your cellphone at the moment."); } if(!strcmp(params, "911")) { PlayerInfo[playerid][pCallLine] = playerid; PlayerInfo[playerid][pCallStage] = 911; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s dials a number on their keypad and begins a call.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_YELLOW, "Dispatch: 911, what is your emergency? Enter 'police' or 'medic'."); return 1; } else if(!strcmp(params, "news")) { PlayerInfo[playerid][pCallLine] = playerid; PlayerInfo[playerid][pCallStage] = 6397; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s dials a number on their keypad and begins a call.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_NAVYBLUE, "News Team: This is SANews here. Leave a message and we'll get back to you! *BEEP*"); return 1; } else if(!strcmp(params, "mechanic")) { PlayerInfo[playerid][pCallLine] = playerid; PlayerInfo[playerid][pCallStage] = 6324; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s dials a number on their keypad and begins a call.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_LIGHTORANGE, "Dispatch: This is the mechanic hotline. Please explain your situation to us."); return 1; } else if(!strcmp(params, "taxi")) { PlayerInfo[playerid][pCallLine] = playerid; PlayerInfo[playerid][pCallStage] = 8294; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s dials a number on their keypad and begins a call.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_YELLOW, "Dispatch: This is the cab company. Please state your location and destination."); return 1; } else { if(number == 0 || number == PlayerInfo[playerid][pPhone]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid number."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are unable to use your cellphone at the moment."); } foreach(new i : Player) { if(PlayerInfo[i][pPhone] == number) { if(PlayerInfo[i][pJailType] > 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently imprisoned and cannot use their phone."); } if(PlayerInfo[i][pCallLine] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "This player is currently in a call. Wait until they hang up."); } if(PlayerInfo[i][pTogglePhone]) { return SendClientMessage(playerid, COLOR_GREY, "That player has their mobile phone switched off."); } if(PlayerInfo[i][pLiveBroadcast] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently in a live interview and can't talk on the phone."); } SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE); PlayerInfo[playerid][pCallLine] = i; PlayerInfo[playerid][pCallStage] = 0; PlayerInfo[i][pCallLine] = playerid; PlayerInfo[i][pCallStage] = 1; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s dials a number on their keypad and begins a call.", GetPlayerRPName(playerid)); SendProximityMessage(i, 20.0, COLOR_PURPLE, "** %s's mobile phone begins to ring.", GetPlayerRPName(i)); SendClientMessageEx(playerid, COLOR_YELLOW, "** You've placed a call to number: %i. Please wait for your call to be answered.", number); SendClientMessageEx(i, COLOR_YELLOW, "** Incoming call from %s [%i]. Use /pickup to take this call.", GetPlayerRPName(playerid), PlayerInfo[playerid][pPhone]); SendClientMessage(playerid, COLOR_GREY, "Use /speaker. To turn the phone speaker"); return 1; } } SendClientMessage(playerid, COLOR_GREY, "That number is either not in service or the owner is offline."); } return 1; } CMD:p(playerid, params[]) { return callcmd::pickup(playerid, params); } CMD:pickup(playerid, params[]) { if(PlayerInfo[playerid][pCallStage] != 1) { return SendClientMessage(playerid, COLOR_GREY, "You have no incoming calls which you can answer right now."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are unable to use your cellphone at the moment."); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s presses a button and answers their mobile phone.", GetPlayerRPName(playerid)); SetPlayerSpecialAction(playerid, SPECIAL_ACTION_USECELLPHONE); PlayerInfo[PlayerInfo[playerid][pCallLine]][pCallStage] = 2; PlayerInfo[playerid][pCallStage] = 2; SendClientMessage(playerid, COLOR_WHITE, "You have answered the call. You can now speak in chat to talk to the caller."); SendClientMessage(PlayerInfo[playerid][pCallLine], COLOR_WHITE, "They answered the call. You can now speak in chat to talk to them."); return 1; } CMD:h(playerid, params[]) { return callcmd::hangup(playerid, params); } CMD:hangup(playerid, params[]) { if(PlayerInfo[playerid][pCallLine] == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You have no calls in session which you can hangup."); } HangupCall(playerid, HANGUP_USER); return 1; } CMD:tog(playerid, params[]) { return callcmd::toggle(playerid, params); } RefreshPlayerTextdraws(playerid) { if(!PlayerInfo[playerid][pToggleTextdraws]) { if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING) { TextDrawHideForPlayer(playerid, WebsiteTD); TextDrawHideForPlayer(playerid, TimeTD); PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][0]); PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][3]); PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][4]); PlayerTextDrawHide(playerid, pHungerTD[playerid]); PlayerTextDrawHide(playerid, HungerTD[playerid]); PlayerTextDrawHide(playerid, pThirstTD[playerid]); PlayerTextDrawHide(playerid, ThirstTD[playerid]); } else { TextDrawShowForPlayer(playerid, WebsiteTD); if(PlayerInfo[playerid][pWatch] && PlayerInfo[playerid][pWatchOn]) { TextDrawShowForPlayer(playerid, TimeTD); } if(PlayerInfo[playerid][pGPS] && PlayerInfo[playerid][pGPSOn]) { PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][0]); } if(!PlayerInfo[playerid][pToggleHUD]) { PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][3]); PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][4]); } PlayerTextDrawShow(playerid, pHungerTD[playerid]); PlayerTextDrawShow(playerid, HungerTD[playerid]); PlayerTextDrawShow(playerid, pThirstTD[playerid]); PlayerTextDrawShow(playerid, ThirstTD[playerid]); } } } CMD:toggle(playerid, params[]) { if(isnull(params)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /(tog)gle [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Textdraws, OOC, Global, Phone, Whisper, Bugged, Newbie, WalkieTalkie, Radio, Streams, News"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: SpawnCam, HUD, Admin, Helper, VIP, Reports, Faction, Gang"); return 1; } if(!strcmp(params, "textdraws", true)) { if(!PlayerInfo[playerid][pToggleTextdraws]) { PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][0]); //PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][1]); //PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][2]); for(new i=0; i<12; i++) PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][i]); // 0-11 el 12 m4 m3ak PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][3]); PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][4]); PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][5]); PlayerTextDrawHide(playerid, pHungerTD[playerid]); PlayerTextDrawHide(playerid, HungerTD[playerid]); PlayerTextDrawHide(playerid, pThirstTD[playerid]); PlayerTextDrawHide(playerid, ThirstTD[playerid]); TextDrawHideForPlayer(playerid, WebsiteTD); TextDrawHideForPlayer(playerid, TimeTD); PlayerInfo[playerid][pToggleTextdraws] = 1; SendClientMessage(playerid, COLOR_AQUA, "Textdraws toggled. You will no longer see any textdraws."); } else { if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && VehicleHasEngine(GetPlayerVehicleID(playerid))) { for(new i=0; i<12; i++) PlayerTextDrawHide(playerid, TDEditor_PTD[playerid][i]); // 0-11 el 12 m4 m3ak } if(PlayerInfo[playerid][pGPSOn]) { PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][0]); } if(PlayerInfo[playerid][pWatchOn]) { TextDrawShowForPlayer(playerid, TimeTD); } if(!PlayerInfo[playerid][pToggleHUD]) { PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][3]); PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][4]); } PlayerTextDrawShow(playerid, pHungerTD[playerid]); PlayerTextDrawShow(playerid, HungerTD[playerid]); PlayerTextDrawShow(playerid, pThirstTD[playerid]); PlayerTextDrawShow(playerid, ThirstTD[playerid]); TextDrawShowForPlayer(playerid, WebsiteTD); PlayerInfo[playerid][pToggleTextdraws] = 0; SendClientMessage(playerid, COLOR_AQUA, "Textdraws enabled. You will now see textdraws again."); } } else if(!strcmp(params, "ooc", true)) { if(!PlayerInfo[playerid][pToggleOOC]) { PlayerInfo[playerid][pToggleOOC] = 1; SendClientMessage(playerid, COLOR_AQUA, "OOC chat toggled. You will no longer see any messages in /o."); } else { PlayerInfo[playerid][pToggleOOC] = 0; SendClientMessage(playerid, COLOR_AQUA, "OOC chat enabled. You will now see messages in /o again."); } } else if(!strcmp(params, "global", true)) { if(!PlayerInfo[playerid][pToggleGlobal]) { PlayerInfo[playerid][pToggleGlobal] = 1; SendClientMessage(playerid, COLOR_AQUA, "Global chat toggled. You will no longer see any messages in /g."); } else { PlayerInfo[playerid][pToggleGlobal] = 0; SendClientMessage(playerid, COLOR_AQUA, "Global chat enabled. You can now speak to other players in /g."); } } else if(!strcmp(params, "phone", true)) { if(!PlayerInfo[playerid][pTogglePhone]) { if(PlayerInfo[playerid][pCallLine] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You can't do this while in a call."); } PlayerInfo[playerid][pTogglePhone] = 1; SendClientMessage(playerid, COLOR_AQUA, "Phone toggled. You will no longer receive calls or texts."); } else { PlayerInfo[playerid][pTogglePhone] = 0; SendClientMessage(playerid, COLOR_AQUA, "Phone enabled. You can now receive calls and texts again."); } } else if(!strcmp(params, "whisper", true)) { if(!PlayerInfo[playerid][pToggleWhisper]) { PlayerInfo[playerid][pToggleWhisper] = 1; SendClientMessage(playerid, COLOR_AQUA, "Whispers toggled. You will no longer receive any whispers from players."); } else { PlayerInfo[playerid][pToggleWhisper] = 0; SendClientMessage(playerid, COLOR_AQUA, "Whispers enabled. You will now receive whispers from players again."); } } else if(!strcmp(params, "bugged", true)) { if(GetFactionType(playerid) != FACTION_FEDERAL) return SendClientMessage(playerid, COLOR_GREY, "You must be a federal agent to use the bug channel."); if(!PlayerInfo[playerid][pToggleBug]) { PlayerInfo[playerid][pToggleBug] = 1; SendClientMessage(playerid, COLOR_AQUA, "Bug channel toggled. You will no longer receive any recordings from bugged players."); } else { PlayerInfo[playerid][pToggleBug] = 0; SendClientMessage(playerid, COLOR_AQUA, "Bug channel enabled. You will now receive recordings from bugged players again."); } } else if(!strcmp(params, "admin", true)) { if(!PlayerInfo[playerid][pAdmin] && !PlayerInfo[playerid][pDeveloper] && !PlayerInfo[playerid][pFormerAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to toggle this feature."); } if(!PlayerInfo[playerid][pToggleAdmin]) { PlayerInfo[playerid][pToggleAdmin] = 1; SendClientMessage(playerid, COLOR_AQUA, "Admin chat toggled. You will no longer see any messages in admin chat."); } else { PlayerInfo[playerid][pToggleAdmin] = 0; SendClientMessage(playerid, COLOR_AQUA, "Admin chat enabled. You will now see messages in admin chat again."); } } else if(!strcmp(params, "reports", true)) { if(PlayerInfo[playerid][pAdmin] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to toggle this feature."); } if(!PlayerInfo[playerid][pToggleReports]) { PlayerInfo[playerid][pToggleReports] = 1; SendClientMessage(playerid, COLOR_AQUA, "Reports toggled. You will no longer see any incoming reports."); } else { PlayerInfo[playerid][pToggleReports] = 0; SendClientMessage(playerid, COLOR_AQUA, "Reports enabled. You will now see incoming reports again."); } } else if(!strcmp(params, "helper", true)) { if(!PlayerInfo[playerid][pHelper]) { return SendClientMessage(playerid, COLOR_GREY, "You are not a helper and therefore cannot toggle this feature."); } if(!PlayerInfo[playerid][pToggleHelper]) { PlayerInfo[playerid][pToggleHelper] = 1; SendClientMessage(playerid, COLOR_AQUA, "Helper chat toggled. You will no longer see any messages in helper chat."); } else { PlayerInfo[playerid][pToggleHelper] = 0; SendClientMessage(playerid, COLOR_AQUA, "Helper chat enabled. You will now see messages in helper chat again."); } } else if(!strcmp(params, "newbie", true)) { if(!PlayerInfo[playerid][pToggleNewbie]) { PlayerInfo[playerid][pToggleNewbie] = 1; SendClientMessage(playerid, COLOR_AQUA, "Newbie chat toggled. You will no longer see any messages in newbie chat."); } else { PlayerInfo[playerid][pToggleNewbie] = 0; SendClientMessage(playerid, COLOR_AQUA, "Newbie chat enabled. You will now see messages in newbie chat again."); } } else if(!strcmp(params, "walkietalkie", true)) { if(!PlayerInfo[playerid][pWalkieTalkie]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a walkie talkie."); } if(!PlayerInfo[playerid][pToggleWT]) { PlayerInfo[playerid][pToggleWT] = 1; SendClientMessage(playerid, COLOR_AQUA, "Walkie talkie toggled. You will no longer receive any messages on your walkie talkie."); } else { PlayerInfo[playerid][pToggleWT] = 0; SendClientMessage(playerid, COLOR_AQUA, "Walkie talkie enabled. You will now receive messages on your walkie talkie again."); } } else if(!strcmp(params, "radio", true)) { if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of a faction and therefore can't toggle your radio."); } if(!PlayerInfo[playerid][pToggleRadio]) { PlayerInfo[playerid][pToggleRadio] = 1; SendClientMessage(playerid, COLOR_AQUA, "Radio chat toggled. You will no longer receive any messages on your radio."); } else { PlayerInfo[playerid][pToggleRadio] = 0; SendClientMessage(playerid, COLOR_AQUA, "Radio chat enabled. You will now receive messages on your radio again."); } } else if(!strcmp(params, "streams", true)) { if(!PlayerInfo[playerid][pToggleMusic]) { PlayerInfo[playerid][pToggleMusic] = 1; StopAudioStreamForPlayer(playerid); SendClientMessage(playerid, COLOR_AQUA, "Music streams toggled. You will no longer hear any music played locally & globally."); } else { PlayerInfo[playerid][pToggleMusic] = 0; SendClientMessage(playerid, COLOR_AQUA, "Music streams enabled. You will now hear music played locally & globally again."); } } else if(!strcmp(params, "vip", true)) { if(!PlayerInfo[playerid][pVIPPackage]) { return SendClientMessage(playerid, COLOR_GREY, "You are not a VIP member and therefore cannot toggle this feature."); } if(!PlayerInfo[playerid][pToggleVIP]) { PlayerInfo[playerid][pToggleVIP] = 1; SendClientMessage(playerid, COLOR_AQUA, "VIP chat toggled. You will no longer see any messages in VIP chat."); } else { PlayerInfo[playerid][pToggleVIP] = 0; SendClientMessage(playerid, COLOR_AQUA, "VIP chat enabled. You will now see messages in VIP chat again."); } } else if(!strcmp(params, "faction", true)) { if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of a faction and therefore can't toggle this chat."); } if(!PlayerInfo[playerid][pToggleFaction]) { PlayerInfo[playerid][pToggleFaction] = 1; SendClientMessage(playerid, COLOR_AQUA, "Faction chat toggled. You will no longer see any messages in faction chat."); } else { PlayerInfo[playerid][pToggleFaction] = 0; SendClientMessage(playerid, COLOR_AQUA, "Faction chat enabled. You will now see messages in faction chat again."); } } else if(!strcmp(params, "gang", true)) { if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not a gang member and therefore can't toggle this chat."); } if(!PlayerInfo[playerid][pToggleGang]) { PlayerInfo[playerid][pToggleGang] = 1; SendClientMessage(playerid, COLOR_AQUA, "Gang chat toggled. You will no longer see any messages in gang chat."); } else { PlayerInfo[playerid][pToggleGang] = 0; SendClientMessage(playerid, COLOR_AQUA, "Gang chat enabled. You will now see messages in gang chat again."); } } else if(!strcmp(params, "news", true)) { if(!PlayerInfo[playerid][pToggleNews]) { PlayerInfo[playerid][pToggleNews] = 1; SendClientMessage(playerid, COLOR_AQUA, "News chat toggled. You will no longer see any news broadcasts."); } else { PlayerInfo[playerid][pToggleNews] = 0; SendClientMessage(playerid, COLOR_AQUA, "News chat enabled. You will now see news broadcasts again."); } } else if(!strcmp(params, "lands", true)) { callcmd::lands(playerid, "\1"); } else if(!strcmp(params, "turfs", true)) { callcmd::turfs(playerid, "\1"); } else if(!strcmp(params, "spawncam", true)) { if(!PlayerInfo[playerid][pToggleCam]) { PlayerInfo[playerid][pToggleCam] = 1; SendClientMessage(playerid, COLOR_AQUA, "Spawn camera toggled. You will no longer see the camera effects upon spawning."); } else { PlayerInfo[playerid][pToggleCam] = 0; SendClientMessage(playerid, COLOR_AQUA, "Spawn camera enabled. You will now see the camera effects when you spawn again."); } } else if(!strcmp(params, "hud", true)) { if(!PlayerInfo[playerid][pToggleHUD]) { PlayerInfo[playerid][pToggleHUD] = 1; SendClientMessage(playerid, COLOR_AQUA, "HUD toggled. You will no longer see your health & armor indicators."); PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][3]); PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][4]); PlayerTextDrawHide(playerid, PlayerInfo[playerid][pText][5]); } else { PlayerInfo[playerid][pToggleHUD] = 0; SendClientMessage(playerid, COLOR_AQUA, "HUD enabled. You will now see your health & armor indicators again."); PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][3]); PlayerTextDrawShow(playerid, PlayerInfo[playerid][pText][4]); } } else { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /(tog)gle [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Textdraws, OOC, Global, Phone, Whisper, Bugged, Newbie, WalkieTalkie, Radio, Streams, News"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: SpawnCam, HUD, Admin, Helper, VIP, Reports, Faction, Gang"); } return 1; } CMD:findjob(playerid, params[]) { return ShowPlayerDialog(playerid, DIALOG_LOCATELIST1, DIALOG_STYLE_LIST, "GPS - Select Destination", "Pizzaman\nCourier\nFisherman\nBodyguard\nWeapon Dealer\nMechanic\nMiner\nSweeper\nTaxi Driver\nDrug Dealer\nLawyer\nDetective\nThief\nGarbage Man\nFarmer", "Select", "Close"); } LocateMethod(playerid, params[]) { if(isnull(params)) { SendClientMessage(playerid, COLOR_GREY, "Null Error - failed to locate properly - contact a developer."); return 1; } if(!strcmp(params, "dmv", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, -199.1727,1215.2516,19.7422, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of DMV."); } else if(!strcmp(params, "bank", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, -183.7134,1132.8501,19.7422, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the bank."); } /*else if(!strcmp(params, "paintball", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, -93.8151,1191.5658,19.7422, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of paintball."); }*/ else if(!strcmp(params, "casino", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, -305.7215,1303.1820,53.6657, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the casino."); } /*else if(!strcmp(params, "vip", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, -93.8151,1191.5658,19.7422, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the VIP lounge."); }*/ /*else if(!strcmp(params, "smuggledrugs", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, 52.0937, -292.2513, 1.7001, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the drug smuggling spot."); } else if(!strcmp(params, "matpickup", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, 118.7502,-183.5144,1.5206, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the materials pickup."); } else if(!strcmp(params, "heisenbergs", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, 26.7035,1361.9994,9.1719, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of Heisenberg's meth cooking trailer."); }*/ else if(!strcmp(params, "pizzaman", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, jobLocations[JOB_PIZZAMAN][jobX], jobLocations[JOB_PIZZAMAN][jobY], jobLocations[JOB_PIZZAMAN][jobZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Pizzaman job."); } else if(!strcmp(params, "courier", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, jobLocations[JOB_COURIER][jobX], jobLocations[JOB_COURIER][jobY], jobLocations[JOB_COURIER][jobZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Courier job."); } else if(!strcmp(params, "fisherman", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, jobLocations[JOB_FISHERMAN][jobX], jobLocations[JOB_FISHERMAN][jobY], jobLocations[JOB_FISHERMAN][jobZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Fisherman job."); } else if(!strcmp(params, "bodyguard", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, jobLocations[JOB_BODYGUARD][jobX], jobLocations[JOB_BODYGUARD][jobY], jobLocations[JOB_BODYGUARD][jobZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Bodyguard job."); } else if(!strcmp(params, "weapondealer", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, jobLocations[JOB_WEAPONDEALER][jobX], jobLocations[JOB_WEAPONDEALER][jobY], jobLocations[JOB_WEAPONDEALER][jobZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Weapons Dealer job."); } else if(!strcmp(params, "mechanic", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, jobLocations[JOB_MECHANIC][jobX], jobLocations[JOB_MECHANIC][jobY], jobLocations[JOB_MECHANIC][jobZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Mechanic job."); } else if(!strcmp(params, "miner", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, jobLocations[JOB_MINER][jobX], jobLocations[JOB_MINER][jobY], jobLocations[JOB_MINER][jobZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Miner job."); } else if(!strcmp(params, "sweeper", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, jobLocations[JOB_SWEEPER][jobX], jobLocations[JOB_SWEEPER][jobY], jobLocations[JOB_SWEEPER][jobZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Sweeper job."); } else if(!strcmp(params, "taxidriver", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, jobLocations[JOB_TAXIDRIVER][jobX], jobLocations[JOB_TAXIDRIVER][jobY], jobLocations[JOB_TAXIDRIVER][jobZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Taxi Driver job."); } else if(!strcmp(params, "drugdealer", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, jobLocations[JOB_DRUGDEALER][jobX], jobLocations[JOB_DRUGDEALER][jobY], jobLocations[JOB_DRUGDEALER][jobZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Drug Dealer job."); } else if(!strcmp(params, "lawyer", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, jobLocations[JOB_LAWYER][jobX], jobLocations[JOB_LAWYER][jobY], jobLocations[JOB_LAWYER][jobZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Lawyer job."); } else if(!strcmp(params, "detective", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, -220.3584, 1124.4917, 19.7422, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Detective job."); } else if(!strcmp(params, "thief", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, -1.8061, 1395.6776, 9.1719, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Thief job."); } else if(!strcmp(params, "garbageman", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, 319.8657,874.8818,20.3990, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Garbage man job."); } else if(!strcmp(params, "farmer", true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, -366.3515, -1412.8286, 25.7266, 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the Farmer job."); } else if(!strcmp(params, "24/7", true)) { new businessid = GetClosestBusiness(playerid, BUSINESS_STORE); if(businessid == -1) { return SendClientMessage(playerid, COLOR_GREY, "There are no businesses of this type to be found."); } PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the closest 24/7 to you."); } else if(!strcmp(params, "Ammunation", true)) { new businessid = GetClosestBusiness(playerid, BUSINESS_Ammunation); if(businessid == -1) { return SendClientMessage(playerid, COLOR_GREY, "There are no businesses of this type to be found."); } PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the closest gun shop to you."); } else if(!strcmp(params, "clothesshop", true)) { new businessid = GetClosestBusiness(playerid, BUSINESS_CLOTHES); if(businessid == -1) { return SendClientMessage(playerid, COLOR_GREY, "There are no businesses of this type to be found."); } PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the closest clothes shop to you."); } else if(!strcmp(params, "gym", true)) { new businessid = GetClosestBusiness(playerid, BUSINESS_GYM); if(businessid == -1) { return SendClientMessage(playerid, COLOR_GREY, "There are no businesses of this type to be found."); } PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the closest gym to you."); } else if(!strcmp(params, "restaurant", true)) { new businessid = GetClosestBusiness(playerid, BUSINESS_RESTAURANT); if(businessid == -1) { return SendClientMessage(playerid, COLOR_GREY, "There are no businesses of this type to be found."); } PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the closest restaurant to you."); } else if(!strcmp(params, "adagency", true)) { new businessid = GetClosestBusiness(playerid, BUSINESS_AGENCY); if(businessid == -1) { return SendClientMessage(playerid, COLOR_GREY, "There are no businesses of this type to be found."); } PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the closest advertisement agency to you."); } else if(!strcmp(params, "club", true)) { new businessid = GetClosestBusiness(playerid, BUSINESS_BARCLUB); if(businessid == -1) { return SendClientMessage(playerid, COLOR_GREY, "There are no businesses of this type to be found."); } PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the closest club/bar to you."); } else if(!strcmp(params, "toolshop", true)) { new businessid = GetClosestBusiness(playerid, BUSINESS_TOOLSHOP); if(businessid == -1) { return SendClientMessage(playerid, COLOR_GREY, "There are no businesses of this type to be found."); } PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, BusinessInfo[businessid][bPosX], BusinessInfo[businessid][bPosY], BusinessInfo[businessid][bPosZ], 3.0); SendClientMessage(playerid, COLOR_WHITE, "** Checkpoint marked at the location of the closest tool shop to you."); } else { for(new x = 0; x < MAX_LOCATIONS; x++) { if(!strcmp(params, LocationInfo[x][locName], true)) { PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, LocationInfo[x][locPosX], LocationInfo[x][locPosY], LocationInfo[x][locPosZ], 3.0); SendClientMessageEx(playerid, COLOR_WHITE, "** Checkpoint marked at the location of %s", LocationInfo[x][locName]); break; } if(x == MAX_LOCATIONS - 1) { SendClientMessageEx(playerid, COLOR_SYNTAX, "Unable to locate '%s'. Contact an administrator!", params); break; } } /*SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gps [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "Business Types: 24/7, Ammunation, ClothesShop, Gym, Restaurant, AdAgency, Club, ToolShop"); SendClientMessage(playerid, COLOR_SYNTAX, "General Locations: DMV, Bank, Paintball, Casino, VIP, Smuggledrugs, MatPickup1, MatPickup2"); SendClientMessage(playerid, COLOR_SYNTAX, "General Locations: Dealership, AirDealer, BoatDealer, MatFactory1, MatFactory2, Heisenbergs"); SendClientMessage(playerid, COLOR_SYNTAX, "Scripted Jobs: Pizzaman, Courier, Fisherman, Bodyguard, WeaponDealer, Mechanic, Miner, Sweeper"); SendClientMessage(playerid, COLOR_SYNTAX, "Scripted Jobs: TaxiDriver, DrugDealer, Lawyer, Detective, Thief");*/ } return 1; } CMD:ccp(playerid, params[]) { return callcmd::cancelcp(playerid, params); } CMD:kcp(playerid, params[]) { return callcmd::cancelcp(playerid, params); } CMD:killcp(playerid, params[]) { return callcmd::cancelcp(playerid, params); } CMD:killcheckpoint(playerid, params[]) { return callcmd::cancelcp(playerid, params); } CMD:cancelcp(playerid, params[]) { CancelActiveCheckpoint(playerid); SendClientMessage(playerid, COLOR_WHITE, "You have cancelled all active checkpoints."); return 1; } CMD:afk(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /afk [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pAdmin] >= 8 && PlayerInfo[playerid][pAdmin] < 8) { return SendClientMessage(playerid, COLOR_GREY, "You're not authorized to check that player's AFK status."); } if(PlayerInfo[targetid][pAFK]) { SendClientMessageEx(playerid, COLOR_WHITE, "** %s has been marked as Away from keyboard for %i minutes.", GetPlayerRPName(targetid), PlayerInfo[targetid][pAFKTime] / 60); } else { SendClientMessageEx(playerid, COLOR_WHITE, "** %s is currently not marked as Away from keyboard.", GetPlayerRPName(targetid)); } return 1; } CMD:afklist(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_______ Away from Keyboard _______"); foreach(new i : Player) { if(PlayerInfo[i][pAdmin] >= 8 && PlayerInfo[playerid][pAdmin] < 8) continue; if(PlayerInfo[i][pAFK]) { SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s - Time: %i seconds", i, GetPlayerRPName(i), PlayerInfo[i][pAFKTime]); } } return 1; } CMD:atm(playerid, params[]) { for(new i = 0; i < sizeof(atmMachines); i ++) { if(IsPlayerInRangeOfPoint(playerid, 3.0, atmMachines[i][atmX], atmMachines[i][atmY], atmMachines[i][atmZ])) { ShowDialogToPlayer(playerid, DIALOG_ATM); return 1; } } if(GetNearbyAtm(playerid) >= 0) { ShowDialogToPlayer(playerid, DIALOG_ATM); return 1; } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any ATM machines."); return 1; } CMD:fixplayerid(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", targetid)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /fixplayerid [playerid]"); SendClientMessage(playerid, COLOR_SYNTAX, "Sometimes player IDs can become bugged causing sscanf to not identify that ID until server restart."); SendClientMessage(playerid, COLOR_SYNTAX, "(e.g. a command used upon a valid player ID saying the player is disconnected, invalid or offline.)"); return 1; } if(!IsPlayerConnected(targetid)) { SSCANF_Leave(targetid); } else { SSCANF_Join(targetid, GetPlayerNameEx(targetid), IsPlayerNPC(targetid)); } SendClientMessageEx(playerid, COLOR_WHITE, "** Player ID %i has been fixed.", targetid); return 1; } /*CMD:showrcon(playerid, params[]) { if(!PlayerInfo[playerid][pDeveloper]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } new rcon_password[128]; GetServerVarAsString("rcon_password", rcon_password, sizeof(rcon_password)); SendClientMessageEx(playerid, COLOR_WHITE, "** RCON Password: %s", rcon_password); return 1; }*/ CMD:disablevpn(playerid, params[]) { new status; if(PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", status) || !(0 <= status <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /disablevpn [0/1]"); } if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has disabled joining with VPN.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has enabled joining with VPN.", GetPlayerRPName(playerid)); } gDisabledVPN = status; return 1; } CMD:obscurent(playerid, params[]) { new status; if(PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", status) || !(0 <= status <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /obscurent [0/1]"); } if(!status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has disabled nametags obfuscation.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has enabled nametags obfuscation.", GetPlayerRPName(playerid)); } antiNT = status; return 1; } /* CMD:anticheat(playerid, params[]) { new status; if(PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", status) || !(0 <= status <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /anticheat [0/1]"); } if(status) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has enabled the server anticheat.", GetPlayerRPName(playerid)); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has disabled the server anticheat.", GetPlayerRPName(playerid)); } gAnticheat = status; return 1; } */ CMD:animhelp(playerid, params[]) { SendClientMessage(playerid, COLOR_GREEN, "______________________________________________________________________________"); SendClientMessage(playerid, COLOR_GREY2, "/dance, /wave, /point, /salute, /laugh, /cry, /deal, /sit, /lay, /fall, /handsup."); SendClientMessage(playerid, COLOR_GREY2, "/tired, /cower, /crack, /injured, /fishing, /reload, /aim, /bomb, /checktime."); SendClientMessage(playerid, COLOR_GREY2, "/dodge, /stop, /scratch, /what, /wash, /come, /hitch, /cpr, /slapass, /drunk."); SendClientMessage(playerid, COLOR_GREY2, "/vomit, /fucku, /taichi, /shifty, /smoke, /chat, /lean, /wank, /crossarms."); SendClientMessage(playerid, COLOR_GREY2, "/ghands, /rap, /dj, /walk, /fuckme, /bj, /kiss, /piss, /robman, /eat, /stopanim."); SendClientMessage(playerid, COLOR_GREEN, "______________________________________________________________________________"); return 1; } CMD:dance(playerid, params[]) { new count, animname[32], animlib[32]; if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1..4: SetPlayerSpecialAction(playerid, (SPECIAL_ACTION_DANCE1 + (strval(params) - 1))); case 5: ApplyAnimationEx(playerid, "DANCING", "DAN_Down_A", 4.1, 1, 0, 0, 0, 0); case 6: ApplyAnimationEx(playerid, "DANCING", "DAN_Left_A", 4.1, 1, 0, 0, 0, 0); case 7: ApplyAnimationEx(playerid, "DANCING", "DAN_Loop_A", 4.1, 1, 0, 0, 0, 0); case 8: ApplyAnimationEx(playerid, "DANCING", "DAN_Right_A", 4.1, 1, 0, 0, 0, 0); case 9: ApplyAnimationEx(playerid, "DANCING", "DAN_Up_A", 4.1, 1, 0, 0, 0, 0); case 10: ApplyAnimationEx(playerid, "DANCING", "dnce_M_a", 4.1, 1, 0, 0, 0, 0); case 11: ApplyAnimationEx(playerid, "DANCING", "dnce_M_b", 4.1, 1, 0, 0, 0, 0); case 12: ApplyAnimationEx(playerid, "DANCING", "dnce_M_c", 4.1, 1, 0, 0, 0, 0); case 13: ApplyAnimationEx(playerid, "DANCING", "dnce_M_d", 4.1, 1, 0, 0, 0, 0); case 14: ApplyAnimationEx(playerid, "DANCING", "dnce_M_e", 4.1, 1, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /dance [1-14]"); } foreach(new i : Player) { if(IsPlayerInRangeOfPlayer(i, playerid, 20.0)) { GetAnimationName(GetPlayerAnimationIndex(i), animlib, sizeof(animlib), animname, sizeof(animname)); if((SPECIAL_ACTION_DANCE1 <= GetPlayerSpecialAction(i) <= SPECIAL_ACTION_DANCE4) || !strcmp(animlib, "DANCING", true)) { count++; } } } if(count >= 5) { foreach(new i : Player) { if(IsPlayerInRangeOfPlayer(i, playerid, 20.0)) { GetAnimationName(GetPlayerAnimationIndex(i), animlib, sizeof(animlib), animname, sizeof(animname)); if((SPECIAL_ACTION_DANCE1 <= GetPlayerSpecialAction(i) <= SPECIAL_ACTION_DANCE4) || !strcmp(animlib, "DANCING", true)) { AwardAchievement(i, "Flash mob"); } } } } return 1; } CMD:wave(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "ON_LOOKERS", "wave_loop", 4.1, 1, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "PED", "endchat_03", 4.1, 0, 0, 0, 0, 0); case 3: ApplyAnimationEx(playerid, "KISSING", "gfwave2", 4.1, 0, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /wave [1-3]"); } return 1; } CMD:point(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "ON_LOOKERS", "panic_point", 4.1, 0, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "ON_LOOKERS", "point_loop", 4.1, 1, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /point [1-2]"); } return 1; } CMD:salute(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "ON_LOOKERS", "Pointup_loop", 4.1, 1, 0, 0, 0, 0); return 1; } CMD:laugh(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "RAPPING", "Laugh_01", 4.1, 1, 0, 0, 0, 0); return 1; } CMD:cry(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "GRAVEYARD", "mrnF_loop", 4.1, 1, 0, 0, 0, 0); return 1; } CMD:deal(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "DEALER", "shop_pay", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:sit(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "BEACH", "ParkSit_M_loop", 4.1, 1, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "BEACH", "ParkSit_W_loop", 4.1, 1, 0, 0, 0, 0); case 3: ApplyAnimationEx(playerid, "MISC", "SEAT_LR", 4.1, 0, 0, 0, 1, 0); case 4: ApplyAnimationEx(playerid, "MISC", "Seat_talk_01", 4.1, 1, 0, 0, 0, 0); case 5: ApplyAnimationEx(playerid, "PED", "SEAT_down", 4.1, 0, 0, 0, 1, 0); case 6: ApplyAnimationEx(playerid, "INT_OFFICE", "OFF_Sit_Bored_Loop", 4.1, 1, 0, 0, 0, 0); case 7: ApplyAnimationEx(playerid, "INT_OFFICE", "OFF_Sit_Read", 4.1, 1, 0, 0, 0, 0); case 8: ApplyAnimationEx(playerid, "INT_OFFICE", "OFF_Sit_Crash", 4.1, 1, 0, 0, 0, 0); case 9: ApplyAnimationEx(playerid, "FOOD", "FF_Sit_Eat1", 4.1, 1, 0, 0, 0, 0); case 10: ApplyAnimationEx(playerid, "CRIB", "PED_Console_Loop", 4.1, 0, 0, 0, 1, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sit [1-10]"); } return 1; } CMD:lay(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "BEACH", "bather", 4.1, 1, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "BEACH", "Lay_Bac_Loop", 4.1, 1, 0, 0, 0, 0); case 3: ApplyAnimationEx(playerid, "BEACH", "SitnWait_loop_W", 4.1, 1, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /lay [1-3]"); } return 1; } CMD:fall(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "PED", "KO_skid_front", 4.1, 0, 0, 0, 1, 0); case 2: ApplyAnimationEx(playerid, "PED", "KO_skid_back", 4.1, 0, 0, 0, 1, 0); case 3: ApplyAnimationEx(playerid, "PED", "KO_shot_face", 4.1, 0, 1, 1, 1, 0); case 4: ApplyAnimationEx(playerid, "PED", "KO_shot_front", 4.1, 0, 1, 1, 1, 0); case 5: ApplyAnimationEx(playerid, "PED", "KO_shot_stom", 4.1, 0, 1, 1, 1, 0); case 6: ApplyAnimationEx(playerid, "PED", "BIKE_fallR", 4.1, 0, 1, 1, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /fall [1-6]"); } return 1; } CMD:handsup(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "SHOP", "SHP_HandsUp_Scr", 4.1, 0, 0, 0, 1, 0); return 1; } CMD:tired(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "PED", "IDLE_tired", 4.1, 1, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "FAT", "IDLE_tired", 4.1, 1, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /tired [1-2]"); } return 1; } CMD:hide(playerid, params[]) { return callcmd::cower(playerid, params); } CMD:cover(playerid, params[]) { return callcmd::cower(playerid, params); } CMD:cower(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "PED", "cower", 4.1, 1, 0, 0, 0, 0); return 1; } CMD:crack(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "CRACK", "crckdeth1", 4.1, 0, 0, 0, 1, 0); case 2: ApplyAnimationEx(playerid, "CRACK", "crckdeth2", 4.1, 1, 0, 0, 0, 0); case 3: ApplyAnimationEx(playerid, "CRACK", "crckdeth3", 4.1, 0, 0, 0, 1, 0); case 4: ApplyAnimationEx(playerid, "CRACK", "crckdeth4", 4.1, 0, 0, 0, 1, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /crack [1-4]"); } return 1; } CMD:injured(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "SWAT", "gnstwall_injurd", 4.1, 1, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "SWEET", "Sweet_injuredloop", 4.1, 1, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /injured [1-2]"); } return 1; } CMD:fishing(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "SAMP", "FishingIdle", 4.1, 0, 0, 0, 1, 0); return 1; } CMD:reload(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "BUDDY", "buddy_reload", 4.1, 0, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "PYTHON", "python_reload", 4.1, 0, 0, 0, 0, 0); case 3: ApplyAnimationEx(playerid, "UZI", "UZI_reload", 4.1, 0, 0, 0, 0, 0); case 4: ApplyAnimationEx(playerid, "RIFLE", "RIFLE_load", 4.1, 0, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /reload [1-4]"); } return 1; } CMD:aim(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "SHOP", "ROB_loop", 4.1, 1, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "PED", "ARRESTgun", 4.1, 0, 0, 0, 1, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /aim [1-2]"); } return 1; } CMD:bomb(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "BOMBER", "BOM_Plant", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:checktime(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "COP_AMBIENT", "Coplook_watch", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:dodge(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "DODGE", "Crush_Jump", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:stop(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "PED", "endchat_01", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:scratch(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "MISC", "Scratchballs_01", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:what(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "RIOT", "RIOT_ANGRY", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:wash(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "BD_FIRE", "wash_up", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:come(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "WUZI", "Wuzi_follow", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:hitch(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "MISC", "Hiker_Pose", 4.1, 0, 0, 0, 1, 0); return 1; } CMD:cpr(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "MEDIC", "CPR", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:slapass(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "SWEET", "sweet_ass_slap", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:drunk(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "PED", "WALK_DRUNK", 4.1, 1, 1, 1, 1, 1); return 1; } CMD:vomit(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "FOOD", "EAT_Vomit_P", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:fucku(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "PED", "fucku", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:taichi(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "PARK", "Tai_Chi_Loop", 4.1, 1, 0, 0, 0, 0); return 1; } CMD:shifty(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "SHOP", "ROB_Shifty", 4.1, 0, 0, 0, 0, 0); return 1; } CMD:smoke(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "SMOKING", "M_smklean_loop", 4.1, 1, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "SMOKING", "M_smk_in", 4.1, 0, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /smoke [1-2]"); } return 1; } CMD:chat(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "PED", "IDLE_CHAT", 4.1, 1, 1, 1, 1, 1); case 2: ApplyAnimationEx(playerid, "GANGS", "prtial_gngtlkA", 4.1, 1, 1, 1, 1, 1); case 3: ApplyAnimationEx(playerid, "GANGS", "prtial_gngtlkB", 4.1, 1, 1, 1, 1, 1); case 4: ApplyAnimationEx(playerid, "GANGS", "prtial_gngtlkC", 4.1, 1, 1, 1, 1, 1); case 5: ApplyAnimationEx(playerid, "GANGS", "prtial_gngtlkD", 4.1, 1, 1, 1, 1, 1); case 6: ApplyAnimationEx(playerid, "GANGS", "prtial_gngtlkE", 4.1, 1, 1, 1, 1, 1); case 7: ApplyAnimationEx(playerid, "GANGS", "prtial_gngtlkF", 4.1, 1, 1, 1, 1, 1); case 8: ApplyAnimationEx(playerid, "GANGS", "prtial_gngtlkG", 4.1, 1, 1, 1, 1, 1); case 9: ApplyAnimationEx(playerid, "GANGS", "prtial_gngtlkH", 4.1, 1, 1, 1, 1, 1); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /chat [1-9]"); } return 1; } CMD:lean(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "GANGS", "leanIDLE", 4.1, 1, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "MISC", "Plyrlean_loop", 4.1, 1, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /lean [1-2]"); } return 1; } CMD:wank(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "PAULNMAC", "wank_loop", 4.1, 1, 0, 0, 0, 0); return 1; } CMD:traffic(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "POLICE", "CopTraf_Stop", 4.1, 0, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "POLICE", "CopTraf_Come", 4.1, 0, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /traffic [1-2]"); } return 1; } CMD:rap(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "RAPPING", "RAP_A_LOOP", 4.1, 1, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "RAPPING", "RAP_B_LOOP", 4.1, 1, 0, 0, 0, 0); case 3: ApplyAnimationEx(playerid, "RAPPING", "RAP_C_LOOP", 4.1, 1, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /rap [1-3]"); } return 1; } CMD:dj(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "SCRATCHING", "scdldlp", 4.1, 1, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "SCRATCHING", "scdlulp", 4.1, 1, 0, 0, 0, 0); case 3: ApplyAnimationEx(playerid, "SCRATCHING", "scdrdlp", 4.1, 1, 0, 0, 0, 0); case 4: ApplyAnimationEx(playerid, "SCRATCHING", "scdrulp", 4.1, 1, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /dj [1-4]"); } return 1; } CMD:crossarms(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "COP_AMBIENT", "Coplook_loop", 4.1, 1, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "DEALER", "DEALER_IDLE", 4.1, 1, 0, 0, 0, 0); case 3: ApplyAnimationEx(playerid, "GRAVEYARD", "mrnM_loop", 4.1, 1, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /crossarms [1-3]"); } return 1; } CMD:ghands(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "GHANDS", "gsign1", 4.1, 0, 0, 0, 0, 0); case 2: ApplyAnimationEx(playerid, "GHANDS", "gsign1LH", 4.1, 0, 0, 0, 0, 0); case 3: ApplyAnimationEx(playerid, "GHANDS", "gsign2", 4.1, 0, 0, 0, 0, 0); case 4: ApplyAnimationEx(playerid, "GHANDS", "gsign2LH", 4.1, 0, 0, 0, 0, 0); case 5: ApplyAnimationEx(playerid, "GHANDS", "gsign3", 4.1, 0, 0, 0, 0, 0); case 6: ApplyAnimationEx(playerid, "GHANDS", "gsign3LH", 4.1, 0, 0, 0, 0, 0); case 7: ApplyAnimationEx(playerid, "GHANDS", "gsign4", 4.1, 0, 0, 0, 0, 0); case 8: ApplyAnimationEx(playerid, "GHANDS", "gsign4LH", 4.1, 0, 0, 0, 0, 0); case 9: ApplyAnimationEx(playerid, "GHANDS", "gsign5", 4.1, 0, 0, 0, 0, 0); case 10: ApplyAnimationEx(playerid, "GHANDS", "gsign5LH", 4.1, 0, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /ghands [1-10]"); } return 1; } CMD:walk(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "PED", "WALK_gang1", 4.1, 1, 1, 1, 1, 1); case 2: ApplyAnimationEx(playerid, "PED", "WALK_gang2", 4.1, 1, 1, 1, 1, 1); case 3: ApplyAnimationEx(playerid, "PED", "WALK_civi", 4.1, 1, 1, 1, 1, 1); case 4: ApplyAnimationEx(playerid, "PED", "WALK_armed", 4.1, 1, 1, 1, 1, 1); case 5: ApplyAnimationEx(playerid, "PED", "WALK_fat", 4.1, 1, 1, 1, 1, 1); case 6: ApplyAnimationEx(playerid, "PED", "WALK_fatold", 4.1, 1, 1, 1, 1, 1); case 7: ApplyAnimationEx(playerid, "PED", "WALK_old", 4.1, 1, 1, 1, 1, 1); case 8: ApplyAnimationEx(playerid, "PED", "WALK_player", 4.1, 1, 1, 1, 1, 1); case 9: ApplyAnimationEx(playerid, "PED", "WALK_shuffle", 4.1, 1, 1, 1, 1, 1); case 10: ApplyAnimationEx(playerid, "PED", "WALK_Wuzi", 4.1, 1, 1, 1, 1, 1); case 11: ApplyAnimationEx(playerid, "PED", "WOMAN_walkbusy", 4.1, 1, 1, 1, 1, 1); case 12: ApplyAnimationEx(playerid, "PED", "WOMAN_walkfatold", 4.1, 1, 1, 1, 1, 1); case 13: ApplyAnimationEx(playerid, "PED", "WOMAN_walknorm", 4.1, 1, 1, 1, 1, 1); case 14: ApplyAnimationEx(playerid, "PED", "WOMAN_walksexy", 4.1, 1, 1, 1, 1, 1); case 15: ApplyAnimationEx(playerid, "PED", "WOMAN_walkpro", 4.1, 1, 1, 1, 1, 1); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /walk [1-15]"); } return 1; } CMD:fuckme(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "SNM", "SPANKING_IDLEW", 4.1, 0, 1, 1, 1, 0); case 2: ApplyAnimationEx(playerid, "SNM", "SPANKING_IDLEP", 4.1, 0, 1, 1, 1, 0); case 3: ApplyAnimationEx(playerid, "SNM", "SPANKINGW", 4.1, 0, 1, 1, 1, 0); case 4: ApplyAnimationEx(playerid, "SNM", "SPANKINGP", 4.1, 0, 1, 1, 1, 0); case 5: ApplyAnimationEx(playerid, "SNM", "SPANKEDW", 4.1, 0, 1, 1, 1, 0); case 6: ApplyAnimationEx(playerid, "SNM", "SPANKEDP", 4.1, 0, 1, 1, 1, 0); case 7: ApplyAnimationEx(playerid, "SNM", "SPANKING_ENDW", 4.1, 0, 1, 1, 1, 0); case 8: ApplyAnimationEx(playerid, "SNM", "SPANKING_ENDP", 4.1, 0, 1, 1, 1, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /fuckme [1-8]"); } return 1; } CMD:bj(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_COUCH_START_P", 4.1, 0, 1, 1, 1, 0); case 2: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_COUCH_START_W", 4.1, 0, 1, 1, 1, 0); case 3: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_COUCH_LOOP_P", 4.1, 0, 1, 1, 1, 0); case 4: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_COUCH_LOOP_W", 4.1, 0, 1, 1, 1, 0); case 5: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_COUCH_END_P", 4.1, 0, 1, 1, 1, 0); case 6: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_COUCH_END_W", 4.1, 0, 1, 1, 1, 0); case 7: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_STAND_START_P", 4.1, 0, 1, 1, 1, 0); case 8: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_STAND_START_W", 4.1, 0, 1, 1, 1, 0); case 9: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_STAND_LOOP_P", 4.1, 1, 0, 0, 0, 0); case 10: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_STAND_LOOP_W", 4.1, 1, 0, 0, 0, 0); case 11: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_STAND_END_P", 4.1, 0, 1, 1, 1, 0); case 12: ApplyAnimationEx(playerid, "BLOWJOBZ", "BJ_STAND_END_W", 4.1, 0, 1, 1, 1, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /bj [1-12]"); } return 1; } CMD:kiss(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "KISSING", "Playa_Kiss_01", 4.0, 0, 0, 0, 0, 0); return 1; } CMD:piss(playerid, params[]) { if(!PlayerUseAnims(playerid) || GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } SetPlayerSpecialAction(playerid, 68); return 1; } CMD:robman(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } ApplyAnimationEx(playerid, "SHOP", "ROB_Loop_Threat", 4.0, 1, 0, 0, 0, 0); return 1; } CMD:eat(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use animations at this moment."); } switch(strval(params)) { case 1: ApplyAnimation(playerid, "FOOD", "EAT_Chicken", 4.1, 0, 0, 0, 0, 0); case 2: ApplyAnimation(playerid, "FOOD", "EAT_Burger", 4.1, 0, 0, 0, 0, 0); case 3: ApplyAnimation(playerid, "FOOD", "EAT_Pizza", 4.1, 0, 0, 0, 0, 0); default: SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /eat [1-3]"); } return 1; } CMD:stopani(playerid, params[]) { return callcmd::stopanim(playerid, params); } CMD:stopanim(playerid, params[]) { if(!PlayerUseAnims(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You're currently unable to use this command at this moment."); } PlayerInfo[playerid][pLoopAnim] = 0; ClearAnimations(playerid, 1); TextDrawHideForPlayer(playerid, AnimationTD); ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0, 1); SendClientMessage(playerid, COLOR_GREY, "Animations cleared."); return 1; } /*CMD:gmx(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 8 && !PlayerInfo[playerid][pDeveloper]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params) && strcmp(params, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gmx [confirm]"); SendClientMessage(playerid, COLOR_SYNTAX, "This command save all player accounts and restarts the server."); return 1; } if(gGMX) { return SendClientMessage(playerid, COLOR_GREY, "You have already called for a server restart. You can't cancel it."); } gGMX = 1; foreach(new i : Player) { if(i != playerid) { if(PlayerInfo[i][pAdminDuty]) { callcmd::aduty(i, ""); } PlayerInfo[i][pHurt] = 0; TogglePlayerControllable(i, 0); SendClientMessageEx(i, COLOR_AQUA, "** %s has initated a server restart. You have been frozen.", GetPlayerRPName(playerid)); } SavePlayerVariables(i); GameTextForPlayer(i, "~w~Restarting server...", 100000, 3); } SendClientMessage(playerid, COLOR_WHITE, "** The server will restart once all accounts have been saved."); return 1; }*/ CMD:changepass(playerid, params[]) { ShowPlayerDialog(playerid, DIALOG_CHANGEPASS, DIALOG_STYLE_INPUT, "{FF1AFF}Emerald City Roleplay{FFFFFF} | Change password", "Please change your password for security purposes\nEnter your new password below:", "Submit", "Cancel"); return 1; } CMD:usecookies(playerid, params[]) { if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJoinedEvent] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(PlayerInfo[playerid][pHurt] - 40 > 0) { return SendClientMessageEx(playerid, COLOR_GREY, "You are too hurt to use this command. Please wait %i seconds before trying again.", (PlayerInfo[playerid][pHurt] - 40)); } if(!IsPlayerInRangeOfPoint(playerid, 8.0, -187.5627,1210.4631,19.7021)) { return SendClientMessage(playerid, COLOR_GREY, "You are not at the cookies shop."); } if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command from within the vehicle."); } new string[1536] = "Perk\tDescription\tCost", title[64]; strcat(string, "\nNumber\tChoose a phone number of your choice.\t{F7A763}10 cookies{FFFFFF}"); strcat(string, "\nJob\tChoose a job to 1x level up.\t{F7A763}10 cookies{FFFFFF}"); strcat(string, "\nDouble XP\tAwards you with 8 hours of double XP.\t{F7A763}20 cookies{FFFFFF}"); strcat(string, "\nVehicle\tFree vehicle ticket under $200k value.\t{F7A763}30 cookies{FFFFFF}"); strcat(string, "\nHouse\tFree house ticket under $250k value.\t{F7A763}60 cookies{FFFFFF}"); strcat(string, "\nVIP\t1 month Limited VIP subscription\t{F7A763}100 cookies{FFFFFF}"); strcat(string, "\nBusiness\tFree business ticket of any type.\t{F7A763}200 cookies{FFFFFF}"); format(title, sizeof(title), "cookie rewards (You have %i cookies.)", PlayerInfo[playerid][pCookies]); ShowPlayerDialog(playerid, DIALOG_USECOOKIES, DIALOG_STYLE_TABLIST_HEADERS, title, string, "Redeem", "Cancel"); return 1; } CMD:clothing(playerid, params[]) { new string[MAX_PLAYER_CLOTHING * 64], title[64], count; for(new i = 0; i < MAX_PLAYER_CLOTHING; i ++) { if(ClothingInfo[playerid][i][cExists]) { if(ClothingInfo[playerid][i][cAttached]) { format(string, sizeof(string), "%s\n{C8C8C8}%i) {00AA00}%s {FFD700}(Attached)", string, i + 1, ClothingInfo[playerid][i][cName]); } else { format(string, sizeof(string), "%s\n{C8C8C8}%i) {00AA00}%s{FFFFFF}", string, i + 1, ClothingInfo[playerid][i][cName]); } count++; } else { format(string, sizeof(string), "%s\n{C8C8C8}%i) {AFAFAF}Empty Slot{FFFFFF}", string, i + 1); } } format(title, sizeof(title), "My clothing items (%i/%i slots)", count, MAX_PLAYER_CLOTHING); ShowPlayerDialog(playerid, DIALOG_CLOTHING, DIALOG_STYLE_LIST, title, string, "Select", "Cancel"); return 1; } CMD:taketest(playerid, params[]) { if(!IsPlayerInRangeOfPoint(playerid, 3.0, -2033.2953, -117.4508, 1035.1719)) { return SendClientMessage(playerid, COLOR_GREY, "You are not at the desk in the Licensing department."); } if(PlayerInfo[playerid][pCarLicense]) { return SendClientMessage(playerid, COLOR_GREY, "You have your drivers license already."); } if(PlayerInfo[playerid][pDrivingTest]) { return SendClientMessage(playerid, COLOR_GREY, "You are already taking your drivers test."); } if(PlayerInfo[playerid][pCash] < 500) { return SendClientMessage(playerid, COLOR_GREY, "You need $500 to pay the licensing fee if you pass the test."); } SendClientMessage(playerid, COLOR_WHITE, "** You've taken on the drivers test. Go outside and enter one of the vehicles to begin."); SendClientMessage(playerid, COLOR_WHITE, "** Once you have passed the test, you will receive your license and pay a $3000 licensing fee."); PlayerInfo[playerid][pTestVehicle] = INVALID_VEHICLE_ID; PlayerInfo[playerid][pDrivingTest] = 1; PlayerInfo[playerid][pTestCP] = 0; return 1; } CMD:spawncar(playerid, params[]) { //mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT modelid, pos_x, pos_y, pos_z, world FROM vehicles WHERE ownerid = %i", PlayerInfo[playerid][pID]); //mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LIST_VEHICLES, playerid); SendClientMessage(playerid, COLOR_WHITE, "This command was removed. /carstorage if you wish to spawn your car now."); return 1; } CMD:carstorage(playerid, params[]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT id, modelid, pos_x, pos_y, pos_z, world FROM vehicles WHERE ownerid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_CAR_STORAGE, playerid); return 1; } CMD:vst(playerid, params[]) { return callcmd::carstorage(playerid, params); } CMD:vstorage(playerid, params[]) { return callcmd::carstorage(playerid, params); } CMD:park(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), id = VehicleInfo[vehicleid][vID]; if(!vehicleid || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle of yours."); } if(!IsVehicleOwner(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't park this vehicle as it doesn't belong to you."); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s parks their %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have parked your {00AA00}%s{33CCFF} which will spawn in this spot from now on.", GetVehicleName(vehicleid)); // Save the vehicle's information. GetVehiclePos(vehicleid, VehicleInfo[vehicleid][vPosX], VehicleInfo[vehicleid][vPosY], VehicleInfo[vehicleid][vPosZ]); GetVehicleZAngle(vehicleid, VehicleInfo[vehicleid][vPosA]); VehicleInfo[vehicleid][vInterior] = GetPlayerInterior(playerid); VehicleInfo[vehicleid][vWorld] = GetPlayerVirtualWorld(playerid); // Update the database record with the new information, then despawn the vehicle. mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET pos_x = '%f', pos_y = '%f', pos_z = '%f', pos_a = '%f', interior = %i, world = %i WHERE id = %i", VehicleInfo[vehicleid][vPosX], VehicleInfo[vehicleid][vPosY], VehicleInfo[vehicleid][vPosZ], VehicleInfo[vehicleid][vPosA], VehicleInfo[vehicleid][vInterior], VehicleInfo[vehicleid][vWorld], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); DespawnVehicle(vehicleid); // Finally, we reload the vehicle from the database. mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM vehicles WHERE id = %i", id); mysql_tquery(connectionID, queryBuffer, "OnPlayerSpawnVehicle", "ii", playerid, true); return 1; } CMD:givekeys(playerid, params[]) { new targetid, vehicleid = GetPlayerVehicleID(playerid); if(!vehicleid || !IsVehicleOwner(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any vehicle of yours."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /givekeys [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't give keys to yourself."); } if(PlayerInfo[targetid][pVehicleKeys] == vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "That player already has keys to your vehicle."); } PlayerInfo[targetid][pVehicleKeys] = vehicleid; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s gives %s the keys to their %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), GetVehicleName(vehicleid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you the keys to their {00AA00}%s{33CCFF}.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %s the keys to your {00AA00}%s{33CCFF}.", GetPlayerRPName(targetid), GetVehicleName(vehicleid)); return 1; } CMD:takekeys(playerid, params[]) { new targetid, vehicleid = GetPlayerVehicleID(playerid); if(!vehicleid || !IsVehicleOwner(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any vehicle of yours."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /takekeys [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't take keys from yourself."); } if(PlayerInfo[targetid][pVehicleKeys] != vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "That player doesn't have the keys to your vehicle."); } PlayerInfo[targetid][pVehicleKeys] = INVALID_VEHICLE_ID; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes back the keys to their %s from %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), GetVehicleName(vehicleid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has taken back the keys to their {00AA00}%s{33CCFF}.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have taken back the keys to your {00AA00}%s{33CCFF} from %s.", GetPlayerRPName(targetid), GetVehicleName(vehicleid)); return 1; } CMD:despawncar(playerid, params[]) { /*new string[MAX_SPAWNED_VEHICLES * 64], count; string = "#\tModel\tLocation"; foreach(new i: Vehicle) { if(IsValidVehicle(i) && VehicleInfo[i][vID] > 0 && IsVehicleOwner(playerid, i)) { format(string, sizeof(string), "%s\n%i\t%s\t%s", string, count + 1, GetVehicleName(i), GetVehicleZoneName(i)); count++; } } if(!count) { SendClientMessage(playerid, COLOR_GREY, "You have no vehicles spawned at the moment."); } else { ShowPlayerDialog(playerid, DIALOG_DESPAWNCAR, DIALOG_STYLE_TABLIST_HEADERS, "Choose a vehicle to despawn.", string, "Select", "Cancel"); }*/ SendClientMessage(playerid, COLOR_WHITE, "This command was removed. /carstorage if you wish to despawn your car now."); return 1; } CMD:findcar(playerid, params[]) { new string[MAX_SPAWNED_VEHICLES * 64], count; string = "#\tModel\tLocation"; foreach(new i: Vehicle) { if(VehicleInfo[i][vID] > 0 && IsVehicleOwner(playerid, i)) { format(string, sizeof(string), "%s\n%i\t%s\t%s", string, count + 1, GetVehicleName(i), GetVehicleZoneName(i)); count++; } } if(!count) { SendClientMessage(playerid, COLOR_GREY, "You have no vehicles spawned at the moment."); } else { ShowPlayerDialog(playerid, DIALOG_FINDCAR, DIALOG_STYLE_TABLIST_HEADERS, "Choose a vehicle to track.", string, "Select", "Cancel"); } return 1; } CMD:upgradevehicle(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), option[8], param[32]; if(!vehicleid || !IsVehicleOwner(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any vehicle of yours."); } if(sscanf(params, "s[8]S()[32]", option, param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /upgradevehicle [trunk | neon | alarm | plate]"); } new id = GetNearestDealerShip(playerid, TYPE_CAR); if(id==-1) return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any car dealership."); // There's a dealership, let's make sure he's at a decent distance from it. if(!IsPlayerInRangeOfPoint(playerid, 8, dsData[id][dX], dsData[id][dY], dsData[id][dZ])) return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any car dealership."); if(!strcmp(option, "trunk", true)) { if(isnull(param) || strcmp(param, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /upgradevehicle [trunk] [confirm]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "Your vehicle's trunk level is at %i/3. Upgrading your trunk will cost you $10,000.", VehicleInfo[vehicleid][vTrunk]); return 1; } if(VehicleInfo[vehicleid][vTrunk] >= 3) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle's trunk is already at its maximum level."); } if(PlayerInfo[playerid][pCash] < 10000) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money to upgrade your trunk."); } VehicleInfo[vehicleid][vTrunk]++; GivePlayerCash(playerid, -10000); GameTextForPlayer(playerid, "~r~-$10000", 5000, 1); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET trunk = %i WHERE id = %i", VehicleInfo[vehicleid][vTrunk], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You have paid $10,000 for trunk level %i/3. '/vstash balance' to see your new capacities.", VehicleInfo[vehicleid][vTrunk]); Log_Write("log_property", "%s (uid: %i) upgraded the trunk of their %s (id: %i) to level %i/3.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID], VehicleInfo[vehicleid][vTrunk]); } else if(!strcmp(option, "neon", true)) { if(isnull(param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /upgradevehicle [neon] [color] (costs $30,000)"); SendClientMessage(playerid, COLOR_SYNTAX, "List of colors: Red, Blue, Green, Yellow, Pink, White"); return 1; } if(PlayerInfo[playerid][pCash] < 30000) { return SendClientMessage(playerid, COLOR_GREY, "You need at least $30,000 to upgrade your neon."); } if(!VehicleHasWindows(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't support neon."); } if(!strcmp(param, "red", true)) { SetVehicleNeon(vehicleid, 18647); GivePlayerCash(playerid, -30000); GameTextForPlayer(playerid, "~r~-$30000", 5000, 1); SendClientMessage(playerid, COLOR_GREEN, "You have paid $30,000 for red neon. You can use /neon to toggle your neon."); Log_Write("log_property", "%s (uid: %i) purchased red neon for their %s (id: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); } else if(!strcmp(param, "blue", true)) { SetVehicleNeon(vehicleid, 18648); GivePlayerCash(playerid, -30000); GameTextForPlayer(playerid, "~r~-$30000", 5000, 1); SendClientMessage(playerid, COLOR_GREEN, "You have paid $30,000 for blue neon. You can use /neon to toggle your neon."); Log_Write("log_property", "%s (uid: %i) purchased blue neon for their %s (id: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); } else if(!strcmp(param, "green", true)) { SetVehicleNeon(vehicleid, 18649); GivePlayerCash(playerid, -30000); GameTextForPlayer(playerid, "~r~-$30000", 5000, 1); SendClientMessage(playerid, COLOR_GREEN, "You have paid $30,000 for green neon. You can use /neon to toggle your neon."); Log_Write("log_property", "%s (uid: %i) purchased green neon for their %s (id: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); } else if(!strcmp(param, "yellow", true)) { SetVehicleNeon(vehicleid, 18650); GivePlayerCash(playerid, -30000); GameTextForPlayer(playerid, "~r~-$30000", 5000, 1); SendClientMessage(playerid, COLOR_GREEN, "You have paid $30,000 for yellow neon. You can use /neon to toggle your neon."); Log_Write("log_property", "%s (uid: %i) purchased yellow neon for their %s (id: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); } else if(!strcmp(param, "pink", true)) { SetVehicleNeon(vehicleid, 18651); GivePlayerCash(playerid, -30000); GameTextForPlayer(playerid, "~r~-$30000", 5000, 1); SendClientMessage(playerid, COLOR_GREEN, "You have paid $30,000 for pink neon. You can use /neon to toggle your neon."); Log_Write("log_property", "%s (uid: %i) purchased pink neon for their %s (id: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); } else if(!strcmp(param, "white", true)) { SetVehicleNeon(vehicleid, 18652); GivePlayerCash(playerid, -30000); GameTextForPlayer(playerid, "~r~-$30000", 5000, 1); SendClientMessage(playerid, COLOR_GREEN, "You have paid $30,000 for white neon. You can use /neon to toggle your neon."); Log_Write("log_property", "%s (uid: %i) purchased white neon for their %s (id: %i)", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); } } else if(!strcmp(option, "alarm", true)) { new level; if(sscanf(param, "i", level)) { SendClientMessage(playerid, COLOR_WHITE, "** Level 1: Alarm sound effects and notification to owner. {FFD700}($15,000)"); SendClientMessage(playerid, COLOR_WHITE, "** Level 2: Alarm sound effects and notification to owner and online LEO. {FFD700}($30,000)"); SendClientMessage(playerid, COLOR_WHITE, "** Level 3: Alarm alarm effects and notification to owner and blip for online LEO. {FFD700}($60,000)"); SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /upgradevehicle [alarm] [level]"); return 1; } if(!(1 <= level <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid level."); } switch(level) { case 1: { if(VehicleInfo[vehicleid][vAlarm] == 1) { return SendClientMessage(playerid, COLOR_GREY, "Your vehicle's alarm is already at this level."); } if(PlayerInfo[playerid][pCash] < 15000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this alarm level."); } VehicleInfo[vehicleid][vAlarm] = 1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET alarm = 1 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -15000); GameTextForPlayer(playerid, "~r~-$15000", 5000, 1); SendClientMessage(playerid, COLOR_GREEN, "You have paid $15,000 to install a level 1 alarm on your vehicle."); Log_Write("log_property", "%s (uid: %i) purchased a level 1 alarm for their %s (id: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); } case 2: { if(VehicleInfo[vehicleid][vAlarm] == 2) { return SendClientMessage(playerid, COLOR_GREY, "Your vehicle's alarm is already at this level."); } if(PlayerInfo[playerid][pCash] < 30000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this alarm level."); } VehicleInfo[vehicleid][vAlarm] = 2; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET alarm = 2 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -30000); GameTextForPlayer(playerid, "~r~-$30000", 5000, 1); SendClientMessage(playerid, COLOR_GREEN, "You have paid $30,000 to install a level 2 alarm on your vehicle."); Log_Write("log_property", "%s (uid: %i) purchased a level 1 alarm for their %s (id: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); } case 3: { if(VehicleInfo[vehicleid][vAlarm] == 3) { return SendClientMessage(playerid, COLOR_GREY, "Your vehicle's alarm is already at this level."); } if(PlayerInfo[playerid][pCash] < 60000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this alarm level."); } VehicleInfo[vehicleid][vAlarm] = 3; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET alarm = 3 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); GivePlayerCash(playerid, -60000); GameTextForPlayer(playerid, "~r~-$60000", 5000, 1); SendClientMessage(playerid, COLOR_GREEN, "You have paid $60,000 to install a level 3 alarm on your vehicle."); Log_Write("log_property", "%s (uid: %i) purchased a level 3 alarm for their %s (id: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); } } } else if(!strcmp(option, "plate", true)) { if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /upgradevehicle [plate] [text] (costs $20,000)"); } if(!VehicleHasEngine(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no license plate. Therefore you can't buy this upgrade."); } strcpy(VehicleInfo[vehicleid][vPlate], param, 32); SetVehicleNumberPlate(vehicleid, param); ResyncVehicle(vehicleid); GivePlayerCash(playerid, -20000); GameTextForPlayer(playerid, "~r~-$20000", 5000, 1); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET plate = '%e' WHERE id = %i", param, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You have paid $20,000 for license plate '%s'. Changes will take effect once vehicle is parked.", param); Log_Write("log_property", "%s (uid: %i) paid $20000 to set the license plate of their %s (id: %i) to %s.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID], param); } return 1; } CMD:neon(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!vehicleid || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle of yours."); } if(!IsVehicleOwner(playerid, vehicleid) && PlayerInfo[playerid][pVehicleKeys] != vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as this vehicle doesn't belong to you."); } if(!VehicleInfo[vehicleid][vNeon]) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no neon installed."); } if(!VehicleInfo[vehicleid][vNeonEnabled]) { VehicleInfo[vehicleid][vNeonEnabled] = 1; GameTextForPlayer(playerid, "~g~Neon activated", 3000, 3); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s presses a button to activate their neon tubes.", GetPlayerRPName(playerid)); //SendClientMessage(playerid, COLOR_AQUA, "** Neon enabled. The tubes appear under your vehicle."); } else { VehicleInfo[vehicleid][vNeonEnabled] = 0; GameTextForPlayer(playerid, "~r~Neon deactivated", 3000, 3); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s presses a button to deactivate their neon tubes.", GetPlayerRPName(playerid)); //SendClientMessage(playerid, COLOR_AQUA, "** Neon disabled."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET neonenabled = %i WHERE id = %i", VehicleInfo[vehicleid][vNeonEnabled], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); ReloadVehicleNeon(vehicleid); return 1; } CMD:vstash(playerid, params[]) { new vehicleid = GetNearbyVehicle(playerid); if(vehicleid != INVALID_VEHICLE_ID && IsVehicleOwner(playerid, vehicleid)) { new option[14], param[32]; if(!VehicleInfo[vehicleid][vTrunk]) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no trunk installed. /upgradevehicle to purchase one."); } if(sscanf(params, "s[14]S()[32]", option, param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [balance | deposit | withdraw]"); } if(!strcmp(option, "balance", true)) { new count; for(new i = 0; i < 5; i ++) { if(VehicleInfo[vehicleid][vWeapons][i]) { count++; } } SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Stash Balance ______"); SendClientMessageEx(playerid, COLOR_GREY2, "Cash: $%i/$%i", VehicleInfo[vehicleid][vCash], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_CASH)); SendClientMessageEx(playerid, COLOR_GREY2, "Materials: %i/%i | Weapons: %i/%i", VehicleInfo[vehicleid][vMaterials], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_MATERIALS), count, GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_WEAPONS)); SendClientMessageEx(playerid, COLOR_GREY2, "Weed: %i/%i grams | Cocaine: %i/%i grams", VehicleInfo[vehicleid][vWeed], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_WEED), VehicleInfo[vehicleid][vCocaine], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_COCAINE)); SendClientMessageEx(playerid, COLOR_GREY2, "Meth: %i/%i grams | Painkillers: %i/%i pills", VehicleInfo[vehicleid][vMeth], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_METH), VehicleInfo[vehicleid][vPainkillers], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_PAINKILLERS)); if(count > 0) { SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Stash Weapons ______"); for(new i = 0; i < 5; i ++) { if(VehicleInfo[vehicleid][vWeapons][i]) { SendClientMessageEx(playerid, COLOR_GREY2, "[%i] Weapon: %s", i + 1, GetWeaponNameEx(VehicleInfo[vehicleid][vWeapons][i])); } } } } else if(!strcmp(option, "deposit", true)) { new value; if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command from within the vehicle."); } if(sscanf(param, "s[14]S()[32]", option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [deposit] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Cash, Materials, Weed, Cocaine, Meth, Painkillers, Weapon"); return 1; } if(!strcmp(option, "cash", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [deposit] [cash] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pCash]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(VehicleInfo[vehicleid][vCash] + value > GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_CASH)) { return SendClientMessageEx(playerid, COLOR_GREY, "Your vehicle's stash can only hold up to %s at its level.", FormatNumber(GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_CASH))); } GivePlayerCash(playerid, -value); VehicleInfo[vehicleid][vCash] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET cash = %i WHERE id = %i", VehicleInfo[vehicleid][vCash], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %s in your vehicle stash.", FormatNumber(value)); } else if(!strcmp(option, "materials", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [deposit] [materials] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pMaterials]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(VehicleInfo[vehicleid][vMaterials] + value > GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_MATERIALS)) { return SendClientMessageEx(playerid, COLOR_GREY, "Your vehicle's stash can only hold up to %i materials at its level.", GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_MATERIALS)); } PlayerInfo[playerid][pMaterials] -= value; VehicleInfo[vehicleid][vMaterials] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET materials = %i WHERE id = %i", VehicleInfo[vehicleid][vMaterials], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %i materials in your vehicle stash.", value); } else if(!strcmp(option, "weed", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [deposit] [weed] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pWeed]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(VehicleInfo[vehicleid][vWeed] + value > GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_WEED)) { return SendClientMessageEx(playerid, COLOR_GREY, "Your vehicle's stash can only hold up to %i grams of weed at its level.", GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_WEED)); } PlayerInfo[playerid][pWeed] -= value; VehicleInfo[vehicleid][vWeed] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET weed = %i WHERE id = %i", VehicleInfo[vehicleid][vWeed], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %ig of weed in your vehicle stash.", value); } else if(!strcmp(option, "cocaine", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [deposit] [cocaine] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pCocaine]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(VehicleInfo[vehicleid][vCocaine] + value > GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_COCAINE)) { return SendClientMessageEx(playerid, COLOR_GREY, "Your vehicle's stash can only hold up to %i grams of cocaine at its level.", GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_COCAINE)); } PlayerInfo[playerid][pCocaine] -= value; VehicleInfo[vehicleid][vCocaine] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET cocaine = %i WHERE id = %i", VehicleInfo[vehicleid][vCocaine], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %ig of cocaine in your vehicle stash.", value); } else if(!strcmp(option, "meth", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [deposit] [meth] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pMeth]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(VehicleInfo[vehicleid][vMeth] + value > GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_METH)) { return SendClientMessageEx(playerid, COLOR_GREY, "Your vehicle's stash can only hold up to %i grams of meth at its level.", GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_METH)); } PlayerInfo[playerid][pMeth] -= value; VehicleInfo[vehicleid][vMeth] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET meth = %i WHERE id = %i", VehicleInfo[vehicleid][vMeth], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %ig of meth in your vehicle stash.", value); } else if(!strcmp(option, "painkillers", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [deposit] [painkillers] [amount]"); } if(value < 1 || value > PlayerInfo[playerid][pPainkillers]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(VehicleInfo[vehicleid][vPainkillers] + value > GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_PAINKILLERS)) { return SendClientMessageEx(playerid, COLOR_GREY, "Your vehicle's stash can only hold up to %i painkillers at its level.", GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_PAINKILLERS)); } PlayerInfo[playerid][pPainkillers] -= value; VehicleInfo[vehicleid][vPainkillers] += value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET painkillers = %i WHERE id = %i", VehicleInfo[vehicleid][vPainkillers], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[playerid][pPainkillers], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored %i painkillers in your vehicle stash.", value); } else if(!strcmp(option, "weapon", true)) { new weaponid; if(sscanf(param, "i", weaponid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [deposit] [weapon] [weaponid] (/guninv for weapon IDs)"); } if(!(1 <= weaponid <= 46) || PlayerInfo[playerid][pWeapons][weaponSlotIDs[weaponid]] != weaponid) { return SendClientMessage(playerid, COLOR_GREY, "You don't have that weapon. /guninv for a list of your weapons."); } if(IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "Law enforcement is prohibited from storing weapons."); } if(GetPlayerHealthEx(playerid) < 60) { return SendClientMessage(playerid, COLOR_GREY, "You can't store weapons as your health is below 60."); } for(new i = 0; i < GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_WEAPONS); i ++) { if(!VehicleInfo[vehicleid][vWeapons][i]) { VehicleInfo[vehicleid][vWeapons][i] = weaponid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET weapon_%i = %i WHERE id = %i", i + 1, VehicleInfo[vehicleid][vWeapons][i], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); RemovePlayerWeapon(playerid, weaponid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have stored a %s in slot %i of your vehicle stash.", GetWeaponNameEx(VehicleInfo[vehicleid][vWeapons][i]), i + 1); return 1; } } SendClientMessage(playerid, COLOR_GREY, "This vehicle has no more slots available for weapons."); } } else if(!strcmp(option, "withdraw", true)) { new value; if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command from within the vehicle."); } if(sscanf(param, "s[14]S()[32]", option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [withdraw] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Cash, Weed, Cocaine, Meth, Painkillers, Weapon"); return 1; } if(!strcmp(option, "cash", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [withdraw] [cash] [amount]"); } if(value < 1 || value > VehicleInfo[vehicleid][vCash]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } GivePlayerCash(playerid, value); VehicleInfo[vehicleid][vCash] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET cash = %i WHERE id = %i", VehicleInfo[vehicleid][vCash], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %s from your vehicle stash.", FormatNumber(value)); } else if(!strcmp(option, "materials", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [withdraw] [materials] [amount]"); } if(value < 1 || value > VehicleInfo[vehicleid][vMaterials]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pMaterials] + value > GetPlayerCapacity(playerid, CAPACITY_MATERIALS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i materials. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMaterials], GetPlayerCapacity(playerid, CAPACITY_MATERIALS)); } PlayerInfo[playerid][pMaterials] += value; VehicleInfo[vehicleid][vMaterials] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET materials = %i WHERE id = %i", VehicleInfo[vehicleid][vMaterials], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = %i WHERE uid = %i", PlayerInfo[playerid][pMaterials], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %i materials from your vehicle stash.", value); } else if(!strcmp(option, "weed", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [withdraw] [weed] [amount]"); } if(value < 1 || value > VehicleInfo[vehicleid][vWeed]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pWeed] + value > GetPlayerCapacity(playerid, CAPACITY_WEED)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i weed. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pWeed], GetPlayerCapacity(playerid, CAPACITY_WEED)); } PlayerInfo[playerid][pWeed] += value; VehicleInfo[vehicleid][vWeed] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET weed = %i WHERE id = %i", VehicleInfo[vehicleid][vWeed], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %ig of weed from your vehicle stash.", value); } else if(!strcmp(option, "cocaine", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [withdraw] [cocaine] [amount]"); } if(value < 1 || value > VehicleInfo[vehicleid][vCocaine]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pCocaine] + value > GetPlayerCapacity(playerid, CAPACITY_COCAINE)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i cocaine. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pCocaine], GetPlayerCapacity(playerid, CAPACITY_COCAINE)); } PlayerInfo[playerid][pCocaine] += value; VehicleInfo[vehicleid][vCocaine] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET cocaine = %i WHERE id = %i", VehicleInfo[vehicleid][vCocaine], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %ig of cocaine from your vehicle stash.", value); } else if(!strcmp(option, "meth", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [withdraw] [meth] [amount]"); } if(value < 1 || value > VehicleInfo[vehicleid][vMeth]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pMeth] + value > GetPlayerCapacity(playerid, CAPACITY_METH)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i meth. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pMeth], GetPlayerCapacity(playerid, CAPACITY_METH)); } PlayerInfo[playerid][pMeth] += value; VehicleInfo[vehicleid][vMeth] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET meth = %i WHERE id = %i", VehicleInfo[vehicleid][vMeth], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %ig of meth from your vehicle stash.", value); } else if(!strcmp(option, "painkillers", true)) { if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vstash [withdraw] [painkillers] [amount]"); } if(value < 1 || value > VehicleInfo[vehicleid][vPainkillers]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(PlayerInfo[playerid][pPainkillers] + value > GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i painkillers. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pPainkillers], GetPlayerCapacity(playerid, CAPACITY_PAINKILLERS)); } PlayerInfo[playerid][pPainkillers] += value; VehicleInfo[vehicleid][vPainkillers] -= value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET painkillers = %i WHERE id = %i", VehicleInfo[vehicleid][vPainkillers], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[playerid][pPainkillers], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken %i painkillers from your vehicle stash.", value); } else if(!strcmp(option, "weapon", true)) { new slots = GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_WEAPONS); if(sscanf(param, "i", value)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /vstash [withdraw] [weapon] [slot (1-%i)]", slots); } if(!(1 <= value <= slots)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid slot, or the slot specified is locked."); } if(!VehicleInfo[vehicleid][vWeapons][value-1]) { return SendClientMessage(playerid, COLOR_GREY, "The slot specified contains no weapon which you can take."); } if(PlayerInfo[playerid][pHours] < 2 || PlayerInfo[playerid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are either weapon restricted or you played less than two playing hours."); } GivePlayerWeaponEx(playerid, VehicleInfo[vehicleid][vWeapons][value-1]); SendClientMessageEx(playerid, COLOR_AQUA, "** You have taken a %s from slot %i of your vehicle stash.", GetWeaponNameEx(VehicleInfo[vehicleid][vWeapons][value-1]), value); VehicleInfo[vehicleid][vWeapons][value-1] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET weapon_%i = 0 WHERE id = %i", value, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } } } else { SendClientMessage(playerid, COLOR_GREY, "You are not in range of any vehicle of yours."); } return 1; } CMD:unmod(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!vehicleid || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle of yours."); } if(!IsVehicleOwner(playerid, vehicleid) && PlayerInfo[playerid][pVehicleKeys] != vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as this vehicle doesn't belong to you."); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /unmod [color | paintjob | mods | neon]"); } if(!strcmp(params, "color", true)) { VehicleInfo[vehicleid][vColor1] = 0; VehicleInfo[vehicleid][vColor2] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET color1 = 0, color2 = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); ChangeVehicleColor(vehicleid, 0, 0); SendClientMessage(playerid, COLOR_WHITE, "** Vehicle color has been set back to default."); } else if(!strcmp(params, "paintjob", true)) { VehicleInfo[vehicleid][vPaintjob] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET paintjob = -1 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); ChangeVehiclePaintjob(vehicleid, 3); SendClientMessage(playerid, COLOR_WHITE, "** Vehicle paintjob has been set back to default."); } else if(!strcmp(params, "mods", true)) { for(new i = 0; i < 14; i ++) { if(VehicleInfo[vehicleid][vMods][i] >= 1000) { RemoveVehicleComponent(vehicleid, VehicleInfo[vehicleid][vMods][i]); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET mod_1 = 0, mod_2 = 0, mod_3 = 0, mod_4 = 0, mod_5 = 0, mod_6 = 0, mod_7 = 0, mod_8 = 0, mod_9 = 0, mod_10 = 0, mod_11 = 0, mod_12 = 0, mod_13 = 0, mod_14 = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_WHITE, "** All vehicle modifications have been removed."); } else if(!strcmp(params, "neon", true)) { if(!VehicleInfo[vehicleid][vNeon]) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no neon which you can remove."); } if(VehicleInfo[vehicleid][vNeonEnabled]) { DestroyDynamicObject(VehicleInfo[vehicleid][vObjects][0]); DestroyDynamicObject(VehicleInfo[vehicleid][vObjects][1]); } VehicleInfo[vehicleid][vNeon] = 0; VehicleInfo[vehicleid][vNeonEnabled] = 0; VehicleInfo[vehicleid][vObjects][0] = INVALID_OBJECT_ID; VehicleInfo[vehicleid][vObjects][1] = INVALID_OBJECT_ID; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET neon = 0, neonenabled = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_WHITE, "** Neon has been removed from vehicle."); } return 1; } CMD:gunmod(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!vehicleid || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle of yours."); } if(VehicleInfo[vehicleid][vGang] >= 0 && VehicleInfo[vehicleid][vGang] != PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as this vehicle doesn't belong to your gang."); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gunmod [color | paintjob | mods]"); } if(!strcmp(params, "color", true)) { VehicleInfo[vehicleid][vColor1] = 0; VehicleInfo[vehicleid][vColor2] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET color1 = 0, color2 = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); ChangeVehicleColor(vehicleid, 0, 0); SendClientMessage(playerid, COLOR_WHITE, "** Vehicle color has been set back to default."); } else if(!strcmp(params, "paintjob", true)) { VehicleInfo[vehicleid][vPaintjob] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET paintjob = -1 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); ChangeVehiclePaintjob(vehicleid, 3); SendClientMessage(playerid, COLOR_WHITE, "** Vehicle paintjob has been set back to default."); } else if(!strcmp(params, "mods", true)) { for(new i = 0; i < 14; i ++) { if(VehicleInfo[vehicleid][vMods][i] >= 1000) { RemoveVehicleComponent(vehicleid, VehicleInfo[vehicleid][vMods][i]); } } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET mod_1 = 0, mod_2 = 0, mod_3 = 0, mod_4 = 0, mod_5 = 0, mod_6 = 0, mod_7 = 0, mod_8 = 0, mod_9 = 0, mod_10 = 0, mod_11 = 0, mod_12 = 0, mod_13 = 0, mod_14 = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_WHITE, "** All vehicle modifications have been removed."); } return 1; } CMD:colorcar(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), color1, color2; if(!IsPlayerInRangeOfPoint(playerid, 3.0, -83.6833,1124.6606,19.7422)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the modding garage."); } if(sscanf(params, "ii", color1, color2)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /colorcar [color1] [color2]"); } if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are not sitting inside any vehicle."); } if(VehicleInfo[vehicleid][vOwnerID] > 0 && !IsVehicleOwner(playerid, vehicleid) && !PlayerHasJob(playerid, JOB_MECHANIC)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't belong to you, therefore you can't respray it."); } if(VehicleInfo[vehicleid][vOwnerID] > 0 && !IsVehicleOwner(playerid, vehicleid) && PlayerInfo[playerid][pMechanicSkill] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You must be a skill level 5 mechanic to paint cars you dont own."); } if(!(0 <= color1 <= 255) || !(0 <= color2 <= 255)) { return SendClientMessage(playerid, COLOR_GREY, "The color specified must range between 0 and 255."); } if(!PlayerHasJob(playerid, JOB_MECHANIC)) { if(VehicleInfo[vehicleid][vOwnerID] > 0 || VehicleInfo[vehicleid][vGang] >= 0) { VehicleInfo[vehicleid][vColor1] = color1; VehicleInfo[vehicleid][vColor2] = color2; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET color1 = %i, color2 = %i WHERE id = %i", color1, color2, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } SendClientMessageEx(playerid, COLOR_WHITE, "** Vehicle resprayed."); ChangeVehicleColor(vehicleid, color1, color2); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); return 1; } if(PlayerHasJob(playerid, JOB_MECHANIC)) { if(PlayerInfo[playerid][pMechanicSkill] < 5) { if(VehicleInfo[vehicleid][vOwnerID] > 0 || VehicleInfo[vehicleid][vGang] >= 0) { VehicleInfo[vehicleid][vColor1] = color1; VehicleInfo[vehicleid][vColor2] = color2; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET color1 = %i, color2 = %i WHERE id = %i", color1, color2, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } SendClientMessageEx(playerid, COLOR_WHITE, "** Vehicle resprayed."); ChangeVehicleColor(vehicleid, color1, color2); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); return 1; } if(PlayerInfo[playerid][pComponents] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough components for this."); } if(VehicleInfo[vehicleid][vOwnerID] > 0 || VehicleInfo[vehicleid][vGang] >= 0) { VehicleInfo[vehicleid][vColor1] = color1; VehicleInfo[vehicleid][vColor2] = color2; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET color1 = %i, color2 = %i WHERE id = %i", color1, color2, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } PlayerInfo[playerid][pComponents]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET components = %i WHERE uid = %i", PlayerInfo[playerid][pComponents], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s sprays the vehicle to a different color.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_WHITE, "** Vehicle resprayed. You have %i components left.", PlayerInfo[playerid][pComponents]); ChangeVehicleColor(vehicleid, color1, color2); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); return 1; } return 1; } CMD:paintcar(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), paintjobid; if(!IsPlayerInRangeOfPoint(playerid, 3.0, -83.6833,1124.6606,19.7422)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the modding garage."); } if(sscanf(params, "i", paintjobid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /paintcar [paintjobid (-1 = none)]"); } if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are not sitting inside any vehicle."); } if(VehicleInfo[vehicleid][vOwnerID] > 0 && !IsVehicleOwner(playerid, vehicleid) && !PlayerHasJob(playerid, JOB_MECHANIC)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't belong to you, therefore you can't respray it."); } if(VehicleInfo[vehicleid][vOwnerID] > 0 && !IsVehicleOwner(playerid, vehicleid) && PlayerInfo[playerid][pMechanicSkill] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You must be a skill level 5 mechanic to paint cars you dont own."); } if(!(-1 <= paintjobid <= 5)) { return SendClientMessage(playerid, COLOR_GREY, "The paintjob specified must range between -1 and 5."); } if(paintjobid == -1) paintjobid = 3; if(!PlayerHasJob(playerid, JOB_MECHANIC)) { if(VehicleInfo[vehicleid][vOwnerID] > 0 || VehicleInfo[vehicleid][vGang] >= 0) { VehicleInfo[vehicleid][vPaintjob] = paintjobid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET paintjob = %i WHERE id = %i", paintjobid, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } SendClientMessageEx(playerid, COLOR_WHITE, "** Vehicle resprayed."); ChangeVehiclePaintjob(vehicleid, paintjobid); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); return 1; } if(PlayerHasJob(playerid, JOB_MECHANIC)) { if(PlayerInfo[playerid][pMechanicSkill] < 5) { if(VehicleInfo[vehicleid][vOwnerID] > 0 || VehicleInfo[vehicleid][vGang] >= 0) { VehicleInfo[vehicleid][vPaintjob] = paintjobid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET paintjob = %i WHERE id = %i", paintjobid, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } SendClientMessageEx(playerid, COLOR_WHITE, "** Vehicle resprayed."); ChangeVehiclePaintjob(vehicleid, paintjobid); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); return 1; } if(PlayerInfo[playerid][pComponents] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough components for this."); } if(VehicleInfo[vehicleid][vOwnerID] > 0 || VehicleInfo[vehicleid][vGang] >= 0) { VehicleInfo[vehicleid][vPaintjob] = paintjobid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET paintjob = %i WHERE id = %i", paintjobid, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); } PlayerInfo[playerid][pComponents]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET components = %i WHERE uid = %i", PlayerInfo[playerid][pComponents], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s sprays the vehicle to a different color.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_WHITE, "** Vehicle resprayed. You have %i components left.", PlayerInfo[playerid][pComponents]); ChangeVehiclePaintjob(vehicleid, paintjobid); PlayerPlaySound(playerid, 1134, 0.0, 0.0, 0.0); return 1; } return 1; } CMD:sellcar(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), targetid, amount; if(!vehicleid || !IsVehicleOwner(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any vehicle of yours."); } if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellcar [playerid] [amount]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell to yourself."); } if(amount < 1) { return SendClientMessage(playerid, COLOR_GREY, "You must specify an amount above zero."); } if(PlayerInfo[playerid][pCP] == CHECKPOINT_DROPCAR) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell your vehicle unless you cancel your car delivery. (/killcp)"); } PlayerInfo[targetid][pCarOffer] = playerid; PlayerInfo[targetid][pCarOffered] = vehicleid; PlayerInfo[targetid][pCarPrice] = amount; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered you their %s for %s (/accept vehicle).", GetPlayerRPName(playerid), GetVehicleName(vehicleid), FormatNumber(amount)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered %s to buy your %s for %s.", GetPlayerRPName(targetid), GetVehicleName(vehicleid), FormatNumber(amount)); return 1; } CMD:sellmyvehicle(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!vehicleid || !IsVehicleOwner(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any vehicle of yours."); } new id = GetNearestDealerShip(playerid, -1); if(id==-1) return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any dealership."); // There's a dealership, let's make sure he's at a decent distance from it. if(!IsPlayerInRangeOfPoint(playerid, 8, dsData[id][dX], dsData[id][dY], dsData[id][dZ])) return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any dealership."); new price = percent(GetVehicleValue(vehicleid), 75); if(strcmp(params, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellmyvehicle [confirm]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "This command permanently deletes your vehicle. You will receive %s back.", FormatNumber(price)); return 1; } GivePlayerCash(playerid, price); SendClientMessageEx(playerid, COLOR_GREEN, "You have sold your %s to the dealership and received %s back.", GetVehicleName(vehicleid), FormatNumber(price)); Log_Write("log_property", "%s (uid: %i) sold their %s (id: %i) to the dealership for $%i", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID], price); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM vehicles WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); DespawnVehicle(vehicleid, false); return 1; } CMD:harvest(playerid, params[]) { if(PlayerInfo[playerid][pJob] != JOB_FARMER && PlayerInfo[playerid][pSecondJob] != JOB_FARMER) { return SendClientMessage(playerid, COLOR_GREY, "You are not a Farmer!"); } if(PlayerInfo[playerid][pCP] != CHECKPOINT_NONE) { return SendClientMessage(playerid, COLOR_GREY, "You must cancel your active checkpoint first. /cancelcp to cancel it."); } new vehicleid = GetPlayerVehicleID(playerid); if(IsAFarmerCar(vehicleid) && GetPlayerState(playerid) == PLAYER_STATE_DRIVER) { GameTextForPlayer(playerid, "Proceed to the~n~Checkpoint", 5000, 3); SendClientMessage(playerid, COLOR_AQUA, "Follow the checkpoints to harvest the crops."); SetPlayerCheckpoint(playerid, -118.5861,97.2261,2.6873, 10); PlayerInfo[playerid][pCP] = CHECKPOINT_FARMER; Harvesting[playerid] = 1; } else return SendClientMessage(playerid, COLOR_GREY, "FARMER: You must be driving a farming vehicle!"); return 1; } CMD:mine(playerid, params[]) { if(!PlayerHasJob(playerid, JOB_MINER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Miner."); } if(PlayerInfo[playerid][pMiningTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are mining already. Wait until you are done."); } if(PlayerInfo[playerid][pMiningRock] > 0 && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY) { return SendClientMessage(playerid, COLOR_GREY, "You need to drop off your current rock first."); } if(!IsPlayerInMiningArea(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the mining area."); } if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) { return SendClientMessage(playerid, COLOR_GREY, "You must be onfoot in order to use this command."); } GameTextForPlayer(playerid, "~w~Mining...", 6000, 3); ApplyAnimation(playerid, "BASEBALL", "BAT_4", 4.1, 1, 0, 0, 0, 0, 1); DisablePlayerCheckpoint(playerid); SetPlayerAttachedObject(playerid, 9, 337, 6); PlayerInfo[playerid][pMiningTime] = 6; return 1; } CMD:startsweeping(playerid, params[]) { if(!PlayerHasJob(playerid, JOB_SWEEPER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Street Sweeper."); } if(PlayerInfo[playerid][pSweeping]) { return SendClientMessage(playerid, COLOR_GREY, "You are sweeping already. /stopsweeping to stop."); } if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 574) { return SendClientMessage(playerid, COLOR_GREY, "You are not sitting inside a Sweeper."); } PlayerInfo[playerid][pSweeping] = 1; PlayerInfo[playerid][pSweepTime] = 30; PlayerInfo[playerid][pSweepEarnings] = 0; SendClientMessage(playerid, COLOR_WHITE, "** You are now sweeping. Drive around with your sweeper to earn money towards your paycheck."); SendClientMessage(playerid, COLOR_WHITE, "** When you are finished your sweeping shift, use /stopsweeping in order to end your shift."); return 1; } CMD:stopsweeping(playerid, params[]) { if(!PlayerHasJob(playerid, JOB_SWEEPER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Street Sweeper."); } if(!PlayerInfo[playerid][pSweeping]) { return SendClientMessage(playerid, COLOR_GREY, "You are not sweeping right now."); } SendClientMessageEx(playerid, COLOR_AQUA, "** You are no longer sweeping. You earned a total of {00AA00}$%i{33CCFF} towards your paycheck during your shift.", PlayerInfo[playerid][pSweepEarnings]); PlayerInfo[playerid][pSweeping] = 0; PlayerInfo[playerid][pSweepTime] = 0; PlayerInfo[playerid][pSweepEarnings] = 0; return 1; } CMD:v(playerid, params[]) { return callcmd::vip(playerid, params); } CMD:vip(playerid, params[]) { if(!PlayerInfo[playerid][pVIPPackage]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you don't have a VIP subscription."); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /(v)ip [vip chat]"); } if(PlayerInfo[playerid][pToggleVIP]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the VIP chat as you have it toggled."); } foreach(new i : Player) { if(PlayerInfo[i][pVIPPackage] > 0 && !PlayerInfo[i][pToggleVIP]) { SendClientMessageEx(i, COLOR_VIP, "** %s %s: %s **", GetVIPRank(PlayerInfo[playerid][pVIPPackage]), GetPlayerRPName(playerid), params); } } return 1; } CMD:viptag(playerid, params[]) { if(!PlayerInfo[playerid][pVIPPackage]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you don't have a VIP subscription."); } if(PlayerInfo[playerid][pAcceptedHelp]) { return SendClientMessage(playerid, COLOR_GREY, "You can't enable your VIP tag until you stop assisting. (/return)"); } if(PlayerInfo[playerid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You can't enable your VIP tag until you are off admin duty."); } if(PlayerInfo[playerid][pTagType] != TAG_VIP) { if(PlayerInfo[playerid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You can't enable your VIP tag while on admin duty."); } if(PlayerInfo[playerid][pAcceptedHelp]) { return SendClientMessage(playerid, COLOR_GREY, "You can't enable your VIP tag while assisting someone."); } SetPlayerSpecialTag(playerid, TAG_VIP); SendClientMessage(playerid, COLOR_AQUA, "** You have enabled the VIP tag above your head."); } else { SetPlayerSpecialTag(playerid, TAG_NONE); SendClientMessage(playerid, COLOR_AQUA, "** You have removed the VIP tag from above your head."); } return 1; } CMD:vipcolor(playerid, params[]) { if(!PlayerInfo[playerid][pVIPPackage]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you don't have a VIP subscription."); } if(!PlayerInfo[playerid][pVIPColor]) { PlayerInfo[playerid][pVIPColor] = 1; SendClientMessage(playerid, COLOR_AQUA, "** You have enabled the VIP nametag color."); } else { PlayerInfo[playerid][pVIPColor] = 0; SendClientMessage(playerid, COLOR_AQUA, "** You have disabled the VIP nametag color."); } return 1; } CMD:vipinvite(playerid, params[]) { new targetid; if(!PlayerInfo[playerid][pVIPPackage]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you don't have a VIP subscription."); } if((PlayerInfo[playerid][pVIPTime] - gettime()) < 259200) { return SendClientMessage(playerid, COLOR_GREY, "Your VIP subscription expires in less than 3 days. You can't do this now."); } if(sscanf(params, "u", targetid)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vipinvite [playerid]"); SendClientMessage(playerid, COLOR_SYNTAX, "This command grants a temporary VIP subscription which lasts one hour to a player of your choice."); if(PlayerInfo[playerid][pVIPCooldown] > gettime()) { SendClientMessageEx(playerid, COLOR_SYNTAX, "You can only use this command once every 24 hours. You have %i hours left until you can use it again.", (PlayerInfo[playerid][pVIPCooldown] - gettime()) / 3600); } else { SendClientMessage(playerid, COLOR_SYNTAX, "You can only use this command once every 24 hours. You currently have no cooldown for this command."); } return 1; } if(PlayerInfo[playerid][pVIPCooldown] > gettime()) { return SendClientMessageEx(playerid, COLOR_GREY, "You have already used this command today. Please wait another %i hours.", (PlayerInfo[playerid][pVIPCooldown] - gettime()) / 3600); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(PlayerInfo[targetid][pVIPPackage]) { return SendClientMessage(playerid, COLOR_GREY, "That player already has a VIP subscription."); } PlayerInfo[targetid][pVIPPackage] = PlayerInfo[playerid][pVIPPackage]; PlayerInfo[targetid][pVIPTime] = gettime() + 10800; PlayerInfo[playerid][pVIPCooldown] = gettime() + 86400; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET vippackage = %i, viptime = %i WHERE uid = %i", PlayerInfo[targetid][pVIPPackage], PlayerInfo[targetid][pVIPTime], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET vipcooldown = %i WHERE uid = %i", PlayerInfo[playerid][pVIPCooldown], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "** %s has given you a temporary three hour {D909D9}%s{33CCFF} VIP package.", GetPlayerRPName(playerid), GetVIPRank(PlayerInfo[targetid][pVIPPackage])); SendClientMessageEx(playerid, COLOR_AQUA, "** You have given %s a temporary three hour {D909D9}%s{33CCFF} VIP package.", GetPlayerRPName(targetid), GetVIPRank(PlayerInfo[targetid][pVIPPackage])); Log_Write("log_vip", "%s VIP %s (uid: %i) has given %s (uid: %i) a temporary three hour package.", GetVIPRank(PlayerInfo[playerid][pVIPPackage]), GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); return 1; } CMD:vipinfo(playerid, params[]) { if(!PlayerInfo[playerid][pVIPPackage]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you don't have a VIP subscription."); } SendClientMessageEx(playerid, COLOR_NAVYBLUE, "______ VIP Package ______"); SendClientMessageEx(playerid, COLOR_GREY2, "Your {D909D9}%s{C8C8C8} VIP subscription expires on %s.", GetVIPRank(PlayerInfo[playerid][pVIPPackage]), GetDateFromTimestamp(PlayerInfo[playerid][pVIPTime], 4)); if(PlayerInfo[playerid][pVIPCooldown] > gettime()) { new time = PlayerInfo[playerid][pVIPCooldown] - gettime(); if(time > 3600) { SendClientMessageEx(playerid, COLOR_GREY2, "You will be able to use the /vipinvite command again in %i hours.", time / 3600); } else { SendClientMessageEx(playerid, COLOR_GREY2, "You will be able to use the /vipinvite command again in %i minutes.", time / 60); } } else { SendClientMessageEx(playerid, COLOR_GREY2, "Your cooldown period for /vipinvite is over and you may use it again."); } return 1; } CMD:vipnumber(playerid, params[]) { new number; if(!PlayerInfo[playerid][pVIPPackage]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you don't have a VIP subscription."); } if(sscanf(params, "i", number)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vipnumber [phone number]"); SendClientMessage(playerid, COLOR_SYNTAX, "This command costs $10,000 and changes your phone number to your chosen one."); return 1; } if(PlayerInfo[playerid][pCash] < 10000) { return SendClientMessage(playerid, COLOR_GREY, "You need at least $10,000 for pay for this."); } if(number == 0 || number == 911) { return SendClientMessage(playerid, COLOR_GREY, "Invalid number."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE phone = %i", number); mysql_tquery(connectionID, queryBuffer, "OnPlayerBuyPhoneNumber", "ii", playerid, number); return 1; } CMD:setfare(playerid, params[]) { new amount; if(!PlayerHasJob(playerid, JOB_TAXIDRIVER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Taxi Driver."); } if(sscanf(params, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setfare [amount]"); } if(!(0 <= amount <= 500)) { return SendClientMessage(playerid, COLOR_GREY, "The fare must range between $0 and $500."); } if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 420 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 438) { return SendClientMessage(playerid, COLOR_GREY, "You are not in a taxi type vehicle."); } if(amount == 0) { if(PlayerInfo[playerid][pTaxiFare] == 0) { return SendClientMessage(playerid, COLOR_GREY, "The fare is already set to zero."); } PlayerInfo[playerid][pTaxiFare] = 0; SendClientMessage(playerid, COLOR_YELLOW, "** You have set the fare to $0 and went off duty."); } else { if(PlayerInfo[playerid][pTaxiFare] == amount) { return SendClientMessage(playerid, COLOR_GREY, "The fare is already set to this amount."); } PlayerInfo[playerid][pTaxiFare] = amount; SendClientMessageToAllEx(COLOR_YELLOW, "** Taxi driver %s is now on duty, fare: $%i. /call taxi for a ride.", GetPlayerRPName(playerid), amount); } return 1; } CMD:createfaction(playerid, params[]) { new type[12], name[48], type_id = -1; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pFactionMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[12]s[48]", type, name)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /createfaction [type] [name]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: Police, Medic, News, Government, Hitman, Federal, Army"); return 1; } if(!strcmp(type, "police", true)) { type_id = FACTION_POLICE; } else if(!strcmp(type, "medic", true)) { type_id = FACTION_MEDIC; } else if(!strcmp(type, "news", true)) { type_id = FACTION_NEWS; } else if(!strcmp(type, "government", true)) { type_id = FACTION_GOVERNMENT; } else if(!strcmp(type, "hitman", true)) { type_id = FACTION_HITMAN; } else if(!strcmp(type, "federal", true)) { type_id = FACTION_FEDERAL; } else if(!strcmp(type, "army", true)) { type_id = FACTION_ARMY; } if(type_id == -1) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } for(new i = 0; i < MAX_FACTIONS; i ++) { if(!FactionInfo[i][fType]) { SetupFaction(i, name, type_id); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has created a {F7A763}%s{FF6347} faction named '%s'.", GetPlayerRPName(playerid), factionTypes[type_id], name); SendClientMessageEx(playerid, COLOR_WHITE, "** This faction's ID is %i. /editfaction to edit.", i); return 1; } } SendClientMessage(playerid, COLOR_GREY, "Faction slots are currently full. Ask developers to increase the internal limit."); return 1; } CMD:editfaction(playerid, params[]) { new factionid, option[12], param[48]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pFactionMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[12]S()[48]", factionid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Name, Shortname, Type, Color, RankCount, RankName, Skin, Paycheck, Leader, Turfcookies, Budget"); return 1; } if(!(0 <= factionid < MAX_FACTIONS) || FactionInfo[factionid][fType] == FACTION_NONE) { return SendClientMessage(playerid, COLOR_GREY, "Invalid faction."); } if(!strcmp(option, "name", true)) { if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [name] [text]"); } strcpy(FactionInfo[factionid][fName], param, 48); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET name = '%e' WHERE id = %i", param, factionid); mysql_tquery(connectionID, queryBuffer); ReloadLockers(factionid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the name of faction ID %i to '%s'.", GetPlayerRPName(playerid), factionid, param); } else if(!strcmp(option, "shortname", true)) { if(isnull(param) || strlen(param) > 24) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [shortname] [text]"); } strcpy(FactionInfo[factionid][fShortName], param, 24); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET shortname = '%e' WHERE id = %i", param, factionid); mysql_tquery(connectionID, queryBuffer); ReloadLockers(factionid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the short name of faction ID %i to '%s'.", GetPlayerRPName(playerid), factionid, param); } else if(!strcmp(option, "type", true)) { new type_id; if(isnull(param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [type] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: Police, Medic, News, Government, Hitman, Federal, Army"); return 1; } if(!strcmp(param, "police", true)) { type_id = FACTION_POLICE; } else if(!strcmp(param, "medic", true)) { type_id = FACTION_MEDIC; } else if(!strcmp(param, "news", true)) { type_id = FACTION_NEWS; } else if(!strcmp(param, "government", true)) { type_id = FACTION_GOVERNMENT; } else if(!strcmp(param, "hitman", true)) { type_id = FACTION_HITMAN; } else if(!strcmp(param, "federal", true)) { type_id = FACTION_FEDERAL; } else if(!strcmp(param, "army", true)) { type_id = FACTION_ARMY; } if(type_id == -1) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } FactionInfo[factionid][fType] = type_id; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET type = %i WHERE id = %i", type_id, factionid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the type of faction ID %i to %s.", GetPlayerRPName(playerid), factionid, factionTypes[type_id]); } else if(!strcmp(option, "color", true)) { new color; if(sscanf(param, "h", color)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [color] [0xRRGGBBAA]"); } FactionInfo[factionid][fColor] = color & ~0xff; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET color = %i WHERE id = %i", FactionInfo[factionid][fColor], factionid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the {%06x}color{FF6347} of faction ID %i.", GetPlayerRPName(playerid), color >>> 8, factionid); } else if(!strcmp(option, "rankcount", true)) { new ranks; if(sscanf(param, "i", ranks)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [rankcount] [amount]"); } if(!(1 <= ranks <= MAX_FACTION_RANKS)) { return SendClientMessageEx(playerid, COLOR_GREY, "The amount of ranks must range from 1 to %i.", MAX_FACTION_RANKS); } FactionInfo[factionid][fRankCount] = ranks; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET rankcount = %i WHERE id = %i", ranks, factionid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the rank count of faction ID %i to %i.", GetPlayerRPName(playerid), factionid, ranks); } else if(!strcmp(option, "rankname", true)) { new rankid, rank[32]; if(sscanf(param, "is[32]", rankid, rank)) { SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Rank Names ______"); for(new i = 0; i < FactionInfo[factionid][fRankCount]; i ++) { if(isnull(FactionRanks[factionid][i])) SendClientMessageEx(playerid, COLOR_GREY2, "Rank %i: (empty)", i); else SendClientMessageEx(playerid, COLOR_GREY2, "Rank %i: %s", i, FactionRanks[factionid][i]); } return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [rankname] [slot (0-%i)] [name]", FactionInfo[factionid][fRankCount] - 1); } if(!(0 <= rankid < FactionInfo[factionid][fRankCount])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid rank."); } strcpy(FactionRanks[factionid][rankid], rank, 32); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO factionranks VALUES(%i, %i, '%e') ON DUPLICATE KEY UPDATE name = '%e'", factionid, rankid, rank, rank); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set rank %i's name of faction ID %i to '%s'.", GetPlayerRPName(playerid), rankid, factionid, rank); } else if(!strcmp(option, "skin", true)) { new slot, skinid; if(sscanf(param, "ii", slot, skinid)) { SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Faction Skins ______"); for(new i = 0; i < MAX_FACTION_SKINS; i ++) { if(FactionInfo[factionid][fSkins][i] == 0) SendClientMessageEx(playerid, COLOR_GREY2, "Skin %i: (none)", i + 1); else SendClientMessageEx(playerid, COLOR_GREY2, "Skin %i: %i", i + 1, FactionInfo[factionid][fSkins][i]); } return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [skin] [slot (1-%i)] [skinid]", MAX_FACTION_SKINS); } if(!(1 <= slot <= MAX_FACTION_SKINS)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid slot."); } if(!(0 <= skinid <= 311)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid skin."); } slot--; FactionInfo[factionid][fSkins][slot] = skinid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO factionskins VALUES(%i, %i, %i) ON DUPLICATE KEY UPDATE skinid = %i", factionid, slot, skinid, skinid); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_WHITE, "** You have set the skin in slot %i to ID %i.", slot + 1, skinid); } else if(!strcmp(option, "paycheck", true)) { new rankid, amount; if(FactionInfo[factionid][fType] == FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "You can't set the paychecks for hitman factions."); } if(sscanf(param, "ii", rankid, amount)) { SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Rank Paychecks ______"); for(new i = 0; i < FactionInfo[factionid][fRankCount]; i ++) { if(isnull(FactionRanks[factionid][i])) SendClientMessageEx(playerid, COLOR_GREY2, "Rank %i: (empty)", i); else SendClientMessageEx(playerid, COLOR_GREY2, "Rank %i: %s ($%i)", i, FactionRanks[factionid][i], FactionInfo[factionid][fPaycheck][i]); } return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [paycheck] [slot (0-%i)] [amount]", FactionInfo[factionid][fRankCount] - 1); } if(!(0 <= rankid < FactionInfo[factionid][fRankCount])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid rank."); } if(!(0 <= amount <= 100000)) { return SendClientMessage(playerid, COLOR_GREY, "The amount must range from $0 to $100000."); } FactionInfo[factionid][fPaycheck][rankid] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO factionpay(id, rank, amount) VALUES(%i, %i, %i) ON DUPLICATE KEY UPDATE amount = %i", factionid, rankid, amount, amount); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set rank %i's paycheck of faction ID %i to $%i.", GetPlayerRPName(playerid), rankid, factionid, amount); } else if(!strcmp(option, "leader", true)) { new leader[MAX_PLAYER_NAME]; if(sscanf(param, "s[24]", leader)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [leader] [name]"); SendClientMessage(playerid, COLOR_SYNTAX, "This only updates the text for the leader's name in /factions. Use /switchfaction to appoint someone as faction leader."); return 1; } strcpy(FactionInfo[factionid][fLeader], leader, MAX_PLAYER_NAME); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET leader = '%e' WHERE id = %i", leader, factionid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the leader of faction ID %i to %s.", GetPlayerRPName(playerid), factionid, leader); } else if(!strcmp(option, "locker", true)) { SendClientMessage(playerid, COLOR_WHITE, "This option has been removed in favor of the dynamic locker system."); SendClientMessage(playerid, COLOR_WHITE, "Use /dynamichelp for a list of commands related to dynamic lockers."); } else if(!strcmp(option, "turfcookies", true)) { new amount; if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [turfcookies] [amount]"); } if(FactionInfo[factionid][fType] != FACTION_POLICE || FactionInfo[factionid][fType] != FACTION_FEDERAL || FactionInfo[factionid][fType] != FACTION_ARMY) { return SendClientMessage(playerid, COLOR_GREY, "You can only set the turf cookies for police factions."); } FactionInfo[factionid][fTurfcookies] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET turfcookies = %i WHERE id = %i", amount, factionid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the turf cookies of faction ID %i to %i.", GetPlayerRPName(playerid), factionid, amount); } else if(!strcmp(option, "budget", true)) { new amount; if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editfaction [factionid] [budget] [amount (max 100k)]"); } if(amount > 100000) { return SendClientMessage(playerid, COLOR_GREY, "Faction budget cannot be over $100,000!"); } FactionInfo[factionid][fBudget] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET budget = %i WHERE id = %i", FactionInfo[factionid][fBudget], factionid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set %s's faction budget to %i.", GetPlayerRPName(playerid), FactionInfo[factionid][fName], amount); } return 1; } CMD:purgefaction(playerid, params[]) { new factionid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pFactionMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", factionid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /purgefaction [factionid]"); } if(!(0 <= factionid < MAX_FACTIONS) || FactionInfo[factionid][fType] == FACTION_NONE) { return SendClientMessage(playerid, COLOR_GREY, "Invalid faction."); } foreach(new i : Player) { if(PlayerInfo[i][pFaction] == factionid) { SetPlayerFaction(i, -1); SendClientMessageEx(i, COLOR_LIGHTRED, "The faction you were apart of has been purged by an administrator."); } } strcpy(FactionInfo[factionid][fLeader], "No-one", MAX_PLAYER_NAME); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET faction = -1, factionrank = 0, division = -1 WHERE faction = %i", factionid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET leader = 'No-one' WHERE id = %i", factionid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has purged faction %s.", GetPlayerRPName(playerid), FactionInfo[factionid][fName]); Log_Write("log_faction", "%s (uid: %i) has purged faction %s (id: %i).", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], FactionInfo[factionid][fName], factionid); return 1; } CMD:removefaction(playerid, params[]) { new factionid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", factionid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removefaction [factionid]"); } if(!(0 <= factionid < MAX_FACTIONS) || FactionInfo[factionid][fType] == FACTION_NONE) { return SendClientMessage(playerid, COLOR_GREY, "Invalid faction."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has deleted faction %s.", GetPlayerRPName(playerid), FactionInfo[factionid][fName]); RemoveFaction(factionid); Log_Write("log_faction", "%s (uid: %i) has deleted faction %s (id: %i).", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], FactionInfo[factionid][fName], factionid); return 1; } CMD:switchfaction(playerid, params[]) { new targetid, factionid, rankid, leader; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pFactionMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "uiI(-1)I(0)", targetid, factionid, rankid, leader)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /switchfaction [playerid] [factionid (-1 = none)] [rank (optional)] [leader (0/1)]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(!(-1 <= factionid < MAX_FACTIONS) || (factionid >= 0 && FactionInfo[factionid][fType] == FACTION_NONE)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid faction."); } if((factionid != -1 && !(-1 <= rankid < FactionInfo[factionid][fRankCount]))) { return SendClientMessage(playerid, COLOR_GREY, "Invalid rank."); } if(factionid == -1) { SetPlayerFaction(targetid, -1); SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed you from your faction.", GetPlayerRPName(playerid)); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s from their faction.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); } else { if(rankid == -1) { rankid = FactionInfo[factionid][fRankCount] - 1; } SetPlayerFaction(targetid, factionid, rankid, leader); SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {00AA00}%s{33CCFF} in %s.", GetPlayerRPName(playerid), FactionRanks[factionid][rankid], FactionInfo[factionid][fName]); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a %s in %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), FactionRanks[factionid][rankid], FactionInfo[factionid][fName]); } return 1; } CMD:factions(playerid, params[]) { SendClientMessage(playerid, COLOR_NAVYBLUE, "_________________ Factions _________________"); for(new i = 0; i < MAX_FACTIONS; i ++) { if(FactionInfo[i][fType] != FACTION_NONE) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM users WHERE faction = %i", i); mysql_tquery(connectionID, queryBuffer, "OnPlayerListFactions", "ii", playerid, i); } } return 1; } CMD:setfreq(playerid, params[]) { new channel; if(!PlayerInfo[playerid][pWalkieTalkie]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a walkie talkie."); } if(sscanf(params, "i", channel)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setfreq [freq]"); } if(!(0 <= channel <= 9999999)) { return SendClientMessage(playerid, COLOR_GREY, "The channel must range from 0 to 9999999."); } PlayerInfo[playerid][pChannel] = channel; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET channel = %i WHERE uid = %i", channel, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); if(channel == 0) { SendClientMessage(playerid, COLOR_WHITE, "** You have set the channel to 0 and disabled your walkie talkie."); } else { SendClientMessageEx(playerid, COLOR_WHITE, "** Channel set to %i, use /wt to broadcast over this channel.", channel); } return 1; } CMD:r(playerid, params[]) { if(!PlayerInfo[playerid][pWalkieTalkie]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a walkie talkie."); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /r [walkie talkie]"); } if(!PlayerInfo[playerid][pChannel]) { return SendClientMessage(playerid, COLOR_GREY, "Your walkie talkie is not tuned into any channel. /channel to set one."); } if(PlayerInfo[playerid][pToggleWT]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in your walkie talkie as you have it toggled."); } if(PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use /r while dead."); } if(PlayerInfo[playerid][pCuffed]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while cuffed"); } if(PlayerInfo[playerid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while tied."); } foreach(new i : Player) { if(PlayerInfo[i][pWalkieTalkie] && PlayerInfo[i][pChannel] == PlayerInfo[playerid][pChannel] && !PlayerInfo[i][pToggleWT]) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_WALKIETALKIE, "** [CH: %i] %s: %.*s... **", PlayerInfo[playerid][pChannel], GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, COLOR_WALKIETALKIE, "** [CH: %i] %s: ...%s **", PlayerInfo[playerid][pChannel], GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_WALKIETALKIE, "** [CH: %i] %s: %s **", PlayerInfo[playerid][pChannel], GetPlayerRPName(playerid), params); } } } SetPlayerBubbleText(playerid, 20.0, COLOR_WHITE, "[WT]: %s", params); if(PlayerInfo[playerid][pBugged]) { foreach(new i : Player) { if(GetFactionType(i) == FACTION_FEDERAL) { SendClientMessageEx(i, 0x9ACD3200, "(bug) %s says [WT]: %s", GetPlayerRPName(playerid), params); } } } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s speaks into their walkie talkie.", GetPlayerRPName(playerid)); return 1; } CMD:g(playerid, params[]) { new string[64]; if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /g [global chat]"); } if(!enabledGlobal && PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "The global channel is disabled at the moment."); } if(PlayerInfo[playerid][pGlobalMuted]) { return SendClientMessage(playerid, COLOR_GREY, "You are muted from speaking in this channel. /unmute to unmute yourself."); } if(PlayerInfo[playerid][pToggleGlobal]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the global chat as you have it toggled."); } if(gettime() - PlayerInfo[playerid][pLastGlobal] < 3) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only speak in this channel every 3 seconds. Please wait %i more seconds.", 3 - (gettime() - PlayerInfo[playerid][pLastGlobal])); } if((!isnull(PlayerInfo[playerid][pCustomTitle]) && strcmp(PlayerInfo[playerid][pCustomTitle], "None", true) != 0) && PlayerInfo[playerid][pAdminHide] == 0) { new color; if(PlayerInfo[playerid][pCustomTColor] == -1 || PlayerInfo[playerid][pCustomTColor] == -256) { color = 0xC8C8C8FF; } else { color = PlayerInfo[playerid][pCustomTColor]; } format(string, sizeof(string), "{%06x}%s{FFA500}", color >>> 8, PlayerInfo[playerid][pCustomTitle]); } else if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdminHide] == 0) { format(string, sizeof(string), "{FF6347}%s{FFA500}", GetAdminRank(playerid)); } else if(PlayerInfo[playerid][pHelper] > 0) { format(string, sizeof(string), "{33CCFF}%s{FFA500}", GetHelperRank(playerid)); } else if(PlayerInfo[playerid][pFormerAdmin]) { string = "{FF69B5}Former Admin{FFA500}"; } else if(PlayerInfo[playerid][pVIPPackage] > 0) { format(string, sizeof(string), "{D909D9}%s VIP{FFA500}", GetVIPRank(PlayerInfo[playerid][pVIPPackage])); } else if(PlayerInfo[playerid][pLevel] >= 3) { format(string, sizeof(string), "Level %i Player", PlayerInfo[playerid][pLevel]); } else { string = "Newbie"; } foreach(new i : Player) { if(!PlayerInfo[i][pToggleGlobal]) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_GLOBAL, "(( %s %s: %.*s...))", string, GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, COLOR_GLOBAL, "(( %s %s: ...%s ))", string, GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_GLOBAL, "(( %s %s: %s ))", string, GetPlayerRPName(playerid), params); } } } if(PlayerInfo[playerid][pAdmin] < 2) { PlayerInfo[playerid][pLastGlobal] = gettime(); } return 1; } CMD:fc(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /fc [faction chat]"); } if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any faction at the moment."); } if(PlayerInfo[playerid][pToggleFaction]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the faction chat as you have it toggled."); } if(PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in /fc if you're dead!"); } if(PlayerInfo[playerid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "You cant speak in /fc while tied."); } foreach(new i : Player) { if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && !PlayerInfo[i][pToggleFaction]) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_FACTIONCHAT, "*[%s] %s: ((%.*s...)) ", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, COLOR_FACTIONCHAT, "*[%s] %s: ((...%s)) ", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_FACTIONCHAT, "*[%s] %s: ((%s))", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params); } } } return 1; } CMD:crew(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /crew [crew chat]"); } if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any gang at the moment."); } if(PlayerInfo[playerid][pCrew] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any crew in your gang."); } foreach(new i : Player) { if(PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && PlayerInfo[i][pCrew] == PlayerInfo[playerid][pCrew]) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_LIGHTORANGE, "** [%s] %s %s: %.*s... **", GangCrews[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pCrew]], GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, COLOR_LIGHTORANGE, "** [%s] %s %s: ...%s **", GangCrews[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pCrew]], GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_LIGHTORANGE, "** [%s] %s %s: %s **", GangCrews[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pCrew]], GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], GetPlayerRPName(playerid), params); } } } return 1; } CMD:div(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /div [division chat]"); } if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any faction at the moment."); } if(PlayerInfo[playerid][pDivision] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any divisions in your faction."); } foreach(new i : Player) { if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pDivision] == PlayerInfo[playerid][pDivision]) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_LIGHTORANGE, "** [%s] %s %s: %.*s... **", FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pDivision]], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, COLOR_LIGHTORANGE, "** [%s] %s %s: ...%s **", FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pDivision]], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_LIGHTORANGE, "** [%s] %s %s: %s **", FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pDivision]], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params); } } } return 1; } CMD:fr(playerid, params[]) { return callcmd::fradio(playerid, params); } CMD:fradio(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /(r)adio [faction radio]"); } if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any faction at the moment."); } if(PlayerInfo[playerid][pToggleRadio]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in your radio as you have it toggled."); } if(PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in /r if you're dead!"); } if(PlayerInfo[playerid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in /r while tied."); } foreach(new i : Player) { if((PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && !PlayerInfo[i][pToggleRadio]) || (PlayerInfo[i][pPoliceScanner] && PlayerInfo[i][pScannerOn] && IsEmergencyFaction(playerid))) { new color = (FactionInfo[PlayerInfo[playerid][pFaction]][fType] == FACTION_MEDIC) ? (COLOR_DOCTOR) : (COLOR_ROYALBLUE); if(strlen(params) > MAX_SPLIT_LENGTH) { if(PlayerInfo[playerid][pDivision] == -1) { SendClientMessageEx(i, color, "** %s %s: %.*s... **", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, color, "** %s %s: ...%s **", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, color, "** [%s] %s %s: %.*s... **", FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pDivision]], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, color, "** [%s] %s %s: ...%s **", FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pDivision]], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } } else { if(PlayerInfo[playerid][pDivision] == -1) { SendClientMessageEx(i, color, "** %s %s: %s **", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params); } else { SendClientMessageEx(i, color, "** [%s] %s %s: %s **", FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pDivision]], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params); } } if((PlayerInfo[i][pPoliceScanner] && PlayerInfo[i][pScannerOn]) && random(100) <= 3) { SendProximityMessage(i, 20.0, COLOR_PURPLE, "** %s's police scanner would shoot a spark and short out.", GetPlayerRPName(i)); SendClientMessage(i, COLOR_GREY2, "Your police scanner shorted out and is now broken."); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET policescanner = 0, scanneron = 0 WHERE uid = %i", PlayerInfo[i][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[i][pPoliceScanner] = 0; PlayerInfo[i][pScannerOn] = 0; } } } SetPlayerBubbleText(playerid, 20.0, COLOR_WHITE, "[Radio]: %s", params); return 1; } CMD:d(playerid, params[]) { new header[128]; if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /d [department radio]"); } if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any faction at the moment."); } if(PlayerInfo[playerid][pToggleRadio]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in your radio as you have it toggled."); } if(PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in /d if you're dead!"); } if(PlayerInfo[playerid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while tied."); } if(PlayerInfo[playerid][pCuffed]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while cuffed."); } if(!strcmp(FactionInfo[PlayerInfo[playerid][pFaction]][fShortName], "None", true)) { if(PlayerInfo[playerid][pDivision] == -1) { format(header, sizeof(header), "(%s) %s %s", FactionInfo[PlayerInfo[playerid][pFaction]][fName], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid)); } else { format(header, sizeof(header), "(%s) [%s] %s %s", FactionInfo[PlayerInfo[playerid][pFaction]][fName], FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pDivision]], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid)); } } else { if(PlayerInfo[playerid][pDivision] == -1) { format(header, sizeof(header), "(%s) %s %s", FactionInfo[PlayerInfo[playerid][pFaction]][fShortName], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid)); } else { format(header, sizeof(header), "(%s) [%s] %s %s", FactionInfo[PlayerInfo[playerid][pFaction]][fShortName], FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pDivision]], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid)); } } switch(FactionInfo[PlayerInfo[playerid][pFaction]][fType]) { case FACTION_POLICE, FACTION_MEDIC, FACTION_GOVERNMENT, FACTION_FEDERAL, FACTION_ARMY: { foreach(new i : Player) { if((PlayerInfo[i][pPoliceScanner] && PlayerInfo[i][pScannerOn]) || ((!PlayerInfo[i][pToggleRadio]) && (GetFactionType(i) == FACTION_POLICE || GetFactionType(i) == FACTION_MEDIC || GetFactionType(i) == FACTION_GOVERNMENT || GetFactionType(i) == FACTION_FEDERAL || GetFactionType(i) == FACTION_ARMY))) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_YELLOW, "** %s: %.*s... **", header, MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, COLOR_YELLOW, "** %s: ...%s **", header, params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_YELLOW, "** %s: %s **", header, params); } if((PlayerInfo[i][pPoliceScanner] && PlayerInfo[i][pScannerOn]) && random(100) <= 3) { SendProximityMessage(i, 20.0, COLOR_PURPLE, "** %s's police scanner would shoot a spark and short out.", GetPlayerRPName(i)); SendClientMessage(i, COLOR_GREY2, "Your police scanner shorted out and is now broken."); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET policescanner = 0, scanneron = 0 WHERE uid = %i", PlayerInfo[i][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[i][pPoliceScanner] = 0; PlayerInfo[i][pScannerOn] = 0; } } } } default: { SendClientMessage(playerid, COLOR_GREY, "Your faction is not authorized to speak in department radio."); } } SetPlayerBubbleText(playerid, 20.0, COLOR_WHITE, "[Radio]: %s", params); return 1; } CMD:faction(playerid, params[]) { new targetid, option[14], param[128]; if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any faction at the moment."); } if(sscanf(params, "s[14]S()[128]", option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /faction [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: MOTD, Invite, Kick, Rank, Roster, Online, Quit, Offlinekick"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Leadership, Respawncars, Budget"); return 1; } if(!strcmp(option, "motd", true)) { if(!PlayerInfo[playerid][pFactionLeader]) { return SendClientMessageEx(playerid, COLOR_YELLOW, "** Faction MOTD: %s", FactionInfo[PlayerInfo[playerid][pFaction]][fMOTD]); } if(isnull(param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /faction [motd] [text ('none' to reset)]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "Current MOTD: %s", FactionInfo[PlayerInfo[playerid][pFaction]][fMOTD]); return 1; } strcpy(FactionInfo[PlayerInfo[playerid][pFaction]][fMOTD], param, 128); SendClientMessageEx(playerid, COLOR_AQUA, "You have changed the MOTD for your faction."); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET motd = '%e' WHERE id = %i", param, PlayerInfo[playerid][pFaction]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "invite", true)) { if(!PlayerInfo[playerid][pFactionLeader]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to invite members to your faction."); } if(sscanf(param, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /faction [invite] [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pFaction] != -1) { return SendClientMessage(playerid, COLOR_GREY, "That player is already apart of a faction."); } if(PlayerInfo[targetid][pGang] >= 0 && GetFactionType(playerid) != FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "That player is apart of a gang and therefore can't join a faction."); } if(PlayerInfo[targetid][pGang] >= 0 && GetFactionType(playerid) != FACTION_FEDERAL) { return SendClientMessage(playerid, COLOR_GREY, "That player is apart of a gang and therefore can't join a faction."); } if(PlayerInfo[targetid][pGang] >= 0 && GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "That player is apart of a gang and therefore can't join a faction."); } PlayerInfo[targetid][pFactionOffer] = playerid; PlayerInfo[targetid][pFactionOffered] = PlayerInfo[playerid][pFaction]; SendClientMessageEx(targetid, COLOR_AQUA, "** %s has invited you to join {00AA00}%s{33CCFF} (/accept faction).", GetPlayerRPName(playerid), FactionInfo[PlayerInfo[playerid][pFaction]][fName]); SendClientMessageEx(playerid, COLOR_AQUA, "** You have invited %s to join your faction.", GetPlayerRPName(targetid)); } else if(!strcmp(option, "kick", true)) { if(!PlayerInfo[playerid][pFactionLeader]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to kick members from your faction."); } if(sscanf(param, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /faction [kick] [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pFaction] != PlayerInfo[playerid][pFaction]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not apart of your faction."); } /*if(PlayerInfo[targetid][pFactionRank] > PlayerInfo[playerid][pFactionRank]) { return SendClientMessage(playerid, COLOR_GREY, "That player has a higher rank than you."); }*/ Log_Write("log_faction", "%s (uid: %i) kicked %s (uid: %i) from %s (id: %i) as rank %s (%i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], FactionInfo[PlayerInfo[playerid][pFaction]][fName], PlayerInfo[playerid][pFaction], FactionRanks[PlayerInfo[targetid][pFaction]][PlayerInfo[targetid][pFactionRank]], PlayerInfo[targetid][pFactionRank]); SetPlayerFaction(targetid, -1); SendClientMessageEx(targetid, COLOR_AQUA, "%s has kicked you from the faction.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have kicked %s from your faction.", GetPlayerRPName(targetid)); } else if(!strcmp(option, "rank", true)) { new rankid; if(!PlayerInfo[playerid][pFactionLeader]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(sscanf(param, "ui", targetid, rankid)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /faction [rank] [playerid] [rankid (0-%i)]", FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 1); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(rankid < 0 || rankid >= FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid rank."); } if(PlayerInfo[targetid][pFaction] != PlayerInfo[playerid][pFaction]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not apart of your faction."); } /*if(PlayerInfo[targetid][pFactionRank] > PlayerInfo[playerid][pFactionRank]) { return SendClientMessage(playerid, COLOR_GREY, "That player has a higher rank than you."); }*/ PlayerInfo[targetid][pFactionRank] = rankid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET factionrank = %i WHERE uid = %i", rankid, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has set your rank to {00AA00}%s{33CCFF} (%i).", GetPlayerRPName(playerid), FactionRanks[PlayerInfo[playerid][pFaction]][rankid], rankid); SendClientMessageEx(playerid, COLOR_AQUA, "You have set %s's rank to {00AA00}%s{33CCFF} (%i).", GetPlayerRPName(targetid), FactionRanks[PlayerInfo[playerid][pFaction]][rankid], rankid); Log_Write("log_faction", "%s (uid: %i) has set %s's (uid: %i) rank in %s (id: %i) to %s (%i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], FactionInfo[PlayerInfo[playerid][pFaction]][fName], PlayerInfo[playerid][pFaction], FactionRanks[PlayerInfo[playerid][pFaction]][rankid], rankid); } else if(!strcmp(option, "leadership", true)) { if(!PlayerInfo[playerid][pFactionLeader]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(sscanf(param, "u", targetid)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /faction [leadership] [playerid]"); SendClientMessage(playerid, COLOR_SYNTAX, "This command grants or revokes a fellow faction member's leadership flags."); return 1; } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pFaction] != PlayerInfo[playerid][pFaction]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not apart of your faction."); } if(!PlayerInfo[targetid][pFactionLeader]) { PlayerInfo[targetid][pFactionLeader] = 1; SendClientMessageEx(targetid, COLOR_AQUA, "%s has {00AA00}granted{33CCFF} you the leadership flags to the faction.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have {00AA00}granted{33CCFF} %s the leadership flags to your faction.", GetPlayerRPName(targetid)); Log_Write("log_faction", "%s (uid: %i) granted leadership flags to %s (uid: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else { PlayerInfo[targetid][pFactionLeader] = 0; SendClientMessageEx(targetid, COLOR_AQUA, "%s has {FF6347}revoked{33CCFF} your leadership flags to the faction.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have {FF6347}revoked{33CCFF} %s's leadership flags to your faction.", GetPlayerRPName(targetid)); Log_Write("log_faction", "%s (uid: %i) revoked leadership flags from %s (uid: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET factionleader = %i WHERE uid = %i", PlayerInfo[targetid][pFactionLeader], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "roster", true)) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT username, lastlogin, factionrank FROM users WHERE faction = %i ORDER BY factionrank DESC", PlayerInfo[playerid][pFaction]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_FACTION_ROSTER, playerid); } else if(!strcmp(option, "online", true)) { callcmd::fmembers(playerid, "\1"); } else if(!strcmp(option, "quit", true)) { if(isnull(param) || strcmp(param, "confirm", true) != 0) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /faction [quit] [confirm]"); } SendClientMessageEx(playerid, COLOR_AQUA, "You have quit %s as a {00AA00}%s{33CCFF} (%i).", FactionInfo[PlayerInfo[playerid][pFaction]][fName], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], PlayerInfo[playerid][pFactionRank]); Log_Write("log_faction", "%s (uid: %i) has quit %s (id: %i) has rank %s (%i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], FactionInfo[PlayerInfo[playerid][pFaction]][fName], PlayerInfo[playerid][pFaction], FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], PlayerInfo[playerid][pFactionRank]); SetPlayerFaction(playerid, -1); } else if(!strcmp(option, "offlinekick", true)) { new username[MAX_PLAYER_NAME]; if(!PlayerInfo[playerid][pFactionLeader]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(sscanf(param, "s[24]", username)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /faction [offlinekick] [username]"); } if(IsPlayerOnline(username)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already online and logged in. Use '/faction kick' instead."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid, faction, factionrank FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "OnPlayerOfflineKickFaction", "is", playerid, username); } else if(!strcmp(option, "respawncars", true)) { if(PlayerInfo[playerid][pFactionRank] < FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 2) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to be at least rank %i+ to use this command.", FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 2); } foreach(new i: Vehicle) { if(!IsVehicleOccupied(i) && VehicleInfo[i][vFactionType] == FactionInfo[PlayerInfo[playerid][pFaction]][fType]) { SetVehicleToRespawn(i); } } SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_FACTIONCHAT, "(( %s %s has respawned all unoccupied faction vehicles. ))", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid)); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has respawned their faction vehicles.", GetPlayerRPName(playerid), playerid); } return 1; } CMD:division(playerid, params[]) { new targetid, divisionid, option[10], param[32]; if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any faction at the moment."); } if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "Hitman factions do not have access to the division system."); } if(sscanf(params, "s[10]S()[32]", option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /division [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Create, Remove, List, Assign, Kick"); return 1; } if(!strcmp(option, "create", true)) { if(!PlayerInfo[playerid][pFactionLeader]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /division [create] [name]"); } for(new i = 0; i < MAX_FACTION_DIVISIONS; i ++) { if(isnull(FactionDivisions[PlayerInfo[playerid][pFaction]][i])) { strcpy(FactionDivisions[PlayerInfo[playerid][pFaction]][i], param, 32); SendClientMessageEx(playerid, COLOR_AQUA, "You have created division {FFA763}%s{33CCFF}. The ID of this division is %i.", param, i); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO divisions VALUES(%i, %i, '%e')", PlayerInfo[playerid][pFaction], i, param); mysql_tquery(connectionID, queryBuffer); return 1; } } SendClientMessageEx(playerid, COLOR_GREY, "Your faction can only have up to %i divisions.", MAX_FACTION_DIVISIONS); } else if(!strcmp(option, "remove", true)) { if(!PlayerInfo[playerid][pFactionLeader]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(sscanf(param, "i", divisionid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /division [remove] [divisionid]"); } if(!(0 <= divisionid < MAX_FACTION_DIVISIONS) || isnull(FactionDivisions[PlayerInfo[playerid][pFaction]][divisionid])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid division ID."); } foreach(new i : Player) { if(PlayerInfo[i][pFaction] == PlayerInfo[playerid][pFaction] && PlayerInfo[i][pDivision] == divisionid) { PlayerInfo[i][pDivision] = -1; SendClientMessage(i, COLOR_LIGHTRED, "The division you were apart of has been deleted by the faction owner."); } } SendClientMessageEx(playerid, COLOR_AQUA, "You have deleted division {F7A763}%s{33CCFF} (%i).", FactionDivisions[PlayerInfo[playerid][pFaction]][divisionid], divisionid); FactionDivisions[PlayerInfo[playerid][pFaction]][divisionid][0] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM divisions WHERE id = %i AND divisionid = %i", PlayerInfo[playerid][pFaction], divisionid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET division = -1 WHERE faction = %i", PlayerInfo[playerid][pFaction]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "list", true)) { SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ Divisions List _____"); for(new i = 0; i < MAX_FACTION_DIVISIONS; i ++) { if(isnull(FactionDivisions[PlayerInfo[playerid][pFaction]][i])) { SendClientMessageEx(playerid, COLOR_GREY1, "ID: %i | Name: Empty Slot", i); } else { SendClientMessageEx(playerid, COLOR_GREY1, "ID: %i | Name: %s", i, FactionDivisions[PlayerInfo[playerid][pFaction]][i]); } } } else if(!strcmp(option, "assign", true)) { if(!PlayerInfo[playerid][pFactionLeader]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(sscanf(param, "ui", targetid, divisionid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /division [assign] [playerid] [divisionid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pFaction] != PlayerInfo[playerid][pFaction]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not apart of your faction."); } if(!(0 <= divisionid < MAX_FACTION_DIVISIONS) || isnull(FactionDivisions[PlayerInfo[playerid][pFaction]][divisionid])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid division ID."); } if(PlayerInfo[targetid][pDivision] == divisionid) { return SendClientMessage(playerid, COLOR_GREY, "That player is already apart of that division."); } if(PlayerInfo[targetid][pDivision] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is already apart of another division."); } PlayerInfo[targetid][pDivision] = divisionid; SendClientMessageEx(targetid, COLOR_AQUA, "%s has assigned you to the {F7A763}%s{33CCFF} division.", GetPlayerRPName(playerid), FactionDivisions[PlayerInfo[playerid][pFaction]][divisionid]); SendClientMessageEx(playerid, COLOR_AQUA, "You have assigned %s to the {F7A763}%s{33CCFF} division.", GetPlayerRPName(targetid), FactionDivisions[PlayerInfo[playerid][pFaction]][divisionid]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET division = %i WHERE uid = %i", divisionid, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "kick", true)) { if(!PlayerInfo[playerid][pFactionLeader]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(sscanf(param, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /division [kick] [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pFaction] != PlayerInfo[playerid][pFaction]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not apart of your faction."); } if(PlayerInfo[targetid][pDivision] == -1) { return SendClientMessage(playerid, COLOR_GREY, "That player is not apart of any division."); } SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed you from the {F7A763}%s{33CCFF} division.", GetPlayerRPName(playerid), FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[targetid][pDivision]]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s from the {F7A763}%s{33CCFF} division.", GetPlayerRPName(targetid), FactionDivisions[PlayerInfo[playerid][pFaction]][PlayerInfo[targetid][pDivision]]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET division = -1 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[targetid][pDivision] = -1; } return 1; } CMD:managecrew(playerid, params[]) { new targetid, crewid, option[10], param[32]; if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any gang at the moment."); } if(sscanf(params, "s[10]S()[32]", option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /managecrew [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Create, Remove, List, Assign, Kick"); return 1; } if(!strcmp(option, "create", true)) { if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /crew [create] [name]"); } for(new i = 0; i < MAX_GANG_CREWS; i ++) { if(isnull(GangCrews[PlayerInfo[playerid][pGang]][i])) { strcpy(GangCrews[PlayerInfo[playerid][pGang]][i], param, 32); SendClientMessageEx(playerid, COLOR_AQUA, "You have created crew {FFA763}%s{33CCFF}. The ID of this crew is %i.", param, i); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO crews VALUES(%i, %i, '%e')", PlayerInfo[playerid][pGang], i, param); mysql_tquery(connectionID, queryBuffer); return 1; } } SendClientMessageEx(playerid, COLOR_GREY, "Your gang can only have up to %i crews.", MAX_GANG_CREWS); } else if(!strcmp(option, "remove", true)) { if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(sscanf(param, "i", crewid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /crew [remove] [crewid]"); } if(!(0 <= crewid < MAX_GANG_CREWS) || isnull(GangCrews[PlayerInfo[playerid][pGang]][crewid])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid crew ID."); } foreach(new i : Player) { if(PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && PlayerInfo[i][pCrew] == crewid) { PlayerInfo[i][pCrew] = -1; SendClientMessage(i, COLOR_LIGHTRED, "The crew you were apart of has been deleted by the gang owner."); } } SendClientMessageEx(playerid, COLOR_AQUA, "You have deleted crew {F7A763}%s{33CCFF} (%i).", GangCrews[PlayerInfo[playerid][pGang]][crewid], crewid); GangCrews[PlayerInfo[playerid][pGang]][crewid][0] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM crews WHERE id = %i AND crewid = %i", PlayerInfo[playerid][pGang], crewid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET crew = -1 WHERE gang = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "list", true)) { SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ Crews List _____"); for(new i = 0; i < MAX_GANG_CREWS; i ++) { if(isnull(GangCrews[PlayerInfo[playerid][pGang]][i])) { SendClientMessageEx(playerid, COLOR_GREY1, "ID: %i | Name: Empty Slot", i); } else { SendClientMessageEx(playerid, COLOR_GREY1, "ID: %i | Name: %s", i, GangCrews[PlayerInfo[playerid][pGang]][i]); } } } else if(!strcmp(option, "assign", true)) { if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(sscanf(param, "ui", targetid, crewid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /crew [assign] [playerid] [crewid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pGang] != PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not apart of your gang."); } if(!(0 <= crewid < MAX_GANG_CREWS) || isnull(GangCrews[PlayerInfo[playerid][pGang]][crewid])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid crew ID."); } if(PlayerInfo[targetid][pCrew] == crewid) { return SendClientMessage(playerid, COLOR_GREY, "That player is already apart of that crew."); } if(PlayerInfo[targetid][pCrew] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "That player is already apart of another crew."); } PlayerInfo[targetid][pCrew] = crewid; SendClientMessageEx(targetid, COLOR_AQUA, "%s has assigned you to the {F7A763}%s{33CCFF} crew.", GetPlayerRPName(playerid), GangCrews[PlayerInfo[playerid][pGang]][crewid]); SendClientMessageEx(playerid, COLOR_AQUA, "You have assigned %s to the {F7A763}%s{33CCFF} crew.", GetPlayerRPName(targetid), GangCrews[PlayerInfo[playerid][pGang]][crewid]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET crew = %i WHERE uid = %i", crewid, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "kick", true)) { if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to use this command."); } if(sscanf(param, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /crew [kick] [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pGang] != PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not apart of your gang."); } if(PlayerInfo[targetid][pCrew] == -1) { return SendClientMessage(playerid, COLOR_GREY, "That player is not apart of any crew."); } SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed you from the {F7A763}%s{33CCFF} crew.", GetPlayerRPName(playerid), GangCrews[PlayerInfo[playerid][pGang]][PlayerInfo[targetid][pCrew]]); SendClientMessageEx(playerid, COLOR_AQUA, "You have removed %s from the {F7A763}%s{33CCFF} crew.", GetPlayerRPName(targetid), GangCrews[PlayerInfo[playerid][pGang]][PlayerInfo[targetid][pCrew]]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET crew = -1 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[targetid][pCrew] = -1; } return 1; } CMD:cells(playerid, params[]) { new status; if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } for(new i = 0; i < sizeof(gPrisonCells); i ++) { if(!Streamer_GetExtraInt(gPrisonCells[i], E_OBJECT_OPENED)) { MoveDynamicObject(gPrisonCells[i], cellPositions[i][3], cellPositions[i][4], cellPositions[i][5], 2.0); Streamer_SetExtraInt(gPrisonCells[i], E_OBJECT_OPENED, 1); status = true; } else { MoveDynamicObject(gPrisonCells[i], cellPositions[i][0], cellPositions[i][1], cellPositions[i][2], 2.0); Streamer_SetExtraInt(gPrisonCells[i], E_OBJECT_OPENED, 0); status = false; } } if(status) SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_ROYALBLUE, "** HQ: %s %s has opened all cells in the prison.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid)); else SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_ROYALBLUE, "** HQ: %s %s has closed all cells in the prison.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid)); return 1; } CMD:cell(playerid, params[]) { for(new i = 0; i < sizeof(gPrisonCells); i ++) { if(IsPlayerInRangeOfPoint(playerid, 2.0, cellPositions[i][0], cellPositions[i][1], cellPositions[i][2])) { if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to open this cell."); } if(!Streamer_GetExtraInt(gPrisonCells[i], E_OBJECT_OPENED)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their key to open the cell door.", GetPlayerRPName(playerid)); MoveDynamicObject(gPrisonCells[i], cellPositions[i][3], cellPositions[i][4], cellPositions[i][5], 2.0); Streamer_SetExtraInt(gPrisonCells[i], E_OBJECT_OPENED, 1); } else { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s uses their key to close the cell door.", GetPlayerRPName(playerid)); MoveDynamicObject(gPrisonCells[i], cellPositions[i][0], cellPositions[i][1], cellPositions[i][2], 2.0); Streamer_SetExtraInt(gPrisonCells[i], E_OBJECT_OPENED, 0); } return 1; } } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any prison cells."); return 1; } CMD:door(playerid, params[]) { if(!DoorCheck(playerid)) { SendClientMessage(playerid, COLOR_GREY, "You are not in range of any door which you can open."); } return 1; } CMD:gate(playerid, params[]) { if(!GateCheck(playerid)) { SendClientMessage(playerid, COLOR_GREY, "You are not in range of any gates which you can open."); } return 1; } CMD:locker(playerid, params[]) { if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any faction at the moment."); } if(!IsPlayerInRangeOfLocker(playerid, PlayerInfo[playerid][pFaction])) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any of your faction lockers."); } if(PlayerInfo[playerid][pHurt]) { return SendClientMessageEx(playerid, COLOR_GREY, "You're too hurt to use the lockers. Please wait %i seconds before trying again.", PlayerInfo[playerid][pHurt]); } switch(FactionInfo[PlayerInfo[playerid][pFaction]][fType]) { case FACTION_POLICE, FACTION_FEDERAL, FACTION_ARMY: { ShowPlayerDialog(playerid, DIALOG_FACTIONLOCKER, DIALOG_STYLE_LIST, "Locker", "Toggle duty\nEquipment\nUniforms\nClothing", "Select", "Cancel"); } case FACTION_MEDIC: { ShowPlayerDialog(playerid, DIALOG_FACTIONLOCKER, DIALOG_STYLE_LIST, "Locker", "Toggle duty\nEquipment\nUniforms", "Select", "Cancel"); } case FACTION_GOVERNMENT, FACTION_NEWS: { ShowPlayerDialog(playerid, DIALOG_FACTIONLOCKER, DIALOG_STYLE_LIST, "Locker", "Equipment\nUniforms", "Select", "Cancel"); } case FACTION_HITMAN: { ShowPlayerDialog(playerid, DIALOG_FACTIONLOCKER, DIALOG_STYLE_LIST, "Locker", "Order weapons\nChange clothes", "Select", "Cancel"); } } return 1; } CMD:showbadge(playerid, params[]) { new targetid, factionid, rankid; if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any faction at the moment."); } if(GetFactionType(playerid) == FACTION_HITMAN) { if(sscanf(params, "uii", targetid, factionid, rankid)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /showbadge [playerid] [factionid] [rankid]"); SendClientMessage(playerid, COLOR_SYNTAX, "Use /factions for a list of factions to use with factionid parameter."); return 1; } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(!(0 <= factionid < MAX_FACTIONS) || FactionInfo[factionid][fType] == FACTION_NONE) { return SendClientMessage(playerid, COLOR_GREY, "Invalid faction."); } if(!(0 <= rankid < FactionInfo[factionid][fRankCount])) { return SendClientMessageEx(playerid, COLOR_GREY, "Invalid rank. Valid ranks for this faction range from 0 to %i.", FactionInfo[factionid][fRankCount] - 1); } if(FactionInfo[factionid][fType] == FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this faction for your fake badge."); } SendClientMessageEx(targetid, COLOR_WHITE, "** %s is rank %s (%i) in %s. **", GetPlayerRPName(playerid), FactionRanks[factionid][rankid], rankid, FactionInfo[factionid][fName]); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s shows their badge to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); } else { if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /showbadge [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } SendClientMessageEx(targetid, COLOR_WHITE, "** %s is rank %s (%i) in %s. **", GetPlayerRPName(playerid), FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], PlayerInfo[playerid][pFactionRank], FactionInfo[PlayerInfo[playerid][pFaction]][fName]); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s shows their badge to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); } return 1; } CMD:m(playerid, params[]) { return callcmd::megaphone(playerid, params); } CMD:megaphone(playerid, params[]) { if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any faction at the moment."); } if(FactionInfo[PlayerInfo[playerid][pFaction]][fType] == FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "Your faction is not authorized to use the megaphone."); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /(m)egaphone [text]"); } SendProximityMessage(playerid, 50.0, COLOR_YELLOW, "[%s %s:o< %s]", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params); return 1; } CMD:tazer(playerid, params[]) { if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_GOVERNMENT) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0 || PlayerInfo[playerid][pJoinedEvent] > 0 || IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(PlayerInfo[playerid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command when you are weapon restricted."); } if(PlayerInfo[playerid][pHurt] && PlayerInfo[playerid][pTazer] == 0) { return SendClientMessageEx(playerid, COLOR_GREY, "You're too hurt to pull out your tazer. Please wait %i seconds before trying again.", PlayerInfo[playerid][pHurt]); } if(!PlayerInfo[playerid][pTazer]) { PlayerInfo[playerid][pTazer] = 1; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s reaches for their tazer.", GetPlayerRPName(playerid)); GivePlayerWeaponEx(playerid, 23, true); SetPlayerArmedWeapon(playerid, 23); } else { PlayerInfo[playerid][pTazer] = 0; SetPlayerWeapons(playerid); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s puts their tazer back in their duty .", GetPlayerRPName(playerid)); if(GetPlayerState(playerid) == PLAYER_STATE_ONFOOT) { SetPlayerArmedWeapon(playerid, PlayerInfo[playerid][pWeapons][2]); } } return 1; } forward teamBalance(playerid, teamid); public teamBalance(playerid, teamid) { SetPlayerSkin(playerid, EventInfo[eSkin][teamid]); SetPlayerPos(playerid, EventInfo[ePosX][teamid], EventInfo[ePosY][teamid], EventInfo[ePosZ][teamid]); SetPlayerFacingAngle(playerid, EventInfo[ePosA][teamid]); SetCameraBehindPlayer(playerid); } forward showMirandaRights(playerid, step); public showMirandaRights(playerid, step) { new string[128]; switch(step) { case 1: { format(string, sizeof(string), "%s says: You have the right to remain silent.", GetPlayerRPName(playerid)); SendProximityFadeMessage(playerid, 20.0, string, COLOR_GREY1, COLOR_GREY2, COLOR_GREY3, COLOR_GREY4, COLOR_GREY5); SetTimerEx("showMirandaRights", 1000, false, "ii", playerid, 2); } case 2: { format(string, sizeof(string), "%s says: Anything you say can and will be used against you in a court of law.", GetPlayerRPName(playerid)); SendProximityFadeMessage(playerid, 20.0, string, COLOR_GREY1, COLOR_GREY2, COLOR_GREY3, COLOR_GREY4, COLOR_GREY5); SetTimerEx("showMirandaRights", 1000, false, "ii", playerid, 3); } case 3: { format(string, sizeof(string), "%s says: You have the right to to an attorney, If you can not afford one, one will be appointed for you.", GetPlayerRPName(playerid)); SendProximityFadeMessage(playerid, 20.0, string, COLOR_GREY1, COLOR_GREY2, COLOR_GREY3, COLOR_GREY4, COLOR_GREY5); } } } CMD:mir(playerid, params[]) { if(IsLawEnforcement(playerid)) { SetTimerEx("showMirandaRights", 1000, false, "ii", playerid, 1); } else { SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command"); } return 1; } CMD:removegunlicense(playerid, params[]) { new targetid; if(IsLawEnforcement(playerid)) { if(sscanf(params, "d", targetid)) { return SendClientMessage(playerid, COLOR_GREY, "Usage: /removegunlicense [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } PlayerInfo[targetid][pGunLicense] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gunlicense = %i WHERE uid = %i", PlayerInfo[playerid][pGunLicense], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You've set %s's gun license to %d", GetPlayerRPName(targetid), PlayerInfo[targetid][pGunLicense]); SendClientMessageEx(targetid, COLOR_AQUA, "Officer %s has revoked your gun license", GetPlayerRPName(playerid)); } else SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command"); return 1; } CMD:givegunlicense(playerid, params[]) { new targetid; if(IsLawEnforcement(playerid)) { if(sscanf(params, "d", targetid)) { return SendClientMessage(playerid, COLOR_GREY, "Usage: /givegunlicense [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } PlayerInfo[targetid][pGunLicense] = 1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gunlicense = %i WHERE uid = %i", PlayerInfo[playerid][pGunLicense], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You've set %s's gun license to %d", GetPlayerRPName(targetid), PlayerInfo[targetid][pGunLicense]); SendClientMessageEx(targetid, COLOR_AQUA, "Officer %s has approved your gun license request", GetPlayerRPName(playerid)); } else SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command"); return 1; } CMD:cuff(playerid, params[]) { new targetid; if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_GOVERNMENT && GetFactionType(playerid) != FACTION_TERRORIST) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /cuff [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't cuff yourself."); } if(PlayerInfo[targetid][pCuffed]) { return SendClientMessage(playerid, COLOR_GREY, "That player is already handcuffed."); } if(PlayerInfo[targetid][pTazedTime] == 0 && GetPlayerSpecialAction(targetid) != SPECIAL_ACTION_DUCK && GetPlayerAnimationIndex(targetid) != 1437) { return SendClientMessage(playerid, COLOR_GREY, "That player must either be tazed, crouched, or hands up."); } if(PlayerInfo[targetid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You can't handcuff an injured player."); } if(PlayerInfo[playerid][pHurt]) { return SendClientMessageEx(playerid, COLOR_GREY, "You're too hurt to cuff anyone. Please wait %i seconds before trying again.", PlayerInfo[playerid][pHurt]); } if(PlayerInfo[targetid][pCallLine] != INVALID_PLAYER_ID) { HangupCall(PlayerInfo[targetid][pCallLine], HANGUP_DROPPED); } PlayerInfo[targetid][pCuffed] = 1; SetPlayerSpecialAction(targetid, SPECIAL_ACTION_CUFFED); //TogglePlayerControllable(targetid, 0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s tightens a pair of handcuffs around %s's wrists.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); GameTextForPlayer(targetid, "~r~Cuffed", 3000, 3); return 1; } CMD:uncuff(playerid, params[]) { new targetid; if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_GOVERNMENT && GetFactionType(playerid) != FACTION_TERRORIST && PlayerInfo[playerid][pAdminDuty] == 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /uncuff [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid && PlayerInfo[playerid][pAdminDuty] == 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't uncuff yourself."); } if(!PlayerInfo[targetid][pCuffed]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not handcuffed."); } if(PlayerInfo[playerid][pHurt]) { return SendClientMessageEx(playerid, COLOR_GREY, "You're too hurt to uncuff anyone. Please wait %i seconds before trying again.", PlayerInfo[playerid][pHurt]); } PlayerInfo[targetid][pCuffed] = 0; PlayerInfo[targetid][pDraggedBy] = INVALID_PLAYER_ID; SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE); TogglePlayerControllable(targetid, 1); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s loosens the pair of handcuffs from around %s's wrists.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); GameTextForPlayer(targetid, "~g~Uncuffed", 3000, 3); return 1; } CMD:drag(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /drag [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't drag yourself."); } if(!PlayerInfo[targetid][pInjured] && !PlayerInfo[targetid][pCuffed] && !PlayerInfo[targetid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not injured, handcuffed or tied."); } if(PlayerInfo[targetid][pInjured] && GetFactionType(playerid) != FACTION_MEDIC) { return SendClientMessage(playerid, COLOR_GREY, "You can't drag an injured player unless you're a medic."); } if(PlayerInfo[playerid][pHurt]) { return SendClientMessageEx(playerid, COLOR_GREY, "You're too hurt to drag anyone. Please wait %i seconds before trying again.", PlayerInfo[playerid][pHurt]); } if(PlayerInfo[targetid][pDraggedBy] == INVALID_PLAYER_ID) { PlayerInfo[targetid][pDraggedBy] = playerid; //TogglePlayerControllable(targetid, 0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s grabs onto %s and begins to drag them.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); } else { PlayerInfo[targetid][pDraggedBy] = INVALID_PLAYER_ID; //TogglePlayerControllable(targetid, 1); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s stops dragging %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); } return 1; } CMD:detain(playerid, params[]) { new targetid, vehicleid = GetPlayerVehicleID(playerid); if(!IsLawEnforcement(playerid) && PlayerInfo[targetid][pCuffed]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /detain [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 15.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't detain yourself."); } if(!PlayerInfo[targetid][pCuffed] && !PlayerInfo[targetid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not handcuffed or tied."); } if(IsPlayerInAnyVehicle(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already in a vehicle."); } if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle."); } for(new i = (GetVehicleSeatCount(vehicleid) == 4) ? 2 : 1; i < GetVehicleSeatCount(vehicleid); i ++) { if(!IsSeatOccupied(vehicleid, i)) { PlayerInfo[targetid][pDraggedBy] = INVALID_PLAYER_ID; PlayerInfo[targetid][pVehicleCount] = 0; TogglePlayerControllable(targetid, 0); PutPlayerInVehicle(targetid, vehicleid, i); SetPlayerSpecialAction(targetid, SPECIAL_ACTION_NONE); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s throws %s into their vehicle.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } } SendClientMessage(playerid, COLOR_GREY, "There are no unoccupied back seats left. Find another vehicle."); return 1; } CMD:charge(playerid, params[]) { new targetid, reason[128]; if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if(sscanf(params, "us[128]", targetid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /charge [playerid] [reason]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't charge yourself."); } if(PlayerInfo[targetid][pWantedLevel] >= 6) { return SendClientMessage(playerid, COLOR_GREY, "This player is already at the maximum wanted level (6)."); } if(GetFactionType(targetid) == FACTION_FEDERAL && GetFactionType(playerid) == FACTION_POLICE && GetFactionType(playerid) == FACTION_ARMY) { return SendClientMessage(playerid, COLOR_GREY, "That player is in a faction of higher authority and therefore can't be charged."); } PlayerInfo[targetid][pWantedLevel]++; PlayerInfo[targetid][pCrimes]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET wantedlevel = %i, crimes = %i WHERE uid = %i", PlayerInfo[targetid][pWantedLevel], PlayerInfo[targetid][pCrimes], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO charges VALUES(null, %i, '%s', NOW(), '%e')", PlayerInfo[targetid][pID], GetPlayerNameEx(playerid), reason); mysql_tquery(connectionID, queryBuffer); foreach(new i : Player) { if(IsLawEnforcement(i)) { SendClientMessageEx(i, COLOR_ROYALBLUE, "** HQ: %s %s has charged %s with {FF6347}%s{9999FF}. **", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), GetPlayerRPName(targetid), reason); } } SendClientMessageEx(targetid, COLOR_LIGHTRED, "** Officer %s has charged you with %s.", GetPlayerRPName(playerid), reason); Log_Write("log_faction", "%s (uid: %i) has charged %s (uid: %i) with %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], reason); return 1; } CMD:su(playerid, params[]) { return callcmd::charge(playerid, params); } CMD:bug(playerid, params[]) { if(GetFactionType(playerid) != FACTION_FEDERAL) { return SendClientMessage(playerid, COLOR_GREY, "You are not a federal agent."); } if(!PlayerInfo[playerid][pToggleBug]) { return SendClientMessage(playerid, COLOR_GREY, "Enable the bug channel first! (/tog bugged)"); } new targetid; if(sscanf(params, "u", targetid)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /bug [playerid]"); } if(PlayerInfo[targetid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You can't place bugs on admins."); } if(PlayerInfo[targetid][pBugged] == 1) { PlayerInfo[targetid][pBugged] = 0; SendClientMessageEx(playerid, COLOR_GREY, "The bug on %s has been disabled.", GetPlayerRPName(targetid)); } else if(IsPlayerInRangeOfPlayer(playerid, targetid, 4.0)) { PlayerInfo[targetid][pBugged] = 1; SendClientMessageEx(playerid, COLOR_GREY ,"You have placed a bug on %s.",GetPlayerRPName(targetid)); } else { SendClientMessage(playerid, COLOR_GREY, "You need to be closer to that person."); } return 1; } CMD:tip(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] > 7) { SendClientMessageToAllEx(COLOR_GREEN, "TIP: {ffffff}%s", params); } return 1; } CMD:speaker(playerid, params[]) { if(PlayerInfo[playerid][pPhone] != 0) { if(PlayerInfo[playerid][pSpeakerPhone] == 1) { PlayerInfo[playerid][pSpeakerPhone] = 0; SendClientMessageEx(playerid, COLOR_WHITE, "You have disabled the speakerphone feature on your phone."); } else { PlayerInfo[playerid][pSpeakerPhone] = 1; SendClientMessageEx(playerid, COLOR_WHITE, "You have enabled the speakerphone feature on your phone."); } } else { SendClientMessageEx(playerid, COLOR_WHITE, "You don't have a phone."); } return 1; } CMD:arrest(playerid, params[]) { new targetid, minutes, fine; if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /arrest [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't arrest yourself."); } if(!PlayerInfo[targetid][pCuffed]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not handcuffed."); } if(!PlayerInfo[targetid][pWantedLevel]) { return SendClientMessage(playerid, COLOR_GREY, "You can't arrest a player with no active charges. /charge to add them."); } for(new i = 0; i < sizeof(arrestPoints); i ++) { if(IsPlayerInRangeOfPoint(playerid, 5.0, arrestPoints[i][0], arrestPoints[i][1], arrestPoints[i][2])) { minutes = PlayerInfo[targetid][pWantedLevel] * 5; fine = PlayerInfo[targetid][pWantedLevel] * 1000; if(PlayerInfo[targetid][pVIPPackage] == 1) { SendClientMessageEx(targetid, COLOR_VIP, "VIP Perk: Your %i minutes of jail time has been reduced by 50 percent to %i minutes.", minutes, percent(minutes, 50)); minutes = percent(minutes, 50); } else if(PlayerInfo[targetid][pVIPPackage] >= 2) { SendClientMessageEx(targetid, COLOR_VIP, "VIP Perk: Your %i minutes of jail time has been reduced by 75 percent to %i minutes.", minutes, percent(minutes, 75)); minutes = percent(minutes, 25); } PlayerInfo[targetid][pJailType] = 3; PlayerInfo[targetid][pJailTime] = minutes * 60; PlayerInfo[targetid][pWantedLevel] = 0; PlayerInfo[targetid][pArrested]++; ResetPlayerWeaponsEx(targetid); ResetPlayer(targetid); TogglePlayerControllable(targetid, 1); SetPlayerInJail(targetid); GivePlayerCash(targetid, -fine); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET wantedlevel = 0, arrested = %i WHERE uid = %i", PlayerInfo[targetid][pArrested], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM charges WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageToAllEx(COLOR_LIGHTRED, "<< %s %s has completed their arrest. %s has been sent to jail for %i days. >>", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), GetPlayerRPName(targetid), minutes); //SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_ROYALBLUE, "** HQ: %s %s has arrested %s for %i minutes, fine: $%i.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), GetPlayerRPName(targetid), minutes, fine); SendClientMessageEx(targetid, COLOR_AQUA, "** You've been arrested for %i minutes, fine: $%i.", minutes, fine); Log_Write("log_faction", "%s (uid: %i) has arrested %s (uid: %i) for %i minutes, fine: $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], minutes, fine); return 1; } } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any arrest points."); return 1; } CMD:wanted(playerid, params[]) { if(!IsLawEnforcement(playerid) && !PlayerHasJob(playerid, JOB_LAWYER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement or a lawyer."); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ Wanted Players _____"); foreach(new i : Player) { if(PlayerInfo[i][pWantedLevel] > 0) { SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s - Wanted Level: %i", i, GetPlayerRPName(i), PlayerInfo[i][pWantedLevel]); } } return 1; } CMD:find(playerid, params[]) { new targetid; if(!PlayerHasJob(playerid, JOB_DETECTIVE) && GetFactionType(playerid) != FACTION_POLICE && GetFactionType(playerid) != FACTION_FEDERAL && GetFactionType(playerid) != FACTION_ARMY) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command unless you're a Detective."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /find [playerid]"); } if(PlayerInfo[playerid][pDetectiveCooldown] > 0) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to wait %i more seconds to use this command again.", PlayerInfo[playerid][pDetectiveCooldown]); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(GetPlayerInterior(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "This player is in an interior. You can't find them at the moment."); } if(PlayerInfo[targetid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on an on duty administrator."); } if(PlayerInfo[targetid][pTogglePhone]) { return SendClientMessage(playerid, COLOR_GREY, "That player's phone is turned off. Therefore you can't find them."); } switch(GetJobLevel(playerid, JOB_DETECTIVE)) { case 1: { PlayerInfo[playerid][pFindTime] = 6; PlayerInfo[playerid][pDetectiveCooldown] = 120; } case 2: { PlayerInfo[playerid][pFindTime] = 8; PlayerInfo[playerid][pDetectiveCooldown] = 90; } case 3: { PlayerInfo[playerid][pFindTime] = 10; PlayerInfo[playerid][pDetectiveCooldown] = 60; } case 4: { PlayerInfo[playerid][pFindTime] = 12; PlayerInfo[playerid][pDetectiveCooldown] = 30; } case 5: { PlayerInfo[playerid][pFindTime] = 14; PlayerInfo[playerid][pDetectiveCooldown] = 15; } } SetPlayerMarkerForPlayer(playerid, targetid, 0xFF0000FF); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes out a cellphone and begins to track someone.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_WHITE, "** %s's location marked on your radar. %i seconds remain until the marker disappears.", GetPlayerRPName(targetid), PlayerInfo[playerid][pFindTime]); IncreaseJobSkill(playerid, JOB_DETECTIVE); PlayerInfo[playerid][pFindPlayer] = targetid; return 1; } CMD:frisk(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /frisk [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You cannot frisk yourself."); } if(PlayerHasJob(playerid, JOB_BODYGUARD) || IsLawEnforcement(playerid)) { FriskPlayer(playerid, targetid); } else { PlayerInfo[targetid][pFriskOffer] = playerid; SendClientMessageEx(targetid, COLOR_AQUA, "** %s is attempting to frisk you for illegal items. (/accept frisk)", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have sent a frisk offer to %s.", GetPlayerRPName(targetid)); } return 1; } CMD:take(playerid, params[]) { new targetid, option[14]; if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if(sscanf(params, "us[14]", targetid, option)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /take [playerid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Weapons, Weed, Cocaine, Meth, Painkillers, CarLicense"); return 1; } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(!strcmp(option, "weapons", true)) { ResetPlayerWeaponsEx(targetid); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes away %s's weapons.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has taken your weapons.", GetPlayerRPName(playerid)); Log_Write("log_faction", "%s (uid: %i) has taken %s's (uid: %i) weapons.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); } else if(!strcmp(option, "weed", true)) { if(!PlayerInfo[targetid][pWeed]) { return SendClientMessage(playerid, COLOR_GREY, "That player has no weed on them."); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes away %s's weed.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has taken your %i grams of weed.", GetPlayerRPName(playerid), PlayerInfo[targetid][pWeed]); Log_Write("log_faction", "%s (uid: %i) has taken %s's (uid: %i) %i grams of weed.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], PlayerInfo[targetid][pWeed]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[targetid][pWeed] = 0; } else if(!strcmp(option, "cocaine", true)) { if(!PlayerInfo[targetid][pCocaine]) { return SendClientMessage(playerid, COLOR_GREY, "That player has no cocaine on them."); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes away %s's cocaine.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has taken your %i grams of cocaine.", GetPlayerRPName(playerid), PlayerInfo[targetid][pWeed]); Log_Write("log_faction", "%s (uid: %i) has taken %s's (uid: %i) %i grams of cocaine.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], PlayerInfo[targetid][pCocaine]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[targetid][pCocaine] = 0; } else if(!strcmp(option, "meth", true)) { if(!PlayerInfo[targetid][pMeth]) { return SendClientMessage(playerid, COLOR_GREY, "That player has no meth on them."); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes away %s's meth.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has taken your %i grams of meth.", GetPlayerRPName(playerid), PlayerInfo[targetid][pWeed]); Log_Write("log_faction", "%s (uid: %i) has taken %s's (uid: %i) %i grams of meth.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], PlayerInfo[targetid][pMeth]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[targetid][pMeth] = 0; } else if(!strcmp(option, "painkillers", true)) { if(!PlayerInfo[targetid][pPainkillers]) { return SendClientMessage(playerid, COLOR_GREY, "That player has no painkillers on them."); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes away %s's painkillers.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has taken your %i painkillers.", GetPlayerRPName(playerid), PlayerInfo[targetid][pWeed]); Log_Write("log_faction", "%s (uid: %i) has taken %s's (uid: %i) %i painkillers.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], PlayerInfo[targetid][pPainkillers]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[targetid][pPainkillers] = 0; } else if(!strcmp(option, "carlicense", true)) { if(!PlayerInfo[targetid][pCarLicense]) { return SendClientMessage(playerid, COLOR_GREY, "That player has no driving license on them."); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes away %s's drivers license.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has taken your drivers license.", GetPlayerRPName(playerid)); Log_Write("log_faction", "%s (uid: %i) has taken %s's (uid: %i) drivers license.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET carlicense = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[targetid][pCarLicense] = 0; } return 1; } CMD:ticket(playerid, params[]) { new targetid, amount, reason[128]; if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if(sscanf(params, "uis[128]", targetid, amount, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /ticket [playerid] [amount] [reason]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't ticket yourself."); } if(!(1000 <= amount <= 10000)) { return SendClientMessage(playerid, COLOR_GREY, "The ticket amount must range between $1000 and $10000."); } PlayerInfo[targetid][pTicketOffer] = playerid; PlayerInfo[targetid][pTicketPrice] = amount; SendClientMessageEx(targetid, COLOR_AQUA, "** %s writes you a %s ticket for %s. (/accept ticket)", GetPlayerRPName(playerid), FormatNumber(amount), reason); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered a %s ticket to %s for %s.", FormatNumber(amount), GetPlayerRPName(targetid), reason); return 1; } CMD:gov(playerid, params[]) { if(PlayerInfo[playerid][pFaction] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any faction at the moment."); } if(!PlayerInfo[playerid][pFactionLeader]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gov [text]"); } switch(FactionInfo[PlayerInfo[playerid][pFaction]][fType]) { case FACTION_MEDIC: { if(!PlayerInfo[playerid][pGovTimer]) SendClientMessageToAll(COLOR_GREY1, "____________ Public Service Announcement ____________"); SendClientMessageToAllEx(COLOR_DOCTOR, "** %s %s: %s", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params); PlayerInfo[playerid][pGovTimer] = 30; } case FACTION_POLICE: { if(!PlayerInfo[playerid][pGovTimer]) SendClientMessageToAll(COLOR_GREY1, "____________ Public Service Announcement ____________"); SendClientMessageToAllEx(COLOR_BLUE, "** %s %s: %s", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params); PlayerInfo[playerid][pGovTimer] = 30; } case FACTION_GOVERNMENT: { if(!PlayerInfo[playerid][pGovTimer]) SendClientMessageToAll(COLOR_GREY1, "____________ Government News Announcement ____________"); SendClientMessageToAllEx(COLOR_YELLOW2, "** %s %s: %s", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params); PlayerInfo[playerid][pGovTimer] = 30; } case FACTION_FEDERAL: { if(!PlayerInfo[playerid][pGovTimer]) SendClientMessageToAll(COLOR_GREY1, "____________ Public Service Announcement ____________"); SendClientMessageToAllEx(COLOR_ROYALBLUE, "** %s %s: %s", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params); PlayerInfo[playerid][pGovTimer] = 30; } case FACTION_ARMY: { if(!PlayerInfo[playerid][pGovTimer]) SendClientMessageToAll(COLOR_GREY1, "____________ Public Service Announcement ____________"); SendClientMessageToAllEx(COLOR_ROYALBLUE, "** %s %s: %s", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), params); PlayerInfo[playerid][pGovTimer] = 30; } default: { SendClientMessage(playerid, COLOR_GREY, "Your faction is not authorized to use this command."); } } return 1; } CMD:ram(playerid, params[]) { new id; if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(IsValidDynamicObject(i) && IsPlayerInRangeOfDynamicObject(playerid, i, 2.5) && IsDoorObject(i)) { if((id = GetInsideHouse(playerid)) >= 0 && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_FURNITURE && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == HouseInfo[id][hID]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT door_opened FROM furniture WHERE id = %i", Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnPlayerRamFurnitureDoor", "iii", playerid, i, Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); return 1; } /*else if((id = GetNearbyLand(playerid)) >= 0 && Streamer_GetExtraInt(i, E_OBJECT_TYPE) == E_OBJECT_LAND && Streamer_GetExtraInt(i, E_OBJECT_EXTRA_ID) == LandInfo[id][lID]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT door_opened FROM landobjects WHERE id = %i", Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); mysql_tquery(connectionID, queryBuffer, "OnPlayerRamLandDoor", "iii", playerid, i, Streamer_GetExtraInt(i, E_OBJECT_INDEX_ID)); return 1; }*/ } } if((id = GetNearbyHouse(playerid)) >= 0) { if(!HouseInfo[id][hLocked]) { return SendClientMessage(playerid, COLOR_GREY, "This house is unlocked. You don't need to ram the door."); } HouseInfo[id][hLocked] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET locked = 0 WHERE id = %i", HouseInfo[id][hID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s rams down %s's house door.", GetPlayerRPName(playerid), HouseInfo[id][hOwner]); } else if((id = GetNearbyBusiness(playerid)) >= 0) { if(!BusinessInfo[id][bLocked]) { return SendClientMessage(playerid, COLOR_GREY, "This business is unlocked. You don't need to ram the door."); } BusinessInfo[id][bLocked] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE businesses SET locked = 0 WHERE id = %i", BusinessInfo[id][bID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s rams down %s's business door.", GetPlayerRPName(playerid), BusinessInfo[id][bOwner]); } else if((id = GetNearbyGarage(playerid)) >= 0) { if(!GarageInfo[id][gLocked]) { return SendClientMessage(playerid, COLOR_GREY, "This garage is unlocked. You don't need to ram the door."); } GarageInfo[id][gLocked] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE garages SET locked = 0 WHERE id = %i", GarageInfo[id][gID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s rams down %s's garage door.", GetPlayerRPName(playerid), GarageInfo[id][gOwner]); } else { SendClientMessage(playerid, COLOR_GREY, "You are not in range of any door which can be rammed."); } return 1; } CMD:deploy(playerid, params[]) { new type[12], type_id = -1, Float:x, Float:y, Float:z, Float:a; if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_MEDIC && GetFactionType(playerid) != FACTION_TERRORIST) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic or law enforcer."); } if(sscanf(params, "s[12]", type)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /deploy [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Spikestrip, Cone, Roadblock, Barrel, Flare"); return 1; } if(GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't deploy objects inside."); } GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); if(!strcmp(type, "spikestrip", true)) { type_id = DEPLOY_SPIKESTRIP; } else if(!strcmp(type, "cone", true)) { type_id = DEPLOY_CONE; } else if(!strcmp(type, "roadblock", true)) { type_id = DEPLOY_ROADBLOCK; } else if(!strcmp(type, "barrel", true)) { type_id = DEPLOY_BARREL; } else if(!strcmp(type, "flare", true)) { type_id = DEPLOY_FLARE; } if(type_id == -1) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } if(DeployObject(type_id, x, y, z, a) == -1) { return SendClientMessage(playerid, COLOR_GREY, "The deployable objects pool is full. Try deleting some first."); } if(IsLawEnforcement(playerid)) SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_ROYALBLUE, "** HQ: %s %s has deployed a %s in %s.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), deployableItems[type_id], GetZoneName(x, y, z)); else SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_DOCTOR, "** HQ: %s %s has deployed a %s in %s.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), deployableItems[type_id], GetZoneName(x, y, z)); return 1; } CMD:undeployall(playerid, params[]) { if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_MEDIC && GetFactionType(playerid) != FACTION_TERRORIST) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic or law enforcer."); } for(new i = 0; i < MAX_DEPLOYABLES; i ++) { if(DeployInfo[i][dExists]) { DestroyDynamicObject(DeployInfo[i][dObject]); DeployInfo[i][dExists] = 0; DeployInfo[i][dType] = -1; } } SendFactionMessage(PlayerInfo[playerid][pFaction], (IsLawEnforcement(playerid)) ? (COLOR_ROYALBLUE) : (COLOR_DOCTOR), "** HQ: %s %s has removed all deployed objects.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid)); return 1; } CMD:undeploy(playerid, params[]) { if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_MEDIC && GetFactionType(playerid) != FACTION_TERRORIST) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic or law enforcer."); } for(new i = 0; i < MAX_DEPLOYABLES; i ++) { if(DeployInfo[i][dExists]) { new Float:range; if(DeployInfo[i][dType] == DEPLOY_SPIKESTRIP || DeployInfo[i][dType] == DEPLOY_BARREL || DeployInfo[i][dType] == DEPLOY_FLARE || DeployInfo[i][dType] == DEPLOY_CONE) { range = 2.0; } else if(DeployInfo[i][dType] == DEPLOY_ROADBLOCK) { range = 5.0; } if(IsPlayerInRangeOfPoint(playerid, range, DeployInfo[i][dPosX], DeployInfo[i][dPosY], DeployInfo[i][dPosZ])) { SendFactionMessage(PlayerInfo[playerid][pFaction], (IsLawEnforcement(playerid)) ? (COLOR_ROYALBLUE) : (COLOR_DOCTOR), "** HQ: %s %s has removed a %s in %s.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), deployableItems[DeployInfo[i][dType]], GetZoneName(DeployInfo[i][dPosX], DeployInfo[i][dPosY], DeployInfo[i][dPosZ])); DestroyDynamicObject(DeployInfo[i][dObject]); DeployInfo[i][dExists] = 0; DeployInfo[i][dType] = -1; return 1; } } } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any deployed objects."); return 1; } CMD:bk(playerid, params[]) { return callcmd::backup(playerid, params); } CMD:backup(playerid, params[]) { if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_MEDIC && GetFactionType(playerid) != FACTION_GOVERNMENT) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic or law enforcer."); } if(PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot call for backup when you are dead."); } if(PlayerInfo[playerid][pCuffed]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while cuffed."); } if(PlayerInfo[playerid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while tied."); } if(!PlayerInfo[playerid][pBackup]) { PlayerInfo[playerid][pBackup] = 1; } else { PlayerInfo[playerid][pBackup] = 0; } foreach(new i : Player) { switch(GetFactionType(i)) { case FACTION_POLICE, FACTION_MEDIC, FACTION_FEDERAL, FACTION_ARMY, FACTION_GOVERNMENT: { if(PlayerInfo[playerid][pBackup]) { SendClientMessageEx(i, COLOR_ROYALBLUE, "** HQ: %s %s is requesting backup in %s (marked on map).", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), GetPlayerZoneName(playerid)); SetPlayerMarkerForPlayer(i, playerid, (FactionInfo[PlayerInfo[playerid][pFaction]][fColor] & ~0xff) + 0xFF); } else { SendClientMessageEx(i, COLOR_ROYALBLUE, "** HQ: %s %s has cancelled their backup request.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), GetPlayerZoneName(playerid)); SetPlayerMarkerForPlayer(i, playerid, GetPlayerColor(playerid)); } } } } return 1; } CMD:mdc(playerid, params[]) { if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic or law enforcer."); } if((!IsPlayerInRangeOfPoint(playerid, 50.0, 1229.3544, -1311.8627, 796.7859)) && !(400 <= GetVehicleModel(GetPlayerVehicleID(playerid)) <= 600)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside a police car or the police station."); } ShowPlayerDialog(playerid, DIALOG_MDC, DIALOG_STYLE_LIST, "Mobile data computer", "Wanted suspects\nPlayer lookup\nVehicle lookup", "Select", "Cancel"); return 1; } CMD:clearwanted(playerid, params[]) { new targetid; if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /clearwanted [playerid]"); } /*if((!IsPlayerInRangeOfPoint(playerid, 50.0, 1229.3544, -1311.8627, 796.7859)) && !(596 <= GetVehicleModel(GetPlayerVehicleID(playerid)) <= 599)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside a police car or the police station."); }*/ if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't clear yourself."); } if(!PlayerInfo[targetid][pWantedLevel]) { return SendClientMessage(playerid, COLOR_GREY, "That player has no active charges to clear."); } PlayerInfo[targetid][pWantedLevel] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM charges WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET wantedlevel = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s calls in dispatch and asks for a warrant removal of %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_WHITE, "** Your crimes were cleared by %s.", GetPlayerRPName(playerid)); SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_ROYALBLUE, "** HQ: %s %s has cleared %s's charges and wanted level.", FactionRanks[PlayerInfo[playerid][pFaction]][PlayerInfo[playerid][pFactionRank]], GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:vticket(playerid, params[]) { new amount, vehicleid; if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if(sscanf(params, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vticket [amount]"); } if((vehicleid = GetNearbyVehicle(playerid)) == INVALID_VEHICLE_ID) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any vehicle."); } if(!VehicleInfo[vehicleid][vOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle isn't owned by any particular person."); } if(!(1000 <= amount <= 5000)) { return SendClientMessage(playerid, COLOR_GREY, "The amount must range from $1000 to $5000."); } if(VehicleInfo[vehicleid][vTickets] >= 50000) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has over $50000 in tickets. You can't add anymore."); } VehicleInfo[vehicleid][vTickets] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET tickets = %i WHERE id = %i", VehicleInfo[vehicleid][vTickets], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s writes up a %s ticket and attaches it to the %s.", GetPlayerRPName(playerid), FormatNumber(amount), GetVehicleName(vehicleid)); Log_Write("log_faction", "%s (uid: %i) placed a ticket for $%i on %s's (uid: %i) %s (id: %i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, VehicleInfo[vehicleid][vOwner], VehicleInfo[vehicleid][vOwnerID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); return 1; } CMD:siren(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), Float:x, Float:y, Float:z, Float:tmp; if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_MEDIC && GetFactionType(playerid) != FACTION_GOVERNMENT) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic or law enforcer."); } if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any vehicle."); } if(!VehicleHasWindows(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle cannot have a siren attached to it."); } if(!IsValidDynamicObject(vehicleSiren[vehicleid])) { GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_SIZE, z, z, z); GetVehicleModelInfo(GetVehicleModel(vehicleid), VEHICLE_MODEL_INFO_FRONTSEAT, x, y, tmp); vehicleSiren[vehicleid] = CreateDynamicObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachDynamicObjectToVehicle(vehicleSiren[vehicleid], vehicleid, -x, y, z / 1.9, 0.0, 0.0, 0.0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s places a detachable siren on the roof of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); } else { DestroyDynamicObject(vehicleSiren[vehicleid]); vehicleSiren[vehicleid] = INVALID_OBJECT_ID; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s detaches the siren from the roof of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); } return 1; } CMD:callsign(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_MEDIC) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic or law enforcer."); } if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any vehicle."); } if(isnull(params) || strlen(params) > 12) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /callsign [text ('none' to reset)]"); } if(IsValidDynamic3DTextLabel(vehicleCallsign[vehicleid])) { DestroyDynamic3DTextLabel(vehicleCallsign[vehicleid]); vehicleCallsign[vehicleid] = Text3D:INVALID_3DTEXT_ID; if(!strcmp(params, "none", true)) { SendClientMessage(playerid, COLOR_WHITE, "** Callsign removed from the vehicle."); } } if(strcmp(params, "none", true) != 0) { vehicleCallsign[vehicleid] = CreateDynamic3DTextLabel(params, COLOR_GREY2, 0.0, -3.0, 0.0, 10.0, .attachedvehicle = vehicleid); SendClientMessage(playerid, COLOR_WHITE, "** Callsign attached. '/callsign none' to detach the callsign."); } return 1; } CMD:vfrisk(playerid, params[]) { new vehicleid; if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if((vehicleid = GetNearbyVehicle(playerid)) == INVALID_VEHICLE_ID) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any vehicle."); } if(!VehicleInfo[vehicleid][vOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle isn't owned by any particular person."); } new count; for(new i = 0; i < 5; i ++) { if(VehicleInfo[vehicleid][vWeapons][i]) { count++; } } SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Trunk Balance ______"); SendClientMessageEx(playerid, COLOR_GREY2, "Cash: $%i/$%i", VehicleInfo[vehicleid][vCash], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_CASH)); SendClientMessageEx(playerid, COLOR_GREY2, "Materials: %i/%i | Weapons: %i/%i", VehicleInfo[vehicleid][vMaterials], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_MATERIALS), count, GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_WEAPONS)); SendClientMessageEx(playerid, COLOR_GREY2, "Weed: %i/%i grams | Cocaine: %i/%i grams", VehicleInfo[vehicleid][vWeed], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_WEED), VehicleInfo[vehicleid][vCocaine], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_COCAINE)); SendClientMessageEx(playerid, COLOR_GREY2, "Meth: %i/%i grams | Painkillers: %i/%i pills", VehicleInfo[vehicleid][vMeth], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_METH), VehicleInfo[vehicleid][vPainkillers], GetVehicleStashCapacity(vehicleid, STASH_CAPACITY_PAINKILLERS)); if(count > 0) { SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Trunk Weapons ______"); for(new i = 0; i < 5; i ++) { if(VehicleInfo[vehicleid][vWeapons][i]) { SendClientMessageEx(playerid, COLOR_GREY2, "[%i] Weapon: %s", i + 1, GetWeaponNameEx(VehicleInfo[vehicleid][vWeapons][i])); } } } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s prys open the trunk of the %s and takes a look inside.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); return 1; } CMD:vtake(playerid, params[]) { new vehicleid, option[14]; if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } if(sscanf(params, "s[14]", option)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vtake [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Weapons, Weed, Cocaine, Meth, Painkillers"); return 1; } if((vehicleid = GetNearbyVehicle(playerid)) == INVALID_VEHICLE_ID) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any vehicle."); } if(!VehicleInfo[vehicleid][vOwnerID]) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle isn't owned by any particular person."); } if(!strcmp(option, "weapons", true)) { VehicleInfo[vehicleid][vWeapons][0] = 0; VehicleInfo[vehicleid][vWeapons][1] = 0; VehicleInfo[vehicleid][vWeapons][2] = 0; VehicleInfo[vehicleid][vWeapons][3] = 0; VehicleInfo[vehicleid][vWeapons][4] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET weapon_1 = 0, weapon_2 = 0, weapon_3 = 0, weapon_4 = 0, weapon_5 = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes the weapons from the trunk of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); SendClientMessage(playerid, COLOR_AQUA, "You have taken the weapons from the trunk."); Log_Write("log_faction", "%s (uid: %i) has taken the weapons from %s's (uid: %i) %s trunk (id: %i).", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], VehicleInfo[vehicleid][vOwner], VehicleInfo[vehicleid][vOwnerID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); } else if(!strcmp(option, "weed", true)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes the weed from the trunk of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have taken the %i grams of weed from the trunk.", VehicleInfo[vehicleid][vWeed]); Log_Write("log_faction", "%s (uid: %i) has taken the %i grams of weed from %s's (uid: %i) %s trunk (id: %i).", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], VehicleInfo[vehicleid][vWeed], VehicleInfo[vehicleid][vOwner], VehicleInfo[vehicleid][vOwnerID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET weed = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); VehicleInfo[vehicleid][vWeed] = 0; } else if(!strcmp(option, "cocaine", true)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes the cocaine from the trunk of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have taken the %i grams of cocaine from the trunk.", VehicleInfo[vehicleid][vCocaine]); Log_Write("log_faction", "%s (uid: %i) has taken the %i grams of cocaine from %s's (uid: %i) %s trunk (id: %i).", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], VehicleInfo[vehicleid][vCocaine], VehicleInfo[vehicleid][vOwner], VehicleInfo[vehicleid][vOwnerID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET cocaine = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); VehicleInfo[vehicleid][vCocaine] = 0; } else if(!strcmp(option, "meth", true)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes the meth from the trunk of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have taken the %i grams of meth from the trunk.", VehicleInfo[vehicleid][vMeth]); Log_Write("log_faction", "%s (uid: %i) has taken the %i grams of meth from %s's (uid: %i) %s trunk (id: %i).", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], VehicleInfo[vehicleid][vMeth], VehicleInfo[vehicleid][vOwner], VehicleInfo[vehicleid][vOwnerID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET meth = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); VehicleInfo[vehicleid][vMeth] = 0; } else if(!strcmp(option, "painkillers", true)) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes the painkillers from the trunk of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have taken the %i painkillers from the trunk.", VehicleInfo[vehicleid][vPainkillers]); Log_Write("log_faction", "%s (uid: %i) has taken the %i painkillers from %s's (uid: %i) %s trunk (id: %i).", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], VehicleInfo[vehicleid][vPainkillers], VehicleInfo[vehicleid][vOwner], VehicleInfo[vehicleid][vOwnerID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET painkillers = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); VehicleInfo[vehicleid][vPainkillers] = 0; } return 1; } CMD:aheal(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use this command."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /aheal [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } SetPlayerHealth(targetid, 100); SetScriptArmour(targetid, 100); SendClientMessageEx(targetid, COLOR_AQUA, "Administrator %s has just healed you.", GetPlayerRPName(playerid)); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has healed %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:heal(playerid, params[]) { new targetid; if(GetFactionType(playerid) != FACTION_MEDIC) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /heal [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't heal yourself."); } if(PlayerInfo[targetid][pReceivingAid]) { return SendClientMessage(playerid, COLOR_GREY, "This player already has first aid effects."); } PlayerInfo[targetid][pReceivingAid] = 1; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s administers first aid to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "You have received first aid from %s. Your health will now regenerate until full.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have administered first aid to %s.", GetPlayerRPName(targetid)); return 1; } CMD:stretcher(playerid, params[]) { new targetid, vehicleid = GetPlayerVehicleID(playerid); if(GetFactionType(playerid) != FACTION_MEDIC) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /stretcher [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 15.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(!PlayerInfo[targetid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not injured."); } if(IsPlayerInAnyVehicle(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already in a vehicle."); } if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER && GetVehicleModel(GetPlayerVehicleID(playerid)) != 416 && GetVehicleModel(GetPlayerVehicleID(playerid)) != 490) { return SendClientMessage(playerid, COLOR_GREY, "You need to be driving an ambulance."); } for(new i = 2; i < GetVehicleSeatCount(vehicleid); i ++) { if(!IsSeatOccupied(vehicleid, i)) { PlayerInfo[targetid][pVehicleCount] = 0; ClearAnimations(targetid, 1); ApplyAnimation(targetid, "CARRY", "crry_prtial", 4.1, 0, 0, 0, 0, 0, 1); TogglePlayerControllable(targetid, 0); PutPlayerInVehicle(targetid, vehicleid, i); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s places %s on a stretcher in the Ambulance.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } } SendClientMessage(playerid, COLOR_GREY, "There are no unoccupied seats left. Find another vehicle."); return 1; } CMD:deliverpatient(playerid, params[]) { new targetid, amount = 2000; if(GetFactionType(playerid) != FACTION_MEDIC) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /deliverpatient [playerid]"); } if(!IsPlayerInRangeOfPoint(playerid, 5.0, 2007.6256, -1410.2455, 16.9922) && !IsPlayerInRangeOfPoint(playerid, 5.0, 1147.3577, -1345.3729, 13.6328) && !IsPlayerInRangeOfPoint(playerid, 5.0, 2070.4307, -1422.8580, 48.331) && !IsPlayerInRangeOfPoint(playerid, 5.0, 1161.1458,-1364.4767,26.6485) && !IsPlayerInRangeOfPoint(playerid, 5.0, 1510.7773, -2151.7322, 13.7483) && !IsPlayerInRangeOfPoint(playerid, 5.0, 1480.4819, -2166.9712, 35.2578) && !IsPlayerInRangeOfPoint(playerid, 5.0, 1539.1060, -2167.2058, 35.2578)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any delivery points at the hospital."); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 7.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(!PlayerInfo[targetid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not injured."); } if(PlayerInfo[playerid][pLaborUpgrade] > 0) { amount += percent(amount, PlayerInfo[playerid][pLaborUpgrade]); } PlayerInfo[targetid][pInjured] = 0; PlayerInfo[targetid][pDelivered] = 0; PlayerInfo[playerid][pTotalPatients]++; if(IsPlayerInRangeOfPoint(playerid, 5.0, 2007.6256, -1410.2455, 16.9922) || IsPlayerInRangeOfPoint(playerid, 5.0, 2070.4307,-1422.8580,48.331)) { SetPlayerVirtualWorld(targetid, HOSPITAL_COUNTY); } if(GetFactionType(targetid) == FACTION_POLICE || GetFactionType(targetid) == FACTION_MEDIC) { SendClientMessage(targetid, COLOR_DOCTOR, "You have not been billed for your stay. You also keep all of your weapons!"); } else { SendClientMessage(targetid, COLOR_DOCTOR, "You have been billed $500 for your stay. You also keep all of your weapons!"); } SetPlayerPos(targetid, -10.4534, 149.3639, 999.0613); SetPlayerFacingAngle(targetid, 180.0000); SetPlayerInterior(targetid, 1); SetCameraBehindPlayer(targetid); if(!(GetFactionType(targetid) == FACTION_POLICE || GetFactionType(targetid) == FACTION_MEDIC)) { GivePlayerCash(targetid, -500); GameTextForPlayer(targetid, "~w~Discharged~n~~r~-$500", 5000, 1); } TogglePlayerControllable(targetid, 1); SetPlayerDrunkLevel(targetid, 0); SetPlayerHealth(targetid, PlayerInfo[targetid][pSpawnHealth]); SetScriptArmour(targetid, PlayerInfo[targetid][pSpawnArmor]); PlayerInfo[targetid][pAcceptedEMS] = INVALID_PLAYER_ID; AddToPaycheck(playerid, amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have delivered %s to the hospital and earned {00AA00}$%i{33CCFF} on your paycheck.", GetPlayerRPName(targetid), amount); return 1; } CMD:listbugs(playerid, params[]) { if(GetFactionType(playerid) != FACTION_FEDERAL) { SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a federal agent."); return 1; } SendClientMessage(playerid, COLOR_GREEN, "Bugged players:"); foreach(new i : Player) { if(PlayerInfo[i][pBugged]) { SendClientMessageEx(playerid, COLOR_GREY, "Name: %s - Location: %s", GetPlayerRPName(i), GetPlayerZoneName(i)); } } return 1; } CMD:listpt(playerid, params[]) { if(GetFactionType(playerid) != FACTION_MEDIC) { SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic."); return 1; } SendClientMessage(playerid, COLOR_GREEN, "Injured - (/injuries):"); foreach(new i : Player) { if(PlayerInfo[i][pInjured]) { new accepted[24]; if(IsPlayerConnected(PlayerInfo[i][pAcceptedEMS])) { accepted = GetPlayerRPName(PlayerInfo[i][pAcceptedEMS]); } else { accepted = "None"; } SendClientMessageEx(playerid, COLOR_GREY, "Name: %s - Location: %s - Medic: %s", GetPlayerRPName(i), GetPlayerZoneName(i), accepted); } } SendClientMessage(playerid, COLOR_AQUA, "Use /getpt [playerid] to track them!"); return 1; } CMD:getpt(playerid, params[]) { if(GetFactionType(playerid) == FACTION_MEDIC) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /getpt [playerid]"); } if(IsPlayerConnected(targetid)) { if(targetid == playerid) { SendClientMessage(playerid, COLOR_AQUA, "You can't accept your own Emergency Dispatch call!"); return 1; } if(!PlayerInfo[targetid][pInjured]) { SendClientMessage(playerid, COLOR_GREY, "That person is not injured!"); return 1; } if(!IsPlayerConnected(PlayerInfo[targetid][pAcceptedEMS])) { if(PlayerInfo[targetid][pJailTime] > 0) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on jailed players."); SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_DOCTOR, "EMS Driver %s has accepted the Emergency Dispatch call for %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(playerid, COLOR_AQUA, "* You have accepted EMS Call from %s, you will see the marker until you have reached it.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "* EMS Driver %s has accepted your EMS Call; please be patient as they are on the way!", GetPlayerNameEx(playerid)); PlayerInfo[targetid][pAcceptedEMS] = playerid; GameTextForPlayer(playerid, "~w~EMS Caller~n~~r~Go to the red marker.", 5000, 1); PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; new Float:ppos[3]; GetPlayerPosEx(targetid, ppos[0], ppos[1], ppos[2]); SetPlayerCheckpoint(playerid, ppos[0],ppos[1],ppos[2], 3.0); } else { SendClientMessage(playerid, COLOR_WHITE, "Someone has already accepted that call!"); } } } return 1; } CMD:loadpt(playerid, params[]) { return callcmd::stretcher(playerid, params); } CMD:deliverpt(playerid, params[]) { return callcmd::deliverpatient(playerid, params); } CMD:movept(playerid, params[]) { return callcmd::drag(playerid, params); } CMD:injuries(playerid, params[]) { new targetid; if(GetFactionType(playerid) != FACTION_MEDIC) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /injuries [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT weaponid, timestamp FROM shots WHERE hitid = %i AND hittype = 1 ORDER BY id DESC LIMIT 20", targetid); mysql_tquery(connectionID, queryBuffer, "OnPlayerListInjuries", "ii", playerid, targetid); return 1; } CMD:news(playerid, params[]) { if(GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a news reporter."); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /news [text]"); } if(PlayerInfo[playerid][pToggleNews]) { return SendClientMessage(playerid, COLOR_GREY, "You can't make news broadcasts as you have it toggled."); } foreach(new i : Player) { if(!PlayerInfo[i][pToggleNews]) { SendClientMessageEx(i, COLOR_LIGHTGREEN, "News Reporter %s: %s", GetPlayerRPName(playerid), params); } } return 1; } CMD:live(playerid, params[]) { new targetid; if(GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a news reporter."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /live [playerid]"); } if(PlayerInfo[playerid][pLiveMuted]) { return SendClientMessage(playerid, COLOR_GREY, "You are banned from live interviews. Ask a higher rank to lift your ban."); } if(PlayerInfo[playerid][pLiveBroadcast] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You are already doing a live interview. /endlive to finish it."); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't interview yourself."); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(PlayerInfo[targetid][pLiveMuted]) { return SendClientMessage(playerid, COLOR_GREY, "That player is banned from live interviews."); } if(PlayerInfo[targetid][pCallLine] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "That player is on a phone call at the moment."); } PlayerInfo[targetid][pLiveOffer] = playerid; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered you a live interview. (/accept live)", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered %s a live interview.", GetPlayerRPName(targetid)); return 1; } CMD:endlive(playerid, params[]) { if(GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a news reporter."); } if(PlayerInfo[playerid][pLiveBroadcast] == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You are currently not doing a live interview."); } SendClientMessage(playerid, COLOR_AQUA, "You have ended the live interview."); SendClientMessageEx(PlayerInfo[playerid][pLiveBroadcast], COLOR_AQUA, "%s has ended the live interview.", GetPlayerRPName(playerid)); PlayerInfo[PlayerInfo[playerid][pLiveBroadcast]][pLiveBroadcast] = INVALID_PLAYER_ID; PlayerInfo[playerid][pLiveBroadcast] = INVALID_PLAYER_ID; return 1; } CMD:liveban(playerid, params[]) { new targetid; if(GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a news reporter."); } if(PlayerInfo[playerid][pFactionRank] < FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 2) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to be at least rank %i+ to use this command.", FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 2); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /liveban [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(!PlayerInfo[targetid][pLiveMuted]) { if(PlayerInfo[targetid][pLiveBroadcast] != INVALID_PLAYER_ID) { PlayerInfo[PlayerInfo[targetid][pLiveBroadcast]][pLiveBroadcast] = INVALID_PLAYER_ID; PlayerInfo[targetid][pLiveBroadcast] = INVALID_PLAYER_ID; } PlayerInfo[targetid][pLiveMuted] = 1; SendClientMessageEx(targetid, COLOR_LIGHTRED, "%s has banned you from live interviews.", GetPlayerNameEx(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have banned %s from live interviews.", GetPlayerNameEx(targetid)); } else { PlayerInfo[targetid][pLiveMuted] = 0; SendClientMessageEx(targetid, COLOR_YELLOW, "%s has unbanned you from live interviews.", GetPlayerNameEx(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have unbanned %s from live interviews.", GetPlayerNameEx(targetid)); } return 1; } CMD:settax(playerid, params[]) { new amount; if(GetFactionType(playerid) != FACTION_GOVERNMENT) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of government."); } if(PlayerInfo[playerid][pFactionRank] < FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 1) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to be at least rank %i+ to use this command.", FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 1); } if(sscanf(params, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /settax [rate]"); } if(!(10 <= amount <= 50)) { return SendClientMessage(playerid, COLOR_GREY, "The tax percentage must range from 10 to 50."); } gTax = amount; SaveServerInfo(); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s has adjusted the income tax rate to %i percent.", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the income tax rate to %i percent.", amount); Log_Write("log_faction", "%s (uid: %i) set the income tax rate to %i percent.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); return 1; } CMD:factionpay(playerid, params[]) { new factionid = PlayerInfo[playerid][pFaction]; if(!PlayerInfo[playerid][pFactionLeader] && GetFactionType(playerid) != FACTION_NONE) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a faction leader or part of a faction altogether."); } if(sscanf(params, "s[5]", "edit")) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /factionpay [edit]"); } if(FactionInfo[factionid][fType] == FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "Hitman factions have no federal budget."); } PlayerInfo[playerid][pFactionEdit] = factionid; ShowDialogToPlayer(playerid, DIALOG_FACTIONPAY1); return 1; } CMD:adwithdraw(playerid, params[]) { new amount, reason[64]; if(GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of the news faction."); } if(PlayerInfo[playerid][pFactionRank] < FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 1) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to be at least rank %i+ to use this command.", FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 1); } if(!IsPlayerInRangeOfPoint(playerid, 10.0, -180.1077,1132.3331,-19.6455)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the bank."); } if(sscanf(params, "is[64]", amount, reason)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /adwithdraw [amount] [reason] ($%i available)", gNewsVault); } if(amount < 1 || amount > gNewsVault) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } gNewsVault -= amount; SaveServerInfo(); GivePlayerCash(playerid, amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You have withdrawn %s from the advertisement vault. The new balance is %s.", FormatNumber(amount), FormatNumber(gVault)); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s has withdrawn %s from the advertisement vault, reason: %s", GetPlayerRPName(playerid), FormatNumber(amount), reason); Log_Write("log_faction", "%s (uid: %i) has withdrawn $%i from the advertisement vault, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, reason); return 1; } CMD:addeposit(playerid, params[]) { new amount; if(GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of the news faction."); } if(PlayerInfo[playerid][pFactionRank] < FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 1) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to be at least rank %i+ to use this command.", FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 1); } if(!IsPlayerInRangeOfPoint(playerid, 10.0, -180.1077,1132.3331,-19.6455)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the bank."); } if(sscanf(params, "i", amount)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /addeposit [amount] ($%i available)", gNewsVault); } if(amount < 1 || amount > PlayerInfo[playerid][pCash]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } gNewsVault += amount; SaveServerInfo(); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You have deposited $%i in the advertisement vault. The new balance is $%i.", amount, gNewsVault); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s has deposited $%i in the advertisement vault.", GetPlayerRPName(playerid), amount); Log_Write("log_faction", "%s (uid: %i) has deposited $%i in the advertisement vault.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); return 1; } CMD:taxwithdraw(playerid, params[]) { new amount, reason[64]; if(GetFactionType(playerid) != FACTION_GOVERNMENT) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of government."); } if(PlayerInfo[playerid][pFactionRank] < FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 1) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to be at least rank %i+ to use this command.", FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 1); } if(!IsPlayerInRangeOfPoint(playerid, 10.0, -180.1077,1132.3331,-19.6455)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the bank."); } if(sscanf(params, "is[64]", amount, reason)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /taxwithdraw [amount] [reason] ($%i available)", gVault); } if(amount < 1 || amount > gVault) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } AddToTaxVault(-amount); GivePlayerCash(playerid, amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You have withdrawn %s from the tax vault. The new balance is %s.", FormatNumber(amount), FormatNumber(gVault)); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s has withdrawn %s from the tax vault, reason: %s", GetPlayerRPName(playerid), FormatNumber(amount), reason); Log_Write("log_faction", "%s (uid: %i) has withdrawn $%i from the tax vault, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount, reason); return 1; } CMD:taxdeposit(playerid, params[]) { new amount; if(GetFactionType(playerid) != FACTION_GOVERNMENT) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of government."); } if(PlayerInfo[playerid][pFactionRank] < FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 1) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to be at least rank %i+ to use this command.", FactionInfo[PlayerInfo[playerid][pFaction]][fRankCount] - 1); } if(!IsPlayerInRangeOfPoint(playerid, 10.0, -180.1077,1132.3331,-19.6455)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the bank."); } if(sscanf(params, "i", amount)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /taxdeposit [amount] ($%i available)", gVault); } if(amount < 1 || amount > PlayerInfo[playerid][pCash]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } AddToTaxVault(amount); GivePlayerCash(playerid, -amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You have deposited $%i in the tax vault. The new balance is $%i.", amount, gVault); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s has deposited $%i in the tax vault.", GetPlayerRPName(playerid), amount); Log_Write("log_faction", "%s (uid: %i) has deposited $%i in the tax vault.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], amount); return 1; } CMD:contract(playerid, params[]) { new targetid, amount, reason[64]; if(sscanf(params, "iis[64]", targetid, amount, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /contract [playerid] [amount] [reason]"); } if(PlayerInfo[playerid][pLevel] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You must be at least level 5+ to contract players."); } if(GetFactionType(playerid) == FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "You are a hitman and therefore can't contract other players."); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't contract yourself."); } if(PlayerInfo[targetid][pLevel] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can only contract level 5+ players."); } if(!(2500 <= amount <= 500000)) { return SendClientMessage(playerid, COLOR_GREY, "The amount must range from $2500 to $500000."); } if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You don't have that much money."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(PlayerInfo[targetid][pContracted] + amount > 500000) { return SendClientMessage(playerid, COLOR_GREY, "That player can't have more than $500000 on their head."); } foreach(new i : Player) { if(GetFactionType(i) == FACTION_HITMAN) { SendClientMessageEx(i, COLOR_YELLOW, "** %s has contracted %s for $%i, reason: %s [/contracts]", GetPlayerRPName(playerid), GetPlayerRPName(targetid), amount, reason); } } GivePlayerCash(playerid, -amount); PlayerInfo[targetid][pContracted] += amount; GetPlayerName(playerid, PlayerInfo[targetid][pContractBy], MAX_PLAYER_NAME); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET contracted = %i, contractby = '%e' WHERE uid = %i", PlayerInfo[targetid][pContracted], PlayerInfo[targetid][pContractBy], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have placed a contract on %s for $%i, reason: %s", GetPlayerRPName(targetid), amount, reason); SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s placed a contract on %s for $%i, reason: %s", GetPlayerRPName(playerid), GetPlayerRPName(targetid), amount, reason); Log_Write("log_contracts", "%s (uid: %i) placed a contract on %s (uid: %i) for $%i, reason: %s", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], amount, reason); return 1; } CMD:noknife(playerid, params[]) { if(GetFactionType(playerid) != FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a hitman."); } if(PlayerInfo[playerid][pNoKnife]) { PlayerInfo[playerid][pNoKnife] = 0; SendClientMessage(playerid, COLOR_AQUA, "You've enabled no knife mode, your armed weapon will never be a knife."); } else { PlayerInfo[playerid][pNoKnife] = 1; SendClientMessage(playerid, COLOR_AQUA, "You've disabled no knife mode, your armed weapon can be anything"); } return 1; } CMD:hfind(playerid, params[]) { new targetid; if(GetFactionType(playerid) != FACTION_HITMAN && GetFactionType(playerid) != FACTION_FEDERAL) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a hitman or federal agent."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /hfind [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(GetPlayerInterior(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "This player is an interior. You can't find them at the moment."); } if(PlayerInfo[targetid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on an on duty administrator."); } PlayerInfo[playerid][pFindTime] = 15; PlayerInfo[playerid][pFindPlayer] = targetid; SetPlayerMarkerForPlayer(playerid, targetid, 0xFF0000FF); SendClientMessageEx(playerid, COLOR_WHITE, "** %s's location marked on your radar. 15 seconds remain until the marker disappears.", GetPlayerRPName(targetid)); return 1; } CMD:contracts(playerid, params[]) { if(GetFactionType(playerid) != FACTION_HITMAN && PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_______ Pending Contracts _______"); foreach(new i : Player) { if(PlayerInfo[i][pContracted] > 0) { SendClientMessageEx(playerid, COLOR_GREY2, "ID: %i | Target: %s | Bounty price: %s | Last contracter: %s", i, GetPlayerRPName(i), FormatNumber(PlayerInfo[i][pContracted]), PlayerInfo[i][pContractBy]); } } SendClientMessage(playerid, COLOR_YELLOW, "** Use /takehit [id] or /denyhit [id] to handle contracts."); return 1; } CMD:denyhit(playerid, params[]) { new targetid; if(GetFactionType(playerid) != FACTION_HITMAN && PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a hitman."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /denyhit [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pContracted]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't been contracted."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has cancelled the contract on %s for $%i.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), PlayerInfo[targetid][pContracted]); if(GetFactionType(playerid) == FACTION_HITMAN) { SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_YELLOW, "** Hitman %s has cancelled the contract on %s for %s. **", GetPlayerRPName(playerid), GetPlayerRPName(targetid), FormatNumber(PlayerInfo[targetid][pContracted])); } PlayerInfo[targetid][pContracted] = 0; strcpy(PlayerInfo[targetid][pContractBy], "No-one", MAX_PLAYER_NAME); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET contracted = 0, contractby = 'No-one' WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); return 1; } CMD:takehit(playerid, params[]) { new targetid; if(GetFactionType(playerid) != FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a hitman."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /takehit [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(!PlayerInfo[targetid][pContracted]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't been contracted."); } if(PlayerInfo[targetid][pCash] + PlayerInfo[targetid][pBank] < PlayerInfo[targetid][pContracted] / 2) { return SendClientMessage(playerid, COLOR_GREY, "That player's total wealth is lower than the contract price. You can't put them in debt."); } PlayerInfo[playerid][pContractTaken] = targetid; SendFactionMessage(PlayerInfo[playerid][pFaction], COLOR_YELLOW, "** Hitman %s has accepted the contract to kill %s for %s. **", GetPlayerRPName(playerid), GetPlayerRPName(targetid), FormatNumber(PlayerInfo[targetid][pContracted])); SendClientMessageEx(playerid, COLOR_AQUA, "You have taken the hit. You will receive %s once you have assassinated {00AA00}%s{33CCFF}.", FormatNumber(PlayerInfo[targetid][pContracted]), GetPlayerRPName(targetid)); return 1; } CMD:marry(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /marry [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 3.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } /*if((id = GetInsideBusiness(playerid)) == -1 || BusinessInfo[id][bType] != BUSINESS_RESTAURANT) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at a restaurant to commence a wedding."); } if(PlayerInfo[playerid][pCash] < 25000 || PlayerInfo[targetid][pCash] < 25000) { return SendClientMessage(playerid, COLOR_GREY, "You both need to have atleast $25,000 to have a wedding."); }*/ if(PlayerInfo[playerid][pMarriedTo] != -1) { return SendClientMessageEx(playerid, COLOR_GREY, "You're already married to %s.", PlayerInfo[playerid][pMarriedName]); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't marry yourself."); } PlayerInfo[targetid][pMarriageOffer] = playerid; SendClientMessageEx(targetid, COLOR_AQUA, "** %s has asked you to marry them, Please be careful when chosing a partner, It will cost both parties $25,000. (/accept marriage)", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have sent %s a proposal for marriage.", GetPlayerRPName(targetid)); return 1; } CMD:divorce(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /divorce [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 3.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(PlayerInfo[playerid][pMarriedTo] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You aren't even married."); } if(PlayerInfo[playerid][pMarriedTo] != PlayerInfo[targetid][pID]) { return SendClientMessage(playerid, COLOR_GREY, "You aren't married to that person."); } PlayerInfo[targetid][pMarriageOffer] = playerid; SendClientMessageEx(targetid, COLOR_AQUA, "** %s has asked you to divorce them (/accept divorce)", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have sent %s a request for divorce.", GetPlayerRPName(targetid)); return 1; } CMD:profile(playerid, params[]) { new targetid; if(GetFactionType(playerid) != FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a hitman."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /profile [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_____ %s _____", GetPlayerRPName(targetid)); SendClientMessageEx(playerid, COLOR_GREY2, "Gender: %s", (PlayerInfo[targetid][pGender] == 2) ? ("Female") : ("Male")); SendClientMessageEx(playerid, COLOR_GREY2, "Age: %i years old", PlayerInfo[targetid][pAge]); if(PlayerInfo[targetid][pFaction] != -1) { SendClientMessageEx(playerid, COLOR_GREY2, "Faction: %s", FactionInfo[PlayerInfo[targetid][pFaction]][fName]); SendClientMessageEx(playerid, COLOR_GREY2, "Rank: %s (%i)", FactionRanks[PlayerInfo[targetid][pFaction]][PlayerInfo[targetid][pFactionRank]], PlayerInfo[targetid][pFactionRank]); } else { SendClientMessageEx(playerid, COLOR_GREY2, "Faction: None"); } if(PlayerInfo[targetid][pContracted] > 0) { SendClientMessageEx(playerid, COLOR_GREY2, "Contract: %s", FormatNumber(PlayerInfo[targetid][pContracted])); SendClientMessageEx(playerid, COLOR_GREY2, "Last Contracter: %s", PlayerInfo[targetid][pContractBy]); } SendClientMessageEx(playerid, COLOR_GREY2, "Completed Hits: %i", PlayerInfo[targetid][pCompletedHits]); SendClientMessageEx(playerid, COLOR_GREY2, "Failed Hits: %i", PlayerInfo[targetid][pFailedHits]); return 1; } CMD:passport(playerid, params[]) { new name[24], level, skinid; if(PlayerInfo[playerid][pPassport]) { Namechange(playerid, GetPlayerNameEx(playerid), PlayerInfo[playerid][pPassportName]); SetScriptSkin(playerid, PlayerInfo[playerid][pPassportSkin]); SendClientMessage(playerid, COLOR_AQUA, "You have burned your passport and received your old name, clothes, level and number back."); PlayerInfo[playerid][pLevel] = PlayerInfo[playerid][pPassportLevel]; PlayerInfo[playerid][pPhone] = PlayerInfo[playerid][pPassportPhone]; PlayerInfo[playerid][pPassport] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET passport = 0, passportname = 'None', passportlevel = 0, passportskin = 0, passportphone = 0, level = %i, phone = %i WHERE uid = %i", PlayerInfo[playerid][pLevel], PlayerInfo[playerid][pPhone], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); return 1; } if(GetFactionType(playerid) != FACTION_HITMAN && GetFactionType(playerid) != FACTION_FEDERAL) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a hitman or federal agent."); } if(sscanf(params, "s[24]ii", name, level, skinid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /passport [name] [level] [skinid]"); } if(!(3 <= strlen(name) <= 20)) { return SendClientMessage(playerid, COLOR_GREY, "Your name must range from 3 to 20 characters."); } if(strfind(name, "_") == -1) { return SendClientMessage(playerid, COLOR_GREY, "Your name needs to contain at least one underscore."); } if(!IsValidName(name)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid characters. Your name may only contain letters and underscores."); } if(PlayerInfo[playerid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You aren't allowed to change your name while on admin duty,"); } if(!(1 <= level <= 10)) { return SendClientMessage(playerid, COLOR_GREY, "Your level must range from 1 to 10."); } if(!(0 <= skinid <= 311)) { return SendClientMessage(playerid, COLOR_GREY, "The skin ID must range from 0 to 311."); } if(!isnull(PlayerInfo[playerid][pNameChange])) { return SendClientMessage(playerid, COLOR_GREY, "You have already requested a namechange. Please wait for a response."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE username = '%e'", name); mysql_tquery(connectionID, queryBuffer, "OnHitmanPassport", "isii", playerid, name, level, skinid); return 1; } CMD:plantbomb(playerid, params[]) { if(GetFactionType(playerid) != FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a hitman."); } if(!PlayerInfo[playerid][pBombs]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have any bombs."); } if(PlayerInfo[playerid][pPlantedBomb]) { return SendClientMessage(playerid, COLOR_GREY, "You have planted a bomb already."); } if(GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't plant a bomb inside."); } if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't plant a bomb while inside of a vehicle"); } GetPlayerPos(playerid, PlayerInfo[playerid][pBombX], PlayerInfo[playerid][pBombY], PlayerInfo[playerid][pBombZ]); ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 0, 0, 0, 0, 0); PlayerInfo[playerid][pPlantedBomb] = 1; PlayerInfo[playerid][pBombObject] = CreateDynamicObject(19602, PlayerInfo[playerid][pBombX], PlayerInfo[playerid][pBombY], PlayerInfo[playerid][pBombZ] - 1.0, 0.0, 0.0, 0.0); PlayerInfo[playerid][pBombs]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bombs = %i WHERE uid = %i", PlayerInfo[playerid][pBombs], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_WHITE, "** Bomb has been planted, use /detonate to make it go BOOM!"); return 1; } CMD:pickupbomb(playerid, params[]) { if(GetFactionType(playerid) != FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a hitman."); } if(!PlayerInfo[playerid][pPlantedBomb]) { return SendClientMessage(playerid, COLOR_GREY, "You haven't planted a bomb which you can pickup."); } if(!IsPlayerInRangeOfPoint(playerid, 3.0, PlayerInfo[playerid][pBombX], PlayerInfo[playerid][pBombY], PlayerInfo[playerid][pBombZ])) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of your planted bomb."); } ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 0, 0, 0, 0, 0); DestroyDynamicObject(PlayerInfo[playerid][pBombObject]); PlayerInfo[playerid][pBombObject] = INVALID_OBJECT_ID; PlayerInfo[playerid][pPlantedBomb] = 0; PlayerInfo[playerid][pBombs]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bombs = %i WHERE uid = %i", PlayerInfo[playerid][pBombs], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessage(playerid, COLOR_WHITE, "** You have picked up your bomb."); return 1; } CMD:detonate(playerid, params[]) { if(!PlayerInfo[playerid][pPlantedBomb]) { return SendClientMessage(playerid, COLOR_GREY, "You haven't planted a bomb which you can detonate."); } if(!IsPlayerInRangeOfPoint(playerid, 50.0, PlayerInfo[playerid][pBombX], PlayerInfo[playerid][pBombY], PlayerInfo[playerid][pBombZ])) { return SendClientMessage(playerid, COLOR_GREY, "You are too far away from your planted bomb."); } CreateExplosion(PlayerInfo[playerid][pBombX], PlayerInfo[playerid][pBombY], PlayerInfo[playerid][pBombZ], 11, 10.0); DestroyDynamicObject(PlayerInfo[playerid][pBombObject]); if(PlayerInfo[playerid][pContractTaken] != INVALID_PLAYER_ID && IsPlayerInRangeOfPoint(PlayerInfo[playerid][pContractTaken], 10.0, PlayerInfo[playerid][pBombX], PlayerInfo[playerid][pBombY], PlayerInfo[playerid][pBombZ])) { SetPlayerHealth(PlayerInfo[playerid][pContractTaken], 0.0); HandleContract(PlayerInfo[playerid][pContractTaken], playerid); } PlayerInfo[playerid][pBombObject] = INVALID_OBJECT_ID; PlayerInfo[playerid][pPlantedBomb] = 0; SendClientMessage(playerid, COLOR_WHITE, "** You have detonated your bomb!"); return 1; } CMD:saveaccounts(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } foreach(new i : Player) { SavePlayerVariables(i); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has saved all player accounts.", GetPlayerRPName(playerid)); return 1; } CMD:adestroyboombox(playerid, params[]) { new boomboxid; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if((boomboxid = GetNearbyBoombox(playerid)) == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "There is no boombox in range."); } SendClientMessageEx(playerid, COLOR_AQUA, "You have destroyed {00AA00}%s{33CCFF}'s boombox.", GetPlayerRPName(boomboxid)); DestroyBoombox(boomboxid); return 1; } CMD:setbanktimer(playerid, params[]) { new hours; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", hours)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /setbanktimer [hours]"); } if(hours < 0) { return SendClientMessage(playerid, COLOR_GREY, "Hours can't be below 0."); } RobberyInfo[rTime] = hours; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has reset the bank robbery timer to %i hours.", GetPlayerRPName(playerid), hours); return 1; } CMD:resetrobbery(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } ResetRobbery(); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has reset the active bank robbery.", GetPlayerRPName(playerid)); return 1; } CMD:addtorobbery(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /addtorobbery [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!RobberyInfo[rPlanning] && !RobberyInfo[rStarted]) { return SendClientMessage(playerid, COLOR_GREY, "There is no bank robbery in progress."); } if(GetBankRobbers() >= MAX_BANK_ROBBERS) { return SendClientMessageEx(playerid, COLOR_GREY, "There can't be more than %i bank robbers in this robbery.", MAX_BANK_ROBBERS); } if(IsPlayerInBankRobbery(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already in the bank robbery."); } AddToBankRobbery(targetid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has added %s to the bank robbery.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has added you to the bank robbery.", GetPlayerRPName(playerid)); return 1; } CMD:givepayday(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /givepayday [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } SendPaycheck(targetid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has forced a payday for %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:givepveh(playerid, params[]) { new model[20], modelid, targetid, color1, color2, Float:x, Float:y, Float:z, Float:a; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[20]ii", targetid, model, color1, color2)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /givepveh [playerid] [modelid/name] [color1] [color2]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if((modelid = GetVehicleModelByName(model)) == 0) { return SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle model."); } if(!(0 <= color1 <= 255) || !(0 <= color2 <= 255)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid color. Valid colors range from 0 to 255."); } GetPlayerPos(targetid, x, y, z); GetPlayerFacingAngle(targetid, a); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO vehicles (ownerid, owner, modelid, pos_x, pos_y, pos_z, pos_a, color1, color2) VALUES(%i, '%s', %i, '%f', '%f', '%f', '%f', %i, %i)", PlayerInfo[targetid][pID], GetPlayerNameEx(targetid), modelid, x + 2.0 * floatsin(-a, degrees), y + 2.0 * floatcos(-a, degrees), z, a, color1, color2); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you your own {00AA00}%s{33CCFF}. /carstorage to spawn it.", GetPlayerRPName(playerid), vehicleNames[modelid - 400]); SendClientMessageEx(playerid, COLOR_AQUA, "You have given %s their own {00AA00}%s{33CCFF}.", GetPlayerRPName(targetid), vehicleNames[modelid - 400]); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has given %s their own %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), vehicleNames[modelid - 400]); Log_Write("log_admin", "%s (uid: %i) has given %s (uid: %i) their own %s.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], vehicleNames[modelid - 400]); return 1; } CMD:givedoublexp(playerid, params[]) { new targetid, hours; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "ui", targetid, hours)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /givedoublexp [playerid] [hours]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(hours < 1 && PlayerInfo[targetid][pDoubleXP] - hours < 0) { return SendClientMessage(playerid, COLOR_GREY, "That player can't have under 0 hours of double XP."); } PlayerInfo[targetid][pDoubleXP] += hours; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has given %i hours of double XP to %s.", GetPlayerRPName(playerid), hours, GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_YELLOW, "%s has given you %i hours of double XP.", GetPlayerRPName(playerid), hours); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET doublexp = %i WHERE uid = %i", PlayerInfo[targetid][pDoubleXP], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); return 1; } CMD:randomfire(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(IsFireActive()) { return SendClientMessage(playerid, COLOR_GREY, "There is a fire active already. /killfire to kill it!"); } new Float:x, Float:y, Float:z; RandomFire(0); GetDynamicObjectPos(gFireObjects[0], x, y, z); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has started a random fire in %s.", GetPlayerRPName(playerid), GetZoneName(x, y, z)); return 1; } CMD:killfire(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!IsFireActive()) { return SendClientMessage(playerid, COLOR_GREY, "There is currently no fire active."); } for(new i = 0; i < MAX_FIRES; i ++) { DestroyDynamicObject(gFireObjects[i]); gFireObjects[i] = INVALID_OBJECT_ID; gFireHealth[i] = 0.0; } gFires = 0; SendClientMessage(playerid, COLOR_GREY, "Active fire killed."); return 1; } CMD:spawnfire(playerid, params[]) { new Float:px, Float:py, Float:pz; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't create fires indoors."); } for(new x = 0; x < MAX_FIRES; x ++) { if(gFireObjects[x] == INVALID_OBJECT_ID) { GetPlayerPos(playerid, px, py, pz); if(!IsFireActive()) { foreach(new i : Player) { if(GetFactionType(i) == FACTION_MEDIC) { PlayerInfo[i][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(i, px, py, pz, 3.0); SendClientMessageEx(i, COLOR_DOCTOR, "** All units, a fire has been reported in %s. Please head to the beacon on your map. **", GetZoneName(px, py, pz)); } } } gFireObjects[x] = CreateDynamicObject(18691, px, py, pz - 2.4, 0.0, 0.0, 0.0, .streamdistance = 50.0); gFireHealth[x] = 50.0; gFires++; return SendClientMessage(playerid, COLOR_GREY, "Fire created!"); } } SendClientMessageEx(playerid, COLOR_GREY, "You can't create anymore fires. The limit is %i fires.", MAX_FIRES); return 1; } CMD:number(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /number [playerid]"); } if(!PlayerInfo[playerid][pPhonebook]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you don't have a phonebook."); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes out a cellphone and looks up a number.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_GREY2, "Name: %s, Ph: %i", GetPlayerRPName(targetid), PlayerInfo[targetid][pPhone]); return 1; } /*CMD:phonebook(playerid, params[]) { new option[10], param[32]; if(!PlayerInfo[playerid][pPhonebook]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you don't have a phonebook."); } if(sscanf(params, "s[10]S()[32]", option, param)) { if(GetFactionType(playerid) == FACTION_NEWS) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /phonebook [view | add | remove]"); } else { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /phonebook [view]"); SendClientMessage(playerid, COLOR_GREY3, "Want your number shown in the phonebook? Ask the news team to add it to the directory."); } return 1; } if(!strcmp(option, "view", true)) { PlayerInfo[playerid][pPage] = 1; ShowDialogToPlayer(playerid, DIALOG_PHONEBOOK); } else if(!strcmp(option, "add", true)) { new number, name[24]; if(GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a news reporter."); } if(sscanf(param, "is[24]", number, name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /phonebook [add] [number] [name]"); } if(number == 0 || number == 911) { return SendClientMessage(playerid, COLOR_GREY, "Invalid number."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT number FROM phonebook WHERE number = %i", number); mysql_tquery(connectionID, queryBuffer, "OnPlayerAddToPhonebook", "iis", playerid, number, name); } else if(!strcmp(option, "remove", true)) { new number; if(GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a news reporter."); } if(sscanf(param, "i", number)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /phonebook [remove] [number]"); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT name FROM phonebook WHERE number = %i", number); mysql_tquery(connectionID, queryBuffer, "OnPlayerRemoveFromPhonebook", "ii", playerid, number); } return 1; }*/ CMD:boombox(playerid, params[]) { new option[10], param[128]; if(!PlayerInfo[playerid][pBoombox]) { return SendClientMessage(playerid, COLOR_GREY, "You have no boombox and therefore can't use this command."); } if(sscanf(params, "s[10]S()[128]", option, param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /boombox [place | pickup | play]"); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command from within the vehicle."); } if(!strcmp(option, "place", true)) { if(PlayerInfo[playerid][pBoomboxPlaced]) { return SendClientMessage(playerid, COLOR_GREY, "You have placed down a boombox already."); } if(GetNearbyBoombox(playerid) != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "There is already a boombox nearby. Place this one somewhere else."); } new Float:x, Float:y, Float:z, Float:a, string[128]; format(string, sizeof(string), "{FFFF00}Boombox placed by:\n{FF0000}%s{FFFF00}\n/boombox for more options.", GetPlayerNameEx(playerid)); GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); PlayerInfo[playerid][pBoomboxPlaced] = 1; PlayerInfo[playerid][pBoomboxObject] = CreateDynamicObject(2102, x, y, z - 1.0, 0.0, 0.0, a, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid)); PlayerInfo[playerid][pBoomboxText] = CreateDynamic3DTextLabel(string, COLOR_LIGHTORANGE, x, y, z - 0.8, 10.0, .worldid = GetPlayerVirtualWorld(playerid), .interiorid = GetPlayerInterior(playerid)); PlayerInfo[playerid][pBoomboxURL] = 0; ApplyAnimation(playerid, "BOMBER", "BOM_Plant", 4.1, 0, 0, 0, 0, 0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s places a boombox on the ground.", GetPlayerRPName(playerid)); } else if(!strcmp(option, "pickup", true)) { if(!PlayerInfo[playerid][pBoomboxPlaced]) { return SendClientMessage(playerid, COLOR_GREY, "You have not placed down a boombox."); } if(!IsPlayerInRangeOfDynamicObject(playerid, PlayerInfo[playerid][pBoomboxObject], 3.0)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of your boombox."); } SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s picks up their boombox and switches it off.", GetPlayerRPName(playerid)); DestroyBoombox(playerid); } else if(!strcmp(option, "play", true)) { if(!PlayerInfo[playerid][pBoomboxPlaced]) { return SendClientMessage(playerid, COLOR_GREY, "You have not placed down a boombox."); } if(!IsPlayerInRangeOfDynamicObject(playerid, PlayerInfo[playerid][pBoomboxObject], 3.0)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of your boombox."); } PlayerInfo[playerid][pMusicType] = MUSIC_BOOMBOX; ShowDialogToPlayer(playerid, DIALOG_MP3PLAYER); } return 1; } CMD:switchspeedo(playerid, params[]) { if(!strcmp(params, "kmh", true)) { PlayerInfo[playerid][pSpeedometer] = 1; SendClientMessage(playerid, COLOR_AQUA, "Your speedometer will now display speed as {00AA00}Kilometers per hour{33CCFF}."); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET speedometer = 1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(params, "mph", true)) { PlayerInfo[playerid][pSpeedometer] = 2; SendClientMessage(playerid, COLOR_AQUA, "Your speedometer will now display speed as {00AA00}Miles per hour{33CCFF}."); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET speedometer = 2 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(isnull(params)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /switchspeedo [kmh/mph]"); } return 1; } CMD:shakehand(playerid, params[]) { new targetid, type; if(sscanf(params, "ui", targetid, type)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /shakehand [playerid] [type (1-6)]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't shake your own hand."); } if(!(1 <= type <= 6)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type. Valid types range from 1 to 6."); } PlayerInfo[targetid][pShakeOffer] = playerid; PlayerInfo[targetid][pShakeType] = type; SendClientMessageEx(targetid, COLOR_AQUA, "** %s has offered to shake your hand. (/accept handshake)", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have sent %s a handshake offer.", GetPlayerRPName(targetid)); return 1; } CMD:dropgun(playerid, params[]) { new weaponid = GetScriptWeapon(playerid), objectid, Float:x, Float:y, Float:z; if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) { return SendClientMessage(playerid, COLOR_GREY, "You need to be onfoot in order to drop weapons."); } if(!weaponid) { return SendClientMessage(playerid, COLOR_GREY, "You must be holding the weapon you're willing to drop."); } if(PlayerInfo[playerid][pWeapons][weaponSlotIDs[weaponid]] != weaponid) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell this weapon as you don't have it."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0 || PlayerInfo[playerid][pJoinedEvent] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(GetPlayerHealthEx(playerid) < 60) { return SendClientMessage(playerid, COLOR_GREY, "You can't drop weapons as your health is below 60."); } GetPlayerPos(playerid, x, y, z); objectid = CreateDynamicObject(weaponModelIDs[weaponid], x, y, z - 1.0, 93.7, 93.7, 120.0); SetTimerEx("DestroyWeapon", 300000, false, "i", objectid); Streamer_SetExtraInt(objectid, E_OBJECT_TYPE, E_OBJECT_WEAPON); Streamer_SetExtraInt(objectid, E_OBJECT_WEAPONID, weaponid); Streamer_SetExtraInt(objectid, E_OBJECT_FACTION, PlayerInfo[playerid][pFaction]); RemovePlayerWeapon(playerid, weaponid); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s drops their %s on the ground.", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have dropped your {00AA00}%s{33CCFF}.", GetWeaponNameEx(weaponid)); return 1; } CMD:grabgun(playerid, params[]) { if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) { return SendClientMessage(playerid, COLOR_GREY, "You need to be onfoot in order to pickup weapons."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(PlayerInfo[playerid][pHours] < 2 || PlayerInfo[playerid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are either weapon restricted or you played less than two playing hours."); } for(new i = 0, j = Streamer_GetUpperBound(STREAMER_TYPE_OBJECT); i <= j; i ++) { if(!IsValidDynamicObject(i) || !IsPlayerInRangeOfDynamicObject(playerid, i, 2.0) || Streamer_GetExtraInt(i, E_OBJECT_TYPE) != E_OBJECT_WEAPON) continue; if(Streamer_GetExtraInt(i, E_OBJECT_FACTION) >= 0 && PlayerInfo[playerid][pFaction] != Streamer_GetExtraInt(i, E_OBJECT_FACTION)) { return SendClientMessage(playerid, COLOR_GREY, "This weapon belongs to a specific faction. You may not pick it up."); } new weaponid = Streamer_GetExtraInt(i, E_OBJECT_WEAPONID); GivePlayerWeaponEx(playerid, weaponid); DestroyDynamicObject(i); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s picks up a %s from the ground.", GetPlayerRPName(playerid), GetWeaponNameEx(weaponid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have picked up a {00AA00}%s{33CCFF}.", GetWeaponNameEx(weaponid)); return 1; } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any dropped weapons."); return 1; } CMD:createland(playerid, params[]) { new price; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", price)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /createland [price]"); } if(price < 1) { return SendClientMessage(playerid, COLOR_GREY, "The price can't be below $1."); } if(GetNearbyLand(playerid) >= 0) { return SendClientMessage(playerid, COLOR_GREY, "There is a land in range. Find somewhere else to create this one."); } if(GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) { return SendClientMessage(playerid, COLOR_GREY, "You cannot create lands indoors."); } PlayerInfo[playerid][pLandCost] = price; PlayerInfo[playerid][pZoneType] = ZONETYPE_LAND; ShowPlayerDialog(playerid, DIALOG_CREATEZONE, DIALOG_STYLE_MSGBOX, "Land creation system", "You have entered land creation mode. In order to create a land you need\nto mark four points around the area you want your land to be in, forming\na square. You must make a square or your outcome won't be as expected.\n\nPress {00AA00}Confirm{A9C4E4} to begin land creation.", "Confirm", "Cancel"); return 1; } CMD:confirm(playerid, params[]) { new Float:x, Float:y, Float:z; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pZoneCreation]) { return SendClientMessage(playerid, COLOR_GREY, "You are not creating any land or turf at the moment."); } if(PlayerInfo[playerid][pMinX] == 0.0) { GetPlayerPos(playerid, PlayerInfo[playerid][pMinX], y, z); PlayerInfo[playerid][pZonePickups][0] = CreateDynamicPickup(1239, 1, PlayerInfo[playerid][pMinX], y, z, .playerid = playerid); SendClientMessage(playerid, COLOR_WHITE, "** Boundary 1/4 set (min X)."); } else if(PlayerInfo[playerid][pMinY] == 0.0) { GetPlayerPos(playerid, x, PlayerInfo[playerid][pMinY], z); PlayerInfo[playerid][pZonePickups][1] = CreateDynamicPickup(1239, 1, x, PlayerInfo[playerid][pMinY], z, .playerid = playerid); SendClientMessage(playerid, COLOR_WHITE, "** Boundary 2/4 set (min Y)."); } else if(PlayerInfo[playerid][pMaxX] == 0.0) { GetPlayerPos(playerid, PlayerInfo[playerid][pMaxX], y, z); PlayerInfo[playerid][pZonePickups][2] = CreateDynamicPickup(1239, 1, PlayerInfo[playerid][pMaxX], y, z, .playerid = playerid); SendClientMessage(playerid, COLOR_WHITE, "** Boundary 3/4 set (max X)."); } else if(PlayerInfo[playerid][pMaxY] == 0.0) { GetPlayerPos(playerid, x, PlayerInfo[playerid][pMaxY], z); SendClientMessage(playerid, COLOR_WHITE, "** Boundary 4/4 set (max Y)."); PlayerInfo[playerid][pZonePickups][3] = CreateDynamicPickup(1239, 1, x, PlayerInfo[playerid][pMaxY], z, .playerid = playerid); PlayerInfo[playerid][pZoneID] = GangZoneCreate(PlayerInfo[playerid][pMinX], PlayerInfo[playerid][pMinY], PlayerInfo[playerid][pMaxX], PlayerInfo[playerid][pMaxY]); GangZoneShowForPlayer(playerid, PlayerInfo[playerid][pZoneID], 0x33CC33FF); if(PlayerInfo[playerid][pZoneCreation] == ZONETYPE_LAND) { ShowPlayerDialog(playerid, DIALOG_CONFIRMZONE, DIALOG_STYLE_MSGBOX, "Land creation system", "You have set the four boundary points. The green zone on your mini-map\nrepresents the area of your land. You can choose to start over or complete\nthe creation of your land.\n\nWhat would you like to do now?", "Create", "Restart"); } else if(PlayerInfo[playerid][pZoneCreation] == ZONETYPE_TURF) { ShowPlayerDialog(playerid, DIALOG_CONFIRMZONE, DIALOG_STYLE_MSGBOX, "Turf creation system", "You have set the four boundary points. The green zone on your mini-map\nrepresents the area of your turf. You can choose to start over or complete\nthe creation of your turf.\n\nWhat would you like to do now?", "Create", "Restart"); } } return 1; } CMD:landcancel(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(PlayerInfo[playerid][pZoneCreation] != ZONETYPE_LAND) { return SendClientMessage(playerid, COLOR_GREY, "You are not creating a land at the moment."); } CancelZoneCreation(playerid); SendClientMessage(playerid, COLOR_LIGHTRED, "** Land creation cancelled."); return 1; } CMD:gotoland(playerid, params[]) { new landid; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "i", landid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gotoland [landid]"); } if(!(0 <= landid < MAX_LANDS) || !LandInfo[landid][lExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid land."); } GameTextForPlayer(playerid, "~w~Teleported", 5000, 1); SetPlayerPos(playerid, LandInfo[landid][lMinX], LandInfo[landid][lMinY], LandInfo[landid][lHeight]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetCameraBehindPlayer(playerid); return 1; } CMD:removelandobjects(playerid, params[]) { new landid; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", landid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removelandobjects [landid]"); } if(!(0 <= landid < MAX_LANDS) || !LandInfo[landid][lExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid land."); } RemoveAllLandObjects(landid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have removed all land objects for land %i.", landid); return 1; } CMD:removeland(playerid, params[]) { new landid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", landid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removeland [landid]"); } if(!(0 <= landid < MAX_LANDS) || !LandInfo[landid][lExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid land."); } RemoveAllLandObjects(landid); GangZoneDestroy(LandInfo[landid][lGangZone]); DestroyDynamicArea(LandInfo[landid][lArea]); DestroyDynamic3DTextLabel(LandInfo[landid][lTextdraw]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM lands WHERE id = %i", LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer); LandInfo[landid][lID] = 0; LandInfo[landid][lExists] = 0; LandInfo[landid][lOwnerID] = 0; Iter_Remove(Land, landid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have removed land %i.", landid); return 1; } CMD:buyland(playerid, params[]) { new landid = GetNearbyLand(playerid); if(landid == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any lands."); } if(LandInfo[landid][lOwnerID] > 0) { return SendClientMessage(playerid, COLOR_GREY, "This land is already owned."); } if(strcmp(params, "confirm", true)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /buyland [confirm] (This land costs %s.)", FormatNumber(LandInfo[landid][lPrice])); } if(PlayerInfo[playerid][pCash] < LandInfo[landid][lPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this land."); } SetLandOwner(landid, playerid); GivePlayerCash(playerid, -LandInfo[landid][lPrice]); SendClientMessageEx(playerid, COLOR_GREEN, "You paid %s for this land! /landhelp to see the available commands for your land.", FormatNumber(LandInfo[landid][lPrice])); Log_Write("log_property", "%s (uid: %i) purchased a land (id: %i) in %s for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], LandInfo[landid][lID], GetPlayerZoneName(playerid), LandInfo[landid][lPrice]); return 1; } CMD:sellland(playerid, params[]) { new landid = GetNearbyLand(playerid), targetid, amount; if(landid == -1 || !IsLandOwner(playerid, landid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any lands of yours."); } if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellland [playerid] [amount]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell to yourself."); } if(amount < 1) { return SendClientMessage(playerid, COLOR_GREY, "You must specify an amount above zero."); } PlayerInfo[targetid][pLandOffer] = playerid; PlayerInfo[targetid][pLandOffered] = landid; PlayerInfo[targetid][pLandPrice] = amount; SendClientMessageEx(targetid, COLOR_AQUA, "** %s offered you to buy their land for %s. (/accept land)", GetPlayerRPName(playerid), FormatNumber(amount)); SendClientMessageEx(playerid, COLOR_AQUA, "** You offered %s to buy your land for %s.", GetPlayerRPName(targetid), FormatNumber(amount)); return 1; } CMD:sellmyland(playerid, params[]) { new landid = GetNearbyLand(playerid); if(landid == -1 || !IsLandOwner(playerid, landid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any lands of yours."); } if(strcmp(params, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /sellmyland [confirm]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "This command sells your land back to the state. You will receive %s back.", FormatNumber(percent(LandInfo[landid][lPrice], 75))); return 1; } SetLandOwner(landid, INVALID_PLAYER_ID); GivePlayerCash(playerid, percent(LandInfo[landid][lPrice], 75)); SendClientMessageEx(playerid, COLOR_GREEN, "You have sold your land to the state and received %s back.", FormatNumber(percent(LandInfo[landid][lPrice], 75))); Log_Write("log_property", "%s (uid: %i) sold their land (id: %i) to the state for $%i", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], LandInfo[landid][lID], percent(LandInfo[landid][lPrice], 75)); return 1; } CMD:landinfo(playerid, params[]) { new landid = GetNearbyLand(playerid); if(landid == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any lands."); } if(!LandInfo[landid][lOwnerID]) { SendClientMessageEx(playerid, COLOR_WHITE, "** This land is currently not owned and is for sale, price: {00AA00}$%i{FFFFFF}.", LandInfo[landid][lPrice]); } else if(!IsLandOwner(playerid, landid)) { SendClientMessageEx(playerid, COLOR_WHITE, "** This land is owned by %s.", LandInfo[landid][lOwner]); } else { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM landobjects WHERE landid = %i", LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LAND_INFORMATION, playerid); } return 1; } CMD:landperms(playerid, params[]) { new targetid, landid; if(PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "ui", targetid, landid)) { return SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /landperms [playerid] [landid (-1 to remove)]"); } if(MAX_LANDS > landid > -1) { SendClientMessageEx(targetid, COLOR_AQUA, "%s has given you temporary access to land #%i's keys.", GetPlayerRPName(playerid), landid); SendClientMessageEx(playerid, COLOR_AQUA, "You have given temporary %s access to %i.", GetPlayerRPName(targetid), landid); PlayerInfo[targetid][pLandPerms] = landid; } else if(landid == -1) { SendClientMessageEx(targetid, COLOR_AQUA, "%s has taken away your temporary land keys.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have taken %s's temporary land access.", GetPlayerRPName(targetid)); PlayerInfo[targetid][pLandPerms] = -1; } return 1; } CMD:droplandkeys(playerid, params[]) { if(PlayerInfo[playerid][pLandPerms] > -1) { SendClientMessageEx(playerid, COLOR_AQUA, "You have dropped land %i's keys.", PlayerInfo[playerid][pLandPerms]); PlayerInfo[playerid][pLandPerms] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET landkeys = -1 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else { SendClientMessageEx(playerid, COLOR_GREY, "You don't have keys to a land."); } return 1; } CMD:land(playerid, params[]) { new landid = GetNearbyLand(playerid); if(landid == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any lands of yours."); } if(!HasLandPerms(playerid, landid)) { return SendClientMessage(playerid, COLOR_GREY, "You don't have permission to build in this land."); } ShowDialogToPlayer(playerid, DIALOG_LANDMENU); return 1; } CMD:mp3(playerid, params[]) { if(!PlayerInfo[playerid][pMP3Player]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have an MP3 player."); } PlayerInfo[playerid][pMusicType] = MUSIC_MP3PLAYER; ShowDialogToPlayer(playerid, DIALOG_MP3PLAYER); return 1; } CMD:setradio(playerid, params[]) { if(!IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in any vehicle."); } PlayerInfo[playerid][pMusicType] = MUSIC_VEHICLE; ShowDialogToPlayer(playerid, DIALOG_MP3PLAYER); return 1; } CMD:changename(playerid, params[]) { if(!IsPlayerInRangeOfPoint(playerid, 3.0, -6.0363,1525.8485,1501.8143)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the desk at city hall."); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /changename [new name]"); } if(!(3 <= strlen(params) <= 20)) { return SendClientMessage(playerid, COLOR_GREY, "Your name must range from 3 to 20 characters."); } if(strfind(params, "_") == -1) { return SendClientMessage(playerid, COLOR_GREY, "Your name needs to contain at least one underscore."); } if(!IsValidName(params)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid characters. Your name may only contain letters and underscores."); } if(PlayerInfo[playerid][pCash] < PlayerInfo[playerid][pLevel] * 7500) { return SendClientMessageEx(playerid, COLOR_GREY, "You need at least %s to change your name at your level.", FormatNumber(PlayerInfo[playerid][pLevel] * 7500)); } if(PlayerInfo[playerid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You aren't allowed to change your name while on admin duty,"); } if(!isnull(PlayerInfo[playerid][pNameChange])) { return SendClientMessage(playerid, COLOR_GREY, "You have already requested a namechange. Please wait for a response."); } PlayerInfo[playerid][pFreeNamechange] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid FROM users WHERE username = '%e'", params); mysql_tquery(connectionID, queryBuffer, "OnPlayerAttemptNameChange", "is", playerid, params); return 1; } CMD:acceptname(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /acceptname [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } /*if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); }*/ if(isnull(PlayerInfo[targetid][pNameChange])) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't requested a namechange."); } if(PlayerInfo[targetid][pFreeNamechange] == 0 && PlayerInfo[targetid][pCash] < PlayerInfo[targetid][pLevel] * 7500) { return SendClientMessage(playerid, COLOR_GREY, "That player can't afford the namechange."); } new cost = PlayerInfo[targetid][pLevel] * 7500; if(PlayerInfo[targetid][pFreeNamechange]) { if(PlayerInfo[targetid][pFreeNamechange] == 2 && (GetFactionType(targetid) == FACTION_HITMAN || GetFactionType(targetid) == FACTION_FEDERAL)) { GetPlayerName(targetid, PlayerInfo[targetid][pPassportName], MAX_PLAYER_NAME); PlayerInfo[targetid][pPassport] = 1; PlayerInfo[targetid][pPassportLevel] = PlayerInfo[targetid][pLevel]; PlayerInfo[targetid][pPassportSkin] = PlayerInfo[targetid][pSkin]; PlayerInfo[targetid][pPassportPhone] = PlayerInfo[targetid][pPhone]; PlayerInfo[targetid][pLevel] = PlayerInfo[targetid][pChosenLevel]; PlayerInfo[targetid][pSkin] = PlayerInfo[targetid][pChosenSkin]; PlayerInfo[targetid][pPhone] = random(0) + 19999; SetPlayerSkin(targetid, PlayerInfo[targetid][pSkin]); Log_Write("log_faction", "%s (uid: %i) used the /passport command to change their name to %s, level to %i and skin to %i.", GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], PlayerInfo[targetid][pNameChange], PlayerInfo[targetid][pLevel], PlayerInfo[targetid][pSkin]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET level = %i, skin = %i, phone = %i, passport = 1, passportname = '%s', passportlevel = %i, passportskin = %i, passportphone = %i WHERE uid = %i", PlayerInfo[targetid][pLevel], PlayerInfo[targetid][pSkin], PlayerInfo[targetid][pPhone], PlayerInfo[targetid][pPassportName], PlayerInfo[targetid][pPassportLevel], PlayerInfo[targetid][pPassportSkin], PlayerInfo[targetid][pPassportPhone], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); } Log_Write("log_admin", "%s (uid: %i) accepted %s's (uid: %i) free namechange to %s.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], PlayerInfo[targetid][pNameChange]); Log_Write("log_namechanges", "%s (uid: %i) accepted %s's (uid: %i) free namechange to %s.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], PlayerInfo[targetid][pNameChange]); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has accepted %s's free namechange to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), PlayerInfo[targetid][pNameChange]); SendClientMessageEx(targetid, COLOR_YELLOW, "Your namechange request to %s was approved for free.", PlayerInfo[targetid][pNameChange]); if(!IsPlayerLoggedIn(targetid)) { #if defined SERVER_INTRO ShowServerIntro(targetid); #else ShowDialogToPlayer(targetid, DIALOG_REGISTER); #endif } if(PlayerInfo[targetid][pFreeNamechange] == 2) { SendClientMessage(targetid, COLOR_WHITE, "** You can use /passport again to return to your old name and stats."); } } else { Log_Write("log_admin", "%s (uid: %i) accepted %s's (uid: %i) namechange to %s for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], PlayerInfo[targetid][pNameChange], cost); Log_Write("log_namechanges", "%s (uid: %i) accepted %s's (uid: %i) namechange to %s for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], PlayerInfo[targetid][pNameChange], cost); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has accepted %s's namechange to %s for %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), PlayerInfo[targetid][pNameChange], FormatNumber(cost)); SendClientMessageEx(targetid, COLOR_YELLOW, "Your namechange request to %s was approved for %s.", PlayerInfo[targetid][pNameChange], FormatNumber(cost)); GivePlayerCash(targetid, -cost); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO log_namehistory VALUES(null, %i, '%s', '%s', '%s', NOW())", PlayerInfo[targetid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pNameChange], GetPlayerNameEx(playerid)); mysql_tquery(connectionID, queryBuffer); Namechange(targetid, GetPlayerNameEx(targetid), PlayerInfo[targetid][pNameChange]); PlayerInfo[targetid][pNameChange] = 0; PlayerInfo[targetid][pFreeNamechange] = 0; return 1; } CMD:denyname(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /denyname [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } /*if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); }*/ if(isnull(PlayerInfo[targetid][pNameChange])) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't requested a namechange."); } if(PlayerInfo[targetid][pFreeNamechange] == 1) { if(!IsPlayerLoggedIn(targetid)) { SendClientMessage(targetid, COLOR_LIGHTRED, "Please reconnect with a proper roleplay name in the Firstname_Lastname format."); KickPlayer(targetid); return 1; } ShowPlayerDialog(targetid, DIALOG_FREENAMECHANGE, DIALOG_STYLE_INPUT, "Non-RP Name", "An administrator has came to the conclusion that your name is non-RP.\nTherefore you have been given this free namechange in order to correct it.\n\nEnter a name in the Firstname_Lastname format in the box below:", "Submit", "Cancel"); } Log_Write("log_admin", "%s (uid: %i) denied %s's (uid: %i) namechange to %s.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], PlayerInfo[targetid][pNameChange]); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has denied %s's namechange to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), PlayerInfo[targetid][pNameChange]); SendClientMessageEx(targetid, COLOR_LIGHTRED, "Your namechange request to %s was denied.", PlayerInfo[targetid][pNameChange]); PlayerInfo[targetid][pNameChange] = 0; PlayerInfo[targetid][pFreeNamechange] = 0; return 1; } CMD:namechanges(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Pending Namechanges ______"); foreach(new i : Player) { if(!isnull(PlayerInfo[i][pNameChange])) { SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s requested a namechange to %s", i, GetPlayerRPName(i), PlayerInfo[i][pNameChange]); } } return 1; } CMD:paytickets(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), amount; if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any vehicle of yours."); } if(!IsVehicleOwner(playerid, vehicleid) && PlayerInfo[playerid][pVehicleKeys] != vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as this vehicle doesn't belong to you."); } if(sscanf(params, "i", amount)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /paytickets [amount] (There is $%i in unpaid tickets.)", VehicleInfo[vehicleid][vTickets]); } if(amount < 1 || amount > PlayerInfo[playerid][pCash]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(amount > VehicleInfo[vehicleid][vTickets]) { return SendClientMessage(playerid, COLOR_GREY, "There isn't that much in unpaid tickets to pay."); } VehicleInfo[vehicleid][vTickets] -= amount; GivePlayerCash(playerid, -amount); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET tickets = %i WHERE id = %i", VehicleInfo[vehicleid][vTickets], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have paid %s in unpaid tickets. This vehicle now has %s left in unpaid tickets.", FormatNumber(amount), FormatNumber(VehicleInfo[vehicleid][vTickets])); return 1; } CMD:carinfo(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!vehicleid || !IsVehicleOwner(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any vehicle of yours."); } new neon[12], Float:health; GetVehicleHealth(vehicleid, health); switch(VehicleInfo[vehicleid][vNeon]) { case 18647: neon = "Red"; case 18648: neon = "Blue"; case 18649: neon = "Green"; case 18650: neon = "Yellow"; case 18651: neon = "Pink"; case 18652: neon = "White"; default: neon = "None"; } SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_______ %s Stats _______", GetVehicleName(vehicleid)); SendClientMessageEx(playerid, COLOR_GREY2, "Owner: %s - Value: $%i - Tickets: $%i - License Plate: %s", VehicleInfo[vehicleid][vOwner], GetVehicleValue(vehicleid), VehicleInfo[vehicleid][vTickets], VehicleInfo[vehicleid][vPlate]); SendClientMessageEx(playerid, COLOR_GREY2, "Neon: %s - Trunk Level: %i/3 - Alarm Level: %i/3 - Health: %.1f - Fuel: %i/100", neon, VehicleInfo[vehicleid][vTrunk], VehicleInfo[vehicleid][vAlarm], health, vehicleFuel[vehicleid]); return 1; } CMD:smuggle(playerid, params[]) { return callcmd::smuggledrugs(playerid, params); } CMD:smuggledrugs(playerid, params[]) { if(!PlayerHasJob(playerid, JOB_DRUGDEALER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Drug Dealer."); } if(!IsPlayerInRangeOfPoint(playerid, 5.0, 52.0937, -292.2513, 1.7001)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the smuggle point."); } if(PlayerInfo[playerid][pCP] != CHECKPOINT_NONE) { return SendClientMessage(playerid, COLOR_GREY, "You must cancel your active checkpoint first. /cancelcp to cancel it."); } if(PlayerInfo[playerid][pCash] < 500) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough money."); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /smuggledrugs [seeds | cocaine | ephedrine]"); } new amount = 500 / GetJobLevel(playerid, JOB_DRUGDEALER); if(!strcmp(params, "seeds", true)) { if(gSeedsStock + 10 > 1000) { return SendClientMessage(playerid, COLOR_GREY, "The drug house can't hold anymore seeds. Therefore you can't smuggle them."); } PlayerInfo[playerid][pSmuggleDrugs] = 1; PlayerInfo[playerid][pSmuggleTime] = gettime(); PlayerInfo[playerid][pCP] = CHECKPOINT_DRUGS; GivePlayerCash(playerid, -amount); AddPointMoney(POINT_DRUGFACTORY, amount); SetPlayerCheckpoint(playerid, 2167.7371, -1670.6298, 15.0804, 3.0); SendClientMessageEx(playerid, COLOR_AQUA, "You have paid $%i for a package of {00AA00}marijuana seeds{33CCFF}. Deliver it to the marker.", amount); } else if(!strcmp(params, "cocaine", true)) { if(gCocaineStock + 10 > 500) { return SendClientMessage(playerid, COLOR_GREY, "The crack house can't hold anymore cocaine. Therefore you can't smuggle it."); } PlayerInfo[playerid][pSmuggleDrugs] = 2; PlayerInfo[playerid][pSmuggleTime] = gettime(); PlayerInfo[playerid][pCP] = CHECKPOINT_DRUGS; GivePlayerCash(playerid, -amount); AddPointMoney(POINT_DRUGFACTORY, amount); SetPlayerCheckpoint(playerid, 2349.7727, -1169.6304, 28.0243, 3.0); SendClientMessageEx(playerid, COLOR_AQUA, "You have paid $%i for a package of {00AA00}cocaine{33CCFF}. Deliver it to the marker.", amount); } else if(!strcmp(params, "ephedrine", true)) { if(gEphedrineStock + 10 > 250) { return SendClientMessage(playerid, COLOR_GREY, "The drug house can't hold anymore ephedrine. Therefore you can't smuggle ir."); } PlayerInfo[playerid][pSmuggleDrugs] = 3; PlayerInfo[playerid][pSmuggleTime] = gettime(); PlayerInfo[playerid][pCP] = CHECKPOINT_DRUGS; GivePlayerCash(playerid, -amount); AddPointMoney(POINT_DRUGFACTORY, amount); SetPlayerCheckpoint(playerid, 2167.7371, -1670.6298, 15.0804, 3.0); SendClientMessageEx(playerid, COLOR_AQUA, "You have paid $5i for a package of {00AA00}raw ephedrine{33CCFF}. Deliver it to the marker.", amount); } return 1; } CMD:buydrug(playerid, params[]) { new option[10], amount, cost; if(!PlayerHasJob(playerid, JOB_DRUGDEALER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Drug Dealer."); } if(sscanf(params, "s[10]i", option, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /buydrug [seeds | cocaine | ephedrine] [amount]"); } if(!strcmp(option, "seeds", true)) { if(!IsPlayerInRangeOfPoint(playerid, 3.0, 321.8347, 1117.1797, 1083.8828)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of the drug den."); } if(amount < 1 || amount > 10) { return SendClientMessage(playerid, COLOR_GREY, "You can't buy less than 1 or more than 10 seeds at a time."); } if(amount > gSeedsStock) { return SendClientMessage(playerid, COLOR_GREY, "There aren't that many seeds left in stock."); } if(PlayerInfo[playerid][pCash] < (cost = amount * 500)) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy that many seeds."); } if(PlayerInfo[playerid][pSeeds] + amount > GetPlayerCapacity(playerid, CAPACITY_SEEDS)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i seeds. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pSeeds], GetPlayerCapacity(playerid, CAPACITY_SEEDS)); } gSeedsStock -= amount; PlayerInfo[playerid][pSeeds] += amount; GivePlayerCash(playerid, -cost); AddPointMoney(POINT_DRUGDEN, cost); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET seeds = %i WHERE uid = %i", PlayerInfo[playerid][pSeeds], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased %i marijuana seeds for {00AA00}$%i{33CCFF}. /planthelp for more help.", amount, cost); } else if(!strcmp(option, "ephedrine", true)) { if(!IsPlayerInRangeOfPoint(playerid, 3.0, 323.7289, 1117.4187, 1083.8828)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of the drug den."); } if(amount < 1 || amount > 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't buy less than 1 or more than 5 grams at a time."); } if(amount > gEphedrineStock) { return SendClientMessage(playerid, COLOR_GREY, "There isn't that much ephedrine left in stock."); } if(PlayerInfo[playerid][pCash] < (cost = amount * 1000)) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy that many grams."); } if(PlayerInfo[playerid][pEphedrine] + amount > GetPlayerCapacity(playerid, CAPACITY_EPHEDRINE)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i ephedrine. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pEphedrine], GetPlayerCapacity(playerid, CAPACITY_EPHEDRINE)); } gEphedrineStock -= amount; PlayerInfo[playerid][pEphedrine] += amount; GivePlayerCash(playerid, -cost); AddPointMoney(POINT_DRUGDEN, cost); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET ephedrine = %i WHERE uid = %i", PlayerInfo[playerid][pEphedrine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased %i grams of raw ephedrine for {00AA00}$%i{33CCFF}.", amount, cost); } else if(!strcmp(option, "cocaine", true)) { if(!IsPlayerInRangeOfPoint(playerid, 3.0, 2342.7766, -1187.0839, 1027.9766)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of the crack house."); } if(amount < 1 || amount > 10) { return SendClientMessage(playerid, COLOR_GREY, "You can't buy less than 1 or more than 10 grams at a time."); } if(amount > gCocaineStock) { return SendClientMessage(playerid, COLOR_GREY, "There isn't that much cocaine left in stock."); } if(PlayerInfo[playerid][pCash] < (cost = amount * 750)) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to buy that many grams."); } if(PlayerInfo[playerid][pCocaine] + amount > GetPlayerCapacity(playerid, CAPACITY_COCAINE)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i cocaine. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pCocaine], GetPlayerCapacity(playerid, CAPACITY_COCAINE)); } gCocaineStock -= amount; PlayerInfo[playerid][pCocaine] += amount; GivePlayerCash(playerid, -cost); AddPointMoney(POINT_CRACKHOUSE, cost); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have purchased %i grams of cocaine for {00AA00}$%i{33CCFF}.", amount, cost); } return 1; } CMD:plantweed(playerid, params[]) { if(PlayerInfo[playerid][pWeedPlanted]) { return SendClientMessage(playerid, COLOR_GREY, "You have an active weed plant already."); } if(PlayerInfo[playerid][pSeeds] < 10) { return SendClientMessage(playerid, COLOR_GREY, "You don't have enough seeds. You need at least 10 seeds in order to plant them."); } if(GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't plant indoors."); } GetPlayerPos(playerid, PlayerInfo[playerid][pWeedX], PlayerInfo[playerid][pWeedY], PlayerInfo[playerid][pWeedZ]); GetPlayerFacingAngle(playerid, PlayerInfo[playerid][pWeedA]); PlayerInfo[playerid][pSeeds] -= 10; PlayerInfo[playerid][pWeedPlanted] = 1; PlayerInfo[playerid][pWeedTime] = 60; PlayerInfo[playerid][pWeedGrams] = 0; PlayerInfo[playerid][pWeedObject] = CreateDynamicObject(3409, PlayerInfo[playerid][pWeedX], PlayerInfo[playerid][pWeedY], PlayerInfo[playerid][pWeedZ] - 1.8, 0.0, 0.0, PlayerInfo[playerid][pWeedA]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET seeds = %i, weedplanted = 1, weedtime = %i, weedgrams = %i, weed_x = '%f', weed_y = '%f', weed_z = '%f', weed_a = '%f' WHERE uid = %i", PlayerInfo[playerid][pSeeds], PlayerInfo[playerid][pWeedTime], PlayerInfo[playerid][pWeedGrams], PlayerInfo[playerid][pWeedX], PlayerInfo[playerid][pWeedY], PlayerInfo[playerid][pWeedZ], PlayerInfo[playerid][pWeedA], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s plants some seeds into the ground.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_GREEN, "You have planted a weed plant. Every two minutes your plant will grow one gram of weed."); SendClientMessage(playerid, COLOR_GREEN, "Your plant will be ready in 60 minutes. Be careful, as anyone who sees your plant can pick it!"); return 1; } CMD:plantinfo(playerid, params[]) { foreach(new i : Player) { if(PlayerInfo[i][pWeedPlanted] && IsPlayerInRangeOfPoint(playerid, 3.0, PlayerInfo[i][pWeedX], PlayerInfo[i][pWeedY], PlayerInfo[i][pWeedZ])) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s inspects the plant.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_WHITE, "** This plant has so far grown %i grams of weed. It will be ready in %i/60 minutes.", PlayerInfo[i][pWeedGrams], PlayerInfo[i][pWeedTime]); return 1; } } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any plants."); return 1; } CMD:pickplant(playerid, params[]) { foreach(new i : Player) { if(PlayerInfo[i][pWeedPlanted] && IsPlayerInRangeOfPoint(playerid, 3.0, PlayerInfo[i][pWeedX], PlayerInfo[i][pWeedY], PlayerInfo[i][pWeedZ])) { if(GetPlayerSpecialAction(playerid) != SPECIAL_ACTION_DUCK) { return SendClientMessage(playerid, COLOR_GREY, "You need to be crouched in order to pick a plant."); } if(PlayerInfo[i][pWeedGrams] < 2) { return SendClientMessage(playerid, COLOR_GREY, "This plant hasn't grown that much yet. Wait a little while first."); } if(PlayerInfo[playerid][pWeed] + PlayerInfo[i][pWeedGrams] > GetPlayerCapacity(playerid, CAPACITY_WEED)) { return SendClientMessageEx(playerid, COLOR_GREY, "You currently have %i/%i weed. You can't carry anymore until you upgrade your inventory skill.", PlayerInfo[playerid][pWeed], GetPlayerCapacity(playerid, CAPACITY_WEED)); } PlayerInfo[playerid][pPickPlant] = i; PlayerInfo[playerid][pPickTime] = 5; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s crouches down and starts picking at the weed plant.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_WHITE, "** Allow up to five seconds for you to pick the plant."); return 1; } } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any plants."); return 1; } CMD:seizeplant(playerid, params[]) { if(!IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't apart of law enforcement."); } foreach(new i : Player) { if(PlayerInfo[i][pWeedPlanted] && IsPlayerInRangeOfPoint(playerid, 3.0, PlayerInfo[i][pWeedX], PlayerInfo[i][pWeedY], PlayerInfo[i][pWeedZ])) { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s seizes a weed plant weighing %i grams.", GetPlayerRPName(playerid), PlayerInfo[i][pWeedGrams]); DestroyWeedPlant(i); return 1; } } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any plants."); return 1; } CMD:cookmeth(playerid, params[]) { if(!PlayerHasJob(playerid, JOB_DRUGDEALER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you're not a Drug Dealer."); } if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1.2179, 2.8095, 999.4284)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in Heisenberg's trailer. You can't use this command."); } if(!PlayerInfo[playerid][pCookMeth]) { if(!PlayerInfo[playerid][pEphedrine]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have any raw ephedrine which you could turn into meth."); } if(!PlayerInfo[playerid][pMuriaticAcid]) { return SendClientMessage(playerid, COLOR_GREY, "You need muriatic acid in order to cook meth. Go buy some at 24/7."); } PlayerInfo[playerid][pCookMeth] = 1; PlayerInfo[playerid][pCookTime] = 15; PlayerInfo[playerid][pCookGrams] = 0; SendClientMessage(playerid, COLOR_GREEN, "You have started cooking meth. One gram of ephedrine will turn into 2 grams of meth every 15 seconds."); SendClientMessage(playerid, COLOR_GREEN, "Type the /cookmeth command again in order to stop cooking."); } else { SendClientMessageEx(playerid, COLOR_AQUA, "You have stopped cooking. You converted %i grams of ephedrine into %i grams of meth.", PlayerInfo[playerid][pCookGrams] / 2, PlayerInfo[playerid][pCookGrams]); ResetCooking(playerid); } return 1; } CMD:usecigar(playerid, params[]) { if(!PlayerInfo[playerid][pCigars]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have any cigars left."); } PlayerInfo[playerid][pCigars]--; SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s lights up a cigar and starts to smoke it.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cigars = %i WHERE uid = %i", PlayerInfo[playerid][pCigars], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); return 1; } CMD:usedrug(playerid, params[]) { if(gettime() - PlayerInfo[playerid][pLastDrug] < 10) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only consume drugs every 10 seconds. Please wait %i more seconds.", 10 - (gettime() - PlayerInfo[playerid][pLastDrug])); } if(PlayerInfo[playerid][pDrugsUsed] >= 4) { return SendClientMessage(playerid, COLOR_GREY, "You are stoned and therefore can't consume anymore drugs right now."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(PlayerInfo[playerid][pJoinedEvent] > 0 && !EventInfo[eHeal]) { return SendClientMessage(playerid, COLOR_GREY, "The administrator has chosen to disable healing in this event."); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /usedrug [weed | cocaine | meth | painkillers]"); } if(PlayerInfo[playerid][pHurt]) { return SendClientMessageEx(playerid, COLOR_GREY, "You're too hurt to use drugs. Please wait %i seconds before trying again.", PlayerInfo[playerid][pHurt]); } if(!strcmp(params, "weed", true)) { if(PlayerInfo[playerid][pWeed] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You need at least two grams of weed."); } if(PlayerInfo[playerid][pAddictUpgrade] > 0) { SendClientMessageEx(playerid, COLOR_YELLOW3, "Addict Perk: Your level %i/3 addict perk gave you %.1f extra health.", PlayerInfo[playerid][pAddictUpgrade], (PlayerInfo[playerid][pAddictUpgrade] * 5.0)); } GivePlayerHealth(playerid, 20.0 + (PlayerInfo[playerid][pAddictUpgrade] * 5.0)); PlayerInfo[playerid][pWeed] -= 2; PlayerInfo[playerid][pDrugsUsed]++; PlayerInfo[playerid][pLastDrug] = gettime(); if(PlayerInfo[playerid][pDrugsUsed] >= 4) { AwardAchievement(playerid, "High times"); GameTextForPlayer(playerid, "~p~shit... you stoned as hell duuuude...", 5000, 1); PlayerInfo[playerid][pDrugsTime] = 30; } ApplyAnimation(playerid, "SMOKING", "M_smk_in", 4.1, 0, 0, 0, 0, 0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s smokes two grams of weed.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = %i WHERE uid = %i", PlayerInfo[playerid][pWeed], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(params, "cocaine", true)) { if(PlayerInfo[playerid][pCocaine] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You need at least two grams of cocaine."); } if(PlayerInfo[playerid][pAddictUpgrade] > 0) { SendClientMessageEx(playerid, COLOR_YELLOW3, "Addict Perk: Your level %i/3 addict perk gave you %.1f extra armor.", PlayerInfo[playerid][pAddictUpgrade], (PlayerInfo[playerid][pAddictUpgrade] * 5.0)); } GivePlayerArmour(playerid, 10.0 + (PlayerInfo[playerid][pAddictUpgrade] * 5.0)); PlayerInfo[playerid][pCocaine] -= 2; PlayerInfo[playerid][pDrugsUsed]++; PlayerInfo[playerid][pLastDrug] = gettime(); if(PlayerInfo[playerid][pDrugsUsed] >= 4) { AwardAchievement(playerid, "High times"); GameTextForPlayer(playerid, "~p~shit... you stoned as hell duuuude...", 5000, 1); PlayerInfo[playerid][pDrugsTime] = 30; } ApplyAnimation(playerid, "SMOKING", "M_smk_in", 4.1, 0, 0, 0, 0, 0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s snorts two grams of cocaine.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = %i WHERE uid = %i", PlayerInfo[playerid][pCocaine], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(params, "meth", true)) { if(PlayerInfo[playerid][pMeth] < 2) { return SendClientMessage(playerid, COLOR_GREY, "You need at least two grams of meth."); } if(PlayerInfo[playerid][pAddictUpgrade] > 0) { SendClientMessageEx(playerid, COLOR_YELLOW3, "Addict Perk: Your level %i/3 addict perk gave you %.1f/%.1f extra health & armor.", PlayerInfo[playerid][pAddictUpgrade], (PlayerInfo[playerid][pAddictUpgrade] * 5.0), (PlayerInfo[playerid][pAddictUpgrade] * 5.0)); } GivePlayerHealth(playerid, 10.0 + (PlayerInfo[playerid][pAddictUpgrade] * 5.0)); GivePlayerArmour(playerid, 10.0 + (PlayerInfo[playerid][pAddictUpgrade] * 5.0)); PlayerInfo[playerid][pMeth] -= 2; PlayerInfo[playerid][pDrugsUsed] += 2; PlayerInfo[playerid][pLastDrug] = gettime(); if(PlayerInfo[playerid][pDrugsUsed] >= 4) { AwardAchievement(playerid, "High times"); GameTextForPlayer(playerid, "~p~shit... you stoned as hell duuuude...", 5000, 1); PlayerInfo[playerid][pDrugsTime] = 30; } ApplyAnimation(playerid, "SMOKING", "M_smk_in", 4.1, 0, 0, 0, 0, 0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s smokes two grams of meth.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = %i WHERE uid = %i", PlayerInfo[playerid][pMeth], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(params, "painkillers", true)) { if(PlayerInfo[playerid][pPainkillers] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "You don't have any painkillers left."); } if(PlayerInfo[playerid][pAddictUpgrade] > 0) { SendClientMessageEx(playerid, COLOR_YELLOW3, "Addict Perk: Your level %i/3 addict perk gave you %.1f extra health.", PlayerInfo[playerid][pAddictUpgrade], (PlayerInfo[playerid][pAddictUpgrade] * 5.0)); } GivePlayerHealth(playerid, 30.0 + (PlayerInfo[playerid][pAddictUpgrade] * 5.0)); PlayerInfo[playerid][pPainkillers] -= 1; PlayerInfo[playerid][pReceivingAid] = 1; PlayerInfo[playerid][pDrugsUsed] += 2; PlayerInfo[playerid][pLastDrug] = gettime(); if(PlayerInfo[playerid][pDrugsUsed] >= 4) { AwardAchievement(playerid, "High times"); GameTextForPlayer(playerid, "~p~shit... you stoned as hell duuuude...", 5000, 1); PlayerInfo[playerid][pDrugsTime] = 30; } ApplyAnimation(playerid, "SMOKING", "M_smk_in", 4.1, 0, 0, 0, 0, 0); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s pops a painkiller in their mouth.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = %i WHERE uid = %i", PlayerInfo[playerid][pPainkillers], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } return 1; } CMD:showid(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /showid [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } SendClientMessage(targetid, COLOR_NAVYBLUE, "______ ID Card ______"); SendClientMessageEx(targetid, COLOR_GREY1, "Name: %s", GetPlayerRPName(playerid)); SendClientMessageEx(targetid, COLOR_GREY1, "Gender: %s", (PlayerInfo[playerid][pGender] == 2) ? ("Female") : ("Male")); SendClientMessageEx(targetid, COLOR_GREY1, "Age: %i years old", PlayerInfo[playerid][pAge]); SendClientMessageEx(targetid, COLOR_GREY1, "Drivers License: %s", (PlayerInfo[playerid][pCarLicense]) ? ("{00AA00}Yes") : ("{FF6347}No")); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s shows their ID card to %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:inv(playerid, params[]) { return callcmd::inventory(playerid, params); } CMD:inventory(playerid, params[]) { DisplayInventory(playerid); return 1; } CMD:drop(playerid, params[]) { new option[12], confirm[10]; if(sscanf(params, "s[12]S()[10]", option, confirm)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /drop [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Weapons, Materials, Weed, Cocaine, Meth, Painkillers, Cigars, Spraycans"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Seeds, Ephedrine, CarLicense"); return 1; } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(!strcmp(option, "weapons", true)) { if(isnull(confirm) || strcmp(confirm, "confirm", true) != 0) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /drop [weapons] [confirm]"); } ResetPlayerWeaponsEx(playerid); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s throws away their weapons.", GetPlayerRPName(playerid)); } else if(!strcmp(option, "materials", true)) { if(!PlayerInfo[playerid][pMaterials]) { return SendClientMessage(playerid, COLOR_GREY, "You have no materials which you can throw away."); } if(isnull(confirm) || strcmp(confirm, "confirm", true) != 0) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /drop [materials] [confirm] (You have %i materials.)", PlayerInfo[playerid][pMaterials]); } PlayerInfo[playerid][pMaterials] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s throws away their materials.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET materials = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "weed", true)) { if(!PlayerInfo[playerid][pWeed]) { return SendClientMessage(playerid, COLOR_GREY, "You have no weed which you can throw away."); } if(isnull(confirm) || strcmp(confirm, "confirm", true) != 0) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /drop [weed] [confirm] (You have %i grams of weed.)", PlayerInfo[playerid][pWeed]); } PlayerInfo[playerid][pWeed] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s throws away their weed.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET weed = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "cocaine", true)) { if(!PlayerInfo[playerid][pCocaine]) { return SendClientMessage(playerid, COLOR_GREY, "You have no cocaine which you can throw away."); } if(isnull(confirm) || strcmp(confirm, "confirm", true) != 0) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /drop [cocaine] [confirm] (You have %i grams of cocaine.)", PlayerInfo[playerid][pCocaine]); } PlayerInfo[playerid][pCocaine] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s throws away their cocaine.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cocaine = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "meth", true)) { if(!PlayerInfo[playerid][pMeth]) { return SendClientMessage(playerid, COLOR_GREY, "You have no meth which you can throw away."); } if(isnull(confirm) || strcmp(confirm, "confirm", true) != 0) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /drop [meth] [confirm] (You have %i grams of meth.)", PlayerInfo[playerid][pMeth]); } PlayerInfo[playerid][pMeth] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s throws away their meth.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET meth = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "painkillers", true)) { if(!PlayerInfo[playerid][pPainkillers]) { return SendClientMessage(playerid, COLOR_GREY, "You have no painkillers which you can throw away."); } if(isnull(confirm) || strcmp(confirm, "confirm", true) != 0) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /drop [cocaine] [confirm] (You have %i painkillers.)", PlayerInfo[playerid][pPainkillers]); } PlayerInfo[playerid][pPainkillers] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s throws away their painkillers.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET painkillers = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "cigars", true)) { if(!PlayerInfo[playerid][pCigars]) { return SendClientMessage(playerid, COLOR_GREY, "You have no cigars which you can throw away."); } if(isnull(confirm) || strcmp(confirm, "confirm", true) != 0) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /drop [cigars] [confirm] (You have %i cigars.)", PlayerInfo[playerid][pCigars]); } PlayerInfo[playerid][pCigars] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s throws away their cigars.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET cigars = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "spraycans", true)) { if(!PlayerInfo[playerid][pSpraycans]) { return SendClientMessage(playerid, COLOR_GREY, "You have no spraycans which you can throw away."); } if(isnull(confirm) || strcmp(confirm, "confirm", true) != 0) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /drop [spraycans] [confirm] (You have %i spraycans.)", PlayerInfo[playerid][pSpraycans]); } PlayerInfo[playerid][pSpraycans] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s throws away their spraycanss.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET spraycans = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "seeds", true)) { if(!PlayerInfo[playerid][pSeeds]) { return SendClientMessage(playerid, COLOR_GREY, "You have no seeds which you can throw away."); } if(isnull(confirm) || strcmp(confirm, "confirm", true) != 0) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /drop [seeds] [confirm] (You have %i seeds.)", PlayerInfo[playerid][pSeeds]); } PlayerInfo[playerid][pSeeds] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s throws away their seeds.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET seeds = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "ephedrine", true)) { if(!PlayerInfo[playerid][pEphedrine]) { return SendClientMessage(playerid, COLOR_GREY, "You have no ephedrine which you can throw away."); } if(isnull(confirm) || strcmp(confirm, "confirm", true) != 0) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /drop [ephedrine] [confirm] (You have %i grams of ephedrine.)", PlayerInfo[playerid][pEphedrine]); } PlayerInfo[playerid][pEphedrine] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s throws away their ephedrine.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET ephedrine = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "carlicense", true)) { if(!PlayerInfo[playerid][pCarLicense]) { return SendClientMessage(playerid, COLOR_GREY, "You have no drivers license which you can throw away."); } if(isnull(confirm) || strcmp(confirm, "confirm", true) != 0) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /drop [carlicense] [confirm] (This drops your drivers license.)"); } PlayerInfo[playerid][pCarLicense] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s rips up their drivers license.", GetPlayerRPName(playerid)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET carlicense = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } return 1; } CMD:creategang(playerid, params[]) { new name[32]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[32]", name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /creategang [name]"); } for(new i = 0; i < MAX_GANGS; i ++) { if(!GangInfo[i][gSetup]) { SetupGang(i, name); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has setup gang {F7A763}%s{FF6347} in slot ID %i.", GetPlayerRPName(playerid), name, i); SendClientMessageEx(playerid, COLOR_WHITE, "** This gang's ID is %i. /editgang to edit.", i); return 1; } } SendClientMessage(playerid, COLOR_GREY, "Gang slots are currently full. Ask developers to increase the internal limit."); return 1; } CMD:editgang(playerid, params[]) { new gangid, option[14], param[128]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[14]S()[128]", gangid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Name, MOTD, Leader, Level, Color, Points, Turfcookies, RankName, Skin, Strikes"); return 1; } if(!(0 <= gangid < MAX_GANGS) || !GangInfo[gangid][gSetup]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid gang."); } if(!strcmp(option, "name", true)) { if(isnull(param) || strlen(params) > 32) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [name] [text]"); } strcpy(GangInfo[gangid][gName], param, 32); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET name = '%e' WHERE id = %i", param, gangid); mysql_tquery(connectionID, queryBuffer); ReloadGang(gangid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the name of gang ID %i to '%s'.", GetPlayerRPName(playerid), gangid, param); } else if(!strcmp(option, "motd", true)) { if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [motd] [text]"); } strcpy(GangInfo[gangid][gMOTD], param, 128); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET motd = '%e' WHERE id = %i", param, gangid); mysql_tquery(connectionID, queryBuffer); ReloadGang(gangid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has adjusted the MOTD of gang ID %i.", GetPlayerRPName(playerid), gangid); } else if(!strcmp(option, "leader", true)) { new leader[MAX_PLAYER_NAME]; if(sscanf(param, "s[24]", leader)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [leader] [name]"); SendClientMessage(playerid, COLOR_SYNTAX, "This only updates the text for the leader's name in /gangs. Use /setgang to appoint someone as gang leader."); return 1; } strcpy(GangInfo[gangid][gLeader], leader, MAX_PLAYER_NAME); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET leader = '%e' WHERE id = %i", leader, gangid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the leader of gang ID %i to %s.", GetPlayerRPName(playerid), gangid, leader); } else if(!strcmp(option, "level", true)) { new value; if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [level] [value (1-3)]"); } if(!(1 <= value <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid level."); } GangInfo[gangid][gLevel] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET level = %i WHERE id = %i", GangInfo[gangid][gLevel], gangid); mysql_tquery(connectionID, queryBuffer); ReloadGang(gangid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the level of gang ID %i to %i/3.", GetPlayerRPName(playerid), gangid, value); } else if(!strcmp(option, "color", true)) { new color; if(sscanf(param, "h", color)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [color] [0xRRGGBBAA]"); } GangInfo[gangid][gColor] = color & ~0xff; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET color = %i WHERE id = %i", GangInfo[gangid][gColor], gangid); mysql_tquery(connectionID, queryBuffer); foreach(new i : Turf) { if(TurfInfo[i][tExists] && TurfInfo[i][tCapturedGang] == gangid) { ReloadTurf(i); } } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the {%06x}color{FF6347} of gang ID %i.", GetPlayerRPName(playerid), color >>> 8, gangid); } else if(!strcmp(option, "points", true)) { new value; if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [points] [value]"); } GangInfo[gangid][gPoints] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET points = %i WHERE id = %i", GangInfo[gangid][gPoints], gangid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the gang points of gang ID %i to %i.", GetPlayerRPName(playerid), gangid, value); } else if(!strcmp(option, "turfcookies", true)) { new value; if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [turfcookies] [value]"); } GangInfo[gangid][gTurfcookies] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET turfcookies = %i WHERE id = %i", GangInfo[gangid][gTurfcookies], gangid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the turf cookies of gang ID %i to %i.", GetPlayerRPName(playerid), gangid, value); } else if(!strcmp(option, "rankname", true)) { new rankid, rank[32]; if(sscanf(param, "is[32]", rankid, rank)) { SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Rank Names ______"); for(new i = 0; i < 7; i ++) { if(isnull(GangRanks[gangid][i])) SendClientMessageEx(playerid, COLOR_GREY2, "Rank %i: (empty)", i); else SendClientMessageEx(playerid, COLOR_GREY2, "Rank %i: %s", i, GangRanks[gangid][i]); } return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [rankname] [slot (0-6)] [name]"); } if(!(0 <= rankid <= 6)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid rank."); } strcpy(GangRanks[gangid][rankid], rank, 32); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO gangranks VALUES(%i, %i, '%e') ON DUPLICATE KEY UPDATE name = '%e'", gangid, rankid, rank, rank); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set rank %i's name of gang ID %i to '%s'.", GetPlayerRPName(playerid), rankid, gangid, rank); } else if(!strcmp(option, "skin", true)) { new slot, skinid; if(sscanf(param, "ii", slot, skinid)) { SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Gang Skins ______"); for(new i = 0; i < MAX_GANG_SKINS; i ++) { if(GangInfo[gangid][gSkins][i] == 0) SendClientMessageEx(playerid, COLOR_GREY2, "Skin %i: (none)", i + 1); else SendClientMessageEx(playerid, COLOR_GREY2, "Skin %i: %i", i + 1, GangInfo[gangid][gSkins][i]); } return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [skin] [slot (1-%i)] [skinid]", MAX_GANG_SKINS); } if(!(1 <= slot <= MAX_GANG_SKINS)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid slot."); } if(!(0 <= skinid <= 311)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid skin."); } slot--; GangInfo[gangid][gSkins][slot] = skinid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO gangskins VALUES(%i, %i, %i) ON DUPLICATE KEY UPDATE skinid = %i", gangid, slot, skinid, skinid); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_WHITE, "** You have set the skin in slot %i to ID %i.", slot + 1, skinid); } else if(!strcmp(option, "strikes", true)) { new amount; if(sscanf(param, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [strikes] [amount]"); } if(!(0 <= amount <= 3)) { return SendClientMessage(playerid, COLOR_GREY, "The amount must range from 0 to 3."); } GangInfo[gangid][gStrikes] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET strikes = %i WHERE id = %i", amount, gangid); mysql_tquery(connectionID, queryBuffer); ReloadGang(gangid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the strikes of gang ID %i to %i.", GetPlayerRPName(playerid), gangid, amount); } else if(!strcmp(option, "alliance", true)) { new allyid; if(sscanf(param, "i", allyid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editgang [gangid] [alliance] [gangid]"); } if(allyid == -1) { if(GangInfo[gangid][gAlliance] >= 0) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET alliance = -1 WHERE id = %i", GangInfo[gangid][gAlliance]); mysql_tquery(connectionID, queryBuffer); GangInfo[GangInfo[gangid][gAlliance]][gAlliance] = -1; } GangInfo[gangid][gAlliance] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET alliance = -1 WHERE id = %i", gangid); mysql_tquery(connectionID, queryBuffer); ReloadGang(gangid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has reset the alliance of gang ID %i.", GetPlayerRPName(playerid), gangid); } else { if(!(0 <= allyid < MAX_GANGS) || GangInfo[allyid][gSetup] == 0) { return SendClientMessage(playerid, COLOR_GREY, "Invalid gang."); } GangInfo[gangid][gAlliance] = allyid; GangInfo[allyid][gAlliance] = gangid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET alliance = %i WHERE id = %i", allyid, gangid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET alliance = %i WHERE id = %i", gangid, allyid); mysql_tquery(connectionID, queryBuffer); ReloadGang(gangid); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the alliance of gang ID %i to gang %i.", GetPlayerRPName(playerid), gangid, allyid); } } return 1; } CMD:settitle(playerid, params[]) { new targetid, option[14], param[128]; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[14]S()[128]", targetid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /settitle [playerid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Name, Color"); return 1; } if(!strcmp(option, "name", true)) { if(isnull(param) || strlen(params) > 32) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /settitle [playerid] [name] [text ('none' to reset)]"); } strcpy(PlayerInfo[targetid][pCustomTitle], param, 64); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET customtitle = '%e' WHERE uid = %i", param, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the customtitle of %s to '%s'.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), param); } else if(!strcmp(option, "color", true)) { new color; if(sscanf(param, "h", color)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /settitle [playerid] [color] [0xRRGGBBAA]"); } PlayerInfo[targetid][pCustomTColor] = color & ~0xff; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET customcolor = %i WHERE uid = %i", PlayerInfo[targetid][pCustomTColor], PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the {%06x}color{FF6347} of %s's title.", GetPlayerRPName(playerid), color >>> 8, GetPlayerRPName(targetid)); } return 1; } CMD:removegang(playerid, params[]) { new gangid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", gangid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removegang [gangid]"); } if(!(0 <= gangid < MAX_GANGS) || !GangInfo[gangid][gSetup]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid gang."); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has deleted gang %s.", GetPlayerRPName(playerid), GangInfo[gangid][gName]); SendClientMessageEx(playerid, COLOR_LIGHTRED, "You have permanently deleted the {F7A763}%s{FF6347} gang slot.", GangInfo[gangid][gName]); RemoveGang(gangid); Log_Write("log_gang", "%s (uid: %i) has removed gang %s (id: %i).", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], GangInfo[gangid][gName], gangid); return 1; } CMD:gangstrike(playerid, params[]) { new gangid, reason[128], color; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[128]", gangid, reason)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gangstrike [gangid] [reason]"); } if(!(0 <= gangid < MAX_GANGS) || !GangInfo[gangid][gSetup]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid gang."); } if(GangInfo[gangid][gStrikes] >= 3) { return SendClientMessage(playerid, COLOR_GREY, "This gang already has 3 strikes."); } GangInfo[gangid][gStrikes]++; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET strikes = %i WHERE id = %i", GangInfo[gangid][gStrikes], gangid); mysql_tquery(connectionID, queryBuffer); Log_Write("log_gang", "%s (uid: %i) has striked gang %s (id: %i).", GetPlayerRPName(playerid), PlayerInfo[playerid][pID], GangInfo[gangid][gName], gangid); if(GangInfo[gangid][gColor] == -1 || GangInfo[gangid][gColor] == -256) { color = 0xC8C8C8FF; } else { color = GangInfo[gangid][gColor]; } switch(GangInfo[gangid][gStrikes]) { case 1: SendClientMessageToAllEx(COLOR_WHITE, "(( Gang News: {%06x}%s{FFFFFF} has received their 1st strike, reason: %s ))", color >>> 8, GangInfo[gangid][gName], reason); case 2: SendClientMessageToAllEx(COLOR_WHITE, "(( Gang News: {%06x}%s{FFFFFF} has received their 2nd strike, reason: %s ))", color >>> 8, GangInfo[gangid][gName], reason); case 3: SendClientMessageToAllEx(COLOR_WHITE, "(( Gang News: {%06x}%s{FFFFFF} has received their 3rd strike, reason: %s ))", color >>> 8, GangInfo[gangid][gName], reason); } return 1; } CMD:switchgang(playerid, params[]) { new targetid, gangid, rankid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "uiI(-1)", targetid, gangid, rankid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /switchgang[playerid] [gangid (-1 = none)] [rank (optional)]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(!(-1 <= gangid < MAX_GANGS) || (gangid >= 0 && !GangInfo[gangid][gSetup])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid gang."); } if((gangid != -1 && !(-1 <= rankid <= 6))) { return SendClientMessage(playerid, COLOR_GREY, "Invalid rank."); } if(gangid == -1) { PlayerInfo[targetid][pGang] = -1; PlayerInfo[targetid][pGangRank] = 0; PlayerInfo[targetid][pCrew] = -1; SendClientMessageEx(targetid, COLOR_AQUA, "%s has removed you from your gang.", GetPlayerRPName(playerid)); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has removed %s from their gang.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); } else { if(rankid == -1) { rankid = 6; } /*if(rankid == 6) { GetPlayerName(targetid, GangInfo[gangid][gLeader], MAX_PLAYER_NAME); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET leader = '%e' WHERE id = %i", GangInfo[gangid][gLeader], gangid); mysql_tquery(connectionID, queryBuffer); }*/ PlayerInfo[targetid][pGang] = gangid; PlayerInfo[targetid][pGangRank] = rankid; PlayerInfo[targetid][pCrew] = -1; SendClientMessageEx(targetid, COLOR_AQUA, "%s has made you a {00AA00}%s{33CCFF} in %s.", GetPlayerRPName(playerid), GangRanks[gangid][rankid], GangInfo[gangid][gName]); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has made %s a %s in %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid), GangRanks[gangid][rankid], GangInfo[gangid][gName]); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gang = %i, gangrank = %i, crew = -1 WHERE uid = %i", gangid, rankid, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); return 1; } CMD:families(playerid, params[]) { return callcmd::gangs(playerid, params); } CMD:gangs(playerid, params[]) { new gangid; if(sscanf(params, "i", gangid)) { SendClientMessage(playerid, COLOR_NAVYBLUE, "___________________ Gangs ___________________"); for(new i = 0; i < MAX_GANGS; i ++) { if(GangInfo[i][gSetup]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM users WHERE gang = %i", i); mysql_tquery(connectionID, queryBuffer, "OnPlayerListGangs", "ii", playerid, i); } } return 1; } if(!(0 <= gangid < MAX_GANGS) || !GangInfo[gangid][gSetup]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid gang."); } if(GangInfo[gangid][gAlliance] != -1) { SendClientMessageEx(playerid, COLOR_GREY, "Name: %s - Leader: %s - Strikes: %i/3 - Alliance: %s", GangInfo[gangid][gName], GangInfo[gangid][gLeader], GangInfo[gangid][gStrikes], GangInfo[GangInfo[gangid][gAlliance]][gName]); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ Members Online _____"); foreach(new i : Player) { if(PlayerInfo[i][pLogged] && PlayerInfo[i][pGang] == gangid) { SendClientMessageEx(playerid, COLOR_GREY2, "(%i) %s %s", PlayerInfo[i][pGangRank], GangRanks[gangid][PlayerInfo[i][pGangRank]], GetPlayerRPName(i)); } } return 1; } CMD:points(playerid, params[]) { new name[32], color = -1, pointid; if(sscanf(params, "i", pointid)) { SendClientMessage(playerid, COLOR_GREEN, "_______________________________________"); for(new i = 0; i < MAX_POINTS; i ++) { if(PointInfo[i][pExists]) { if(PointInfo[i][pCapturedGang] == -1) { name = "None"; } else { strcpy(name, GangInfo[PointInfo[i][pCapturedGang]][gName]); } SendClientMessageEx(playerid, COLOR_GREY2, "ID: %i | Name: %s | Owner: %s | Captured by: %s | Profits: %s | Time: %ih", i, PointInfo[i][pName], name, PointInfo[i][pCapturedBy], FormatNumber(PointInfo[i][pProfits]), PointInfo[i][pTime]); } } SendClientMessage(playerid, COLOR_GREEN, "_______________________________________"); SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /points [pointid]"); return 1; } if(!(0 <= pointid < MAX_POINTS) || !PointInfo[pointid][pExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid point."); } if(PointInfo[pointid][pCapturedGang] >= 0) { strcpy(name, GangInfo[PointInfo[pointid][pCapturedGang]][gName]); color = GangInfo[PointInfo[pointid][pCapturedGang]][gColor]; } else { name = "None"; } SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_____ %s ($%i) _____", PointInfo[pointid][pName], PointInfo[pointid][pProfits]); SendClientMessageEx(playerid, COLOR_WHITE, "** This point captured by %s for {%06x}%s{FFFFFF} will be available in %i hours.", PointInfo[pointid][pCapturedBy], color >>> 8, name, PointInfo[pointid][pTime]); if(PointInfo[pointid][pCapturer] != INVALID_PLAYER_ID) { SendClientMessageEx(playerid, COLOR_WHITE, "** This point is being captured by %s and will be theirs in %i minutes.", GetPlayerRPName(PointInfo[pointid][pCapturer]), PointInfo[pointid][pCaptureTime]); } return 1; } /*CMD:turfs(playerid, params[]) { if(!PlayerInfo[playerid][pShowTurfs]) { ShowTurfsOnMap(playerid, true); SendClientMessage(playerid, COLOR_AQUA, "You will now see turfs on your mini-map."); } else { ShowTurfsOnMap(playerid, false); SendClientMessage(playerid, COLOR_AQUA, "You will no longer see any turfs on your mini-map."); } return 1; } */ CMD:lands(playerid, params[]) { if(!PlayerInfo[playerid][pShowLands]) { ShowLandsOnMap(playerid, true); SendClientMessage(playerid, COLOR_AQUA, "You will now see lands on your mini-map."); } else { ShowLandsOnMap(playerid, false); SendClientMessage(playerid, COLOR_AQUA, "You will no longer see any lands on your mini-map."); } return 1; } CMD:f(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /f [gang chat]"); } if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any gang at the moment."); } if(PlayerInfo[playerid][pToggleGang]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the gang chat as you have it toggled."); } if(PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot speak in /r while dead."); } if(PlayerInfo[playerid][pCuffed]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while cuffed."); } if(PlayerInfo[playerid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while tied."); } foreach(new i : Player) { new crew[32]; if(PlayerInfo[playerid][pCrew] >= 0) { crew = GangCrews[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pCrew]]; } else { crew = "None"; } if(PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] && !PlayerInfo[i][pToggleGang]) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_AQUA, "** [%i] %s (%s) %s: %.*s... **", PlayerInfo[playerid][pGangRank], GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], crew, GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, COLOR_AQUA, "** [%i] %s (%s) %s: ...%s **", PlayerInfo[playerid][pGangRank], GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], crew, GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_AQUA, "** [%i] %s (%s) %s: %s **", PlayerInfo[playerid][pGangRank], GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], crew, GetPlayerRPName(playerid), params); } } } return 1; } CMD:ally(playerid, params[]) { new gangid = PlayerInfo[playerid][pGang]; if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /ally [Alliance chat]"); } if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any gang at the moment."); } if(GangInfo[gangid][gAlliance] == -1) { return SendClientMessage(playerid, COLOR_GREY, "Your gang isn't a part of an alliance."); } if(PlayerInfo[playerid][pToggleGang]) { return SendClientMessage(playerid, COLOR_GREY, "You can't speak in the alliance chat as you have gang chat toggled."); } if(PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot speak in /ally while dead."); } if(PlayerInfo[playerid][pCuffed]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while cuffed."); } if(PlayerInfo[playerid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while tied."); } foreach(new i : Player) { if((PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang] || PlayerInfo[i][pGang] == GangInfo[gangid][gAlliance]) && !PlayerInfo[i][pToggleGang]) { if(strlen(params) > MAX_SPLIT_LENGTH) { SendClientMessageEx(i, COLOR_GREEN, "** [Alliance] %s %s: %.*s... **", GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], GetPlayerRPName(playerid), MAX_SPLIT_LENGTH, params); SendClientMessageEx(i, COLOR_GREEN, "** [Alliance] %s %s: ...%s **", GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], GetPlayerRPName(playerid), params[MAX_SPLIT_LENGTH]); } else { SendClientMessageEx(i, COLOR_GREEN, "** [Alliance] %s %s: %s **", GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], GetPlayerRPName(playerid), params); } } } return 1; } /* CMD:gmembers(playerid, params[]) { if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of a gang at the moment."); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ Members Online _____"); foreach(new i : Player) { if(PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang]) { SendClientMessageEx(playerid, COLOR_GREY2, "(%i) %s %s", PlayerInfo[i][pGangRank], GangRanks[PlayerInfo[i][pGang]][PlayerInfo[i][pGangRank]], GetPlayerRPName(i)); } } return 1; }*/ stock nComma(numbers) //by Gamer931215 http://forum.sa-mp.com/showthread.php?t=259208 { new temp[24],counter = -1; valstr(temp,numbers); for(new i = strlen(temp);i > 0; i--) { counter++; if(counter == 3) { strins(temp,",",i); counter = 0; } } return temp; } CMD:gang(playerid, params[]) { new targetid, option[16], param[128]; if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any gang at the moment."); } if(sscanf(params, "s[16]S()[128]", option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gang [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Invite, Kick, Rank, Roster, Online, Quit, Offlinekick"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: MOTD, Stash, Stats, Turfs, Rankname, NPC, Upgrade, War, Alliance"); return 1; } if(!strcmp(option, "invite", true)) { if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 5+ to use this command."); } if(sscanf(param, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gang [invite] [playerid]"); } if(GangInfo[PlayerInfo[playerid][pGang]][gInvCooldown] > 0 && gacooldown) { return SendClientMessageEx(playerid, COLOR_GREY, "You're gang is currently on a invite cooldown. Please wait %i minutes before the next invite.", GangInfo[PlayerInfo[playerid][pGang]][gInvCooldown]); } if(GangClaimingTurfs(PlayerInfo[playerid][pGang]) || GangCapturingPoints(PlayerInfo[playerid][pGang])) { return SendClientMessage(playerid, COLOR_GREY, "You can not use invite if your gang is attending a turf or point."); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pGang] != -1) { return SendClientMessage(playerid, COLOR_GREY, "That player is already apart of a gang."); } if(GetFactionType(targetid) == FACTION_POLICE || GetFactionType(targetid) == FACTION_MEDIC || GetFactionType(targetid) == FACTION_GOVERNMENT || GetFactionType(targetid) == FACTION_ARMY) { return SendClientMessage(playerid, COLOR_GREY, "You cannot invite members that are in LSFMD, GOV, ARMY, or LSPD."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM users WHERE gang = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer, "OnPlayerAttemptInviteGang", "ii", playerid, targetid); } else if(!strcmp(option, "kick", true)) { if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 5+ to use this command."); } if(sscanf(param, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gang [kick] [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerInfo[targetid][pGang] != PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not apart of your gang."); } if(PlayerInfo[targetid][pGangRank] > PlayerInfo[playerid][pGangRank]) { return SendClientMessage(playerid, COLOR_GREY, "That player has a higher rank than you."); } Log_Write("log_gang", "%s (uid: %i) kicked %s (uid: %i) from %s (id: %i) as rank %s (%i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang], GangRanks[PlayerInfo[targetid][pGang]][PlayerInfo[targetid][pGangRank]], PlayerInfo[targetid][pGangRank]); PlayerInfo[targetid][pGang] = -1; PlayerInfo[targetid][pGangRank] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gang = -1, gangrank = 0 WHERE uid = %i", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has kicked you from the gang.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "You have kicked %s from your gang.", GetPlayerRPName(targetid)); } else if(!strcmp(option, "rank", true)) { new rankid; if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 5+ to use this command."); } if(sscanf(param, "ui", targetid, rankid)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /gang [rank] [playerid] [rankid (0-6)]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(rankid < 0 || rankid > PlayerInfo[playerid][pGangRank]) { return SendClientMessage(playerid, COLOR_GREY, "The rank specified is either invalid or higher than your rank."); } if(PlayerInfo[targetid][pGang] != PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not apart of your gang."); } if(PlayerInfo[targetid][pGangRank] > PlayerInfo[playerid][pGangRank]) { return SendClientMessage(playerid, COLOR_GREY, "That player has a higher rank than you."); } PlayerInfo[targetid][pGangRank] = rankid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gangrank = %i WHERE uid = %i", rankid, PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(targetid, COLOR_AQUA, "%s has set your rank to {00AA00}%s{33CCFF} (%i).", GetPlayerRPName(playerid), GangRanks[PlayerInfo[playerid][pGang]][rankid], rankid); SendClientMessageEx(playerid, COLOR_AQUA, "You have set %s's rank to {00AA00}%s{33CCFF} (%i).", GetPlayerRPName(targetid), GangRanks[PlayerInfo[playerid][pGang]][rankid], rankid); Log_Write("log_gang", "%s (uid: %i) has set %s's (uid: %i) rank in %s (id: %i) to %s (%i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetPlayerNameEx(targetid), PlayerInfo[targetid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang], GangRanks[PlayerInfo[playerid][pGang]][rankid], rankid); } else if(!strcmp(option, "stash", true)) { if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 6+ to use this command."); } if(isnull(param) || strcmp(param, "confirm", true) != 0) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gang [stash] [confirm] (Moves the gang stash.)"); } GetPlayerPos(playerid, GangInfo[PlayerInfo[playerid][pGang]][gStashX], GangInfo[PlayerInfo[playerid][pGang]][gStashY], GangInfo[PlayerInfo[playerid][pGang]][gStashZ]); GangInfo[PlayerInfo[playerid][pGang]][gStashInterior] = GetPlayerInterior(playerid); GangInfo[PlayerInfo[playerid][pGang]][gStashWorld] = GetPlayerVirtualWorld(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET stash_x = '%f', stash_y = '%f', stash_z = '%f', stashinterior = %i, stashworld = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gStashX], GangInfo[PlayerInfo[playerid][pGang]][gStashY], GangInfo[PlayerInfo[playerid][pGang]][gStashZ], GangInfo[PlayerInfo[playerid][pGang]][gStashInterior], GangInfo[PlayerInfo[playerid][pGang]][gStashWorld], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); ReloadGang(PlayerInfo[playerid][pGang]); SendClientMessageEx(playerid, COLOR_AQUA, "You have moved the gang stash to your location. /gstash to access your stash."); } else if(!strcmp(option, "turfs", true)) { new perk[32]; SendClientMessage(playerid, COLOR_GREEN, "_______________________________________"); foreach(new i : Turf) { if(TurfInfo[i][tExists] && TurfInfo[i][tCapturedGang] == PlayerInfo[playerid][pGang]) { switch(TurfInfo[i][tType]) { case 0: perk = "Normal"; case 1: perk = "Materials"; case 2: perk = "Low class weapons"; case 3: perk = "Medium class weapons"; case 4: perk = "High class weapons"; case 5: perk = "Traphouse"; case 6: perk = "Crackhouse"; case 7: perk = "Sales tax"; case 8: perk = "Locked turf"; } SendClientMessageEx(playerid, COLOR_GREY2, "ID: %i | Name: %s | Captured by: %s | Perk: %s | Time left: %ih", i, TurfInfo[i][tName], TurfInfo[i][tCapturedBy], perk, TurfInfo[i][tTime]); } } } else if(!strcmp(option, "stats", true)) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM users WHERE gang = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_GANG_INFORMATION, playerid); } else if(!strcmp(option, "roster", true)) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT username, lastlogin, gangrank FROM users WHERE gang = %i ORDER BY gangrank DESC", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_GANG_ROSTER, playerid); } else if(!strcmp(option, "online", true)) { callcmd::gmembers(playerid, "\1"); } else if(!strcmp(option, "quit", true)) { if(isnull(param) || strcmp(param, "confirm", true) != 0) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gang [quit] [confirm]"); } SendClientMessageEx(playerid, COLOR_AQUA, "You have quit %s as a {00AA00}%s{33CCFF} (%i).", GangInfo[PlayerInfo[playerid][pGang]][gName], GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], PlayerInfo[playerid][pGangRank]); Log_Write("log_gang", "%s (uid: %i) has quit %s (id: %i) has rank %s (%i).", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GangInfo[PlayerInfo[playerid][pGang]][gName], PlayerInfo[playerid][pGang], GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], PlayerInfo[playerid][pGangRank]); PlayerInfo[playerid][pGang] = -1; PlayerInfo[playerid][pGangRank] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gang = -1, gangrank = 0 WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(option, "offlinekick", true)) { new username[MAX_PLAYER_NAME]; if(PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 5+ to use this command."); } if(sscanf(param, "s[24]", username)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gang [offlinekick] [username]"); } if(IsPlayerOnline(username)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already online and logged in. Use '/gang kick' instead."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT uid, gang, gangrank FROM users WHERE username = '%e'", username); mysql_tquery(connectionID, queryBuffer, "OnPlayerOfflineKickGang", "is", playerid, username); } else if(!strcmp(option, "motd", true)) { if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 6+ to use this command."); } if(isnull(param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gang [motd] [text]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "Current MOTD: %s", GangInfo[PlayerInfo[playerid][pGang]][gMOTD]); return 1; } strcpy(GangInfo[PlayerInfo[playerid][pGang]][gMOTD], param, 128); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET motd = '%e' WHERE id = %i", param, PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); ReloadGang(PlayerInfo[playerid][pGang]); SendClientMessage(playerid, COLOR_AQUA, "You have changed the MOTD for your gang."); } else if(!strcmp(option, "rankname", true)) { new rankid, rank[32]; if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 6+ to use this command."); } if(sscanf(param, "is[32]", rankid, rank)) { SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Rank Names ______"); for(new i = 0; i < 7; i ++) { if(isnull(GangRanks[PlayerInfo[playerid][pGang]][i])) SendClientMessageEx(playerid, COLOR_GREY2, "Rank %i: (empty)", i); else SendClientMessageEx(playerid, COLOR_GREY2, "Rank %i: %s", i, GangRanks[PlayerInfo[playerid][pGang]][i]); } return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gang [rankname] [slot (0-6)] [name]"); } if(!(0 <= rankid <= 6)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid rank."); } strcpy(GangRanks[PlayerInfo[playerid][pGang]][rankid], rank, 32); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO gangranks VALUES(%i, %i, '%e') ON DUPLICATE KEY UPDATE name = '%e'", PlayerInfo[playerid][pGang], rankid, rank, rank); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the name of rank %i to {00AA00}%s{33CCFF}.", rankid, rank); } else if(!strcmp(option, "npc", true)) { new type, confirm[10]; if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 6+ to use this command."); } if(sscanf(param, "is[10]", type, confirm)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gang [npc] [slot] [confirm]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of slots: (1) Arms Dealer (2) Drug Dealer"); return 1; } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0 || PlayerInfo[playerid][pJoinedEvent] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command from within the vehicle."); } if(!isnull(confirm) && !strcmp(confirm, "confirm", true)) { if(type == 1) { if(!GangInfo[PlayerInfo[playerid][pGang]][gArmsDealer]) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have the arms dealer upgrade. (/gang upgrade)"); } GetPlayerPos(playerid, GangInfo[PlayerInfo[playerid][pGang]][gArmsX], GangInfo[PlayerInfo[playerid][pGang]][gArmsY], GangInfo[PlayerInfo[playerid][pGang]][gArmsZ]); SetPlayerPos(playerid, GangInfo[PlayerInfo[playerid][pGang]][gArmsX] + 1.0, GangInfo[PlayerInfo[playerid][pGang]][gArmsY], GangInfo[PlayerInfo[playerid][pGang]][gArmsZ] + 1.0); GetPlayerFacingAngle(playerid, GangInfo[PlayerInfo[playerid][pGang]][gArmsA]); GangInfo[PlayerInfo[playerid][pGang]][gArmsWorld] = GetPlayerVirtualWorld(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET arms_x = '%f', arms_y = '%f', arms_z = '%f', arms_a = '%f', armsworld = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gArmsX], GangInfo[PlayerInfo[playerid][pGang]][gArmsY], GangInfo[PlayerInfo[playerid][pGang]][gArmsZ], GangInfo[PlayerInfo[playerid][pGang]][gArmsA], GangInfo[PlayerInfo[playerid][pGang]][gArmsWorld], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); ReloadGang(PlayerInfo[playerid][pGang]); SendClientMessage(playerid, COLOR_AQUA, "You have moved the position of the arms dealer for your gang."); } else if(type == 2) { if(!GangInfo[PlayerInfo[playerid][pGang]][gDrugDealer]) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have the drug dealer upgrade. (/gang upgrade)"); } GetPlayerPos(playerid, GangInfo[PlayerInfo[playerid][pGang]][gDrugX], GangInfo[PlayerInfo[playerid][pGang]][gDrugY], GangInfo[PlayerInfo[playerid][pGang]][gDrugZ]); SetPlayerPos(playerid, GangInfo[PlayerInfo[playerid][pGang]][gDrugX] + 1.0, GangInfo[PlayerInfo[playerid][pGang]][gDrugY], GangInfo[PlayerInfo[playerid][pGang]][gDrugZ] + 1.0); GetPlayerFacingAngle(playerid, GangInfo[PlayerInfo[playerid][pGang]][gDrugA]); GangInfo[PlayerInfo[playerid][pGang]][gDrugWorld] = GetPlayerVirtualWorld(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET drug_x = '%f', drug_y = '%f', drug_z = '%f', drug_a = '%f', drugworld = %i WHERE id = %i", GangInfo[PlayerInfo[playerid][pGang]][gDrugX], GangInfo[PlayerInfo[playerid][pGang]][gDrugY], GangInfo[PlayerInfo[playerid][pGang]][gDrugZ], GangInfo[PlayerInfo[playerid][pGang]][gDrugA], GangInfo[PlayerInfo[playerid][pGang]][gDrugWorld], PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); ReloadGang(PlayerInfo[playerid][pGang]); SendClientMessage(playerid, COLOR_AQUA, "You have moved the position of the drug dealer for your gang."); } } } else if(!strcmp(option, "upgrade", true)) { if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 6+ to use this command."); } new title[48], string[1024] = "Perk\tDescription\tCost"; strcat(string, "\nDrug dealer\tAn NPC which sells individually stocked drugs\t{F7A763}500 GP {FFFFFF}+{00AA00} $50,000"); strcat(string, "\nArms dealer\tAn NPC which sells individually stocked weapons\t{F7A763}500 GP {FFFFFF}+{00AA00} $50,000"); strcat(string, "\nDuel arena\tAn OOC 1v1 duel arena for your gang.\t{F7A763}400 GP {FFFFFF}+{00AA00} $75,000"); strcat(string, "\nMapping\tUp to 50 mapped objects for your gang.\t{F7A763}4500 GP {FFFFFF}+{00AA00} $100,000"); strcat(string, "\nInterior\tCustom interior exclusively for your gang.\t{F7A763}5000 GP {FFFFFF}+{00AA00} $100,000"); // gang and mat s0ns format(string, sizeof string, "%s\nMaterials level up\tReceive more materials from successfully captured turfs.\t{F7A763}%s GP {FFFFFF}+{00AA00} $%s", string, nComma(1500 + (500*GangInfo[PlayerInfo[playerid][pGang]][gMatLevel])), nComma(100000 + (50000*GangInfo[PlayerInfo[playerid][pGang]][gMatLevel]))); format(string, sizeof string, "%s\nGun level up\tReceive more guns from successfully captured turfs.\t{F7A763} %s GP {FFFFFF}+{00AA00} $%s", string, nComma(1500 + (250*GangInfo[PlayerInfo[playerid][pGang]][gGunLevel])), nComma(40000 + (20000 * GangInfo[PlayerInfo[playerid][pGang]][gGunLevel]))); if(GangInfo[PlayerInfo[playerid][pGang]][gLevel] == 1) { strcat(string, "\nLevel Up\tAdvance your gang's level to 2/3.\t{F7A763}6000 GP {FFFFFF}+{00AA00} $75,000"); } else if(GangInfo[PlayerInfo[playerid][pGang]][gLevel] == 2) { strcat(string, "\nLevel Up\tAdvance your gang's level to 3/3.\t{F7A763}12000 GP {FFFFFF}+{00AA00} $100,000"); } format(title, sizeof(title), "Gang upgrades (Your gang has %i GP.)", GangInfo[PlayerInfo[playerid][pGang]][gPoints]); ShowPlayerDialog(playerid, DIALOG_GANGPOINTSHOP, DIALOG_STYLE_TABLIST_HEADERS, title, string, "Select", "Cancel"); } else if(!strcmp(option, "alliance", true)) { new gangid = PlayerInfo[playerid][pGang]; if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least rank 6+ to use this command."); } if(sscanf(param, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gang [alliance] [playerid]"); } if(GangInfo[gangid][gAlliance] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "You're already in an alliance, end it first! (/endalliance)"); } if(PlayerInfo[targetid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "The player you're offering to ally with must be R6 in their gang!"); } if(PlayerInfo[targetid][pGang] == gangid) { return SendClientMessage(playerid, COLOR_GREY, "You cannot form an alliance with your own gang!"); } if(GangInfo[gangid][gAlliance] == -1) { SendClientMessageEx(playerid, COLOR_AQUA, "You've offered to form a gang alliance with %s.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "%s has offered to form an alliance with your gang. (/accept alliance)", GetPlayerRPName(playerid)); PlayerInfo[targetid][pAllianceOffer] = playerid; } } return 1; } CMD:gstash(playerid, params[]) { if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of a gang at the moment."); } if(PlayerInfo[playerid][pFaction] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while in a faction."); } if(!(IsPlayerInRangeOfPoint(playerid, 5.0, GangInfo[PlayerInfo[playerid][pGang]][gStashX], GangInfo[PlayerInfo[playerid][pGang]][gStashY], GangInfo[PlayerInfo[playerid][pGang]][gStashZ]) && GetPlayerVirtualWorld(playerid) == GangInfo[PlayerInfo[playerid][pGang]][gStashWorld])) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of your gang stash."); } if(PlayerInfo[playerid][pHurt]) { return SendClientMessageEx(playerid, COLOR_GREY, "You're too hurt to open the stash. Please wait %i seconds before trying again.", PlayerInfo[playerid][pHurt]); } ShowDialogToPlayer(playerid, DIALOG_GANGSTASH); return 1; } CMD:bandana(playerid, params[]) { if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of a gang at the moment."); } if(PlayerInfo[playerid][pHurt]) { return SendClientMessageEx(playerid, COLOR_GREY, "You're too hurt to takeoff your bandana. Please wait %i seconds before trying again.", PlayerInfo[playerid][pHurt]); } if(!PlayerInfo[playerid][pBandana]) { /*if(PlayerInfo[playerid][pJoinedEvent] || PlayerInfo[playerid][pPaintballTeam] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "You can not put on your bandana on while in a event or paintball match."); }*/ PlayerInfo[playerid][pBandana] = 1; SendClientMessage(playerid, COLOR_AQUA, "You have enabled your bandana. Your nametag color has been set to your gang color."); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes out a bandana and wraps it around their head.", GetPlayerRPName(playerid)); SetPlayerColor(playerid, GangInfo[PlayerInfo[playerid][pGang]][gColor] & ~0xff); } else { PlayerInfo[playerid][pBandana] = 0; SendClientMessage(playerid, COLOR_AQUA, "You have disabled your bandana. Your nametag color was reset back to normal."); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s takes off their bandana from around their head.", GetPlayerRPName(playerid)); SetPlayerColor(playerid, 0xFFFFFF00); } return 1; } CMD:gbuyvehicle(playerid, params[]) { /*if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You are not rank 5+ in any gang at the moment."); } if(GetGangVehicles(PlayerInfo[playerid][pGang]) >= GetGangVehicleLimit(PlayerInfo[playerid][pGang])) { return SendClientMessageEx(playerid, COLOR_GREY, "Your gang can't have more than %i vehicles at its level.", GetGangVehicleLimit(PlayerInfo[playerid][pGang])); } PlayerInfo[playerid][pGangCar] = 1; if(IsPlayerInRangeOfPoint(playerid, 3.0, 542.0433, -1293.5909, 17.2422)) { ShowDialogToPlayer(playerid, DIALOG_BUYVEHICLE); } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 154.2223, -1946.3030, 5.1920)) { ShowDialogToPlayer(playerid, DIALOG_BUYBOAT); } else if(IsPlayerInRangeOfPoint(playerid, 3.0, 1892.6315, -2328.6721, 13.5469)) { ShowDialogToPlayer(playerid, DIALOG_BUYAIRCRAFT); } else { SendClientMessage(playerid, COLOR_GREY, "You are not in range of any dealership."); }*/ SendClientMessage(playerid, COLOR_GREY, "Command has been removed, Contact an admin instead."); return 1; } CMD:gpark(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), id = VehicleInfo[vehicleid][vID]; if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You are not rank 5+ in any gang at the moment."); } if(!vehicleid || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any of your gang vehicles."); } if(VehicleInfo[vehicleid][vGang] != PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "You can't park this vehicle as it doesn't belong to your gang."); } // Save the vehicle's information. GetVehiclePos(vehicleid, VehicleInfo[vehicleid][vPosX], VehicleInfo[vehicleid][vPosY], VehicleInfo[vehicleid][vPosZ]); GetVehicleZAngle(vehicleid, VehicleInfo[vehicleid][vPosA]); VehicleInfo[vehicleid][vInterior] = GetPlayerInterior(playerid); VehicleInfo[vehicleid][vWorld] = GetPlayerVirtualWorld(playerid); SendClientMessage(playerid, COLOR_AQUA, "** Gang vehicle parked. It will now spawn here."); // Update the database record with the new information, then despawn the vehicle. mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET pos_x = '%f', pos_y = '%f', pos_z = '%f', pos_a = '%f', interior = %i, world = %i WHERE id = %i", VehicleInfo[vehicleid][vPosX], VehicleInfo[vehicleid][vPosY], VehicleInfo[vehicleid][vPosZ], VehicleInfo[vehicleid][vPosA], VehicleInfo[vehicleid][vInterior], VehicleInfo[vehicleid][vWorld], VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); SaveVehicleModifications(vehicleid); DespawnVehicle(vehicleid, false); // Finally, we reload the vehicle from the database. mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM vehicles WHERE id = %i", id); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LOAD_VEHICLES, -1); return 1; } CMD:gfindcar(playerid, params[]) { new string[512], count; if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of a gang at the moment."); } string = "#\tModel\tLocation"; foreach(new i: Vehicle) { if(VehicleInfo[i][vID] > 0 && VehicleInfo[i][vGang] == PlayerInfo[playerid][pGang]) { format(string, sizeof(string), "%s\n%i\t%s\t%s", string, count + 1, GetVehicleName(i), GetVehicleZoneName(i)); count++; } } if(!count) { return SendClientMessage(playerid, COLOR_GREY, "Your gang has no vehicles which you can track."); } ShowPlayerDialog(playerid, DIALOG_GANGFINDCAR, DIALOG_STYLE_TABLIST_HEADERS, "Gang vehicles", string, "Track", "Cancel"); return 1; } CMD:grespawncars(playerid, params[]) { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You are not rank 5+ in any gang at the moment."); } foreach(new i: Vehicle) { if(VehicleInfo[i][vID] > 0 && VehicleInfo[i][vGang] == PlayerInfo[playerid][pGang] && !IsVehicleOccupied(i)) { SetVehicleToRespawn(i); } } SendAdminMessage(COLOR_YELLOW, "AdmWarning: %s[%i] has respawned their gang vehicles.", GetPlayerRPName(playerid), playerid); SendClientMessage(playerid, COLOR_YELLOW, "You have respawned all of your unoccupied gang vehicles."); return 1; } CMD:gsellcar(playerid, params[]) { /*new vehicleid = GetPlayerVehicleID(playerid); if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You are not rank 5+ in any gang at the moment."); } if(!vehicleid || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any of your gang vehicles."); } if(VehicleInfo[vehicleid][vGang] != PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "You can't sell this vehicle as it doesn't belong to your gang."); } if(!IsPlayerInRangeOfPoint(playerid, 8.0, 542.0433, -1293.5909, 17.2422)) // here { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the Grotti car dealership."); } if(strcmp(params, "confirm", true) != 0) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gsellcar [confirm]"); SendClientMessageEx(playerid, COLOR_SYNTAX, "This command permanently deletes your gang vehicle. You will receive %s back.", FormatNumber(percent(VehicleInfo[vehicleid][vPrice], 75))); return 1; } GivePlayerCash(playerid, percent(VehicleInfo[vehicleid][vPrice], 75)); SendClientMessageEx(playerid, COLOR_GREEN, "You have sold your %s to the dealership and received %s back.", GetVehicleName(vehicleid), FormatNumber(percent(VehicleInfo[vehicleid][vPrice], 75))); Log_Write("log_gang", "%s (uid: %i) sold their gang owned %s (id: %i) to the dealership for $%i", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], GetVehicleName(vehicleid), VehicleInfo[vehicleid][vID], percent(VehicleInfo[vehicleid][vPrice], 75)); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM vehicles WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); DespawnVehicle(vehicleid, false);*/ SendClientMessage(playerid, COLOR_GREY, "Command has been removed, Contact an admin instead."); return 1; } CMD:createpoint(playerid, params[]) { new type, name[32]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[32]", type, name)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /createpoint [type] [name]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (1) Drug factory (2) Drug den (3) Crack house (4) Auto export (5) Fuel"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (6) Mat pickup 1 (7) Mat pickup 2 (8) Mat factory 1 (9) Mat factory 2"); return 1; } if(!(0 <= type <= 9)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } for(new i = 0; i < MAX_POINTS; i ++) { if(!PointInfo[i][pExists]) { GetPlayerPos(playerid, PointInfo[i][pPointX], PointInfo[i][pPointY], PointInfo[i][pPointZ]); strcpy(PointInfo[i][pName], name, 32); strcpy(PointInfo[i][pCapturedBy], "No-one", MAX_PLAYER_NAME); PointInfo[i][pExists] = 1; PointInfo[i][pType] = type; PointInfo[i][pProfits] = 0; PointInfo[i][pCapturedGang] = -1; PointInfo[i][pTime] = 20; PointInfo[i][pPointInterior] = GetPlayerInterior(playerid); PointInfo[i][pPointWorld] = GetPlayerVirtualWorld(playerid); PointInfo[i][pCaptureTime] = 0; PointInfo[i][pCapturer] = INVALID_PLAYER_ID; PointInfo[i][pText] = Text3D:INVALID_3DTEXT_ID; PointInfo[i][pPickup] = -1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO points (id, name, type, point_x, point_y, point_z, pointinterior, pointworld) VALUES(%i, '%e', %i, '%f', '%f', '%f', %i, %i)", i, name, type, PointInfo[i][pPointX], PointInfo[i][pPointY], PointInfo[i][pPointZ], PointInfo[i][pPointInterior], PointInfo[i][pPointWorld]); mysql_tquery(connectionID, queryBuffer); ReloadPoint(i); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has created point {F7A763}%s{FF6347}.", GetPlayerRPName(playerid), name); SendClientMessageEx(playerid, COLOR_AQUA, "You have created point {F7A763}%s{33CCFF}. /editpoint %i to edit this point.", name, i); return 1; } } return 1; } CMD:gotopoint(playerid, params[]) { new pointid; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", pointid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gotopoint [pointid]"); } if(!(0 <= pointid < MAX_POINTS) || !PointInfo[pointid][pExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid point."); } GameTextForPlayer(playerid, "~w~Teleported", 5000, 1); SetPlayerPos(playerid, PointInfo[pointid][pPointX], PointInfo[pointid][pPointY], PointInfo[pointid][pPointZ]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetCameraBehindPlayer(playerid); return 1; } CMD:editpoint(playerid, params[]) { new pointid, option[14], param[32]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[14]S()[32]", pointid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editpoint [pointid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Name, Location, CapturedBy, Gang, Type, Profits, Time"); return 1; } if(!(0 <= pointid < MAX_POINTS) || !PointInfo[pointid][pExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid point."); } if(!strcmp(option, "name", true)) { if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editpoint [pointid] [name] [text]"); } strcpy(PointInfo[pointid][pName], param, 32); ReloadPoint(pointid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET name = '%e' WHERE id = %i", PointInfo[pointid][pName], pointid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the name of point %i to %s.", GetPlayerRPName(playerid), pointid, param); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the name of point %i to {F7A763}%s{33CCFF}.", pointid, param); } else if(!strcmp(option, "location", true)) { GetPlayerPos(playerid, PointInfo[pointid][pPointX], PointInfo[pointid][pPointY], PointInfo[pointid][pPointZ]); PointInfo[pointid][pPointInterior] = GetPlayerInterior(playerid); PointInfo[pointid][pPointWorld] = GetPlayerVirtualWorld(playerid); ReloadPoint(pointid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET point_x = '%f', point_y = '%f', point_z = '%f', pointinterior = %i, pointworld = %i WHERE id = %i", PointInfo[pointid][pPointX], PointInfo[pointid][pPointY], PointInfo[pointid][pPointZ], PointInfo[pointid][pPointInterior], PointInfo[pointid][pPointWorld], pointid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has moved the location of point %i.", GetPlayerRPName(playerid), pointid); SendClientMessageEx(playerid, COLOR_AQUA, "You have moved the location of point %i.", pointid); } else if(!strcmp(option, "capturedby", true)) { if(isnull(param) || strlen(params) > 24) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editpoint [pointid] [capturedby] [name]"); } strcpy(PointInfo[pointid][pCapturedBy], param, MAX_PLAYER_NAME); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET capturedby = '%e' WHERE id = %i", PointInfo[pointid][pCapturedBy], pointid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the capturer of point %i to %s.", GetPlayerRPName(playerid), pointid, param); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the capturer of point %i to {F7A763}%s{33CCFF}.", pointid, param); } else if(!strcmp(option, "gang", true)) { new gangid; if(sscanf(param, "i", gangid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editpoint [pointid] [gang] [gangid (-1 = none)]"); } if(!(-1 <= gangid < MAX_GANGS) || (gangid >= 0 && !GangInfo[gangid][gSetup])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid gang."); } PointInfo[pointid][pCapturedGang] = gangid; ReloadPoint(pointid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET capturedgang = %i WHERE id = %i", PointInfo[pointid][pCapturedGang], pointid); mysql_tquery(connectionID, queryBuffer); if(gangid == -1) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has reset the capturing gang of point %i.", GetPlayerRPName(playerid), pointid); SendClientMessageEx(playerid, COLOR_AQUA, "You have reset the capturing gang of point %i.", pointid); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the capturing gang of point %i to %s.", GetPlayerRPName(playerid), pointid, GangInfo[gangid][gName]); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the capturing gang of point %i to {00AA00}%s{33CCFF}.", pointid, GangInfo[gangid][gName]); } } else if(!strcmp(option, "type", true)) { new type; if(sscanf(param, "i", type)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editpoint [pointid] [type] [value]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (1) Drug factory (2) Drug den (3) Crack house (4) Auto export (5) Fuel"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (6) Mat pickup 1 (7) Mat pickup 2 (8) Mat factory 1 (9) Mat factory 2"); return 1; } if(!(0 <= type <= 9)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } PointInfo[pointid][pType] = type; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET type = %i WHERE id = %i", PointInfo[pointid][pType], pointid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the type of point %i to %i.", GetPlayerRPName(playerid), pointid, type); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the type of point %i to %i.", pointid, type); } else if(!strcmp(option, "profits", true)) { new value; if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editpoint [pointid] [profits] [value]"); } PointInfo[pointid][pProfits] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET profits = %i WHERE id = %i", PointInfo[pointid][pProfits], pointid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the profits of point %i to $%i.", GetPlayerRPName(playerid), pointid, value); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the profits of point %i to $%i.", pointid, value); } else if(!strcmp(option, "time", true)) { new value; if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editpoint [pointid] [time] [hours (0-24)]"); } if(!(0 <= value <= 24)) { return SendClientMessage(playerid, COLOR_GREY, "The amount of hours must range from 0 to 24."); } PointInfo[pointid][pTime] = value; if(PointInfo[pointid][pTime] == 0) { SendClientMessageToAllEx(COLOR_YELLOW, "Point wars: %s is now available to capture.", PointInfo[pointid][pName]); } else { PointInfo[pointid][pCapturer] = INVALID_PLAYER_ID; PointInfo[pointid][pCaptureTime] = 0; } ReloadPoint(pointid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE points SET time = %i WHERE id = %i", PointInfo[pointid][pTime], pointid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the time of point %i to %i hours.", GetPlayerRPName(playerid), pointid, value); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the time of point %i to %i hours.", pointid, value); } return 1; } CMD:removepoint(playerid, params[]) { new pointid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", pointid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removepoint [pointid]"); } if(!(0 <= pointid < MAX_POINTS) || !PointInfo[pointid][pExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid point."); } DestroyDynamic3DTextLabel(PointInfo[pointid][pText]); DestroyDynamicPickup(PointInfo[pointid][pPickup]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM points WHERE id = %i", pointid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has deleted point %s.", GetPlayerRPName(playerid), PointInfo[pointid][pName]); SendClientMessageEx(playerid, COLOR_AQUA, "You have deleted point {F7A763}%s{33CCFF}.", PointInfo[pointid][pName]); PointInfo[pointid][pExists] = 0; PointInfo[pointid][pCapturedGang] = -1; PointInfo[pointid][pTime] = 0; return 1; } CMD:capture(playerid, params[]) { if(PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You are not rank 5+ in any gang at the moment."); } if(PlayerInfo[playerid][pCapturingPoint] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "You are already attempting to capture the point."); } if(PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You can't capture a point while injured."); } if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) { return SendClientMessage(playerid, COLOR_GREY, "You must be onfoot in order to use this command."); } if(GangCapturingPoints(PlayerInfo[playerid][pGang]) >= MaxCapCount[1]) { return SendClientMessageEx(playerid, COLOR_GREY, "You're gang is already capturing %i points.", MaxCapCount[1]); } for(new i = 0; i < MAX_POINTS; i ++) { if(PointInfo[i][pExists] && IsPlayerInRangeOfPoint(playerid, 1.0, PointInfo[i][pPointX], PointInfo[i][pPointY], PointInfo[i][pPointZ]) && GetPlayerInterior(playerid) == PointInfo[i][pPointInterior] && GetPlayerVirtualWorld(playerid) == PointInfo[i][pPointWorld]) { if(PointInfo[i][pTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "This point is not available to capture yet."); } if(PointInfo[i][pCapturer] == playerid) { return SendClientMessage(playerid, COLOR_GREY, "This point is already being captured by you."); } if(PointInfo[i][pCapturer] != INVALID_PLAYER_ID && PlayerInfo[PointInfo[i][pCapturer]][pGang] == PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "This point is already being captured by your gang."); } foreach(new x : Player) { if(PlayerInfo[x][pCapturingPoint] == i && PlayerInfo[x][pCaptureTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "Someone else is already attempting to capture. Please wait until they're done."); } } PlayerInfo[playerid][pCapturingPoint] = i; PlayerInfo[playerid][pCaptureTime] = 10; GetPlayerPos(playerid, PlayerInfo[playerid][pPointX], PlayerInfo[playerid][pPointY], PlayerInfo[playerid][pPointZ]); SendProximityMessage(playerid, 20.0, COLOR_RED, "(( %s is attempting to capture %s. ))", GetPlayerRPName(playerid), PointInfo[i][pName]); return 1; } } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any points."); return 1; } GangCapturingPoints(gang) { new capCount = 0; for(new x = 0; x < MAX_POINTS; x++) { if(PointInfo[x][pExists] && PointInfo[x][pCapturer] != INVALID_PLAYER_ID && PointInfo[x][pTime] == 0) { if(PlayerInfo[PointInfo[x][pCapturer]][pGang] == gang) { capCount++; } } } return capCount; } GangClaimingTurfs(gang) { new capCount = 0; for(new x = 0; x < MAX_TURFS; x++) { if(TurfInfo[x][tExists] && TurfInfo[x][tCapturer] != INVALID_PLAYER_ID && TurfInfo[x][tTime] == 0) { if(PlayerInfo[TurfInfo[x][tCapturer]][pGang] == gang) { capCount++; } } } return capCount; } CMD:claim(playerid, params[]) { new turfid, count; if((PlayerInfo[playerid][pGang] == -1 || PlayerInfo[playerid][pGangRank] < 5) && !IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not rank 5+ in a gang or apart of law enforcement."); } if((turfid = GetNearbyTurf(playerid)) == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any turfs which you can claim."); } if(IsLawEnforcement(playerid) && PlayerInfo[playerid][pGang] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "You're not allowed to claim turfs as a law enforcer and a gang member."); } if(PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You can't claim a turf while injured."); } if(TurfInfo[turfid][tTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "This turf is not yet available to claim."); } if(TurfInfo[turfid][tType] == 8) { return SendClientMessage(playerid, COLOR_GREY, "This is a locked turf and therefore cannot be claimed."); } if(TurfInfo[turfid][tCapturer] == playerid) { return SendClientMessage(playerid, COLOR_GREY, "This turf is already being captured by you."); } if(!IsLawEnforcement(playerid) && GangClaimingTurfs(PlayerInfo[playerid][pGang]) >= MaxCapCount[0]) { return SendClientMessageEx(playerid, COLOR_GREY, "You're gang is already claiming %i turfs.", MaxCapCount[0]); } if(!IsLawEnforcement(playerid) && TurfInfo[turfid][tCapturer] != INVALID_PLAYER_ID && PlayerInfo[TurfInfo[turfid][tCapturer]][pGang] == PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "This turf is already being claimed by your gang."); } if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT) { return SendClientMessage(playerid, COLOR_GREY, "You must be onfoot in order to use this command."); } if(GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't claim a turf inside an interior."); } if(TurfInfo[turfid][tCapturer] != INVALID_PLAYER_ID && TurfInfo[turfid][tTime] == 0) { foreach(new i : Player) { if(i != playerid && GetNearbyTurf(i) == turfid && !PlayerInfo[i][pInjured] && !PlayerInfo[i][pAdminDuty] && !PlayerInfo[i][pAcceptedHelp] && !PlayerInfo[i][pAFK] && GetPlayerState(i) != PLAYER_STATE_SPECTATING) { if(PlayerInfo[TurfInfo[turfid][tCapturer]][pGang] >= 0 && PlayerInfo[i][pGang] == PlayerInfo[TurfInfo[turfid][tCapturer]][pGang] && PlayerInfo[i][pGang] != GangInfo[PlayerInfo[playerid][pGang]][gAlliance]) { return SendClientMessage(playerid, COLOR_GREY, "You must eliminate all members of the attacking gang before you can claim this."); } else if(IsLawEnforcement(TurfInfo[turfid][tCapturer]) && IsLawEnforcement(i)) { return SendClientMessage(playerid, COLOR_GREY, "You must eliminate all LEO in this turf before you can claim this."); } } } } if(PlayerInfo[playerid][pGang] >= 0) { if(GangInfo[PlayerInfo[playerid][pGang]][gTurfcookies] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "Your gang doesn't have any turf cookies left."); } foreach(new i : Player) { if(GetNearbyTurf(i) == turfid && PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang]) { count++; } } if(count < 3) { return SendClientMessage(playerid, COLOR_GREY, "You need at least 3 members of your gang in this turf to claim it."); } else { GangInfo[PlayerInfo[playerid][pGang]][gTurfcookies]--; SendClientMessageToAllEx(COLOR_YELLOW, "Turf wars: %s has attempted to claim %s for %s. It will be their turf in 10 minutes!", GetPlayerRPName(playerid), TurfInfo[turfid][tName], GangInfo[PlayerInfo[playerid][pGang]][gName]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET turfcookies = turfcookies - 1 WHERE id = %i", PlayerInfo[playerid][pGang]); mysql_tquery(connectionID, queryBuffer); } } else if(IsLawEnforcement(playerid) && PlayerInfo[playerid][pGang] == -1) { if(FactionInfo[PlayerInfo[playerid][pFaction]][fTurfcookies] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "Your faction doesn't have any turf cookies left."); } FactionInfo[PlayerInfo[playerid][pFaction]][fTurfcookies]--; SendClientMessageToAllEx(COLOR_YELLOW, "Turf wars: %s has attempted to claim back %s. It will be their turf in 10 minutes!", GetPlayerRPName(playerid), TurfInfo[turfid][tName]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factions SET turfcookies = turfcookies - 1 WHERE id = %i", PlayerInfo[playerid][pFaction]); mysql_tquery(connectionID, queryBuffer); } TurfInfo[turfid][tCapturer] = playerid; TurfInfo[turfid][tCaptureTime] = 10; ReloadTurf(turfid); return 1; } CMD:reclaim(playerid, params[]) { new turfid; if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any gang at the moment."); } if((turfid = GetNearbyTurf(playerid)) == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any turfs."); } if(IsLawEnforcement(playerid) && PlayerInfo[playerid][pGang] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "You're not allowed to claim turfs as a law enforcer and a gang member."); } if(PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You can't reclaim a turf while injured."); } if(TurfInfo[turfid][tCapturedGang] != PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "This turf does not belong to your gang. Therefore you can't reclaim it."); } if(TurfInfo[turfid][tType] == 8) { return SendClientMessage(playerid, COLOR_GREY, "This is a locked turf and therefore cannot be claimed."); } if(TurfInfo[turfid][tCapturer] == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "This turf is not being claimed by anyone. Therefore you can't reclaim it."); } if(TurfInfo[turfid][tCapturer] != INVALID_PLAYER_ID && TurfInfo[turfid][tTime] == 0) { foreach(new i : Player) { if(i != playerid && GetNearbyTurf(i) == turfid && !PlayerInfo[i][pInjured] && !PlayerInfo[i][pAdminDuty] && !PlayerInfo[i][pAcceptedHelp] && !PlayerInfo[i][pAFK] && GetPlayerState(i) != PLAYER_STATE_SPECTATING) { if(PlayerInfo[TurfInfo[turfid][tCapturer]][pGang] >= 0 && PlayerInfo[i][pGang] == PlayerInfo[TurfInfo[turfid][tCapturer]][pGang] && PlayerInfo[i][pGang] != GangInfo[PlayerInfo[playerid][pGang]][gAlliance]) { return SendClientMessage(playerid, COLOR_GREY, "You must eliminate all members of the attacking gang before you can claim this."); } else if(IsLawEnforcement(TurfInfo[turfid][tCapturer]) && IsLawEnforcement(i)) { return SendClientMessage(playerid, COLOR_GREY, "You must eliminate all LEO in this turf before you can claim this."); } } } } SendTurfMessage(turfid, COLOR_YELLOW, "Turf wars: %s has reclaimed %s for %s and ended the turf war.", GetPlayerRPName(playerid), TurfInfo[turfid][tName], GangInfo[PlayerInfo[playerid][pGang]][gName]); TurfInfo[turfid][tCapturer] = INVALID_PLAYER_ID; TurfInfo[turfid][tCaptureTime] = 0; ReloadTurf(turfid); return 1; } CMD:guninv(playerid, params[]) { SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ My Weapons _____"); for(new i = 0; i < 13; i ++) { if(PlayerInfo[playerid][pWeapons][i] > 0) { SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s", PlayerInfo[playerid][pWeapons][i], GetWeaponNameEx(PlayerInfo[playerid][pWeapons][i])); } } return 1; } CMD:armsdealer(playerid, params[]) { if(PlayerInfo[playerid][pHours] < 2 || PlayerInfo[playerid][pWeaponRestricted] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are either weapon restricted or you played less than two playing hours."); } for(new i = 0; i < MAX_GANGS; i ++) { if(GangInfo[i][gArmsDealer] && IsPlayerInRangeOfPoint(playerid, 3.0, GangInfo[i][gArmsX], GangInfo[i][gArmsY], GangInfo[i][gArmsZ]) && GetPlayerVirtualWorld(playerid) == GangInfo[i][gArmsWorld]) { PlayerInfo[playerid][pDealerGang] = i; ShowDialogToPlayer(playerid, DIALOG_GANGARMSDEALER); return 1; } } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any gang owned arms dealers."); return 1; } CMD:drugdealer(playerid, params[]) { for(new i = 0; i < MAX_GANGS; i ++) { if(GangInfo[i][gDrugDealer] && IsPlayerInRangeOfPoint(playerid, 3.0, GangInfo[i][gDrugX], GangInfo[i][gDrugY], GangInfo[i][gDrugZ]) && GetPlayerVirtualWorld(playerid) == GangInfo[i][gDrugWorld]) { PlayerInfo[playerid][pDealerGang] = i; ShowDialogToPlayer(playerid, DIALOG_GANGDRUGDEALER); return 1; } } SendClientMessage(playerid, COLOR_GREY, "You are not in range of any gang owned drug dealers."); return 1; } CMD:createturf(playerid, params[]) { new type, name[32]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[32]", type, name)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /createturf [special type] [name]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (0) None (1) Materials (2) Low weapons (3) Med weapons (4) High weapons"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (5) Traphouse (6) Crackhouse (7) Sales taxing (8) Locked"); return 1; } if(!(0 <= type <= 8)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } if(GetNearbyTurf(playerid) >= 0) { return SendClientMessage(playerid, COLOR_GREY, "There is a turf in range. Find somewhere else to create this one."); } if(GetPlayerInterior(playerid) > 0 || GetPlayerVirtualWorld(playerid) > 0) { return SendClientMessage(playerid, COLOR_GREY, "You cannot create turfs indoors."); } PlayerInfo[playerid][pTurfType] = type; PlayerInfo[playerid][pZoneType] = ZONETYPE_TURF; strcpy(PlayerInfo[playerid][pTurfName], name, 32); ShowPlayerDialog(playerid, DIALOG_CREATEZONE, DIALOG_STYLE_MSGBOX, "Turf creation system", "You have entered turf creation mode. In order to create a turf you need\nto mark four points around the area you want your turf to be in, forming\na square. You must make a square or your outcome won't be as expected.\n\nPress {00AA00}Confirm{A9C4E4} to begin turf creation.", "Confirm", "Cancel"); return 1; } CMD:turfcancel(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(PlayerInfo[playerid][pZoneCreation] != ZONETYPE_TURF) { return SendClientMessage(playerid, COLOR_GREY, "You are not creating a turf at the moment."); } CancelZoneCreation(playerid); SendClientMessage(playerid, COLOR_LIGHTRED, "** Land creation cancelled."); return 1; } CMD:gototurf(playerid, params[]) { new turfid; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "i", turfid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gototurf [turfid]"); } if(!(0 <= turfid < MAX_TURFS) || !TurfInfo[turfid][tExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid turf."); } GameTextForPlayer(playerid, "~w~Teleported", 5000, 1); SetPlayerPos(playerid, TurfInfo[turfid][tMinX], TurfInfo[turfid][tMinY], TurfInfo[turfid][tHeight]); SetPlayerInterior(playerid, 0); SetPlayerVirtualWorld(playerid, 0); SetCameraBehindPlayer(playerid); return 1; } CMD:removeturf(playerid, params[]) { new turfid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", turfid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removeturf [turfid]"); } if(!(0 <= turfid < MAX_TURFS) || !TurfInfo[turfid][tExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid turf."); } GangZoneDestroy(TurfInfo[turfid][tGangZone]); DestroyDynamicArea(TurfInfo[turfid][tArea]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM turfs WHERE id = %i", turfid); mysql_tquery(connectionID, queryBuffer); TurfInfo[turfid][tExists] = 0; TurfInfo[turfid][tCapturedGang] = 0; TurfInfo[turfid][tType] = 0; Iter_Remove(Turf, turfid); SendClientMessageEx(playerid, COLOR_AQUA, "** You have removed turf %i.", turfid); return 1; } CMD:editturf(playerid, params[]) { new turfid, option[14], param[32]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pGangMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[14]S()[32]", turfid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editturf [turfid] [option]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: Name, CapturedBy, Gang, Type, Time"); return 1; } if(!(0 <= turfid < MAX_TURFS) || !TurfInfo[turfid][tExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid turf."); } if(!strcmp(option, "name", true)) { if(isnull(param)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editturf [turfid] [name] [text]"); } strcpy(TurfInfo[turfid][tName], param, 32); ReloadTurf(turfid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE turfs SET name = '%e' WHERE id = %i", TurfInfo[turfid][tName], turfid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the name of turf %i to %s.", GetPlayerRPName(playerid), turfid, param); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the name of turf %i to {F7A763}%s{33CCFF}.", turfid, param); } else if(!strcmp(option, "capturedby", true)) { if(isnull(param) || strlen(params) > 24) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editturf [turfid] [capturedby] [name]"); } strcpy(TurfInfo[turfid][tCapturedBy], param, MAX_PLAYER_NAME); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE turfs SET capturedby = '%e' WHERE id = %i", TurfInfo[turfid][tCapturedBy], turfid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the capturer of turf %i to %s.", GetPlayerRPName(playerid), turfid, param); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the capturer of turf %i to {F7A763}%s{33CCFF}.", turfid, param); } else if(!strcmp(option, "gang", true)) { new gangid; if(sscanf(param, "i", gangid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editturf [turfid] [gang] [gangid (-1 = none)]"); } if(!(-1 <= gangid < MAX_GANGS) || (gangid >= 0 && !GangInfo[gangid][gSetup])) { return SendClientMessage(playerid, COLOR_GREY, "Invalid gang."); } TurfInfo[turfid][tCapturedGang] = gangid; ReloadTurf(turfid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE turfs SET capturedgang = %i WHERE id = %i", TurfInfo[turfid][tCapturedGang], turfid); mysql_tquery(connectionID, queryBuffer); if(gangid == -1) { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has reset the capturing gang of turf %i.", GetPlayerRPName(playerid), turfid); SendClientMessageEx(playerid, COLOR_AQUA, "You have reset the capturing gang of turf %i.", turfid); } else { SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the capturing gang of turf %i to %s.", GetPlayerRPName(playerid), turfid, GangInfo[gangid][gName]); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the capturing gang of turf %i to {00AA00}%s{33CCFF}.", turfid, GangInfo[gangid][gName]); } } else if(!strcmp(option, "type", true)) { new type; if(sscanf(param, "i", type)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editturf [turfid] [type] [value]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (0) None (1) Materials (2) Low weapons (3) Med weapons (4) High weapons"); SendClientMessage(playerid, COLOR_SYNTAX, "List of types: (5) Traphouse (6) Crackhouse (7) Sales taxing (8) Locked"); return 1; } if(!(0 <= type <= 8)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid type."); } TurfInfo[turfid][tType] = type; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE turfs SET type = %i WHERE id = %i", TurfInfo[turfid][tType], turfid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the type of turf %i to %i.", GetPlayerRPName(playerid), turfid, type); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the type of turf %i to %i.", turfid, type); } else if(!strcmp(option, "time", true)) { new value; if(sscanf(param, "i", value)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editturf [turfid] [time] [hours (0-24)]"); } if(!(0 <= value <= 24)) { return SendClientMessage(playerid, COLOR_GREY, "The amount of hours must range from 0 to 24."); } TurfInfo[turfid][tTime] = value; if(TurfInfo[turfid][tTime] == 0 && TurfInfo[turfid][tType] != 8) { SendTurfMessage(turfid, COLOR_YELLOW, "Turf wars: %s is now available to capture.", TurfInfo[turfid][tName]); } else { TurfInfo[turfid][tCapturer] = INVALID_PLAYER_ID; TurfInfo[turfid][tCaptureTime] = 0; } ReloadTurf(turfid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE turfs SET time = %i WHERE id = %i", TurfInfo[turfid][tTime], turfid); mysql_tquery(connectionID, queryBuffer); SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has set the time of turf %i to %i hours.", GetPlayerRPName(playerid), turfid, value); SendClientMessageEx(playerid, COLOR_AQUA, "You have set the time of turf %i to %i hours.", turfid, value); } return 1; } /*CMD:pointinfo(playerid, params[]) { new pointid = GetNearbyPoint(playerid), string[12]; if(pointid == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any points."); } format(string, sizeof(string), "%i", pointid); callcmd::points(playerid, string); return 1; }*/ CMD:pointinfo(playerid, params[]) { new iCount, szMessage[128]; SendClientMessage(playerid, COLOR_ORANGE, "Point Info:"); for(new i; i < MAX_POINTS; i++) { if(PointInfo[i][pExists]) { if(PointInfo[i][pCapturer] != INVALID_PLAYER_ID) { if(PointInfo[i][pCaptureTime] == 1) { format(szMessage, sizeof(szMessage), "* %s | Capper: %s | Gang: %s | Time left: Less than 1 minute", PointInfo[i][pName], GetPlayerRPName(PointInfo[i][pCapturer]), GangInfo[PlayerInfo[PointInfo[i][pCapturer]][pGang]][gName]); SendClientMessage(playerid, COLOR_WHITE, szMessage); iCount++; } else { format(szMessage, sizeof(szMessage), "* %s | Capper: %s | Gang: %s | Time left: %d minutes", PointInfo[i][pName], GetPlayerRPName(PointInfo[i][pCapturer]), GangInfo[PlayerInfo[PointInfo[i][pCapturer]][pGang]][gName], PointInfo[i][pCaptureTime]); SendClientMessage(playerid, COLOR_WHITE, szMessage); iCount++; } } } } if(iCount == 0) return SendClientMessage(playerid, COLOR_GREY, "No gang has attempted to capture a point at this time."); return 1; } CMD:turfinfo(playerid, params[]) { new turfid, name[32] = "None", perk[32], color = -1; if((turfid = GetNearbyTurf(playerid)) == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any turfs."); } if(TurfInfo[turfid][tCapturedGang] >= 0) { strcpy(name, GangInfo[TurfInfo[turfid][tCapturedGang]][gName]); color = GangInfo[TurfInfo[turfid][tCapturedGang]][gColor]; } switch(TurfInfo[turfid][tType]) { case 0: perk = "Normal"; case 1: perk = "Materials"; case 2: perk = "Low class weapons"; case 3: perk = "Medium class weapons"; case 4: perk = "High class weapons"; case 5: perk = "Traphouse"; case 6: perk = "Crackhouse"; case 7: perk = "Sales tax"; case 8: perk = "Locked turf"; } SendClientMessageEx(playerid, COLOR_NAVYBLUE, "_____ %s (%s) _____", TurfInfo[turfid][tName], perk); if(TurfInfo[turfid][tType] == 8) { SendClientMessageEx(playerid, COLOR_WHITE, "** This turf is owned by {%06x}%s{FFFFFF} and is not available to capture.", color >>> 8, name); } else { SendClientMessageEx(playerid, COLOR_WHITE, "** This turf captured by %s for {%06x}%s{FFFFFF} will be available in %i hours.", TurfInfo[turfid][tCapturedBy], color >>> 8, name, TurfInfo[turfid][tTime]); if(TurfInfo[turfid][tCapturer] != INVALID_PLAYER_ID) { SendClientMessageEx(playerid, COLOR_WHITE, "** This turf is being captured by %s and will be theirs in %i minutes.", GetPlayerRPName(TurfInfo[turfid][tCapturer]), TurfInfo[turfid][tCaptureTime]); } } return 1; } CMD:carhelp(playerid, params[]) { return callcmd::vehiclehelp(playerid, params); } CMD:armbomb(playerid, params[]) { return callcmd::plantbomb(playerid, params); } CMD:defend(playerid, params[]) { new targetid, amount, time = (5 - GetJobLevel(playerid, JOB_LAWYER)) * 30; if(!PlayerHasJob(playerid, JOB_LAWYER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command unless you're a Lawyer."); } if(gettime() - PlayerInfo[playerid][pLastDefend] < time) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only defend a player every %i seconds. Please wait %i more seconds.", time, time - (gettime() - PlayerInfo[playerid][pLastDefend])); } if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /defend [playerid] [amount]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't defend yourself."); } if(!PlayerInfo[targetid][pWantedLevel]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not wanted."); } if(amount < 1000 || amount > 10000) { return SendClientMessage(playerid, COLOR_GREY, "The amount can't be below $1000 or above $10000."); } PlayerInfo[targetid][pDefendOffer] = playerid; PlayerInfo[targetid][pDefendPrice] = amount; PlayerInfo[playerid][pLastDefend] = gettime(); SendClientMessageEx(targetid, COLOR_AQUA, "** Lawyer %s has offered to defend your wanted level for $%i. (/accept lawyer)", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You have offered to defend %s's wanted level for $%i.", GetPlayerRPName(targetid), amount); return 1; } CMD:free(playerid, params[]) { new targetid, time = GetJobLevel(playerid, JOB_LAWYER); if(!PlayerHasJob(playerid, JOB_LAWYER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command unless you're a Lawyer."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /free [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(PlayerInfo[targetid][pJailType] != 3) { return SendClientMessage(playerid, COLOR_GREY, "That player is not in IC jail."); } if(PlayerInfo[targetid][pJailTime] < time * 60) { return SendClientMessage(playerid, COLOR_GREY, "You can't free this player, their jail time expires soon."); } PlayerInfo[targetid][pJailTime] -= time * 60; SendClientMessageEx(targetid, COLOR_AQUA, "** Lawyer %s has reduced your jail sentence by %i minutes.", GetPlayerRPName(playerid), time); SendClientMessageEx(playerid, COLOR_AQUA, "** You have reduced %s's jail sentence by %i minutes.", GetPlayerRPName(targetid), time); return 1; } CMD:eject(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /eject [playerid]"); } if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle."); } if(!IsPlayerConnected(targetid) || !IsPlayerInVehicle(targetid, GetPlayerVehicleID(playerid))) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected, or is not in your vehicle."); } RemovePlayerFromVehicle(targetid); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s ejects %s from the vehicle.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); return 1; } CMD:dicebet(playerid, params[]) { new targetid, amount; if(!IsPlayerInRangeOfPoint(playerid, 50.0, 1099.8420, 20.3554, 1000.6797)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the casino."); } if(PlayerInfo[playerid][pLevel] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You need to be at least level 3+ in order to dice bet."); } if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /dicebet [playerid] [amount]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(PlayerInfo[targetid][pLevel] < 3) { return SendClientMessage(playerid, COLOR_GREY, "That player must be at least level 3+ to bet with them."); } if(amount < 1) { return SendClientMessage(playerid, COLOR_GREY, "The amount can't be below $1."); } if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You don't have that much money to bet."); } if(gettime() - PlayerInfo[playerid][pLastBet] < 10) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only use this command every 10 seconds. Please wait %i more seconds.", 10 - (gettime() - PlayerInfo[playerid][pLastBet])); } PlayerInfo[targetid][pDiceOffer] = playerid; PlayerInfo[targetid][pDiceBet] = amount; PlayerInfo[targetid][pDiceRigged] = 0; PlayerInfo[playerid][pLastBet] = gettime(); SendClientMessageEx(targetid, COLOR_AQUA, "** %s has initiated a dice bet with you for $%i (/accept dicebet).", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You have initiated a dice bet against %s for $%i.", GetPlayerRPName(targetid), amount); return 1; } CMD:dicebetrigged(playerid, params[]) // Added to keep the economy in control. And to make people qq when they lose all their cash. { new targetid, amount; if(PlayerInfo[playerid][pAdmin] < 8) { return -1; } if(!IsPlayerInRangeOfPoint(playerid, 50.0, 1099.8420, 20.3554, 1000.6797)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the casino."); } if(sscanf(params, "ui", targetid, amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /dicebetrigged [playerid] [amount]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(PlayerInfo[targetid][pLevel] < 3) { return SendClientMessage(playerid, COLOR_GREY, "That player must be at least level 3+ to bet with them."); } if(amount < 1) { return SendClientMessage(playerid, COLOR_GREY, "The amount can't be below $1."); } if(PlayerInfo[playerid][pCash] < amount) { return SendClientMessage(playerid, COLOR_GREY, "You don't have that much money to bet."); } if(gettime() - PlayerInfo[playerid][pLastBet] < 10) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only use this command every 10 seconds. Please wait %i more seconds.", 10 - (gettime() - PlayerInfo[playerid][pLastBet])); } PlayerInfo[targetid][pDiceOffer] = playerid; PlayerInfo[targetid][pDiceBet] = amount; PlayerInfo[targetid][pDiceRigged] = 1; PlayerInfo[playerid][pLastBet] = gettime(); SendClientMessageEx(targetid, COLOR_AQUA, "** %s has initiated a dice bet with you for $%i (/accept dicebet).", GetPlayerRPName(playerid), amount); SendClientMessageEx(playerid, COLOR_AQUA, "** You have initiated a dice bet against %s for $%i.", GetPlayerRPName(targetid), amount); return 1; } CMD:calculate(playerid, params[]) { new option, Float:value1, Float:value2; if(sscanf(params, "fcf", value1, option, value2)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /calculate [value 1] [option] [value 2]"); SendClientMessage(playerid, COLOR_SYNTAX, "List of options: (+) Add (-) Subtract (*) Multiply (/) Divide"); return 1; } if(option == '/' && value2 == 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't divide by zero."); } if(option == '+') { SendClientMessageEx(playerid, COLOR_GREEN, "** Result: %.2f + %.2f = %.2f", value1, value2, value1 + value2); } else if(option == '-') { SendClientMessageEx(playerid, COLOR_GREEN, "** Result: %.2f - %.2f = %.2f", value1, value2, value1 - value2); } else if(option == '*' || option == 'x') { SendClientMessageEx(playerid, COLOR_GREEN, "** Result: %.2f * %.2f = %.2f", value1, value2, value1 * value2); } else if(option == '/') { SendClientMessageEx(playerid, COLOR_GREEN, "** Result: %.2f / %.2f = %.2f", value1, value2, value1 / value2); } return 1; } CMD:serverstats(playerid, params[]) { new houses, businesses, garages, vehicles, lands, entrances, turfs, points, gangs, factions, lockers; houses = Iter_Count(House); businesses = Iter_Count(Business); garages = Iter_Count(Garage); vehicles = Iter_Count(Vehicle); lands = Iter_Count(Land); entrances = Iter_Count(Entrance); turfs = Iter_Count(Turf); for(new i = 0; i < MAX_POINTS; i ++) if(PointInfo[i][pExists]) points++; for(new i = 0; i < MAX_GANGS; i ++) if(GangInfo[i][gSetup]) gangs++; for(new i = 0; i < MAX_FACTIONS; i ++) if(FactionInfo[i][fType]) factions++; for(new i = 0; i < MAX_LOCKERS; i ++) if(LockerInfo[i][lExists]) lockers++; SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Emerald City Roleplay Stats ______"); SendClientMessageEx(playerid, COLOR_GREY2, "Connections: %i - Registered: %i - Kill Counter: %i - Death Counter: %i - Hours Played: %i", gConnections, gTotalRegistered, gTotalKills, gTotalDeaths, gTotalHours); SendClientMessageEx(playerid, COLOR_GREY2, "Houses: %i/%i - Businesses: %i/%i - Garages: %i/%i - Lands: %i/%i - Vehicles: %i/%i", houses, MAX_HOUSES, businesses, MAX_BUSINESSES, garages, MAX_GARAGES, lands, MAX_LANDS, vehicles, MAX_VEHICLES); SendClientMessageEx(playerid, COLOR_GREY2, "Entrances: %i/%i - Turfs: %i/%i - Points: %i/%i - Gangs: %i/%i - Factions: %i/%i - Lockers: %i/%i", entrances, MAX_ENTRANCES, turfs, MAX_TURFS, points, MAX_POINTS, gangs, MAX_GANGS, factions, MAX_FACTIONS, lockers, MAX_LOCKERS); SendClientMessageEx(playerid, COLOR_GREY2, "Players Online: %i/%i - Player Record: %i - Record Date: %s - Anticheat Bans: %i", Iter_Count(Player), MAX_PLAYERS, gPlayerRecord, gRecordDate, gAnticheatBans); return 1; } CMD:ww(playerid, params[]) { return callcmd::pw(playerid, params); } CMD:watch(playerid, params[]) { return callcmd::pw(playerid, params); } CMD:pw(playerid, params[]) { if(!PlayerInfo[playerid][pWatch]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a pocket watch. You can buy one at 24/7."); } if(!PlayerInfo[playerid][pWatchOn]) { if(PlayerInfo[playerid][pToggleTextdraws]) { return SendClientMessage(playerid, COLOR_GREY, "You can't turn on your watch as you have textdraws toggled! (/toggle textdraws)"); } PlayerInfo[playerid][pWatchOn] = 1; TextDrawShowForPlayer(playerid, TimeTD); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s turns on their pocket watch.", GetPlayerRPName(playerid)); } else { PlayerInfo[playerid][pWatchOn] = 0; TextDrawHideForPlayer(playerid, TimeTD); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s turns off their pocket watch.", GetPlayerRPName(playerid)); } return 1; } CMD:gps(playerid, params[]) { if(!PlayerInfo[playerid][pGPS]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a GPS. You can buy one at 24/7."); } if(isnull(params)) { return ShowDialogToPlayer(playerid, DIALOG_LOCATE); } else { LocateMethod(playerid, params); } return 1; } CMD:fixvw(playerid, params[]) { /*if(PlayerInfo[playerid][pPaintball] > 0 || PlayerInfo[playerid][pJoinedEvent] || PlayerInfo[playerid][pJailType] > 0 || PlayerInfo[playerid][pDueling] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); }*/ if(GetPlayerVirtualWorld(playerid) > 0 && GetPlayerInterior(playerid) == 0) { SetPlayerVirtualWorld(playerid, 0); SendClientMessage(playerid, COLOR_GREY, "Your virtual world has been fixed."); } else { SendClientMessage(playerid, COLOR_GREY, "Your virtual world is not bugged at the moment."); } return 1; } CMD:stuck(playerid, params[]) { if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pAcceptedHelp] || PlayerInfo[playerid][pMiningTime] > 0 || PlayerInfo[playerid][pFishTime] > 0 || PlayerInfo[playerid][pLootTime] > 0 || GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CARRY || IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(gettime() - PlayerInfo[playerid][pLastStuck] < 5) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only use this command every 5 seconds. Please wait %i more seconds.", 5 - (gettime() - PlayerInfo[playerid][pLastStuck])); } new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); SetPlayerPos(playerid, x, y, z + 0.5); ClearAnimations(playerid); TogglePlayerControllable(playerid, 1); ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.1, 0, 0, 0, 0, 0, 1); SendClientMessage(playerid, COLOR_GREY, "You are no longer stuck."); PlayerInfo[playerid][pLastStuck] = gettime(); return 1; } CMD:badge(playerid, params[]) { if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_MEDIC && GetFactionType(playerid) != FACTION_GOVERNMENT && GetFactionType(playerid) != FACTION_NEWS) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic or law enforcer."); } if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJailTime] > 0 || PlayerInfo[playerid][pJoinedEvent] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(!PlayerInfo[playerid][pDuty]) { if(PlayerInfo[playerid][pJoinedEvent]) { return SendClientMessage(playerid, COLOR_GREY, "You can not put on your badge on while in a event."); } PlayerInfo[playerid][pDuty] = 1; SendClientMessage(playerid, COLOR_WHITE, "You have enabled your badge. Your nametag color now shows for all players."); } else { PlayerInfo[playerid][pDuty] = 0; SendClientMessage(playerid, COLOR_WHITE, "You have disabled your badge. Your nametag color no longer shows for any players."); } return 1; } /*CMD:duel(playerid, params[]) { new target1, target2, Float:health, Float:armor, weapon1, weapon2; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "uuffii", target1, target2, health, armor, weapon1, weapon2)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /duel [player1] [player2] [health] [armor] [weapon1] [weapon2]"); } if(target1 == INVALID_PLAYER_ID || target2 == INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "Invalid player specified."); } if(health < 1.0) { return SendClientMessage(playerid, COLOR_GREY, "Health can't be under 1.0."); } if(!(0 <= weapon1 <= 46) || !(0 <= weapon2 <= 46)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid weapon. Valid weapon IDs range from 0 to 46."); } SavePlayerVariables(target1); SavePlayerVariables(target2); ResetPlayerWeapons(target1); ResetPlayerWeapons(target2); SetPlayerPos(target1, 1370.3395, -15.4556, 1000.9219); SetPlayerPos(target2, 1414.4841, -15.1239, 1000.9253); SetPlayerFacingAngle(target1, 270.0000); SetPlayerFacingAngle(target2, 90.0000); SetPlayerInterior(target1, 1); SetPlayerInterior(target2, 1); SetPlayerVirtualWorld(target1, 0); SetPlayerVirtualWorld(target2, 0); SetPlayerHealth(target1, health); SetPlayerArmour(target1, armor); SetPlayerHealth(target2, health); SetPlayerArmour(target2, armor); GivePlayerWeaponEx(target1, weapon1, true); GivePlayerWeaponEx(target1, weapon2, true); GivePlayerWeaponEx(target2, weapon1, true); GivePlayerWeaponEx(target2, weapon2, true); GameTextForPlayer(target1, "~r~Duel time!", 3000, 3); GameTextForPlayer(target2, "~r~Duel time!", 3000, 3); PlayerInfo[target1][pDueling] = target2; PlayerInfo[target2][pDueling] = target1; SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has forced %s and %s into a duel.", GetPlayerRPName(playerid), GetPlayerRPName(target1), GetPlayerRPName(target2)); return 1; }*/ CMD:mole(playerid, params[]) // MADE BY THE ONE AND ONLY Hernandez! { if(GetFactionType(playerid) != FACTION_HITMAN && PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(isnull(params)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /mole [text]"); SendClientMessage(playerid, COLOR_YELLOW, "This command sends a SMS to the entire server. Abusing this command will result in heavy punishment."); return 1; } SendClientMessageToAllEx(COLOR_YELLOW, "** SMS from Satan: %s, Ph: 666 **", params); return 1; } CMD:info(playerid, params[]) { return callcmd::information(playerid, params); } CMD:information(playerid, params[]) { SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ Server Information _____"); SendClientMessage(playerid, COLOR_GREY2, "Website: https://ecrp.h0v1n8.nl"); SendClientMessage(playerid, COLOR_GREY2, "Forums: https://ecrp.h0v1n8.nl/board"); SendClientMessage(playerid, COLOR_GREY2, "Discord: https://discord.gg/XVXccen"); return 1; } CMD:takecall(playerid, params[]) { new targetid, Float:x, Float:y, Float:z; if(!PlayerHasJob(playerid, JOB_MECHANIC) && !PlayerHasJob(playerid, JOB_TAXIDRIVER)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command unless you're a Mechanic or Taxi Driver."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /takecall [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(PlayerHasJob(playerid, JOB_MECHANIC) && PlayerInfo[targetid][pMechanicCall] > 0) { if(GetPlayerInterior(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently unreachable."); } PlayerInfo[targetid][pMechanicCall] = 0; PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; GetPlayerPos(targetid, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 5.0); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's mechanic call. Their location was marked on your map.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "** %s has accepted your mechanic call. Please wait patiently until they arrive.", GetPlayerRPName(playerid)); } else if(PlayerHasJob(playerid, JOB_TAXIDRIVER) && PlayerInfo[targetid][pTaxiCall] > 0) { if(GetPlayerInterior(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently unreachable."); } PlayerInfo[targetid][pTaxiCall] = 0; PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; GetPlayerPos(targetid, x, y, z); SetPlayerCheckpoint(playerid, x, y, z, 5.0); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's taxi call. Their location was marked on your map.", GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_AQUA, "** %s has accepted your taxi call. Please wait patiently until they arrive.", GetPlayerRPName(playerid)); } else { SendClientMessage(playerid, COLOR_GREY, "That player has no calls which can be taken."); } return 1; } CMD:listcallers(playerid, params[]) { if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_MEDIC) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic or law enforcer."); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ Emergency Calls _____"); foreach(new i : Player) { if((PlayerInfo[i][pEmergencyCall] > 0) && ((PlayerInfo[i][pEmergencyType] == FACTION_MEDIC && GetFactionType(playerid) == FACTION_MEDIC) || (PlayerInfo[i][pEmergencyType] == FACTION_POLICE && IsLawEnforcement(playerid)))) { SendClientMessageEx(playerid, COLOR_GREY2, "** %s[%i] - Expiry: %i seconds - Emergency: %s", GetPlayerRPName(i), i, PlayerInfo[i][pEmergencyCall], PlayerInfo[i][pEmergency]); } } return 1; } CMD:trackcall(playerid, params[]) { new targetid, Float:x, Float:y, Float:z; if(!IsLawEnforcement(playerid) && GetFactionType(playerid) != FACTION_MEDIC) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you aren't a medic or law enforcer."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /trackcall [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pEmergencyCall]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't called 911 recently or their call expired."); } if(!GetPlayerPosEx(targetid, x, y, z)) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently unreachable."); } //PlayerInfo[targetid][pEmergencyCall] = 0; PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, x, y, z, 5.0); SendClientMessageEx(playerid, COLOR_AQUA, "** You have accepted %s's emergency call. Their location was marked on your map.", GetPlayerRPName(targetid)); if(PlayerInfo[targetid][pEmergencyCall] == FACTION_MEDIC) { SendClientMessageEx(targetid, COLOR_AQUA, "** %s has accepted your emergency call. Please wait patiently until they arrive.", GetPlayerRPName(playerid)); } return 1; } CMD:startchat(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /startchat [playerid]"); } if(IsPlayerChatActive(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You are already in an active chat. /invitechat to invite them."); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(IsPlayerChatActive(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "That player is in an active chat with another admin."); } chattingWith[playerid]{targetid} = true; chattingWith[targetid]{playerid} = true; SendClientMessageEx(targetid, COLOR_YELLOW, "Administrator %s has started a chat with you. /(re)ply to speak with this admin.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_YELLOW, "You have started a chat with %s (ID %i). /(re)ply to speak to the player.", GetPlayerRPName(targetid), targetid); return 1; } CMD:invitechat(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /invitechat [playerid]"); } if(!IsPlayerChatActive(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You have not started a chat yet. /startchat to start one."); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(IsPlayerChatActive(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "That player is in an active chat with another admin."); } chattingWith[playerid]{targetid} = true; chattingWith[targetid]{playerid} = true; SendClientMessageEx(targetid, COLOR_YELLOW, "Administrator %s has invited you to a chat. /(re)ply to speak with them.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_YELLOW, "You have invited %s (ID %i) to your chat.", GetPlayerRPName(targetid), targetid); return 1; } CMD:kickchat(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /kickchat [playerid]"); } if(!IsPlayerChatActive(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You have not started a chat yet. /startchat to start one."); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!chattingWith[playerid]{targetid}) { return SendClientMessage(playerid, COLOR_GREY, "That player is currently not in a chat with you."); } chattingWith[playerid]{targetid} = false; chattingWith[targetid]{playerid} = false; SendClientMessageEx(targetid, COLOR_YELLOW, "Administrator %s has removed you from the chat.", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_YELLOW, "You have removed %s (ID %i) from your chat.", GetPlayerRPName(targetid), targetid); return 1; } CMD:endchat(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!IsPlayerChatActive(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You have not started a chat yet. /startchat to start one."); } foreach(new i : Player) { if(i == playerid || chattingWith[playerid]{i}) { chattingWith[playerid]{i} = false; SendClientMessageEx(i, COLOR_YELLOW, "Administrator %s has ended the chat.", GetPlayerRPName(playerid)); } } return 1; } CMD:re(playerid, params[]) { return callcmd::reply(playerid, params); } CMD:reply(playerid, params[]) { if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /(re)ply [text]"); } if(!IsPlayerChatActive(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You haven't been invited to any chats by an admin."); } foreach(new i : Player) { if(i == playerid || chattingWith[i]{playerid}) { if(PlayerInfo[playerid][pAdmin] > 1 && PlayerInfo[playerid][pAdminHide] == 0) SendClientMessageEx(i, COLOR_YELLOW, "** %s %s (ID %i): %s **", GetAdminRank(playerid), GetPlayerRPName(playerid), playerid, params); else SendClientMessageEx(i, COLOR_YELLOW, "** Player %s (ID %i): %s **", GetPlayerRPName(playerid), playerid, params); } } return 1; } CMD:gascan(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid), amount; if(!vehicleid || GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You must be driving a vehicle to use this command."); } if(!VehicleHasEngine(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle has no engine which runs off gas."); } if(sscanf(params, "i", amount)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gascan [amount]"); } if(amount < 1 || amount > PlayerInfo[playerid][pGasCan]) { return SendClientMessage(playerid, COLOR_GREY, "Insufficient amount."); } if(vehicleFuel[vehicleid] + amount > 100) { return SendClientMessage(playerid, COLOR_GREY, "You can't add that much gasoline to the vehicle."); } PlayerInfo[playerid][pGasCan] -= amount; vehicleFuel[vehicleid] += amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET gascan = %i WHERE uid = %i", PlayerInfo[playerid][pGasCan], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s refills the %s's gas tank with %i liters of gasoline.", GetPlayerRPName(playerid), GetVehicleName(vehicleid), amount); return 1; } CMD:robbiz(playerid, params[]) { new bizid; if(IsPlayerAdmin(playerid)) // disabled for now { if(PlayerInfo[playerid][pRobbingBiz] >= 0) { return SendClientMessage(playerid, COLOR_GREY, "You're already robbing a business."); } if((bizid = GetInsideBusiness(playerid)) != -1) { return SendClientMessage(playerid, COLOR_GREY, "You aren't inside a business that you can rob."); } if(PlayerInfo[playerid][pLootTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are already looting a business."); } if(PlayerInfo[playerid][pRobCash] >= 10000) { return SendClientMessage(playerid, COLOR_GREY, "Your pockets can't hold more than $10,000 of money!"); } PlayerInfo[playerid][pRobbingBiz] = bizid; PlayerInfo[playerid][pLootTime] = 5; } return 1; } CMD:stoprobbery(playerid, params[]) { if(PlayerInfo[playerid][pRobbingBiz] < 0) { return SendClientMessage(playerid, COLOR_GREY, "You aren't actively robbing a business."); } if(GetInsideBusiness(playerid) != PlayerInfo[playerid][pRobbingBiz]) { return SendClientMessage(playerid, COLOR_GREY, "You aren't inside the business you were robbing."); } PlayerInfo[playerid][pRobbingBiz] = -1; PlayerInfo[playerid][pCP] = CHECKPOINT_ROBBERY; SendClientMessageEx(playerid, COLOR_AQUA, "You have robbed a total of %s. You need to get this cash immediately to the {FF6347}marker{33CCFF} before the cops catch you!", FormatNumber(PlayerInfo[playerid][pRobCash])); SetPlayerCheckpoint(playerid, 1429.9939, 1066.9581, 9.8938, 3.0); return 1; } CMD:robbank(playerid, params[]) { new count; if(PlayerInfo[playerid][pLevel] < 7) { return SendClientMessage(playerid, COLOR_GREY, "You must be at least level 7+ to use this command."); } if(!IsPlayerInRangeOfPoint(playerid, 20.0, -180.1077,1132.3331,-19.6455)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the bank."); } if(RobberyInfo[rTime] > 0) { return SendClientMessageEx(playerid, COLOR_GREY, "The bank can be robbed again in %i hours. You can't rob it now.", RobberyInfo[rTime]); } if(RobberyInfo[rPlanning]) { return SendClientMessage(playerid, COLOR_GREY, "There is a bank robbery being planned already. Ask the leader to join."); } if(RobberyInfo[rStarted]) { return SendClientMessage(playerid, COLOR_GREY, "You can't rob the bank as a robbery has already started."); } if(IsLawEnforcement(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't rob the bank as a law enforcer. Ask your boss for a raise."); } foreach(new i : Player) { if(IsLawEnforcement(i) && !PlayerInfo[i][pAdminDuty]) { count++; } } if(count < 5) { return SendClientMessage(playerid, COLOR_GREY, "There needs to be at least 5+ LEO online in order to rob the bank."); } RobberyInfo[rRobbers][0] = playerid; RobberyInfo[rPlanning] = 1; PlayerInfo[playerid][pCP] = CHECKPOINT_MISC; SetPlayerCheckpoint(playerid, 1677.2610, -987.6659, 671.1152, 2.0); SendClientMessage(playerid, COLOR_AQUA, "You have setup a {FF6347}bank robbery{33CCFF}. You need to /robinvite at least 2 more people in order to begin the heist."); SendClientMessage(playerid, COLOR_AQUA, "After you've found two additional heisters, you can use /bombvault at the checkpoint to blow the vault."); return 1; } CMD:robinvite(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /robinvite [playerid]"); } if(!(RobberyInfo[rPlanning] && RobberyInfo[rRobbers][0] == playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You are currently not planning a bank robbery."); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command on yourself."); } if(IsPlayerInBankRobbery(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "That player is already in the robbery with you."); } if(GetBankRobbers() >= MAX_BANK_ROBBERS) { return SendClientMessageEx(playerid, COLOR_GREY, "You can't have more than %i bank robbers in this robbery.", MAX_BANK_ROBBERS); } if(IsLawEnforcement(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't invite law enforcement to rob the bank."); } PlayerInfo[targetid][pRobberyOffer] = playerid; SendClientMessageEx(targetid, COLOR_AQUA, "** %s has invited you to a bank robbery. (/accept robbery)", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have invited %s to join your bank robbery.", GetPlayerRPName(targetid)); return 1; } CMD:bombvault(playerid, params[]) { if(RobberyInfo[rPlanning] == 0 && RobberyInfo[rRobbers][0] != playerid) { return SendClientMessage(playerid, COLOR_GREY, "You are currently not planning a bank robbery."); } if(GetBankRobbers() < 3) { return SendClientMessage(playerid, COLOR_GREY, "You need at least two other heisters in your robbery."); } if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1677.2610, -987.6659, 671.1152)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the vault."); } if(IsValidDynamicObject(RobberyInfo[rObjects][1])) { return SendClientMessage(playerid, COLOR_GREY, "The vault is already being bombed at the moment."); } RobberyInfo[rObjects][1] = CreateDynamicObject(1654, 1677.787475, -988.009765, 671.625366, 0.000000, 0.000000, 180.680709); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s firmly plants an explosive on the vault door.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_WHITE, "** Bomb planted. Shoot at the bomb to blow that sumbitch' up!"); return 1; } CMD:lootbox(playerid, params[]) { if(!IsPlayerInBankRobbery(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in an active bank robbery."); } if(!RobberyInfo[rStarted]) { return SendClientMessage(playerid, COLOR_GREY, "The bank robbery hasn't started yet."); } if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1680.2344, -994.6146, 671.0032) && !IsPlayerInRangeOfPoint(playerid, 3.0, 1680.2335, -998.6115, 671.0032) && !IsPlayerInRangeOfPoint(playerid, 3.0, 1680.2344, -1002.5356, 671.0032) && !IsPlayerInRangeOfPoint(playerid, 3.0, 1674.2708, -998.4954, 671.0032) && !IsPlayerInRangeOfPoint(playerid, 3.0, 1674.2708, -994.5173, 671.0032)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the deposit boxes."); } if(PlayerInfo[playerid][pLootTime] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are already looting a deposit box."); } if(PlayerInfo[playerid][pRobCash] >= 100000) { return SendClientMessage(playerid, COLOR_GREY, "Your pockets can't hold more than $100,000 of money!"); } if(!IsPlayerInBankRobbery(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of this bank robbery."); } PlayerInfo[playerid][pLootTime] = 5; ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 4.1, 1, 0, 0, 0, 0, 1); GameTextForPlayer(playerid, "~w~Looting deposit box...", 5000, 3); return 1; } CMD:robbers(playerid, params[]) { if(!RobberyInfo[rStarted] && !IsPlayerInBankRobbery(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "There is no bank robbery currently active."); } SendClientMessage(playerid, COLOR_NAVYBLUE, "______ Robbers Alive ______"); foreach(new i : Player) { if(IsPlayerInBankRobbery(i)) { SendClientMessageEx(playerid, COLOR_GREY2, "(ID: %i) %s {00AA00}(%s stolen)", i, GetPlayerRPName(i), FormatNumber(PlayerInfo[i][pRobCash])); } } return 1; } CMD:motd(playerid, params[]) { if(!isnull(gServerMOTD)) { SendClientMessageEx(playerid, COLOR_YELLOW, "** MOTD: %s", gServerMOTD); } if(!isnull(adminMOTD) && PlayerInfo[playerid][pAdmin] > 0) { SendClientMessageEx(playerid, COLOR_LIGHTRED, "** Admin MOTD: %s", adminMOTD); } if(!isnull(helperMOTD) && (PlayerInfo[playerid][pHelper] > 0 || PlayerInfo[playerid][pAdmin] > 0)) { SendClientMessageEx(playerid, COLOR_AQUA, "** Helper MOTD: %s", helperMOTD); } if(PlayerInfo[playerid][pGang] >= 0 && strcmp(GangInfo[PlayerInfo[playerid][pGang]][gMOTD], "None", true) != 0) { SendClientMessageEx(playerid, COLOR_YELLOW, "** Gang MOTD: %s", GangInfo[PlayerInfo[playerid][pGang]][gMOTD]); } if(PlayerInfo[playerid][pFaction] >= 0 && strcmp(FactionInfo[PlayerInfo[playerid][pFaction]][fMOTD], "None", true) != 0) { SendClientMessageEx(playerid, COLOR_YELLOW, "** Faction MOTD: %s", FactionInfo[PlayerInfo[playerid][pFaction]][fMOTD]); } return 1; } // LEONE - ERROR ALERT, STILL WORKING ON THIS. CMD:createlocation(playerid, params[]) { new name[32], Float:x, Float:y, Float:z; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[32]", name)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /createlocation [name]"); SendClientMessage(playerid, COLOR_WHITE, "** NOTE: The location will be created at the coordinates you are standing on."); return 1; } if(GetPlayerInterior(playerid) != 0 || GetPlayerVirtualWorld(playerid) != 0) { return SendClientMessage(playerid, COLOR_GREY, "Your virtual world & interior must be 0!"); } GetPlayerPos(playerid, x, y, z); for(new i = 0; i < MAX_LOCATIONS; i ++) { if(!LocationInfo[i][locExists]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO locations VALUES(null, '%e', '%f', '%f', '%f')", name, x, y, z); mysql_tquery(connectionID, queryBuffer, "OnAdminCreateLocation", "iisfff", playerid, i, name, x, y, z); return 1; } } SendClientMessage(playerid, COLOR_GREY, "Location slots are currently full. Ask developers to increase the internal limit."); return 1; } CMD:createatm(playerid, params[]) { new Float:x, Float:y, Float:z, Float:a; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "s[32]", "confirm")) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /createatm [confirm]"); SendClientMessage(playerid, COLOR_WHITE, "** NOTE: The ATM will be created at the coordinates you are standing on."); return 1; } if(GetPlayerInterior(playerid) != 0 || GetPlayerVirtualWorld(playerid) != 0) { return SendClientMessage(playerid, COLOR_GREY, "Your virtual world & interior must be 0!"); } GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, a); for(new i = 0; i < MAX_ATMS; i ++) { if(!AtmInfo[i][aExists]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO atms VALUES(null, '%f', '%f', '%f', '%f')", x, y, z, a); mysql_tquery(connectionID, queryBuffer, "OnAdminCreateAtm", "iiffff", playerid, i, x, y, z, a); return 1; } } SendClientMessage(playerid, COLOR_GREY, "ATM slots are currently full. Ask developers to increase the internal limit."); return 1; } CMD:removeatm(playerid, params[]) { new loc; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", loc)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removeatm [atmid] (/nearest)"); } if(!(0 <= loc < MAX_ATMS) || !AtmInfo[loc][aExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid ATM or Static."); } DestroyDynamic3DTextLabel(AtmInfo[loc][aText]); DestroyDynamicObject(AtmInfo[loc][aObject]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM atms WHERE id = %i", AtmInfo[loc][aID]); mysql_tquery(connectionID, queryBuffer); AtmInfo[loc][aExists] = false; AtmInfo[loc][aID] = 0; SendClientMessageEx(playerid, COLOR_AQUA, "** You have removed ATM %i.", loc); return 1; } CMD:removelocation(playerid, params[]) { new loc; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", loc)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removelocation [locationid]"); } if(!(0 <= loc < MAX_LOCATIONS) || !LocationInfo[loc][locExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid location."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM locations WHERE id = %i", LocationInfo[loc][locID]); mysql_tquery(connectionID, queryBuffer); LocationInfo[loc][locName][0] = EOS; LocationInfo[loc][locExists] = false; LocationInfo[loc][locID] = 0; SendClientMessageEx(playerid, COLOR_AQUA, "** You have removed location %i.", loc); return 1; } CMD:createlocker(playerid, params[]) { new factionid, Float:x, Float:y, Float:z; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pFactionMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", factionid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /createlocker [factionid]"); } if(!(0 <= factionid < MAX_FACTIONS) || FactionInfo[factionid][fType] == FACTION_NONE) { return SendClientMessage(playerid, COLOR_GREY, "Invalid faction."); } GetPlayerPos(playerid, x, y, z); for(new i = 0; i < MAX_LOCKERS; i ++) { if(!LockerInfo[i][lExists]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO factionlockers (factionid, pos_x, pos_y, pos_z, interior, world) VALUES(%i, '%f', '%f', '%f', %i, %i)", factionid, x, y, z, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid)); mysql_tquery(connectionID, queryBuffer, "OnAdminCreateLocker", "iiifffii", playerid, i, factionid, x, y, z, GetPlayerInterior(playerid), GetPlayerVirtualWorld(playerid)); return 1; } } SendClientMessage(playerid, COLOR_GREY, "Locker slots are currently full. Ask developers to increase the internal limit."); return 1; } CMD:editland(playerid, params[]) { new landid, option[32], param[32]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pDynamicAdmin]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[32]S()[32]", landid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editland [landid] [option]"); SendClientMessage(playerid, COLOR_GREY, "OPTIONS: Price, Level, Height, Owner"); return 1; } if(!strcmp(option, "price", true)) { new value; if(sscanf(param, "i", value)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editland [%i] [%s] [value]", landid, option); } if(!(1<= value <= 100000000)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "Value cannot be less than 1 or more than 100M"); } LandInfo[landid][lPrice] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE lands SET price = %i WHERE id = %i", value, LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You set land %i's price to %i.", landid, value); ReloadLand(landid); } else if(!strcmp(option, "level", true)) { new value; if(sscanf(param, "i", value)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editland [%i] [%s] [value]", landid, option); } if(!(1 <= value <= 3)) { return SendClientMessage(playerid, COLOR_SYNTAX, "Land levels cannot be below 0 or more than 3"); } LandInfo[landid][lLevel] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE lands SET level = %i WHERE id = %i", value, LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You set land %i's price to %i.", landid, value); ReloadLand(landid); } else if(!strcmp(option, "height", true)) { if(sscanf(param, "s", "confirm")) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editland [%i] [%s] [confirm]", landid, option); } new Float:zCoord[2]; GetPlayerPos(playerid, zCoord[0], zCoord[0], zCoord[1]); LandInfo[landid][lHeight] = zCoord[1] + 1.0; // LandInfo[landid][lPickup] = zCoord[1]; We need this, land pickup, when you create a land at height it will create a pickup like house pickup. mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE lands SET height = %f WHERE id = %i", zCoord[1], LandInfo[landid][lID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have land %i's Z (height) pos to your current Z (height) Pos (%f).", landid, zCoord[1]); ReloadLand(landid); } else if(!strcmp(option, "owner", true)) { new targetid; if(sscanf(param, "u", targetid)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editland [%i] [%s] [value]", landid, option); } SetLandOwner(landid, targetid); SendClientMessageEx(playerid, COLOR_AQUA, "** You set land %i's owner to %s.", landid, GetPlayerRPName(targetid)); ReloadLand(landid); } return 1; } CMD:editlocker(playerid, params[]) { new lockerid, option[32], param[32]; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pFactionMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "is[32]S()[32]", lockerid, option, param)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editlocker [lockerid] [option]"); SendClientMessage(playerid, COLOR_GREY, "OPTIONS: Position, FactionID, Icon, Label, Weapons"); return 1; } if(!(0 <= lockerid < MAX_LOCKERS) || !LockerInfo[lockerid][lExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid locker."); } if(!strcmp(option, "position", true)) { GetPlayerPos(playerid, LockerInfo[lockerid][lPosX], LockerInfo[lockerid][lPosY], LockerInfo[lockerid][lPosZ]); LockerInfo[lockerid][lInterior] = GetPlayerInterior(playerid); LockerInfo[lockerid][lWorld] = GetPlayerVirtualWorld(playerid); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET pos_x = '%f', pos_y = '%f', pos_z = '%f', interior = %i, world = %i WHERE id = %i", LockerInfo[lockerid][lPosX], LockerInfo[lockerid][lPosY], LockerInfo[lockerid][lPosZ], LockerInfo[lockerid][lInterior], LockerInfo[lockerid][lWorld], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You have moved locker %i to your position.", lockerid); ReloadLocker(lockerid); } else if(!strcmp(option, "factionid", true)) { new value; if(sscanf(param, "i", value)) { return SendClientMessageEx(playerid, COLOR_SYNTAX, "USAGE: /editlocker [%i] [%s] [value]", lockerid, option); } LockerInfo[lockerid][lFaction] = value; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET factionid = %i WHERE id = %i", LockerInfo[lockerid][lFaction], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_AQUA, "** You set locker %i's faction to %i.", lockerid, value); ReloadLocker(lockerid); } else if(!strcmp(option, "icon", true)) { new iconid; if(sscanf(param, "i", iconid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editlocker [lockerid] [icon] [iconid (19300 = hide)]"); } if(!IsValidModel(iconid)) { return SendClientMessage(playerid, COLOR_GREY, "Invalid model ID."); } LockerInfo[lockerid][lIcon] = iconid; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET iconid = %i WHERE id = %i", LockerInfo[lockerid][lIcon], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); ReloadLocker(lockerid); SendClientMessageEx(playerid, COLOR_AQUA, "** You've changed the pickup icon model of locker %i to %i.", lockerid, iconid); } else if(!strcmp(option, "label", true)) { new status; if(sscanf(param, "i", status) || !(0 <= status <= 1)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editlocker [lockerid] [label] [0/1]"); } LockerInfo[lockerid][lLabel] = status; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET label = %i WHERE id = %i", LockerInfo[lockerid][lLabel], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); ReloadLocker(lockerid); if(status) SendClientMessageEx(playerid, COLOR_AQUA, "** You've enabled the 3D text label for locker %i.", lockerid); else SendClientMessageEx(playerid, COLOR_AQUA, "** You've disabled the 3D text label for locker %i.", lockerid); } else if(!strcmp(option, "weapons", true)) { if(FactionInfo[LockerInfo[lockerid][lFaction]][fType] == FACTION_HITMAN) { return SendClientMessage(playerid, COLOR_GREY, "Weapons for hitman agency lockers cannot be edited in-game."); } new inputtext[24], opt2[8], amount; if(sscanf(param, "s[24]s[8]i", inputtext, opt2, amount)) { SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /editlocker [lockerid] [weapons] [weaponname] [option] [amount]"); SendClientMessage(playerid, COLOR_GREEN, "Weapon Name: Kevlar, Medkit, Nitestick, Mace, Deagle, Shotgun, M4, MP5, Sniper, Camera, FireExt, Painkillers"); SendClientMessage(playerid, COLOR_YELLOW, "Options: Allow, Price"); SendClientMessage(playerid, COLOR_ORANGE, "Amount: Price (amount), Allow (1 or 0)"); return 1; } if(!strcmp(opt2, "allow", true)) { if(!(0 <= amount <= 1)) return SendClientMessage(playerid, COLOR_GREY, "Amount can be 1 or 0"); if(!strcmp(inputtext, "Kevlar", true)) { LockerInfo[lockerid][locKevlar][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_kevlar = %i WHERE id = %i", LockerInfo[lockerid][locKevlar][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Medkit", true)) { LockerInfo[lockerid][locMedKit][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_medkit = %i WHERE id = %i", LockerInfo[lockerid][locMedKit][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Nitestick", true)) { LockerInfo[lockerid][locNitestick][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_nitestick = %i WHERE id = %i", LockerInfo[lockerid][locNitestick][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Mace", true)) { LockerInfo[lockerid][locMace][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_mace = %i WHERE id = %i", LockerInfo[lockerid][locMace][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Deagle", true)) { LockerInfo[lockerid][locDeagle][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_deagle = %i WHERE id = %i", LockerInfo[lockerid][locDeagle][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Shotgun", true)) { LockerInfo[lockerid][locShotgun][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_shotgun = %i WHERE id = %i", LockerInfo[lockerid][locShotgun][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "MP5", true)) { LockerInfo[lockerid][locMP5][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_mp5 = %i WHERE id = %i", LockerInfo[lockerid][locMP5][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "M4", true)) { LockerInfo[lockerid][locM4][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_m4 = %i WHERE id = %i", LockerInfo[lockerid][locM4][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Sniper", true)) { LockerInfo[lockerid][locSniper][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_sniper = %i WHERE id = %i", LockerInfo[lockerid][locSniper][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Camera", true)) { LockerInfo[lockerid][locCamera][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_camera = %i WHERE id = %i", LockerInfo[lockerid][locCamera][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "FireExt", true)) { LockerInfo[lockerid][locFireExt][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_fire_extinguisher = %i WHERE id = %i", LockerInfo[lockerid][locFireExt][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Painkillers", true)) { LockerInfo[lockerid][locPainKillers][0] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET weapon_painkillers = %i WHERE id = %i", LockerInfo[lockerid][locPainKillers][0], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } SendClientMessageEx(playerid, COLOR_GREY, "Locker %i's %s status set to %i", lockerid, inputtext, amount); } else if(!strcmp(opt2, "price", true)) { if(!strcmp(inputtext, "Kevlar", true)) { LockerInfo[lockerid][locKevlar][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_kevlar = %i WHERE id = %i", LockerInfo[lockerid][locKevlar], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Medkit", true)) { LockerInfo[lockerid][locMedKit][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_medkit = %i WHERE id = %i", LockerInfo[lockerid][locMedKit], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Nitestick", true)) { LockerInfo[lockerid][locNitestick][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_nitestick = %i WHERE id = %i", LockerInfo[lockerid][locNitestick][1], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Mace", true)) { LockerInfo[lockerid][locMace][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_mace = %i WHERE id = %i", LockerInfo[lockerid][locMace][1], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Deagle", true)) { LockerInfo[lockerid][locDeagle][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_deagle = %i WHERE id = %i", LockerInfo[lockerid][locDeagle][1], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Shotgun", true)) { LockerInfo[lockerid][locShotgun][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_shotgun = %i WHERE id = %i", LockerInfo[lockerid][locShotgun][1], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "MP5", true)) { LockerInfo[lockerid][locMP5][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_mp5 = %i WHERE id = %i", LockerInfo[lockerid][locMP5][1], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "M4", true)) { LockerInfo[lockerid][locM4][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_m4 = %i WHERE id = %i", LockerInfo[lockerid][locM4][1], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Sniper", true)) { LockerInfo[lockerid][locSniper][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_sniper = %i WHERE id = %i", LockerInfo[lockerid][locSniper][1], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Camera", true)) { LockerInfo[lockerid][locCamera][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_camera = %i WHERE id = %i", LockerInfo[lockerid][locCamera][1], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "FireExt", true)) { LockerInfo[lockerid][locFireExt][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_fire_extinguisher = %i WHERE id = %i", LockerInfo[lockerid][locFireExt][1], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } else if(!strcmp(inputtext, "Painkillers", true)) { LockerInfo[lockerid][locPainKillers][1] = amount; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE factionlockers SET price_painkillers = %i WHERE id = %i", LockerInfo[lockerid][locPainKillers][1], LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); } SendClientMessageEx(playerid, COLOR_GREY, "Locker %i's %s price set to %i", lockerid, inputtext, amount); } } return 1; } CMD:removelocker(playerid, params[]) { new lockerid; if(PlayerInfo[playerid][pAdmin] < 7 && !PlayerInfo[playerid][pFactionMod]) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "i", lockerid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /removelocker [lockerid]"); } if(!(0 <= lockerid < MAX_LOCKERS) || !LockerInfo[lockerid][lExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid locker."); } DestroyDynamic3DTextLabel(LockerInfo[lockerid][lText]); DestroyDynamicPickup(LockerInfo[lockerid][lPickup]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "DELETE FROM factionlockers WHERE id = %i", LockerInfo[lockerid][lID]); mysql_tquery(connectionID, queryBuffer); LockerInfo[lockerid][lExists] = 0; LockerInfo[lockerid][lID] = 0; SendClientMessageEx(playerid, COLOR_AQUA, "** You have removed locker %i.", lockerid); return 1; } CMD:gotolocker(playerid, params[]) { new lockerid; if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(!PlayerInfo[playerid][pAdminDuty] && PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "This command requires you to be on admin duty. /aduty to go on duty."); } if(sscanf(params, "i", lockerid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /gotolocker [lockerid]"); } if(!(0 <= lockerid < MAX_LOCKERS) || !LockerInfo[lockerid][lExists]) { return SendClientMessage(playerid, COLOR_GREY, "Invalid locker."); } GameTextForPlayer(playerid, "~w~Teleported", 5000, 1); SetPlayerPos(playerid, LockerInfo[lockerid][lPosX], LockerInfo[lockerid][lPosY], LockerInfo[lockerid][lPosZ]); SetPlayerInterior(playerid, LockerInfo[lockerid][lInterior]); SetPlayerVirtualWorld(playerid, LockerInfo[lockerid][lWorld]); SetCameraBehindPlayer(playerid); return 1; } CMD:namehistory(playerid, params[]) { new targetid; if(PlayerInfo[playerid][pAdmin] < 3) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /namehistory [playerid]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM log_namehistory WHERE uid = %i ORDER BY id DESC", PlayerInfo[targetid][pID]); mysql_tquery(connectionID, queryBuffer, "OnAdminCheckNameHistory", "ii", playerid, targetid); return 1; } CMD:unmute(playerid, params[]) { new string[128]; if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /unmute [newbie | report | global]"); } if(!strcmp(params, "newbie", true)) { if(!PlayerInfo[playerid][pNewbieMuted]) { return SendClientMessage(playerid, COLOR_GREY, "You are not muted from the newbie chat."); } if(PlayerInfo[playerid][pNewbieMuteTime] > gettime()) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to wait at least %i minutes before requesting an unmute.", (PlayerInfo[playerid][pNewbieMuteTime] - gettime()) / 60); } format(string, sizeof(string), "Fine ($%i)\n10 Minute Jail", percent(PlayerInfo[playerid][pCash]+PlayerInfo[playerid][pBank], 5)); ShowPlayerDialog(playerid, DIALOG_NEWBIEUNMUTE, DIALOG_STYLE_LIST, "Choose your punishment for this unmute.", string, "Select", "Cancel"); } else if(!strcmp(params, "report", true)) { if(!PlayerInfo[playerid][pReportMuted]) { return SendClientMessage(playerid, COLOR_GREY, "You are not muted from submitting reports."); } if(PlayerInfo[playerid][pReportMuted] <= 12) { return SendClientMessageEx(playerid, COLOR_GREY, "Your report mute is not indefinite and expires in %i playing hours.", PlayerInfo[playerid][pReportMuted]); } if(PlayerInfo[playerid][pReportMuteTime] > gettime()) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to wait at least %i minutes before requesting an unmute.", (PlayerInfo[playerid][pReportMuteTime] - gettime()) / 60); } format(string, sizeof(string), "Fine ($%i)\n10 Minute Jail", percent(PlayerInfo[playerid][pCash]+PlayerInfo[playerid][pBank], 5)); ShowPlayerDialog(playerid, DIALOG_REPORTUNMUTE, DIALOG_STYLE_LIST, "Choose your punishment for this unmute.", string, "Select", "Cancel"); } else if(!strcmp(params, "global", true)) { if(!PlayerInfo[playerid][pGlobalMuted]) { return SendClientMessage(playerid, COLOR_GREY, "You are not muted from the global chat."); } if(PlayerInfo[playerid][pGlobalMuteTime] > gettime()) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to wait at least %i minutes before requesting an unmute.", (PlayerInfo[playerid][pGlobalMuteTime] - gettime()) / 60); } format(string, sizeof(string), "Fine ($%i)\n10 Minute Jail", percent(PlayerInfo[playerid][pCash]+PlayerInfo[playerid][pBank], 5)); ShowPlayerDialog(playerid, DIALOG_GLOBALUNMUTE, DIALOG_STYLE_LIST, "Choose your punishment for this unmute.", string, "Select", "Cancel"); } return 1; } CMD:ahide(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 6) { return 0; } if(!PlayerInfo[playerid][pAdminHide]) { PlayerInfo[playerid][pAdminHide] = 1; SendClientMessage(playerid, COLOR_AQUA, "You are now hidden in /admins and your admin rank no longer shows in /a, /g or /o."); } else { PlayerInfo[playerid][pAdminHide] = 0; SendClientMessage(playerid, COLOR_AQUA, "You are no longer hidden as an administrator."); } return 1; } CMD:lockpick(playerid, params[]) { new vehicleid = GetNearbyVehicle(playerid); if(PlayerInfo[playerid][pTazedTime] > 0 || PlayerInfo[playerid][pInjured] > 0 || PlayerInfo[playerid][pHospital] > 0 || PlayerInfo[playerid][pCuffed] > 0 || PlayerInfo[playerid][pTied] > 0 || PlayerInfo[playerid][pJoinedEvent] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command at the moment."); } if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command from within the vehicle."); } if(vehicleid == INVALID_VEHICLE_ID) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of any vehicle."); } if(VehicleInfo[vehicleid][vOwnerID] == 0) { return SendClientMessage(playerid, COLOR_GREY, "You may only break into a player owned vehicle."); } if(VehicleInfo[vehicleid][vLocked] == 0) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle is unlocked. Therefore you can't break into it."); } if(PlayerInfo[playerid][pLockBreak] == vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You are already attempting to break into this vehicle."); } /*if(!VehicleHasDoors(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle cannot be broken into."); }*/ if(IsVehicleOwner(playerid, vehicleid)) { //return SendClientMessage(playerid, COLOR_GREY, "Why would you want to break into your own vehicle?"); } if(IsVehicleBeingPicked(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle is already being broken into by someone else."); } PlayerInfo[playerid][pLockBreak] = vehicleid; PlayerInfo[playerid][pLockHealth] = 1000.0; SendClientMessage(playerid, COLOR_AQUA, "You have started the {FF6347}break-in{33CCFF} process. Start hitting the driver or passenger side door to break it down."); SendClientMessage(playerid, COLOR_AQUA, "You can use your fists for this job, however melee weapons are preferred and gets the job done faster."); return 1; } CMD:dropcar(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!PlayerHasJob(playerid, JOB_THIEF)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command unless you're a Thief."); } if(PlayerInfo[playerid][pThiefCooldown] > 0) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to wait %i more seconds before dropping off another car.", PlayerInfo[playerid][pThiefCooldown]); } if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle."); } if(IsVehicleOwner(playerid, vehicleid) || PlayerInfo[playerid][pVehicleKeys] == vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You can't drop off a vehicle that belongs to you."); } if(!GetVehicleCranePrice(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle isn't worth anything. Therefore you can't sell it."); } if(PlayerInfo[playerid][pCP] != CHECKPOINT_NONE) { return SendClientMessage(playerid, COLOR_GREY, "You have an active checkpoint already. /killcp to cancel it."); } if(VehicleInfo[vehicleid][vID] > 0 && IsPointInRangeOfPoint(VehicleInfo[vehicleid][vPosX], VehicleInfo[vehicleid][vPosY], VehicleInfo[vehicleid][vPosZ], 600.0, 2695.8010, -2226.6643, 13.5501)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle is parked too close to the crane."); } if(!IsPlayerInRangeOfPoint(playerid, 300.0, 2695.8010, -2226.6643, 13.5501)) { PlayerInfo[playerid][pDropTime] = gettime(); } PlayerInfo[playerid][pCP] = CHECKPOINT_DROPCAR; SendClientMessage(playerid, COLOR_AQUA, "Navigate to the {FF6347}checkpoint{33CCFF} at the crane to drop off your vehicle."); SetPlayerCheckpoint(playerid, 2695.8010, -2226.6643, 13.5501, 5.0); return 1; } CMD:carvalue(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!PlayerHasJob(playerid, JOB_THIEF)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command unless you're a Thief."); } if(!vehicleid) { return SendClientMessage(playerid, COLOR_GREY, "You need to be in a vehicle to use this command."); } if(IsVehicleOwner(playerid, vehicleid) || PlayerInfo[playerid][pVehicleKeys] == vehicleid) { //return SendClientMessage(playerid, COLOR_GREY, "This vehicle belongs to you. It's not worth anything."); } if(!GetVehicleCranePrice(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle isn't worth anything."); } SendClientMessage(playerid, COLOR_NAVYBLUE, "_____ Car Value _____"); SendClientMessageEx(playerid, COLOR_GREY2, "Name: %s", GetVehicleName(vehicleid)); if(GetVehicleCranePrice(vehicleid, false) == GetVehicleCranePrice(vehicleid)) { SendClientMessageEx(playerid, COLOR_GREY2, "Value: {00AA00}$%i", GetVehicleCranePrice(vehicleid)); } else { SendClientMessageEx(playerid, COLOR_GREY2, "Value: {00AA00}$%i", GetVehicleCranePrice(vehicleid, false)); if(VehicleInfo[vehicleid][vOwnerID] > 0) { if(VehicleInfo[vehicleid][vNeon] != 0) { SendClientMessage(playerid, COLOR_GREY2, "Neon: {00AA00}+$1000"); } if(VehicleInfo[vehicleid][vAlarm] != 0) { SendClientMessageEx(playerid, COLOR_GREY2, "Alarm: {00AA00}+$%i", VehicleInfo[vehicleid][vAlarm] * 500); } if(VehicleInfo[vehicleid][vTrunk] != 0) { SendClientMessageEx(playerid, COLOR_GREY2, "Trunk: {00AA00}+$%i", VehicleInfo[vehicleid][vTrunk] * 250); } if(strcmp(VehicleInfo[vehicleid][vPlate], "None") != 0) { SendClientMessage(playerid, COLOR_GREY2, "Plate: {00AA00}+$750"); } } SendClientMessageEx(playerid, COLOR_GREY2, "Total Value: {00AA00}$%i", GetVehicleCranePrice(vehicleid)); } return 1; } CMD:cracktrunk(playerid, params[]) { new vehicleid = GetNearbyVehicle(playerid); if(!PlayerHasJob(playerid, JOB_THIEF)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command unless you're a Thief."); } if(PlayerInfo[playerid][pCocaineCooldown] > 0) { return SendClientMessageEx(playerid, COLOR_GREY, "You need to wait %i more seconds before cracking into another trunk.", PlayerInfo[playerid][pCocaineCooldown]); } if(vehicleid == INVALID_VEHICLE_ID || !IsPlayerInRangeOfBoot(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You need to be close to a vehicle's trunk."); } if(IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command from inside the vehicle."); } if(IsVehicleOwner(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't crack the trunk on your own vehicle."); } if(VehicleInfo[vehicleid][vOwnerID] == 0) { return SendClientMessage(playerid, COLOR_GREY, "You can only crack into a player owned vehicle's trunk."); } if(VehicleInfo[vehicleid][vLocked]) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle is locked. /lockpick to attempt to unlock it."); } if(PlayerInfo[playerid][pCocaineTrunk] != INVALID_VEHICLE_ID) { return SendClientMessage(playerid, COLOR_GREY, "You are already cracking a trunk at the moment. Leave the area to cancel."); } switch(GetJobLevel(playerid, JOB_THIEF)) { case 1: PlayerInfo[playerid][pCocaineTime] = 60; case 2: PlayerInfo[playerid][pCocaineTime] = 50; case 3: PlayerInfo[playerid][pCocaineTime] = 40; case 4: PlayerInfo[playerid][pCocaineTime] = 30; case 5: PlayerInfo[playerid][pCocaineTime] = 20; } PlayerInfo[playerid][pCocaineTrunk] = vehicleid; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s begins to pry open the trunk of the %s.", GetPlayerRPName(playerid), GetVehicleName(vehicleid)); SendClientMessageEx(playerid, COLOR_WHITE, "** This will take about %i seconds. Do not move during the process.", PlayerInfo[playerid][pCocaineTime]); return 1; } CMD:achievements(playerid, params[]) { mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT * FROM achievements WHERE uid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer, "OnQueryFinished", "ii", THREAD_LIST_ACHIEVEMENTS, playerid); return 1; } CMD:buyinsurance(playerid, params[]) { if(!IsPlayerInRangeOfPoint(playerid, 3.0, -28.2710, 151.3092, 999.0621)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in any of the hospitals."); } if(PlayerInfo[playerid][pCash] < 2000) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford insurance."); } switch(GetPlayerVirtualWorld(playerid)) { case HOSPITAL_COUNTY: { if(PlayerInfo[playerid][pInsurance] == HOSPITAL_COUNTY) { return SendClientMessage(playerid, COLOR_GREY, "You are already insured at this hospital."); } GivePlayerCash(playerid, -2000); GameTextForPlayer(playerid, "~r~-$2000", 5000, 1); SendClientMessage(playerid, COLOR_AQUA, "You paid $2000 for insurance at {FF8282}Fort Carson\nMedical Center{33CCFF}. You will now spawn here after death."); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET insurance = %i WHERE uid = %i", HOSPITAL_COUNTY, PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerInfo[playerid][pInsurance] = HOSPITAL_COUNTY; } } return 1; } CMD:tie(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /tie [playerid]"); } if(PlayerInfo[playerid][pRope] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "You don't have any ropes left."); } if(!IsPlayerInAnyVehicle(playerid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of any vehicle."); } if(!IsPlayerConnected(targetid) || !IsPlayerInVehicle(targetid, GetPlayerVehicleID(playerid))) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected, or is not in your vehicle."); } if(GetPlayerState(targetid) == PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You can't tie up the driver."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't tie yourself."); } if(PlayerInfo[targetid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "That player is already tied. /untie to free them."); } if(PlayerInfo[targetid][pAcceptedHelp]) { return SendClientMessage(playerid, COLOR_GREY, "You can't tie a helper who is assisting someone."); } if(PlayerInfo[targetid][pAdminDuty]) { return SendClientMessage(playerid, COLOR_GREY, "You can't tie an on duty administrator."); } if(PlayerInfo[playerid][pHurt]) { return SendClientMessageEx(playerid, COLOR_GREY, "You're too hurt to tie anyone. Please wait %i seconds before trying again.", PlayerInfo[playerid][pHurt]); } PlayerInfo[playerid][pRope]--; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET rope = %i WHERE uid = %i", PlayerInfo[playerid][pRope], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); GameTextForPlayer(targetid, "~r~Tied", 3000, 3); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s ties %s with a rope.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); TogglePlayerControllable(targetid, 0); PlayerInfo[targetid][pTied] = 1; return 1; } CMD:untie(playerid, params[]) { new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /untie [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 5.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't untie yourself."); } if(!PlayerInfo[targetid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "That player is not tied."); } if(IsPlayerInAnyVehicle(targetid) && !IsPlayerInVehicle(playerid, GetPlayerVehicleID(targetid))) { return SendClientMessage(playerid, COLOR_GREY, "You must be in that player's vehicle in order to untie them."); } if(PlayerInfo[playerid][pHurt]) { return SendClientMessageEx(playerid, COLOR_GREY, "You're too hurt to untie anyone. Please wait %i seconds before trying again.", PlayerInfo[playerid][pHurt]); } GameTextForPlayer(targetid, "~g~Untied", 3000, 3); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s unties the rope from %s.", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); TogglePlayerControllable(targetid, 1); PlayerInfo[targetid][pTied] = 0; return 1; } CMD:repaircar(playerid, params[]) { new entranceid = GetNearbyEntrance(playerid); if(entranceid == -1 || EntranceInfo[entranceid][eType] != 2) { return SendClientMessage(playerid, COLOR_GREY, "You aren't nearby any repairshops."); } if(EntranceInfo[entranceid][eAdminLevel] && PlayerInfo[playerid][pAdmin] < EntranceInfo[entranceid][eAdminLevel]) { return SendClientMessage(playerid, COLOR_GREY, "Your administrator level is too low to repair here."); } if(EntranceInfo[entranceid][eFactionType] > 0 && GetFactionType(playerid) != EntranceInfo[entranceid][eFactionType]) { return SendClientMessage(playerid, COLOR_GREY, "This command is restricted to a specific faction type."); } if(EntranceInfo[entranceid][eGang] >= 0 && EntranceInfo[entranceid][eGang] != PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "This command is restricted to a specific gang type."); } if(EntranceInfo[entranceid][eVIP] && PlayerInfo[playerid][pVIPPackage] < EntranceInfo[entranceid][eVIP]) { return SendClientMessage(playerid, COLOR_GREY, "This command is restricted to a higher VIP level."); } if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You aren't driving a vehicle."); } RepairVehicle(GetPlayerVehicleID(playerid)); SendClientMessage(playerid, COLOR_GREY, "Your vehicle was repaired."); return 1; } /*CMD:offerduel(playerid, params[]) { new entranceid = GetInsideEntrance(playerid), targetid; if(entranceid == -1 || EntranceInfo[entranceid][eType] != 1) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside of a duel arena."); } if(EntranceInfo[entranceid][eAdminLevel] && PlayerInfo[playerid][pAdmin] < EntranceInfo[entranceid][eAdminLevel]) { return SendClientMessage(playerid, COLOR_GREY, "Your administrator level is too low to initiate duels here."); } if(EntranceInfo[entranceid][eFactionType] > 0 && GetFactionType(playerid) != EntranceInfo[entranceid][eFactionType]) { return SendClientMessage(playerid, COLOR_GREY, "This command is restricted to a specific faction type."); } if(EntranceInfo[entranceid][eGang] >= 0 && EntranceInfo[entranceid][eGang] != PlayerInfo[playerid][pGang]) { return SendClientMessage(playerid, COLOR_GREY, "This command is restricted to a specific gang type."); } if(EntranceInfo[entranceid][eVIP] && PlayerInfo[playerid][pVIPPackage] < EntranceInfo[entranceid][eVIP]) { return SendClientMessage(playerid, COLOR_GREY, "This command is restricted to a higher VIP level."); } if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /offerduel [playerid]"); } if(!IsPlayerConnected(targetid) || !IsPlayerInRangeOfPlayer(playerid, targetid, 15.0)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected or out of range."); } if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't offer to duel with yourself."); } if(PlayerInfo[targetid][pDueling] != INVALID_PLAYER_ID) { return SendClientMessage(playerid, COLOR_GREY, "That player is already in a duel."); } PlayerInfo[targetid][pDuelOffer] = playerid; SendClientMessageEx(targetid, COLOR_AQUA, "** %s has offered you to duel with them. (/accept duel)", GetPlayerRPName(playerid)); SendClientMessageEx(playerid, COLOR_AQUA, "** You have sent %s a duel offer.", GetPlayerRPName(targetid)); return 1; }*/ CMD:gbackup(playerid, params[]) { if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You are not apart of any gang at the moment."); } if(PlayerInfo[playerid][pInjured]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot call for backup when you are dead."); } if(PlayerInfo[playerid][pCuffed]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while cuffed."); } if(PlayerInfo[playerid][pTied]) { return SendClientMessage(playerid, COLOR_GREY, "You cannot use this command while tied."); } if(!PlayerInfo[playerid][pBackup]) { PlayerInfo[playerid][pBackup] = 1; } else { PlayerInfo[playerid][pBackup] = 0; } foreach(new i : Player) { if(PlayerInfo[i][pGang] == PlayerInfo[playerid][pGang]) { if(PlayerInfo[playerid][pBackup]) { SendClientMessageEx(i, COLOR_AQUA, "** %s %s is requesting backup in %s (marked on map). **", GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], GetPlayerRPName(playerid), GetPlayerZoneName(playerid)); SetPlayerMarkerForPlayer(i, playerid, (GangInfo[PlayerInfo[playerid][pGang]][gColor] & ~0xff) + 0xFF); } else { SendClientMessageEx(i, COLOR_AQUA, "** %s %s has cancelled their backup request. **", GangRanks[PlayerInfo[playerid][pGang]][PlayerInfo[playerid][pGangRank]], GetPlayerRPName(playerid), GetPlayerZoneName(playerid)); SetPlayerMarkerForPlayer(i, playerid, GetPlayerColor(playerid)); } } } return 1; } CMD:confirmupgrade(playerid, params[]) { new houseid = PlayerInfo[playerid][pPreviewHouse], type = PlayerInfo[playerid][pPreviewType]; if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You aren't previewing a house interior. '/upgradehouse interior' to begin."); } if(PlayerInfo[playerid][pCash] < houseInteriors[type][intPrice]) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford to upgrade to this interior."); } foreach(new i : Player) { if(GetInsideHouse(i) == houseid) { SetPlayerPos(i, houseInteriors[type][intX], houseInteriors[type][intY], houseInteriors[type][intZ]); SetPlayerFacingAngle(i, houseInteriors[type][intA]); SetPlayerInterior(i, houseInteriors[type][intID]); SetCameraBehindPlayer(i); } } GivePlayerCash(playerid, -houseInteriors[type][intPrice]); HouseInfo[houseid][hType] = type; HouseInfo[houseid][hPrice] = houseInteriors[type][intPrice]; HouseInfo[houseid][hInterior] = houseInteriors[type][intID]; HouseInfo[houseid][hIntX] = houseInteriors[type][intX]; HouseInfo[houseid][hIntY] = houseInteriors[type][intY]; HouseInfo[houseid][hIntZ] = houseInteriors[type][intZ]; HouseInfo[houseid][hIntA] = houseInteriors[type][intA]; PlayerInfo[playerid][pPreviewHouse] = -1; PlayerInfo[playerid][pPreviewType] = 0; PlayerInfo[playerid][pPreviewTime] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE houses SET type = %i, price = %i, int_x = '%f', int_y = '%f', int_z = '%f', int_a = '%f', interior = %i, world = %i WHERE id = %i", type, HouseInfo[houseid][hPrice], HouseInfo[houseid][hIntX], HouseInfo[houseid][hIntY], HouseInfo[houseid][hIntZ], HouseInfo[houseid][hIntA], HouseInfo[houseid][hInterior], HouseInfo[houseid][hWorld], HouseInfo[houseid][hID]); mysql_tquery(connectionID, queryBuffer); SendClientMessageEx(playerid, COLOR_GREEN, "You have upgraded your house to this interior for $%i.", houseInteriors[type][intPrice]); Log_Write("log_property", "%s (uid: %i) upgraded their house interior (id: %i) to interior %i for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], HouseInfo[houseid][hID], type, houseInteriors[type][intPrice]); return 1; } CMD:cancelupgrade(playerid, params[]) { new houseid = PlayerInfo[playerid][pPreviewHouse]; if(houseid == -1 || !IsHouseOwner(playerid, houseid)) { return SendClientMessage(playerid, COLOR_GREY, "You aren't previewing a house interior at the moment."); } SetPlayerPos(playerid, HouseInfo[houseid][hIntX], HouseInfo[houseid][hIntY], HouseInfo[houseid][hIntZ]); SetPlayerFacingAngle(playerid, HouseInfo[houseid][hIntA]); SetPlayerInterior(playerid, HouseInfo[houseid][hInterior]); SetPlayerVirtualWorld(playerid, HouseInfo[houseid][hWorld]); SetCameraBehindPlayer(playerid); PlayerInfo[playerid][pPreviewHouse] = -1; PlayerInfo[playerid][pPreviewType] = 0; PlayerInfo[playerid][pPreviewTime] = 0; SendClientMessage(playerid, COLOR_WHITE, "You have cancelled your interior upgrade. You were returned back to your old one."); return 1; } CMD:giveachievement(playerid, params[]) { new targetid, name[32]; if(PlayerInfo[playerid][pAdmin] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } if(sscanf(params, "us[32]", targetid, name)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /giveachievement [playerid] [name]"); } if(!IsPlayerConnected(targetid)) { return SendClientMessage(playerid, COLOR_GREY, "The player specified is disconnected."); } if(!PlayerInfo[targetid][pLogged]) { return SendClientMessage(playerid, COLOR_GREY, "That player hasn't logged in yet."); } if(!AwardAchievement(targetid, name)) { SendClientMessage(playerid, COLOR_GREY, "Invalid achievement."); } else { SendClientMessageEx(targetid, COLOR_AQUA, "%s has awarded you with the {FF6347}%s{33CCFF} achievement.", GetPlayerRPName(playerid), name); SendClientMessageEx(playerid, COLOR_AQUA, "You have awarded %s with the {FF6347}%s{33CCFF} achievement.", GetPlayerRPName(targetid), name); } return 1; } CMD:vipmusic(playerid, params[]) { if(PlayerInfo[playerid][pVIPPackage] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You must be a donator to use this command!"); } if(isnull(params)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /vipmusic [songname.mp3]"); } if(gettime() - gLastMusic < 300) { return SendClientMessage(playerid, COLOR_GREY, "Music can only be played globally every 5 minutes."); } new url[144]; format(url, sizeof(url), "http://%s/%i/%s", VIP_MUSIC_URL, PlayerInfo[playerid][pID], params); foreach(new i : Player) { if(!PlayerInfo[i][pToggleMusic] && PlayerInfo[i][pStreamType] == MUSIC_NONE) { PlayAudioStreamForPlayer(i, url); } } SendClientMessageToAllEx(COLOR_VIP, "VIP Music: %s VIP %s has started the global playback of %s from their music folder!", GetVIPRank(PlayerInfo[playerid][pVIPPackage]), GetPlayerRPName(playerid), params); gLastMusic = gettime(); return 1; } CMD:kill(playerid, params[]) { new Float:health; GetPlayerHealth(playerid, health); if(PlayerInfo[playerid][pCuffed] == 1) { return SendClientMessage(playerid, COLOR_GREY, "You cannot kill yourself while cuffed!"); } if(PlayerInfo[playerid][pTied] == 1) { return SendClientMessage(playerid, COLOR_GREY, "You cannot kill yourself while tied!"); } if(PlayerInfo[playerid][pJailTime] > 1) { return SendClientMessage(playerid, COLOR_GREY, "You cannot do this while in jail."); } if(PlayerInfo[playerid][pInjured] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You are too injured to attempt suicide!"); } if(health < 15.0) { return SendClientMessage(playerid, COLOR_GREY, "Your health is currently too low to kill yourself."); } switch(GetPlayerWeapon(playerid)) { case 0 .. 21: { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s reaches into their pocket, pulling out a large quantity of pills, swallowing them.", GetPlayerRPName(playerid)); } case 22 .. 24: { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s raises their handgun to their head, pulling the trigger.", GetPlayerRPName(playerid)); } case 25 .. 27: { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s places the barrel of their shotgun into their mouth, pulling the trigger.", GetPlayerRPName(playerid)); } case 28 .. 39: { SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s places the barrel of their weapon into their mouth, pulling the trigger.", GetPlayerRPName(playerid)); } } SetPlayerHealth(playerid, 0.0); return 1; } CMD:garbage(playerid, params[]) { if(!PlayerHasJob(playerid, JOB_GARBAGEMAN)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you are not a Garbage Man."); } if(GetVehicleModel(GetPlayerVehicleID(playerid)) != 408 && GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You need to be driving a Trashmaster."); } if(!IsPlayerInRangeOfPoint(playerid, 8.0, 337.4032,881.1183,20.4063)) { return SendClientMessage(playerid, COLOR_GREY, "You are not at the starting point"); } if(PlayerInfo[playerid][pGarbage] > 0) { return SendClientMessage(playerid, COLOR_GREY, "You're already doing a garbage run!"); } GameTextForPlayer(playerid, "Proceed to the~n~Checkpoint", 5000, 3); PlayerInfo[playerid][pGarbage] = 1; PlayerInfo[playerid][pCP] = CHECKPOINT_GARBAGE; SetPlayerCheckpoint(playerid, -160.1904,1233.6595,19.7422, 5.0); return 1; } CMD:forcetut(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 4) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } new targetid; if(sscanf(params, "u", targetid)) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /forcetut [playerid]"); } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has forced %s to watch the server tutorial", GetPlayerRPName(playerid), GetPlayerRPName(targetid)); SendClientMessageEx(targetid, COLOR_LIGHTRED, "Administrator %s has forced you to rewatch the server tutorial.", GetPlayerRPName(playerid)); PlayerInfo[targetid][pTutorial] = 1; PlayerInfo[targetid][pTutorialTimer] = SetTimerEx("TutorialTimer", 1000, false, "ii", targetid, 1); return 1; } CMD:clearreports(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 5) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); } for(new i = 0; i < MAX_REPORTS; i ++) { if(ReportInfo[i][rExists]) { ReportInfo[i][rExists] = 0; } } SendAdminMessage(COLOR_LIGHTRED, "AdmCmd: %s has cleared all active reports.", GetPlayerRPName(playerid)); return 1; } CMD:endalliance(playerid, params[]) { new gangid = PlayerInfo[playerid][pGang]; new allyid = GangInfo[gangid][gAlliance]; new color, color2; if(isnull(params) || strcmp(params, "confirm", true) != 0) { return SendClientMessage(playerid, COLOR_SYNTAX, "USAGE: /endalliance [confirm]"); } if(PlayerInfo[playerid][pGang] == -1) { return SendClientMessage(playerid, COLOR_GREY, "You need to be in a gang to use this command"); } if(PlayerInfo[playerid][pGangRank] < 6) { return SendClientMessage(playerid, COLOR_GREY, "You need to be rank 6 to use this command."); } if(GangInfo[gangid][gAlliance] == -1) { return SendClientMessage(playerid, COLOR_GREY, "Your gang isn't currently in an alliance."); } SendClientMessageEx(playerid, COLOR_YELLOW, "You just ended your alliance with %s.", GangInfo[gangid][gName]); if(GangInfo[gangid][gColor] == -1 || GangInfo[gangid][gColor] == -256) { color = 0xC8C8C8FF; } else { color = GangInfo[gangid][gColor]; } if(GangInfo[allyid][gColor] == -1 || GangInfo[allyid][gColor] == -256) { color2 = 0xC8C8C8FF; } else { color2 = GangInfo[allyid][gColor]; } SendClientMessageToAllEx(COLOR_WHITE, "(( Gang News: {%06x}%s{FFFFFF} has ended their alliance with {%06x}%s{FFFFFF} ))", color >>> 8, GangInfo[gangid][gName], color2 >>> 8, GangInfo[allyid][gName]); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET alliance = -1 WHERE id = %i", gangid); mysql_tquery(connectionID, queryBuffer); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE gangs SET alliance = -1 WHERE id = %i", allyid); mysql_tquery(connectionID, queryBuffer); GangInfo[allyid][gAlliance] = -1; GangInfo[gangid][gAlliance] = -1; return 1; } CMD:clothes(playerid, params[]) { if(PlayerInfo[playerid][pVIPPackage] < 1) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command as you don't have a VIP subscription."); } if(!IsPlayerInRangeOfPoint(playerid, 3.0, 1826.3379, -1308.8324, 1131.7552)) { return SendClientMessage(playerid, COLOR_GREY, "You are not in range of the VIP locker."); } new skins[311], index; for(new i = 0; i < 312; i ++) { if(i != 74) { skins[index++] = i; } } ShowPlayerSelectionMenu(playerid, MODEL_SELECTION_VIPCLOTHES, "VIP Clothes", skins); return 1; } CMD:firstaid(playerid, params[]) { if(PlayerInfo[playerid][pFirstAid] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "You don't have any first aid kits."); } if(GetPlayerHealthEx(playerid) >= 100) { return SendClientMessage(playerid, COLOR_GREY, "You can only use a first aid kit if your health is below 100."); } if(PlayerInfo[playerid][pReceivingAid]) { return SendClientMessage(playerid, COLOR_GREY, "You have already used a first aid kit."); } PlayerInfo[playerid][pFirstAid]--; PlayerInfo[playerid][pReceivingAid] = 1; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET firstaid = %i WHERE uid = %i", PlayerInfo[playerid][pFirstAid], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s administers first aid to their self.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_WHITE, "HINT: Your first aid kit is in effect until your health is full."); return 1; } CMD:scanner(playerid, params[]) { if(!PlayerInfo[playerid][pPoliceScanner]) { return SendClientMessage(playerid, COLOR_GREY, "You don't have a police scanner."); } if(!PlayerInfo[playerid][pScannerOn]) { PlayerInfo[playerid][pScannerOn] = 1; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s turns on their police scanner.", GetPlayerRPName(playerid)); SendClientMessage(playerid, COLOR_WHITE, "You will now hear messages from emergency and department chats."); } else { PlayerInfo[playerid][pScannerOn] = 0; SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s turns off their police scanner.", GetPlayerRPName(playerid)); } return 1; } CMD:bodykit(playerid, params[]) { if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle."); } if(PlayerInfo[playerid][pBodykits] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "You have no bodywork kits which you can use."); } if(gettime() - PlayerInfo[playerid][pLastRepair] < 60) { return SendClientMessageEx(playerid, COLOR_GREY, "You can only repair a vehicle every 60 seconds. Please wait %i more seconds.", 60 - (gettime() - PlayerInfo[playerid][pLastRepair])); } PlayerInfo[playerid][pBodykits]--; PlayerInfo[playerid][pLastRepair] = gettime(); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE users SET bodykits = %i WHERE uid = %i", PlayerInfo[playerid][pBodykits], PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer); PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0); RepairVehicle(GetPlayerVehicleID(playerid)); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s repairs the health and bodywork on their vehicle.", GetPlayerRPName(playerid)); return 1; } CMD:rimkit(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, COLOR_GREY, "You are not driving any vehicle."); } if(PlayerInfo[playerid][pRimkits] <= 0) { return SendClientMessage(playerid, COLOR_GREY, "You have no rimkits which you can use."); } if(!IsVehicleOwner(playerid, vehicleid) && PlayerInfo[playerid][pVehicleKeys] != vehicleid && !(VehicleInfo[vehicleid][vGang] >= 0 && PlayerInfo[playerid][pGang] == VehicleInfo[vehicleid][vGang])) { return SendClientMessage(playerid, COLOR_GREY, "This vehicle doesn't belong to you."); } if(!VehicleHasDoors(vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You can't use this command in this type of vehicle."); } ShowPlayerDialog(playerid, DIALOG_USERIMKIT, DIALOG_STYLE_LIST, "Choose which set of rims to install.", "Offroad\nShadow\nMega\nRimshine\nWires\nClassic\nTwist\nCutter\nSwitch\nGrove\nImport\nDollar\nTrance\nAtomic\nAhab\nVirtual\nAccess", "Select", "Cancel"); return 1; } /*CMD:shutdownserver(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] >= 8) { if(strcmp(params, "confirm", true)) { SendClientMessage(playerid, COLOR_GREY3, "[Usage]: /shutdown [confirm]"); SendClientMessage(playerid, COLOR_GREY3, "This command save all player accounts and shutsdown the server."); return 1; } if(gGMX) { return SendClientMessage(playerid, COLOR_GREY, "You have already called for a server shutdown. You can't cancel it."); } gGMX = 0; SetTimer("FinishServerShutdown", 5000, false); SendClientMessage(playerid, COLOR_GREY, "Server will shutdown in 5 seconds."); foreach(new i : Player) { TogglePlayerControllable(i, 0); SavePlayerVariables(i); } } return 1; }*/ forward FinishServerShutdown(); public FinishServerShutdown() { foreach(new i : Player) { Kick(i); } SendRconCommand("exit"); return 1; } getTurftype(tid) { new ret[32], id = TurfInfo[tid][tType]; switch(id) { case 0: { ret = "Normal"; } case 1: { ret = "Materials"; } // hollowpoimt case 2: { ret = "Low class weapons"; }// poisontip case 3: { ret = "Medium class weapons"; }// fmj case 4: { ret = "High class Weapons"; } // old weps case 5: { ret = "Traphouse"; } case 6: { ret = "Crackhouse"; } case 7: { ret = "Sales tax"; } case 8: { ret = "Locked"; } } return ret; } CMD:showturfs(playerid, params[]) { if(!PlayerInfo[playerid][pShowTurfs]) { ShowTurfsOnMap(playerid, true); SendClientMessage(playerid, COLOR_AQUA, "You will now see turfs on your mini-map."); } else { ShowTurfsOnMap(playerid, false); SendClientMessage(playerid, COLOR_AQUA, "You will no longer see any turfs on your mini-map."); } return 1; } CMD:turfs(playerid, params[]) { new turfid, name[32], color, timeleft[32], string[2048]; //SendClientMessageEx(playerid, COLOR_GREEN, "---- Turfs ----"); tsstring = ""; for(turfid = 0; turfid < MAX_TURFS; turfid++) { if((TurfInfo[turfid][tType] < 8 && TurfInfo[turfid][tType] > 0) && TurfInfo[turfid][tExists]) { if(TurfInfo[turfid][tCapturedGang] >= 0) { strcpy(name, GangInfo[TurfInfo[turfid][tCapturedGang]][gName]); color = GangInfo[TurfInfo[turfid][tCapturedGang]][gColor]; } else if(TurfInfo[turfid][tCapturedGang] == -5) { name = "Shutdown by The Police"; color = 0x8D8DFF00; } else { color = COLOR_FACTIONCHAT; name = "None"; } if(TurfInfo[turfid][tTime] > 0) format(timeleft, sizeof(timeleft), "%d hours left", TurfInfo[turfid][tTime]); else format(timeleft, sizeof(timeleft), "Vulnerable"); if(strlen(string) < 1950) { format(string, sizeof(string), "%s {FFFFFF}%i. xe| Name: %s | Owner: {%06x}%s{FFFFFF} | Claimer: %s | Perk: %s | %s \n", string, turfid, TurfInfo[turfid][tName], color >>> 8, name, TurfInfo[turfid][tCapturedBy], getTurftype(turfid), timeleft); } else { format(tsstring, sizeof(tsstring), "%s {FFFFFF}%i. | Name: %s | Owner: {%06x}%s{FFFFFF} | Claimer: %s | Perk: %s | %s \n", tsstring, turfid, TurfInfo[turfid][tName], color >>> 8, name, TurfInfo[turfid][tCapturedBy], getTurftype(turfid), timeleft); } } } ShowPlayerDialog(playerid, DIALOG_TURFLIST, DIALOG_STYLE_MSGBOX, "Turf list", string, "Next", "Cancel"); return 1; } CMD:rules(playerid, params[]) { return ShowDialogToPlayer(playerid, DIALOG_RULES); } /* =============================================== [START]Backpack Player System by ToiletDuck =============================================== */ /* ----------------- Functions --------------- */ stock SetPlayerAttachedObjectEx(playerid, idx, model, bonex, Float:OffsetX = 0.0, Float:OffsetY = 0.0, Float:OffsetZ = 0.0, Float:RotX = 0.0, Float:RotY = 0.0, Float:RotZ = 0.0, Float:ScaleX = 1.0, Float:ScaleY = 1.0, Float:ScaleZ = 1.0, mat1 = 0, mat2 = 0) { if(idx < 9) { SetPlayerAttachedObject(playerid, idx, model, bonex, Float:OffsetX, Float:OffsetY, Float:OffsetZ, Float:RotX, Float:RotY, Float:RotZ, Float:ScaleX, Float:ScaleY, Float:ScaleZ, mat1, mat2); } } stock RemovePlayerAttachedObjectEx(playerid, idx) { if(idx < 9) { RemovePlayerAttachedObject(playerid, idx); } } stock GetBackpackStored(playerid) // 1 = HOUSE STORED | 2 = Vehicle Stored { if(PlayerHasBackpack(playerid)) { new bpID = GetPlayerBackpackID(playerid); if(BackpackInfo[bpID][bHouseStored] == 1) return 1; else if(BackpackInfo[bpID][bVehicleStored] == 1) return 2; } return 0; } stock PlayerHasBackpack(playerid) { if(GetPlayerBackpackID(playerid) != MAX_BACKPACKS+1) return 1; else return 0; } stock GetPlayerBackpackID(playerid) return backpackid[playerid]; stock LoadPlayerBackpack(playerid) { for(new i; i < MAX_BACKPACKS; i++) { if(BackpackInfo[i][bBackpackOwner] != -1) { if(BackpackInfo[i][bBackpackOwner] == GetPlayerSQLId(playerid)) { if(BackpackInfo[i][bHouseStored] != 1 && BackpackInfo[i][bVehicleStored] != 1) { if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9); SetPlayerAttachedObject(playerid, 9, 3026, 1, -0.15, -0.1, 0, 0, 0, 0, 1, 1, 1); } backpackid[playerid] = i; i = MAX_BACKPACKS+1; } } } return 1; } stock GetPlayerStorageType(playerid) { new id = GetPlayerBackpackID(playerid); new string[32]; format(string,sizeof(string), "%s",storagetype[BackpackInfo[id][bBackpackSize]]); return string; } stock BackpackLimit(size,type) { switch(size) { case 1:{ switch(type){ case LIMIT_CASH: return sbackpacklimit[LIMIT_CASH]; case LIMIT_POT: return sbackpacklimit[LIMIT_POT]; case LIMIT_CRACK: return sbackpacklimit[LIMIT_CRACK]; case LIMIT_MATS: return sbackpacklimit[LIMIT_MATS]; case LIMIT_GUN: return sbackpacklimit[LIMIT_GUN]; } } case 2:{ switch(type){ case LIMIT_CASH: return mbackpacklimit[LIMIT_CASH]; case LIMIT_POT: return mbackpacklimit[LIMIT_POT]; case LIMIT_CRACK: return mbackpacklimit[LIMIT_CRACK]; case LIMIT_MATS: return mbackpacklimit[LIMIT_MATS]; case LIMIT_GUN: return mbackpacklimit[LIMIT_GUN]; } } case 3: { switch(type){ case LIMIT_CASH: return lbackpacklimit[LIMIT_CASH]; case LIMIT_POT: return lbackpacklimit[LIMIT_POT]; case LIMIT_CRACK: return lbackpacklimit[LIMIT_CRACK]; case LIMIT_MATS: return lbackpacklimit[LIMIT_MATS]; case LIMIT_GUN: return lbackpacklimit[LIMIT_GUN]; } } } return -1; } stock GetBackpackSize(id) { new string[64]; switch(BackpackInfo[id][bBackpackSize]) { case 1: format(string,sizeof(string), "{FFFFFF}Small Backpack{FFFFFF}"); case 2: format(string,sizeof(string), "{FF9500}Medium Backpack{FFFFFF}"); case 3: format(string,sizeof(string), "{FF00EA}Large Backpack{FFFFFF}"); } return string; } stock IsRoleplayWeapon(weaponid) { switch(weaponid) { case 1..3,5..8,10..16,22..34: return 1; } return 0; } stock ShowBackpackActionChoice(playerid) { switch(GetPVarInt(playerid, "Listitem_Backpack")) { case 0: ShowPlayerDialog(playerid, DIALOG_ACTIONBACKPACKMENU, DIALOG_STYLE_LIST, "Backpack Action", "Put Cash\nTake Cash", "Choose", "Back"); case 1: ShowPlayerDialog(playerid, DIALOG_ACTIONBACKPACKMENU, DIALOG_STYLE_LIST, "Backpack Action", "Put Pots\nTake Pots", "Choose", "Back"); case 2: ShowPlayerDialog(playerid, DIALOG_ACTIONBACKPACKMENU, DIALOG_STYLE_LIST, "Backpack Action", "Put Cracks\nTake Cracks", "Choose", "Back"); case 3: ShowPlayerDialog(playerid, DIALOG_ACTIONBACKPACKMENU, DIALOG_STYLE_LIST, "Backpack Action", "Put Materials\nTake Materials", "Choose", "Back"); case 4: ShowPlayerDialog(playerid, DIALOG_ACTIONBACKPACKMENU, DIALOG_STYLE_LIST, "Backpack Action", "Put Weapon to Gun1\nTake Weapon in Gun1", "Choose", "Back"); case 5: ShowPlayerDialog(playerid, DIALOG_ACTIONBACKPACKMENU, DIALOG_STYLE_LIST, "Backpack Action", "Put Weapon to Gun2\nTake Weapon in Gun2", "Choose", "Back"); case 6: ShowPlayerDialog(playerid, DIALOG_ACTIONBACKPACKMENU, DIALOG_STYLE_LIST, "Backpack Action", "Put Weapon to Gun3\nTake Weapon in Gun3", "Choose", "Back"); case 7: ShowPlayerDialog(playerid, DIALOG_ACTIONBACKPACKMENU, DIALOG_STYLE_LIST, "Backpack Action", "Put Weapon to Gun4\nTake Weapon in Gun4", "Choose", "Back"); case 8: ShowPlayerDialog(playerid, DIALOG_ACTIONBACKPACKMENU, DIALOG_STYLE_LIST, "Backpack Action", "Put Weapon to Gun5\nTake Weapon in Gun5", "Choose", "Back"); } return 1; } stock ShowPlayerBackpack(playerid) { new stringex[2000], index = GetPlayerBackpackID(playerid),title[64]; if(!PlayerHasBackpack(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You don't have any Backpack"); format(stringex,sizeof(stringex), "Cash ($%s) \n\ Pots (%sg) \n\ Cracks (%sg) \n\ Mats (%s)\n", FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackInfo[index][bMats]) ); if(BackpackInfo[index][bBackpackSize] == 1) { format(stringex,sizeof(stringex), "%s\ Gun (%s) \n\ Gun (%s)", stringex, GetWeaponNameEx(BackpackInfo[index][bGun][0]), GetWeaponNameEx(BackpackInfo[index][bGun][1]) ); } else if(BackpackInfo[index][bBackpackSize] == 2) { format(stringex,sizeof(stringex), "%s\ Gun (%s) \n\ Gun (%s) \n\ Gun (%s)", stringex, GetWeaponNameEx(BackpackInfo[index][bGun][0]), GetWeaponNameEx(BackpackInfo[index][bGun][1]), GetWeaponNameEx(BackpackInfo[index][bGun][3]) ); } else if(BackpackInfo[index][bBackpackSize] == 3) { format(stringex,sizeof(stringex), "%s\ Gun (%s) \n\ Gun (%s) \n\ Gun (%s) \n\ Gun (%s) \n\ Gun (%s)", stringex, GetWeaponNameEx(BackpackInfo[index][bGun][0]), GetWeaponNameEx(BackpackInfo[index][bGun][1]), GetWeaponNameEx(BackpackInfo[index][bGun][2]), GetWeaponNameEx(BackpackInfo[index][bGun][3]), GetWeaponNameEx(BackpackInfo[index][bGun][4]) ); } format(title,sizeof(title), "Content of my %s", GetBackpackSize(index)); ShowPlayerDialog(playerid, DIALOG_BACKPACKMENU, DIALOG_STYLE_LIST, title, stringex, "Choose", "Close"); return 1; } stock ShowEditBackpackDialog(playerid, index) { new stringex[2000]; format(stringex,sizeof(stringex), "Cash ($%s) \n\ Pots (%sg) \n\ Cracks (%sg) \n\ Mats (%s)\n", FormatNumber(BackpackInfo[index][bCash]), FormatNumber(BackpackInfo[index][bPot]), FormatNumber(BackpackInfo[index][bCrack]), FormatNumber(BackpackInfo[index][bMats]) ); if(BackpackInfo[index][bBackpackSize] == 1) { format(stringex,sizeof(stringex), "%s\ Gun (%s) \n\ Gun (%s)", stringex, GetWeaponNameEx(BackpackInfo[index][bGun][0]), GetWeaponNameEx(BackpackInfo[index][bGun][1]) ); } else if(BackpackInfo[index][bBackpackSize] == 2) { format(stringex,sizeof(stringex), "%s\ Gun (%s) \n\ Gun (%s) \n\ Gun (%s)", stringex, GetWeaponNameEx(BackpackInfo[index][bGun][0]), GetWeaponNameEx(BackpackInfo[index][bGun][1]), GetWeaponNameEx(BackpackInfo[index][bGun][3]) ); } else if(BackpackInfo[index][bBackpackSize] == 3) { format(stringex,sizeof(stringex), "%s\ Gun (%s) \n\ Gun (%s) \n\ Gun (%s) \n\ Gun (%s) \n\ Gun (%s)", stringex, GetWeaponNameEx(BackpackInfo[index][bGun][0]), GetWeaponNameEx(BackpackInfo[index][bGun][1]), GetWeaponNameEx(BackpackInfo[index][bGun][2]), GetWeaponNameEx(BackpackInfo[index][bGun][3]), GetWeaponNameEx(BackpackInfo[index][bGun][4]) ); } new title[64]; format(title,sizeof(title), "Player (%s) - %s Information", GetPlayerNameEx(GetPVarInt(playerid, "GetPlayerID")), GetPlayerStorageType(GetPVarInt(playerid, "GetPlayerID"))); ShowPlayerDialog(playerid, DIALOG_EDITMAINBACKPACK, DIALOG_STYLE_LIST, title, stringex, "Edit", "Close"); SetPVarInt(playerid, "BackpackID", index); return 1; } /* ----------------- MYSQL SAVING/LOADING --------------- */ // LoadBackpacks(playerid) // Description: Load the backpacks of the server stock SaveBackpack(i) { if(i == MAX_BACKPACKS+1) return 1; new string[2000]; format(string, sizeof(string), "UPDATE `playerbackpack` SET \ `BackpackOwner`=%d, \ `BackpackSize`=%d, \ `HouseStored`=%d, \ `VehicleStored`=%d, \ `Cash`=%d, \ `Pot`=%d, \ `Crack`=%d, \ `Mats`=%d,", BackpackInfo[i][bBackpackOwner], BackpackInfo[i][bBackpackSize], BackpackInfo[i][bHouseStored], BackpackInfo[i][bVehicleStored], BackpackInfo[i][bCash], BackpackInfo[i][bPot], BackpackInfo[i][bCrack], BackpackInfo[i][bMats] ); for(new weaponid; weaponid= 1) return SendClientMessageEx(playerid, COLOR_GREY, "Administrators are not allowed to sell their backpack!"); if(sscanf(params ,"ud", giveplayerid, amount)) return SendClientMessageEx(playerid, COLOR_GREY," USAGE: /sellmybackpack [giveplayerid] [price]"); if(giveplayerid == playerid) return SendClientMessageEx(playerid, COLOR_GREY, "What was that? Ofcourse you can't sell your backpack to yourself"); if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, " Invalid Player ID !"); if(PlayerHasBackpack(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, " That player has already a Backpack!"); new bpstored2 = GetBackpackStored(giveplayerid); if(bpstored2 == 1) return SendClientMessageEx(playerid, COLOR_GREY, "That player has already his backpack stored in his/her house!"); else if(bpstored2 == 2) return SendClientMessageEx(playerid, COLOR_GREY, "That player has already his backpack stored in his/her vehicle trunk!"); if(1 < amount > 10000000) return SendClientMessageEx(playerid, COLOR_GREY, "Price must not a negative value or over $10,000,000!"); if(GetPlayerCash(giveplayerid) < amount) return SendClientMessageEx(playerid, COLOR_GREY, " That player dont have enought cash to buy your backpack!"); if(BackpackInfo[bpID][bCash] != 0 && !GetPVarInt(playerid, "SellBackpackConfirm") || BackpackInfo[bpID][bPot] != 0 && !GetPVarInt(playerid, "SellBackpackConfirm") || BackpackInfo[bpID][bCrack] != 0 && !GetPVarInt(playerid, "SellBackpackConfirm") || BackpackInfo[bpID][bMats] != 0 && !GetPVarInt(playerid, "SellBackpackConfirm")) { ShowPlayerDialog(playerid, 0 , DIALOG_STYLE_MSGBOX, "Backpack Notice", "Are you sure do you want to sell your Backpack when you still have items on it?\nIf Yes kindly re-enter the command!", "Okay", ""); SetPVarInt(playerid, "SellBackpackConfirm", 1); return 1; } DeletePVar(playerid, "SellBackpackConfirm"); format(string ,sizeof(string), "* Player %s has offered you to buy his %s for $%s (/acceptbackpack) to buy or (/denybackpack) if not", GetPlayerNameEx(playerid) , GetPlayerStorageType(playerid), FormatNumber(amount)); SendClientMessageEx(giveplayerid, COLOR_ROYALBLUE , string); format(string ,sizeof(string) ,"* You have offered %s to buy your %s for $%s", GetPlayerNameEx(giveplayerid) ,GetPlayerStorageType(playerid) , FormatNumber(amount)); SendClientMessageEx(playerid, COLOR_ROYALBLUE, string); SetPVarInt(giveplayerid, "BackpackSeller", playerid); SetPVarInt(giveplayerid, "BackpackPrice", amount); SetPVarInt(giveplayerid, "BackpackID", bpID); return 1; } stock FIXES_valstr(dest[], value, bool:pack = false) { // format can't handle cellmin properly static const cellmin_value[] = !"-2147483648"; if (value == cellmin) pack && strpack(dest, cellmin_value, 12) || strunpack(dest, cellmin_value, 12); else format(dest, 12, "%d", value) && pack && strpack(dest, dest, 12); } stock number_format(number) { new i, string[15]; FIXES_valstr(string, number); if(strfind(string, "-") != -1) i = strlen(string) - 4; else i = strlen(string) - 3; while (i >= 1) { if(strfind(string, "-") != -1) strins(string, ",", i + 1); else strins(string, ",", i); i -= 3; } return string; } CMD:backpackhelp(playerid) { new string[3000]; strcat(string, "\t\t** {00AA00}Dynamic Backpack System Version 1 of Emerald City Roleplay{FFFFFF} **"); strcat(string, "\n\n{FF00FF}Information:{FFFFFF}"); strcat(string, "\n You can now store items in your Backpack! such as Cash/Pot/Crack/Mats/Weapons check it below."); strcat(string, "\n And also need to play more 5 playing hours to be able to use backpacks and 10 playing hours to sell a Backpack"); strcat(string, "\n 3 Types of Backpack: {FFFFFF}Small Backpack {FF9500}Medium Backpack {0000FF}Large Backpack"); strcat(string, "\n\n\n~ {FFFFFF}Small Backpack LIMIT{FFFFFF} ~"); format(string, sizeof(string), "%s\n\t\ -Max Cash : {FFFF00}$%s Cash{FFFFFF}\n\t\ -Max Pots: {FFFF00}%sg Pots{FFFFFF}\n\t\ -Max Cracks: {FFFF00}%sg Cracks{FFFFFF}\n\t\ -Max Materials: {FFFF00}%s Materials{FFFFFF}\n\t\ -Max Weapons: {FFFF00}2 Weapons{FFFFFF}", string, number_format(sbackpacklimit[LIMIT_CASH]), number_format(sbackpacklimit[LIMIT_POT]), number_format(sbackpacklimit[LIMIT_CRACK]), number_format(sbackpacklimit[LIMIT_MATS]) ); strcat(string, "\n\n\n~ {FF9500}Medium Backpack LIMIT{FFFFFF} ~"); format(string, sizeof(string), "%s\n\t\ -Max Cash : {FFFF00}$%s Cash{FFFFFF}\n\t\ -Max Pots: {FFFF00}%sg Pots{FFFFFF}\n\t\ -Max Cracks: {FFFF00}%sg Cracks{FFFFFF}\n\t\ -Max Materials: {FFFF00}%s Materials{FFFFFF}\n\t\ -Max Weapons: {FFFF00}3 Weapons{FFFFFF}", string, number_format(mbackpacklimit[LIMIT_CASH]), number_format(mbackpacklimit[LIMIT_POT]), number_format(mbackpacklimit[LIMIT_CRACK]), number_format(mbackpacklimit[LIMIT_MATS]) ); strcat(string, "\n\n\n~ {0000FF}Large Backpack LIMIT{FFFFFF} ~"); format(string, sizeof(string), "%s\n\t\ -Max Cash : {FFFF00}$%s Cash{FFFFFF}\n\t\ -Max Pots: {FFFF00}%sg Pots{FFFFFF}\n\t\ -Max Cracks: {FFFF00}%sg Cracks{FFFFFF}\n\t\ -Max Materials: {FFFF00}%s Materials{FFFFFF}\n\t\ -Max Weapons: {FFFF00}5 Weapons{FFFFFF}", string, number_format(lbackpacklimit[LIMIT_CASH]), number_format(lbackpacklimit[LIMIT_POT]), number_format(lbackpacklimit[LIMIT_CRACK]), number_format(lbackpacklimit[LIMIT_MATS]) ); strcat(string, "\n\n{9ACD32}Commands List:{FFFFFF}"); strcat(string, "\n/backpackopen (/bpopen)\t/sellmybackpack\t/accepbackpack\t/denybackpack"); if(PlayerInfo[playerid][pAdmin] >= 8) strcat(string, "\n{FF3080}Admin Commands List:{FFFFFF}\n/givebackpack\t/removebackpack\t/editbackpack"); strcat(string, "\n\n\n{FFFFFF}Notice:\n\t{FF8000} This only a Version 1 so expect more changes in the System ?? Have fun enjoy the updates"); ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "* {007FFF}Dynamic Backpack System v1.0 of Emerald City Roleplay *", string, "Like", ""); return 1; } CMD:acceptbackpack(playerid, params[]) { if(!GetPVarType(playerid, "BackpackSeller")) return SendClientMessageEx(playerid, COLOR_GREY, "No one offerec you to buy a Backpack!"); new sellerid = GetPVarInt(playerid, "BackpackSeller"), price = GetPVarInt(playerid, "BackpackPrice"), index = GetPVarInt(playerid, "BackpackID"); if(PlayerHasBackpack(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You already have a Backpack!"); if(!IsPlayerConnected(sellerid)) return SendClientMessageEx(playerid, COLOR_GREY, "The Player offered you a Backpack is isn't connected!"); if(!PlayerHasBackpack(sellerid)) return SendClientMessageEx(playerid, COLOR_GREY, "The Seller doesn't have any Backpack to sell!"); if(price > GetPlayerCash(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You dont have enough cash to buy this Backpack"); if(!GetPVarType(playerid, "BuyBackpackConfirm")) return SetPVarInt(playerid, "BuyBackpackConfirm", 1), ShowPlayerDialog(playerid, 0 , DIALOG_STYLE_MSGBOX, "Backpack Notice!", "Are you sure do you want to buy this backpack? If Yes kindly re-enter the command", "Okay", ""); DeletePVar(playerid, "BuyBackpackConfirm"); new string[128]; format(string ,sizeof(string), "* Player %s has successfuly bought your %s for $%s", GetPlayerNameEx(playerid) , GetPlayerStorageType(sellerid), FormatNumber(price)); SendClientMessageEx(sellerid, COLOR_ROYALBLUE, string); format(string, sizeof(string), "* You have successfuly bought %s's %s for $%s", GetPlayerNameEx(sellerid), GetPlayerStorageType(sellerid) , FormatNumber(price)); SendClientMessageEx(playerid, COLOR_ROYALBLUE, string); GivePlayerCash(playerid, -price); GivePlayerCash(sellerid, price); BackpackInfo[index][bBackpackOwner] = GetPlayerSQLId(playerid); if(IsPlayerAttachedObjectSlotUsed(sellerid, 9)) RemovePlayerAttachedObject(sellerid, 9); if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9); switch(BackpackInfo[index][bBackpackSize]) { case 1: SetPlayerAttachedObject(playerid, 9, 3026, 1, -0.15, -0.1, 0, 0, 0, 0, 1, 1, 1); } backpackid[sellerid] = MAX_BACKPACKS+1; backpackid[playerid] = index; SavePlayerVariables(sellerid); SavePlayerVariables(playerid); DeletePVar(playerid, "BackpackSeller"); DeletePVar(playerid, "BackpackPrice"); DeletePVar(playerid, "BackpackID"); return 1; } CMD:denybackpack(playerid, params[]) { new string[128], sellerid = GetPVarInt(playerid, "BackpackSeller"), price = GetPVarInt(playerid, "BackpackPrice"); if(!GetPVarType(playerid, "BackpackSeller")) return SendClientMessageEx(playerid, COLOR_GREY, "No one offerec you to buy a Backpack!"); format(string ,sizeof(string), "* Player %s has turn down your offer to buy your %s for $%s", GetPlayerNameEx(playerid) , GetPlayerStorageType(sellerid), FormatNumber(price)); SendClientMessageEx(sellerid, COLOR_ROYALBLUE, string); format(string, sizeof(string), "* You have turn down the offer of %s's %s for $%s", GetPlayerNameEx(sellerid), GetPlayerStorageType(sellerid) , FormatNumber(price)); SendClientMessageEx(playerid, COLOR_ROYALBLUE, string); DeletePVar(playerid, "BackpackSeller"); DeletePVar(playerid, "BackpackPrice"); DeletePVar(playerid, "BackpackID"); return 1; } CMD:removebackpack(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 8) return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this command"); new giveplayerid, string[128]; if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /removebackpack [playerid]"); if(!PlayerHasBackpack(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "That player doesn't have any Backpack!"); format(string ,sizeof(string), "* Admin %s has removed your %s and all items except weapons has been added to your stats", GetPlayerNameEx(playerid), GetPlayerStorageType(giveplayerid)); SendClientMessageEx(giveplayerid, COLOR_ROYALBLUE, string); format(string ,sizeof(string), "* You have removed Player %s's %s and all items except gun in the Backpack has been added to their stats", GetPlayerNameEx(giveplayerid), GetPlayerStorageType(giveplayerid)); SendClientMessageEx(playerid, COLOR_WHITE, string); new bpID = GetPlayerBackpackID(giveplayerid); if(BackpackInfo[bpID][bCash] != 0) GivePlayerCash(giveplayerid, BackpackInfo[bpID][bCash]); if(BackpackInfo[bpID][bPot] != 0) PlayerInfo[giveplayerid][pWeed] += BackpackInfo[bpID][bPot]; if(BackpackInfo[bpID][bCrack] != 0) PlayerInfo[giveplayerid][pCocaine] += BackpackInfo[bpID][bCrack]; if(BackpackInfo[bpID][bMats] != 0) PlayerInfo[giveplayerid][pMaterials] += BackpackInfo[bpID][bMats]; BackpackInfo[bpID][bCash] = 0; BackpackInfo[bpID][bPot] = 0; BackpackInfo[bpID][bCrack] = 0; BackpackInfo[bpID][bMats] = 0; BackpackInfo[bpID][bGun][0] = 0; BackpackInfo[bpID][bGun][1] = 0; BackpackInfo[bpID][bGun][2] = 0; BackpackInfo[bpID][bGun][3] = 0; BackpackInfo[bpID][bGun][4] = 0; BackpackInfo[bpID][bBackpackOwner] = -1; SavePlayerVariables(giveplayerid); if(IsPlayerAttachedObjectSlotUsed(giveplayerid, 9)) RemovePlayerAttachedObject(giveplayerid, 9); backpackid[giveplayerid] = MAX_BACKPACKS+1; return 1; } CMD:bpopen(playerid) return callcmd::backpackopen(playerid); CMD:backpackopen(playerid) { if(!PlayerHasBackpack(playerid)) return SendClientMessageEx(playerid, COLOR_GREY, "You dont have any Backpack"); new bpstored = GetBackpackStored(playerid); if(bpstored == 1) return SendClientMessageEx(playerid, COLOR_GREY, " You don't have your backpack with you! You just stored in your house safe!"); else if(bpstored == 2) return SendClientMessageEx(playerid, COLOR_GREY, " You don't have your backpack with you! You just stored in your vehicle trunk!"); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s lays their backpack on the ground-.. as he open it.", GetPlayerRPName(playerid)); ApplyAnimationEx(playerid, "BOMBER", "BOM_Plant", 4.1, 0, 0, 0, 0, 0); ShowPlayerBackpack(playerid); return 1; } CMD:editbackpack(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 8) return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this command"); new giveplayerid; if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /editbackpack [playerid]"); if(!IsPlayerConnected(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "That player isn't connected"); if(!PlayerHasBackpack(giveplayerid)) return SendClientMessageEx(playerid, COLOR_GREY, "That player dosn't have any backpack!"); new bpID = GetPlayerBackpackID(giveplayerid); new bpstored = GetBackpackStored(giveplayerid); if(bpstored == 1) SendClientMessageEx(playerid, COLOR_WHITE, "NOTE: That player has their backpack stored in their house safe"); else if(bpstored == 2) SendClientMessageEx(playerid, COLOR_WHITE, "NOTE: That player has their backpack stored in their vehicle trunk"); SetPVarInt(playerid, "GetPlayerID", giveplayerid); ShowEditBackpackDialog(playerid, bpID); return 1; } CMD:givebackpack(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 8) return SendClientMessageEx(playerid, COLOR_GREY, "You can't use this command"); new giveplayerid, bsize, bpsize[32], string[128]; if(sscanf(params,"ud", giveplayerid, bsize)) { SendClientMessageEx(playerid, COLOR_GREY, "USAGE: /givebackpack [playerid] [backpacksize]"); SendClientMessageEx(playerid, COLOR_GREY, "Available Size: ( 1 - Small Backpack | 2 - Medium Backpack | 3 - Large Backpack )"); return 1; } if(bsize < 1 || bsize > 3) return SendClientMessageEx(playerid, COLOR_GREY, "Invalid Backpack Size!"); if(IsPlayerConnected(giveplayerid)) { printf("Step 1"); switch(bsize) { case 1: format(bpsize,sizeof(bpsize), "Small Backpack"); case 2: format(bpsize,sizeof(bpsize), "Medium Backpack"); case 3: format(bpsize,sizeof(bpsize), "Large Backpack"); } new bpID = GetPlayerBackpackID(giveplayerid); if(PlayerHasBackpack(giveplayerid) && BackpackInfo[bpID][bBackpackSize] == bsize) { format(string,sizeof(string), "Player %s has already a %s!",GetPlayerNameEx(giveplayerid), GetPlayerStorageType(giveplayerid)); SendClientMessageEx(playerid, COLOR_GREY, string); //printf("Step 1.1"); return 1; } else if(PlayerHasBackpack(giveplayerid) && BackpackInfo[bpID][bBackpackSize] != bsize) { new bpstored = GetBackpackStored(giveplayerid); format(string, sizeof(string), "* You have setted %s's %s to %s", GetPlayerNameEx(giveplayerid) ,GetPlayerStorageType(giveplayerid),bpsize); SendClientMessageEx(playerid, COLOR_WHITE, string); if(bpstored == 1 || bpstored == 2) SendClientMessageEx(playerid, COLOR_GREY, "NOTE: That player has already their backpack stored in house either vehicle trunk!"); format(string,sizeof(string), "* Admin %s has setted your %s to %s", GetPlayerNameEx(playerid), GetPlayerStorageType(giveplayerid), bpsize); SendClientMessageEx(giveplayerid, COLOR_ROYALBLUE, string); BackpackInfo[bpID][bBackpackSize] = bsize; SaveBackpack(bpID); LoadPlayerBackpack(giveplayerid); return 1; } else if(!PlayerHasBackpack(giveplayerid)) { printf("Step 1.3"); new query[230]; for(new index = 0; index "); { if(targetid == playerid) { return SendClientMessage(playerid, COLOR_GREY, "You can't whisper to yourself."); } if(IsPlayerConnected(targetid)) { new targetname[125]; targetname = GetPlayerNameEx(targetid); SendClientMessageEx(targetid, COLOR_WHITE, "(( PM from %s: %s ))", GetPlayerRPName(playerid), msg); SendClientMessageEx(playerid, COLOR_WHITE, "(( PM to %s: %s ))", GetPlayerRPName(targetid), msg); return 1; } else return SendClientMessage(playerid, COLOR_GREY, "The target player is offline!"); } } else return SendClientMessage(playerid, COLOR_GREY, "You must login before using this command!"); } // -------------------------- Vehicle dealership commands & functions ------------------------------------- CMD:adealershiphelp(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); SendClientMessage(playerid, COLOR_GREY, "/createdealerveh - /destroydealerveh - /respawnalldv - /editprice"); return 1; } CMD:editprice(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in any vehicle."); new vehid = GetPlayerDealerVehID(playerid), veh2, veh = GetPlayerVehicleID(playerid); if(vehid==-1) return SendClientMessage(playerid, -1, "You are not in a dealership vehicle."); new price,txt[80], oldprice, query[200], str[200]; if(sscanf(params, "d", price)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /editprice "); if(price <= 0) return SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle price."); veh2 = vehData[vehid][vModel]; if(veh != veh2) return printf("error in /editprice"); oldprice = vehData[vehid][vPrice]; vehData[vehid][vPrice] = price; format(txt, sizeof(txt), "%s\n%s", vehicleNames[vehData[vehid][vModelID] - 400], FormatNumber(price)); UpdateDynamic3DTextLabelText(vehData[vehid][vLabel], COLOR_BLUE, txt); format(str, sizeof(str), "You have changed the price of this vehicle from %s to %s.", FormatNumber(oldprice), FormatNumber(price)); SendClientMessage(playerid, COLOR_GREY, str); mysql_format(connectionID, query, sizeof(query), "UPDATE `dealervehs` SET `price` = '%d' WHERE `id` = '%d'", price, vehData[vehid][vID]); mysql_tquery(connectionID, query); return 1; } CMD:respawnalldv(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); foreach(new i : DealerVeh) { SetVehicleToRespawn(vehData[i][vModel]); } SendClientMessage(playerid, COLOR_GREY, "You have respawned all dealership vehicles."); return 1; } CMD:createdealerveh(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); new Float: x, Float: y, Float: z, Float: fA, modelid, price; if(sscanf(params, "dd", modelid, price)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /createdealerveh "); if( 400 <= modelid <= 611 ) { new mysql_id, query[200]; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, fA); mysql_format(connectionID, query, sizeof(query), "INSERT INTO `dealervehs` (`model`, `price`, `posx`, `posy`, `posz`, `facingangle`) VALUES ('%d', '%d','%f', '%f', '%f', '%f')", modelid, price, x, y, z, fA); mysql_query(connectionID, query); mysql_id = cache_insert_id(connectionID); AddVeh(mysql_id, modelid, price, x, y, z, fA, playerid); } else SendClientMessage(playerid, COLOR_GREY, "Invalid vehicle model. [400 --> 611]"); return 1; } CMD:buyvehicle(playerid, params[]) { if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in any vehicle."); new vehid = GetPlayerDealerVehID(playerid), veh2, veh = GetPlayerVehicleID(playerid); if(vehid==-1) return SendClientMessage(playerid, COLOR_GREY, "You are not in any dealership vehicle."); veh2 = vehData[vehid][vModel]; if(veh != veh2) return printf("error in /buyvehicle"); // buy it. if(GetSpawnedVehicles(playerid) >= MAX_SPAWNED_VEHICLES) return SendClientMessageEx(playerid, COLOR_GREY, "You can't have more than %i vehicles spawned at a time.", MAX_SPAWNED_VEHICLES); if(PlayerInfo[playerid][pCash] < vehData[vehid][vPrice]) return SendClientMessage(playerid, COLOR_GREY, "You cannot afford to buy this vehicle."); PlayerInfo[playerid][pGangCar] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "SELECT COUNT(*) FROM vehicles WHERE ownerid = %i", PlayerInfo[playerid][pID]); mysql_tquery(connectionID, queryBuffer, "OnPlayerAttemptBuyVehicle", "ii", playerid, vehid); return 1; } forward OnPlayerAttemptBuyVehicle(playerid, index); public OnPlayerAttemptBuyVehicle(playerid, index) { new count = cache_get_row_int(0, 0); if(index == -1) return SendClientMessage(playerid, COLOR_GREY, "You are not in a dealership vehicle."); if(count >= GetPlayerAssetLimit(playerid, LIMIT_VEHICLES)) { SendClientMessageEx(playerid, COLOR_GREY, "You currently own %i/%i vehicles. You can't own anymore unless you upgrade your asset perk.", count, GetPlayerAssetLimit(playerid, LIMIT_VEHICLES)); } else { new string[20]; if(PlayerInfo[playerid][pCash] < vehData[index][vPrice]) { SendClientMessage(playerid, COLOR_GREY, "You can't afford to purchase this vehicle."); } else if(GetSpawnedVehicles(playerid) >= MAX_SPAWNED_VEHICLES) { SendClientMessageEx(playerid, COLOR_GREY, "You can't have more than %i vehicles spawned at a time.", MAX_SPAWNED_VEHICLES); } else { new id = GetNearestDealerShip(playerid, -1); // doesn't matter which dealership is close if(id == -1) return SendClientMessage(playerid, COLOR_GREY, "You are not close to any dealership."); new Float:x = dsData[id][dspawnX], Float:y = dsData[id][dspawnY], Float:z = dsData[id][dspawnZ], Float:angle = dsData[id][dspawnfA]; AwardAchievement(playerid, "First wheels"); mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "INSERT INTO vehicles (ownerid, owner, modelid, price, pos_x, pos_y, pos_z, pos_a) VALUES(%i, '%s', %i, %i, '%f', '%f', '%f', '%f')", PlayerInfo[playerid][pID], GetPlayerNameEx(playerid), vehData[index][vModelID], vehData[index][vPrice], x, y, z, angle); mysql_tquery(connectionID, queryBuffer); AddPointMoney(POINT_AUTOEXPORT, percent(vehData[index][vPrice], 3)); GivePlayerCash(playerid, -vehData[index][vPrice]); format(string, sizeof(string), "~r~-$%i", vehData[index][vPrice]); GameTextForPlayer(playerid, string, 5000, 1); SendClientMessageEx(playerid, COLOR_GREEN, "%s purchased for $%i. /carstorage to spawn this vehicle.", vehicleNames[vehData[index][vModelID] - 400], vehData[index][vPrice]); Log_Write("log_property", "%s (uid: %i) purchased a %s for $%i.", GetPlayerNameEx(playerid), PlayerInfo[playerid][pID], vehicleNames[vehData[index][vModelID] - 400], vehData[index][vPrice]); } } return 1; } CMD:destroydealerveh(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not in any vehicle."); new vehid = GetPlayerDealerVehID(playerid), veh2, veh = GetPlayerVehicleID(playerid); if(vehid==-1) return SendClientMessage(playerid, -1, "You are not in a dealership vehicle."); veh2 = vehData[vehid][vModel]; if(veh != veh2) return printf("error in /destroydealerveh"); DestroyVeh(vehid); new str[160]; format(str, sizeof(str), "You have destroyed a dealership veh. [arrayid: %i - vehicleid: %i]", vehid, veh2); SendClientMessage(playerid, COLOR_GREY, str); return 1; } AddVeh(mysql_id, modelid, price, Float: x, Float: y, Float: z, Float: fA, playerid) { new i = Iter_Free(DealerVeh); vehData[i][vID] = mysql_id; vehData[i][posx] = x; vehData[i][posy] = y; vehData[i][posz] = z; vehData[i][vfA] = fA; vehData[i][vPrice] = price; vehData[i][vModelID] = modelid; vehData[i][vModel] = VIH_CreateVehicle(modelid, x, y, z, fA, 0, 0, 0, 0); Iter_Add(DealerVeh, i); new txt[80]; format(txt, sizeof(txt), "%s\n%s", vehicleNames[modelid - 400], FormatNumber(price)); vehData[i][vLabel] = CreateDynamic3DTextLabel(txt, COLOR_BLUE, x, y, z, 4, INVALID_PLAYER_ID, vehData[i][vModel], 0, -1, -1, -1, 100.0); if(playerid!=-1) PutPlayerInVehicle(playerid, vehData[i][vModel], 0); return 1; } DestroyVeh(id) { if(id == -1) return printf("You passed invalid vehid to DestroyVeh(vehid)"); new query[200]; mysql_format(connectionID, query, sizeof(query), "DELETE FROM `dealervehs` WHERE `id` = '%d'", vehData[id][vID]); mysql_tquery(connectionID,query); RemoveVeh(id); return 1; } RemoveVeh(id) // remove it on server shutdown or on destroying a vehicle { if(id == -1) return printf("You passed invalid vehid to RemoveVeh(id)"); vehData[id][vID] = -1; vehData[id][posx] = -1; vehData[id][posy] = -1; vehData[id][posz] = -1; vehData[id][vfA] = -1; vehData[id][vPrice] = -1; vehData[id][vModelID] = -1; VIH_DestroyVehicle(vehData[id][vModel]); DestroyDynamic3DTextLabel(vehData[id][vLabel]); Iter_Remove(DealerVeh, id); return 1; } GetPlayerDealerVehID(playerid) { new v = GetPlayerVehicleID(playerid); foreach(new i : DealerVeh) { if(v == vehData[i][vModel]) return i; } return -1; } forward LoadVehs(); public LoadVehs() { new rows = cache_get_row_count(connectionID); vehs = rows; if(rows) { new mysql_id, model, Float: x, Float: y, Float: z, Float: fA, price //msg[500] ; for(rows=0; rows "); SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} Available types: Car: 0, Bike: 1, Plane: 2, Boat: 3."); } else { if( 0 <= type <= 3 ) { new query[800], mysql_id; GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, fA); mysql_format(connectionID, query, sizeof(query), "INSERT INTO `dealerships` (`name`, `type`, `range`, `posx`, `posy`, `posz`, `spawnposx`, `spawnposy`, `spawnposz`, `spawnposfa`) VALUES ('%s', '%d', '%f', '%f', '%f', '%f', '%f', '%f', '%f', '%f')", name, type, range, x, y, z, x, y, z, fA); mysql_query(connectionID, query); mysql_id = cache_insert_id(connectionID); AddDealerShip(mysql_id, name, type, range, x, y, z, x, y, z, fA); // spawn pos = dealership pos until it's edited. SendClientMessage(playerid, COLOR_GREY, "You have created a dealership. Spawn position has been set to your position."); SendClientMessage(playerid, COLOR_GREY, "Use /editdsspawnpos to edit it. Make sure you edit it with respect to the facing angle."); } else SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} Available types: Car: 0, Bike: 1, Plane: 2, Boat: 3."); } return 1; } CMD:editdspos(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); new Float: x, Float: y, Float: z, id, str[200], query[200]; if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /editdspos - will be set to your current position"); if(!Iter_Contains(DealerShip, id)) return SendClientMessage(playerid, COLOR_GREY, "Invalid dealership id."); GetPlayerPos(playerid, x, y, z); dsData[id][dX] = x; dsData[id][dY] = y; dsData[id][dZ] = z; // recreate the pickup, mapicon, label. DestroyDynamic3DTextLabel(dsData[id][dLabel]); DestroyDynamicPickup(dsData[id][dPickUp]); DestroyDynamicMapIcon(dsData[id][dMapIcon]); new mid, txt[400]; format(txt, sizeof(txt), "%s %s", dsData[id][dName], GetDealerShipType(id)); dsData[id][dLabel] = CreateDynamic3DTextLabel(txt, COLOR_YELLOW, x, y, z, 10.0); dsData[id][dPickUp] = CreateDynamicPickup(1274, 1, x, y, z); switch(dsData[id][dType]) { case 0,1: mid = 55; // car case 2: mid = 5; // plane case 3: mid = 9; // boat default: mid = 55; } dsData[id][dMapIcon] = CreateDynamicMapIcon(x, y, z, mid, 0, -1, -1); mysql_format(connectionID, query, sizeof(query), "UPDATE `dealerships` SET `posx` = '%f', `posy` = '%f', `posz` = '%f' WHERE `id` = '%d'", x, y, z, dsData[id][dID]); mysql_tquery(connectionID, query); format(str, sizeof(str), "You have set dealership id %i position to %f, %f, %f.", id, x, y, z); SendClientMessage(playerid, COLOR_GREY, str); SendClientMessage(playerid, COLOR_GREY, "Make sure you edit dealership spawn position using /editdsspawnpos"); return 1; } CMD:editdsspawnpos(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); new Float: x, Float: y, Float: z, Float: fA, id, str[200], query[200]; if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /editdsspawnpos - will be set to your current position"); if(!Iter_Contains(DealerShip, id)) return SendClientMessage(playerid, COLOR_GREY, "Invalid dealership id."); GetPlayerPos(playerid, x, y, z); GetPlayerFacingAngle(playerid, fA); dsData[id][dspawnX] = x; dsData[id][dspawnY] = y; dsData[id][dspawnZ] = z; dsData[id][dspawnfA] = fA; mysql_format(connectionID, query, sizeof(query), "UPDATE `dealerships` SET `spawnposx` = '%f', `spawnposy` = '%f', `spawnposz` = '%f', `spawnposfa` = '%f' WHERE `id` = '%d'", x, y, z, fA, dsData[id][dID]); mysql_tquery(connectionID, query); format(str, sizeof(str), "You have set the spawn position of dealership id %i to %f, %f, %f, %f.", id, x, y, z, fA); SendClientMessage(playerid, COLOR_GREY, str); return 1; } CMD:editdsname(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); new id, name[40], str[300], query[200]; if(sscanf(params, "is[40]", id, name)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /editdsname "); if(!Iter_Contains(DealerShip, id)) return SendClientMessage(playerid, COLOR_GREY, "Invalid dealership id."); mysql_format(connectionID, query, sizeof(query), "UPDATE `dealerships` SET `name` = '%s' WHERE `id` = '%d'", name, dsData[id][dID]); mysql_tquery(connectionID, query); dsData[id][dName] = name; new txt[400]; format(txt, sizeof(txt), "%s %s", name, GetDealerShipType(id)); UpdateDynamic3DTextLabelText(dsData[id][dLabel], COLOR_YELLOW, txt); format(str, sizeof(str), "You have changed the name of dealership id %i to %s.", id, name); SendClientMessage(playerid, COLOR_GREY, str); return 1; } CMD:gotods(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); new id, str[200]; if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /gotods "); if(!Iter_Contains(DealerShip, id)) return SendClientMessage(playerid, COLOR_GREY, "Invalid dealership id."); SetPlayerPos(playerid, dsData[id][dX], dsData[id][dY], dsData[id][dZ]); format(str, sizeof(str), "You have teleported to dealership id %i.", id); SendClientMessage(playerid, COLOR_GREY, str); return 1; } CMD:destroyds(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 9) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); new id, str[200]; if(sscanf(params, "i", id)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /destroyds "); if(!Iter_Contains(DealerShip, id)) return SendClientMessage(playerid, COLOR_GREY, "Invalid dealership id."); DestroyDealerShip(id); format(str, sizeof(str), "You have successfully destroyed dealership id %d.", id); SendClientMessage(playerid, COLOR_GREY, str); SendClientMessage(playerid, COLOR_GREY, "You need to restart the server NOW or a bug will occur in /findds."); return 1; } GetNearestDealerShip(playerid, type) { new Float:x, Float:y, Float:z, Float: Distance, Float: range, Float: OldDistance,ds=-1; GetPlayerPos(playerid, x, y, z); if(type==-1) // if type = -1, nearest dealership will be returned no matter what type it has. { foreach(new dsid : DealerShip) { Distance = GetDistance(x, y, z, dsData[dsid][dX], dsData[dsid][dY], dsData[dsid][dZ]); range = dsData[dsid][dRange]; if(dsid == 0) OldDistance = range +1; if(Distance <= range && Distance <= OldDistance) { ds = dsid; OldDistance = Distance; } } } else { foreach(new dsid : DealerShip) { if(dsData[dsid][dType] == type) { Distance = GetDistance(x, y, z, dsData[dsid][dX], dsData[dsid][dY], dsData[dsid][dZ]); range = dsData[dsid][dRange]; if(dsid == 0) OldDistance = range +1; if(Distance <= range && Distance <= OldDistance) { ds = dsid; OldDistance = Distance; } } } } return ds; } GetDistance( Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2 ) { return floatround( floatsqroot( ( ( x1 - x2 ) * ( x1 - x2 ) ) + ( ( y1 - y2 ) * ( y1 - y2 ) ) + ( ( z1 - z2 ) * ( z1 - z2 ) ) ) ); } AddDealerShip(mysql_id, name[40], type, Float: range, Float: x, Float: y, Float: z, Float: spawnx, Float: spawny, Float: spawnz, Float: spawnfA) { new i = Iter_Free(DealerShip); dsData[i][dID] = mysql_id; dsData[i][dX] = x; dsData[i][dY] = y; dsData[i][dZ] = z; dsData[i][dRange] = range; dsData[i][dType] = type; dsData[i][dName] = name; dsData[i][dspawnX] = spawnx; dsData[i][dspawnY] = spawny; dsData[i][dspawnZ] = spawnz; dsData[i][dspawnfA] = spawnfA; new mid, txt[400]; format(txt, sizeof(txt), "%s %s", name, GetDealerShipType(i)); dsData[i][dLabel] = CreateDynamic3DTextLabel(txt, COLOR_YELLOW, x, y, z, 10.0); dsData[i][dPickUp] = CreateDynamicPickup(1274, 1, x, y, z); Iter_Add(DealerShip, i); switch(type) { case 0,1: mid = 55; // car case 2: mid = 5; // plane case 3: mid = 9; // boat default: mid = 55; } dsData[i][dMapIcon] = CreateDynamicMapIcon(x, y, z, mid, 0, -1, -1); return 1; } GetDealerShipType(id) { new name[200]; switch(dsData[id][dType]) { case 0: name = "Car Dealership\nEnter a vehicle and use /buyvehicle to purchase it.\n/upgradevehicle for upgrades."; case 1: name = "Bike Dealership\nEnter a vehicle and use /buyvehicle to purchase it."; case 2: name = "Plane Dealership\nEnter a vehicle and use /buyvehicle to purchase it."; case 3: name = "Boat Dealership\nEnter a vehicle and use /buyvehicle to purchase it."; default: name = "Not specified"; } return name; } DestroyDealerShip(id) { if(id == -1) return printf("You passed invalid vehid to DestroyDealerShip(id)"); new query[200]; mysql_format(connectionID, query, sizeof(query), "DELETE FROM `dealerships` WHERE `id` = '%d'", dsData[id][dID]); mysql_tquery(connectionID,query); RemoveDealerShip(id); return 1; } RemoveDealerShip(id) // remove it on server shutdown or on destroying a vehicle { if(id == -1) return printf("You passed invalid vehid to RemoveDealerShip(id)"); dsData[id][dID] = -1; dsData[id][dX] = -1; dsData[id][dY] = -1; dsData[id][dZ] = -1; dsData[id][dspawnX] = -1; dsData[id][dspawnY] = -1; dsData[id][dspawnZ] = -1; dsData[id][dspawnfA] = -1; dsData[id][dRange] = -1; dsData[id][dType] = -1; DestroyDynamic3DTextLabel(dsData[id][dLabel]); DestroyDynamicPickup(dsData[id][dPickUp]); DestroyDynamicMapIcon(dsData[id][dMapIcon]); Iter_Remove(DealerShip, id); return 1; } forward LoadDealerShips(); public LoadDealerShips() { new rows = cache_get_row_count(connectionID); dships = rows; if(rows) { new mysql_id, Float: x, Float: y, Float: z, Float: spawnx, Float: spawny, Float: spawnz, Float: spawnfA, name[40], Float: range, type ; for(rows=0; rows "); if( 0 <= level <= 100 ) { PlayerInfo[giveid][pHunger] = level; format(str, sizeof(str), "You have set %s's hunger to %i.", GetPlayerNameEx(giveid), level); SendClientMessage(playerid, COLOR_GREY, str); if(level != 0) { if(PlayerInfo[giveid][pLoseReason] == REASON_HUNGER || PlayerInfo[giveid][pLoseReason] == REASON_ALL) { PlayerInfo[giveid][pLoseReason] = -1; KillTimer(PlayerInfo[giveid][pLoseHealth]); } } } else SendClientMessage(playerid, COLOR_GREY, "Invalid hunger level. [0-100]"); return 1; } CMD:setthirst(playerid, params[]) { if(PlayerInfo[playerid][pAdmin] < 7) return SendClientMessage(playerid, COLOR_GREY, "You can't use this command"); new giveid, level, str[200]; if(sscanf(params, "ui", giveid, level)) return SendClientMessage(playerid, COLOR_GREY, "{00BFFF}Usage:{FFFFFF} /setthirst "); if( 0 <= level <= 100 ) { PlayerInfo[giveid][pThirst] = level; format(str, sizeof(str), "You have set %s's thirst to %i.", GetPlayerNameEx(giveid), level); SendClientMessage(playerid, COLOR_GREY, str); if(level != 0) { if(PlayerInfo[giveid][pLoseReason] == REASON_THIRST || PlayerInfo[giveid][pLoseReason] == REASON_ALL) { PlayerInfo[giveid][pLoseReason] = -1; KillTimer(PlayerInfo[giveid][pLoseHealth]); } } } else SendClientMessage(playerid, COLOR_GREY, "Invalid thirst level. [0-100]"); return 1; } CMD:mask(playerid, params[]) { new string[92]; if(!PlayerInfo[playerid][pMask]) return SendClientMessage(playerid, COLOR_GREY, "* You haven't purchased a mask from 24/7 yet!"); switch(PlayerInfo[playerid][pMaskOn]) { case false: { PlayerInfo[playerid][pMaskID] = (random(10000) + playerid + 1); PlayerInfo[playerid][pMaskOn] = true; format(string, sizeof(string), "* Your maskID is %d.", PlayerInfo[playerid][pMaskID]); SendClientMessage(playerid, 0x33AA33FF, string); if(IsPlayerAttachedObjectSlotUsed(playerid, 9)) RemovePlayerAttachedObject(playerid, 9); SetPlayerAttachedObject(playerid, 9, 19036,2, 0.093999, 0.026000, -0.004999, 93.800018, 82.199951, -3.300001, 1.098000, 1.139999, 1.173000); for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) if(i != playerid) { if(IsPlayerStreamedIn(i, playerid)) { ShowPlayerNameTagForPlayer(i, playerid, 0); } } if(IsValidDynamic3DTextLabel(PlayerInfo[playerid][pMaskLabel])) DestroyDynamic3DTextLabel(PlayerInfo[playerid][pMaskLabel]); format(string, sizeof(string), "Stranger_%d", PlayerInfo[playerid][pMaskID]); PlayerInfo[playerid][pMaskLabel] = CreateDynamic3DTextLabel(string, -1, 0, 0, 0.10, 25, playerid, .streamdistance = 10); // Change stream distance to the current nametag distance to match up. SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s puts his mask on his face.", GetPlayerRPName(playerid)); // Add /me line - wears mask on? } case true: { for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) if(i != playerid) { if(IsPlayerStreamedIn(i, playerid)) { ShowPlayerNameTagForPlayer(i, playerid, 1); } } PlayerInfo[playerid][pMaskID] = -1; PlayerInfo[playerid][pMaskOn] = false; RemovePlayerAttachedObject(playerid, 9); DestroyDynamic3DTextLabel(PlayerInfo[playerid][pMaskLabel]); SendProximityMessage(playerid, 20.0, COLOR_PURPLE, "** %s puts away his mask.", GetPlayerRPName(playerid)); // Add /me line - wears mask off? } } return 1; } CMD:listmasked(playerid, params[]) { new string[100], p_Name[24]; if(!PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, -1, "You are not authorized to use this command."); SendClientMessage(playerid, 0x33AA33FF, "Listing all masked players..."); for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) { if(PlayerInfo[i][pMaskOn] && PlayerInfo[i][pMask]) { GetPlayerName(i, p_Name, sizeof(p_Name)); format(string, sizeof(string), "[ID: %d] %s (%d)", i, p_Name, PlayerInfo[i][pMaskID]); SendClientMessage(playerid, -1, string); } } return 1; } CMD:tune(playerid, params[]) { if(!IsPlayerInRangeOfPoint(playerid, 5.0, -83.6833,1124.6606,19.7422)) { return SendClientMessage(playerid, COLOR_GREY, "You are not at the modding garage location at Temple."); } if(PlayerInfo[playerid][pCash] < 500) { return SendClientMessage(playerid, COLOR_GREY, "You can't afford for this operation."); } new playerstate = GetPlayerState(playerid); if(playerstate == PLAYER_STATE_DRIVER) { ShowPlayerDialog(playerid, DIALOG_TYPE_MAIN, DIALOG_STYLE_LIST, "Car Tuning Menu", "Hoods\nVents\nLights\nExhausts\nFront Bumpers\nRear Bumpers\nRoofs\nSpoilers\nSide Skirts\nBullbars\nWheels\nCar Stereo\nHydraulics\nNitrous Oxide\nRepair Car", "Enter", "Close"); GivePlayerCash(playerid, -500); return 1; } else { return SendClientMessage(playerid, COLOR_LIGHTRED, "You cannot modify/tune a car unless you are the driver."); } } CMD:setforsale(playerid, params[]) { new askingprice, forsale[264], vehicleid = GetPlayerVehicleID(playerid); if(!vehicleid || !IsVehicleOwner(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any vehicle of yours."); } if(VehicleInfo[vehicleid][vForSale]) return SendClientMessage(playerid, COLOR_GREY, "This vehicle is already for sale."); if(!PlayerInfo[playerid][pPhone]) return SendClientMessage(playerid, COLOR_GREY, "You don't have any phone setup."); if(sscanf(params, "i", askingprice)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /setforsale [price]"); if(askingprice < 1 || askingprice > 2000000) return SendClientMessage(playerid, COLOR_GREY, "Price must be between $1 and $20,000,00."); VehicleInfo[vehicleid][vForSale] = true; VehicleInfo[vehicleid][vForSalePrice] = askingprice; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET forsale = 1, forsaleprice = %i WHERE id = %i", askingprice, VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); format(forsale, sizeof(forsale), "FOR SALE\n%s - %s\nPh: %i.", GetVehicleName(vehicleid), FormatNumber(VehicleInfo[vehicleid][vForSalePrice]), PlayerInfo[playerid][pPhone]); VehicleInfo[vehicleid][vForSaleLabel] = CreateDynamic3DTextLabel(forsale, COLOR_GREY2, 0.0, 0.0, 0.0, 10.0, INVALID_PLAYER_ID, vehicleid, 1, -1, 0, -1, 30.0); SendClientMessageEx(playerid, COLOR_WHITE, "You have set your %s for sale with an asking price of $%s.", GetVehicleName(vehicleid), FormatNumber(VehicleInfo[vehicleid][vForSalePrice])); return 1; } CMD:cancelforsale(playerid, params[]) { new vehicleid = GetPlayerVehicleID(playerid); if(!vehicleid || !IsVehicleOwner(playerid, vehicleid)) { return SendClientMessage(playerid, COLOR_GREY, "You are not inside any vehicle of yours."); } if(!VehicleInfo[vehicleid][vForSale]) return SendClientMessage(playerid, COLOR_GREY, "This vehicle is not for sale."); VehicleInfo[vehicleid][vForSale] = false; VehicleInfo[vehicleid][vForSalePrice] = 0; mysql_format(connectionID, queryBuffer, sizeof(queryBuffer), "UPDATE vehicles SET forsale = 0, forsaleprice = 0 WHERE id = %i", VehicleInfo[vehicleid][vID]); mysql_tquery(connectionID, queryBuffer); DestroyDynamic3DTextLabel(VehicleInfo[vehicleid][vForSaleLabel]); SendClientMessageEx(playerid, COLOR_WHITE, "You have cancelled the sale of your %s.", GetVehicleName(vehicleid)); return true; } CMD:elm(playerid, params[]) { new vehicleid,panels,doors,lights,tires; vehicleid = GetPlayerVehicleID(playerid); if(!IsLawEnforcement(playerid) || !(GetFactionType(playerid) == FACTION_MEDIC)) return SendClientMessage(playerid, -1, "You are not authorized to use this command."); if(!Flasher[vehicleid]) { if (GetPlayerState(playerid) != PLAYER_STATE_DRIVER) { return SendClientMessage(playerid, -1, "You must be in a vehicle in order to use this command"); } if (!GetVehicleModel(vehicleid)) return SendClientMessage(playerid, -1, "You must be in a vehicle in order to use this command"); if (IsValidObject(obj[vehicleid]) || IsValidObject(obj2[vehicleid])) { SendClientMessage(playerid, -1, "You switched off the sirens."), DestroyObject(obj[vehicleid]), DestroyObject(obj2[vehicleid]); GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); if(LightPwr[vehicleid] == 1) UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires); else UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires); Flasher[vehicleid] = 0; } switch (GetVehicleModel(vehicleid)) { case 596: { obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); obj2[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000); AttachObjectToVehicle(obj2[vehicleid], vehicleid, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000); GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); Flasher[vehicleid] = 1; } case 597: { obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); obj2[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000); AttachObjectToVehicle(obj2[vehicleid], vehicleid, -0.599999,-0.375000,0.899999,0.000000,0.000000,0.000000); GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); Flasher[vehicleid] = 1; } case 598: { obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); obj2[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.524999, -0.300000, 0.899999, 0.000000, 0.000000, 0.000000); AttachObjectToVehicle(obj2[vehicleid], vehicleid, -0.524999, -0.300000, 0.899999, 0.000000, 0.000000, 0.000000); GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); Flasher[vehicleid] = 1; } case 599: { obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); obj2[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.524999,0.000000,1.125000,0.000000,0.000000,0.000000); AttachObjectToVehicle(obj2[vehicleid], vehicleid, -0.524999,0.000000,1.125000,0.000000,0.000000,0.000000); GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); Flasher[vehicleid] = 1; } case 541://bullet { obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.375000,0.524999,0.375000,0.000000,0.000000,0.000000); GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); Flasher[vehicleid] = 1; } case 426://premier { obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.524999,0.749999,0.375000,0.000000,0.000000,0.000000); GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); Flasher[vehicleid] = 1; } case 427://enforcer { GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); Flasher[vehicleid] = 1; } case 416://Ambulance { GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); Flasher[vehicleid] = 1; } case 407://FireTruck { GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); Flasher[vehicleid] = 1; } case 560://sultan { obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.225000,0.750000,0.449999,0.000000,0.000000,0.000000); GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); Flasher[vehicleid] = 1; } case 490://FBI { obj[vehicleid] = CreateObject(18646, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); AttachObjectToVehicle(obj[vehicleid], vehicleid, 0.000000,1.125000,0.599999,0.000000,0.000000,0.000000); GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); Flasher[vehicleid] = 1; } default: { return SendClientMessage(playerid, -1, "You switched on the sirens."); } } return SendClientMessage(playerid, -1, "You switched on the sirens."); } else { if (IsValidObject(obj[vehicleid]) || IsValidObject(obj2[vehicleid])) { SendClientMessage(playerid, -1, "You switched off the sirens."), DestroyObject(obj[vehicleid]), DestroyObject(obj2[vehicleid]); } GetVehicleDamageStatus(vehicleid,panels,doors,lights,tires); if(LightPwr[vehicleid] == 1) UpdateVehicleDamageStatus(vehicleid, panels, doors, 0, tires); else UpdateVehicleDamageStatus(vehicleid, panels, doors, 5, tires); Flasher[vehicleid] = 0; } return 1; } public FlasherFunc() { new panelsx,doorsx,lightsx,tiresx; for (new p=0; p