Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //includes
- #include <a_samp>
- #include <Dini>
- #include <dudb>
- #include <zcmd>
- #include <streamer>
- #include <djson>
- #include <SII>
- #define MAX_HOUSES 100
- #define LABELS 0xFFFF00FF
- #define MAX_GROUPS 20
- #define NICESKY 0x00C2ECFF
- #define PINK 0xD52DFFFF
- #define GROUP_CHAT 0xC0FAFAFF
- #define MAX_GROUPS 20
- #define ME 0x00C2ECFF
- //new Checkpoint[MAX_PLAYERS];
- new OnDuty[MAX_PLAYERS];
- new AdminDuty[MAX_PLAYERS];
- new InBank[MAX_PLAYERS];
- new InClothesShop[MAX_PLAYERS];
- new Afk[MAX_PLAYERS];
- new UnconfirmedSave[MAX_PLAYERS];
- new Prison1Int, Prison1World;
- new Float: Prison1X, Float: Prison1Y, Float: Prison1Z;
- new Float: ClothesExtX, Float: ClothesExtY, Float: ClothesExtZ;
- new Float: ClothesIntX, Float: ClothesIntY, Float: ClothesIntZ;
- new ClothesIntID;
- new Float: BankIntX, Float: BankIntY, Float: BankIntZ;
- new Float: BankExtX, Float: BankExtY, Float: BankExtZ;
- new Float: SpawnX, Float: SpawnY, Float: SpawnZ;
- new BankIntID;
- new Float: DepartmentIntX, Float: DepartmentIntY, Float: DepartmentIntZ;
- new Float: DepartmentExtX, Float: DepartmentExtY, Float: DepartmentExtZ;
- new DepartmentIntID;
- new InHQ[MAX_PLAYERS];
- new fishname[0][0] =
- {
- {"BlueGill"},
- {"Bass"},
- {"Cod"},
- {"Shark"},
- {"CatFish"},
- {"Polack"},
- {"Swordfish"},
- {"Lobster"},
- {"Crab"},
- {"Sunfish"}
- };
- new whalename[0][0] =
- {
- {"Humpback Whale"},
- {"Sperm Whale"},
- {"Blue Whale"},
- {"Fin Whale"},
- {"Killer Whale"}
- };
- new whaletype[0][0] =
- {
- {"HUGE"},
- {"GIGANTIC"},
- {"VERY RARE"},
- {"VERY LARGE"},
- {"EXTREMELY RARE"}
- };
- new Fishing[MAX_PLAYERS];
- new stock ScoreTimer;
- new stock HospitalTimer;
- new stock OneMinuteTimer;
- new stock OneSecondTimer;
- new stock FishTimer;
- new stock UpdateTimer;
- new stock PickupsTimer;
- new Text: TextdrawConnect;
- //new Checkpoint[MAX_PLAYERS];
- new UnmodifiableVehicles[29] =
- {
- 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
- };
- new Hood[MAX_VEHICLES];
- new Trunk[MAX_VEHICLES];
- new Engine[MAX_VEHICLES];
- new Lights[MAX_VEHICLES];
- new realchat = 1;
- new BigEar[MAX_PLAYERS];
- new Text:Time1;
- new Float:svx[MAX_PLAYERS]; // Holds Velocity X
- new Float:svy[MAX_PLAYERS]; // Holds Velocity Y
- new Float:svz[MAX_PLAYERS]; // Holds Velocity Z
- new Float:s11[MAX_PLAYERS]; // This Is What Our Forumula Outputs
- new s21[MAX_PLAYERS]; // This Is The Output When The Forumula's Ouput Is Round
- new s3[MAX_PLAYERS][256]; // This Is The Text That Is Displayed To The User
- new Text:sdisplay[MAX_PLAYERS]; // This Holds The Textdraw's ID
- new stimer[MAX_PLAYERS]; // This Holds The Timer's ID (Used To Refresh Speed)
- new Text:Zones[MAX_PLAYERS];
- new Timeshow[MAX_PLAYERS];
- //new iSpawnSet[MAX_PLAYERS];
- //new Checkpoint[MAX_PLAYERS];
- new WeaponNames[47][] =
- {
- "0 - Fists", "1 - Brass Knuckles", "2 - Golf Club", "3 - Nite Stick", "4 - Knife", "5 - Baseball Bat", "6 - Shovel", "7 - Pool Cue", "8 - Katana", "9 - Chainsaw", "10 - Purple Dildo", "11 - Small White Vibrator", "12 - Large White Vibrator", "13 - Silver Vibrator",
- "14 - Flowers", "15 - Cane", "16 - Grenade", "17 - Tear Gas", "18 - Molotov Cocktail", "19 - Jetpack", "20 - Nothing", "21 - Nothing", "22 - Colt 45 (9mm)", "23 - Silenced Pistol", "24 - Desert Eagle", "25 - Pump Action Shotgun", "26 - Sawn-off Shotgun", "27 - SPAS-12 (Combat Shotgun",
- "28 - Micro SMG", "29 - MP5", "30 - AK47", "31 - M4A1", "32 - Tec-9", "33 - Country Rifle", "34 - Sniper Rifle", "35 - Rocket Launcher", "36 - HS Rocket Launcher", "37 - Flamethrower", "38 - Minigun", "39 - Satchel Charge", "40 - Detonator", "41 - Spraycan", "42 - Fire Extinguisher",
- "43 - Camera", "44 - Nightvision Goggles", "45 - Thermal Goggles", "46 - Parachute"
- };
- new gPlayerLogged[MAX_PLAYERS];
- new AdminSpawned[MAX_VEHICLES];
- new SpawnedVehicles;
- new CarCount;
- //defines
- #define NOTADMIN "You are not an administrator!"
- #define COL_LIGHTBLUE "{00CED1}"
- #define COLOR_GREY 0xAFAFAFAA
- #define COLOR_FADE1 0xE6E6E6E6
- #define COLOR_FADE2 0xC8C8C8C8
- #define COLOR_FADE3 0xAAAAAAAA
- #define COLOR_FADE4 0x8C8C8C8C
- #define COLOR_FADE5 0x6E6E6E6E
- #define COLOR_PURPLE 0xCA6DCFAA
- #define COLOR_WHITE 0xFFFFFFAA
- #define COLOR_GRAD2 0xBFC0C2FF
- #define MEDIC 0xFF00FF00
- #define COLOR_YELLOW 0x00FFFF
- #define COLOR_RED 0x00FFFF
- #define DEATH 0xF70000FF
- #define WIN 0x00FF00FF
- #define ARMY 0x008431FF
- #define BLOODS 0xFF0000FF
- #define LOGIN 0x00FFFFFF
- #define POLICE 0x0018FFFF
- #define BALLAS 0xA500FFFF
- #define DM 0xFFFF00FF
- #define GROVE 0x00FF00FF
- #define RED 0xFF0000FF
- #define MAX_ZONE_NAME 28
- #define BLUE 0x00FFFFFF
- #define STATS 0xFF7900FF
- #define REMINDER 0xFF00FFFF
- #define NEWBIE 0xFF00FF00
- #define AFK 0x4A49AFF
- #define GREEN 0x21DD00FF
- #define YELLOW 0xFFFF00FF
- #define ORANGE 0xF97804FF
- #define LIGHTRED 0xFF8080FF
- #define PURPLE 0xB360FDFF
- #define DEPARTMENT_CHAT 0xBDF38BFF
- #define VIP_CHAT 0xE1FCFFFF
- #define PLAYER_COLOR 0xFFFFFFFF
- #define GROUP_CHAT 0xC0FAFAFF
- #define LIGHTGREEN 0x38FF06FF
- #define RADIO_CHAT 0xBCC1F3FF
- #define DARKPINK 0xE100E1FF
- #define PLAYERCOM 0xD5EAFFFF
- #define DARKGREEN 0x008040FF
- #define ANNOUNCEMENT 0xa9c4e4ff
- #define GREY 0xCECECEFF
- #define DARKGREY 0x626262FF
- #define OOC_CHAT 0xAFD9FAFF
- #define NEWBIE_CHAT 0xDBE1E6FF
- #define AQUAGREEN 0x03D687FF
- #define ADMINBLUE 0x99FFFFAA
- #define ADMINORANGE 0xF6970CAA
- #define WHITE 0xFFFFFFFF
- #define BLACK 0x000000FF
- #define VERSION "v1.0"
- #define VEHICLES_FILE "Vehicles.json"
- #pragma unused ret_memcpy
- #define SERVER_USER_FILE "UserFiles/%s.ini"
- //forwards
- forward OneMinutePublic(playerid);
- forward OneSecondPublic(playerid);
- forward SendToAdmins(colour, string[], requireduty);
- forward UpdatePublic(playerid);
- forward PurchaseCar(playerid, carid, price, slotid);
- forward NearByMessage(playerid, colour, string[]);
- forward PickupMessages();
- forward FishPublic(playerid);
- forward WhalePublic(playerid);
- forward IsPlayerInInvalidNosVehicle(playerid);
- forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
- forward settime(playerid);
- forward Zones_Update();
- forward speedometer(playerid); // This Forwards The Timer To Our Function
- forward SetPlayerRandomSpawn(playerid);
- //forward SetupPlayerForClassSelection(playerid);
- forward DynamicWeather();
- forward NearByMessageEx(playerid, color, string[], Float: range);
- forward NearByMessage(playerid, colour, string[]);
- forward GivePlayerSavedWeapons(playerid);
- forward GivePlayerWeaponEx(playerid, weapon);
- forward SetPlayerPosEx(playerid, Float: posx, Float: posy, Float: posz, interior, virtualworld);
- forward SendToAdmins(colour, string[], requireduty);
- //enums
- enum GroupData
- {
- gIntID,
- Float: gIntX,
- Float: gIntY,
- Float: gIntZ,
- gExtID,
- Float: gExtX,
- Float: gExtY,
- Float: gExtZ,
- gPickupID,
- gName[255],
- };
- new Groups[MAX_GROUPS][GroupData];
- enum HouseData
- {
- hInteriorID,
- Float: hInteriorX,
- Float: hInteriorY,
- Float: hInteriorZ,
- HousePrice,
- hExteriorID,
- Float: hExteriorX,
- Float: hExteriorY,
- Float: hExteriorZ,
- HPickupID,
- hOwner[255],
- };
- new Houses[MAX_HOUSES][HouseData];
- enum SAZONE_MAIN { //Betamaster
- SAZONE_NAME[28],
- Float:SAZONE_AREA[6]
- };
- enum SpecData
- {
- Float: SpecPlayerX,
- Float: SpecPlayerY,
- Float: SpecPlayerZ,
- SpecPlayerInterior,
- Float: SpecPlayerAngle,
- SpecPlayerWorld,
- SpecSpectatingPlayer,
- SpecSpectatingState,
- };
- new Spectator[MAX_PLAYERS][SpecData];
- new SpawnedHouses;
- new SpawnedGroups;
- new Float: OwnedCarSpawnX, Float: OwnedCarSpawnY, Float: OwnedCarSpawnZ;
- new OwnedCarCount;
- enum pInfo
- {
- pAdminLevel,
- PendingPay,
- CarModDelay,
- pCash,
- pScore,
- pJob,
- PlayerSpawn,
- Group,
- GroupRank,
- PendingHandshake,
- PendingGroupInvite,
- PendingGroup,
- PendingHandshakeStyle,
- PendingHeal,
- pMats,
- BankMoney,
- Minutes,
- Seconds,
- FishRod,
- CarBeingCarried,
- CarPriceCarried,
- CarPriceBeingCarried,
- GivingSlot,
- PendingCarReceival,
- Float: CarX,
- Float: CarY,
- Float: CarZ,
- Float: Car2X,
- Float: Car2Y,
- Float: Car2Z,
- Float: Car3X,
- Float: Car3Y,
- Float: Car3Z,
- PlayerCarModel,
- PlayerCarModel2,
- PlayerCarModel3,
- Float: CarZAngle,
- Float: Car2ZAngle,
- Float: Car3ZAngle,
- CarCol1,
- CarCol2,
- Car2Col1,
- Car2Col2,
- Car3Col1,
- Car3Col2,
- CarLinkID,
- Car2LinkID,
- Car3LinkID,
- CarPaintJobID,
- Car2PaintJobID,
- Car3PaintJobID,
- FishBait,
- FishLicense,
- Fish,
- FishWeight,
- PrisonDuration,
- PrisonID,
- InHouse,
- WepSlot0,
- WepSlot1,
- WepSlot2,
- WepSlot3,
- WepSlot4,
- WepSlot5,
- WepSlot6,
- WepSlot7,
- WepSlot8,
- WepSlot9,
- WepSlot10,
- WepSlot11,
- WepSlot12,
- WepSlot13,
- WepSlot14,
- WepSlot15,
- Skin,
- House,
- HouseInterior,
- HouseExterior,
- GroupExterior,
- GroupInterior,
- Float: hExtX,
- Float: hExtY,
- Float: hExtZ,
- Float: hIntX,
- Float: hIntY,
- Float: hIntZ,
- hIntID,
- hExtID,
- Float: gExtX,
- Float: gExtY,
- Float: gExtZ,
- Float: gIntX,
- Float: gIntY,
- Float: gIntZ,
- gIntID,
- gExtID,
- Kills,
- Deaths,
- Animation,
- BeingDraggedBy,
- pLevel,
- }
- new PlayerInfo[MAX_PLAYERS][pInfo];
- enum VehicleData
- {
- CarModel,
- CarColour1,
- CarColour2,
- CarNos,
- CarGroup,
- Float: CarPosX,
- Float: CarPosY,
- Float: CarPosZ,
- Float: CarZAngle,
- GameID,
- };
- /*new UnmodifiableVehicles[29] =
- {
- 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
- };*/
- new GlobalWeather;
- new stock WeatherTimer;
- new Vehicles[MAX_VEHICLES][VehicleData];
- new VehicleNames[212][] =
- {
- "400 - Landstalker", "401 - Bravura", "402 - Buffalo", "403 - Linerunner", "404 - Pereniel", "405 - Sentinel", "406 - Dumper", "407 - Firetruck", "408 - Trashmaster", "409 - Stretch",
- "410 - Manana", "411 - Infernus", "412 - Voodoo", "413 - Pony", "414 - Mule", "415 - Cheetah", "416 - Ambulance", "417 - Leviathan", "418 - Moonbeam", "419 - Esperanto", "420 - Taxi",
- "421 - Washington", "422 - Bobcat", "423 - Mr Whoopee", "424 - BF Injection", "425 - Hunter", "426 - Premier", "427 - Enforcer", "428 - Securicar", "429 - Banshee", "430 - Predator",
- "431 - Bus", "432 - Rhino", "433 - Barracks", "434 - Hotknife", "435 - Trailer", "436 - Previon", "437 - Coach", "438 - Cabbie", "439 - Stallion", "440 - Rumpo", "441 - RC Bandit", "442 - Romero",
- "443 - Packer", "444 - Monster", "445- Admiral", "446 - Squalo", "447 - Seasparrow", "448 - Pizzaboy", "449 - Tram", "450 - Trailer", "451 - Turismo", "452 - Speeder", "453 - Reefer", "454 - Tropic", "455 - Flatbed",
- "456 - Yankee", "457 - Caddy", "458 - Solair", "459 - Berkley's RC Van", "460 - Skimmer", "461 - PCJ-600", "462 - Faggio", "463 - Freeway", "464 - RC Baron", "465 - RC Raider",
- "466 - Glendale", "467 - Oceanic", "468 - Sanchez", "469 - Sparrow", "470 - Patriot", "471 - Quad", "472 - Coastguard", "473 - Dinghy", "474 - Hermes", "475 - Sabre", "476 - Rustler",
- "477 - ZR350", "478 - Walton", "479 - Regina", "480 - Comet", "481 - BMX", "482 - Burrito", "483 - Camper", "484 - Marquis", "485 - Baggage", "486 - Dozer", "487 - Maverick", "488 - News Chopper",
- "489 - Rancher", "490 - FBI Rancher", "491 - Virgo", "492 - Greenwood", "493 - Jetmax", "494 - Hotring", "495 - Sandking", "496 - Blista Compact", "497 - Police Maverick",
- "498 - Boxville", "499 - Benson", "500 - Mesa", "501 - RC Goblin", "502 - Hotring Racer", "503 - Hotring Racer", "504 - Bloodring Banger", "505 - Rancher", "506 - Super GT",
- "507 - Elegant", "508 - Journey", "509 - Bike", "510 - Mountain Bike", "511 - Beagle", "512 - Cropdust", "513 - Stunt", "514 - Tanker", "515 - RoadTrain", "516 - Nebula", "517 - Majestic",
- "518 - Buccaneer", "519 - Shamal", "520 - Hydra", "521 - FCR-900", "522 - NRG-500", "523 - HPV1000", "524 - Cement Truck", "525 - Tow Truck", "526 - Fortune", "527 - Cadrona", "528 - FBI Truck",
- "529 - Willard", "530 - Forklift", "531 - Tractor", "532 - Combine", "533 - Feltzer", "534 - Remington", "535 - Slamvan", "536 - Blade", "537 - Freight", "538 - Streak", "539 - Vortex", "540 - Vincent",
- "541 - Bullet", "542 - Clover", "543 - Sadler", "544 - Firetruck", "545 - Hustler", "546 - Intruder", "547 - Primo", "548 - Cargobob", "549 - Tampa", "550 - Sunrise", "551 - Merit", "552 - Utility",
- "553 - Nevada", "554 - Yosemite", "555 - Windsor", "556 - Monster", "557 - Monster", "558 - Uranus", "559 - Jester", "560 - Sultan", "561 - Stratum", "562 - Elegy", "563 - Raindance", "564 - RC Tiger",
- "565 - Flash", "566 - Tahoma", "567 - Savanna", "568 - Bandito", "569 - Freight", "570 - Trailer", "571 - Kart", "572 - Mower", "573 - Duneride", "574 - Sweeper", "575 - Broadway",
- "576 - Tornado", "577 - AT-400", "578 - DFT-30", "579 - Huntley", "580 - Stafford", "581 - BF-400", "582 - Newsvan", "583 - Tug", "584 - Trailer", "585 - Emperor", "586 - Wayfarer",
- "587 - Euros", "588 - Hotdog", "589 - Club", "590 - Trailer", "591 - Trailer", "592 - Andromada", "593 - Dodo", "594 - RC Cam", "595 - Launch", "596 - Police Car (LSPD)", "597 - Police Car (SFPD)",
- "598 - Police Car (LVPD)", "599 - Police Ranger", "600 - Picador", "601 - S.W.A.T. Van", "602 - Alpha", "603 - Phoenix", "604 - Glendale", "605 - Sadler", "606 - Luggage Trailer A",
- "607 - Luggage Trailer B", "608 - Stair Trailer", "609 - Boxville", "610 - Farm Plow", "611 - Utility Trailer"
- };
- //stocks + Extras
- stock PutPlayerInTutorial(playerid)
- {
- ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Define OOC", "Out of Control\nOut of Cards\n Out Of Character", "Select", "Cancel");
- return 1;
- }
- stock SpawnPlayerAlways(playerid)
- {
- TogglePlayerSpectating(playerid, false);
- SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], SpawnX, SpawnY, SpawnZ, 90, 0, 0, 0, 0, 0, 0);
- SpawnPlayer(playerid);
- SetPlayerVirtualWorld(playerid, 0);
- TogglePlayerControllable(playerid, true);
- SetCameraBehindPlayer(playerid);
- return 1;
- }
- stock PlayerFacePlayer(playerid, targetplayerid)
- {
- new Float: Angle;
- GetPlayerFacingAngle(playerid, Angle);
- SetPlayerFacingAngle(targetplayerid, Angle+180);
- return true;
- }
- stock split(const strsrc[], strdest[][], delimiter)
- {
- new i, li, len, aNum;
- while(i <= strlen(strsrc))
- {
- if(strsrc[i] == delimiter || i == strlen(strsrc))
- {
- len = strmid(strdest[aNum], strsrc, li, i, 128);
- strdest[aNum][len] = 0;
- li = i+1;
- aNum++;
- }
- i++;
- }
- return 1;
- }
- stock RemovePlayerWeapons(playerid)
- {
- new name[MAX_PLAYER_NAME];
- new file[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- ResetPlayerWeapons(playerid);
- dini_IntSet(file, "WepSlot0",PlayerInfo[playerid][WepSlot0] = 0);
- dini_IntSet(file, "WepSlot1",PlayerInfo[playerid][WepSlot1] = 0);
- dini_IntSet(file, "WepSlot2",PlayerInfo[playerid][WepSlot2] = 0);
- dini_IntSet(file, "WepSlot3",PlayerInfo[playerid][WepSlot3] = 0);
- dini_IntSet(file, "WepSlot4",PlayerInfo[playerid][WepSlot4] = 0);
- dini_IntSet(file, "WepSlot5",PlayerInfo[playerid][WepSlot5] = 0);
- dini_IntSet(file, "WepSlot6",PlayerInfo[playerid][WepSlot6] = 0);
- dini_IntSet(file, "WepSlot7",PlayerInfo[playerid][WepSlot7] = 0);
- dini_IntSet(file, "WepSlot8",PlayerInfo[playerid][WepSlot8] = 0);
- dini_IntSet(file, "WepSlot9",PlayerInfo[playerid][WepSlot9] = 0);
- dini_IntSet(file, "WepSlot10",PlayerInfo[playerid][WepSlot10] = 0);
- dini_IntSet(file, "WepSlot11",PlayerInfo[playerid][WepSlot11] = 0);
- dini_IntSet(file, "WepSlot12",PlayerInfo[playerid][WepSlot12] = 0);
- dini_IntSet(file, "WepSlot13",PlayerInfo[playerid][WepSlot13] = 0);
- dini_IntSet(file, "WepSlot14",PlayerInfo[playerid][WepSlot14] = 0);
- dini_IntSet(file, "WepSlot15",PlayerInfo[playerid][WepSlot15] = 0);
- return 1;
- }
- stock IsAnOwnedCar(linkid)
- {
- new tmpcount;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(PlayerInfo[i][CarLinkID] == linkid) tmpcount++;
- if(PlayerInfo[i][Car2LinkID] == linkid) tmpcount++;
- if(PlayerInfo[i][Car3LinkID] == linkid) tmpcount++;
- }
- if(tmpcount >= 1)
- {
- return true;
- }
- else return false;
- }
- IsKeyJustDown(key, newkeys, oldkeys)
- {
- if((newkeys & key) && !(oldkeys & key)) return 1;
- return 0;
- }
- StopLoopingAnimation(playerid)
- {
- ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
- }
- stock SpawnOwnedCar(playerid, slotid)
- {
- if(IsPlayerConnected(playerid))
- {
- switch(slotid)
- {
- case 1:
- {
- if(PlayerInfo[playerid][PlayerCarModel] >= 1)
- {
- if(PlayerInfo[playerid][CarLinkID] >= 1)
- {
- DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
- PlayerInfo[playerid][CarLinkID] = 0;
- }
- CarCount++;
- OwnedCarCount++;
- PlayerInfo[playerid][CarLinkID] = CreateVehicle(PlayerInfo[playerid][PlayerCarModel], PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ], PlayerInfo[playerid][CarZAngle], PlayerInfo[playerid][CarCol1], PlayerInfo[playerid][CarCol2], -1);
- if(GetVehicleModel(PlayerInfo[playerid][CarLinkID]) != PlayerInfo[playerid][PlayerCarModel])
- {
- DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
- PlayerInfo[playerid][CarLinkID] = 0;
- PlayerInfo[playerid][CarLinkID] = CreateVehicle(PlayerInfo[playerid][PlayerCarModel], PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ], PlayerInfo[playerid][CarZAngle], PlayerInfo[playerid][CarCol1], PlayerInfo[playerid][CarCol2], -1);
- }
- ChangeVehiclePaintjob(PlayerInfo[playerid][CarLinkID], PlayerInfo[playerid][CarPaintJobID]);
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][PlayerCarModel2] >= 1)
- {
- if(PlayerInfo[playerid][Car2LinkID] >= 1)
- {
- DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
- PlayerInfo[playerid][Car2LinkID] = 0;
- }
- CarCount++;
- OwnedCarCount++;
- PlayerInfo[playerid][Car2LinkID] = CreateVehicle(PlayerInfo[playerid][PlayerCarModel2], PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z], PlayerInfo[playerid][Car2ZAngle], PlayerInfo[playerid][Car2Col1], PlayerInfo[playerid][Car2Col2], -1);
- if(GetVehicleModel(PlayerInfo[playerid][Car2LinkID]) != PlayerInfo[playerid][PlayerCarModel2])
- {
- DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
- PlayerInfo[playerid][Car2LinkID] = 0;
- PlayerInfo[playerid][Car2LinkID] = CreateVehicle(PlayerInfo[playerid][PlayerCarModel2], PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z], PlayerInfo[playerid][Car2ZAngle], PlayerInfo[playerid][Car2Col1], PlayerInfo[playerid][Car2Col2], -1);
- }
- ChangeVehiclePaintjob(PlayerInfo[playerid][Car2LinkID], PlayerInfo[playerid][Car2PaintJobID]);
- }
- }
- case 3:
- {
- if(PlayerInfo[playerid][PlayerCarModel3] >= 1)
- {
- CarCount++;
- OwnedCarCount++;
- PlayerInfo[playerid][Car3LinkID] = CreateVehicle(PlayerInfo[playerid][PlayerCarModel3], PlayerInfo[playerid][Car3X], PlayerInfo[playerid][Car3Y], PlayerInfo[playerid][Car3Z], PlayerInfo[playerid][Car3ZAngle], PlayerInfo[playerid][Car3Col1], PlayerInfo[playerid][Car3Col2], -1);
- if(GetVehicleModel(PlayerInfo[playerid][Car3LinkID]) != PlayerInfo[playerid][PlayerCarModel3])
- {
- DestroyVehicle(PlayerInfo[playerid][Car3LinkID]);
- PlayerInfo[playerid][Car3LinkID] = 0;
- PlayerInfo[playerid][Car3LinkID] = CreateVehicle(PlayerInfo[playerid][PlayerCarModel3], PlayerInfo[playerid][Car3X], PlayerInfo[playerid][Car3Y], PlayerInfo[playerid][Car3Z], PlayerInfo[playerid][Car3ZAngle], PlayerInfo[playerid][Car3Col1], PlayerInfo[playerid][Car3Col2], -1);
- }
- ChangeVehiclePaintjob(PlayerInfo[playerid][Car3LinkID], PlayerInfo[playerid][Car3PaintJobID]);
- }
- }
- }
- }
- }
- stock LoadFiles()
- {
- InitVehicles();
- InitHouses();
- InitGroups();
- CreatePickup(1247, 23, 627.7214, -571.7225, 17.5726, -1);
- Create3DTextLabel("Police Department", LABELS, 627.7214, -571.7225, 17.5726, 100.0, 0, -1);
- Create3DTextLabel("/fishingshop, /sellfish", LABELS, 2160.6680, -98.3544, 2.8150, 100.0, 0, -1);
- Create3DTextLabel("/vbuy", LABELS, 1230.2791,139.5188,20.3028, 30.0, 0, 0);
- CreatePickup(1239, 23, 2111.2566, -98.2426, 2.1183, -1);
- CreatePickup(1239, 23, 2160.6680,-98.3544,2.8150, -1);
- CreatePickup(1239, 23, 1230.2791,139.5188,20.3028, -1);
- Prison1X = dini_Float("Assets.ini", "Prison1X");
- Prison1Y = dini_Float("Assets.ini", "Prison1Y");
- Prison1Z = dini_Float("Assets.ini", "Prison1Z");
- Prison1Int = dini_Int("Assets.ini", "Prison1Int");
- Prison1World = dini_Int("Assets.ini", "Prison1World");
- OwnedCarSpawnX = dini_Int("Assets.ini", "OwnedCarSpawnX");
- OwnedCarSpawnY = dini_Int("Assets.ini", "OwnedCarSpawnY");
- OwnedCarSpawnZ = dini_Int("Assets.ini", "OwnedCarSpawnZ");
- DepartmentIntX = dini_Int("Assets.ini", "DepartmentIntX");
- DepartmentIntY = dini_Int("Assets.ini", "DepartmentIntY");
- DepartmentIntZ = dini_Int("Assets.ini", "DepartmentIntZ");
- DepartmentExtX = dini_Int("Assets.ini", "DepartmentExtX");
- DepartmentExtY = dini_Int("Assets.ini", "DepartmentExtY");
- DepartmentExtZ = dini_Int("Assets.ini", "DepartmentExtZ");
- DepartmentIntID = dini_Int("Assets.ini", "DepartmentIntID");
- BankIntX = dini_Int("Assets.ini", "BankIntX");
- BankIntY = dini_Int("Assets.ini", "BankIntY");
- BankIntZ = dini_Int("Assets.ini", "BankIntZ");
- BankExtX = dini_Int("Assets.ini", "BankExtX");
- BankExtY = dini_Int("Assets.ini", "BankExtY");
- BankExtZ = dini_Int("Assets.ini", "BankExtZ");
- BankIntID = dini_Int("Assets.ini", "BankIntID");
- ClothesExtX = dini_Int("Assets.ini", "ClothesExtX");
- ClothesExtY = dini_Int("Assets.ini", "ClothesExtY");
- ClothesExtZ = dini_Int("Assets.ini", "ClothesExtZ");
- ClothesIntX = dini_Int("Assets.ini", "ClothesIntX");
- ClothesIntY = dini_Int("Assets.ini", "ClothesIntY");
- ClothesIntZ = dini_Int("Assets.ini", "ClothesIntZ");
- ClothesIntID = dini_Int("Assets.ini", "ClothesIntID");
- CreatePickup(1275, 23, ClothesExtX, ClothesExtY, ClothesExtZ, -1);
- Create3DTextLabel("Binco", LABELS, ClothesExtX, ClothesExtY, ClothesExtZ, 100.0, 0, -1);
- CreatePickup(1274, 23, BankExtX, BankExtY, BankExtZ, -1);
- Create3DTextLabel("SA National Bank", LABELS, BankExtX, BankExtY, BankExtZ, 100.0, 0, -1);
- CreatePickup(1275, 23, 207.6361,-100.8324,1005.2578, -1);
- CreatePickup(362, 23, 1302.1343,217.0710,19.5547, -1);
- Create3DTextLabel("Arms Dealer", LABELS, 1302.1343,217.0710,19.5547, 100.0, 0, -1);
- print("Files Loaded!");
- return 1;
- }
- stock InitGroups()
- {
- new FileName[128], GroupName[128];
- for(new i = 0; i < MAX_GROUPS; i++)
- {
- format(FileName, sizeof(FileName), "Groups/Group_%d.ini", i);
- format(GroupName, sizeof(GroupName), "Group_%d's HQ", i);
- if(fexist(FileName))
- {
- Groups[i][gIntID] = dini_Int(FileName, "IntID");
- Groups[i][gIntX] = dini_Float(FileName, "IntX");
- Groups[i][gIntY] = dini_Float(FileName, "IntY");
- Groups[i][gIntZ] = dini_Float(FileName, "IntZ");
- Groups[i][gExtID] = dini_Int(FileName, "ExtID");
- Groups[i][gExtX] = dini_Float(FileName, "ExtX");
- Groups[i][gExtY] = dini_Float(FileName, "ExtY");
- Groups[i][gExtZ] = dini_Float(FileName, "ExtZ");
- Groups[i][gName] = dini_Get(FileName, "Name");
- printf("[system] Group %d spawned.", i);
- Groups[i][gPickupID] = CreateDynamicPickup(1318, 23, Groups[i][gExtX], Groups[i][gExtY], Groups[i][gExtZ], 0, -1, -1, 150.0);
- Create3DTextLabel(GroupName, LABELS, Groups[i][gExtX], Groups[i][gExtY], Groups[i][gExtZ], 100.0, 0, -1);
- SpawnedGroups++;
- }
- }
- return 1;
- }
- stock IsVehicleConnected(vehicleid) //By Sacky (edited by Gabriel "Larcius" Cordes)
- {
- new Float:x1,Float:y1,Float:z1;
- GetVehiclePos(vehicleid,x1,y1,z1);
- if(x1==0.0 && y1==0.0 && z1==0.0)
- {
- return 0;
- }
- return 1;
- }
- stock Float:GetDistanceBetweenPoints(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2) //By Gabriel "Larcius" Cordes
- {
- return floatadd(floatadd(floatsqroot(floatpower(floatsub(x1,x2),2)),floatsqroot(floatpower(floatsub(y1,y2),2))),floatsqroot(floatpower(floatsub(z1,z2),2)));
- }
- stock Float:GetDistanceToPoint(playerid,Float:x1,Float:y1,Float:z1) //By Gabriel "Larcius" Cordes
- {
- if (IsPlayerConnected(playerid))
- {
- new Float:x2,Float:y2,Float:z2;
- GetPlayerPos(playerid,x2,y2,z2);
- return GetDistanceBetweenPoints(x1,y1,z1,x2,y2,z2);
- }
- return INF_FLOAT;
- }
- stock Float:GetDistanceToVehicle(playerid,vehicleid) //By Darkrealm (Edited by Sacky and Gabriel "Larcius" Cordes)
- {
- if (IsPlayerConnected(playerid) && IsVehicleConnected(vehicleid))
- {
- new Float:x1,Float:y1,Float:z1;
- GetVehiclePos(vehicleid,x1,y1,z1);
- return GetDistanceToPoint(playerid,x1,y1,z1);
- }
- return INF_FLOAT;
- }
- stock GetDistanceBetweenPlayers(playerid, playerid2)
- {
- new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
- new Float:dis;
- GetPlayerPos(playerid,x1,y1,z1);
- GetPlayerPos(playerid2,x2,y2,z2);
- dis = floatsqroot((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)+(z2-z1)*(z2-z1));
- return floatround(dis);
- }
- stock GetClosestVehicle(playerid)
- {
- if(IsPlayerConnected(playerid) && IsVehicleConnected(0))
- {
- new closestvehicle=0;
- new Float:closestdist=GetDistanceToVehicle(playerid,0);
- for(new vehicleid=0; vehicleid<MAX_VEHICLES; vehicleid++)
- {
- new Float:dist = GetDistanceToVehicle(playerid,vehicleid);
- if ((dist < closestdist))
- {
- closestdist = dist;
- closestvehicle = vehicleid;
- }
- }
- return closestvehicle;
- }
- return -1;
- }
- stock SaveExistingVehicle(gameid)
- {
- new Vehicle[16], id;
- id = GetVehicleFileID(gameid);
- format(Vehicle, sizeof(Vehicle), "V_%d", id);
- if(djIsSet(VEHICLES_FILE, Vehicle))
- {
- djAutocommit(false);
- format(Vehicle, sizeof(Vehicle), "V_%d/PosX", id);
- djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosX], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/PosY", id);
- djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosY], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/PosZ", id);
- djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosZ], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/ZAngle", id);
- djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarZAngle], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Model", id);
- djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarModel], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Col1", id);
- djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarColour1], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Col2", id);
- djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarColour2], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Group", id);
- djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarGroup], true);
- djCommit(VEHICLES_FILE);
- djAutocommit(true);
- printf("[system] Existing Vehicle %d has been saved to %s.", id, VEHICLES_FILE);
- return true;
- }
- else
- {
- return false;
- }
- }
- stock InitVehicles()
- {
- new Vehicle[16];
- for(new i = 0; i < MAX_VEHICLES; i++)
- {
- format(Vehicle, sizeof(Vehicle), "V_%d", i);
- if(djIsSet(VEHICLES_FILE, Vehicle))
- {
- format(Vehicle, sizeof(Vehicle), "V_%d/PosX", i);
- Vehicles[i][CarPosX] = djFloat(VEHICLES_FILE, Vehicle, true);
- format(Vehicle, sizeof(Vehicle), "V_%d/PosY", i);
- Vehicles[i][CarPosY] = djFloat(VEHICLES_FILE, Vehicle, true);
- format(Vehicle, sizeof(Vehicle), "V_%d/PosZ", i);
- Vehicles[i][CarPosZ] = djFloat(VEHICLES_FILE, Vehicle, true);
- format(Vehicle, sizeof(Vehicle), "V_%d/ZAngle", i);
- Vehicles[i][CarZAngle] = djFloat(VEHICLES_FILE, Vehicle, true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Model", i);
- Vehicles[i][CarModel] = djInt(VEHICLES_FILE, Vehicle, true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Col1", i);
- Vehicles[i][CarColour1] = djInt(VEHICLES_FILE, Vehicle, true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Col2", i);
- Vehicles[i][CarColour2] = djInt(VEHICLES_FILE, Vehicle, true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Group", i);
- Vehicles[i][CarGroup] = djInt(VEHICLES_FILE, Vehicle, true);
- CarCount++;
- if(Vehicles[i][CarModel] != 537 && Vehicles[i][CarModel] != 538 && Vehicles[i][CarModel] != 569 && 570 && Vehicles[i][CarModel] != 590)
- {
- Vehicles[i][GameID] = AddStaticVehicleEx(Vehicles[i][CarModel], Vehicles[i][CarPosX], Vehicles[i][CarPosY], Vehicles[i][CarPosZ], Vehicles[i][CarZAngle], Vehicles[i][CarColour1], Vehicles[i][CarColour2], 3600);
- }
- }
- }
- }
- public NearByMessage(playerid, colour, string[])
- {
- new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
- if(IsPlayerInRangeOfPoint(i, 12, PlayerX, PlayerY, PlayerZ))
- {
- if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && GetPlayerInterior(playerid) == GetPlayerInterior(i))
- {
- SendClientMessage(i, colour, string);
- }
- }
- }
- }
- return 1;
- }
- public UpdatePublic(playerid)
- {
- new name[MAX_PLAYER_NAME];
- new file[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
- dini_IntSet(file, "Group", PlayerInfo[playerid][Group]);
- dini_IntSet(file, "GroupRank", PlayerInfo[playerid][GroupRank]);
- dini_IntSet(file, "Job", PlayerInfo[playerid][pJob]);
- dini_IntSet(file, "Skin", PlayerInfo[playerid][Skin]);
- dini_IntSet(file, "GivingSlot", PlayerInfo[playerid][GivingSlot]);
- dini_IntSet(file, "PendingCarReceival", PlayerInfo[playerid][PendingCarReceival]);
- dini_FloatSet(file, "CarX", PlayerInfo[playerid][CarX]);
- dini_FloatSet(file, "CarY", PlayerInfo[playerid][CarY]);
- dini_FloatSet(file, "CarZ", PlayerInfo[playerid][CarZ]);
- dini_IntSet(file, "CarPaintJobID", PlayerInfo[playerid][CarPaintJobID]);
- dini_IntSet(file, "PlayerCarModel2", PlayerInfo[playerid][PlayerCarModel2]);
- dini_IntSet(file, "PlayerCarModel3", PlayerInfo[playerid][PlayerCarModel3]);
- dini_FloatSet(file, "Car2ZAngle", PlayerInfo[playerid][Car2ZAngle]);
- dini_FloatSet(file, "Car3ZAngle", PlayerInfo[playerid][Car3ZAngle]);
- dini_IntSet(file, "Car2Col1", PlayerInfo[playerid][Car2Col1]);
- dini_IntSet(file, "Car2Col2", PlayerInfo[playerid][Car2Col2]);
- dini_IntSet(file, "Car3Col1", PlayerInfo[playerid][Car3Col1]);
- dini_IntSet(file, "Car3Col2", PlayerInfo[playerid][Car3Col2]);
- dini_IntSet(file, "CarLinkID", PlayerInfo[playerid][CarLinkID]);
- dini_IntSet(file, "Car2LinkID", PlayerInfo[playerid][Car2LinkID]);
- dini_IntSet(file, "Car3LinkID", PlayerInfo[playerid][Car3LinkID]);
- dini_IntSet(file, "Car2PaintJobID", PlayerInfo[playerid][Car2PaintJobID]);
- dini_IntSet(file, "Car3PaintJobID", PlayerInfo[playerid][Car3PaintJobID]);
- dini_FloatSet(file, "Car2X", PlayerInfo[playerid][Car2X]);
- dini_FloatSet(file, "Car2Y", PlayerInfo[playerid][Car2Y]);
- dini_FloatSet(file, "Car2Z", PlayerInfo[playerid][Car2Z]);
- dini_FloatSet(file, "Car3X", PlayerInfo[playerid][Car3X]);
- dini_FloatSet(file, "Car3Y", PlayerInfo[playerid][Car3Y]);
- dini_FloatSet(file, "Car3Z", PlayerInfo[playerid][Car3Z]);
- dini_FloatSet(file, "CarZAngle", PlayerInfo[playerid][CarZAngle]);
- dini_IntSet(file, "PlayerCarModel", PlayerInfo[playerid][PlayerCarModel]);
- dini_IntSet(file, "CarCol1", PlayerInfo[playerid][CarCol1]);
- dini_IntSet(file, "CarCol2", PlayerInfo[playerid][CarCol2]);
- dini_IntSet(file, "Fish", PlayerInfo[playerid][Fish]);
- dini_IntSet(file, "FishBait", PlayerInfo[playerid][FishBait]);
- dini_IntSet(file, "FishLicense", PlayerInfo[playerid][FishLicense]);
- dini_IntSet(file, "FishRod", PlayerInfo[playerid][FishRod]);
- dini_IntSet(file, "FishWeight", PlayerInfo[playerid][FishWeight]);
- dini_IntSet(file, "Mats", PlayerInfo[playerid][pMats]);
- dini_IntSet(file, "BankMoney", PlayerInfo[playerid][BankMoney]);
- dini_IntSet(file, "Minutes", PlayerInfo[playerid][Minutes]);
- dini_IntSet(file, "Seconds", PlayerInfo[playerid][Seconds]);
- dini_IntSet(file, "Spawn", PlayerInfo[playerid][PlayerSpawn]);
- dini_IntSet(file, "Kills", PlayerInfo[playerid][Kills]);
- dini_IntSet(file, "Deaths", PlayerInfo[playerid][Deaths]);
- dini_IntSet(file, "Amination", PlayerInfo[playerid][Animation]);
- dini_IntSet(file, "House", PlayerInfo[playerid][House]);
- dini_IntSet(file, "BeingDraggedBy", PlayerInfo[playerid][BeingDraggedBy]);
- dini_IntSet(file, "WepSlot0", PlayerInfo[playerid][WepSlot0]);
- dini_IntSet(file, "WepSlot1", PlayerInfo[playerid][WepSlot1]);
- dini_IntSet(file, "WepSlot2", PlayerInfo[playerid][WepSlot2]);
- dini_IntSet(file, "WepSlot3", PlayerInfo[playerid][WepSlot3]);
- dini_IntSet(file, "WepSlot4", PlayerInfo[playerid][WepSlot4]);
- dini_IntSet(file, "WepSlot5", PlayerInfo[playerid][WepSlot5]);
- dini_IntSet(file, "WepSlot6", PlayerInfo[playerid][WepSlot6]);
- dini_IntSet(file, "WepSlot7", PlayerInfo[playerid][WepSlot7]);
- dini_IntSet(file, "WepSlot8", PlayerInfo[playerid][WepSlot8]);
- dini_IntSet(file, "WepSlot9", PlayerInfo[playerid][WepSlot9]);
- dini_IntSet(file, "WepSlot10", PlayerInfo[playerid][WepSlot10]);
- dini_IntSet(file, "WepSlot11", PlayerInfo[playerid][WepSlot11]);
- dini_IntSet(file, "WepSlot12", PlayerInfo[playerid][WepSlot12]);
- dini_IntSet(file, "WepSlot13", PlayerInfo[playerid][WepSlot13]);
- dini_IntSet(file, "WepSlot14", PlayerInfo[playerid][WepSlot14]);
- dini_IntSet(file, "WepSlot15", PlayerInfo[playerid][WepSlot15]);
- dini_IntSet(file, "Level", PlayerInfo[playerid][pLevel]);
- dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
- dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
- return 1;
- }
- public PurchaseCar(playerid, carid, price, slotid)
- {
- new string[128];
- if(carid < 400 || carid > 611)
- {
- SendClientMessage(playerid, WHITE, "Valid car IDs start from 400, ending at 611.");
- return 1;
- }
- else
- {
- if(PlayerInfo[playerid][pCash] >= price)
- {
- switch(slotid)
- {
- case 1:
- {
- if(PlayerInfo[playerid][PlayerCarModel] > 0)
- {
- SendClientMessage(playerid, WHITE, "You already have a vehicle in slot 1, /abandoncar first.");
- }
- else
- {
- PlayerInfo[playerid][pCash] -= price;
- PlayerInfo[playerid][CarX] = OwnedCarSpawnX;
- PlayerInfo[playerid][CarY] = OwnedCarSpawnY;
- PlayerInfo[playerid][CarZ] = OwnedCarSpawnZ;
- PlayerInfo[playerid][PlayerCarModel] = carid;
- PlayerInfo[playerid][CarCol1] = 0;
- PlayerInfo[playerid][CarCol2] = 0;
- SpawnOwnedCar(playerid, 1);
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][PlayerCarModel2] > 0)
- {
- SendClientMessage(playerid, WHITE, "You already have a vehicle in slot 2, /abandoncar first.");
- }
- else
- {
- PlayerInfo[playerid][pCash] -= price;
- PlayerInfo[playerid][Car2X] = OwnedCarSpawnX;
- PlayerInfo[playerid][Car2Y] = OwnedCarSpawnY;
- PlayerInfo[playerid][Car2Z] = OwnedCarSpawnZ;
- PlayerInfo[playerid][PlayerCarModel2] = carid;
- PlayerInfo[playerid][Car2Col1] = 0;
- PlayerInfo[playerid][Car2Col2] = 0;
- SpawnOwnedCar(playerid, 2);
- }
- }
- case 3:
- {
- if(PlayerInfo[playerid][PlayerCarModel3] > 0)
- {
- SendClientMessage(playerid, WHITE, "You already have a vehicle in slot 3, /abandoncar first.");
- }
- else
- {
- PlayerInfo[playerid][pCash] -= price;
- PlayerInfo[playerid][Car3X] = OwnedCarSpawnX;
- PlayerInfo[playerid][Car3Y] = OwnedCarSpawnY;
- PlayerInfo[playerid][Car3Z] = OwnedCarSpawnZ;
- PlayerInfo[playerid][PlayerCarModel3] = carid;
- PlayerInfo[playerid][Car3Col1] = 0;
- PlayerInfo[playerid][Car3Col2] = 0;
- SpawnOwnedCar(playerid, 3);
- }
- }
- }
- }
- else
- {
- format(string, sizeof(string), "You must have $%d to purchase this vehicle.", price);
- SendClientMessage(playerid, WHITE, string);
- }
- }
- return 1;
- }
- public FishPublic(playerid)
- {
- new string[128];
- new fishweight = 10+random(150);
- new fish = random(sizeof(fishname));
- format(string, sizeof(string), "You have caught a %dlb %s, and have added it to your fish bucket!", fishweight, fishname[fish]);
- PlayerInfo[playerid][FishBait] -= 1;
- PlayerInfo[playerid][FishWeight] += fishweight;
- PlayerInfo[playerid][Fish] += 1;
- SendClientMessage(playerid, WHITE, string);
- TogglePlayerControllable(playerid, true);
- Fishing[playerid] = 0;
- ClearAnimations(playerid);
- StopLoopingAnimation(playerid);
- RemovePlayerAttachedObject(playerid,0);
- return 1;
- }
- public WhalePublic(playerid)
- {
- new string[128];
- new fishweight = 10000+random(100000);
- new whale = random(sizeof(whalename));
- new whale2 = random(sizeof(whaletype));
- format(string, sizeof(string), "You have caught a %d %d weighing a MASSIVE %slbs!", whaletype[whale2], whalename[whale], fishweight);
- PlayerInfo[playerid][FishWeight] += fishweight;
- SendClientMessage(playerid, WHITE, string);
- TogglePlayerControllable(playerid, true);
- Fishing[playerid] = 0;
- PlayerInfo[playerid][Fish] += 1;
- PlayerInfo[playerid][FishBait] -= 1;
- ClearAnimations(playerid);
- StopLoopingAnimation(playerid);
- RemovePlayerAttachedObject(playerid,0);
- return 1;
- }
- public IsPlayerInInvalidNosVehicle(playerid)
- {
- new carid = GetPlayerVehicleID(playerid);
- new carmodel = GetVehicleModel(carid);
- for (new i = 0; i < sizeof(UnmodifiableVehicles); i++)
- {
- if(carmodel == UnmodifiableVehicles[i]) return 1;
- }
- return 0;
- }
- stock IsAHelicopter(vehicleid)
- {
- new model = GetVehicleModel(vehicleid);
- if(model == 548 || model == 511 || model == 553 || model == 519 || model == 469 || model == 447 || model == 563 || model == 497 || model == 488 || model == 487 || model == 417 || model == 425 || model == 548 || model == 577 || model == 573 || model == 592 || model == 525 || model == 417 || model == 487 || model == 488 || model == 497 || model == 563 || model == 447 || model == 469)
- {
- return 1;
- }
- else
- {
- return 0;
- }
- }
- stock SpectatorRefresh(playerid, otherplayer)
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if(otherplayer == INVALID_PLAYER_ID)
- {
- SetPlayerInterior(playerid, Spectator[playerid][SpecPlayerInterior]);
- SetPlayerPos(playerid, Spectator[playerid][SpecPlayerX], Spectator[playerid][SpecPlayerY], Spectator[playerid][SpecPlayerZ]);
- SetPlayerVirtualWorld(playerid, Spectator[playerid][SpecPlayerWorld]);
- SetPlayerFacingAngle(playerid, Spectator[playerid][SpecPlayerAngle]);
- SetCameraBehindPlayer(playerid);
- Spectator[playerid][SpecSpectatingPlayer] = -1;
- Spectator[playerid][SpecSpectatingState] = -1;
- TogglePlayerControllable(playerid, true);
- SendClientMessage(playerid, WHITE, "You are no longer spectating; the specified player ID is unavailable.");
- }
- else
- {
- if(GetPlayerInterior(playerid) != GetPlayerInterior(otherplayer))
- {
- SetPlayerInterior(playerid, GetPlayerInterior(otherplayer));
- Spectator[playerid][SpecSpectatingState] = 0;
- }
- if(GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(otherplayer))
- {
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(otherplayer));
- Spectator[playerid][SpecSpectatingState] = 0;
- }
- if(IsPlayerInAnyVehicle(otherplayer) == 1 && Spectator[playerid][SpecSpectatingState] != 1)
- {
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(otherplayer));
- Spectator[playerid][SpecSpectatingState] = 1;
- }
- else if(!IsPlayerInAnyVehicle(otherplayer) && Spectator[playerid][SpecSpectatingState] != 2)
- {
- PlayerSpectatePlayer(playerid, otherplayer);
- Spectator[playerid][SpecSpectatingState] = 2;
- }
- }
- }
- }
- stock IsNumeric(string[]) { for (new i = 0, j = strlen(string); i < j; i++) if (string[i] > '9' || string[i] < '0') return 0; return 1; }
- stock findAvailableVehicleID() {
- for(new i = 0; i < MAX_VEHICLES; i++) {
- if(Vehicles[i][CarModel] == 0) {
- return i;
- }
- }
- return -1;
- }
- stock GivePlayerHealth(playerid, Float: Health)
- {
- new Float:health; GetPlayerHealth(playerid,health);
- SetPlayerHealth(playerid, health+Health);
- }
- stock GetName(playerid)
- {
- new name[MAX_PLAYER_NAME];
- if(IsPlayerConnected(playerid))
- {
- GetPlayerName(playerid, name, sizeof(name));
- }
- return name;
- }
- stock sscanf(string[], format[], {Float,_}:...)
- {
- #if defined isnull
- if (isnull(string))
- #else
- if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
- #endif
- {
- return format[0];
- }
- #pragma tabsize 4
- new
- formatPos = 0,
- stringPos = 0,
- paramPos = 2,
- paramCount = numargs(),
- delim = ' ';
- while (string[stringPos] && string[stringPos] <= ' ')
- {
- stringPos++;
- }
- while (paramPos < paramCount && string[stringPos])
- {
- switch (format[formatPos++])
- {
- case '\0':
- {
- return 0;
- }
- case 'i', 'd':
- {
- new
- neg = 1,
- num = 0,
- ch = string[stringPos];
- if (ch == '-')
- {
- neg = -1;
- ch = string[++stringPos];
- }
- do
- {
- stringPos++;
- if ('0' <= ch <= '9')
- {
- num = (num * 10) + (ch - '0');
- }
- else
- {
- return -1;
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num * neg);
- }
- case 'h', 'x':
- {
- new
- num = 0,
- ch = string[stringPos];
- do
- {
- stringPos++;
- switch (ch)
- {
- case 'x', 'X':
- {
- num = 0;
- continue;
- }
- case '0' .. '9':
- {
- num = (num << 4) | (ch - '0');
- }
- case 'a' .. 'f':
- {
- num = (num << 4) | (ch - ('a' - 10));
- }
- case 'A' .. 'F':
- {
- num = (num << 4) | (ch - ('A' - 10));
- }
- default:
- {
- return -1;
- }
- }
- }
- while ((ch = string[stringPos]) > ' ' && ch != delim);
- setarg(paramPos, 0, num);
- }
- case 'c':
- {
- setarg(paramPos, 0, string[stringPos++]);
- }
- case 'f':
- {
- setarg(paramPos, 0, _:floatstr(string[stringPos]));
- }
- case 'p':
- {
- delim = format[formatPos++];
- continue;
- }
- case '\'':
- {
- new
- end = formatPos - 1,
- ch;
- while ((ch = format[++end]) && ch != '\'') {}
- if (!ch)
- {
- return -1;
- }
- format[end] = '\0';
- if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
- {
- if (format[end + 1])
- {
- return -1;
- }
- return 0;
- }
- format[end] = '\'';
- stringPos = ch + (end - formatPos);
- formatPos = end + 1;
- }
- case 'u':
- {
- new
- end = stringPos - 1,
- id = 0,
- bool:num = true,
- ch;
- while ((ch = string[++end]) && ch != delim)
- {
- if (num)
- {
- if ('0' <= ch <= '9')
- {
- id = (id * 10) + (ch - '0');
- }
- else
- {
- num = false;
- }
- }
- }
- if (num && IsPlayerConnected(id))
- {
- setarg(paramPos, 0, id);
- }
- else
- {
- #if !defined foreach
- #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
- #define __SSCANF_FOREACH__
- #endif
- string[end] = '\0';
- num = false;
- new
- name[MAX_PLAYER_NAME];
- id = end - stringPos;
- foreach(Player, playerid)
- {
- GetPlayerName(playerid, name, sizeof (name));
- if (!strcmp(name, string[stringPos], true, id))
- {
- setarg(paramPos, 0, playerid);
- num = true;
- break;
- }
- }
- if (!num)
- {
- setarg(paramPos, 0, INVALID_PLAYER_ID);
- }
- string[end] = ch;
- #if defined __SSCANF_FOREACH__
- #undef foreach
- #undef __SSCANF_FOREACH__
- #endif
- }
- stringPos = end;
- }
- case 's', 'z':
- {
- new
- i = 0,
- ch;
- if (format[formatPos])
- {
- while ((ch = string[stringPos++]) && ch != delim)
- {
- setarg(paramPos, i++, ch);
- }
- if (!i)
- {
- return -1;
- }
- }
- else
- {
- while ((ch = string[stringPos++]))
- {
- setarg(paramPos, i++, ch);
- }
- }
- stringPos--;
- setarg(paramPos, i, '\0');
- }
- default:
- {
- continue;
- }
- }
- while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
- {
- stringPos++;
- }
- while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
- {
- stringPos++;
- }
- paramPos++;
- }
- do
- {
- if ((delim = format[formatPos++]) > ' ')
- {
- if (delim == '\'')
- {
- while ((delim = format[formatPos++]) && delim != '\'') {}
- }
- else if (delim != 'z')
- {
- return delim;
- }
- }
- }
- while (delim > ' ');
- return 0;
- }
- main()
- {
- print("\n----------------------------------");
- print(" Elite Roleplay by RBCRP");
- print("----------------------------------\n");
- }
- public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:posx, Float:posy, Float:posz;
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- //radi = 2.0; //Trigger Radius
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(!BigEar[i])
- {
- GetPlayerPos(i, posx, posy, posz);
- tempposx = (oldposx -posx);
- tempposy = (oldposy -posy);
- tempposz = (oldposz -posz);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- new playerworld, player2world;
- playerworld = GetPlayerVirtualWorld(playerid);
- player2world = GetPlayerVirtualWorld(i);
- if(playerworld == player2world)
- {
- if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
- {
- SendClientMessage(i, col1, string);
- }
- else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
- {
- SendClientMessage(i, col2, string);
- }
- else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
- {
- SendClientMessage(i, col3, string);
- }
- else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
- {
- SendClientMessage(i, col4, string);
- }
- else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- SendClientMessage(i, col5, string);
- }
- }
- }
- else
- {
- SendClientMessage(i, col1, string);
- }
- }
- }
- }//not connected
- return 1;
- }
- stock InitHouses()
- {
- new FileName[128], HouseName[128];
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- format(FileName, sizeof(FileName), "Houses/House_%d.ini", i);
- format(HouseName, sizeof(HouseName), "House_%d", i);
- if(fexist(FileName))
- {
- Houses[i][hInteriorID] = dini_Int(FileName, "InteriorID");
- Houses[i][hInteriorX] = dini_Float(FileName, "InteriorX");
- Houses[i][hInteriorY] = dini_Float(FileName, "InteriorY");
- Houses[i][hInteriorZ] = dini_Float(FileName, "InteriorZ");
- Houses[i][HousePrice] = dini_Int(FileName, "HousePrice");
- Houses[i][hExteriorID] = dini_Int(FileName, "ExteriorID");
- Houses[i][hExteriorX] = dini_Float(FileName, "ExteriorX");
- Houses[i][hExteriorY] = dini_Float(FileName, "ExteriorY");
- Houses[i][hExteriorZ] = dini_Float(FileName, "ExteriorZ");
- Houses[i][hOwner] = dini_Get(FileName, "Owner");
- if(strcmp(Houses[i][hOwner], "Nobody", true) == 0)
- {
- Houses[i][HPickupID] = CreateDynamicPickup(1273, 23, Houses[i][hExteriorX], Houses[i][hExteriorY], Houses[i][hExteriorZ], 0, -1, -1, 150.0);
- }
- else
- {
- Houses[i][HPickupID] = CreateDynamicPickup(1272, 23, Houses[i][hExteriorX], Houses[i][hExteriorY], Houses[i][hExteriorZ], 0, -1, -1, 150.0);
- }
- Create3DTextLabel(HouseName, LABELS, Houses[i][hExteriorX], Houses[i][hExteriorY], Houses[i][hExteriorZ], 100.0, 0, 0);
- SpawnedHouses++;
- }
- }
- return 1;
- }
- public PickupMessages()
- {
- new string[128], Float: playX, Float: playY, Float: playZ;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(!IsPlayerInRangeOfPoint(i, 9, playX, playY, playZ))
- {
- if(IsPlayerConnected(i))
- {
- for(new h = 0; h < sizeof(Houses); h++)
- {
- if(IsPlayerInRangeOfPoint(i, 5, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ]))
- {
- if(GetPlayerVirtualWorld(i) == 0)
- {
- if(strcmp(Houses[h][hOwner], "Nobody", true) == 0)
- {
- if(Houses[h][HousePrice] == -1)
- {
- format(string, sizeof(string), "~w~ House ~y~ %d ~n~ ~w~ Unavailable.", h, Houses[h][HousePrice]);
- GameTextForPlayer(i, string, 3500, 3);
- }
- else
- {
- format(string, sizeof(string), "~w~ House ~y~ %d ~n~ Available to buy for %d (/buyhouse).", h, Houses[h][HousePrice]);
- GameTextForPlayer(i, string, 3500, 3);
- }
- }
- else
- {
- format(string, sizeof(string), "~w~ House ~y~ %d ~n~ ~w~ Owner: ~y~ %s. ~n~~n~ ~r~ ~k~~PED_DUCK~ ~w~ to enter", h, Houses[h][hOwner]);
- GameTextForPlayer(i, string, 3500, 3);
- }
- }
- }
- }
- }
- if(IsPlayerInRangeOfPoint(i, 9, 2111.2566,-98.2426,2.1183))
- {
- if(Fishing[i] == 0)
- {
- format(string, sizeof(string), "~r~/FISH~w~ to fish \n(You must have a ~r~ Fishing License, Bait,\n& ~w~A fishing pole to ~r~FISH~w~)");
- GameTextForPlayer(i, string, 3500, 3);
- }
- }
- if(IsPlayerInRangeOfPoint(i, 5, 1302.1343,217.0710,19.5547))
- {
- GameTextForPlayer(i, "~r~/joinjob armsdealer", 3000, 4);
- }
- }
- }
- return 1;
- }
- public OnGameModeInit()
- {
- UpdateTimer = SetTimer("UpdatePublic", 5000, true);
- djson_GameModeInit();
- LoadFiles();
- PickupsTimer = SetTimer("PickupMessages", 1500, true);
- TextdrawConnect = TextDrawCreate(5.000000,435.000000,"Elite Roleplay | Owner: Axel_Petrov | Website: Null");
- TextDrawAlignment(TextdrawConnect, 0);
- TextDrawBackgroundColor(TextdrawConnect, 0x000000ff);
- TextDrawFont(TextdrawConnect, 2);
- TextDrawLetterSize(TextdrawConnect, 0.2,1.0);
- TextDrawColor(TextdrawConnect, 0xffffffff);
- TextDrawSetOutline(TextdrawConnect, 1);
- TextDrawSetProportional(TextdrawConnect, 1);
- TextDrawSetShadow(TextdrawConnect, 1);
- SetTimer("settime",1000,true);
- Time1 = TextDrawCreate(500.000000,15.000000,"--");
- TextDrawFont(Time1,3);
- TextDrawBackgroundColor(Time1, 0x000000AA);
- TextDrawLetterSize(Time1,0.400000, 0.999999);
- TextDrawSetOutline(Time1,1);
- TextDrawSetShadow(Time1,0);
- TextDrawTextSize(Time1, 606.000000, -2.000000);
- TextDrawFont(Time1, 3);
- TextDrawColor(Time1,POLICE);
- TextDrawUseBox(Time1, 0);
- TextDrawBoxColor(Time1, 0x00000076);
- SetTimer("settime",1000,true);
- SetTimer("Zones_Update", 500, 1);
- for(new i=0; i<MAX_PLAYERS; i++){
- Zones[i] = TextDrawCreate(500.000000, 105.000000, "_");
- TextDrawBackgroundColor(Zones[i], 255);
- TextDrawFont(Zones[i], 1);
- TextDrawLetterSize(Zones[i], 0.200000, 0.999999);
- TextDrawColor(Zones[i], -1);
- TextDrawSetOutline(Zones[i], 0);
- TextDrawSetProportional(Zones[i], 1);
- TextDrawSetShadow(Zones[i], 1);
- TextDrawUseBox(Zones[i], 1);
- TextDrawBoxColor(Zones[i], 0x00000076);
- TextDrawTextSize(Zones[i], 606.000000, -2.000000);}
- ShowPlayerMarkers(1);
- ShowNameTags(1);
- EnableStuntBonusForAll(1);
- DisableInteriorEnterExits();
- ManualVehicleEngineAndLights();
- AddPlayerClass(0,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);
- AddPlayerClass(1,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
- AddPlayerClass(299,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
- WeatherTimer = SetTimer("DynamicWeather", 7200000, true);
- SetGameModeText("EL:RP v1.11");
- DynamicWeather();
- return 1;
- }
- public DynamicWeather()
- {
- GlobalWeather = random(17);
- SetWeather(GlobalWeather);
- return 1;
- }
- public NearByMessageEx(playerid, color, string[], Float: range)
- {
- new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
- if(IsPlayerInRangeOfPoint(i, range, PlayerX, PlayerY, PlayerZ))
- {
- if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
- {
- SendClientMessage(i, color, string);
- }
- }
- }
- }
- }
- public GivePlayerWeaponEx(playerid, weapon)
- {
- switch(weapon)
- {
- case 0, 1:
- {
- PlayerInfo[playerid][WepSlot0] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 2, 3, 4, 5, 6, 7, 8, 9:
- {
- PlayerInfo[playerid][WepSlot1] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 22, 23, 24:
- {
- PlayerInfo[playerid][WepSlot2] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 25, 26, 27:
- {
- PlayerInfo[playerid][WepSlot3] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 28, 29, 32:
- {
- PlayerInfo[playerid][WepSlot4] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 30, 31:
- {
- PlayerInfo[playerid][WepSlot5] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 33, 34:
- {
- PlayerInfo[playerid][WepSlot6] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 35, 36, 37, 38:
- {
- PlayerInfo[playerid][WepSlot7] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 16, 17, 18, 39:
- {
- PlayerInfo[playerid][WepSlot8] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 41, 42, 43:
- {
- PlayerInfo[playerid][WepSlot9] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 10, 11, 12, 13, 14, 15:
- {
- PlayerInfo[playerid][WepSlot10] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 44, 45, 46:
- {
- PlayerInfo[playerid][WepSlot11] = weapon;
- GivePlayerWeapon(playerid, weapon, 99999);
- }
- case 40:
- {
- printf("[system] [error] GivePlayerWeaponEx() was unable to give weapon ID %d.", weapon);
- }
- }
- return 1;
- }
- public SendToAdmins(colour, string[], requireduty)
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(PlayerInfo[i][pAdminLevel] >= 1)
- {
- SendClientMessage(i, colour, string);
- }
- }
- }
- return 1;
- }
- stock SavePlayers()
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- SavePlayer(i);
- }
- return 1;
- }
- stock SaveHouses()
- {
- for(new i = 0; i < MAX_HOUSES; i++)
- {
- SaveHouse(i);
- }
- return 1;
- }
- stock SavePlayer(i)
- {
- new name[MAX_PLAYER_NAME];
- new file[256];
- GetPlayerName(i, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- dini_IntSet(file, "Money", PlayerInfo[i][pCash]);
- dini_IntSet(file, "Group", PlayerInfo[i][Group]);
- dini_IntSet(file, "GroupRank", PlayerInfo[i][GroupRank]);
- dini_IntSet(file, "Job", PlayerInfo[i][pJob]);
- dini_IntSet(file, "Skin", PlayerInfo[i][Skin]);
- dini_IntSet(file, "GivingSlot", PlayerInfo[i][GivingSlot]);
- dini_IntSet(file, "PendingCarReceival", PlayerInfo[i][PendingCarReceival]);
- dini_FloatSet(file, "CarX", PlayerInfo[i][CarX]);
- dini_FloatSet(file, "CarY", PlayerInfo[i][CarY]);
- dini_FloatSet(file, "CarZ", PlayerInfo[i][CarZ]);
- dini_IntSet(file, "CarPaintJobID", PlayerInfo[i][CarPaintJobID]);
- dini_IntSet(file, "PlayerCarModel2", PlayerInfo[i][PlayerCarModel2]);
- dini_IntSet(file, "PlayerCarModel3", PlayerInfo[i][PlayerCarModel3]);
- dini_FloatSet(file, "Car2ZAngle", PlayerInfo[i][Car2ZAngle]);
- dini_FloatSet(file, "Car3ZAngle", PlayerInfo[i][Car3ZAngle]);
- dini_IntSet(file, "Car2Col1", PlayerInfo[i][Car2Col1]);
- dini_IntSet(file, "Car2Col2", PlayerInfo[i][Car2Col2]);
- dini_IntSet(file, "Car3Col1", PlayerInfo[i][Car3Col1]);
- dini_IntSet(file, "Car3Col2", PlayerInfo[i][Car3Col2]);
- dini_IntSet(file, "CarLinkID", PlayerInfo[i][CarLinkID]);
- dini_IntSet(file, "Car2LinkID", PlayerInfo[i][Car2LinkID]);
- dini_IntSet(file, "Car3LinkID", PlayerInfo[i][Car3LinkID]);
- dini_IntSet(file, "Car2PaintJobID", PlayerInfo[i][Car2PaintJobID]);
- dini_IntSet(file, "Car3PaintJobID", PlayerInfo[i][Car3PaintJobID]);
- dini_FloatSet(file, "Car2X", PlayerInfo[i][Car2X]);
- dini_FloatSet(file, "Car2Y", PlayerInfo[i][Car2Y]);
- dini_FloatSet(file, "Car2Z", PlayerInfo[i][Car2Z]);
- dini_FloatSet(file, "Car3X", PlayerInfo[i][Car3X]);
- dini_FloatSet(file, "Car3Y", PlayerInfo[i][Car3Y]);
- dini_FloatSet(file, "Car3Z", PlayerInfo[i][Car3Z]);
- dini_FloatSet(file, "CarZAngle", PlayerInfo[i][CarZAngle]);
- dini_IntSet(file, "PlayerCarModel", PlayerInfo[i][PlayerCarModel]);
- dini_IntSet(file, "CarCol1", PlayerInfo[i][CarCol1]);
- dini_IntSet(file, "CarCol2", PlayerInfo[i][CarCol2]);
- dini_IntSet(file, "Fish", PlayerInfo[i][Fish]);
- dini_IntSet(file, "FishBait", PlayerInfo[i][FishBait]);
- dini_IntSet(file, "FishLicense", PlayerInfo[i][FishLicense]);
- dini_IntSet(file, "FishRod", PlayerInfo[i][FishRod]);
- dini_IntSet(file, "FishWeight", PlayerInfo[i][FishWeight]);
- dini_IntSet(file, "Mats", PlayerInfo[i][pMats]);
- dini_IntSet(file, "BankMoney", PlayerInfo[i][BankMoney]);
- dini_IntSet(file, "Minutes", PlayerInfo[i][Minutes]);
- dini_IntSet(file, "Seconds", PlayerInfo[i][Seconds]);
- dini_IntSet(file, "Spawn", PlayerInfo[i][PlayerSpawn]);
- dini_IntSet(file, "Kills", PlayerInfo[i][Kills]);
- dini_IntSet(file, "Deaths", PlayerInfo[i][Deaths]);
- dini_IntSet(file, "Amination", PlayerInfo[i][Animation]);
- dini_IntSet(file, "House", PlayerInfo[i][House]);
- dini_IntSet(file, "BeingDraggedBy", PlayerInfo[i][BeingDraggedBy]);
- dini_IntSet(file, "WepSlot0", PlayerInfo[i][WepSlot0]);
- dini_IntSet(file, "WepSlot1", PlayerInfo[i][WepSlot1]);
- dini_IntSet(file, "WepSlot2", PlayerInfo[i][WepSlot2]);
- dini_IntSet(file, "WepSlot3", PlayerInfo[i][WepSlot3]);
- dini_IntSet(file, "WepSlot4", PlayerInfo[i][WepSlot4]);
- dini_IntSet(file, "WepSlot5", PlayerInfo[i][WepSlot5]);
- dini_IntSet(file, "WepSlot6", PlayerInfo[i][WepSlot6]);
- dini_IntSet(file, "WepSlot7", PlayerInfo[i][WepSlot7]);
- dini_IntSet(file, "WepSlot8", PlayerInfo[i][WepSlot8]);
- dini_IntSet(file, "WepSlot9", PlayerInfo[i][WepSlot9]);
- dini_IntSet(file, "WepSlot10", PlayerInfo[i][WepSlot10]);
- dini_IntSet(file, "WepSlot11", PlayerInfo[i][WepSlot11]);
- dini_IntSet(file, "WepSlot12", PlayerInfo[i][WepSlot12]);
- dini_IntSet(file, "WepSlot13", PlayerInfo[i][WepSlot13]);
- dini_IntSet(file, "WepSlot14", PlayerInfo[i][WepSlot14]);
- dini_IntSet(file, "WepSlot15", PlayerInfo[i][WepSlot15]);
- dini_IntSet(file, "Level", PlayerInfo[i][pLevel]);
- dini_IntSet(file, "Score", PlayerInfo[i][pScore]);
- dini_IntSet(file, "AdminLevel",PlayerInfo[i][pAdminLevel]);
- PlayerInfo[i][pAdminLevel] = dini_Int(file, "AdminLevel");
- PlayerInfo[i][pCash] = dini_Int(file, "Money");
- PlayerInfo[i][Group] = dini_Int(file, "Group");
- PlayerInfo[i][GroupRank] = dini_Int(file, "GroupRank");
- PlayerInfo[i][pJob] = dini_Int(file, "Job");
- PlayerInfo[i][Skin] = dini_Int(file, "Skin");
- PlayerInfo[i][pScore] = dini_Int(file, "Score");
- PlayerInfo[i][Deaths] = dini_Int(file, "Deaths");
- PlayerInfo[i][Kills] = dini_Int(file, "Kills");
- PlayerInfo[i][PendingCarReceival] = dini_Int(file, "PendingCarReceival");
- PlayerInfo[i][GivingSlot] = dini_Int(file, "GivingSlot");
- PlayerInfo[i][FishBait] = dini_Int(file, "FishBait");
- PlayerInfo[i][FishWeight] = dini_Int(file, "FishWeight");
- PlayerInfo[i][FishRod] = dini_Int(file, "FishRod");
- PlayerInfo[i][FishLicense] = dini_Int(file, "FishLicense");
- PlayerInfo[i][Fish] = dini_Int(file, "Fish");
- PlayerInfo[i][pMats] = dini_Int(file, "Mats");
- PlayerInfo[i][Minutes] = dini_Int(file, "Minutes");
- PlayerInfo[i][Seconds] = dini_Int(file, "Seconds");
- PlayerInfo[i][BankMoney] = dini_Int(file, "BankMoney");
- PlayerInfo[i][WepSlot0] = dini_Int(file, "WepSlot0");
- PlayerInfo[i][WepSlot1] = dini_Int(file, "WepSlot1");
- PlayerInfo[i][WepSlot2] = dini_Int(file, "WepSlot2");
- PlayerInfo[i][WepSlot3] = dini_Int(file, "WepSlot3");
- PlayerInfo[i][WepSlot4] = dini_Int(file, "WepSlot4");
- PlayerInfo[i][WepSlot5] = dini_Int(file, "WepSlot5");
- PlayerInfo[i][WepSlot6] = dini_Int(file, "WepSlot6");
- PlayerInfo[i][WepSlot7] = dini_Int(file, "WepSlot7");
- PlayerInfo[i][WepSlot8] = dini_Int(file, "WepSlot8");
- PlayerInfo[i][WepSlot9] = dini_Int(file, "WepSlot9");
- PlayerInfo[i][WepSlot10] = dini_Int(file, "WepSlot10");
- PlayerInfo[i][WepSlot11] = dini_Int(file, "WepSlot11");
- PlayerInfo[i][WepSlot12] = dini_Int(file, "WepSlot12");
- PlayerInfo[i][WepSlot13] = dini_Int(file, "WepSlot13");
- PlayerInfo[i][WepSlot14] = dini_Int(file, "WepSlot14");
- PlayerInfo[i][WepSlot15] = dini_Int(file, "WepSlot15");
- PlayerInfo[i][CarX] = dini_Int(file, "CarX");
- PlayerInfo[i][CarY] = dini_Int(file, "CarY");
- PlayerInfo[i][CarZ] = dini_Int(file, "CarZ");
- PlayerInfo[i][CarPaintJobID] = dini_Int(file, "CarPaintJobID");
- PlayerInfo[i][PlayerCarModel2] = dini_Int(file, "PlayerCarModel2");
- PlayerInfo[i][PlayerCarModel3] = dini_Int(file, "PlayerCarModel3");
- PlayerInfo[i][Car2ZAngle] = dini_Int(file, "Car2ZAngle");
- PlayerInfo[i][Car3ZAngle] = dini_Int(file, "Car3ZAngle");
- PlayerInfo[i][Car2Col1] = dini_Int(file, "Car2Col1");
- PlayerInfo[i][Car2Col2] = dini_Int(file, "Car2Col2");
- PlayerInfo[i][Car3Col1] = dini_Int(file, "Car3Col1");
- PlayerInfo[i][Car3Col2] = dini_Int(file, "Car3Col2");
- PlayerInfo[i][CarLinkID] = dini_Int(file, "CarLinkID");
- PlayerInfo[i][Car2LinkID] = dini_Int(file, "Car2LinkID");
- PlayerInfo[i][Car3LinkID] = dini_Int(file, "Car3LinkID");
- PlayerInfo[i][Car2PaintJobID] = dini_Int(file, "Car2PaitnJobID");
- PlayerInfo[i][Car3PaintJobID] = dini_Int(file, "Car3PaitnJobID");
- PlayerInfo[i][Car2X] = dini_Int(file, "Car2X");
- PlayerInfo[i][Car2Y] = dini_Int(file, "Car2Y");
- PlayerInfo[i][Car2Z] = dini_Int(file, "Car2Z");
- PlayerInfo[i][Car3X] = dini_Int(file, "Car3X");
- PlayerInfo[i][Car3Y] = dini_Int(file, "Car3Y");
- PlayerInfo[i][Car3Z] = dini_Int(file, "Car3Z");
- PlayerInfo[i][CarZAngle] = dini_Int(file, "CarZAngle");
- PlayerInfo[i][PlayerCarModel] = dini_Int(file, "PlayerCarModel");
- PlayerInfo[i][CarCol1] = dini_Int(file, "CarCol1");
- PlayerInfo[i][CarCol2] = dini_Int(file, "CarCol2");
- printf("[System-Player] Player %d Saved", i);
- return 1;
- }
- stock SaveHouse(i)
- {
- new FileName[23];
- format(FileName, sizeof(FileName), "Houses/House_%d.ini", i);
- if(fexist(FileName))
- {
- dini_IntSet(FileName, "InteriorID", Houses[i][hInteriorID]);
- dini_FloatSet(FileName, "InteriorX", Houses[i][hInteriorX]);
- dini_FloatSet(FileName, "InteriorY", Houses[i][hInteriorY]);
- dini_FloatSet(FileName, "InteriorZ", Houses[i][hInteriorZ]);
- dini_IntSet(FileName, "HousePrice", Houses[i][HousePrice]);
- dini_IntSet(FileName, "ExteriorID", Houses[i][hExteriorID]);
- dini_FloatSet(FileName, "ExteriorX", Houses[i][hExteriorX]);
- dini_FloatSet(FileName, "ExteriorY", Houses[i][hExteriorY]);
- dini_FloatSet(FileName, "ExteriorZ", Houses[i][hExteriorZ]);
- dini_Set(FileName, "Owner", Houses[i][hOwner]);
- printf("[system] House %d saved.", i);
- }
- return 1;
- }
- public OnGameModeExit()
- {
- djson_GameModeExit();
- SaveHouses();
- SavePlayers();
- return 1;
- }
- public OnPlayerRequestClass(playerid, classid)
- {
- //iSpawnSet[playerid] = 0;
- //SetupPlayerForClassSelection(playerid);
- return 1;
- }
- /*public SetupPlayerForClassSelection(playerid)
- {
- SetPlayerInterior(playerid,14);
- SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
- SetPlayerFacingAngle(playerid, 270.0);
- SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
- SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
- }*/
- public speedometer(playerid) {
- GetVehicleVelocity(GetPlayerVehicleID(playerid), svx[playerid], svy[playerid], svz[playerid]); // This Saves Our Velocitys To Our Varibles
- s11[playerid] = floatsqroot(((svx[playerid]*svx[playerid])+(svy[playerid]*svy[playerid]))+(svz[playerid]*svz[playerid]))*100; // This Is Our Forumula ( I Don't Know How It Works )
- s21[playerid] = floatround(s11[playerid],floatround_round); // This Rounds Our Output To The Nearest Whole Number
- format(s3[playerid],256,"MPH: %i", s21[playerid]); // This Format Our Text Into What We See
- TextDrawLetterSize(sdisplay[playerid], 0.400000, 0.999999);
- TextDrawSetString(sdisplay[playerid], s3[playerid]); // This Changes The Value Of Our Textdraw To What We Formatted
- return 1;
- }
- public OneMinutePublic(playerid)
- {
- PlayerInfo[playerid][Minutes] += 1;
- return 1;
- }
- public OneSecondPublic(playerid)
- {
- PlayerInfo[playerid][Seconds] += 1;
- return 1;
- }
- public OnPlayerConnect(playerid)
- {
- TextDrawShowForPlayer(playerid, TextdrawConnect);
- Timeshow[playerid] = 1;
- sdisplay[playerid] = TextDrawCreate(56.0,340.000000," "); // This Creates Our Textdraw And Stores The Id In The Varible In Front
- TextDrawColor(sdisplay[playerid], POLICE);
- TextDrawBoxColor(sdisplay[playerid], 0x00000076);
- TextDrawUseBox(sdisplay[playerid], 0);
- TextDrawTextSize(sdisplay[playerid], 606.000000, -2.000000);
- TextDrawBackgroundColor(sdisplay[playerid], 0x000000AA);
- TextDrawSetShadow(sdisplay[playerid],0); // This Removes Our Textdraw's Shadow ( Makes Easier To Read )
- TextDrawSetOutline(sdisplay[playerid],1); // This Adds A Black Outline To Our Textdraw ( Makes Easier To Read )
- TextDrawFont(sdisplay[playerid], 3); // This Changes Our Textdraw's Font ( I Think This Ones Makes It Easier To Read )
- TextDrawHideForPlayer(playerid,sdisplay[playerid]);
- TextDrawHideForPlayer(playerid,Time1);
- PlayerPlaySound(playerid,1183,418.1829,2533.8340,16.5637);
- new string[64], name[MAX_PLAYER_NAME];
- GetPlayerName(playerid,name,MAX_PLAYER_NAME);
- format(string,sizeof string,"LOGIN: %s has logged in to the server!",name);
- SendClientMessageToAll(LOGIN,string);
- SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
- SetPlayerMoney(playerid, PlayerInfo[playerid][pCash]);
- SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
- new file[256];
- gPlayerLogged[playerid] = 0;
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- new playernamesplit[3][MAX_PLAYER_NAME];
- split(name, playernamesplit, '_');
- if (!strlen(playernamesplit[0]) || !strlen(playernamesplit[1]))
- {
- SendClientMessage(playerid, WHITE, "Please choose a Valid Roleplaying Name before registering. (Ex: Bob_Thompson)");
- Kick(playerid);
- }
- if (!dini_Exists(file))
- {
- ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_PASSWORD, "You are not registered", "Welcome, please register a password for this account!", "Register", "Leave");
- }
- if(fexist(file))
- {
- ShowPlayerDialog(playerid, 2000, DIALOG_STYLE_PASSWORD, "This account is registered", "Your account is registered! Type in your password below!", "Login", "Leave");
- }
- return 1;
- }
- public settime(playerid)
- {
- new string[256],year,month,day,hours,minutes,seconds;
- gettime(hours, minutes, seconds);
- format(string, sizeof string, "%d/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
- format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
- TextDrawSetString(Time1, string);
- }
- public OnPlayerDisconnect(playerid, reason)
- {
- TextDrawHideForPlayer(playerid, Time1);
- PlayerInfo[playerid][Animation] = 0;
- new name[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- switch(reason)
- {
- case 0: format(string, sizeof(string), "LEAVE: %s has left the server. (Lost Connection)", name);
- case 1: format(string, sizeof(string), "LEAVE: %s has left the server. (Leaving)", name);
- case 2: format(string, sizeof(string), "LEAVE: %s has left the server. (Kicked)", name);
- }
- SendClientMessageToAll(0xAAAAAAAA, string);
- new file[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- if(gPlayerLogged[playerid] == 1)
- {
- dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
- dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
- dini_IntSet(file, "Group", PlayerInfo[playerid][Group]);
- dini_IntSet(file, "GroupRank", PlayerInfo[playerid][GroupRank]);
- dini_IntSet(file, "Job", PlayerInfo[playerid][pJob]);
- dini_IntSet(file, "Skin", PlayerInfo[playerid][Skin]);
- dini_IntSet(file, "GivingSlot", PlayerInfo[playerid][GivingSlot]);
- dini_IntSet(file, "PendingCarReceival", PlayerInfo[playerid][PendingCarReceival]);
- dini_FloatSet(file, "CarX", PlayerInfo[playerid][CarX]);
- dini_FloatSet(file, "CarY", PlayerInfo[playerid][CarY]);
- dini_FloatSet(file, "CarZ", PlayerInfo[playerid][CarZ]);
- dini_IntSet(file, "CarPaintJobID", PlayerInfo[playerid][CarPaintJobID]);
- dini_IntSet(file, "PlayerCarModel2", PlayerInfo[playerid][PlayerCarModel2]);
- dini_IntSet(file, "PlayerCarModel3", PlayerInfo[playerid][PlayerCarModel3]);
- dini_FloatSet(file, "Car2ZAngle", PlayerInfo[playerid][Car2ZAngle]);
- dini_FloatSet(file, "Car3ZAngle", PlayerInfo[playerid][Car3ZAngle]);
- dini_IntSet(file, "Car2Col1", PlayerInfo[playerid][Car2Col1]);
- dini_IntSet(file, "Car2Col2", PlayerInfo[playerid][Car2Col2]);
- dini_IntSet(file, "Car3Col1", PlayerInfo[playerid][Car3Col1]);
- dini_IntSet(file, "Car3Col2", PlayerInfo[playerid][Car3Col2]);
- dini_IntSet(file, "CarLinkID", PlayerInfo[playerid][CarLinkID]);
- dini_IntSet(file, "Car2LinkID", PlayerInfo[playerid][Car2LinkID]);
- dini_IntSet(file, "Car3LinkID", PlayerInfo[playerid][Car3LinkID]);
- dini_IntSet(file, "Car2PaintJobID", PlayerInfo[playerid][Car2PaintJobID]);
- dini_IntSet(file, "Car3PaintJobID", PlayerInfo[playerid][Car3PaintJobID]);
- dini_FloatSet(file, "Car2X", PlayerInfo[playerid][Car2X]);
- dini_FloatSet(file, "Car2Y", PlayerInfo[playerid][Car2Y]);
- dini_FloatSet(file, "Car2Z", PlayerInfo[playerid][Car2Z]);
- dini_FloatSet(file, "Car3X", PlayerInfo[playerid][Car3X]);
- dini_FloatSet(file, "Car3Y", PlayerInfo[playerid][Car3Y]);
- dini_FloatSet(file, "Car3Z", PlayerInfo[playerid][Car3Z]);
- dini_FloatSet(file, "CarZAngle", PlayerInfo[playerid][CarZAngle]);
- dini_IntSet(file, "CarModel", PlayerInfo[playerid][PlayerCarModel]);
- dini_IntSet(file, "CarCol1", PlayerInfo[playerid][CarCol1]);
- dini_IntSet(file, "CarCol2", PlayerInfo[playerid][CarCol2]);
- dini_IntSet(file, "Fish", PlayerInfo[playerid][Fish]);
- dini_IntSet(file, "FishBait", PlayerInfo[playerid][FishBait]);
- dini_IntSet(file, "FishLicense", PlayerInfo[playerid][FishLicense]);
- dini_IntSet(file, "FishRod", PlayerInfo[playerid][FishRod]);
- dini_IntSet(file, "FishWeight", PlayerInfo[playerid][FishWeight]);
- dini_IntSet(file, "Mats", PlayerInfo[playerid][pMats]);
- dini_IntSet(file, "BankMoney", PlayerInfo[playerid][BankMoney]);
- dini_IntSet(file, "Minutes", PlayerInfo[playerid][Minutes]);
- dini_IntSet(file, "Seconds", PlayerInfo[playerid][Seconds]);
- dini_IntSet(file, "Spawn", PlayerInfo[playerid][PlayerSpawn]);
- dini_IntSet(file, "Kills", PlayerInfo[playerid][Kills]);
- dini_IntSet(file, "Deaths", PlayerInfo[playerid][Deaths]);
- dini_IntSet(file, "Amination", PlayerInfo[playerid][Animation]);
- dini_IntSet(file, "House", PlayerInfo[playerid][House]);
- dini_IntSet(file, "BeingDraggedBy", PlayerInfo[playerid][BeingDraggedBy]);
- dini_IntSet(file, "WepSlot0", PlayerInfo[playerid][WepSlot0]);
- dini_IntSet(file, "WepSlot1", PlayerInfo[playerid][WepSlot1]);
- dini_IntSet(file, "WepSlot2", PlayerInfo[playerid][WepSlot2]);
- dini_IntSet(file, "WepSlot3", PlayerInfo[playerid][WepSlot3]);
- dini_IntSet(file, "WepSlot4", PlayerInfo[playerid][WepSlot4]);
- dini_IntSet(file, "WepSlot5", PlayerInfo[playerid][WepSlot5]);
- dini_IntSet(file, "WepSlot6", PlayerInfo[playerid][WepSlot6]);
- dini_IntSet(file, "WepSlot7", PlayerInfo[playerid][WepSlot7]);
- dini_IntSet(file, "WepSlot8", PlayerInfo[playerid][WepSlot8]);
- dini_IntSet(file, "WepSlot9", PlayerInfo[playerid][WepSlot9]);
- dini_IntSet(file, "WepSlot10", PlayerInfo[playerid][WepSlot10]);
- dini_IntSet(file, "WepSlot11", PlayerInfo[playerid][WepSlot11]);
- dini_IntSet(file, "WepSlot12", PlayerInfo[playerid][WepSlot12]);
- dini_IntSet(file, "WepSlot13", PlayerInfo[playerid][WepSlot13]);
- dini_IntSet(file, "WepSlot14", PlayerInfo[playerid][WepSlot14]);
- dini_IntSet(file, "WepSlot15", PlayerInfo[playerid][WepSlot15]);
- dini_IntSet(file, "Level", PlayerInfo[playerid][pLevel]);
- dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
- dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
- }
- return 1;
- }
- public OnPlayerSpawn(playerid)
- {
- OnDuty[playerid] = 0;
- OneMinuteTimer = SetTimerEx("OneMinutePublic", 60000, true, "i", playerid);
- OneSecondTimer = SetTimerEx("OneSecondPublic", 1000, true, "i", playerid);
- UpdateTimer = SetTimerEx("UpdatePublic", 5000, true, "i", playerid);
- SpawnOwnedCar(playerid, 1);
- SpawnOwnedCar(playerid, 2);
- SpawnOwnedCar(playerid, 3);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 999);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 999);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 999);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 999);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 999);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 999);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 999);
- SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 999);
- SetPlayerColor(playerid, WHITE);
- if(PlayerInfo[playerid][PlayerSpawn] == 0)
- {
- SetPlayerPos(playerid, 1283.9332,169.4734,20.4338);
- }
- if(PlayerInfo[playerid][PlayerSpawn] == 2)
- {
- SetPlayerPos(playerid, 1352.8156,351.6037,20.4168);
- }
- SetPlayerVirtualWorld(playerid, 0);
- TextDrawShowForPlayer(playerid, Time1);
- PlayerPlaySound(playerid,1069,418.1829,2533.8340,16.5637);
- SetPlayerWeather(playerid, GlobalWeather);
- ResetPlayerWeapons(playerid);
- GivePlayerSavedWeapons(playerid);
- PlayerPlaySound(playerid,1069,418.1829,2533.8340,16.5637);
- SetPlayerInterior(playerid, 0);
- SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
- return 1;
- }
- public OnPlayerDeath(playerid, killerid, reason)
- {
- new string[128];
- if(GetDistanceBetweenPlayers(killerid, playerid) > 25 && reason > 1 && reason < 100 && IsPlayerConnected(killerid) && killerid != playerid)
- {
- new weapon[128];
- GetWeaponName(reason, weapon, sizeof(weapon));
- format(string, sizeof(string), "WARNING: %s has killed %s; from a long distance, using a %s.", GetName(killerid), GetName(playerid), weapon);
- SendToAdmins(ADMINORANGE, string, 1);
- print(string);
- }
- if(reason == 49)
- {
- format(string, sizeof(string), "WARNING: %s has car-rammed %s to death.", GetName(killerid), GetName(playerid));
- SendToAdmins(ADMINORANGE, string, 1);
- print(string);
- }
- if(reason == 50)
- {
- if(IsAHelicopter(GetPlayerVehicleID(killerid)))
- {
- format(string, sizeof(string), "WARNING: %s has heli-killed %s.", GetName(killerid), GetName(playerid));
- SendToAdmins(ADMINORANGE, string, 1);
- print(string);
- }
- else
- {
- if(GetPlayerWeapon(killerid) != 32 || GetPlayerWeapon(killerid) != 28 || GetPlayerWeapon(killerid) != 29)
- {
- format(string, sizeof(string), "WARNING: %s has car-parked %s.", GetName(killerid), GetName(playerid));
- SendToAdmins(ADMINORANGE, string, 1);
- print(string);
- }
- }
- }
- PlayerInfo[playerid][Animation] = 0;
- TogglePlayerControllable(playerid, true);
- PlayerInfo[killerid][Kills]++;
- PlayerInfo[playerid][Deaths]++;
- RemovePlayerWeapons(playerid);
- return 1;
- }
- public OnVehicleSpawn(vehicleid)
- {
- Engine[vehicleid] = 0;
- Lights[vehicleid] = 0;
- Trunk[vehicleid] = 0;
- Hood[vehicleid] = 0;
- return 1;
- }
- public OnVehicleDeath(vehicleid, killerid)
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if (realchat)
- {
- new sendername[MAX_PLAYER_NAME], string[128];
- GetPlayerName(playerid, sendername, sizeof(sendername));
- sendername[strfind(sendername,"_")] = ' ';
- format(string, sizeof(string), "%s says: %s", sendername, text);
- ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
- return 0;
- }
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- TextDrawShowForPlayer(playerid,sdisplay[playerid]);
- return 1;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- TextDrawHideForPlayer(playerid,sdisplay[playerid]);
- return 1;
- }
- public OnPlayerStateChange(playerid, newstate, oldstate)
- {
- new carid = GetPlayerVehicleID(playerid);
- if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
- {
- TextDrawHideForPlayer(playerid, sdisplay[playerid]);
- KillTimer(stimer[playerid]); // This Stops Our Timer For When You Get Out Of Your Vehicle Your Speed Doesn't Keep Going
- }
- if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
- {
- if(carid == 407 || carid == 544 || carid == 416)
- {
- if(PlayerInfo[playerid][Group] == 2)
- {
- return 1;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not a member of the Fire Department!");
- RemovePlayerFromVehicle(playerid);
- }
- }
- TextDrawSetString(sdisplay[playerid], " "); // This Sets Our Textdraw To Blank And Freezes Because We Stop The Timer ^
- if(newstate == 2) stimer[playerid] = SetTimerEx("speedometer", 255, true, "i", playerid); // This Starts The Timer When The Player Changes His/Her State To Being The Driver
- else if(newstate == 3) stimer[playerid] = SetTimerEx("speedometer", 250, true, "i", playerid);
- }
- return 1;
- }
- public OnPlayerEnterCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerEnterRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnPlayerLeaveRaceCheckpoint(playerid)
- {
- return 1;
- }
- public OnRconCommand(cmd[])
- {
- return 1;
- }
- public OnPlayerRequestSpawn(playerid)
- {
- return 1;
- }
- public OnObjectMoved(objectid)
- {
- return 1;
- }
- public OnPlayerObjectMoved(playerid, objectid)
- {
- return 1;
- }
- public OnPlayerPickUpPickup(playerid, pickupid)
- {
- return 1;
- }
- public OnVehicleMod(playerid, vehicleid, componentid)
- {
- return 1;
- }
- public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
- {
- return 1;
- }
- public OnVehicleRespray(playerid, vehicleid, color1, color2)
- {
- return 1;
- }
- public OnPlayerSelectedMenuRow(playerid, row)
- {
- return 1;
- }
- public OnPlayerExitedMenu(playerid)
- {
- return 1;
- }
- public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
- {
- return 1;
- }
- public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
- {
- if(PlayerInfo[playerid][Animation] >= 1)
- {
- if(IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
- {
- PlayerInfo[playerid][Animation] = 0;
- ClearAnimations(playerid);
- StopLoopingAnimation(playerid);
- TogglePlayerControllable(playerid, true);
- SendClientMessage(playerid, WHITE, "You have cleared all animations.");
- }
- }
- return 1;
- }
- public OnRconLoginAttempt(ip[], password[], success)
- {
- return 1;
- }
- public OnPlayerUpdate(playerid)
- {
- if(OnDuty[playerid] == 1)
- {
- if(PlayerInfo[playerid][Group] == 2)
- {
- SetPlayerColor(playerid, 0x00FF00FF);
- }
- }
- new Float:health;
- GetPlayerHealth(playerid, health);
- if(health < 25.0)
- {
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- }
- if(PlayerInfo[playerid][Minutes] >= 60)
- {
- PlayerInfo[playerid][Minutes] -= 60;
- PlayerInfo[playerid][pScore] += 1;
- SendClientMessage(playerid, WHITE, "You have gained 1 Player Level Congratulations! (1 Hour of Playing)");
- }
- if(AdminDuty[playerid] == 1)
- {
- SetPlayerHealth(playerid, 50000);
- SetPlayerArmour(playerid, 50000);
- }
- if(Fishing[playerid] == 1)
- {
- GameTextForPlayer(playerid, "~g~Fishing...", 30000, 4);
- }
- SetPlayerMoney(playerid, PlayerInfo[playerid][pCash]);
- SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
- return 1;
- }
- public OnPlayerStreamIn(playerid, forplayerid)
- {
- return 1;
- }
- public OnPlayerStreamOut(playerid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamIn(vehicleid, forplayerid)
- {
- return 1;
- }
- public OnVehicleStreamOut(vehicleid, forplayerid)
- {
- return 1;
- }
- public GivePlayerSavedWeapons(playerid)
- {
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot0], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot1], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot2], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot3], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot4], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot5], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot6], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot7], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot8], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot9], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot10], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot11], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot12], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot13], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot14], 99999);
- GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot15], 99999);
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(response)
- {
- switch(dialogid)
- {
- case 333:
- {
- switch(listitem)
- {
- case 0:
- {
- PlayerInfo[playerid][PlayerSpawn] = 0;
- SendClientMessage(playerid, WHITE, "You will now spawn at the newbie spawn!");
- }
- case 1:
- {
- if(PlayerInfo[playerid][Group] > 0)
- {
- if(PlayerInfo[playerid][Group] == 2)
- {
- PlayerInfo[playerid][PlayerSpawn] = 2;
- SendClientMessage(playerid, WHITE, "You are a member of the Fire Department, therefore you will spawn at their HQ!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not belong to a group, therefore you will spawn at the Newbie Spawn!");
- PlayerInfo[playerid][PlayerSpawn] = 0;
- }
- }
- }
- }
- case 300:
- {
- new skinid, message[128];
- skinid = strval(inputtext);
- if(skinid < 0 || skinid > 299)
- {
- SendClientMessage(playerid, 0x33FF33AA, "Error: Choose a skin ID between 0 and 299.");
- }
- else
- {
- SetPlayerSkin(playerid, skinid);
- format(message, sizeof(message), "You have successfully purchased a set of clothes(ID: %d)! It costed you $25.00.", skinid);
- SendClientMessage(playerid, 0x33FF33AA, message);
- PlayerInfo[playerid][Skin] = skinid;
- PlayerInfo[playerid][pCash] -= 25;
- }
- }
- case 6:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- case 1:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- case 2:
- {
- SendClientMessage(playerid, WHITE, "CORRECT Answer, Next Question!");
- ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Define Metagaming.", "Using IC information ICly\nUsing OOC Information ICly\nUsing OOC information OOCly", "Select", "Cancel");
- }
- }
- }
- case 7:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- case 1:
- {
- SendClientMessage(playerid, WHITE, "CORRECT Answer, Next Question!");
- ShowPlayerDialog(playerid, 8, DIALOG_STYLE_LIST, "Define PowerGaming.", "Playing for Long periods of Time\nUsing Bots or Hacks\nForcing UN-RP Actions on a Player", "Select", "Cancel");
- }
- case 2:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- }
- }
- case 8:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- case 1:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- case 2:
- {
- SendClientMessage(playerid, WHITE, "CORRECT Answer, Next Question!");
- ShowPlayerDialog(playerid, 90, DIALOG_STYLE_LIST, "Define IC.", "In Character\nI'm Crazy\nIts Cruel", "Select", "Cancel");
- }
- }
- }
- case 90:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessage(playerid, WHITE, "CORRECT Answer, Next Question!");
- ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "Define DM", "Death Matching\nDick Muncher\nDont Masturbate", "Select", "Cancel");
- }
- case 1:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- case 2:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- }
- }
- case 9:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessage(playerid, WHITE, "CORRECT Answer, Next Question!");
- ShowPlayerDialog(playerid, 15, DIALOG_STYLE_LIST, "Define RK", "Rendered Knight\nRyan Knoblestone\nRevenge Killing", "Select", "Cancel");
- }
- case 1:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- case 2:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- }
- }
- case 15:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- case 1:
- {
- SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
- Kick(playerid);
- }
- case 2:
- {
- SendClientMessage(playerid, WHITE, "CORRECT Answer, You have Passed the Quiz!");
- SendClientMessage(playerid, WHITE, "To Ask Any Questions In Game, please use /n or /assistance!");
- SendClientMessage(playerid, WHITE, "Have a nice day! Have Fun and remember, This server is RolePlay!");
- SpawnPlayer(playerid);
- }
- }
- }
- case 100:
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= 500)
- {
- if(PlayerInfo[playerid][PlayerCarModel] > 0)
- {
- SpawnOwnedCar(playerid, 1);
- PlayerInfo[playerid][pCash] -= 500;
- SendClientMessage(playerid, WHITE, "You have respawned your Slot 1 Vehicle.");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have a vehicle in that slot!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to perfor this action!");
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= 500)
- {
- if(PlayerInfo[playerid][PlayerCarModel2] > 0)
- {
- SpawnOwnedCar(playerid, 2);
- PlayerInfo[playerid][pCash] -= 500;
- SendClientMessage(playerid, WHITE, "You have respawned your Slot 2 Vehicle.");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have a vehicle in that slot!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to perfor this action!");
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= 500)
- {
- if(PlayerInfo[playerid][PlayerCarModel3] > 0)
- {
- SpawnOwnedCar(playerid, 3);
- PlayerInfo[playerid][pCash] -= 500;
- SendClientMessage(playerid, WHITE, "You have respawned your Slot 3 Vehicle.");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have a vehicle in that slot!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to perfor this action!");
- }
- }
- }
- }
- case 346:
- {
- switch(listitem)
- {
- case 0:
- {
- ShowPlayerDialog(playerid, 347, DIALOG_STYLE_LIST, "Vehicle Dealership - Special Deals", "Blista Compact ($8,000)\nClover ($4,300)\nStallion ($5,700)\nTampa ($3,800)\n", "Select", "Cancel");
- }
- case 1:
- {
- ShowPlayerDialog(playerid, 348, DIALOG_STYLE_LIST, "Vehicle Dealership - Low-Riders", "Blade ($22,000)\nRemington ($28,000)\nSavanna ($30,000)\nSlamvan ($32,000)\nTornado ($24,500)\n", "Select", "Cancel");
- }
- case 2:
- {
- ShowPlayerDialog(playerid, 349, DIALOG_STYLE_LIST, "Vehicle Dealership - Saloon Cars", "Elegant ($34,000)\nPremier ($30,000)\nSentinel ($45,000)\nStretch ($55,000)\nSunrise ($33,000)\nWashington ($38,000)\n", "Select", "Cancel");
- }
- case 3:
- {
- ShowPlayerDialog(playerid, 350, DIALOG_STYLE_LIST, "Vehicle Dealership - 4x4 / Off-Roaders / Pickups", "Huntley ($48,000)\nLandstalker ($37,000)\nMesa ($35,000)\nRancher ($43,000)\nSandking ($60,000)\nYosemite ($10,000)\n", "Select", "Cancel");
- }
- case 4:
- {
- ShowPlayerDialog(playerid, 310, DIALOG_STYLE_LIST, "Vehicle Dealership - Bikes", "Wayfarer ($15,000)\nFCR-900 ($20,000)\nPCJ-600 ($20,000)\nFreeway ($21,000)\n", "Select", "Cancel");
- }
- case 5:
- {
- ShowPlayerDialog(playerid, 351, DIALOG_STYLE_LIST, "Vehicle Dealership - Sports / Muscle / Supercars", "Banshee ($120,000)\nBuffalo ($57,000)\nComet ($80,000)\nPhoenix ($90,000)\nSultan ($85,000)\n", "Select", "Cancel");
- }
- case 6:
- {
- ShowPlayerDialog(playerid, 352, DIALOG_STYLE_LIST, "Vehicle Dealership - VIP Models", "Cheetah ($10,000)\nBullet ($10,000)\nInfernus ($10,000)\nNRG-500 ($10,000)\nTurismo ($10,000)\nMaverick ($10,000)\nSanchez ($10,000)\nQuadbike ($10,000)\n", "Select", "Cancel");
- }
- }
- }
- case 310:
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= 15000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 586;
- PlayerInfo[playerid][CarPriceBeingCarried] = 15000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= 20000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 521;
- PlayerInfo[playerid][CarPriceBeingCarried] = 20000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= 20000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 461;
- PlayerInfo[playerid][CarPriceBeingCarried] = 20000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 3:
- {
- if(PlayerInfo[playerid][pCash] >= 21000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 463;
- PlayerInfo[playerid][CarPriceBeingCarried] = 21000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- }
- }
- case 352:
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= 10000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 415;
- PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= 10000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 541;
- PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= 10000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 411;
- PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 3:
- {
- if(PlayerInfo[playerid][pCash] >= 10000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 522;
- PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 4:
- {
- if(PlayerInfo[playerid][pCash] >= 10000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 451;
- PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 5:
- {
- if(PlayerInfo[playerid][pCash] >= 10000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 487;
- PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 6:
- {
- if(PlayerInfo[playerid][pCash] >= 10000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 468;
- PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 7:
- {
- if(PlayerInfo[playerid][pCash] >= 10000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 471;
- PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- }
- }
- case 94:
- {
- if(PlayerInfo[playerid][CarBeingCarried] >= 1)
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= PlayerInfo[playerid][CarPriceBeingCarried])
- {
- PurchaseCar(playerid, PlayerInfo[playerid][CarBeingCarried], PlayerInfo[playerid][CarPriceBeingCarried], 1);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough money on you.");
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= PlayerInfo[playerid][CarPriceBeingCarried])
- {
- PurchaseCar(playerid, PlayerInfo[playerid][CarBeingCarried], PlayerInfo[playerid][CarPriceBeingCarried], 2);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough money on you.");
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= PlayerInfo[playerid][CarPriceBeingCarried])
- {
- PurchaseCar(playerid, PlayerInfo[playerid][CarBeingCarried], PlayerInfo[playerid][CarPriceBeingCarried], 3);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough money on you.");
- }
- }
- }
- }
- }
- case 347:
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= 8000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 496;
- PlayerInfo[playerid][CarPriceBeingCarried] = 8000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= 4300)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 542;
- PlayerInfo[playerid][CarPriceBeingCarried] = 4300;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= 5700)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 439;
- PlayerInfo[playerid][CarPriceBeingCarried] = 5700;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 3:
- {
- if(PlayerInfo[playerid][pCash] >= 3800)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 549;
- PlayerInfo[playerid][CarPriceBeingCarried] = 3800;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- }
- }
- case 16:
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][GivingSlot] == 1)
- {
- if(PlayerInfo[playerid][CarLinkID] >= 1)
- {
- DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
- PlayerInfo[playerid][CarLinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel] = 0;
- }
- GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID], PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ]);
- DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID]);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel];
- PlayerInfo[playerid][PendingCarReceival] = -1;
- SpawnOwnedCar(playerid, 1);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel] = 0;
- }
- if(PlayerInfo[playerid][GivingSlot] == 2)
- {
- if(PlayerInfo[playerid][CarLinkID] >= 1)
- {
- DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
- PlayerInfo[playerid][CarLinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel] = 0;
- }
- GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID], PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ]);
- DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID]);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2];
- PlayerInfo[playerid][PendingCarReceival] = -1;
- SpawnOwnedCar(playerid, 1);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2] = 0;
- }
- if(PlayerInfo[playerid][GivingSlot] == 3)
- {
- if(PlayerInfo[playerid][CarLinkID] >= 1)
- {
- DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
- PlayerInfo[playerid][CarLinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel] = 0;
- }
- GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID], PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ]);
- DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID]);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3];
- PlayerInfo[playerid][PendingCarReceival] = -1;
- SpawnOwnedCar(playerid, 1);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3] = 0;
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][GivingSlot] == 1)
- {
- if(PlayerInfo[playerid][Car2LinkID] >= 1)
- {
- DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
- PlayerInfo[playerid][Car2LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel2] = 0;
- }
- GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID], PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z]);
- DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID]);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel2] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel];
- PlayerInfo[playerid][PendingCarReceival] = -1;
- SpawnOwnedCar(playerid, 2);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel] = 0;
- }
- if(PlayerInfo[playerid][GivingSlot] == 2)
- {
- if(PlayerInfo[playerid][Car2LinkID] >= 1)
- {
- DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
- PlayerInfo[playerid][Car2LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel2] = 0;
- }
- GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID], PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z]);
- DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID]);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel2] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2];
- PlayerInfo[playerid][PendingCarReceival] = -1;
- SpawnOwnedCar(playerid, 2);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2] = 0;
- }
- if(PlayerInfo[playerid][GivingSlot] == 3)
- {
- if(PlayerInfo[playerid][Car2LinkID] >= 1)
- {
- DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
- PlayerInfo[playerid][Car2LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel2] = 0;
- }
- GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID], PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z]);
- DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID]);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel2] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3];
- PlayerInfo[playerid][PendingCarReceival] = -1;
- SpawnOwnedCar(playerid, 2);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3] = 0;
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][GivingSlot] == 1)
- {
- if(PlayerInfo[playerid][Car3LinkID] >= 1)
- {
- DestroyVehicle(PlayerInfo[playerid][Car3LinkID]);
- PlayerInfo[playerid][Car3LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel3] = 0;
- }
- GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID], PlayerInfo[playerid][Car3X], PlayerInfo[playerid][Car3Y], PlayerInfo[playerid][Car3Z]);
- DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID]);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel3] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel];
- PlayerInfo[playerid][PendingCarReceival] = -1;
- SpawnOwnedCar(playerid, 3);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel] = 0;
- }
- if(PlayerInfo[playerid][GivingSlot] == 2)
- {
- if(PlayerInfo[playerid][Car3LinkID] >= 1)
- {
- DestroyVehicle(PlayerInfo[playerid][Car3LinkID]);
- PlayerInfo[playerid][Car3LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel3] = 0;
- }
- GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID], PlayerInfo[playerid][Car3X], PlayerInfo[playerid][Car3Y], PlayerInfo[playerid][Car3Z]);
- DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID]);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel3] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2];
- PlayerInfo[playerid][PendingCarReceival] = -1;
- SpawnOwnedCar(playerid, 3);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2] = 0;
- }
- if(PlayerInfo[playerid][GivingSlot] == 3)
- {
- if(PlayerInfo[playerid][Car3LinkID] >= 1)
- {
- DestroyVehicle(PlayerInfo[playerid][Car3LinkID]);
- PlayerInfo[playerid][Car3LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel3] = 0;
- }
- GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID], PlayerInfo[playerid][Car3X], PlayerInfo[playerid][Car3Y], PlayerInfo[playerid][Car3Z]);
- DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID]);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID] = 0;
- PlayerInfo[playerid][PlayerCarModel3] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3];
- PlayerInfo[playerid][PendingCarReceival] = -1;
- SpawnOwnedCar(playerid, 3);
- PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3] = 0;
- }
- }
- }
- }
- case 348:
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= 22000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 536;
- PlayerInfo[playerid][CarPriceBeingCarried] = 22000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= 28000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 534;
- PlayerInfo[playerid][CarPriceBeingCarried] = 28000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= 30000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 567;
- PlayerInfo[playerid][CarPriceBeingCarried] = 30000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 3:
- {
- if(PlayerInfo[playerid][pCash] >= 32000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 535;
- PlayerInfo[playerid][CarPriceBeingCarried] = 32000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 4:
- {
- if(PlayerInfo[playerid][pCash] >= 24500)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 576;
- PlayerInfo[playerid][CarPriceBeingCarried] = 24500;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- }
- }
- case 349:
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= 34000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 507;
- PlayerInfo[playerid][CarPriceBeingCarried] = 34000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= 30000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 526;
- PlayerInfo[playerid][CarPriceBeingCarried] = 30000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= 45000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 405;
- PlayerInfo[playerid][CarPriceBeingCarried] = 45000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 3:
- {
- if(PlayerInfo[playerid][pCash] >= 55000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 409;
- PlayerInfo[playerid][CarPriceBeingCarried] = 55000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 4:
- {
- if(PlayerInfo[playerid][pCash] >= 33000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 550;
- PlayerInfo[playerid][CarPriceBeingCarried] = 33000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 5:
- {
- if(PlayerInfo[playerid][pCash] >= 38000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 421;
- PlayerInfo[playerid][CarPriceBeingCarried] = 38000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- }
- }
- case 350:
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= 48000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 579;
- PlayerInfo[playerid][CarPriceBeingCarried] = 48000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= 37000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 400;
- PlayerInfo[playerid][CarPriceBeingCarried] = 37000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= 35000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 500;
- PlayerInfo[playerid][CarPriceBeingCarried] = 35000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 3:
- {
- if(PlayerInfo[playerid][pCash] >= 43000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 489;
- PlayerInfo[playerid][CarPriceBeingCarried] = 43000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 4:
- {
- if(PlayerInfo[playerid][pCash] >= 60000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 495;
- PlayerInfo[playerid][CarPriceBeingCarried] = 60000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 5:
- {
- if(PlayerInfo[playerid][pCash] >= 10000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 554;
- PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- }
- }
- case 351:
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= 120000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 429;
- PlayerInfo[playerid][CarPriceBeingCarried] = 120000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= 57000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 402;
- PlayerInfo[playerid][CarPriceBeingCarried] = 57000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= 80000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 480;
- PlayerInfo[playerid][CarPriceBeingCarried] = 80000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 3:
- {
- if(PlayerInfo[playerid][pCash] >= 90000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 603;
- PlayerInfo[playerid][CarPriceBeingCarried] = 90000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- case 4:
- {
- if(PlayerInfo[playerid][pCash] >= 85000)
- {
- ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
- PlayerInfo[playerid][CarBeingCarried] = 560;
- PlayerInfo[playerid][CarPriceBeingCarried] = 85000;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have enough.");
- }
- }
- }
- }
- case 1000:
- {
- new name[MAX_PLAYER_NAME], file[256], string[128];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- if(!response) return Kick(playerid);
- if (!strlen(inputtext)) return
- ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_INPUT, "Not Registered!", "You are not registered!", "Register", "Leave");
- dini_Create(file);
- dini_FloatSet(file, "CarX",PlayerInfo[playerid][CarX] = 0);
- dini_FloatSet(file, "CarY",PlayerInfo[playerid][CarY] = 0);
- dini_FloatSet(file, "CarZ",PlayerInfo[playerid][CarZ] = 0);
- dini_IntSet(file, "GivingSlot", PlayerInfo[playerid][GivingSlot] = 0);
- dini_IntSet(file, "PendingCarReceival", PlayerInfo[playerid][PendingCarReceival] = 0);
- dini_IntSet(file, "CarPaintJobID",PlayerInfo[playerid][CarPaintJobID] = 0);
- dini_IntSet(file, "PlayerCarModel2",PlayerInfo[playerid][PlayerCarModel2] = 0);
- dini_IntSet(file, "PlayerCarModel3",PlayerInfo[playerid][PlayerCarModel3] = 0);
- dini_FloatSet(file, "Car2ZAngle",PlayerInfo[playerid][Car2ZAngle] = 0);
- dini_FloatSet(file, "Car3ZAngle",PlayerInfo[playerid][Car3ZAngle] = 0);
- dini_IntSet(file, "Car2Col1",PlayerInfo[playerid][Car2Col1] = 0);
- dini_IntSet(file, "Car2Col2",PlayerInfo[playerid][Car2Col2] = 0);
- dini_IntSet(file, "Car3Col1",PlayerInfo[playerid][Car3Col1] = 0);
- dini_IntSet(file, "Car3Col2",PlayerInfo[playerid][Car3Col2] = 0);
- dini_IntSet(file, "CarLinkID",PlayerInfo[playerid][CarLinkID] = 0);
- dini_IntSet(file, "Car2LinkID",PlayerInfo[playerid][CarLinkID] = 0);
- dini_IntSet(file, "Car3LinkID",PlayerInfo[playerid][Car3LinkID] = 0);
- dini_IntSet(file, "Car2PaintJobID",PlayerInfo[playerid][Car2PaintJobID] = 0);
- dini_IntSet(file, "Car3PaintJobID",PlayerInfo[playerid][Car3PaintJobID] = 0);
- dini_FloatSet(file, "Car2X",PlayerInfo[playerid][Car2X] = 0);
- dini_FloatSet(file, "Car2Y",PlayerInfo[playerid][Car2Y] = 0);
- dini_FloatSet(file, "Car2Z",PlayerInfo[playerid][Car2Z] = 0);
- dini_FloatSet(file, "Car3X",PlayerInfo[playerid][Car3X] = 0);
- dini_FloatSet(file, "Car3Y",PlayerInfo[playerid][Car3Y] = 0);
- dini_FloatSet(file, "Car3Z",PlayerInfo[playerid][Car3Z] = 0);
- dini_FloatSet(file, "CarZAngle",PlayerInfo[playerid][CarZAngle] = 0);
- dini_IntSet(file, "PlayerCarModel",PlayerInfo[playerid][PlayerCarModel] = 0);
- dini_IntSet(file, "CarCol1",PlayerInfo[playerid][CarCol1] = 0);
- dini_IntSet(file, "CarCol2",PlayerInfo[playerid][CarCol2] = 0);
- dini_IntSet(file, "Password",udb_hash(inputtext));
- dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0);
- dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 500);
- dini_IntSet(file, "Group",PlayerInfo[playerid][Group] = 0);
- dini_IntSet(file, "GroupRank",PlayerInfo[playerid][GroupRank] = 0);
- dini_IntSet(file, "Job",PlayerInfo[playerid][pJob] = 0);
- dini_IntSet(file, "Skin", PlayerInfo[playerid][Skin] = 0);
- dini_IntSet(file, "Fish",PlayerInfo[playerid][Fish] = 0);
- dini_IntSet(file, "FishBait",PlayerInfo[playerid][FishBait] = 0);
- dini_IntSet(file, "FishRod",PlayerInfo[playerid][FishRod] = 0);
- dini_IntSet(file, "FishWeight",PlayerInfo[playerid][FishWeight] = 0);
- dini_IntSet(file, "FishLicense",PlayerInfo[playerid][FishLicense] = 0);
- dini_IntSet(file, "House",PlayerInfo[playerid][House] = 0);
- dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0);
- dini_IntSet(file, "Spawn",PlayerInfo[playerid][PlayerSpawn] = 0);
- dini_IntSet(file, "Mats",PlayerInfo[playerid][pMats] = 0);
- dini_IntSet(file, "BankMoney", PlayerInfo[playerid][BankMoney] = 0);
- dini_IntSet(file, "Minutes", PlayerInfo[playerid][Minutes] = 0);
- dini_IntSet(file, "Seconds", PlayerInfo[playerid][Seconds] = 0);
- dini_IntSet(file, "Kills",PlayerInfo[playerid][Kills] = 0);
- dini_IntSet(file, "Deaths",PlayerInfo[playerid][Deaths] = 0);
- dini_IntSet(file, "Animcation", PlayerInfo[playerid][Animation] = 0);
- dini_IntSet(file, "BeingDraggedBy",PlayerInfo[playerid][BeingDraggedBy] = 0);
- dini_IntSet(file, "WepSlot0",PlayerInfo[playerid][WepSlot0] = 0);
- dini_IntSet(file, "WepSlot1",PlayerInfo[playerid][WepSlot1] = 0);
- dini_IntSet(file, "WepSlot2",PlayerInfo[playerid][WepSlot2] = 0);
- dini_IntSet(file, "WepSlot3",PlayerInfo[playerid][WepSlot3] = 0);
- dini_IntSet(file, "WepSlot4",PlayerInfo[playerid][WepSlot4] = 0);
- dini_IntSet(file, "WepSlot5",PlayerInfo[playerid][WepSlot5] = 0);
- dini_IntSet(file, "WepSlot6",PlayerInfo[playerid][WepSlot6] = 0);
- dini_IntSet(file, "WepSlot7",PlayerInfo[playerid][WepSlot7] = 0);
- dini_IntSet(file, "WepSlot8",PlayerInfo[playerid][WepSlot8] = 0);
- dini_IntSet(file, "WepSlot9",PlayerInfo[playerid][WepSlot9] = 0);
- dini_IntSet(file, "WepSlot10",PlayerInfo[playerid][WepSlot10] = 0);
- dini_IntSet(file, "WepSlot11",PlayerInfo[playerid][WepSlot11] = 0);
- dini_IntSet(file, "WepSlot12",PlayerInfo[playerid][WepSlot12] = 0);
- dini_IntSet(file, "WepSlot13",PlayerInfo[playerid][WepSlot13] = 0);
- dini_IntSet(file, "WepSlot14",PlayerInfo[playerid][WepSlot14] = 0);
- dini_IntSet(file, "WepSlot15",PlayerInfo[playerid][WepSlot15] = 0);
- dini_IntSet(file, "Level",PlayerInfo[playerid][pLevel] = 0);
- dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0);
- format(string, 128, "[SYSTEM]: You succesfully registered the name [ %s ] with password [ %s ]!", name, inputtext);
- PutPlayerInTutorial(playerid);
- SendClientMessage(playerid, COLOR_YELLOW, string);
- gPlayerLogged[playerid] = 1;
- }
- case 2000:
- {
- new name[MAX_PLAYER_NAME], file[256];
- GetPlayerName(playerid, name, sizeof(name));
- format(file, sizeof(file), SERVER_USER_FILE, name);
- if(!response) return Kick(playerid);
- if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Registered!", "You are registered! Type in your password to login.", "Login", "Leave");
- new tmp;
- tmp = dini_Int(file, "Password");
- if(udb_hash(inputtext) != tmp)
- {
- ShowPlayerDialog(playerid, 2000, DIALOG_STYLE_INPUT, "Registered!", "You are registered! Type in your password to login.", "Login", "Leave");
- }
- else
- {
- gPlayerLogged[playerid] = 1;
- PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
- PlayerInfo[playerid][pCash] = dini_Int(file, "Money");
- PlayerInfo[playerid][Group] = dini_Int(file, "Group");
- PlayerInfo[playerid][GroupRank] = dini_Int(file, "GroupRank");
- PlayerInfo[playerid][pJob] = dini_Int(file, "Job");
- PlayerInfo[playerid][Skin] = dini_Int(file, "Skin");
- PlayerInfo[playerid][pScore] = dini_Int(file, "Score");
- PlayerInfo[playerid][Deaths] = dini_Int(file, "Deaths");
- PlayerInfo[playerid][Kills] = dini_Int(file, "Kills");
- PlayerInfo[playerid][PendingCarReceival] = dini_Int(file, "PendingCarReceival");
- PlayerInfo[playerid][GivingSlot] = dini_Int(file, "GivingSlot");
- PlayerInfo[playerid][FishBait] = dini_Int(file, "FishBait");
- PlayerInfo[playerid][FishWeight] = dini_Int(file, "FishWeight");
- PlayerInfo[playerid][FishRod] = dini_Int(file, "FishRod");
- PlayerInfo[playerid][FishLicense] = dini_Int(file, "FishLicense");
- PlayerInfo[playerid][Fish] = dini_Int(file, "Fish");
- PlayerInfo[playerid][pMats] = dini_Int(file, "Mats");
- PlayerInfo[playerid][Minutes] = dini_Int(file, "Minutes");
- PlayerInfo[playerid][Seconds] = dini_Int(file, "Seconds");
- PlayerInfo[playerid][BankMoney] = dini_Int(file, "BankMoney");
- PlayerInfo[playerid][WepSlot0] = dini_Int(file, "WepSlot0");
- PlayerInfo[playerid][WepSlot1] = dini_Int(file, "WepSlot1");
- PlayerInfo[playerid][WepSlot2] = dini_Int(file, "WepSlot2");
- PlayerInfo[playerid][WepSlot3] = dini_Int(file, "WepSlot3");
- PlayerInfo[playerid][WepSlot4] = dini_Int(file, "WepSlot4");
- PlayerInfo[playerid][WepSlot5] = dini_Int(file, "WepSlot5");
- PlayerInfo[playerid][WepSlot6] = dini_Int(file, "WepSlot6");
- PlayerInfo[playerid][WepSlot7] = dini_Int(file, "WepSlot7");
- PlayerInfo[playerid][WepSlot8] = dini_Int(file, "WepSlot8");
- PlayerInfo[playerid][WepSlot9] = dini_Int(file, "WepSlot9");
- PlayerInfo[playerid][WepSlot10] = dini_Int(file, "WepSlot10");
- PlayerInfo[playerid][WepSlot11] = dini_Int(file, "WepSlot11");
- PlayerInfo[playerid][WepSlot12] = dini_Int(file, "WepSlot12");
- PlayerInfo[playerid][WepSlot13] = dini_Int(file, "WepSlot13");
- PlayerInfo[playerid][WepSlot14] = dini_Int(file, "WepSlot14");
- PlayerInfo[playerid][WepSlot15] = dini_Int(file, "WepSlot15");
- PlayerInfo[playerid][CarX] = dini_Int(file, "CarX");
- PlayerInfo[playerid][CarY] = dini_Int(file, "CarY");
- PlayerInfo[playerid][CarZ] = dini_Int(file, "CarZ");
- PlayerInfo[playerid][CarPaintJobID] = dini_Int(file, "CarPaintJobID");
- PlayerInfo[playerid][PlayerCarModel2] = dini_Int(file, "PlayerCarModel2");
- PlayerInfo[playerid][PlayerCarModel3] = dini_Int(file, "PlayerCarModel3");
- PlayerInfo[playerid][Car2ZAngle] = dini_Int(file, "Car2ZAngle");
- PlayerInfo[playerid][Car3ZAngle] = dini_Int(file, "Car3ZAngle");
- PlayerInfo[playerid][Car2Col1] = dini_Int(file, "Car2Col1");
- PlayerInfo[playerid][Car2Col2] = dini_Int(file, "Car2Col2");
- PlayerInfo[playerid][Car3Col1] = dini_Int(file, "Car3Col1");
- PlayerInfo[playerid][Car3Col2] = dini_Int(file, "Car3Col2");
- PlayerInfo[playerid][CarLinkID] = dini_Int(file, "CarLinkID");
- PlayerInfo[playerid][Car2LinkID] = dini_Int(file, "Car2LinkID");
- PlayerInfo[playerid][Car3LinkID] = dini_Int(file, "Car3LinkID");
- PlayerInfo[playerid][Car2PaintJobID] = dini_Int(file, "Car2PaitnJobID");
- PlayerInfo[playerid][Car3PaintJobID] = dini_Int(file, "Car3PaitnJobID");
- PlayerInfo[playerid][Car2X] = dini_Int(file, "Car2X");
- PlayerInfo[playerid][Car2Y] = dini_Int(file, "Car2Y");
- PlayerInfo[playerid][Car2Z] = dini_Int(file, "Car2Z");
- PlayerInfo[playerid][Car3X] = dini_Int(file, "Car3X");
- PlayerInfo[playerid][Car3Y] = dini_Int(file, "Car3Y");
- PlayerInfo[playerid][Car3Z] = dini_Int(file, "Car3Z");
- PlayerInfo[playerid][CarZAngle] = dini_Int(file, "CarZAngle");
- PlayerInfo[playerid][PlayerCarModel] = dini_Int(file, "PlayerCarModel");
- PlayerInfo[playerid][CarCol1] = dini_Int(file, "CarCol1");
- PlayerInfo[playerid][CarCol2] = dini_Int(file, "CarCol2");
- SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
- GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
- SendClientMessage(playerid,COLOR_RED, "[SYSTEM]: Successfully logged in!");
- SpawnPlayerAlways(playerid);
- }
- }
- case 1:
- {
- switch(listitem)
- {
- case 0:
- {
- SendClientMessage(playerid, WHITE, "/pm[playerid](ooc messages), /makegun");
- }
- case 1:
- {
- SendClientMessage(playerid, WHITE, "/bar, /hide, /handsup, /rap, /reload, /laugh, /dance, /sit, /gsit, /ko, /wave, /spank");
- SendClientMessage(playerid, WHITE, "/fuckoff, /chat, /deal, /vomit, /bomb, /crack, /piss, /masturbate, /crossarms, /robman, /pedmove");
- }
- case 2:
- {
- SendClientMessage(playerid, WHITE, "/eon - Car Engine ON, /eoff - Car Engine OFF, /open(close)trunk - Open and Close Trunk");
- SendClientMessage(playerid, WHITE, "/lon(off) - Turn lights on and off, /open(close)hood - Open and Close Hood");
- }
- }
- }
- case 10:
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pCash] >= 10)
- {
- if(PlayerInfo[playerid][FishBait] <= 500)
- {
- PlayerInfo[playerid][FishBait] += 25;
- PlayerInfo[playerid][pCash] -= 10;
- SendClientMessage(playerid, WHITE, "You have baught 25 Fishing Bait!");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You can only have a maximum of 500 Fish Bait!");
- }
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pCash] >= 250)
- {
- if(PlayerInfo[playerid][FishLicense] == 0)
- {
- PlayerInfo[playerid][FishLicense] = 1;
- PlayerInfo[playerid][pCash] -= 250;
- SendClientMessage(playerid, WHITE, "You have purchased a Fishing License!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You already have a Fishing License!");
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][pCash] >= 150)
- {
- if(PlayerInfo[playerid][FishRod] == 0)
- {
- PlayerInfo[playerid][FishRod] = 1;
- PlayerInfo[playerid][pCash] -= 150;
- SendClientMessage(playerid, WHITE, "You have purchased a Fishing Rod!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You already have a Fishing Rod!");
- }
- }
- }
- }
- case 2:
- {
- switch(listitem)
- {
- case 0:
- {
- if(PlayerInfo[playerid][pMats] >= 100)
- {
- if(PlayerInfo[playerid][pCash] >= 100)
- {
- PlayerInfo[playerid][pCash] -= 100;
- PlayerInfo[playerid][pMats] -= 100;
- GivePlayerWeapon(playerid, 1, 1000);
- SendClientMessage(playerid, WHITE, "You have made a pair of Brass Knuckles for 100 materials and $100.");
- PlayerInfo[playerid][WepSlot0] = 1;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
- }
- }
- case 1:
- {
- if(PlayerInfo[playerid][pMats] >= 300)
- {
- if(PlayerInfo[playerid][pCash] >= 300)
- {
- PlayerInfo[playerid][pCash] -= 300;
- PlayerInfo[playerid][pMats] -= 300;
- GivePlayerWeapon(playerid, 4, 1000);
- SendClientMessage(playerid, WHITE, "You have made an Assasin's Knife for 300 materials and $300.");
- PlayerInfo[playerid][WepSlot1] = 4;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][pMats] >= 500)
- {
- if(PlayerInfo[playerid][pCash] >= 500)
- {
- PlayerInfo[playerid][pCash] -= 500;
- PlayerInfo[playerid][pMats] -= 500;
- GivePlayerWeapon(playerid, 22, 1000);
- SendClientMessage(playerid, WHITE, "You have made a 9MM for 500 materials and $500.");
- PlayerInfo[playerid][WepSlot2] = 22;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
- }
- }
- case 3:
- {
- if(PlayerInfo[playerid][pMats] >= 700)
- {
- if(PlayerInfo[playerid][pCash] >= 700)
- {
- PlayerInfo[playerid][pCash] -= 700;
- PlayerInfo[playerid][pMats] -= 700;
- GivePlayerWeapon(playerid, 24, 1000);
- SendClientMessage(playerid, WHITE, "You have made a Desert Eagle for 700 materials and $700.");
- PlayerInfo[playerid][WepSlot3] = 24;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
- }
- }
- case 4:
- {
- if(PlayerInfo[playerid][pMats] >= 900)
- {
- if(PlayerInfo[playerid][pCash] >= 900)
- {
- PlayerInfo[playerid][pCash] -= 900;
- PlayerInfo[playerid][pMats] -= 900;
- GivePlayerWeapon(playerid, 25, 1000);
- SendClientMessage(playerid, WHITE, "You have made a Shotgun for 900 materials and $900.");
- PlayerInfo[playerid][WepSlot4] = 25;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
- }
- }
- case 5:
- {
- if(PlayerInfo[playerid][pMats] >= 1100)
- {
- if(PlayerInfo[playerid][pCash] >= 1100)
- {
- PlayerInfo[playerid][pCash] -= 1100;
- PlayerInfo[playerid][pMats] -= 1100;
- GivePlayerWeapon(playerid, 29, 1000);
- SendClientMessage(playerid, WHITE, "You have made an MP-5 for 1100 materials and $1100.");
- PlayerInfo[playerid][WepSlot5] = 29;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
- }
- }
- case 6:
- {
- if(PlayerInfo[playerid][pMats] >= 1500)
- {
- if(PlayerInfo[playerid][pCash] >= 1500)
- {
- PlayerInfo[playerid][pCash] -= 1500;
- PlayerInfo[playerid][pMats] -= 1500;
- GivePlayerWeapon(playerid, 30, 1000);
- SendClientMessage(playerid, WHITE, "You have made an AK-47 for 1500 materials and $1500.");
- PlayerInfo[playerid][WepSlot6] = 30;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
- }
- }
- case 7:
- {
- if(PlayerInfo[playerid][pMats] >= 2000)
- {
- if(PlayerInfo[playerid][pCash] >= 2000)
- {
- PlayerInfo[playerid][pCash] -= 2000;
- PlayerInfo[playerid][pMats] -= 2000;
- GivePlayerWeapon(playerid, 31, 1000);
- SendClientMessage(playerid, WHITE, "You have made an M4A1 for 2000 materials and $2000.");
- PlayerInfo[playerid][WepSlot7] = 31;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
- }
- }
- }
- }
- }
- }
- return 1;
- }
- public OnPlayerClickPlayer(playerid, clickedplayerid, source)
- {
- return 1;
- }
- public SetPlayerPosEx(playerid, Float: posx, Float: posy, Float: posz, interior, virtualworld)
- {
- if(GetPlayerState(playerid) == 2)
- {
- SetPlayerVirtualWorld(playerid, virtualworld);
- SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), virtualworld);
- LinkVehicleToInterior(GetPlayerVehicleID(playerid), interior);
- SetPlayerInterior(playerid, interior);
- SetVehiclePos(GetPlayerVehicleID(playerid), posx, posy, posz);
- return 1;
- }
- else
- {
- SetPlayerVirtualWorld(playerid, virtualworld);
- SetPlayerInterior(playerid, interior);
- SetPlayerPos(playerid, posx, posy, posz);
- return 1;
- }
- }
- //zcmd commands below
- command(set, playerid, params[])
- {
- new Usage[128], id, string[128], string2[128], amount;
- if(sscanf(params, "zud", Usage, id, amount))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /set [usage] [id] [amount]");
- SendClientMessage(playerid, GREY, "Usages: Health, Armour, VirtualWorld");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if(strcmp(Usage, "Health", true) == 0)
- {
- SetPlayerHealth(id, amount);
- format(string, sizeof(string), "Admin %s has set your Health to %d.", GetName(playerid), amount);
- SendClientMessage(id, WHITE, string);
- format(string2, sizeof(string2), "You have set %s's Health to %d.", GetName(id), amount);
- SendClientMessage(playerid, WHITE, string2);
- }
- else if(strcmp(Usage, "Armour", true) == 0)
- {
- SetPlayerArmour(id, amount);
- format(string, sizeof(string), "Admin %s has set your Armour to %d.", GetName(playerid), amount);
- SendClientMessage(id, WHITE, string);
- format(string2, sizeof(string2), "You have set %s's Armour to %d.", GetName(id), amount);
- SendClientMessage(playerid, WHITE, string2);
- }
- else if(strcmp(Usage, "Virtualworld", true) == 0)
- {
- SetPlayerHealth(id, amount);
- format(string, sizeof(string), "Admin %s has set your VirtualWorld to %d.", GetName(playerid), amount);
- SendClientMessage(id, WHITE, string);
- format(string2, sizeof(string2), "You have set %s's VirtualWorld to %d.", GetName(id), amount);
- SendClientMessage(playerid, WHITE, string2);
- }
- }
- }
- return 1;
- }
- command(admins, playerid, params[])
- {
- #pragma unused params
- new string[128];
- SendClientMessage(playerid, WHITE, "---------------------------------------------------------------------------------------------------------------------------------");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i))
- {
- if(AdminDuty[i] == 1)
- {
- if(Afk[i] == 0)
- {
- format(string, sizeof(string), "Administrator %s (Level %d): On Admin Duty (/assitance available).", GetName(i), PlayerInfo[i][pAdminLevel]);
- SendClientMessage(playerid, GREEN, string);
- }
- }
- if(AdminDuty[i] == 1)
- {
- if(Afk[i] == 1)
- {
- format(string, sizeof(string), "Administrator %s (Level %d): On Admin Duty & AFK.", GetName(i), PlayerInfo[i][pAdminLevel]);
- SendClientMessage(playerid, GREEN, string);
- }
- }
- if(AdminDuty[i] == 0)
- {
- format(string, sizeof(string), "Administrator %s (Level %d): Roleplaying.", GetName(i), PlayerInfo[i][pAdminLevel]);
- SendClientMessage(playerid, GREEN, string);
- }
- }
- }
- SendClientMessage(playerid, WHITE, "---------------------------------------------------------------------------------------------------------------------------------");
- return 1;
- }
- command(heal, playerid, params[])
- {
- new id, string[128];
- if(sscanf(params, "u", id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /heal [playerid]");
- }
- else
- {
- if(IsPlayerConnected(id))
- {
- if(GetDistanceBetweenPlayers(playerid, id) < 2)
- {
- if(PlayerInfo[playerid][Group] == 2)
- {
- PlayerInfo[id][PendingHeal] = playerid;
- format(string, sizeof(string), "You have requested to Heal %s.", GetName(id));
- SendClientMessage(playerid, WHITE, string);
- format(string, sizeof(string), "%s is requesting to Heal you... Type /approve heal to accept it!", GetName(playerid));
- SendClientMessage(id, NICESKY, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not a member of the Fire Department!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You must be closer to the player to perform this action!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player is not connected!");
- }
- }
- return 1;
- }
- command(buyclothes, playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 207.6361,-100.8324,1005.2578))
- {
- if(InClothesShop[playerid] == 1)
- {
- ShowPlayerDialog(playerid, 300, DIALOG_STYLE_INPUT, "Change Skin", "Enter a skin ID below to get started", "Confirm", "Cancel");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in the clothes shop!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You must be in the clothes shop at the register to purchase clothes!");
- }
- return 1;
- }
- command(shout, playerid, params[])
- {
- new message[128], string[128];
- if(sscanf(params, "z", message))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /(s)hout [message]");
- }
- else
- {
- format(string, sizeof(string), "%s shouts: %s!", GetName(playerid), message);
- NearByMessageEx(playerid, WHITE, string, 30.0);
- }
- return 1;
- }
- command(aduty, playerid, params[])
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if(AdminDuty[playerid] == 0)
- {
- AdminDuty[playerid] = 1;
- SetPlayerHealth(playerid, 50000);
- SetPlayerArmour(playerid, 50000);
- SetPlayerColor(playerid, ADMINORANGE);
- }
- else
- {
- AdminDuty[playerid] = 0;
- SetPlayerHealth(playerid, 100);
- SetPlayerArmour(playerid, 100);
- SetPlayerColor(playerid, WHITE);
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not an Administrator!");
- }
- return 1;
- }
- command(s, playerid, params[])
- {
- return cmd_shout(playerid, params);
- }
- command(do, playerid, params[])
- {
- new Message[128], string[128];
- if(sscanf(params, "z", Message))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /do [action]");
- }
- else
- {
- if(strlen(Message) < 1 || !IsPlayerConnected(playerid))
- {
- return 1;
- }
- else
- {
- format(string, sizeof(string), "* %s ((%s)) ", Message, GetName(playerid));
- NearByMessage(playerid, NICESKY, string);
- }
- }
- return 1;
- }
- command(get, playerid, params[])
- {
- new id, string[128], Float: ToX, Float: ToY, Float: ToZ;
- if(sscanf(params, "u", id))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, LOGIN, "USAGE: /get [playerid]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if(IsPlayerConnected(id))
- {
- GetPlayerPos(playerid, ToX, ToY, ToZ);
- SetPlayerInterior(id, GetPlayerInterior(playerid));
- SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
- SetPlayerPos(id, ToX, ToY+2, ToZ);
- format(string, sizeof(string), "%s has teleported you over to him / her.", GetName(playerid));
- SendClientMessage(id, LOGIN, string);
- format(string, sizeof(string), "You have teleported %s to you.", GetName(id));
- SendClientMessage(playerid, LOGIN, string);
- }
- else
- {
- SendClientMessage(playerid, LOGIN, "That player is not connected or isn't logged in.");
- }
- }
- }
- return 1;
- }
- command(goto, playerid, params[])
- {
- new id, string[128], Float: ToX, Float: ToY, Float: ToZ;
- if(sscanf(params, "u", id))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, LOGIN, "USAGE: /goto [playerid]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if(IsPlayerConnected(id))
- {
- GetPlayerPos(id, ToX, ToY, ToZ);
- SetPlayerPosEx(playerid, ToX, ToY, ToZ, GetPlayerInterior(id), GetPlayerVirtualWorld(id));
- format(string, sizeof(string), "You have teleported to %s.", GetName(id));
- SendClientMessage(playerid, LOGIN, string);
- }
- else
- {
- SendClientMessage(playerid, LOGIN, "That player is not connected or isn't logged in.");
- }
- }
- }
- return 1;
- }
- command(kill, playerid, params[])
- {
- new id, string[128];
- if(sscanf(params, "uz", id))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, LOGIN, "USAGE: /kill [playerid]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pAdminLevel] > PlayerInfo[id][pAdminLevel])
- {
- format(string, sizeof(string), "[Kill] Admin %s has killed %s (/kill).", GetName(playerid), GetName(id));
- SetPlayerHealth(id, 0);
- SendClientMessageToAll(ADMINORANGE, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are unable to kill that player!");
- }
- }
- else
- {
- SendClientMessage(playerid, LOGIN, "That player is not connected!");
- }
- }
- else
- {
- SendClientMessage(playerid, LOGIN, "You are not an admin!");
- }
- }
- return 1;
- }
- command(ragequit, playerid, params[])
- {
- new reason[128], string[128];
- if(sscanf(params, "uz", reason))
- {
- SendClientMessage(playerid, LOGIN, "USAGE: /ragequit(/rq) [reason]");
- }
- else
- {
- format(string, sizeof(string), "RAGEQUIT!: %s has ragequit! (Reason: %s)", GetName(playerid));
- SendClientMessageToAll(COLOR_RED, string);
- Kick(playerid);
- }
- return 1;
- }
- command(rq, playerid, params[])
- {
- new reason[128], string[128];
- if(sscanf(params, "uz", reason))
- {
- SendClientMessage(playerid, LOGIN, "USAGE: /rq(/ragequit) [reason]");
- }
- else
- {
- format(string, sizeof(string), "RAGEQUIT!: %s has ragequit! (Reason: %s)", GetName(playerid));
- SendClientMessageToAll(COLOR_RED, string);
- Kick(playerid);
- }
- return 1;
- }
- command(pm, playerid, params[])
- {
- new string[128], message[128], id;
- if(sscanf(params, "uz", id, message))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /pm [playerid] [message]");
- }
- else
- {
- if(IsPlayerConnected(id))
- {
- if(strlen(message) >= 1)
- {
- format(string, sizeof(string), "((You have sent %s: %s)) ", GetName(id), message);
- SendClientMessage(playerid, PLAYERCOM, string);
- format(string, sizeof(string), "((PM from %s (ID: %d): %s)) ", GetName(playerid), playerid, message);
- SendClientMessage(id, PLAYERCOM, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /pm [playerid] [message]");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
- }
- }
- return 1;
- }
- command(me, playerid, params[])
- {
- new string[128];
- if(isnull(params))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /me [action]");
- }
- else
- {
- format(string, sizeof(string), "* %s %s", GetName(playerid), params);
- NearByMessage(playerid, NICESKY, string);
- }
- return 1;
- }
- command(vehname, playerid, params[])
- {
- new value[128], results, strings[128];
- if(sscanf(params, "z", value))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /vehname [name]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
- for(new i; i < sizeof(VehicleNames); i++)
- {
- if(strfind(VehicleNames[i], value, true) != -1)
- {
- if(results == 0)
- {
- format(strings, sizeof(strings), "%s", VehicleNames[i]);
- }
- else
- {
- format(strings, sizeof(strings), "%s, %s", strings, VehicleNames[i]);
- }
- results++;
- if(strlen(strings) > 118)
- {
- SendClientMessage(playerid, WHITE, "Too many results found! Please search more specified!");
- SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
- return 1;
- }
- }
- }
- if(results == 0)
- {
- SendClientMessage(playerid, WHITE, "Sorry, no vehicles found.");
- SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Results:");
- SendClientMessage(playerid, WHITE, strings);
- SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
- }
- }
- }
- return 1;
- }
- command(despawncar, playerid, params[])
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 3)
- {
- new string[128];
- for(new i = 0; i < SpawnedVehicles; i++)
- {
- if(AdminSpawned[i] == GetPlayerVehicleID(playerid))
- {
- AdminSpawned[i] = 0;
- }
- }
- SendClientMessage(playerid, WHITE, "Vehicle de-spawned.");
- DestroyVehicle(GetPlayerVehicleID(playerid));
- format(string, sizeof(string), "%s has de-spawned a vehicle.", GetName(playerid));
- }
- return 1;
- }
- command(respawncar, playerid, params[])
- {
- #pragma unused params
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- SetVehicleToRespawn(GetPlayerVehicleID(playerid));
- }
- }
- return 1;
- }
- command(spawncar, playerid, params[])
- {
- new carid, string[128], Float: CarToX, Float: CarToY, Float: CarToZ, physical_car_id;
- if(sscanf(params, "d", carid))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /spawncar [vehicleid]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 3)
- {
- if(CarCount < MAX_VEHICLES)
- {
- if(carid < 400 || carid > 611)
- {
- SendClientMessage(playerid, WHITE, "Valid car IDs start from 400, ending at 611.");
- return 1;
- }
- GetPlayerPos(playerid, CarToX, CarToY, CarToZ);
- physical_car_id = CreateVehicle(carid, CarToX, CarToY+4, CarToZ, 90, -1, -1, -1);
- format(string, sizeof(string), "You have spawned model ID %d.", carid);
- SendClientMessage(playerid, WHITE, string);
- AdminSpawned[SpawnedVehicles] = physical_car_id;
- SpawnedVehicles++;
- PutPlayerInVehicle(playerid, physical_car_id, 0);
- LinkVehicleToInterior(physical_car_id, GetPlayerInterior(playerid));
- SetVehicleVirtualWorld(physical_car_id, GetPlayerVirtualWorld(playerid));
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Despawn the current spawned vehicles before spawning any more (or attempting to do so).");
- }
- }
- }
- return 1;
- }
- command(specoff, playerid, params[])
- {
- #pragma unused params
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- new string[128];
- Spectator[playerid][SpecSpectatingPlayer] = -1;
- TogglePlayerSpectating(playerid, false);
- SetCameraBehindPlayer(playerid);
- SetPlayerInterior(playerid, Spectator[playerid][SpecPlayerInterior]);
- SetPlayerFacingAngle(playerid, Spectator[playerid][SpecPlayerAngle]);
- SetPlayerVirtualWorld(playerid, Spectator[playerid][SpecPlayerWorld]);
- SetPlayerPos(playerid, Spectator[playerid][SpecPlayerX], Spectator[playerid][SpecPlayerY], Spectator[playerid][SpecPlayerZ]);
- SendClientMessage(playerid, WHITE, "You've finished your session of spectating.");
- format(string, sizeof(string), "%s has finished spectating.", GetName(playerid));
- }
- return 1;
- }
- command(spec, playerid, params[])
- {
- new id, string[128], Float: health, Float: armour, healthf, armourf;
- if(sscanf(params, "u", id))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /spec [playerid] (type /specoff to finish spectating)");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if(IsPlayerConnected(id))
- {
- if(Spectator[playerid][SpecSpectatingPlayer] == -1)
- {
- GetPlayerPos(playerid, Spectator[playerid][SpecPlayerX], Spectator[playerid][SpecPlayerY], Spectator[playerid][SpecPlayerZ]);
- GetPlayerFacingAngle(playerid, Spectator[playerid][SpecPlayerAngle]);
- Spectator[playerid][SpecPlayerWorld] = GetPlayerVirtualWorld(playerid);
- Spectator[playerid][SpecPlayerInterior] = GetPlayerInterior(playerid);
- }
- format(string, sizeof(string), "You are now spectating Player %s.", GetName(id));
- SendClientMessage(playerid, GREY, string);
- GetPlayerHealth(id, health);
- GetPlayerArmour(id, armour);
- healthf = floatround(health, floatround_ceil);
- armourf = floatround(armour, floatround_ceil);
- SetPlayerInterior(playerid, GetPlayerInterior(id));
- SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
- format(string, sizeof(string), "Health: %d | Armour: %d | Money: %d", healthf, armourf, PlayerInfo[id][pCash]);
- SendClientMessage(playerid, WHITE, string);
- Spectator[playerid][SpecSpectatingPlayer] = id;
- TogglePlayerSpectating(playerid, true);
- if(IsPlayerInAnyVehicle(id))
- {
- PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
- Spectator[playerid][SpecSpectatingState] = 1;
- }
- else
- {
- PlayerSpectatePlayer(playerid, id);
- Spectator[playerid][SpecSpectatingState] = 2;
- }
- Spectator[playerid][SpecSpectatingPlayer] = id;
- SpectatorRefresh(playerid, id);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
- }
- }
- }
- return 1;
- }
- command(bar, playerid, params[])
- {
- new id;
- if(sscanf(params, "d", id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /bar [1-12]");
- }
- else
- {
- switch(id)
- {
- case 1:
- {
- ApplyAnimation(playerid, "BAR", "Barcustom_get", 3.1, 0, 1, 1, 1, 1);
- }
- case 2:
- {
- ApplyAnimation(playerid, "BAR", "Barcustom_loop", 3.1, 1, 1, 1, 1, 1);
- }
- case 3:
- {
- ApplyAnimation(playerid, "BAR", "Barcustom_order", 3.1, 0, 1, 1, 1, 1);
- }
- case 4:
- {
- ApplyAnimation(playerid, "BAR", "BARman_idle", 3.1, 0, 1, 1, 1, 1);
- }
- case 5:
- {
- ApplyAnimation(playerid, "BAR", "Barserve_bottle", 3.1, 0, 1, 1, 1, 1);
- }
- case 6:
- {
- ApplyAnimation(playerid, "BAR", "Barserve_give", 3.1, 0, 1, 1, 1, 1);
- }
- case 7:
- {
- ApplyAnimation(playerid, "BAR", "Barserve_glass", 3.1, 0, 1, 1, 1, 1);
- }
- case 8:
- {
- ApplyAnimation(playerid, "BAR", "Barserve_in", 3.1, 0, 1, 1, 1, 1);
- }
- case 9:
- {
- ApplyAnimation(playerid, "BAR", "Barserve_loop", 3.1, 1, 1, 1, 1, 1);
- }
- case 10:
- {
- ApplyAnimation(playerid, "BAR", "Barserve_order", 3.1, 0, 1, 1, 1, 1);
- }
- case 11:
- {
- ApplyAnimation(playerid, "BAR", "dnk_stndF_loop", 3.1, 1, 1, 1, 1, 1);
- }
- case 12:
- {
- ApplyAnimation(playerid, "BAR", "dnk_stndM_loop", 3.1, 1, 1, 1, 1, 1);
- }
- }
- }
- return 1;
- }
- command(hide, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "ped", "cower", 4.1, 0, 1, 1, 0, 0);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(handsup, playerid, params[])
- {
- #pragma unused params
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_HANDSUP);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(rap, playerid, params[])
- {
- new id;
- if(sscanf(params, "d", id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /rap [style: 1/2/3/4]");
- }
- else
- {
- switch(id)
- {
- case 1:
- {
- ApplyAnimation(playerid, "RAPPING", "RAP_A_Loop", 3.1, 1, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 2:
- {
- ApplyAnimation(playerid, "RAPPING", "RAP_C_Loop", 3.1, 1, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 3:
- {
- ApplyAnimation(playerid, "GANGS", "prtial_gngtlkD", 3.1, 1, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 4:
- {
- ApplyAnimation(playerid, "GANGS", "prtial_gngtlkH", 3.1, 1, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- }
- default: SendClientMessage(playerid, WHITE, "SYNTAX: /rap [style: 1/2/3/4]");
- }
- }
- return 1;
- }
- command(reload, playerid, params[])
- {
- new id;
- if(sscanf(params, "d", id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /reload [1/2]");
- }
- else
- {
- switch(id)
- {
- case 1:
- {
- ApplyAnimation(playerid, "COLT45", "colt45_reload", 4.0, 0, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 2:
- {
- ApplyAnimation(playerid, "UZI", "UZI_reload", 4.0, 0, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- }
- }
- }
- return 1;
- }
- command(laugh, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 1, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(dance, playerid, params[])
- {
- new id;
- if(sscanf(params, "d", id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /dance [style: 1/2/3/4]");
- }
- else
- {
- switch(id)
- {
- case 1:
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE1);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 2:
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE2);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 3:
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE3);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 4:
- {
- SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE4);
- PlayerInfo[playerid][Animation] = 1;
- }
- default: SendClientMessage(playerid, WHITE, "SYNTAX: /dance [style: 1/2/3/4]");
- }
- }
- return 1;
- }
- command(sit, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "PED", "SEAT_down", 3.1, 0, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(gsit, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "BEACH", "ParkSit_M_loop", 3.1, 0, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(ko, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "PED", "FLOOR_hit_f", 3.1, 0, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(wave, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "ON_LOOKERS", "wave_loop", 3.1, 1, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(spank, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "SWEET", "sweet_ass_slap", 3.1, 0, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(fuckoff, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "PED", "fucku", 3.1, 0, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(chat, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "PED", "IDLE_CHAT", 3.1, 1, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(deal, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 3.1, 1, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(vomit, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.1, 0, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(bomb, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 3.1, 0, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(crack, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(piss, playerid, params[])
- {
- #pragma unused params
- SetPlayerSpecialAction(playerid, 68);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(masturbate, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "PAULNMAC", "wank_loop", 4.1, 1, 1, 1, 1, 1);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(crossarms, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "COP_AMBIENT", "Coplook_loop", 1, 1, 0, 0, 0, 0);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(robman, playerid, params[])
- {
- #pragma unused params
- ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.1, 0, 1, 1, 0, 0);
- PlayerInfo[playerid][Animation] = 1;
- return 1;
- }
- command(pedmove, playerid, params[])
- {
- new id;
- if(sscanf(params, "d", id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /pedmove [(1-10)]");
- SendClientMessage(playerid, WHITE, "USAGES: 1 - Sexy Walk, 2 - Old Woman Walk, 3 - Normal Woman Walk, 4 - Woman Run (Old)");
- SendClientMessage(playerid, WHITE, "USAGES: 5 - Woman Run - Panic, 6 - Drunk, 7 - Fat Walk, 8 - Old Fat Walk, 9/10 - Gang Walk");
- }
- else
- {
- switch(id)
- {
- case 1:
- {
- ApplyAnimation(playerid, "PED", "WOMAN_walksexy", 4.1, 1, 1, 1, 0, 0);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 2:
- {
- ApplyAnimation(playerid, "PED", "WOMAN_walkold", 4.1,1,1,1,0,0);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 3:
- {
- ApplyAnimation(playerid, "PED", "WOMAN_walknorm", 4.1,1,1,1,0,0);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 4:
- {
- ApplyAnimation(playerid, "PED", "WOMAN_runfatold", 4.1,1,1,1,0,0);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 5:
- {
- ApplyAnimation(playerid, "PED", "woman_runpanic", 4.1,1,1,1,0,0);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 6:
- {
- ApplyAnimation(playerid, "PED", "WALK_drunk", 4.1,1,1,1,0,0);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 7:
- {
- ApplyAnimation(playerid, "PED", "WALK_fat", 4.1,1,1,1,0,0);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 8:
- {
- ApplyAnimation(playerid, "PED", "WALK_fatold", 4.1,1,1,1,0,0);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 9:
- {
- ApplyAnimation(playerid, "PED", "WALK_csaw", 4.1,1,1,1,0,0);
- PlayerInfo[playerid][Animation] = 1;
- }
- case 10:
- {
- ApplyAnimation(playerid, "PED", "WALK_gang2", 4.1,1,1,1,0,0);
- PlayerInfo[playerid][Animation] = 1;
- }
- default:
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /pedmove [id (1-10)]");
- SendClientMessage(playerid, WHITE, "USAGES: 1 - Sexy Walk, 2 - Old Woman Walk, 3 - Normal Woman Walk, 4 - Woman Run (Old)");
- SendClientMessage(playerid, WHITE, "USAGES: 5 - Woman Run - Panic, 6 - Drunk, 7 - Fat Walk, 8 - Old Fat Walk, 9/10 - Gang Walk");
- }
- }
- }
- return 1;
- }
- command(approve, playerid, params[])
- {
- new Usage[128];
- if(sscanf(params, "z", Usage))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /approve [usage]");
- SendClientMessage(playerid, GREY, "Usages: Handshake, Heal, Groupinvite");
- }
- else
- {
- if(strcmp(Usage, "Groupinvite", true) == 0)
- {
- if(PlayerInfo[playerid][PendingGroupInvite] != -1)
- {
- if(GetDistanceBetweenPlayers(playerid, PlayerInfo[playerid][PendingGroupInvite]) < 3)
- {
- PlayerInfo[playerid][PendingGroupInvite] = -1;
- PlayerInfo[playerid][Group] = PlayerInfo[playerid][PendingGroup];
- SendClientMessage(playerid, WHITE, "Group Invite Approved!");
- SendClientMessage(playerid, WHITE, "You have accepted the Group Invite! You are now in a faction!");
- }
- }
- }
- if(strcmp(Usage, "Heal", true) == 0)
- {
- if(PlayerInfo[playerid][PendingHeal] != -1)
- {
- if(GetDistanceBetweenPlayers(playerid, PlayerInfo[playerid][PendingHeal]) < 3)
- {
- PlayerInfo[playerid][PendingHeal] = -1;
- SendClientMessage(playerid, WHITE, "Heal approved.");
- SetPlayerHealth(playerid, 100);
- SetPlayerHealth(playerid, 100);
- SendClientMessage(playerid, WHITE, "You have been healed!");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You must be closer to that player to perform this action!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have a pending heal request!");
- }
- }
- else if(strcmp(Usage, "Handshake", true) == 0)
- {
- if(PlayerInfo[playerid][PendingHandshake] != -1)
- {
- if(GetDistanceBetweenPlayers(playerid, PlayerInfo[playerid][PendingHandshake]) < 3)
- {
- switch(PlayerInfo[playerid][PendingHandshakeStyle])
- {
- case 1:
- {
- PlayerInfo[playerid][PendingHandshake] = -1;
- PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
- ApplyAnimation(playerid, "GANGS", "hndshkaa", 4.0, 1, 1, 1, 0, 1000);
- ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkaa", 4.0, 1, 1, 1, 0, 1000);
- SendClientMessage(playerid, WHITE, "Handshake approved.");
- }
- case 2:
- {
- PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
- ApplyAnimation(playerid, "GANGS", "hndshkba", 4.0, 1, 1, 1, 0, 1000);
- ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkba", 4.0, 1, 1, 1, 0, 1000);
- SendClientMessage(playerid, WHITE, "Handshake approved.");
- PlayerInfo[playerid][PendingHandshake] = -1;
- }
- case 3:
- {
- PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
- ApplyAnimation(playerid, "GANGS", "hndshkca", 4.0, 1, 1, 1, 0, 1000);
- ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkca", 4.0, 1, 1, 1, 0, 1000);
- SendClientMessage(playerid, WHITE, "Handshake approved.");
- PlayerInfo[playerid][PendingHandshake] = -1;
- }
- case 4:
- {
- PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
- ApplyAnimation(playerid, "GANGS", "hndshkcb", 4.0, 1, 1, 1, 0, 1000);
- ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkcb", 4.0, 1, 1, 1, 0, 1000);
- SendClientMessage(playerid, WHITE, "Handshake approved.");
- PlayerInfo[playerid][PendingHandshake] = -1;
- }
- case 5:
- {
- PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
- ApplyAnimation(playerid, "GANGS", "hndshkda", 4.0, 1, 1, 1, 0, 1000);
- ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkda", 4.0, 1, 1, 1, 0, 1000);
- SendClientMessage(playerid, WHITE, "Handshake approved.");
- PlayerInfo[playerid][PendingHandshake] = -1;
- }
- case 6:
- {
- PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
- ApplyAnimation(playerid, "GANGS", "hndshkea", 4.0, 1, 1, 1, 0, 1000);
- ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkea", 4.0, 1, 1, 1, 0, 1000);
- SendClientMessage(playerid, WHITE, "Handshake approved.");
- PlayerInfo[playerid][PendingHandshake] = -1;
- }
- case 7:
- {
- PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
- ApplyAnimation(playerid, "GANGS", "hndshkfa", 4.0, 1, 1, 1, 0, 1000);
- ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkfa", 4.0, 1, 1, 1, 0, 1000);
- SendClientMessage(playerid, WHITE, "Handshake approved.");
- PlayerInfo[playerid][PendingHandshake] = -1;
- }
- case 8:
- {
- PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
- ApplyAnimation(playerid, "GANGS", "hndshkfa_swt", 4.0, 1, 1, 1, 0, 1000);
- ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkfa_swt", 4.0, 1, 1, 1, 0, 1000);
- SendClientMessage(playerid, WHITE, "Handshake approved.");
- PlayerInfo[playerid][PendingHandshake] = -1;
- }
- case 9:
- {
- PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
- ApplyAnimation(playerid, "GANGS", "prtial_hndshk_01", 4.0, 1, 1, 1, 0, 1000);
- ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "prtial_hndshk_01", 4.0, 1, 1, 1, 0, 1000);
- SendClientMessage(playerid, WHITE, "Handshake approved.");
- PlayerInfo[playerid][PendingHandshake] = -1;
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You're too far away.");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You don't have a pending handshake request.");
- }
- }
- }
- return 1;
- }
- command(attempt, playerid, params[])
- {
- new Message[128], string[128];
- if(sscanf(params, "z", Message))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /attempt [action]");
- }
- else
- {
- if(strlen(Message) < 1)
- {
- return 1;
- }
- if(random(10) < 6)
- {
- format(string, sizeof(string), "[ATTEMPT] * %s has attempted to %s, and succeeded.", GetName(playerid), Message);
- NearByMessage(playerid, ME, string);
- }
- else
- {
- format(string, sizeof(string), "[ATTEMPT] * %s has attempted to %s, but failed.", GetName(playerid), Message);
- NearByMessage(playerid, ME, string);
- }
- }
- return 1;
- }
- command(stopanim, playerid, params[])
- {
- #pragma unused params
- PlayerInfo[playerid][Animation] = 0;
- ClearAnimations(playerid);
- StopLoopingAnimation(playerid);
- TogglePlayerControllable(playerid, true);
- SendClientMessage(playerid, WHITE, "You have cleared all animations.");
- return 1;
- }
- command(shakehand, playerid, params[])
- {
- new style, id, string[128];
- if(sscanf(params, "ud", id, style))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /shakehand [playerid] [1-9]");
- }
- else
- {
- if(IsPlayerConnected(id))
- {
- if(GetDistanceBetweenPlayers(playerid, id) < 2)
- {
- if(style >= 1 && style < 10)
- {
- PlayerInfo[id][PendingHandshakeStyle] = style;
- PlayerInfo[id][PendingHandshake] = playerid;
- format(string, sizeof(string), "You have requested to shake %s's hand.", GetName(id));
- SendClientMessage(playerid, WHITE, string);
- format(string, sizeof(string), "%s is requesting to shake your hand... Type /approve handshake to shake hands!", GetName(playerid));
- SendClientMessage(id, NICESKY, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /handshake [playerid] [1-9]");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Please stand closer to them.");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player is not connected or is not logged in.");
- }
- }
- return 1;
- }
- command(gunname, playerid, params[])
- {
- new value[128], results, strings[128];
- if(sscanf(params, "z", value))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /gunname [name/weaponid]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
- for(new i; i < sizeof(WeaponNames); i++)
- {
- if(strfind(WeaponNames[i], value, true) != -1)
- {
- if(results == 0)
- {
- format(strings, sizeof(strings), "%s", WeaponNames[i]);
- }
- else
- {
- format(strings, sizeof(strings), "%s, %s", strings, WeaponNames[i]);
- }
- results++;
- if(strlen(strings) > 118)
- {
- SendClientMessage(playerid, WHITE, "Too many results found! Please search more specified!");
- SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
- return 1;
- }
- }
- }
- if(results == 0)
- {
- SendClientMessage(playerid, WHITE, "Sorry, no weapons found.");
- SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Results:");
- SendClientMessage(playerid, WHITE, strings);
- SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
- }
- }
- }
- return 1;
- }
- command(stopdrag, playerid, params[])
- {
- #pragma unused params
- new string[73];
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(IsPlayerConnected(i) && PlayerInfo[i][BeingDraggedBy] == playerid)
- {
- format(string, sizeof(string), "* %s has stopped dragging %s.", GetName(playerid), GetName(i));
- NearByMessage(playerid, ME, string);
- PlayerInfo[i][BeingDraggedBy] = -1;
- }
- }
- return 1;
- }
- command(drag, playerid, params[])
- {
- new id, string[128];
- if(sscanf(params, "u", id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /drag [playerid]");
- }
- else
- {
- if(GetDistanceBetweenPlayers(playerid, id) < 7)
- {
- PlayerInfo[id][BeingDraggedBy] = playerid;
- format(string, sizeof(string), "You have started to drag %s.", GetName(id));
- SendClientMessage(playerid, WHITE, string);
- format(string, sizeof(string), "* %s grabs ahold of %s and starts dragging them.", GetName(playerid), GetName(id));
- NearByMessage(playerid, ME, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You're too far away!");
- }
- }
- return 1;
- }
- command(announce, playerid, params[])
- {
- new Announcement[128], string[128];
- if(sscanf(params, "z", Announcement))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /announce [message]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if(strlen(Announcement) >= 1)
- {
- format(string, sizeof(string), "((Announcement from Server Admin %s: %s)) ", GetName(playerid), Announcement);
- SendClientMessageToAll(LIGHTRED, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /announce [message]");
- }
- }
- }
- return 1;
- }
- command(getid, playerid, params[])
- {
- new string[128], id;
- if(sscanf(params, "u", id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /getid [playerid/name]");
- }
- else
- {
- if(IsPlayerConnected(id))
- {
- format(string, sizeof(string), "The ID that matches %s is %d.", GetName(id), id);
- SendClientMessage(playerid, WHITE, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player is not connected or is not logged in.");
- }
- }
- return 1;
- }
- command(explode, playerid, params[])
- {
- new userid, string[128];
- if(sscanf(params, "u", userid))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /explode [playerid]");
- }
- }
- else
- {
- if(IsPlayerConnected(userid))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- if(userid == INVALID_PLAYER_ID)
- {
- SendClientMessage(playerid, WHITE, "Invalid ID.");
- return 1;
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= PlayerInfo[userid][pAdminLevel])
- {
- new Float:px, Float:py, Float:pz;
- GetPlayerPos(userid, px, py, pz);
- SetPlayerHealth(userid, 50);
- CreateExplosion(px+10, py, pz, 7, 100.0);
- CreateExplosion(px, py+10, pz, 7, 100.0);
- CreateExplosion(px-10, py, pz, 7, 100.0);
- CreateExplosion(px, py-10, pz, 7, 100.0);
- CreateExplosion(px, py, pz, 7, 100.0);
- format(string, sizeof(string), "You have exploded %s.", GetName(userid));
- SendClientMessage(playerid, WHITE, string);
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player is not connected or is logged in.");
- }
- }
- return 1;
- }
- command(slap, playerid, params[])
- {
- new string[128], id, Float: pX, Float: pY, Float: pZ, MathsFlaw, Float: Mathematical;
- if(sscanf(params, "u", id))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /slap [playerid]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if(IsPlayerConnected(id))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= PlayerInfo[id][pAdminLevel])
- {
- GetPlayerPos(id, pX, pY, pZ);
- SetPlayerPos(id, pX, pY, pZ+5);
- GetPlayerHealth(id, Mathematical);
- MathsFlaw = floatround(Mathematical, floatround_ceil);
- SetPlayerHealth(id, MathsFlaw-5);
- format(string, sizeof(string), "You have slapped %s.", GetName(id));
- SendClientMessage(playerid, WHITE, string);
- format(string, sizeof(string), "%s has been slapped.", GetName(id));
- NearByMessage(id, ME, string);
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
- }
- }
- }
- return 1;
- }
- command(setweather, playerid, params[])
- {
- new weatherid;
- if(sscanf(params, "d", weatherid))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- SendClientMessage(playerid, WHITE, "USAGE: /setweather [weatherid]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- if(weatherid >= 1 && weatherid < 46)
- {
- SetWeather(weatherid);
- GlobalWeather = weatherid;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Invalid weather ID - must be between 1 and 45.");
- }
- }
- }
- return 1;
- }
- command(ban, playerid, params[])
- {
- new id, reason[35], name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[128];
- if(!(PlayerInfo[playerid][pAdminLevel] >= 2)) return SendClientMessage(playerid, COLOR_RED,NOTADMIN);
- if(sscanf(params,"uz", id, reason)) return SendClientMessage(playerid, COLOR_WHITE,"Syntax: /ban [playerid/partofname] [Reason]");
- if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY,"Invalid player id");
- else
- {
- if(PlayerInfo[id][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid,COLOR_GREY,"You can't ban him/her.");
- return 1;
- }
- GetPlayerName(playerid, name1, sizeof(name1));
- GetPlayerName(id, name2, sizeof(name2));
- format(string, sizeof(string), "%s got banned. Reason: %s", name2, reason);
- SendClientMessageToAll(COLOR_RED, string);
- new plrIP[16];
- GetPlayerIp(id,plrIP, sizeof(plrIP));
- SendClientMessage(id,COLOR_YELLOW,"|___________[BAN INFO]___________|");
- format(string, sizeof(string), "Your name: %s.",name2);
- SendClientMessage(id, COLOR_WHITE, string);
- format(string, sizeof(string), "Your IP: %s.",plrIP);
- SendClientMessage(id, COLOR_WHITE, string);
- format(string, sizeof(string), "Who banned you: %s.",name1);
- SendClientMessage(id, COLOR_WHITE, string);
- format(string, sizeof(string), "Reason: %s.",reason);
- SendClientMessage(id, COLOR_WHITE, string);
- SendClientMessage(id,COLOR_YELLOW,"|___________[BAN INFO]___________|");
- Ban(id);
- }
- return 1;
- }
- command(freeze, playerid, params[])
- {
- new id, string[128];
- if(sscanf(params, "u", id))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 2)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /freeze [playerid]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 2)
- {
- if(IsPlayerConnected(id))
- {
- TogglePlayerControllable(id, false);
- format(string, sizeof(string), "You have frozen player %s.", GetName(id));
- SendClientMessage(playerid, WHITE, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
- }
- }
- }
- return 1;
- }
- command(unfreeze, playerid, params[])
- {
- new id, string[128];
- if(sscanf(params, "u", id))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /unfreeze [playerid]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 2)
- {
- if(IsPlayerConnected(id))
- {
- TogglePlayerControllable(id, true);
- format(string, sizeof(string), "You have un-frozen player %s.", GetName(id));
- SendClientMessage(playerid, WHITE, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
- }
- }
- }
- return 1;
- }
- command(kick, playerid, params[])
- {
- new id, reason[128], string[128];
- if(sscanf(params, "us", id, reason))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /kick [playerid] [reason]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if(IsPlayerConnected(id))
- {
- if(PlayerInfo[id][pAdminLevel] > PlayerInfo[playerid][pAdminLevel])
- {
- SendClientMessage(playerid, WHITE, "You do not have the authority to do that (higher rank).");
- return 1;
- }
- format(string, sizeof(string), "Kick: %s has been kicked by %s, reason: %s", GetName(id), GetName(playerid), reason);
- SendClientMessageToAll(LIGHTRED, string);
- format(string, sizeof(string), "You have been kicked from the server for %s", reason);
- SendClientMessage(id, WHITE, string);
- Kick(id);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player is not connected.");
- return 1;
- }
- }
- }
- return 1;
- }
- command(eon, playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(Engine[vehicleid] == 0)
- {
- Engine[vehicleid] = 1;
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
- new string[128];
- format(string, sizeof(string), "* %s has turned their vehicles engine on.", GetName(playerid));
- NearByMessage(playerid, PINK, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Your vehicles engine must be off to use this command!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
- }
- return 1;
- }
- command(eoff, playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(Engine[vehicleid] == 1)
- {
- Engine[vehicleid] = 0;
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
- new string[128];
- format(string, sizeof(string), "* %s has turned their vehicles engine off.", GetName(playerid));
- NearByMessage(playerid, PINK, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You vehicles engine must be turned on to use this command!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
- }
- return 1;
- }
- command(lon, playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(Lights[vehicleid] == 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- Lights[vehicleid] = 1;
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vehicleid,engine,1,alarm,doors,bonnet,boot,objective);
- new string[128];
- format(string, sizeof(string), "* %s has turned their vehicles lights on.", GetName(playerid));
- NearByMessage(playerid, PINK, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Your vehicle's lights must me off to use this command!");
- }
- return 1;
- }
- command(loff, playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(Lights[vehicleid] == 1)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- Lights[vehicleid] = 0;
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vehicleid,engine,0,alarm,doors,bonnet,boot,objective);
- new string[128];
- format(string, sizeof(string), "* %s has turned their vehicles lights off.", GetName(playerid));
- NearByMessage(playerid, PINK, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Your vehicle's lights must me on to use this command!");
- }
- return 1;
- }
- command(opentrunk, playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(Trunk[vehicleid] == 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- Trunk[vehicleid] = 1;
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,1,objective);
- new string[128];
- format(string, sizeof(string), "* %s has opened their vehicles trunk.", GetName(playerid));
- NearByMessage(playerid, PINK, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Your vehicle's trunk must me closed to use this command!");
- }
- return 1;
- }
- command(closetrunk, playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(Trunk[vehicleid] == 1)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- Trunk[vehicleid] = 0;
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,0,objective);
- new string[128];
- format(string, sizeof(string), "* %s has closed their vehicles trunk.", GetName(playerid));
- NearByMessage(playerid, PINK, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Your vehicle's trunk must me open to use this command!");
- }
- return 1;
- }
- command(openhood, playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(Hood[vehicleid] == 0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- Hood[vehicleid] = 1;
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,1,boot,objective);
- new string[128];
- format(string, sizeof(string), "* %s has opened their vehicles hood.", GetName(playerid));
- NearByMessage(playerid, PINK, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Your vehicle's hood must me closed to use this command!");
- }
- return 1;
- }
- command(closehood, playerid, params[])
- {
- new vehicleid = GetPlayerVehicleID(playerid);
- if(Hood[vehicleid] == 1)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- Hood[vehicleid] = 0;
- new engine,lights,alarm,doors,bonnet,boot,objective;
- GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
- SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,boot,objective);
- new string[128];
- format(string, sizeof(string), "* %s has closed their vehicles hood.", GetName(playerid));
- NearByMessage(playerid, PINK, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Your vehicle's hood must me open to use this command!");
- }
- return 1;
- }
- command(stats, playerid, params[])
- {
- new calculation = PlayerInfo[playerid][Seconds]/60;
- new namestring[380];
- format(namestring, sizeof(namestring), "________________________________|%s's Stats|________________________________", GetName(playerid));
- SendClientMessage(playerid, WHITE, namestring);
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- new astring[208];
- format(astring, sizeof(astring),"Name: %s | AdminLevel: %d | Cash: %d | Materials: %d | Fish: %d | FishBait: %d | FishWeight: %d", GetName(playerid), PlayerInfo[playerid][pAdminLevel], PlayerInfo[playerid][pCash], PlayerInfo[playerid][pMats], PlayerInfo[playerid][Fish], PlayerInfo[playerid][FishBait], PlayerInfo[playerid][FishWeight]);
- SendClientMessage(playerid, WHITE, astring);
- format(astring, sizeof(astring),"FishingRod: %d | FishingLicense: %d | PlayingTime: %d Minutes | BankMoney: %d", PlayerInfo[playerid][FishRod], PlayerInfo[playerid][FishLicense], PlayerInfo[playerid][Minutes], PlayerInfo[playerid][BankMoney]);
- SendClientMessage(playerid, WHITE, astring);
- format(astring, sizeof(astring),"Kills: %d | Deaths: %d | TotalSecondsConnected: %d | TotalMinutesConnected: %d", PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Seconds], calculation);
- SendClientMessage(playerid, WHITE, astring);
- SendClientMessage(playerid, WHITE, "Usage: 1 = YES, 0 = NO");
- }
- else
- {
- new string[128];
- format(string, sizeof(string),"Name: %d | Cash: %d | Materials: %d | Fish: %d | FishBait: %d | FishWeight: %d", GetName(playerid), PlayerInfo[playerid][pCash], PlayerInfo[playerid][pMats], PlayerInfo[playerid][Fish], PlayerInfo[playerid][FishBait], PlayerInfo[playerid][FishWeight]);
- SendClientMessage(playerid, WHITE, string);
- format(string, sizeof(string),"FishingRod: %d | FishingLicense: %d | PlayingTime: %d Minutes | BankMoney: %d", PlayerInfo[playerid][FishRod], PlayerInfo[playerid][FishLicense], PlayerInfo[playerid][Minutes], PlayerInfo[playerid][BankMoney]);
- SendClientMessage(playerid, WHITE, string);
- format(string, sizeof(string),"Kills: %d | Deaths: %d | TotalSecondsConnected: %d | TotalMinutesConnected: %d", PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Seconds], calculation);
- SendClientMessage(playerid, WHITE, string);
- }
- SendClientMessage(playerid, WHITE, "___________________________________________________________________________________");
- return 1;
- }
- command(help, playerid, params[])
- {
- ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Help Menu - Select a Category", "General Commands\nAnimations\nVehicle", "Select", "Cancel");
- return 1;
- }
- command(makegun, playerid, params[])
- {
- if(PlayerInfo[playerid][pJob] == 1)
- {
- if(PlayerInfo[playerid][pMats] > 0)
- {
- ShowPlayerDialog(playerid, 2, DIALOG_STYLE_LIST, "Choose a Weapon", "Brass Knuckles(100Mats&$)\nAssassins Knife(300Mats&$)\n9MM(500Mats&$)\nDeagle(700Mats&$)\nShotgun(900Mats&$)\nMP-5(1100Mats&$)\nAK-47(1500Mats&$)\nM4A1(2000Mats&$)", "Select", "Cancel");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have any materials!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not an arms dealer!");
- }
- return 1;
- }
- command(agivemats, playerid, params[])
- {
- new id, string[128], string2[128], materials;
- if(sscanf(params, "ud", id, materials))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /agivemats [playerid] [amount]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- PlayerInfo[id][pMats] += materials;
- format(string2, sizeof(string2), "You have given Player %s %d materials successfully.", GetName(id), materials);
- SendClientMessage(playerid, WHITE, string2);
- format(string, sizeof(string), "Admin %s has given you %d materials (Admin Command)", GetName(playerid), materials);
- SendClientMessage(id, WHITE, string);
- }
- }
- return 1;
- }
- command(setadminlevel, playerid, params[])
- {
- new id, string[128], adminlevel;
- if(sscanf(params, "ud", id, adminlevel))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1330)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /setadminlevel [playerid] [level]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1330)
- {
- if(PlayerInfo[playerid][pAdminLevel] > PlayerInfo[id][pAdminLevel])
- {
- PlayerInfo[id][pAdminLevel] = adminlevel;
- format(string, sizeof(string), "%s is now a level %d Administrator! Congratulations!", GetName(id), adminlevel);
- SendClientMessageToAll(WHITE, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That Admin is a higher rank than you.");
- }
- }
- }
- return 1;
- }
- command(createhouse, playerid, params[])
- {
- new Usage[128], string[128];
- if(sscanf(params, "z", Usage))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 5)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /createhouse [usage]");
- SendClientMessage(playerid, GREY, "Usage: Interior, Exterior or Complete.");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 5)
- {
- if(strcmp(Usage, "exterior", true) == 0)
- {
- PlayerInfo[playerid][HouseExterior]++;
- PlayerInfo[playerid][hExtID] = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, PlayerInfo[playerid][hExtX], PlayerInfo[playerid][hExtY], PlayerInfo[playerid][hExtZ]);
- format(string, sizeof(string), "Exterior set! (X: %f, Y: %f, Z: %f).", PlayerInfo[playerid][hExtX], PlayerInfo[playerid][hExtY], PlayerInfo[playerid][hExtZ]);
- SendClientMessage(playerid, WHITE, string);
- }
- if(strcmp(Usage, "interior", true) == 0)
- {
- PlayerInfo[playerid][HouseInterior]++;
- PlayerInfo[playerid][hIntID] = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, PlayerInfo[playerid][hIntX], PlayerInfo[playerid][hIntY], PlayerInfo[playerid][hIntZ]);
- format(string, sizeof(string), "Interior set! (X: %f, Y: %f, Z: %f).", PlayerInfo[playerid][hIntX], PlayerInfo[playerid][hIntY], PlayerInfo[playerid][hIntZ]);
- SendClientMessage(playerid, WHITE, string);
- }
- if(strcmp(Usage, "complete", true) == 0)
- {
- if(PlayerInfo[playerid][HouseInterior] > 0 || PlayerInfo[playerid][HouseExterior] > 0)
- {
- new NewHouseID = SpawnedHouses+1;
- if(NewHouseID >= MAX_HOUSES)
- {
- SendClientMessage(playerid, WHITE, "Too many houses are currently spawned!");
- }
- else
- {
- format(string, sizeof(string), "Houses/House_%d.ini", NewHouseID);
- if(!fexist(string))
- {
- Houses[NewHouseID][hInteriorID] = PlayerInfo[playerid][hIntID];
- Houses[NewHouseID][hExteriorID] = PlayerInfo[playerid][hExtID];
- Houses[NewHouseID][hInteriorX] = PlayerInfo[playerid][hIntX];
- Houses[NewHouseID][hInteriorY] = PlayerInfo[playerid][hIntY];
- Houses[NewHouseID][hInteriorZ] = PlayerInfo[playerid][hIntZ];
- Houses[NewHouseID][hExteriorX] = PlayerInfo[playerid][hExtX];
- Houses[NewHouseID][hExteriorY] = PlayerInfo[playerid][hExtY];
- Houses[NewHouseID][hExteriorZ] = PlayerInfo[playerid][hExtZ];
- format(Houses[NewHouseID][hOwner], 255, "Nobody");
- Houses[NewHouseID][HPickupID] = CreateDynamicPickup(1273, 23, Houses[NewHouseID][hExteriorX], Houses[NewHouseID][hExteriorY], Houses[NewHouseID][hExteriorZ], 0, -1, -1, 150.0);
- dini_Create(string);
- dini_IntSet(string, "InteriorID", Houses[NewHouseID][hInteriorID]);
- dini_FloatSet(string, "InteriorX", Houses[NewHouseID][hInteriorX]);
- dini_FloatSet(string, "InteriorY", Houses[NewHouseID][hInteriorY]);
- dini_FloatSet(string, "InteriorZ", Houses[NewHouseID][hInteriorZ]);
- dini_IntSet(string, "HousePrice", 0);
- dini_IntSet(string, "ExteriorID", 0);
- dini_FloatSet(string, "ExteriorX", Houses[NewHouseID][hExteriorX]);
- dini_FloatSet(string, "ExteriorY", Houses[NewHouseID][hExteriorY]);
- dini_FloatSet(string, "ExteriorZ", Houses[NewHouseID][hExteriorZ]);
- dini_Set(string, "Owner", "Nobody");
- PlayerInfo[playerid][HouseExterior]--;
- PlayerInfo[playerid][HouseInterior]--;
- SpawnedHouses++;
- SendClientMessage(playerid, ME, "Successfully created house!");
- SetPlayerInterior(playerid, Houses[NewHouseID][hExteriorID]);
- SetPlayerPos(playerid, Houses[NewHouseID][hExteriorX], Houses[NewHouseID][hExteriorY], Houses[NewHouseID][hExteriorZ]);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Error: File already exists!");
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You must select an exterior and an interior first!");
- }
- }
- }
- }
- return 1;
- }
- command(buyhouse, playerid, params[])
- {
- #pragma unused params
- new string[128];
- if(PlayerInfo[playerid][House] == 0)
- {
- for(new h = 0; h < sizeof(Houses); h++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ]))
- {
- if(strcmp(Houses[h][hOwner], "Nobody", true) == 0)
- {
- if(Houses[h][HousePrice] == -1)
- {
- SendClientMessage(playerid, WHITE, "This house isn't purchasable.");
- }
- else
- {
- if(PlayerInfo[playerid][pCash] >= Houses[h][HousePrice])
- {
- PlayerInfo[playerid][pCash] -= Houses[h][HousePrice];
- format(Houses[h][hOwner], 128, "%s", GetName(playerid));
- format(string, sizeof(string), "Congratulations! You are now the owner of this property (House %d)", h);
- SendClientMessage(playerid, ANNOUNCEMENT, string);
- PlayerInfo[playerid][House] = h;
- DestroyDynamicPickup(Houses[h][HPickupID]);
- Houses[h][HPickupID] = CreateDynamicPickup(1272, 23, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ], 0, -1, -1, 150.0);
- SaveHouse(h);
- SendClientMessage(playerid, WHITE, "By purchasing a house, you've unlocked a bunch of new commands; use /help to find them out!");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have enough money to purchase this house.");
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Sorry, this house is not available!");
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You already have a house, type /abandonhouse.");
- }
- return 1;
- }
- command(houseprice, playerid, params[])
- {
- new money, id, string[128];
- if(sscanf(params, "dd", id, money))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /houseprice [houseid] [usage]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 2)
- {
- format(string, sizeof(string), "Houses/House_%d.ini", id);
- if(!fexist(string))
- {
- SendClientMessage(playerid, WHITE, "Invalid house ID!");
- return 1;
- }
- else
- {
- Houses[id][HousePrice] = money;
- SaveHouse(id);
- }
- }
- }
- return 1;
- }
- command(abandonhouse, playerid, params[])
- {
- new Confirmation[7];
- if(sscanf(params, "z", Confirmation))
- {
- SendClientMessage(playerid, WHITE, "Are you SURE you want to abandon your house? Please type /abandonhouse confirm");
- }
- else
- {
- if(strcmp(Confirmation, "Confirm", true) == 0)
- {
- if(PlayerInfo[playerid][House] != 0)
- {
- format(Houses[PlayerInfo[playerid][House]][hOwner], 255, "Nobody");
- SendClientMessage(playerid, WHITE, "You have now abandoned your house.");
- SaveHouse(PlayerInfo[playerid][House]);
- DestroyDynamicPickup(Houses[PlayerInfo[playerid][House]][HPickupID]);
- Houses[PlayerInfo[playerid][House]][HPickupID] = CreateDynamicPickup(1273, 23, Houses[PlayerInfo[playerid][House]][hExteriorX], Houses[PlayerInfo[playerid][House]][hExteriorY], Houses[PlayerInfo[playerid][House]][hExteriorZ], 0, -1, -1, 150.0);
- PlayerInfo[playerid][House] = 0;
- }
- }
- }
- return 1;
- }
- command(asellhouse, playerid, params[])
- {
- new string[128], id;
- if(sscanf(params, "d", id))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /asellhouse [house ID]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- format(string, sizeof(string), "Houses/House_%d.ini", id);
- if(fexist(string))
- {
- format(string, sizeof(string), "Accounts/%s.ini", Houses[id][hOwner]);
- if(fexist(string))
- {
- dini_IntSet(string, "House", 0);
- }
- format(Houses[id][hOwner], 128, "Nobody");
- format(string, sizeof(string), "You have sold house %d.", id);
- SendClientMessage(playerid, WHITE, string);
- SaveHouse(id);
- DestroyDynamicPickup(Houses[id][HPickupID]);
- Houses[id][HPickupID] = CreateDynamicPickup(1273, 23, Houses[id][hExteriorX], Houses[id][hExteriorY], Houses[id][hExteriorZ], 0, -1, -1, 150.0);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Invalid house ID!");
- }
- }
- }
- return 1;
- }
- command(deposit, playerid, params[])
- {
- new string[128], money;
- new string2[128];
- if(sscanf(params, "d", money))
- {
- if(IsPlayerConnected(playerid))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /deposit [ammount]");
- }
- }
- else
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][pCash] >= money)
- {
- if(InBank[playerid] == 1)
- {
- if(money > 0)
- {
- PlayerInfo[playerid][pCash] -= money;
- PlayerInfo[playerid][BankMoney] += money;
- format(string, sizeof(string), "You have Deposited $%d into your Bank Account!", money);
- SendClientMessage(playerid, WHITE, string);
- format(string2, sizeof(string2), "Your new Balance: $%d", PlayerInfo[playerid][BankMoney]);
- SendClientMessage(playerid, WHITE, string2);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Amount must be greater than 0!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You must be in the bank to Deposit Money!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have that much money to Deposit!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not connected!");
- }
- }
- return 1;
- }
- command(balance, playerid, params[])
- {
- if(InBank[playerid] == 1)
- {
- new string[128];
- format(string, sizeof(string), "Bank Balance: $%d", PlayerInfo[playerid][BankMoney]);
- SendClientMessage(playerid, WHITE, string);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You must be in the bank to check your Balance!");
- }
- return 1;
- }
- command(withdraw, playerid, params[])
- {
- new string[128], money;
- new string2[128];
- if(sscanf(params, "d", money))
- {
- if(IsPlayerConnected(playerid))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /withdraw [ammount]");
- }
- }
- else
- {
- if(IsPlayerConnected(playerid))
- {
- if(PlayerInfo[playerid][BankMoney] >= money)
- {
- if(InBank[playerid] == 1)
- {
- if(money > 0)
- {
- PlayerInfo[playerid][pCash] += money;
- PlayerInfo[playerid][BankMoney] -= money;
- format(string, sizeof(string), "You have Withdrawed $%d from your Bank Account!", money);
- SendClientMessage(playerid, WHITE, string);
- format(string2, sizeof(string2), "Your new Balance: $%d", PlayerInfo[playerid][BankMoney]);
- SendClientMessage(playerid, WHITE, string2);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Amount must be greater than 0!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You must be in the bank to Withdraw Money!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have that much money in your account to Withdraw!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not connected!");
- }
- }
- return 1;
- }
- command(quitjob, playerid, params[])
- {
- if(PlayerInfo[playerid][pJob] >= 1)
- {
- PlayerInfo[playerid][pJob] = 0;
- SendClientMessage(playerid, WHITE, "You have quit your job!");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have a job to quit!");
- }
- return 1;
- }
- command(joinjob, playerid, params[])
- {
- new Usage[128];
- if(sscanf(params, "z", Usage))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /joinjob [usage]");
- SendClientMessage(playerid, GREY, "Usages: ArmsDealer");
- }
- else
- {
- if(strcmp(Usage, "Armsdealer", true) == 0)
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 1302.1343,217.0710,19.5547))
- {
- if(PlayerInfo[playerid][pJob] == 0)
- {
- if(PlayerInfo[playerid][pScore] >= 3)
- {
- PlayerInfo[playerid][pJob] = 1;
- SendClientMessage(playerid, WHITE, "You have now become an Arms Dealer, you can now use the command /makegun!");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not a high enough level to become an arms dealer! (Level 3).");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You already have a job!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not in the Join Job area!");
- }
- }
- }
- return 1;
- }
- command(enter, playerid, params[])
- {
- for(new i = 0; i < sizeof(Houses); i++)
- {
- if(IsPlayerInRangeOfPoint(playerid, 3, Houses[i][hExteriorX], Houses[i][hExteriorY], Houses[i][hExteriorZ]))
- {
- PlayerInfo[playerid][InHouse] = i;
- SetPlayerVirtualWorld(playerid, 55000+i);
- SetPlayerInterior(playerid, Houses[i][hInteriorID]);
- SetPlayerPos(playerid, Houses[i][hInteriorX], Houses[i][hInteriorY], Houses[i][hInteriorZ]);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3, Groups[i][gExtX], Groups[i][gExtY], Groups[i][gExtZ]))
- {
- InHQ[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 55000+i);
- SetPlayerInterior(playerid, Groups[i][gIntID]);
- SetPlayerPos(playerid, Groups[i][gIntX], Groups[i][gIntY], Groups[i][gIntZ]);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3, DepartmentExtX, DepartmentExtY, DepartmentExtZ))
- {
- InHQ[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 55000+i);
- SetPlayerInterior(playerid, DepartmentIntID);
- SetPlayerPos(playerid, DepartmentIntX, DepartmentIntY, DepartmentIntZ);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3, BankExtX, BankExtY, BankExtZ))
- {
- InBank[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 55000+i);
- SetPlayerInterior(playerid, BankIntID);
- SendClientMessage(playerid, WHITE, "AVAILABLE COMMANDS: /deposit, /withdraw, /balance");
- SetPlayerPos(playerid, BankIntX, BankIntY, BankIntZ);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3, ClothesExtX, ClothesExtY, ClothesExtZ))
- {
- InClothesShop[playerid] = 1;
- SetPlayerVirtualWorld(playerid, 55000+i);
- SetPlayerInterior(playerid, ClothesIntID);
- SetPlayerPos(playerid, ClothesIntX, ClothesIntY, ClothesIntZ);
- }
- }
- return 1;
- }
- command(exit, playerid, params[])
- {
- for(new i = 0; i < sizeof(Houses); i++)
- {
- if(GetPlayerVirtualWorld(playerid) >= 55000 && GetPlayerVirtualWorld(playerid) < 65000 && IsPlayerInRangeOfPoint(playerid, 3, Houses[i][hInteriorX], Houses[i][hInteriorY], Houses[i][hInteriorZ]))
- {
- if(PlayerInfo[playerid][InHouse] != 0)
- {
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, Houses[PlayerInfo[playerid][InHouse]][hExteriorID]);
- SetPlayerPos(playerid, Houses[PlayerInfo[playerid][InHouse]][hExteriorX], Houses[PlayerInfo[playerid][InHouse]][hExteriorY], Houses[PlayerInfo[playerid][InHouse]][hExteriorZ]);
- PlayerInfo[playerid][InHouse] = 0;
- }
- else
- {
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, Houses[i][hExteriorID]);
- SetPlayerPos(playerid, Houses[i][hExteriorX], Houses[i][hExteriorY], Houses[i][hExteriorZ]);
- }
- }
- if(IsPlayerInRangeOfPoint(playerid, 3, Groups[i][gIntX], Groups[i][gIntY], Groups[i][gIntZ]))
- {
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, Groups[i][gExtX], Groups[i][gExtY], Groups[i][gExtZ]);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3, DepartmentIntX, DepartmentIntY, DepartmentIntZ))
- {
- InHQ[playerid] = 0;
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- SetPlayerPos(playerid, DepartmentExtX, DepartmentExtY, DepartmentExtZ);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3, BankIntX, BankIntY, BankIntZ))
- {
- InBank[playerid] = 0;
- SetPlayerPos(playerid, BankExtX, BankExtY, BankExtZ);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- }
- if(IsPlayerInRangeOfPoint(playerid, 3, ClothesIntX, ClothesIntY, ClothesIntZ))
- {
- InClothesShop[playerid] = 0;
- SetPlayerPos(playerid, ClothesExtX, ClothesExtY, ClothesExtZ);
- SetPlayerVirtualWorld(playerid, 0);
- SetPlayerInterior(playerid, 0);
- }
- }
- return 1;
- }
- command(fish, playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 10, 2111.2566,-98.2426,2.1183))
- {
- if(PlayerInfo[playerid][FishRod] == 1)
- {
- if(PlayerInfo[playerid][FishLicense] == 1)
- {
- if(PlayerInfo[playerid][FishBait] >= 1)
- {
- if(PlayerInfo[playerid][Fish] < 10)
- {
- if(Fishing[playerid] == 0)
- {
- new rand = random(10);
- switch(rand)
- {
- case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9:
- {
- FishTimer = SetTimerEx("FishPublic", 10000, false, "i", playerid);
- Fishing[playerid] = 1;
- TogglePlayerControllable(playerid, false);
- ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,0,1,1);
- SetPlayerAttachedObject(playerid, 0,18632,6,0.079376,0.037070,0.007706,181.482910,0.000000,0.000000,1.000000,1.000000,1.000000);
- }
- case 1000:
- {
- FishTimer = SetTimerEx("WhalePublic", 10000, false, "i", playerid);
- Fishing[playerid] = 1;
- TogglePlayerControllable(playerid, false);
- ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,0,1,1);
- SetPlayerAttachedObject(playerid, 0,18632,6,0.079376,0.037070,0.007706,181.482910,0.000000,0.000000,1.000000,1.000000,1.000000);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are already fishing, please wait!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You must sell some fish before you can fish again!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have any Fishing Bait!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have a Fishing License!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have a Fishing Rod!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You must be at the pier to fish!");
- }
- return 1;
- }
- command(fishingshop, playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 2160.6680,-98.3544,2.8150))
- {
- ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, "Fish Shop", "Fishing Bait(x25)($10)\nFishing License($250)\nFishing Rod($150)", "Select", "Cancel");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not at the fishing shop!");
- }
- return 1;
- }
- command(ajail, playerid, params[])
- {
- new id, string[128], time, Reason[128];
- if(sscanf(params, "udz", id, time, Reason))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /prison [playerid] [time] [reason]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- if(IsPlayerConnected(id))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= PlayerInfo[id][pAdminLevel])
- {
- if(strlen(Reason) < 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /prison [playerid] [time] [reason]");
- }
- else
- {
- if(time == 0)
- {
- if(PlayerInfo[id][PrisonDuration] >= 1)
- {
- format(string, sizeof(string), "Prison: %s has been released from prison by %s, reason: %s.", GetName(id), GetName(playerid), Reason);
- SendClientMessageToAll(LIGHTRED, string);
- PlayerInfo[id][PrisonDuration] = 0;
- PlayerInfo[id][PrisonID] = 0;
- SetPlayerPos(id, 608.1954,-543.5193,16.5681);
- SetPlayerVirtualWorld(id, 0);
- SetPlayerInterior(id, 0);
- SendClientMessage(id, WHITE, "You have been released from prison.");
- TogglePlayerControllable(id, true);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You can't release some-one who isn't even prisoned.");
- }
- }
- else
- {
- format(string, sizeof(string), "Prison: %s has been prisoned by %s, reason: %s (%d minutes).", GetName(id), GetName(playerid), Reason, time);
- SendClientMessageToAll(LIGHTRED, string);
- PlayerInfo[id][PrisonDuration] = time*60;
- PlayerInfo[id][PrisonID] = 1;
- if(PlayerInfo[id][pAdminLevel] < 1)
- {
- SendClientMessage(playerid, WHITE, "You have earned an admin action!");
- }
- if(IsPlayerInAnyVehicle(id))
- {
- RemovePlayerFromVehicle(id);
- }
- ResetPlayerWeapons(id);
- SetPlayerInterior(id, Prison1Int);
- SetPlayerPos(id, Prison1X, Prison1Y, Prison1Z);
- SetPlayerVirtualWorld(id, Prison1World);
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You can't prison a higher level admin.");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player isn't connected or isn't logged in.");
- }
- }
- }
- return 1;
- }
- command(sellfish, playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 5.0, 2160.6680,-98.3544,2.8150))
- {
- if(PlayerInfo[playerid][Fish] > 0)
- {
- new string[128];
- new calculation = PlayerInfo[playerid][FishWeight]*3;
- PlayerInfo[playerid][pCash] += calculation;
- PlayerInfo[playerid][FishWeight] = 0;
- format(string, sizeof(string), "You have recieved $%d for all of your fish!", calculation);
- SendClientMessage(playerid, WHITE, string);
- PlayerInfo[playerid][Fish] = 0;
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have any fish to sell!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not at the Fishing Shop!");
- }
- return 1;
- }
- command(vbuy, playerid, params[])
- {
- if(IsPlayerInRangeOfPoint(playerid, 10, 1230.2791,139.5188,20.3028))
- {
- ShowPlayerDialog(playerid, 346, DIALOG_STYLE_LIST, "Vehicle Dealership", "Special Deals\nLow-Riders\nSaloon Cars\n4x4 / Off-Roaders / Pickups\nBikes\nSports, Muscle and Supercars\nVIP Models", "Select", "Cancel");
- }
- return 1;
- }
- command(pay, playerid, params[])
- {
- new id, string[128], string2[128], money;
- new string3[128];
- if(sscanf(params, "ud", id, money))
- {
- if(IsPlayerConnected(id))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /pay [playerid] [ammount]");
- }
- }
- else
- {
- if(IsPlayerConnected(id))
- {
- if(PlayerInfo[playerid][pCash] >= money)
- {
- if(GetDistanceBetweenPlayers(playerid, id) <= 10)
- {
- PlayerInfo[playerid][pCash] -= money;
- PlayerInfo[id][pCash] += money;
- format(string, sizeof(string), "You have given %s $%d.", GetName(id), money);
- format(string2, sizeof(string2), "%s has given you $%d.", GetName(playerid), money);
- format(string3, sizeof(string3), "%s has given %s $%d.", GetName(playerid), GetName(id), money);
- SendClientMessage(playerid, WHITE, string);
- SendClientMessage(id, WHITE, string2);
- NearByMessage(playerid, WHITE, string3);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You must be closer to that player to Pay them!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You do not have that much money to give!");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That player is not connected!");
- }
- }
- return 1;
- }
- command(agivemoney, playerid, params[])
- {
- new id, string[128], string2[128], money;
- if(sscanf(params, "ud", id, money))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /agivemoney [playerid] [amount]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- PlayerInfo[id][pCash] += money;
- format(string2, sizeof(string2), "You have given Player %s $%d successfully.", GetName(id), money);
- SendClientMessage(playerid, WHITE, string2);
- format(string, sizeof(string), "Admin %s has given you $%d (Admin Command)", GetName(playerid), money);
- SendClientMessage(id, WHITE, string);
- }
- }
- return 1;
- }
- command(parkcar, playerid, params[])
- {
- new vehslot;
- if(sscanf(params, "d", vehslot))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /parkcar [1-3]");
- }
- else
- {
- switch(vehslot)
- {
- case 1:
- {
- if(PlayerInfo[playerid][PlayerCarModel] > 0)
- {
- if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][CarLinkID])
- {
- if(PlayerInfo[playerid][CarModDelay] == 0)
- {
- new Float: tmpdamage;
- GetVehicleHealth(PlayerInfo[playerid][CarLinkID], tmpdamage);
- GetVehicleZAngle(PlayerInfo[playerid][CarLinkID], PlayerInfo[playerid][CarZAngle]);
- GetVehiclePos(PlayerInfo[playerid][CarLinkID], PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ]);
- DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
- OwnedCarCount--;
- CarCount--;
- SpawnOwnedCar(playerid, 1);
- PutPlayerInVehicle(playerid, PlayerInfo[playerid][CarLinkID], 0);
- PlayerInfo[playerid][CarModDelay] = 1;
- SetVehicleHealth(PlayerInfo[playerid][CarLinkID], tmpdamage);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Please wait your reload time (60 seconds).");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You have to be in your car to do this. Use /callcar if you've lost it.");
- }
- }
- }
- case 2:
- {
- if(PlayerInfo[playerid][PlayerCarModel2] > 0)
- {
- if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][Car2LinkID])
- {
- if(PlayerInfo[playerid][CarModDelay] == 0)
- {
- new Float: tmpdamage;
- GetVehicleHealth(PlayerInfo[playerid][Car2LinkID], tmpdamage);
- GetVehicleZAngle(PlayerInfo[playerid][Car2LinkID], PlayerInfo[playerid][Car2ZAngle]);
- GetVehiclePos(PlayerInfo[playerid][Car2LinkID], PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z]);
- DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
- OwnedCarCount--;
- CarCount--;
- SpawnOwnedCar(playerid, 2);
- PutPlayerInVehicle(playerid, PlayerInfo[playerid][Car2LinkID], 0);
- PlayerInfo[playerid][CarModDelay] = 1;
- SetVehicleHealth(PlayerInfo[playerid][Car2LinkID], tmpdamage);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Please wait your reload time (60 seconds).");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You have to be in your car to do this. Use /callcar if you've lost it.");
- }
- }
- }
- case 3:
- {
- if(PlayerInfo[playerid][PlayerCarModel3] > 0)
- {
- if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][Car3LinkID])
- {
- if(PlayerInfo[playerid][CarModDelay] == 0)
- {
- new Float: tmpdamage;
- GetVehicleHealth(PlayerInfo[playerid][Car3LinkID], tmpdamage);
- GetVehicleZAngle(PlayerInfo[playerid][Car3LinkID], PlayerInfo[playerid][Car3ZAngle]);
- GetVehiclePos(PlayerInfo[playerid][Car3LinkID], PlayerInfo[playerid][Car3X], PlayerInfo[playerid][Car3Y], PlayerInfo[playerid][Car3Z]);
- DestroyVehicle(PlayerInfo[playerid][Car3LinkID]);
- OwnedCarCount--;
- CarCount--;
- SpawnOwnedCar(playerid, 3);
- PutPlayerInVehicle(playerid, PlayerInfo[playerid][Car3LinkID], 0);
- PlayerInfo[playerid][CarModDelay] = 1;
- SetVehicleHealth(PlayerInfo[playerid][Car3LinkID], tmpdamage);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Please wait your reload time (60 seconds).");
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You have to be in your car to do this. Use /callcar if you've lost it.");
- }
- }
- }
- }
- }
- return 1;
- }
- command(respawnmycar, playerid, params[])
- {
- ShowPlayerDialog(playerid, 100, DIALOG_STYLE_LIST, "Choose a Vehicle to Respawn", "Vehicle Slot 1($500)\nVehicle Slot 2($500)\nVehicle Slot 3($500)", "Select", "Cancel");
- return 1;
- }
- GetVehicleFileID(gameid)
- {
- new result;
- for(new i = 0; i < MAX_VEHICLES; i++)
- {
- if(gameid == Vehicles[i][GameID])
- {
- result = i;
- }
- }
- return result;
- }
- command(afk, playerid, params[])
- {
- new string[128];
- if(Afk[playerid] == 0)
- {
- Afk[playerid] = 1;
- SetPlayerColor(playerid, AFK);
- format(string, sizeof(string), "[AFK] A nearby player [%s] is now AFK (/afk).", GetName(playerid));
- NearByMessage(playerid, AFK, string);
- TogglePlayerControllable(playerid, false);
- }
- else
- {
- SetPlayerColor(playerid, WHITE);
- Afk[playerid] = 0;
- format(string, sizeof(string), "[BackFromAFK] A nearby player [%s] is now back from AFK (/afk).", GetName(playerid));
- NearByMessage(playerid, AFK, string);
- TogglePlayerControllable(playerid, true);
- }
- return 1;
- }
- command(unban, playerid, params[])
- {
- new Name[MAX_PLAYER_NAME], string[128], string2[128];
- if(sscanf(params, "z", Name))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /unban [name]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- format(string, sizeof(string), "Accounts/%s.ini", Name);
- if(fexist(string))
- {
- if(dini_Isset(string, "Banned"))
- {
- if(dini_Int(string, "Banned") == 1)
- {
- dini_IntSet(string, "Banned", -1);
- if(dini_Isset(string, "LastIP"))
- {
- format(string2, sizeof(string2), "Now attempting to unban players' last known IP (%s).", dini_Get(string, "LastIP"));
- SendClientMessage(playerid, GREY, string2);
- format(string2, sizeof(string2), "unbanip %s", dini_Get(string, "LastIP"));
- SendRconCommand(string2);
- SendRconCommand("reloadbans");
- SendClientMessage(playerid, GREY, "IP unbanned and bans list reloaded.");
- format(string, sizeof(string), "WARNING: %s has unbanned Player %s.", GetName(playerid), Name);
- SendToAdmins(ADMINORANGE, string, 0);
- new hour, minute, second, day, year, month, string3[128];
- gettime(hour, minute, second);
- getdate(year, month, day);
- format(string3, sizeof(string3), "%s | %d/%d/%d | %d:%d | %s", Name, day, month, year, hour, minute, GetName(playerid));
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Account unbanned, though the IP was not valid or even in the file. You'll have to manualy unban it.");
- }
- SendClientMessage(playerid, WHITE, "Account unbanned.");
- }
- else
- {
- if(dini_Int(string, "Banned") == 2 || dini_Int(string, "Banned") == 4)
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 5)
- {
- dini_IntSet(string, "Banned", 0);
- if(dini_Isset(string, "LastIP"))
- {
- if(dini_Int(string, "AdminLevel") == -1)
- {
- dini_IntSet(string, "AdminLevel", 0);
- dini_Set(string, "Note", "You have been removed from the admin team.");
- }
- else
- {
- new ssadas[128];
- format(ssadas, sizeof(ssadas), "You have been unbanned by %s.", GetName(playerid));
- dini_Set(string, "Note", ssadas);
- }
- format(string2, sizeof(string2), "Now attempting to unban players' last known IP (%s).", dini_Get(string, "LastIP"));
- SendClientMessage(playerid, GREY, string2);
- format(string2, sizeof(string2), "unbanip %s", dini_Get(string, "LastIP"));
- SendRconCommand(string2);
- SendRconCommand("reloadbans");
- SendClientMessage(playerid, GREY, "IP unbanned and bans list reloaded.");
- format(string, sizeof(string), "WARNING: %s has unbanned Player %s.", GetName(playerid), Name);
- SendToAdmins(ADMINORANGE, string, 0);
- new hour, minute, second, day, year, month, string3[128];
- gettime(hour, minute, second);
- getdate(year, month, day);
- format(string3, sizeof(string3), "%s | %d/%d/%d | %d:%d | %s", Name, day, month, year, hour, minute, GetName(playerid));
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Account unbanned, though the IP was not valid or even in the file. You'll have to manualy unban it.");
- }
- SendClientMessage(playerid, WHITE, "Account unbanned.");
- }
- else
- {
- SendClientMessage(playerid, WHITE, "That account has been permabanned.");
- }
- }
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Account not found.");
- }
- return 1;
- }
- }
- return 1;
- }
- command(n, playerid, params[])
- {
- new
- string[128];
- if(isnull(params))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /n [message]");
- }
- else
- {
- format(string, sizeof(string), "(([NewbieChat] %s: %s ))", GetName(playerid), params);
- SendClientMessageToAll(NEWBIE, string);
- }
- return 1;
- }
- command(o, playerid, params[])
- {
- new
- string[128];
- if(isnull(params))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /o(oc) [message]");
- }
- else
- {
- format(string, sizeof(string), "(([GlobalOOC] %s: %s ))", GetName(playerid), params);
- SendClientMessageToAll(GREY, string);
- }
- return 1;
- }
- command(b, playerid, params[])
- {
- new
- string[128];
- if(isnull(params))
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /o(oc) [message]");
- }
- else
- {
- format(string, sizeof(string), "(([LocalOOC] %s: %s ))", GetName(playerid), params);
- NearByMessage(playerid, POLICE, string);
- }
- return 1;
- }
- command(ooc, playerid, params[])
- {
- return cmd_o(playerid, params);
- }
- command(newbie, playerid, params[])
- {
- return cmd_n(playerid, params);
- }
- command(savecar, playerid, params[])
- {
- #pragma unused params
- if(PlayerInfo[playerid][pAdminLevel] >= 5)
- {
- if(UnconfirmedSave[playerid] == 0)
- {
- SendClientMessage(playerid, WHITE, "Are you sure you want to save this vehicle? Please re-type this command to confirm this action.");
- UnconfirmedSave[playerid] = 1;
- }
- else
- {
- UnconfirmedSave[playerid] = 0;
- if(IsPlayerInAnyVehicle(playerid))
- {
- new id, Vehicle[16], vehicleid = GetPlayerVehicleID(playerid);
- id = findAvailableVehicleID();
- format(Vehicle, sizeof(Vehicle), "V_%d", id);
- if(!djIsSet(VEHICLES_FILE, Vehicle)) // Fail-safe to prevent overwriting any current values
- {
- GetVehiclePos(vehicleid, Vehicles[id][CarPosX], Vehicles[id][CarPosY], Vehicles[id][CarPosZ]);
- GetVehicleZAngle(vehicleid, Vehicles[id][CarZAngle]);
- Vehicles[id][CarModel] = GetVehicleModel(vehicleid);
- Vehicles[id][CarGroup] = 0;
- Vehicles[id][CarColour1] = -1;
- Vehicles[id][CarColour2] = -1;
- djAutocommit(false);
- format(Vehicle, sizeof(Vehicle), "V_%d/PosX", id);
- djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosX], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/PosY", id);
- djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosY], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/PosZ", id);
- djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosZ], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/ZAngle", id);
- djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarZAngle], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Model", id);
- djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarModel], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Col1", id);
- djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarColour1], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Col2", id);
- djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarColour2], true);
- format(Vehicle, sizeof(Vehicle), "V_%d/Group", id);
- djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarGroup], true);
- djCommit(VEHICLES_FILE);
- djAutocommit(true);
- CarCount++;
- printf("[system] Vehicle %d has been saved to %s.", id, VEHICLES_FILE);
- SendClientMessage(playerid, WHITE, "Vehicle saved!");
- DestroyVehicle(vehicleid);
- Vehicles[id][GameID] = CreateVehicle(Vehicles[id][CarModel], Vehicles[id][CarPosX], Vehicles[id][CarPosY], Vehicles[id][CarPosZ], Vehicles[id][CarZAngle], Vehicles[id][CarColour1], Vehicles[id][CarColour2], 3600);
- PutPlayerInVehicle(playerid, Vehicles[id][GameID], 0);
- SendClientMessage(playerid, WHITE, "Do NOT despawn this vehicle.");
- for(new i = 0; i < SpawnedVehicles; i++)
- {
- if(AdminSpawned[i] == GetPlayerVehicleID(playerid))
- {
- AdminSpawned[i] = 0;
- }
- }
- }
- }
- }
- }
- return 1;
- }
- command(setcargroup, playerid, params[])
- {
- new id, string[128];
- if(sscanf(params, "d", id))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /setcargroup [group ID]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- if(id >= 0 && id < MAX_GROUPS)
- {
- if(GetVehicleFileID(GetPlayerVehicleID(playerid)) == 0)
- {
- SendClientMessage(playerid, WHITE, "That doesn't seem to be a saved vehicle.");
- }
- else
- {
- if(id == 0)
- {
- SendClientMessage(playerid, WHITE, "You have unlocked this vehicle.");
- Vehicles[GetVehicleFileID(GetPlayerVehicleID(playerid))][CarGroup] = 0;
- }
- else
- {
- Vehicles[GetVehicleFileID(GetPlayerVehicleID(playerid))][CarGroup] = id;
- format(string, sizeof(string), "You have locked this vehicle to Group %d.", id);
- SendClientMessage(playerid, WHITE, string);
- SaveExistingVehicle(GetPlayerVehicleID(playerid));
- }
- }
- }
- else
- {
- format(string, sizeof(string), "Invalid Group ID (groups vary from ID 1 to ID %d).", MAX_GROUPS);
- SendClientMessage(playerid, WHITE, string);
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You're not in a valid vehicle.");
- }
- }
- }
- return 1;
- }
- command(asetgroup, playerid, params[])
- {
- new id, string[128], string2[128], group, grouprank;
- if(sscanf(params, "udd", id, group, grouprank))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /asetgroup [playerid] [groupid] [grouprank]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 1)
- {
- PlayerInfo[id][Group] = group;
- PlayerInfo[id][GroupRank] = grouprank;
- format(string, sizeof(string), "Admin %s has set your group to %d and your grouprank to %d.", GetName(playerid), group, grouprank);
- SendClientMessage(id, WHITE, string);
- format(string2, sizeof(string2), "You have set %s's group to %d and his grouprank to %d.", GetName(id), group, grouprank);
- SendClientMessage(playerid, WHITE, string2);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You are not an Administrator!");
- }
- }
- return 1;
- }
- command(changespawn, playerid, params[])
- {
- ShowPlayerDialog(playerid, 333, DIALOG_STYLE_LIST, "Choose a Spawn", "Newbie Spawn\nGroup Spawn", "Select", "Cancel");
- return 1;
- }
- command(creategroup, playerid, params[])
- {
- new Usage[128], string[128];
- if(sscanf(params, "z", Usage))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 5)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /creategroup [usage]");
- SendClientMessage(playerid, GREY, "Usage: Interior, Exterior or Complete.");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 5)
- {
- if(strcmp(Usage, "exterior", true) == 0)
- {
- PlayerInfo[playerid][GroupExterior]++;
- PlayerInfo[playerid][gExtID] = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, PlayerInfo[playerid][gExtX], PlayerInfo[playerid][gExtY], PlayerInfo[playerid][gExtZ]);
- format(string, sizeof(string), "Exterior set! (X: %f, Y: %f, Z: %f).", PlayerInfo[playerid][gExtX], PlayerInfo[playerid][gExtY], PlayerInfo[playerid][gExtZ]);
- SendClientMessage(playerid, WHITE, string);
- }
- if(strcmp(Usage, "interior", true) == 0)
- {
- PlayerInfo[playerid][GroupInterior]++;
- PlayerInfo[playerid][gExtID] = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, PlayerInfo[playerid][gIntX], PlayerInfo[playerid][gIntY], PlayerInfo[playerid][gIntZ]);
- format(string, sizeof(string), "Interior set! (X: %f, Y: %f, Z: %f).", PlayerInfo[playerid][gIntX], PlayerInfo[playerid][gIntY], PlayerInfo[playerid][gIntZ]);
- SendClientMessage(playerid, WHITE, string);
- }
- if(strcmp(Usage, "complete", true) == 0)
- {
- if(PlayerInfo[playerid][GroupInterior] > 0 || PlayerInfo[playerid][GroupExterior] > 0)
- {
- new NewGroupID = SpawnedGroups+1;
- if(NewGroupID >= MAX_GROUPS)
- {
- SendClientMessage(playerid, WHITE, "Too many groups are currently spawned!");
- }
- else
- {
- format(string, sizeof(string), "Groups/Group_%d.ini", NewGroupID);
- if(!fexist(string))
- {
- Groups[NewGroupID][gIntID] = PlayerInfo[playerid][gIntID];
- Groups[NewGroupID][gExtID] = PlayerInfo[playerid][gExtID];
- Groups[NewGroupID][gIntX] = PlayerInfo[playerid][gIntX];
- Groups[NewGroupID][gIntY] = PlayerInfo[playerid][gIntY];
- Groups[NewGroupID][gIntZ] = PlayerInfo[playerid][gIntZ];
- Groups[NewGroupID][gExtX] = PlayerInfo[playerid][gExtX];
- Groups[NewGroupID][gExtY] = PlayerInfo[playerid][gExtY];
- Groups[NewGroupID][gExtZ] = PlayerInfo[playerid][gExtZ];
- format(Groups[NewGroupID][gName], 255, "Un-Named");
- Groups[NewGroupID][gPickupID] = CreateDynamicPickup(1273, 23, Groups[NewGroupID][gExtX], Groups[NewGroupID][gExtY], Groups[NewGroupID][gExtZ], 0, -1, -1, 150.0);
- dini_Create(string);
- dini_IntSet(string, "IntID", Groups[NewGroupID][gIntID]);
- dini_FloatSet(string, "IntX", Groups[NewGroupID][gIntX]);
- dini_FloatSet(string, "IntY", Groups[NewGroupID][gIntY]);
- dini_FloatSet(string, "IntZ", Groups[NewGroupID][gIntZ]);
- dini_IntSet(string, "ExtID", 0);
- dini_FloatSet(string, "ExtX", Groups[NewGroupID][gExtX]);
- dini_FloatSet(string, "ExtY", Groups[NewGroupID][gExtY]);
- dini_FloatSet(string, "ExtZ", Groups[NewGroupID][gExtZ]);
- PlayerInfo[playerid][GroupExterior]--;
- PlayerInfo[playerid][GroupInterior]--;
- SpawnedGroups++;
- SendClientMessage(playerid, ME, "Successfully created group HQ!");
- SetPlayerInterior(playerid, Groups[NewGroupID][gExtID]);
- SetPlayerPos(playerid, Groups[NewGroupID][gExtX], Groups[NewGroupID][gExtY], Groups[NewGroupID][gExtZ]);
- }
- else
- {
- SendClientMessage(playerid, WHITE, "Error: File already exists!");
- }
- }
- }
- else
- {
- SendClientMessage(playerid, WHITE, "You must select an exterior and an interior first!");
- }
- }
- }
- }
- return 1;
- }
- command(ghqinterior, playerid, params[])
- {
- new GroupID, string[128];
- if(sscanf(params, "d", GroupID))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /ghqinteror [group ID]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- format(string, sizeof(string), "Groups/Group_%d.ini", GroupID);
- if(fexist(string))
- {
- Groups[GroupID][gIntID] = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, Groups[GroupID][gIntX], Groups[GroupID][gIntY], Groups[GroupID][gIntZ]);
- format(string, sizeof(string), "You have successfully moved Group %s's interior.", GroupID);
- SendClientMessage(playerid, WHITE, string);
- SaveGroup(GroupID);
- }
- }
- }
- return 1;
- }
- stock SaveGroup(i)
- {
- new FileName[21];
- format(FileName, sizeof(FileName), "Groups/Group_%d.ini", i);
- if(fexist(FileName))
- {
- dini_Set(FileName, "gName", Groups[i][gName]);
- dini_IntSet(FileName, "gIntID", Groups[i][gIntID]);
- dini_FloatSet(FileName, "gIntX", Groups[i][gIntX]);
- dini_FloatSet(FileName, "gIntY", Groups[i][gIntY]);
- dini_FloatSet(FileName, "gIntZ", Groups[i][gIntZ]);
- dini_IntSet(FileName, "gExtID", Groups[i][gExtID]);
- dini_FloatSet(FileName, "gExtX", Groups[i][gExtX]);
- dini_FloatSet(FileName, "gExtY", Groups[i][gExtY]);
- dini_FloatSet(FileName, "gExtZ", Groups[i][gExtZ]);
- printf("[system] Group %d saved.", i);
- }
- else
- {
- printf("Could not execute SaveGroup(%d).", i);
- }
- }
- command(ghqexterior, playerid, params[])
- {
- new GroupID, string[128];
- if(sscanf(params, "d", GroupID))
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /ghqexteror [group ID]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][pAdminLevel] >= 4)
- {
- format(string, sizeof(string), "Groups/Group_%d.ini", GroupID);
- if(fexist(string))
- {
- DestroyDynamicPickup(Groups[GroupID][gPickupID]);
- Groups[GroupID][gExtID] = GetPlayerInterior(playerid);
- GetPlayerPos(playerid, Groups[GroupID][gExtX], Groups[GroupID][gExtY], Groups[GroupID][gExtZ]);
- format(string, sizeof(string), "You have successfully moved Group %s's exterior.", GroupID);
- SendClientMessage(playerid, WHITE, string);
- Groups[GroupID][gPickupID] = CreateDynamicPickup(1239, 23, Groups[GroupID][gExtX], Groups[GroupID][gExtY], Groups[GroupID][gExtZ], 0, -1, -1, 150.0);
- SaveGroup(GroupID);
- }
- }
- }
- return 1;
- }
- command(hire, playerid, params[])
- {
- new id, string[128];
- if(sscanf(params, "u", playerid))
- {
- if(PlayerInfo[playerid][Group] >= 1)
- {
- SendClientMessage(playerid, WHITE, "SYNTAX: /hire [playerid]");
- }
- }
- else
- {
- if(PlayerInfo[playerid][Group] >= 1)
- {
- PlayerInfo[id][PendingGroupInvite] = playerid;
- PlayerInfo[id][PendingGroup] = PlayerInfo[playerid][Group];
- format(string, sizeof(string), "You have requested to HIRE %d into the Group.", GetName(id));
- SendClientMessage(playerid, WHITE, string);
- format(string, sizeof(string), "%s is requesting to HIRE you into his/her faction... Type /approve groupinvite to join the group!", GetName(playerid));
- SendClientMessage(id, NICESKY, string);
- }
- }
- return 1;
- }
- command(duty, playerid, params[])
- {
- if(InHQ[playerid] == 1)
- {
- if(PlayerInfo[playerid][Group] == 2)
- {
- if(OnDuty[playerid] == 0)
- {
- if(PlayerInfo[playerid][GroupRank] == 1)
- {
- SetPlayerSkin(playerid, 277);
- OnDuty[playerid] = 1;
- }
- if(PlayerInfo[playerid][GroupRank] == 2)
- {
- SetPlayerSkin(playerid, 274);
- OnDuty[playerid] = 1;
- }
- if(PlayerInfo[playerid][GroupRank] == 3)
- {
- SetPlayerSkin(playerid, 278);
- OnDuty[playerid] = 1;
- }
- if(PlayerInfo[playerid][GroupRank] == 4)
- {
- SetPlayerSkin(playerid, 275);
- OnDuty[playerid] = 1;
- }
- if(PlayerInfo[playerid][GroupRank] == 5)
- {
- SetPlayerSkin(playerid, 276);
- OnDuty[playerid] = 1;
- }
- if(PlayerInfo[playerid][GroupRank] == 6)
- {
- SetPlayerSkin(playerid, 279);
- OnDuty[playerid] = 1;
- }
- }
- else
- {
- OnDuty[playerid] = 0;
- SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
- SetPlayerColor(playerid, WHITE);
- }
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment