TheProNoob2004

Elite Ainmations

Jul 2nd, 2016
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 253.69 KB | None | 0 0
  1. //includes
  2. #include <a_samp>
  3.  
  4. #include <Dini>
  5.  
  6. #include <dudb>
  7.  
  8. #include <zcmd>
  9.  
  10. #include <streamer>
  11.  
  12. #include <djson>
  13.  
  14. #include <SII>
  15.  
  16. #define MAX_HOUSES 100
  17.  
  18. #define LABELS 0xFFFF00FF
  19.  
  20. #define MAX_GROUPS 20
  21.  
  22. #define NICESKY 0x00C2ECFF
  23.  
  24. #define PINK 0xD52DFFFF
  25.  
  26. #define GROUP_CHAT 0xC0FAFAFF
  27.  
  28. #define MAX_GROUPS 20
  29.  
  30. #define ME 0x00C2ECFF
  31.  
  32. //new Checkpoint[MAX_PLAYERS];
  33.  
  34. new OnDuty[MAX_PLAYERS];
  35.  
  36. new AdminDuty[MAX_PLAYERS];
  37.  
  38. new InBank[MAX_PLAYERS];
  39.  
  40. new InClothesShop[MAX_PLAYERS];
  41.  
  42. new Afk[MAX_PLAYERS];
  43.  
  44. new UnconfirmedSave[MAX_PLAYERS];
  45.  
  46. new Prison1Int, Prison1World;
  47.  
  48. new Float: Prison1X, Float: Prison1Y, Float: Prison1Z;
  49.  
  50. new Float: ClothesExtX, Float: ClothesExtY, Float: ClothesExtZ;
  51.  
  52. new Float: ClothesIntX, Float: ClothesIntY, Float: ClothesIntZ;
  53.  
  54. new ClothesIntID;
  55.  
  56. new Float: BankIntX, Float: BankIntY, Float: BankIntZ;
  57.  
  58. new Float: BankExtX, Float: BankExtY, Float: BankExtZ;
  59.  
  60. new Float: SpawnX, Float: SpawnY, Float: SpawnZ;
  61.  
  62. new BankIntID;
  63.  
  64. new Float: DepartmentIntX, Float: DepartmentIntY, Float: DepartmentIntZ;
  65.  
  66. new Float: DepartmentExtX, Float: DepartmentExtY, Float: DepartmentExtZ;
  67.  
  68. new DepartmentIntID;
  69.  
  70. new InHQ[MAX_PLAYERS];
  71.  
  72. new fishname[0][0] =
  73. {
  74. {"BlueGill"},
  75. {"Bass"},
  76. {"Cod"},
  77. {"Shark"},
  78. {"CatFish"},
  79. {"Polack"},
  80. {"Swordfish"},
  81. {"Lobster"},
  82. {"Crab"},
  83. {"Sunfish"}
  84. };
  85.  
  86. new whalename[0][0] =
  87. {
  88. {"Humpback Whale"},
  89. {"Sperm Whale"},
  90. {"Blue Whale"},
  91. {"Fin Whale"},
  92. {"Killer Whale"}
  93. };
  94.  
  95. new whaletype[0][0] =
  96. {
  97. {"HUGE"},
  98. {"GIGANTIC"},
  99. {"VERY RARE"},
  100. {"VERY LARGE"},
  101. {"EXTREMELY RARE"}
  102. };
  103.  
  104. new Fishing[MAX_PLAYERS];
  105.  
  106. new stock ScoreTimer;
  107.  
  108. new stock HospitalTimer;
  109.  
  110. new stock OneMinuteTimer;
  111.  
  112. new stock OneSecondTimer;
  113.  
  114. new stock FishTimer;
  115.  
  116. new stock UpdateTimer;
  117.  
  118. new stock PickupsTimer;
  119.  
  120. new Text: TextdrawConnect;
  121.  
  122. //new Checkpoint[MAX_PLAYERS];
  123.  
  124. new UnmodifiableVehicles[29] =
  125. {
  126. 581,523,462,521,463,522,461,448,468,586,
  127. 509,481,510,472,473,493,595,484,430,453,
  128. 452,446,454,590,569,537,538,570,449
  129. };
  130.  
  131. new Hood[MAX_VEHICLES];
  132.  
  133. new Trunk[MAX_VEHICLES];
  134.  
  135. new Engine[MAX_VEHICLES];
  136.  
  137. new Lights[MAX_VEHICLES];
  138.  
  139. new realchat = 1;
  140.  
  141. new BigEar[MAX_PLAYERS];
  142.  
  143. new Text:Time1;
  144.  
  145. new Float:svx[MAX_PLAYERS]; // Holds Velocity X
  146.  
  147. new Float:svy[MAX_PLAYERS]; // Holds Velocity Y
  148.  
  149. new Float:svz[MAX_PLAYERS]; // Holds Velocity Z
  150.  
  151. new Float:s11[MAX_PLAYERS]; // This Is What Our Forumula Outputs
  152.  
  153. new s21[MAX_PLAYERS]; // This Is The Output When The Forumula's Ouput Is Round
  154.  
  155. new s3[MAX_PLAYERS][256]; // This Is The Text That Is Displayed To The User
  156.  
  157. new Text:sdisplay[MAX_PLAYERS]; // This Holds The Textdraw's ID
  158.  
  159. new stimer[MAX_PLAYERS]; // This Holds The Timer's ID (Used To Refresh Speed)
  160.  
  161. new Text:Zones[MAX_PLAYERS];
  162.  
  163. new Timeshow[MAX_PLAYERS];
  164.  
  165. //new iSpawnSet[MAX_PLAYERS];
  166.  
  167. //new Checkpoint[MAX_PLAYERS];
  168.  
  169. new WeaponNames[47][] =
  170. {
  171. "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",
  172. "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",
  173. "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",
  174. "43 - Camera", "44 - Nightvision Goggles", "45 - Thermal Goggles", "46 - Parachute"
  175. };
  176.  
  177. new gPlayerLogged[MAX_PLAYERS];
  178.  
  179. new AdminSpawned[MAX_VEHICLES];
  180.  
  181. new SpawnedVehicles;
  182.  
  183. new CarCount;
  184.  
  185. //defines
  186. #define NOTADMIN "You are not an administrator!"
  187.  
  188. #define COL_LIGHTBLUE "{00CED1}"
  189.  
  190. #define COLOR_GREY 0xAFAFAFAA
  191.  
  192. #define COLOR_FADE1 0xE6E6E6E6
  193.  
  194. #define COLOR_FADE2 0xC8C8C8C8
  195.  
  196. #define COLOR_FADE3 0xAAAAAAAA
  197.  
  198. #define COLOR_FADE4 0x8C8C8C8C
  199.  
  200. #define COLOR_FADE5 0x6E6E6E6E
  201.  
  202. #define COLOR_PURPLE 0xCA6DCFAA
  203.  
  204. #define COLOR_WHITE 0xFFFFFFAA
  205.  
  206. #define COLOR_GRAD2 0xBFC0C2FF
  207.  
  208. #define MEDIC 0xFF00FF00
  209.  
  210. #define COLOR_YELLOW 0x00FFFF
  211.  
  212. #define COLOR_RED 0x00FFFF
  213.  
  214. #define DEATH 0xF70000FF
  215.  
  216. #define WIN 0x00FF00FF
  217.  
  218. #define ARMY 0x008431FF
  219.  
  220. #define BLOODS 0xFF0000FF
  221.  
  222. #define LOGIN 0x00FFFFFF
  223.  
  224. #define POLICE 0x0018FFFF
  225.  
  226. #define BALLAS 0xA500FFFF
  227.  
  228. #define DM 0xFFFF00FF
  229.  
  230. #define GROVE 0x00FF00FF
  231.  
  232. #define RED 0xFF0000FF
  233.  
  234. #define MAX_ZONE_NAME 28
  235.  
  236. #define BLUE 0x00FFFFFF
  237.  
  238. #define STATS 0xFF7900FF
  239.  
  240. #define REMINDER 0xFF00FFFF
  241.  
  242. #define NEWBIE 0xFF00FF00
  243.  
  244. #define AFK 0x4A49AFF
  245.  
  246. #define GREEN 0x21DD00FF
  247.  
  248. #define YELLOW 0xFFFF00FF
  249.  
  250. #define ORANGE 0xF97804FF
  251.  
  252. #define LIGHTRED 0xFF8080FF
  253.  
  254. #define PURPLE 0xB360FDFF
  255.  
  256. #define DEPARTMENT_CHAT 0xBDF38BFF
  257.  
  258. #define VIP_CHAT 0xE1FCFFFF
  259.  
  260. #define PLAYER_COLOR 0xFFFFFFFF
  261.  
  262. #define GROUP_CHAT 0xC0FAFAFF
  263.  
  264. #define LIGHTGREEN 0x38FF06FF
  265.  
  266. #define RADIO_CHAT 0xBCC1F3FF
  267.  
  268. #define DARKPINK 0xE100E1FF
  269.  
  270. #define PLAYERCOM 0xD5EAFFFF
  271.  
  272. #define DARKGREEN 0x008040FF
  273.  
  274. #define ANNOUNCEMENT 0xa9c4e4ff
  275.  
  276. #define GREY 0xCECECEFF
  277.  
  278. #define DARKGREY 0x626262FF
  279.  
  280. #define OOC_CHAT 0xAFD9FAFF
  281.  
  282. #define NEWBIE_CHAT 0xDBE1E6FF
  283.  
  284. #define AQUAGREEN 0x03D687FF
  285.  
  286. #define ADMINBLUE 0x99FFFFAA
  287.  
  288. #define ADMINORANGE 0xF6970CAA
  289.  
  290. #define WHITE 0xFFFFFFFF
  291.  
  292. #define BLACK 0x000000FF
  293.  
  294. #define VERSION "v1.0"
  295.  
  296. #define VEHICLES_FILE "Vehicles.json"
  297.  
  298. #pragma unused ret_memcpy
  299.  
  300. #define SERVER_USER_FILE "UserFiles/%s.ini"
  301.  
  302. //forwards
  303. forward OneMinutePublic(playerid);
  304.  
  305. forward OneSecondPublic(playerid);
  306.  
  307. forward SendToAdmins(colour, string[], requireduty);
  308.  
  309. forward UpdatePublic(playerid);
  310.  
  311. forward PurchaseCar(playerid, carid, price, slotid);
  312.  
  313. forward NearByMessage(playerid, colour, string[]);
  314.  
  315. forward PickupMessages();
  316.  
  317. forward FishPublic(playerid);
  318.  
  319. forward WhalePublic(playerid);
  320.  
  321. forward IsPlayerInInvalidNosVehicle(playerid);
  322.  
  323. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  324.  
  325. forward settime(playerid);
  326.  
  327. forward Zones_Update();
  328.  
  329. forward speedometer(playerid); // This Forwards The Timer To Our Function
  330.  
  331. forward SetPlayerRandomSpawn(playerid);
  332.  
  333. //forward SetupPlayerForClassSelection(playerid);
  334.  
  335. forward DynamicWeather();
  336.  
  337. forward NearByMessageEx(playerid, color, string[], Float: range);
  338.  
  339. forward NearByMessage(playerid, colour, string[]);
  340.  
  341. forward GivePlayerSavedWeapons(playerid);
  342.  
  343. forward GivePlayerWeaponEx(playerid, weapon);
  344.  
  345. forward SetPlayerPosEx(playerid, Float: posx, Float: posy, Float: posz, interior, virtualworld);
  346.  
  347. forward SendToAdmins(colour, string[], requireduty);
  348.  
  349. //enums
  350. enum GroupData
  351. {
  352. gIntID,
  353. Float: gIntX,
  354. Float: gIntY,
  355. Float: gIntZ,
  356. gExtID,
  357. Float: gExtX,
  358. Float: gExtY,
  359. Float: gExtZ,
  360. gPickupID,
  361. gName[255],
  362. };
  363.  
  364. new Groups[MAX_GROUPS][GroupData];
  365.  
  366. enum HouseData
  367. {
  368. hInteriorID,
  369. Float: hInteriorX,
  370. Float: hInteriorY,
  371. Float: hInteriorZ,
  372. HousePrice,
  373. hExteriorID,
  374. Float: hExteriorX,
  375. Float: hExteriorY,
  376. Float: hExteriorZ,
  377. HPickupID,
  378. hOwner[255],
  379. };
  380.  
  381. new Houses[MAX_HOUSES][HouseData];
  382.  
  383. enum SAZONE_MAIN { //Betamaster
  384. SAZONE_NAME[28],
  385. Float:SAZONE_AREA[6]
  386. };
  387.  
  388. enum SpecData
  389. {
  390. Float: SpecPlayerX,
  391. Float: SpecPlayerY,
  392. Float: SpecPlayerZ,
  393. SpecPlayerInterior,
  394. Float: SpecPlayerAngle,
  395. SpecPlayerWorld,
  396. SpecSpectatingPlayer,
  397. SpecSpectatingState,
  398. };
  399.  
  400. new Spectator[MAX_PLAYERS][SpecData];
  401.  
  402. new SpawnedHouses;
  403.  
  404. new SpawnedGroups;
  405.  
  406. new Float: OwnedCarSpawnX, Float: OwnedCarSpawnY, Float: OwnedCarSpawnZ;
  407.  
  408. new OwnedCarCount;
  409.  
  410. enum pInfo
  411. {
  412. pAdminLevel,
  413. PendingPay,
  414. CarModDelay,
  415. pCash,
  416. pScore,
  417. pJob,
  418. PlayerSpawn,
  419. Group,
  420. GroupRank,
  421. PendingHandshake,
  422. PendingGroupInvite,
  423. PendingGroup,
  424. PendingHandshakeStyle,
  425. PendingHeal,
  426. pMats,
  427. BankMoney,
  428. Minutes,
  429. Seconds,
  430. FishRod,
  431. CarBeingCarried,
  432. CarPriceCarried,
  433. CarPriceBeingCarried,
  434. GivingSlot,
  435. PendingCarReceival,
  436. Float: CarX,
  437. Float: CarY,
  438. Float: CarZ,
  439. Float: Car2X,
  440. Float: Car2Y,
  441. Float: Car2Z,
  442. Float: Car3X,
  443. Float: Car3Y,
  444. Float: Car3Z,
  445. PlayerCarModel,
  446. PlayerCarModel2,
  447. PlayerCarModel3,
  448. Float: CarZAngle,
  449. Float: Car2ZAngle,
  450. Float: Car3ZAngle,
  451. CarCol1,
  452. CarCol2,
  453. Car2Col1,
  454. Car2Col2,
  455. Car3Col1,
  456. Car3Col2,
  457. CarLinkID,
  458. Car2LinkID,
  459. Car3LinkID,
  460. CarPaintJobID,
  461. Car2PaintJobID,
  462. Car3PaintJobID,
  463. FishBait,
  464. FishLicense,
  465. Fish,
  466. FishWeight,
  467. PrisonDuration,
  468. PrisonID,
  469. InHouse,
  470. WepSlot0,
  471. WepSlot1,
  472. WepSlot2,
  473. WepSlot3,
  474. WepSlot4,
  475. WepSlot5,
  476. WepSlot6,
  477. WepSlot7,
  478. WepSlot8,
  479. WepSlot9,
  480. WepSlot10,
  481. WepSlot11,
  482. WepSlot12,
  483. WepSlot13,
  484. WepSlot14,
  485. WepSlot15,
  486. Skin,
  487. House,
  488. HouseInterior,
  489. HouseExterior,
  490. GroupExterior,
  491. GroupInterior,
  492. Float: hExtX,
  493. Float: hExtY,
  494. Float: hExtZ,
  495. Float: hIntX,
  496. Float: hIntY,
  497. Float: hIntZ,
  498. hIntID,
  499. hExtID,
  500. Float: gExtX,
  501. Float: gExtY,
  502. Float: gExtZ,
  503. Float: gIntX,
  504. Float: gIntY,
  505. Float: gIntZ,
  506. gIntID,
  507. gExtID,
  508. Kills,
  509. Deaths,
  510. Animation,
  511. BeingDraggedBy,
  512. pLevel,
  513. }
  514.  
  515. new PlayerInfo[MAX_PLAYERS][pInfo];
  516.  
  517. enum VehicleData
  518. {
  519. CarModel,
  520. CarColour1,
  521. CarColour2,
  522. CarNos,
  523. CarGroup,
  524. Float: CarPosX,
  525. Float: CarPosY,
  526. Float: CarPosZ,
  527. Float: CarZAngle,
  528. GameID,
  529. };
  530.  
  531. /*new UnmodifiableVehicles[29] =
  532. {
  533. 581,523,462,521,463,522,461,448,468,586,
  534. 509,481,510,472,473,493,595,484,430,453,
  535. 452,446,454,590,569,537,538,570,449
  536. };*/
  537.  
  538. new GlobalWeather;
  539.  
  540. new stock WeatherTimer;
  541.  
  542. new Vehicles[MAX_VEHICLES][VehicleData];
  543.  
  544. new VehicleNames[212][] =
  545. {
  546. "400 - Landstalker", "401 - Bravura", "402 - Buffalo", "403 - Linerunner", "404 - Pereniel", "405 - Sentinel", "406 - Dumper", "407 - Firetruck", "408 - Trashmaster", "409 - Stretch",
  547. "410 - Manana", "411 - Infernus", "412 - Voodoo", "413 - Pony", "414 - Mule", "415 - Cheetah", "416 - Ambulance", "417 - Leviathan", "418 - Moonbeam", "419 - Esperanto", "420 - Taxi",
  548. "421 - Washington", "422 - Bobcat", "423 - Mr Whoopee", "424 - BF Injection", "425 - Hunter", "426 - Premier", "427 - Enforcer", "428 - Securicar", "429 - Banshee", "430 - Predator",
  549. "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",
  550. "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",
  551. "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",
  552. "466 - Glendale", "467 - Oceanic", "468 - Sanchez", "469 - Sparrow", "470 - Patriot", "471 - Quad", "472 - Coastguard", "473 - Dinghy", "474 - Hermes", "475 - Sabre", "476 - Rustler",
  553. "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",
  554. "489 - Rancher", "490 - FBI Rancher", "491 - Virgo", "492 - Greenwood", "493 - Jetmax", "494 - Hotring", "495 - Sandking", "496 - Blista Compact", "497 - Police Maverick",
  555. "498 - Boxville", "499 - Benson", "500 - Mesa", "501 - RC Goblin", "502 - Hotring Racer", "503 - Hotring Racer", "504 - Bloodring Banger", "505 - Rancher", "506 - Super GT",
  556. "507 - Elegant", "508 - Journey", "509 - Bike", "510 - Mountain Bike", "511 - Beagle", "512 - Cropdust", "513 - Stunt", "514 - Tanker", "515 - RoadTrain", "516 - Nebula", "517 - Majestic",
  557. "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",
  558. "529 - Willard", "530 - Forklift", "531 - Tractor", "532 - Combine", "533 - Feltzer", "534 - Remington", "535 - Slamvan", "536 - Blade", "537 - Freight", "538 - Streak", "539 - Vortex", "540 - Vincent",
  559. "541 - Bullet", "542 - Clover", "543 - Sadler", "544 - Firetruck", "545 - Hustler", "546 - Intruder", "547 - Primo", "548 - Cargobob", "549 - Tampa", "550 - Sunrise", "551 - Merit", "552 - Utility",
  560. "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",
  561. "565 - Flash", "566 - Tahoma", "567 - Savanna", "568 - Bandito", "569 - Freight", "570 - Trailer", "571 - Kart", "572 - Mower", "573 - Duneride", "574 - Sweeper", "575 - Broadway",
  562. "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",
  563. "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)",
  564. "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",
  565. "607 - Luggage Trailer B", "608 - Stair Trailer", "609 - Boxville", "610 - Farm Plow", "611 - Utility Trailer"
  566. };
  567.  
  568. //stocks + Extras
  569. stock PutPlayerInTutorial(playerid)
  570. {
  571. ShowPlayerDialog(playerid, 6, DIALOG_STYLE_LIST, "Define OOC", "Out of Control\nOut of Cards\n Out Of Character", "Select", "Cancel");
  572. return 1;
  573. }
  574.  
  575. stock SpawnPlayerAlways(playerid)
  576. {
  577. TogglePlayerSpectating(playerid, false);
  578. SetSpawnInfo(playerid, 0, PlayerInfo[playerid][Skin], SpawnX, SpawnY, SpawnZ, 90, 0, 0, 0, 0, 0, 0);
  579. SpawnPlayer(playerid);
  580. SetPlayerVirtualWorld(playerid, 0);
  581. TogglePlayerControllable(playerid, true);
  582. SetCameraBehindPlayer(playerid);
  583. return 1;
  584. }
  585.  
  586. stock PlayerFacePlayer(playerid, targetplayerid)
  587. {
  588. new Float: Angle;
  589. GetPlayerFacingAngle(playerid, Angle);
  590. SetPlayerFacingAngle(targetplayerid, Angle+180);
  591. return true;
  592. }
  593.  
  594. stock split(const strsrc[], strdest[][], delimiter)
  595. {
  596. new i, li, len, aNum;
  597. while(i <= strlen(strsrc))
  598. {
  599. if(strsrc[i] == delimiter || i == strlen(strsrc))
  600. {
  601. len = strmid(strdest[aNum], strsrc, li, i, 128);
  602. strdest[aNum][len] = 0;
  603. li = i+1;
  604. aNum++;
  605. }
  606. i++;
  607. }
  608. return 1;
  609. }
  610.  
  611. stock RemovePlayerWeapons(playerid)
  612. {
  613. new name[MAX_PLAYER_NAME];
  614. new file[256];
  615. GetPlayerName(playerid, name, sizeof(name));
  616. format(file, sizeof(file), SERVER_USER_FILE, name);
  617. ResetPlayerWeapons(playerid);
  618. dini_IntSet(file, "WepSlot0",PlayerInfo[playerid][WepSlot0] = 0);
  619. dini_IntSet(file, "WepSlot1",PlayerInfo[playerid][WepSlot1] = 0);
  620. dini_IntSet(file, "WepSlot2",PlayerInfo[playerid][WepSlot2] = 0);
  621. dini_IntSet(file, "WepSlot3",PlayerInfo[playerid][WepSlot3] = 0);
  622. dini_IntSet(file, "WepSlot4",PlayerInfo[playerid][WepSlot4] = 0);
  623. dini_IntSet(file, "WepSlot5",PlayerInfo[playerid][WepSlot5] = 0);
  624. dini_IntSet(file, "WepSlot6",PlayerInfo[playerid][WepSlot6] = 0);
  625. dini_IntSet(file, "WepSlot7",PlayerInfo[playerid][WepSlot7] = 0);
  626. dini_IntSet(file, "WepSlot8",PlayerInfo[playerid][WepSlot8] = 0);
  627. dini_IntSet(file, "WepSlot9",PlayerInfo[playerid][WepSlot9] = 0);
  628. dini_IntSet(file, "WepSlot10",PlayerInfo[playerid][WepSlot10] = 0);
  629. dini_IntSet(file, "WepSlot11",PlayerInfo[playerid][WepSlot11] = 0);
  630. dini_IntSet(file, "WepSlot12",PlayerInfo[playerid][WepSlot12] = 0);
  631. dini_IntSet(file, "WepSlot13",PlayerInfo[playerid][WepSlot13] = 0);
  632. dini_IntSet(file, "WepSlot14",PlayerInfo[playerid][WepSlot14] = 0);
  633. dini_IntSet(file, "WepSlot15",PlayerInfo[playerid][WepSlot15] = 0);
  634. return 1;
  635. }
  636.  
  637. stock IsAnOwnedCar(linkid)
  638. {
  639. new tmpcount;
  640. for(new i = 0; i < MAX_PLAYERS; i++)
  641. {
  642. if(PlayerInfo[i][CarLinkID] == linkid) tmpcount++;
  643. if(PlayerInfo[i][Car2LinkID] == linkid) tmpcount++;
  644. if(PlayerInfo[i][Car3LinkID] == linkid) tmpcount++;
  645. }
  646.  
  647. if(tmpcount >= 1)
  648. {
  649. return true;
  650. }
  651. else return false;
  652. }
  653.  
  654. IsKeyJustDown(key, newkeys, oldkeys)
  655. {
  656. if((newkeys & key) && !(oldkeys & key)) return 1;
  657. return 0;
  658. }
  659.  
  660.  
  661. StopLoopingAnimation(playerid)
  662. {
  663. ApplyAnimation(playerid, "CARRY", "crry_prtial", 4.0, 0, 0, 0, 0, 0);
  664. }
  665.  
  666. stock SpawnOwnedCar(playerid, slotid)
  667. {
  668. if(IsPlayerConnected(playerid))
  669. {
  670. switch(slotid)
  671. {
  672. case 1:
  673. {
  674. if(PlayerInfo[playerid][PlayerCarModel] >= 1)
  675. {
  676. if(PlayerInfo[playerid][CarLinkID] >= 1)
  677. {
  678. DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
  679. PlayerInfo[playerid][CarLinkID] = 0;
  680. }
  681.  
  682. CarCount++;
  683. OwnedCarCount++;
  684. 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);
  685. if(GetVehicleModel(PlayerInfo[playerid][CarLinkID]) != PlayerInfo[playerid][PlayerCarModel])
  686. {
  687. DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
  688. PlayerInfo[playerid][CarLinkID] = 0;
  689. 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);
  690. }
  691.  
  692. ChangeVehiclePaintjob(PlayerInfo[playerid][CarLinkID], PlayerInfo[playerid][CarPaintJobID]);
  693. }
  694. }
  695. case 2:
  696. {
  697. if(PlayerInfo[playerid][PlayerCarModel2] >= 1)
  698. {
  699. if(PlayerInfo[playerid][Car2LinkID] >= 1)
  700. {
  701. DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
  702. PlayerInfo[playerid][Car2LinkID] = 0;
  703. }
  704.  
  705. CarCount++;
  706. OwnedCarCount++;
  707. 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);
  708. if(GetVehicleModel(PlayerInfo[playerid][Car2LinkID]) != PlayerInfo[playerid][PlayerCarModel2])
  709. {
  710. DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
  711. PlayerInfo[playerid][Car2LinkID] = 0;
  712. 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);
  713. }
  714.  
  715. ChangeVehiclePaintjob(PlayerInfo[playerid][Car2LinkID], PlayerInfo[playerid][Car2PaintJobID]);
  716. }
  717. }
  718. case 3:
  719. {
  720. if(PlayerInfo[playerid][PlayerCarModel3] >= 1)
  721. {
  722. CarCount++;
  723. OwnedCarCount++;
  724. 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);
  725. if(GetVehicleModel(PlayerInfo[playerid][Car3LinkID]) != PlayerInfo[playerid][PlayerCarModel3])
  726. {
  727. DestroyVehicle(PlayerInfo[playerid][Car3LinkID]);
  728. PlayerInfo[playerid][Car3LinkID] = 0;
  729. 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);
  730. }
  731.  
  732. ChangeVehiclePaintjob(PlayerInfo[playerid][Car3LinkID], PlayerInfo[playerid][Car3PaintJobID]);
  733. }
  734. }
  735. }
  736. }
  737. }
  738.  
  739. stock LoadFiles()
  740. {
  741. InitVehicles();
  742. InitHouses();
  743. InitGroups();
  744. CreatePickup(1247, 23, 627.7214, -571.7225, 17.5726, -1);
  745. Create3DTextLabel("Police Department", LABELS, 627.7214, -571.7225, 17.5726, 100.0, 0, -1);
  746. Create3DTextLabel("/fishingshop, /sellfish", LABELS, 2160.6680, -98.3544, 2.8150, 100.0, 0, -1);
  747. Create3DTextLabel("/vbuy", LABELS, 1230.2791,139.5188,20.3028, 30.0, 0, 0);
  748. CreatePickup(1239, 23, 2111.2566, -98.2426, 2.1183, -1);
  749. CreatePickup(1239, 23, 2160.6680,-98.3544,2.8150, -1);
  750. CreatePickup(1239, 23, 1230.2791,139.5188,20.3028, -1);
  751. Prison1X = dini_Float("Assets.ini", "Prison1X");
  752. Prison1Y = dini_Float("Assets.ini", "Prison1Y");
  753. Prison1Z = dini_Float("Assets.ini", "Prison1Z");
  754. Prison1Int = dini_Int("Assets.ini", "Prison1Int");
  755. Prison1World = dini_Int("Assets.ini", "Prison1World");
  756. OwnedCarSpawnX = dini_Int("Assets.ini", "OwnedCarSpawnX");
  757. OwnedCarSpawnY = dini_Int("Assets.ini", "OwnedCarSpawnY");
  758. OwnedCarSpawnZ = dini_Int("Assets.ini", "OwnedCarSpawnZ");
  759. DepartmentIntX = dini_Int("Assets.ini", "DepartmentIntX");
  760. DepartmentIntY = dini_Int("Assets.ini", "DepartmentIntY");
  761. DepartmentIntZ = dini_Int("Assets.ini", "DepartmentIntZ");
  762. DepartmentExtX = dini_Int("Assets.ini", "DepartmentExtX");
  763. DepartmentExtY = dini_Int("Assets.ini", "DepartmentExtY");
  764. DepartmentExtZ = dini_Int("Assets.ini", "DepartmentExtZ");
  765. DepartmentIntID = dini_Int("Assets.ini", "DepartmentIntID");
  766. BankIntX = dini_Int("Assets.ini", "BankIntX");
  767. BankIntY = dini_Int("Assets.ini", "BankIntY");
  768. BankIntZ = dini_Int("Assets.ini", "BankIntZ");
  769. BankExtX = dini_Int("Assets.ini", "BankExtX");
  770. BankExtY = dini_Int("Assets.ini", "BankExtY");
  771. BankExtZ = dini_Int("Assets.ini", "BankExtZ");
  772. BankIntID = dini_Int("Assets.ini", "BankIntID");
  773. ClothesExtX = dini_Int("Assets.ini", "ClothesExtX");
  774. ClothesExtY = dini_Int("Assets.ini", "ClothesExtY");
  775. ClothesExtZ = dini_Int("Assets.ini", "ClothesExtZ");
  776. ClothesIntX = dini_Int("Assets.ini", "ClothesIntX");
  777. ClothesIntY = dini_Int("Assets.ini", "ClothesIntY");
  778. ClothesIntZ = dini_Int("Assets.ini", "ClothesIntZ");
  779. ClothesIntID = dini_Int("Assets.ini", "ClothesIntID");
  780. CreatePickup(1275, 23, ClothesExtX, ClothesExtY, ClothesExtZ, -1);
  781. Create3DTextLabel("Binco", LABELS, ClothesExtX, ClothesExtY, ClothesExtZ, 100.0, 0, -1);
  782. CreatePickup(1274, 23, BankExtX, BankExtY, BankExtZ, -1);
  783. Create3DTextLabel("SA National Bank", LABELS, BankExtX, BankExtY, BankExtZ, 100.0, 0, -1);
  784. CreatePickup(1275, 23, 207.6361,-100.8324,1005.2578, -1);
  785. CreatePickup(362, 23, 1302.1343,217.0710,19.5547, -1);
  786. Create3DTextLabel("Arms Dealer", LABELS, 1302.1343,217.0710,19.5547, 100.0, 0, -1);
  787. print("Files Loaded!");
  788. return 1;
  789. }
  790.  
  791. stock InitGroups()
  792. {
  793. new FileName[128], GroupName[128];
  794. for(new i = 0; i < MAX_GROUPS; i++)
  795. {
  796. format(FileName, sizeof(FileName), "Groups/Group_%d.ini", i);
  797. format(GroupName, sizeof(GroupName), "Group_%d's HQ", i);
  798. if(fexist(FileName))
  799. {
  800. Groups[i][gIntID] = dini_Int(FileName, "IntID");
  801. Groups[i][gIntX] = dini_Float(FileName, "IntX");
  802. Groups[i][gIntY] = dini_Float(FileName, "IntY");
  803. Groups[i][gIntZ] = dini_Float(FileName, "IntZ");
  804.  
  805. Groups[i][gExtID] = dini_Int(FileName, "ExtID");
  806. Groups[i][gExtX] = dini_Float(FileName, "ExtX");
  807. Groups[i][gExtY] = dini_Float(FileName, "ExtY");
  808. Groups[i][gExtZ] = dini_Float(FileName, "ExtZ");
  809.  
  810. Groups[i][gName] = dini_Get(FileName, "Name");
  811.  
  812. printf("[system] Group %d spawned.", i);
  813.  
  814. Groups[i][gPickupID] = CreateDynamicPickup(1318, 23, Groups[i][gExtX], Groups[i][gExtY], Groups[i][gExtZ], 0, -1, -1, 150.0);
  815.  
  816. Create3DTextLabel(GroupName, LABELS, Groups[i][gExtX], Groups[i][gExtY], Groups[i][gExtZ], 100.0, 0, -1);
  817.  
  818. SpawnedGroups++;
  819. }
  820. }
  821. return 1;
  822. }
  823.  
  824. stock IsVehicleConnected(vehicleid) //By Sacky (edited by Gabriel "Larcius" Cordes)
  825. {
  826. new Float:x1,Float:y1,Float:z1;
  827. GetVehiclePos(vehicleid,x1,y1,z1);
  828. if(x1==0.0 && y1==0.0 && z1==0.0)
  829. {
  830. return 0;
  831. }
  832. return 1;
  833. }
  834.  
  835. stock Float:GetDistanceBetweenPoints(Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2) //By Gabriel "Larcius" Cordes
  836. {
  837. return floatadd(floatadd(floatsqroot(floatpower(floatsub(x1,x2),2)),floatsqroot(floatpower(floatsub(y1,y2),2))),floatsqroot(floatpower(floatsub(z1,z2),2)));
  838. }
  839.  
  840. stock Float:GetDistanceToPoint(playerid,Float:x1,Float:y1,Float:z1) //By Gabriel "Larcius" Cordes
  841. {
  842. if (IsPlayerConnected(playerid))
  843. {
  844. new Float:x2,Float:y2,Float:z2;
  845. GetPlayerPos(playerid,x2,y2,z2);
  846. return GetDistanceBetweenPoints(x1,y1,z1,x2,y2,z2);
  847. }
  848. return INF_FLOAT;
  849. }
  850.  
  851. stock Float:GetDistanceToVehicle(playerid,vehicleid) //By Darkrealm (Edited by Sacky and Gabriel "Larcius" Cordes)
  852. {
  853. if (IsPlayerConnected(playerid) && IsVehicleConnected(vehicleid))
  854. {
  855. new Float:x1,Float:y1,Float:z1;
  856. GetVehiclePos(vehicleid,x1,y1,z1);
  857. return GetDistanceToPoint(playerid,x1,y1,z1);
  858. }
  859. return INF_FLOAT;
  860. }
  861.  
  862. stock GetDistanceBetweenPlayers(playerid, playerid2)
  863. {
  864. new Float:x1,Float:y1,Float:z1,Float:x2,Float:y2,Float:z2;
  865. new Float:dis;
  866. GetPlayerPos(playerid,x1,y1,z1);
  867. GetPlayerPos(playerid2,x2,y2,z2);
  868. dis = floatsqroot((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)+(z2-z1)*(z2-z1));
  869. return floatround(dis);
  870. }
  871.  
  872. stock GetClosestVehicle(playerid)
  873. {
  874. if(IsPlayerConnected(playerid) && IsVehicleConnected(0))
  875. {
  876. new closestvehicle=0;
  877. new Float:closestdist=GetDistanceToVehicle(playerid,0);
  878. for(new vehicleid=0; vehicleid<MAX_VEHICLES; vehicleid++)
  879. {
  880. new Float:dist = GetDistanceToVehicle(playerid,vehicleid);
  881. if ((dist < closestdist))
  882. {
  883. closestdist = dist;
  884. closestvehicle = vehicleid;
  885. }
  886. }
  887. return closestvehicle;
  888. }
  889. return -1;
  890. }
  891.  
  892. stock SaveExistingVehicle(gameid)
  893. {
  894. new Vehicle[16], id;
  895.  
  896. id = GetVehicleFileID(gameid);
  897.  
  898. format(Vehicle, sizeof(Vehicle), "V_%d", id);
  899. if(djIsSet(VEHICLES_FILE, Vehicle))
  900. {
  901. djAutocommit(false);
  902. format(Vehicle, sizeof(Vehicle), "V_%d/PosX", id);
  903. djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosX], true);
  904. format(Vehicle, sizeof(Vehicle), "V_%d/PosY", id);
  905. djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosY], true);
  906. format(Vehicle, sizeof(Vehicle), "V_%d/PosZ", id);
  907. djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosZ], true);
  908. format(Vehicle, sizeof(Vehicle), "V_%d/ZAngle", id);
  909. djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarZAngle], true);
  910. format(Vehicle, sizeof(Vehicle), "V_%d/Model", id);
  911. djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarModel], true);
  912. format(Vehicle, sizeof(Vehicle), "V_%d/Col1", id);
  913. djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarColour1], true);
  914. format(Vehicle, sizeof(Vehicle), "V_%d/Col2", id);
  915. djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarColour2], true);
  916. format(Vehicle, sizeof(Vehicle), "V_%d/Group", id);
  917. djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarGroup], true);
  918. djCommit(VEHICLES_FILE);
  919. djAutocommit(true);
  920.  
  921. printf("[system] Existing Vehicle %d has been saved to %s.", id, VEHICLES_FILE);
  922.  
  923. return true;
  924. }
  925. else
  926. {
  927. return false;
  928. }
  929. }
  930.  
  931. stock InitVehicles()
  932. {
  933. new Vehicle[16];
  934. for(new i = 0; i < MAX_VEHICLES; i++)
  935. {
  936. format(Vehicle, sizeof(Vehicle), "V_%d", i);
  937. if(djIsSet(VEHICLES_FILE, Vehicle))
  938. {
  939. format(Vehicle, sizeof(Vehicle), "V_%d/PosX", i);
  940. Vehicles[i][CarPosX] = djFloat(VEHICLES_FILE, Vehicle, true);
  941. format(Vehicle, sizeof(Vehicle), "V_%d/PosY", i);
  942. Vehicles[i][CarPosY] = djFloat(VEHICLES_FILE, Vehicle, true);
  943. format(Vehicle, sizeof(Vehicle), "V_%d/PosZ", i);
  944. Vehicles[i][CarPosZ] = djFloat(VEHICLES_FILE, Vehicle, true);
  945. format(Vehicle, sizeof(Vehicle), "V_%d/ZAngle", i);
  946. Vehicles[i][CarZAngle] = djFloat(VEHICLES_FILE, Vehicle, true);
  947. format(Vehicle, sizeof(Vehicle), "V_%d/Model", i);
  948. Vehicles[i][CarModel] = djInt(VEHICLES_FILE, Vehicle, true);
  949. format(Vehicle, sizeof(Vehicle), "V_%d/Col1", i);
  950. Vehicles[i][CarColour1] = djInt(VEHICLES_FILE, Vehicle, true);
  951. format(Vehicle, sizeof(Vehicle), "V_%d/Col2", i);
  952. Vehicles[i][CarColour2] = djInt(VEHICLES_FILE, Vehicle, true);
  953. format(Vehicle, sizeof(Vehicle), "V_%d/Group", i);
  954. Vehicles[i][CarGroup] = djInt(VEHICLES_FILE, Vehicle, true);
  955. CarCount++;
  956.  
  957. if(Vehicles[i][CarModel] != 537 && Vehicles[i][CarModel] != 538 && Vehicles[i][CarModel] != 569 && 570 && Vehicles[i][CarModel] != 590)
  958. {
  959. 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);
  960. }
  961. }
  962. }
  963. }
  964.  
  965. public NearByMessage(playerid, colour, string[])
  966. {
  967. new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
  968. for(new i = 0; i < MAX_PLAYERS; i++)
  969. {
  970. if(IsPlayerConnected(i))
  971. {
  972. GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
  973. if(IsPlayerInRangeOfPoint(i, 12, PlayerX, PlayerY, PlayerZ))
  974. {
  975. if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i) && GetPlayerInterior(playerid) == GetPlayerInterior(i))
  976. {
  977. SendClientMessage(i, colour, string);
  978. }
  979. }
  980. }
  981. }
  982. return 1;
  983. }
  984.  
  985. public UpdatePublic(playerid)
  986. {
  987. new name[MAX_PLAYER_NAME];
  988. new file[256];
  989. GetPlayerName(playerid, name, sizeof(name));
  990. format(file, sizeof(file), SERVER_USER_FILE, name);
  991. dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
  992. dini_IntSet(file, "Group", PlayerInfo[playerid][Group]);
  993. dini_IntSet(file, "GroupRank", PlayerInfo[playerid][GroupRank]);
  994. dini_IntSet(file, "Job", PlayerInfo[playerid][pJob]);
  995. dini_IntSet(file, "Skin", PlayerInfo[playerid][Skin]);
  996. dini_IntSet(file, "GivingSlot", PlayerInfo[playerid][GivingSlot]);
  997. dini_IntSet(file, "PendingCarReceival", PlayerInfo[playerid][PendingCarReceival]);
  998. dini_FloatSet(file, "CarX", PlayerInfo[playerid][CarX]);
  999. dini_FloatSet(file, "CarY", PlayerInfo[playerid][CarY]);
  1000. dini_FloatSet(file, "CarZ", PlayerInfo[playerid][CarZ]);
  1001. dini_IntSet(file, "CarPaintJobID", PlayerInfo[playerid][CarPaintJobID]);
  1002. dini_IntSet(file, "PlayerCarModel2", PlayerInfo[playerid][PlayerCarModel2]);
  1003. dini_IntSet(file, "PlayerCarModel3", PlayerInfo[playerid][PlayerCarModel3]);
  1004. dini_FloatSet(file, "Car2ZAngle", PlayerInfo[playerid][Car2ZAngle]);
  1005. dini_FloatSet(file, "Car3ZAngle", PlayerInfo[playerid][Car3ZAngle]);
  1006. dini_IntSet(file, "Car2Col1", PlayerInfo[playerid][Car2Col1]);
  1007. dini_IntSet(file, "Car2Col2", PlayerInfo[playerid][Car2Col2]);
  1008. dini_IntSet(file, "Car3Col1", PlayerInfo[playerid][Car3Col1]);
  1009. dini_IntSet(file, "Car3Col2", PlayerInfo[playerid][Car3Col2]);
  1010. dini_IntSet(file, "CarLinkID", PlayerInfo[playerid][CarLinkID]);
  1011. dini_IntSet(file, "Car2LinkID", PlayerInfo[playerid][Car2LinkID]);
  1012. dini_IntSet(file, "Car3LinkID", PlayerInfo[playerid][Car3LinkID]);
  1013. dini_IntSet(file, "Car2PaintJobID", PlayerInfo[playerid][Car2PaintJobID]);
  1014. dini_IntSet(file, "Car3PaintJobID", PlayerInfo[playerid][Car3PaintJobID]);
  1015. dini_FloatSet(file, "Car2X", PlayerInfo[playerid][Car2X]);
  1016. dini_FloatSet(file, "Car2Y", PlayerInfo[playerid][Car2Y]);
  1017. dini_FloatSet(file, "Car2Z", PlayerInfo[playerid][Car2Z]);
  1018. dini_FloatSet(file, "Car3X", PlayerInfo[playerid][Car3X]);
  1019. dini_FloatSet(file, "Car3Y", PlayerInfo[playerid][Car3Y]);
  1020. dini_FloatSet(file, "Car3Z", PlayerInfo[playerid][Car3Z]);
  1021. dini_FloatSet(file, "CarZAngle", PlayerInfo[playerid][CarZAngle]);
  1022. dini_IntSet(file, "PlayerCarModel", PlayerInfo[playerid][PlayerCarModel]);
  1023. dini_IntSet(file, "CarCol1", PlayerInfo[playerid][CarCol1]);
  1024. dini_IntSet(file, "CarCol2", PlayerInfo[playerid][CarCol2]);
  1025. dini_IntSet(file, "Fish", PlayerInfo[playerid][Fish]);
  1026. dini_IntSet(file, "FishBait", PlayerInfo[playerid][FishBait]);
  1027. dini_IntSet(file, "FishLicense", PlayerInfo[playerid][FishLicense]);
  1028. dini_IntSet(file, "FishRod", PlayerInfo[playerid][FishRod]);
  1029. dini_IntSet(file, "FishWeight", PlayerInfo[playerid][FishWeight]);
  1030. dini_IntSet(file, "Mats", PlayerInfo[playerid][pMats]);
  1031. dini_IntSet(file, "BankMoney", PlayerInfo[playerid][BankMoney]);
  1032. dini_IntSet(file, "Minutes", PlayerInfo[playerid][Minutes]);
  1033. dini_IntSet(file, "Seconds", PlayerInfo[playerid][Seconds]);
  1034. dini_IntSet(file, "Spawn", PlayerInfo[playerid][PlayerSpawn]);
  1035. dini_IntSet(file, "Kills", PlayerInfo[playerid][Kills]);
  1036. dini_IntSet(file, "Deaths", PlayerInfo[playerid][Deaths]);
  1037. dini_IntSet(file, "Amination", PlayerInfo[playerid][Animation]);
  1038. dini_IntSet(file, "House", PlayerInfo[playerid][House]);
  1039. dini_IntSet(file, "BeingDraggedBy", PlayerInfo[playerid][BeingDraggedBy]);
  1040. dini_IntSet(file, "WepSlot0", PlayerInfo[playerid][WepSlot0]);
  1041. dini_IntSet(file, "WepSlot1", PlayerInfo[playerid][WepSlot1]);
  1042. dini_IntSet(file, "WepSlot2", PlayerInfo[playerid][WepSlot2]);
  1043. dini_IntSet(file, "WepSlot3", PlayerInfo[playerid][WepSlot3]);
  1044. dini_IntSet(file, "WepSlot4", PlayerInfo[playerid][WepSlot4]);
  1045. dini_IntSet(file, "WepSlot5", PlayerInfo[playerid][WepSlot5]);
  1046. dini_IntSet(file, "WepSlot6", PlayerInfo[playerid][WepSlot6]);
  1047. dini_IntSet(file, "WepSlot7", PlayerInfo[playerid][WepSlot7]);
  1048. dini_IntSet(file, "WepSlot8", PlayerInfo[playerid][WepSlot8]);
  1049. dini_IntSet(file, "WepSlot9", PlayerInfo[playerid][WepSlot9]);
  1050. dini_IntSet(file, "WepSlot10", PlayerInfo[playerid][WepSlot10]);
  1051. dini_IntSet(file, "WepSlot11", PlayerInfo[playerid][WepSlot11]);
  1052. dini_IntSet(file, "WepSlot12", PlayerInfo[playerid][WepSlot12]);
  1053. dini_IntSet(file, "WepSlot13", PlayerInfo[playerid][WepSlot13]);
  1054. dini_IntSet(file, "WepSlot14", PlayerInfo[playerid][WepSlot14]);
  1055. dini_IntSet(file, "WepSlot15", PlayerInfo[playerid][WepSlot15]);
  1056. dini_IntSet(file, "Level", PlayerInfo[playerid][pLevel]);
  1057. dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
  1058. dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
  1059. return 1;
  1060. }
  1061.  
  1062. public PurchaseCar(playerid, carid, price, slotid)
  1063. {
  1064. new string[128];
  1065. if(carid < 400 || carid > 611)
  1066. {
  1067. SendClientMessage(playerid, WHITE, "Valid car IDs start from 400, ending at 611.");
  1068. return 1;
  1069. }
  1070. else
  1071. {
  1072. if(PlayerInfo[playerid][pCash] >= price)
  1073. {
  1074. switch(slotid)
  1075. {
  1076. case 1:
  1077. {
  1078. if(PlayerInfo[playerid][PlayerCarModel] > 0)
  1079. {
  1080. SendClientMessage(playerid, WHITE, "You already have a vehicle in slot 1, /abandoncar first.");
  1081. }
  1082. else
  1083. {
  1084. PlayerInfo[playerid][pCash] -= price;
  1085. PlayerInfo[playerid][CarX] = OwnedCarSpawnX;
  1086. PlayerInfo[playerid][CarY] = OwnedCarSpawnY;
  1087. PlayerInfo[playerid][CarZ] = OwnedCarSpawnZ;
  1088. PlayerInfo[playerid][PlayerCarModel] = carid;
  1089. PlayerInfo[playerid][CarCol1] = 0;
  1090. PlayerInfo[playerid][CarCol2] = 0;
  1091. SpawnOwnedCar(playerid, 1);
  1092. }
  1093. }
  1094. case 2:
  1095. {
  1096. if(PlayerInfo[playerid][PlayerCarModel2] > 0)
  1097. {
  1098. SendClientMessage(playerid, WHITE, "You already have a vehicle in slot 2, /abandoncar first.");
  1099. }
  1100. else
  1101. {
  1102. PlayerInfo[playerid][pCash] -= price;
  1103. PlayerInfo[playerid][Car2X] = OwnedCarSpawnX;
  1104. PlayerInfo[playerid][Car2Y] = OwnedCarSpawnY;
  1105. PlayerInfo[playerid][Car2Z] = OwnedCarSpawnZ;
  1106. PlayerInfo[playerid][PlayerCarModel2] = carid;
  1107. PlayerInfo[playerid][Car2Col1] = 0;
  1108. PlayerInfo[playerid][Car2Col2] = 0;
  1109. SpawnOwnedCar(playerid, 2);
  1110. }
  1111. }
  1112. case 3:
  1113. {
  1114. if(PlayerInfo[playerid][PlayerCarModel3] > 0)
  1115. {
  1116. SendClientMessage(playerid, WHITE, "You already have a vehicle in slot 3, /abandoncar first.");
  1117. }
  1118. else
  1119. {
  1120. PlayerInfo[playerid][pCash] -= price;
  1121. PlayerInfo[playerid][Car3X] = OwnedCarSpawnX;
  1122. PlayerInfo[playerid][Car3Y] = OwnedCarSpawnY;
  1123. PlayerInfo[playerid][Car3Z] = OwnedCarSpawnZ;
  1124. PlayerInfo[playerid][PlayerCarModel3] = carid;
  1125. PlayerInfo[playerid][Car3Col1] = 0;
  1126. PlayerInfo[playerid][Car3Col2] = 0;
  1127. SpawnOwnedCar(playerid, 3);
  1128. }
  1129. }
  1130. }
  1131. }
  1132. else
  1133. {
  1134. format(string, sizeof(string), "You must have $%d to purchase this vehicle.", price);
  1135. SendClientMessage(playerid, WHITE, string);
  1136. }
  1137. }
  1138. return 1;
  1139. }
  1140.  
  1141. public FishPublic(playerid)
  1142. {
  1143. new string[128];
  1144. new fishweight = 10+random(150);
  1145. new fish = random(sizeof(fishname));
  1146. format(string, sizeof(string), "You have caught a %dlb %s, and have added it to your fish bucket!", fishweight, fishname[fish]);
  1147. PlayerInfo[playerid][FishBait] -= 1;
  1148. PlayerInfo[playerid][FishWeight] += fishweight;
  1149. PlayerInfo[playerid][Fish] += 1;
  1150. SendClientMessage(playerid, WHITE, string);
  1151. TogglePlayerControllable(playerid, true);
  1152. Fishing[playerid] = 0;
  1153. ClearAnimations(playerid);
  1154. StopLoopingAnimation(playerid);
  1155. RemovePlayerAttachedObject(playerid,0);
  1156. return 1;
  1157. }
  1158.  
  1159. public WhalePublic(playerid)
  1160. {
  1161. new string[128];
  1162. new fishweight = 10000+random(100000);
  1163. new whale = random(sizeof(whalename));
  1164. new whale2 = random(sizeof(whaletype));
  1165. format(string, sizeof(string), "You have caught a %d %d weighing a MASSIVE %slbs!", whaletype[whale2], whalename[whale], fishweight);
  1166. PlayerInfo[playerid][FishWeight] += fishweight;
  1167. SendClientMessage(playerid, WHITE, string);
  1168. TogglePlayerControllable(playerid, true);
  1169. Fishing[playerid] = 0;
  1170. PlayerInfo[playerid][Fish] += 1;
  1171. PlayerInfo[playerid][FishBait] -= 1;
  1172. ClearAnimations(playerid);
  1173. StopLoopingAnimation(playerid);
  1174. RemovePlayerAttachedObject(playerid,0);
  1175. return 1;
  1176. }
  1177.  
  1178.  
  1179. public IsPlayerInInvalidNosVehicle(playerid)
  1180. {
  1181. new carid = GetPlayerVehicleID(playerid);
  1182. new carmodel = GetVehicleModel(carid);
  1183. for (new i = 0; i < sizeof(UnmodifiableVehicles); i++)
  1184. {
  1185. if(carmodel == UnmodifiableVehicles[i]) return 1;
  1186. }
  1187. return 0;
  1188. }
  1189.  
  1190. stock IsAHelicopter(vehicleid)
  1191. {
  1192. new model = GetVehicleModel(vehicleid);
  1193.  
  1194. 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)
  1195. {
  1196. return 1;
  1197. }
  1198. else
  1199. {
  1200. return 0;
  1201. }
  1202. }
  1203.  
  1204. stock SpectatorRefresh(playerid, otherplayer)
  1205. {
  1206. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  1207. {
  1208. if(otherplayer == INVALID_PLAYER_ID)
  1209. {
  1210. SetPlayerInterior(playerid, Spectator[playerid][SpecPlayerInterior]);
  1211. SetPlayerPos(playerid, Spectator[playerid][SpecPlayerX], Spectator[playerid][SpecPlayerY], Spectator[playerid][SpecPlayerZ]);
  1212. SetPlayerVirtualWorld(playerid, Spectator[playerid][SpecPlayerWorld]);
  1213. SetPlayerFacingAngle(playerid, Spectator[playerid][SpecPlayerAngle]);
  1214.  
  1215. SetCameraBehindPlayer(playerid);
  1216.  
  1217. Spectator[playerid][SpecSpectatingPlayer] = -1;
  1218. Spectator[playerid][SpecSpectatingState] = -1;
  1219.  
  1220. TogglePlayerControllable(playerid, true);
  1221.  
  1222. SendClientMessage(playerid, WHITE, "You are no longer spectating; the specified player ID is unavailable.");
  1223.  
  1224. }
  1225. else
  1226. {
  1227. if(GetPlayerInterior(playerid) != GetPlayerInterior(otherplayer))
  1228. {
  1229. SetPlayerInterior(playerid, GetPlayerInterior(otherplayer));
  1230. Spectator[playerid][SpecSpectatingState] = 0;
  1231. }
  1232.  
  1233. if(GetPlayerVirtualWorld(playerid) != GetPlayerVirtualWorld(otherplayer))
  1234. {
  1235. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(otherplayer));
  1236. Spectator[playerid][SpecSpectatingState] = 0;
  1237. }
  1238.  
  1239. if(IsPlayerInAnyVehicle(otherplayer) == 1 && Spectator[playerid][SpecSpectatingState] != 1)
  1240. {
  1241. PlayerSpectateVehicle(playerid, GetPlayerVehicleID(otherplayer));
  1242. Spectator[playerid][SpecSpectatingState] = 1;
  1243. }
  1244. else if(!IsPlayerInAnyVehicle(otherplayer) && Spectator[playerid][SpecSpectatingState] != 2)
  1245. {
  1246. PlayerSpectatePlayer(playerid, otherplayer);
  1247. Spectator[playerid][SpecSpectatingState] = 2;
  1248. }
  1249. }
  1250. }
  1251. }
  1252.  
  1253. stock IsNumeric(string[]) { for (new i = 0, j = strlen(string); i < j; i++) if (string[i] > '9' || string[i] < '0') return 0; return 1; }
  1254.  
  1255. stock findAvailableVehicleID() {
  1256. for(new i = 0; i < MAX_VEHICLES; i++) {
  1257. if(Vehicles[i][CarModel] == 0) {
  1258. return i;
  1259. }
  1260. }
  1261.  
  1262. return -1;
  1263. }
  1264.  
  1265. stock GivePlayerHealth(playerid, Float: Health)
  1266. {
  1267. new Float:health; GetPlayerHealth(playerid,health);
  1268. SetPlayerHealth(playerid, health+Health);
  1269. }
  1270.  
  1271. stock GetName(playerid)
  1272. {
  1273. new name[MAX_PLAYER_NAME];
  1274.  
  1275. if(IsPlayerConnected(playerid))
  1276. {
  1277. GetPlayerName(playerid, name, sizeof(name));
  1278. }
  1279. return name;
  1280. }
  1281.  
  1282. stock sscanf(string[], format[], {Float,_}:...)
  1283. {
  1284. #if defined isnull
  1285. if (isnull(string))
  1286. #else
  1287. if (string[0] == 0 || (string[0] == 1 && string[1] == 0))
  1288. #endif
  1289. {
  1290. return format[0];
  1291. }
  1292. #pragma tabsize 4
  1293. new
  1294. formatPos = 0,
  1295. stringPos = 0,
  1296. paramPos = 2,
  1297. paramCount = numargs(),
  1298. delim = ' ';
  1299. while (string[stringPos] && string[stringPos] <= ' ')
  1300. {
  1301. stringPos++;
  1302. }
  1303. while (paramPos < paramCount && string[stringPos])
  1304. {
  1305. switch (format[formatPos++])
  1306. {
  1307. case '\0':
  1308. {
  1309. return 0;
  1310. }
  1311. case 'i', 'd':
  1312. {
  1313. new
  1314. neg = 1,
  1315. num = 0,
  1316. ch = string[stringPos];
  1317. if (ch == '-')
  1318. {
  1319. neg = -1;
  1320. ch = string[++stringPos];
  1321. }
  1322. do
  1323. {
  1324. stringPos++;
  1325. if ('0' <= ch <= '9')
  1326. {
  1327. num = (num * 10) + (ch - '0');
  1328. }
  1329. else
  1330. {
  1331. return -1;
  1332. }
  1333. }
  1334. while ((ch = string[stringPos]) > ' ' && ch != delim);
  1335. setarg(paramPos, 0, num * neg);
  1336. }
  1337. case 'h', 'x':
  1338. {
  1339. new
  1340. num = 0,
  1341. ch = string[stringPos];
  1342. do
  1343. {
  1344. stringPos++;
  1345. switch (ch)
  1346. {
  1347. case 'x', 'X':
  1348. {
  1349. num = 0;
  1350. continue;
  1351. }
  1352. case '0' .. '9':
  1353. {
  1354. num = (num << 4) | (ch - '0');
  1355. }
  1356. case 'a' .. 'f':
  1357. {
  1358. num = (num << 4) | (ch - ('a' - 10));
  1359. }
  1360. case 'A' .. 'F':
  1361. {
  1362. num = (num << 4) | (ch - ('A' - 10));
  1363. }
  1364. default:
  1365. {
  1366. return -1;
  1367. }
  1368. }
  1369. }
  1370. while ((ch = string[stringPos]) > ' ' && ch != delim);
  1371. setarg(paramPos, 0, num);
  1372. }
  1373. case 'c':
  1374. {
  1375. setarg(paramPos, 0, string[stringPos++]);
  1376. }
  1377. case 'f':
  1378. {
  1379. setarg(paramPos, 0, _:floatstr(string[stringPos]));
  1380. }
  1381. case 'p':
  1382. {
  1383. delim = format[formatPos++];
  1384. continue;
  1385. }
  1386. case '\'':
  1387. {
  1388. new
  1389. end = formatPos - 1,
  1390. ch;
  1391. while ((ch = format[++end]) && ch != '\'') {}
  1392. if (!ch)
  1393. {
  1394. return -1;
  1395. }
  1396. format[end] = '\0';
  1397. if ((ch = strfind(string, format[formatPos], false, stringPos)) == -1)
  1398. {
  1399. if (format[end + 1])
  1400. {
  1401. return -1;
  1402. }
  1403. return 0;
  1404. }
  1405. format[end] = '\'';
  1406. stringPos = ch + (end - formatPos);
  1407. formatPos = end + 1;
  1408. }
  1409. case 'u':
  1410. {
  1411. new
  1412. end = stringPos - 1,
  1413. id = 0,
  1414. bool:num = true,
  1415. ch;
  1416. while ((ch = string[++end]) && ch != delim)
  1417. {
  1418. if (num)
  1419. {
  1420. if ('0' <= ch <= '9')
  1421. {
  1422. id = (id * 10) + (ch - '0');
  1423. }
  1424. else
  1425. {
  1426. num = false;
  1427. }
  1428. }
  1429. }
  1430. if (num && IsPlayerConnected(id))
  1431. {
  1432. setarg(paramPos, 0, id);
  1433. }
  1434. else
  1435. {
  1436. #if !defined foreach
  1437. #define foreach(%1,%2) for (new %2 = 0; %2 < MAX_PLAYERS; %2++) if (IsPlayerConnected(%2))
  1438. #define __SSCANF_FOREACH__
  1439. #endif
  1440. string[end] = '\0';
  1441. num = false;
  1442. new
  1443. name[MAX_PLAYER_NAME];
  1444. id = end - stringPos;
  1445. foreach(Player, playerid)
  1446. {
  1447. GetPlayerName(playerid, name, sizeof (name));
  1448. if (!strcmp(name, string[stringPos], true, id))
  1449. {
  1450. setarg(paramPos, 0, playerid);
  1451. num = true;
  1452. break;
  1453. }
  1454. }
  1455. if (!num)
  1456. {
  1457. setarg(paramPos, 0, INVALID_PLAYER_ID);
  1458. }
  1459. string[end] = ch;
  1460. #if defined __SSCANF_FOREACH__
  1461. #undef foreach
  1462. #undef __SSCANF_FOREACH__
  1463. #endif
  1464. }
  1465. stringPos = end;
  1466. }
  1467. case 's', 'z':
  1468. {
  1469. new
  1470. i = 0,
  1471. ch;
  1472. if (format[formatPos])
  1473. {
  1474. while ((ch = string[stringPos++]) && ch != delim)
  1475. {
  1476. setarg(paramPos, i++, ch);
  1477. }
  1478. if (!i)
  1479. {
  1480. return -1;
  1481. }
  1482. }
  1483. else
  1484. {
  1485. while ((ch = string[stringPos++]))
  1486. {
  1487. setarg(paramPos, i++, ch);
  1488. }
  1489. }
  1490. stringPos--;
  1491. setarg(paramPos, i, '\0');
  1492. }
  1493. default:
  1494. {
  1495. continue;
  1496. }
  1497. }
  1498. while (string[stringPos] && string[stringPos] != delim && string[stringPos] > ' ')
  1499. {
  1500. stringPos++;
  1501. }
  1502. while (string[stringPos] && (string[stringPos] == delim || string[stringPos] <= ' '))
  1503. {
  1504. stringPos++;
  1505. }
  1506. paramPos++;
  1507. }
  1508. do
  1509. {
  1510. if ((delim = format[formatPos++]) > ' ')
  1511. {
  1512. if (delim == '\'')
  1513. {
  1514. while ((delim = format[formatPos++]) && delim != '\'') {}
  1515. }
  1516. else if (delim != 'z')
  1517. {
  1518. return delim;
  1519. }
  1520. }
  1521. }
  1522. while (delim > ' ');
  1523. return 0;
  1524. }
  1525.  
  1526. main()
  1527. {
  1528. print("\n----------------------------------");
  1529. print(" Elite Roleplay by RBCRP");
  1530. print("----------------------------------\n");
  1531. }
  1532.  
  1533. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  1534. {
  1535. if(IsPlayerConnected(playerid))
  1536. {
  1537. new Float:posx, Float:posy, Float:posz;
  1538. new Float:oldposx, Float:oldposy, Float:oldposz;
  1539. new Float:tempposx, Float:tempposy, Float:tempposz;
  1540. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  1541. //radi = 2.0; //Trigger Radius
  1542. for(new i = 0; i < MAX_PLAYERS; i++)
  1543. {
  1544. if(IsPlayerConnected(i))
  1545. {
  1546. if(!BigEar[i])
  1547. {
  1548. GetPlayerPos(i, posx, posy, posz);
  1549. tempposx = (oldposx -posx);
  1550. tempposy = (oldposy -posy);
  1551. tempposz = (oldposz -posz);
  1552. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  1553. new playerworld, player2world;
  1554. playerworld = GetPlayerVirtualWorld(playerid);
  1555. player2world = GetPlayerVirtualWorld(i);
  1556. if(playerworld == player2world)
  1557. {
  1558. if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  1559. {
  1560. SendClientMessage(i, col1, string);
  1561. }
  1562. else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  1563. {
  1564. SendClientMessage(i, col2, string);
  1565. }
  1566. else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  1567. {
  1568. SendClientMessage(i, col3, string);
  1569. }
  1570. else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  1571. {
  1572. SendClientMessage(i, col4, string);
  1573. }
  1574. else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  1575. {
  1576. SendClientMessage(i, col5, string);
  1577. }
  1578. }
  1579. }
  1580. else
  1581. {
  1582. SendClientMessage(i, col1, string);
  1583. }
  1584. }
  1585. }
  1586. }//not connected
  1587. return 1;
  1588. }
  1589.  
  1590. stock InitHouses()
  1591. {
  1592. new FileName[128], HouseName[128];
  1593. for(new i = 0; i < MAX_HOUSES; i++)
  1594. {
  1595. format(FileName, sizeof(FileName), "Houses/House_%d.ini", i);
  1596. format(HouseName, sizeof(HouseName), "House_%d", i);
  1597. if(fexist(FileName))
  1598. {
  1599. Houses[i][hInteriorID] = dini_Int(FileName, "InteriorID");
  1600. Houses[i][hInteriorX] = dini_Float(FileName, "InteriorX");
  1601. Houses[i][hInteriorY] = dini_Float(FileName, "InteriorY");
  1602. Houses[i][hInteriorZ] = dini_Float(FileName, "InteriorZ");
  1603.  
  1604. Houses[i][HousePrice] = dini_Int(FileName, "HousePrice");
  1605.  
  1606. Houses[i][hExteriorID] = dini_Int(FileName, "ExteriorID");
  1607. Houses[i][hExteriorX] = dini_Float(FileName, "ExteriorX");
  1608. Houses[i][hExteriorY] = dini_Float(FileName, "ExteriorY");
  1609. Houses[i][hExteriorZ] = dini_Float(FileName, "ExteriorZ");
  1610.  
  1611. Houses[i][hOwner] = dini_Get(FileName, "Owner");
  1612.  
  1613. if(strcmp(Houses[i][hOwner], "Nobody", true) == 0)
  1614. {
  1615. Houses[i][HPickupID] = CreateDynamicPickup(1273, 23, Houses[i][hExteriorX], Houses[i][hExteriorY], Houses[i][hExteriorZ], 0, -1, -1, 150.0);
  1616. }
  1617. else
  1618. {
  1619. Houses[i][HPickupID] = CreateDynamicPickup(1272, 23, Houses[i][hExteriorX], Houses[i][hExteriorY], Houses[i][hExteriorZ], 0, -1, -1, 150.0);
  1620. }
  1621.  
  1622. Create3DTextLabel(HouseName, LABELS, Houses[i][hExteriorX], Houses[i][hExteriorY], Houses[i][hExteriorZ], 100.0, 0, 0);
  1623.  
  1624. SpawnedHouses++;
  1625. }
  1626. }
  1627. return 1;
  1628. }
  1629.  
  1630. public PickupMessages()
  1631. {
  1632. new string[128], Float: playX, Float: playY, Float: playZ;
  1633. for(new i = 0; i < MAX_PLAYERS; i++)
  1634. {
  1635. if(!IsPlayerInRangeOfPoint(i, 9, playX, playY, playZ))
  1636. {
  1637. if(IsPlayerConnected(i))
  1638. {
  1639. for(new h = 0; h < sizeof(Houses); h++)
  1640. {
  1641. if(IsPlayerInRangeOfPoint(i, 5, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ]))
  1642. {
  1643. if(GetPlayerVirtualWorld(i) == 0)
  1644. {
  1645. if(strcmp(Houses[h][hOwner], "Nobody", true) == 0)
  1646. {
  1647. if(Houses[h][HousePrice] == -1)
  1648. {
  1649. format(string, sizeof(string), "~w~ House ~y~ %d ~n~ ~w~ Unavailable.", h, Houses[h][HousePrice]);
  1650. GameTextForPlayer(i, string, 3500, 3);
  1651. }
  1652. else
  1653. {
  1654. format(string, sizeof(string), "~w~ House ~y~ %d ~n~ Available to buy for %d (/buyhouse).", h, Houses[h][HousePrice]);
  1655. GameTextForPlayer(i, string, 3500, 3);
  1656. }
  1657. }
  1658. else
  1659. {
  1660. 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]);
  1661. GameTextForPlayer(i, string, 3500, 3);
  1662. }
  1663. }
  1664. }
  1665. }
  1666. }
  1667. if(IsPlayerInRangeOfPoint(i, 9, 2111.2566,-98.2426,2.1183))
  1668. {
  1669. if(Fishing[i] == 0)
  1670. {
  1671. 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~)");
  1672. GameTextForPlayer(i, string, 3500, 3);
  1673. }
  1674. }
  1675. if(IsPlayerInRangeOfPoint(i, 5, 1302.1343,217.0710,19.5547))
  1676. {
  1677. GameTextForPlayer(i, "~r~/joinjob armsdealer", 3000, 4);
  1678. }
  1679. }
  1680. }
  1681. return 1;
  1682. }
  1683.  
  1684. public OnGameModeInit()
  1685. {
  1686. UpdateTimer = SetTimer("UpdatePublic", 5000, true);
  1687. djson_GameModeInit();
  1688. LoadFiles();
  1689. PickupsTimer = SetTimer("PickupMessages", 1500, true);
  1690. TextdrawConnect = TextDrawCreate(5.000000,435.000000,"Elite Roleplay | Owner: Axel_Petrov | Website: Null");
  1691. TextDrawAlignment(TextdrawConnect, 0);
  1692. TextDrawBackgroundColor(TextdrawConnect, 0x000000ff);
  1693. TextDrawFont(TextdrawConnect, 2);
  1694. TextDrawLetterSize(TextdrawConnect, 0.2,1.0);
  1695. TextDrawColor(TextdrawConnect, 0xffffffff);
  1696. TextDrawSetOutline(TextdrawConnect, 1);
  1697. TextDrawSetProportional(TextdrawConnect, 1);
  1698. TextDrawSetShadow(TextdrawConnect, 1);
  1699.  
  1700. SetTimer("settime",1000,true);
  1701.  
  1702. Time1 = TextDrawCreate(500.000000,15.000000,"--");
  1703.  
  1704. TextDrawFont(Time1,3);
  1705. TextDrawBackgroundColor(Time1, 0x000000AA);
  1706. TextDrawLetterSize(Time1,0.400000, 0.999999);
  1707. TextDrawSetOutline(Time1,1);
  1708. TextDrawSetShadow(Time1,0);
  1709. TextDrawTextSize(Time1, 606.000000, -2.000000);
  1710. TextDrawFont(Time1, 3);
  1711. TextDrawColor(Time1,POLICE);
  1712. TextDrawUseBox(Time1, 0);
  1713. TextDrawBoxColor(Time1, 0x00000076);
  1714.  
  1715. SetTimer("settime",1000,true);
  1716.  
  1717. SetTimer("Zones_Update", 500, 1);
  1718.  
  1719. for(new i=0; i<MAX_PLAYERS; i++){
  1720. Zones[i] = TextDrawCreate(500.000000, 105.000000, "_");
  1721. TextDrawBackgroundColor(Zones[i], 255);
  1722. TextDrawFont(Zones[i], 1);
  1723. TextDrawLetterSize(Zones[i], 0.200000, 0.999999);
  1724. TextDrawColor(Zones[i], -1);
  1725. TextDrawSetOutline(Zones[i], 0);
  1726. TextDrawSetProportional(Zones[i], 1);
  1727. TextDrawSetShadow(Zones[i], 1);
  1728. TextDrawUseBox(Zones[i], 1);
  1729. TextDrawBoxColor(Zones[i], 0x00000076);
  1730. TextDrawTextSize(Zones[i], 606.000000, -2.000000);}
  1731.  
  1732. ShowPlayerMarkers(1);
  1733. ShowNameTags(1);
  1734. EnableStuntBonusForAll(1);
  1735. DisableInteriorEnterExits();
  1736. ManualVehicleEngineAndLights();
  1737.  
  1738. AddPlayerClass(0,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1);
  1739. AddPlayerClass(1,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
  1740. AddPlayerClass(299,1958.3783,1343.1572,15.3746,269.1425,0,0,24,300,-1,-1);
  1741.  
  1742. WeatherTimer = SetTimer("DynamicWeather", 7200000, true);
  1743. SetGameModeText("EL:RP v1.11");
  1744. DynamicWeather();
  1745. return 1;
  1746. }
  1747.  
  1748. public DynamicWeather()
  1749. {
  1750. GlobalWeather = random(17);
  1751. SetWeather(GlobalWeather);
  1752. return 1;
  1753. }
  1754.  
  1755. public NearByMessageEx(playerid, color, string[], Float: range)
  1756. {
  1757. new Float: PlayerX, Float: PlayerY, Float: PlayerZ;
  1758. for(new i = 0; i < MAX_PLAYERS; i++)
  1759. {
  1760. if(IsPlayerConnected(i))
  1761. {
  1762. GetPlayerPos(playerid, PlayerX, PlayerY, PlayerZ);
  1763. if(IsPlayerInRangeOfPoint(i, range, PlayerX, PlayerY, PlayerZ))
  1764. {
  1765. if(GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
  1766. {
  1767. SendClientMessage(i, color, string);
  1768. }
  1769. }
  1770. }
  1771. }
  1772. }
  1773.  
  1774. public GivePlayerWeaponEx(playerid, weapon)
  1775. {
  1776. switch(weapon)
  1777. {
  1778. case 0, 1:
  1779. {
  1780. PlayerInfo[playerid][WepSlot0] = weapon;
  1781. GivePlayerWeapon(playerid, weapon, 99999);
  1782. }
  1783. case 2, 3, 4, 5, 6, 7, 8, 9:
  1784. {
  1785. PlayerInfo[playerid][WepSlot1] = weapon;
  1786. GivePlayerWeapon(playerid, weapon, 99999);
  1787. }
  1788. case 22, 23, 24:
  1789. {
  1790. PlayerInfo[playerid][WepSlot2] = weapon;
  1791. GivePlayerWeapon(playerid, weapon, 99999);
  1792. }
  1793. case 25, 26, 27:
  1794. {
  1795. PlayerInfo[playerid][WepSlot3] = weapon;
  1796. GivePlayerWeapon(playerid, weapon, 99999);
  1797. }
  1798. case 28, 29, 32:
  1799. {
  1800. PlayerInfo[playerid][WepSlot4] = weapon;
  1801. GivePlayerWeapon(playerid, weapon, 99999);
  1802. }
  1803. case 30, 31:
  1804. {
  1805. PlayerInfo[playerid][WepSlot5] = weapon;
  1806. GivePlayerWeapon(playerid, weapon, 99999);
  1807. }
  1808. case 33, 34:
  1809. {
  1810. PlayerInfo[playerid][WepSlot6] = weapon;
  1811. GivePlayerWeapon(playerid, weapon, 99999);
  1812. }
  1813. case 35, 36, 37, 38:
  1814. {
  1815. PlayerInfo[playerid][WepSlot7] = weapon;
  1816. GivePlayerWeapon(playerid, weapon, 99999);
  1817. }
  1818. case 16, 17, 18, 39:
  1819. {
  1820. PlayerInfo[playerid][WepSlot8] = weapon;
  1821. GivePlayerWeapon(playerid, weapon, 99999);
  1822. }
  1823. case 41, 42, 43:
  1824. {
  1825. PlayerInfo[playerid][WepSlot9] = weapon;
  1826. GivePlayerWeapon(playerid, weapon, 99999);
  1827. }
  1828. case 10, 11, 12, 13, 14, 15:
  1829. {
  1830. PlayerInfo[playerid][WepSlot10] = weapon;
  1831. GivePlayerWeapon(playerid, weapon, 99999);
  1832. }
  1833. case 44, 45, 46:
  1834. {
  1835. PlayerInfo[playerid][WepSlot11] = weapon;
  1836. GivePlayerWeapon(playerid, weapon, 99999);
  1837. }
  1838. case 40:
  1839. {
  1840. printf("[system] [error] GivePlayerWeaponEx() was unable to give weapon ID %d.", weapon);
  1841. }
  1842. }
  1843. return 1;
  1844. }
  1845.  
  1846. public SendToAdmins(colour, string[], requireduty)
  1847. {
  1848. for(new i = 0; i < MAX_PLAYERS; i++)
  1849. {
  1850. if(IsPlayerConnected(i))
  1851. {
  1852. if(PlayerInfo[i][pAdminLevel] >= 1)
  1853. {
  1854. SendClientMessage(i, colour, string);
  1855. }
  1856. }
  1857. }
  1858. return 1;
  1859. }
  1860.  
  1861. stock SavePlayers()
  1862. {
  1863. for(new i = 0; i < MAX_PLAYERS; i++)
  1864. {
  1865. SavePlayer(i);
  1866. }
  1867. return 1;
  1868. }
  1869.  
  1870. stock SaveHouses()
  1871. {
  1872. for(new i = 0; i < MAX_HOUSES; i++)
  1873. {
  1874. SaveHouse(i);
  1875. }
  1876. return 1;
  1877. }
  1878.  
  1879. stock SavePlayer(i)
  1880. {
  1881. new name[MAX_PLAYER_NAME];
  1882. new file[256];
  1883. GetPlayerName(i, name, sizeof(name));
  1884. format(file, sizeof(file), SERVER_USER_FILE, name);
  1885. dini_IntSet(file, "Money", PlayerInfo[i][pCash]);
  1886. dini_IntSet(file, "Group", PlayerInfo[i][Group]);
  1887. dini_IntSet(file, "GroupRank", PlayerInfo[i][GroupRank]);
  1888. dini_IntSet(file, "Job", PlayerInfo[i][pJob]);
  1889. dini_IntSet(file, "Skin", PlayerInfo[i][Skin]);
  1890. dini_IntSet(file, "GivingSlot", PlayerInfo[i][GivingSlot]);
  1891. dini_IntSet(file, "PendingCarReceival", PlayerInfo[i][PendingCarReceival]);
  1892. dini_FloatSet(file, "CarX", PlayerInfo[i][CarX]);
  1893. dini_FloatSet(file, "CarY", PlayerInfo[i][CarY]);
  1894. dini_FloatSet(file, "CarZ", PlayerInfo[i][CarZ]);
  1895. dini_IntSet(file, "CarPaintJobID", PlayerInfo[i][CarPaintJobID]);
  1896. dini_IntSet(file, "PlayerCarModel2", PlayerInfo[i][PlayerCarModel2]);
  1897. dini_IntSet(file, "PlayerCarModel3", PlayerInfo[i][PlayerCarModel3]);
  1898. dini_FloatSet(file, "Car2ZAngle", PlayerInfo[i][Car2ZAngle]);
  1899. dini_FloatSet(file, "Car3ZAngle", PlayerInfo[i][Car3ZAngle]);
  1900. dini_IntSet(file, "Car2Col1", PlayerInfo[i][Car2Col1]);
  1901. dini_IntSet(file, "Car2Col2", PlayerInfo[i][Car2Col2]);
  1902. dini_IntSet(file, "Car3Col1", PlayerInfo[i][Car3Col1]);
  1903. dini_IntSet(file, "Car3Col2", PlayerInfo[i][Car3Col2]);
  1904. dini_IntSet(file, "CarLinkID", PlayerInfo[i][CarLinkID]);
  1905. dini_IntSet(file, "Car2LinkID", PlayerInfo[i][Car2LinkID]);
  1906. dini_IntSet(file, "Car3LinkID", PlayerInfo[i][Car3LinkID]);
  1907. dini_IntSet(file, "Car2PaintJobID", PlayerInfo[i][Car2PaintJobID]);
  1908. dini_IntSet(file, "Car3PaintJobID", PlayerInfo[i][Car3PaintJobID]);
  1909. dini_FloatSet(file, "Car2X", PlayerInfo[i][Car2X]);
  1910. dini_FloatSet(file, "Car2Y", PlayerInfo[i][Car2Y]);
  1911. dini_FloatSet(file, "Car2Z", PlayerInfo[i][Car2Z]);
  1912. dini_FloatSet(file, "Car3X", PlayerInfo[i][Car3X]);
  1913. dini_FloatSet(file, "Car3Y", PlayerInfo[i][Car3Y]);
  1914. dini_FloatSet(file, "Car3Z", PlayerInfo[i][Car3Z]);
  1915. dini_FloatSet(file, "CarZAngle", PlayerInfo[i][CarZAngle]);
  1916. dini_IntSet(file, "PlayerCarModel", PlayerInfo[i][PlayerCarModel]);
  1917. dini_IntSet(file, "CarCol1", PlayerInfo[i][CarCol1]);
  1918. dini_IntSet(file, "CarCol2", PlayerInfo[i][CarCol2]);
  1919. dini_IntSet(file, "Fish", PlayerInfo[i][Fish]);
  1920. dini_IntSet(file, "FishBait", PlayerInfo[i][FishBait]);
  1921. dini_IntSet(file, "FishLicense", PlayerInfo[i][FishLicense]);
  1922. dini_IntSet(file, "FishRod", PlayerInfo[i][FishRod]);
  1923. dini_IntSet(file, "FishWeight", PlayerInfo[i][FishWeight]);
  1924. dini_IntSet(file, "Mats", PlayerInfo[i][pMats]);
  1925. dini_IntSet(file, "BankMoney", PlayerInfo[i][BankMoney]);
  1926. dini_IntSet(file, "Minutes", PlayerInfo[i][Minutes]);
  1927. dini_IntSet(file, "Seconds", PlayerInfo[i][Seconds]);
  1928. dini_IntSet(file, "Spawn", PlayerInfo[i][PlayerSpawn]);
  1929. dini_IntSet(file, "Kills", PlayerInfo[i][Kills]);
  1930. dini_IntSet(file, "Deaths", PlayerInfo[i][Deaths]);
  1931. dini_IntSet(file, "Amination", PlayerInfo[i][Animation]);
  1932. dini_IntSet(file, "House", PlayerInfo[i][House]);
  1933. dini_IntSet(file, "BeingDraggedBy", PlayerInfo[i][BeingDraggedBy]);
  1934. dini_IntSet(file, "WepSlot0", PlayerInfo[i][WepSlot0]);
  1935. dini_IntSet(file, "WepSlot1", PlayerInfo[i][WepSlot1]);
  1936. dini_IntSet(file, "WepSlot2", PlayerInfo[i][WepSlot2]);
  1937. dini_IntSet(file, "WepSlot3", PlayerInfo[i][WepSlot3]);
  1938. dini_IntSet(file, "WepSlot4", PlayerInfo[i][WepSlot4]);
  1939. dini_IntSet(file, "WepSlot5", PlayerInfo[i][WepSlot5]);
  1940. dini_IntSet(file, "WepSlot6", PlayerInfo[i][WepSlot6]);
  1941. dini_IntSet(file, "WepSlot7", PlayerInfo[i][WepSlot7]);
  1942. dini_IntSet(file, "WepSlot8", PlayerInfo[i][WepSlot8]);
  1943. dini_IntSet(file, "WepSlot9", PlayerInfo[i][WepSlot9]);
  1944. dini_IntSet(file, "WepSlot10", PlayerInfo[i][WepSlot10]);
  1945. dini_IntSet(file, "WepSlot11", PlayerInfo[i][WepSlot11]);
  1946. dini_IntSet(file, "WepSlot12", PlayerInfo[i][WepSlot12]);
  1947. dini_IntSet(file, "WepSlot13", PlayerInfo[i][WepSlot13]);
  1948. dini_IntSet(file, "WepSlot14", PlayerInfo[i][WepSlot14]);
  1949. dini_IntSet(file, "WepSlot15", PlayerInfo[i][WepSlot15]);
  1950. dini_IntSet(file, "Level", PlayerInfo[i][pLevel]);
  1951. dini_IntSet(file, "Score", PlayerInfo[i][pScore]);
  1952. dini_IntSet(file, "AdminLevel",PlayerInfo[i][pAdminLevel]);
  1953. PlayerInfo[i][pAdminLevel] = dini_Int(file, "AdminLevel");
  1954. PlayerInfo[i][pCash] = dini_Int(file, "Money");
  1955. PlayerInfo[i][Group] = dini_Int(file, "Group");
  1956. PlayerInfo[i][GroupRank] = dini_Int(file, "GroupRank");
  1957. PlayerInfo[i][pJob] = dini_Int(file, "Job");
  1958. PlayerInfo[i][Skin] = dini_Int(file, "Skin");
  1959. PlayerInfo[i][pScore] = dini_Int(file, "Score");
  1960. PlayerInfo[i][Deaths] = dini_Int(file, "Deaths");
  1961. PlayerInfo[i][Kills] = dini_Int(file, "Kills");
  1962. PlayerInfo[i][PendingCarReceival] = dini_Int(file, "PendingCarReceival");
  1963. PlayerInfo[i][GivingSlot] = dini_Int(file, "GivingSlot");
  1964. PlayerInfo[i][FishBait] = dini_Int(file, "FishBait");
  1965. PlayerInfo[i][FishWeight] = dini_Int(file, "FishWeight");
  1966. PlayerInfo[i][FishRod] = dini_Int(file, "FishRod");
  1967. PlayerInfo[i][FishLicense] = dini_Int(file, "FishLicense");
  1968. PlayerInfo[i][Fish] = dini_Int(file, "Fish");
  1969. PlayerInfo[i][pMats] = dini_Int(file, "Mats");
  1970. PlayerInfo[i][Minutes] = dini_Int(file, "Minutes");
  1971. PlayerInfo[i][Seconds] = dini_Int(file, "Seconds");
  1972. PlayerInfo[i][BankMoney] = dini_Int(file, "BankMoney");
  1973. PlayerInfo[i][WepSlot0] = dini_Int(file, "WepSlot0");
  1974. PlayerInfo[i][WepSlot1] = dini_Int(file, "WepSlot1");
  1975. PlayerInfo[i][WepSlot2] = dini_Int(file, "WepSlot2");
  1976. PlayerInfo[i][WepSlot3] = dini_Int(file, "WepSlot3");
  1977. PlayerInfo[i][WepSlot4] = dini_Int(file, "WepSlot4");
  1978. PlayerInfo[i][WepSlot5] = dini_Int(file, "WepSlot5");
  1979. PlayerInfo[i][WepSlot6] = dini_Int(file, "WepSlot6");
  1980. PlayerInfo[i][WepSlot7] = dini_Int(file, "WepSlot7");
  1981. PlayerInfo[i][WepSlot8] = dini_Int(file, "WepSlot8");
  1982. PlayerInfo[i][WepSlot9] = dini_Int(file, "WepSlot9");
  1983. PlayerInfo[i][WepSlot10] = dini_Int(file, "WepSlot10");
  1984. PlayerInfo[i][WepSlot11] = dini_Int(file, "WepSlot11");
  1985. PlayerInfo[i][WepSlot12] = dini_Int(file, "WepSlot12");
  1986. PlayerInfo[i][WepSlot13] = dini_Int(file, "WepSlot13");
  1987. PlayerInfo[i][WepSlot14] = dini_Int(file, "WepSlot14");
  1988. PlayerInfo[i][WepSlot15] = dini_Int(file, "WepSlot15");
  1989. PlayerInfo[i][CarX] = dini_Int(file, "CarX");
  1990. PlayerInfo[i][CarY] = dini_Int(file, "CarY");
  1991. PlayerInfo[i][CarZ] = dini_Int(file, "CarZ");
  1992. PlayerInfo[i][CarPaintJobID] = dini_Int(file, "CarPaintJobID");
  1993. PlayerInfo[i][PlayerCarModel2] = dini_Int(file, "PlayerCarModel2");
  1994. PlayerInfo[i][PlayerCarModel3] = dini_Int(file, "PlayerCarModel3");
  1995. PlayerInfo[i][Car2ZAngle] = dini_Int(file, "Car2ZAngle");
  1996. PlayerInfo[i][Car3ZAngle] = dini_Int(file, "Car3ZAngle");
  1997. PlayerInfo[i][Car2Col1] = dini_Int(file, "Car2Col1");
  1998. PlayerInfo[i][Car2Col2] = dini_Int(file, "Car2Col2");
  1999. PlayerInfo[i][Car3Col1] = dini_Int(file, "Car3Col1");
  2000. PlayerInfo[i][Car3Col2] = dini_Int(file, "Car3Col2");
  2001. PlayerInfo[i][CarLinkID] = dini_Int(file, "CarLinkID");
  2002. PlayerInfo[i][Car2LinkID] = dini_Int(file, "Car2LinkID");
  2003. PlayerInfo[i][Car3LinkID] = dini_Int(file, "Car3LinkID");
  2004. PlayerInfo[i][Car2PaintJobID] = dini_Int(file, "Car2PaitnJobID");
  2005. PlayerInfo[i][Car3PaintJobID] = dini_Int(file, "Car3PaitnJobID");
  2006. PlayerInfo[i][Car2X] = dini_Int(file, "Car2X");
  2007. PlayerInfo[i][Car2Y] = dini_Int(file, "Car2Y");
  2008. PlayerInfo[i][Car2Z] = dini_Int(file, "Car2Z");
  2009. PlayerInfo[i][Car3X] = dini_Int(file, "Car3X");
  2010. PlayerInfo[i][Car3Y] = dini_Int(file, "Car3Y");
  2011. PlayerInfo[i][Car3Z] = dini_Int(file, "Car3Z");
  2012. PlayerInfo[i][CarZAngle] = dini_Int(file, "CarZAngle");
  2013. PlayerInfo[i][PlayerCarModel] = dini_Int(file, "PlayerCarModel");
  2014. PlayerInfo[i][CarCol1] = dini_Int(file, "CarCol1");
  2015. PlayerInfo[i][CarCol2] = dini_Int(file, "CarCol2");
  2016. printf("[System-Player] Player %d Saved", i);
  2017. return 1;
  2018. }
  2019.  
  2020. stock SaveHouse(i)
  2021. {
  2022. new FileName[23];
  2023. format(FileName, sizeof(FileName), "Houses/House_%d.ini", i);
  2024. if(fexist(FileName))
  2025. {
  2026. dini_IntSet(FileName, "InteriorID", Houses[i][hInteriorID]);
  2027. dini_FloatSet(FileName, "InteriorX", Houses[i][hInteriorX]);
  2028. dini_FloatSet(FileName, "InteriorY", Houses[i][hInteriorY]);
  2029. dini_FloatSet(FileName, "InteriorZ", Houses[i][hInteriorZ]);
  2030.  
  2031. dini_IntSet(FileName, "HousePrice", Houses[i][HousePrice]);
  2032.  
  2033. dini_IntSet(FileName, "ExteriorID", Houses[i][hExteriorID]);
  2034. dini_FloatSet(FileName, "ExteriorX", Houses[i][hExteriorX]);
  2035. dini_FloatSet(FileName, "ExteriorY", Houses[i][hExteriorY]);
  2036. dini_FloatSet(FileName, "ExteriorZ", Houses[i][hExteriorZ]);
  2037.  
  2038. dini_Set(FileName, "Owner", Houses[i][hOwner]);
  2039.  
  2040. printf("[system] House %d saved.", i);
  2041. }
  2042. return 1;
  2043. }
  2044.  
  2045. public OnGameModeExit()
  2046. {
  2047. djson_GameModeExit();
  2048. SaveHouses();
  2049. SavePlayers();
  2050. return 1;
  2051. }
  2052.  
  2053. public OnPlayerRequestClass(playerid, classid)
  2054. {
  2055. //iSpawnSet[playerid] = 0;
  2056. //SetupPlayerForClassSelection(playerid);
  2057. return 1;
  2058. }
  2059.  
  2060. /*public SetupPlayerForClassSelection(playerid)
  2061. {
  2062. SetPlayerInterior(playerid,14);
  2063. SetPlayerPos(playerid,258.4893,-41.4008,1002.0234);
  2064. SetPlayerFacingAngle(playerid, 270.0);
  2065. SetPlayerCameraPos(playerid,256.0815,-43.0475,1004.0234);
  2066. SetPlayerCameraLookAt(playerid,258.4893,-41.4008,1002.0234);
  2067. }*/
  2068.  
  2069. public speedometer(playerid) {
  2070. GetVehicleVelocity(GetPlayerVehicleID(playerid), svx[playerid], svy[playerid], svz[playerid]); // This Saves Our Velocitys To Our Varibles
  2071. 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 )
  2072. s21[playerid] = floatround(s11[playerid],floatround_round); // This Rounds Our Output To The Nearest Whole Number
  2073. format(s3[playerid],256,"MPH: %i", s21[playerid]); // This Format Our Text Into What We See
  2074. TextDrawLetterSize(sdisplay[playerid], 0.400000, 0.999999);
  2075. TextDrawSetString(sdisplay[playerid], s3[playerid]); // This Changes The Value Of Our Textdraw To What We Formatted
  2076. return 1;
  2077. }
  2078.  
  2079. public OneMinutePublic(playerid)
  2080. {
  2081. PlayerInfo[playerid][Minutes] += 1;
  2082. return 1;
  2083. }
  2084.  
  2085. public OneSecondPublic(playerid)
  2086. {
  2087. PlayerInfo[playerid][Seconds] += 1;
  2088. return 1;
  2089. }
  2090.  
  2091. public OnPlayerConnect(playerid)
  2092. {
  2093. TextDrawShowForPlayer(playerid, TextdrawConnect);
  2094. Timeshow[playerid] = 1;
  2095. sdisplay[playerid] = TextDrawCreate(56.0,340.000000," "); // This Creates Our Textdraw And Stores The Id In The Varible In Front
  2096. TextDrawColor(sdisplay[playerid], POLICE);
  2097. TextDrawBoxColor(sdisplay[playerid], 0x00000076);
  2098. TextDrawUseBox(sdisplay[playerid], 0);
  2099. TextDrawTextSize(sdisplay[playerid], 606.000000, -2.000000);
  2100. TextDrawBackgroundColor(sdisplay[playerid], 0x000000AA);
  2101. TextDrawSetShadow(sdisplay[playerid],0); // This Removes Our Textdraw's Shadow ( Makes Easier To Read )
  2102. TextDrawSetOutline(sdisplay[playerid],1); // This Adds A Black Outline To Our Textdraw ( Makes Easier To Read )
  2103. TextDrawFont(sdisplay[playerid], 3); // This Changes Our Textdraw's Font ( I Think This Ones Makes It Easier To Read )
  2104. TextDrawHideForPlayer(playerid,sdisplay[playerid]);
  2105. TextDrawHideForPlayer(playerid,Time1);
  2106. PlayerPlaySound(playerid,1183,418.1829,2533.8340,16.5637);
  2107. new string[64], name[MAX_PLAYER_NAME];
  2108. GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  2109. format(string,sizeof string,"LOGIN: %s has logged in to the server!",name);
  2110. SendClientMessageToAll(LOGIN,string);
  2111. SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
  2112. SetPlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  2113. SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
  2114. new file[256];
  2115. gPlayerLogged[playerid] = 0;
  2116. GetPlayerName(playerid, name, sizeof(name));
  2117. format(file, sizeof(file), SERVER_USER_FILE, name);
  2118. new playernamesplit[3][MAX_PLAYER_NAME];
  2119. split(name, playernamesplit, '_');
  2120.  
  2121. if (!strlen(playernamesplit[0]) || !strlen(playernamesplit[1]))
  2122. {
  2123. SendClientMessage(playerid, WHITE, "Please choose a Valid Roleplaying Name before registering. (Ex: Bob_Thompson)");
  2124. Kick(playerid);
  2125. }
  2126. if (!dini_Exists(file))
  2127. {
  2128. ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_PASSWORD, "You are not registered", "Welcome, please register a password for this account!", "Register", "Leave");
  2129. }
  2130. if(fexist(file))
  2131. {
  2132. ShowPlayerDialog(playerid, 2000, DIALOG_STYLE_PASSWORD, "This account is registered", "Your account is registered! Type in your password below!", "Login", "Leave");
  2133. }
  2134. return 1;
  2135. }
  2136.  
  2137. public settime(playerid)
  2138. {
  2139. new string[256],year,month,day,hours,minutes,seconds;
  2140. gettime(hours, minutes, seconds);
  2141. format(string, sizeof string, "%d/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
  2142. format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
  2143. TextDrawSetString(Time1, string);
  2144. }
  2145.  
  2146. public OnPlayerDisconnect(playerid, reason)
  2147. {
  2148. TextDrawHideForPlayer(playerid, Time1);
  2149. PlayerInfo[playerid][Animation] = 0;
  2150. new name[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
  2151. GetPlayerName(playerid, name, sizeof(name));
  2152. switch(reason)
  2153. {
  2154. case 0: format(string, sizeof(string), "LEAVE: %s has left the server. (Lost Connection)", name);
  2155. case 1: format(string, sizeof(string), "LEAVE: %s has left the server. (Leaving)", name);
  2156. case 2: format(string, sizeof(string), "LEAVE: %s has left the server. (Kicked)", name);
  2157. }
  2158. SendClientMessageToAll(0xAAAAAAAA, string);
  2159. new file[256];
  2160. GetPlayerName(playerid, name, sizeof(name));
  2161. format(file, sizeof(file), SERVER_USER_FILE, name);
  2162. if(gPlayerLogged[playerid] == 1)
  2163. {
  2164. dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
  2165. dini_IntSet(file, "Money", PlayerInfo[playerid][pCash]);
  2166. dini_IntSet(file, "Group", PlayerInfo[playerid][Group]);
  2167. dini_IntSet(file, "GroupRank", PlayerInfo[playerid][GroupRank]);
  2168. dini_IntSet(file, "Job", PlayerInfo[playerid][pJob]);
  2169. dini_IntSet(file, "Skin", PlayerInfo[playerid][Skin]);
  2170. dini_IntSet(file, "GivingSlot", PlayerInfo[playerid][GivingSlot]);
  2171. dini_IntSet(file, "PendingCarReceival", PlayerInfo[playerid][PendingCarReceival]);
  2172. dini_FloatSet(file, "CarX", PlayerInfo[playerid][CarX]);
  2173. dini_FloatSet(file, "CarY", PlayerInfo[playerid][CarY]);
  2174. dini_FloatSet(file, "CarZ", PlayerInfo[playerid][CarZ]);
  2175. dini_IntSet(file, "CarPaintJobID", PlayerInfo[playerid][CarPaintJobID]);
  2176. dini_IntSet(file, "PlayerCarModel2", PlayerInfo[playerid][PlayerCarModel2]);
  2177. dini_IntSet(file, "PlayerCarModel3", PlayerInfo[playerid][PlayerCarModel3]);
  2178. dini_FloatSet(file, "Car2ZAngle", PlayerInfo[playerid][Car2ZAngle]);
  2179. dini_FloatSet(file, "Car3ZAngle", PlayerInfo[playerid][Car3ZAngle]);
  2180. dini_IntSet(file, "Car2Col1", PlayerInfo[playerid][Car2Col1]);
  2181. dini_IntSet(file, "Car2Col2", PlayerInfo[playerid][Car2Col2]);
  2182. dini_IntSet(file, "Car3Col1", PlayerInfo[playerid][Car3Col1]);
  2183. dini_IntSet(file, "Car3Col2", PlayerInfo[playerid][Car3Col2]);
  2184. dini_IntSet(file, "CarLinkID", PlayerInfo[playerid][CarLinkID]);
  2185. dini_IntSet(file, "Car2LinkID", PlayerInfo[playerid][Car2LinkID]);
  2186. dini_IntSet(file, "Car3LinkID", PlayerInfo[playerid][Car3LinkID]);
  2187. dini_IntSet(file, "Car2PaintJobID", PlayerInfo[playerid][Car2PaintJobID]);
  2188. dini_IntSet(file, "Car3PaintJobID", PlayerInfo[playerid][Car3PaintJobID]);
  2189. dini_FloatSet(file, "Car2X", PlayerInfo[playerid][Car2X]);
  2190. dini_FloatSet(file, "Car2Y", PlayerInfo[playerid][Car2Y]);
  2191. dini_FloatSet(file, "Car2Z", PlayerInfo[playerid][Car2Z]);
  2192. dini_FloatSet(file, "Car3X", PlayerInfo[playerid][Car3X]);
  2193. dini_FloatSet(file, "Car3Y", PlayerInfo[playerid][Car3Y]);
  2194. dini_FloatSet(file, "Car3Z", PlayerInfo[playerid][Car3Z]);
  2195. dini_FloatSet(file, "CarZAngle", PlayerInfo[playerid][CarZAngle]);
  2196. dini_IntSet(file, "CarModel", PlayerInfo[playerid][PlayerCarModel]);
  2197. dini_IntSet(file, "CarCol1", PlayerInfo[playerid][CarCol1]);
  2198. dini_IntSet(file, "CarCol2", PlayerInfo[playerid][CarCol2]);
  2199. dini_IntSet(file, "Fish", PlayerInfo[playerid][Fish]);
  2200. dini_IntSet(file, "FishBait", PlayerInfo[playerid][FishBait]);
  2201. dini_IntSet(file, "FishLicense", PlayerInfo[playerid][FishLicense]);
  2202. dini_IntSet(file, "FishRod", PlayerInfo[playerid][FishRod]);
  2203. dini_IntSet(file, "FishWeight", PlayerInfo[playerid][FishWeight]);
  2204. dini_IntSet(file, "Mats", PlayerInfo[playerid][pMats]);
  2205. dini_IntSet(file, "BankMoney", PlayerInfo[playerid][BankMoney]);
  2206. dini_IntSet(file, "Minutes", PlayerInfo[playerid][Minutes]);
  2207. dini_IntSet(file, "Seconds", PlayerInfo[playerid][Seconds]);
  2208. dini_IntSet(file, "Spawn", PlayerInfo[playerid][PlayerSpawn]);
  2209. dini_IntSet(file, "Kills", PlayerInfo[playerid][Kills]);
  2210. dini_IntSet(file, "Deaths", PlayerInfo[playerid][Deaths]);
  2211. dini_IntSet(file, "Amination", PlayerInfo[playerid][Animation]);
  2212. dini_IntSet(file, "House", PlayerInfo[playerid][House]);
  2213. dini_IntSet(file, "BeingDraggedBy", PlayerInfo[playerid][BeingDraggedBy]);
  2214. dini_IntSet(file, "WepSlot0", PlayerInfo[playerid][WepSlot0]);
  2215. dini_IntSet(file, "WepSlot1", PlayerInfo[playerid][WepSlot1]);
  2216. dini_IntSet(file, "WepSlot2", PlayerInfo[playerid][WepSlot2]);
  2217. dini_IntSet(file, "WepSlot3", PlayerInfo[playerid][WepSlot3]);
  2218. dini_IntSet(file, "WepSlot4", PlayerInfo[playerid][WepSlot4]);
  2219. dini_IntSet(file, "WepSlot5", PlayerInfo[playerid][WepSlot5]);
  2220. dini_IntSet(file, "WepSlot6", PlayerInfo[playerid][WepSlot6]);
  2221. dini_IntSet(file, "WepSlot7", PlayerInfo[playerid][WepSlot7]);
  2222. dini_IntSet(file, "WepSlot8", PlayerInfo[playerid][WepSlot8]);
  2223. dini_IntSet(file, "WepSlot9", PlayerInfo[playerid][WepSlot9]);
  2224. dini_IntSet(file, "WepSlot10", PlayerInfo[playerid][WepSlot10]);
  2225. dini_IntSet(file, "WepSlot11", PlayerInfo[playerid][WepSlot11]);
  2226. dini_IntSet(file, "WepSlot12", PlayerInfo[playerid][WepSlot12]);
  2227. dini_IntSet(file, "WepSlot13", PlayerInfo[playerid][WepSlot13]);
  2228. dini_IntSet(file, "WepSlot14", PlayerInfo[playerid][WepSlot14]);
  2229. dini_IntSet(file, "WepSlot15", PlayerInfo[playerid][WepSlot15]);
  2230. dini_IntSet(file, "Level", PlayerInfo[playerid][pLevel]);
  2231. dini_IntSet(file, "Score", PlayerInfo[playerid][pScore]);
  2232. dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel]);
  2233. }
  2234. return 1;
  2235. }
  2236.  
  2237.  
  2238. public OnPlayerSpawn(playerid)
  2239. {
  2240. OnDuty[playerid] = 0;
  2241. OneMinuteTimer = SetTimerEx("OneMinutePublic", 60000, true, "i", playerid);
  2242. OneSecondTimer = SetTimerEx("OneSecondPublic", 1000, true, "i", playerid);
  2243. UpdateTimer = SetTimerEx("UpdatePublic", 5000, true, "i", playerid);
  2244. SpawnOwnedCar(playerid, 1);
  2245. SpawnOwnedCar(playerid, 2);
  2246. SpawnOwnedCar(playerid, 3);
  2247. SetPlayerSkillLevel(playerid, WEAPONSKILL_SAWNOFF_SHOTGUN, 999);
  2248. SetPlayerSkillLevel(playerid, WEAPONSKILL_PISTOL, 999);
  2249. SetPlayerSkillLevel(playerid, WEAPONSKILL_DESERT_EAGLE, 999);
  2250. SetPlayerSkillLevel(playerid, WEAPONSKILL_SHOTGUN, 999);
  2251. SetPlayerSkillLevel(playerid, WEAPONSKILL_SPAS12_SHOTGUN, 999);
  2252. SetPlayerSkillLevel(playerid, WEAPONSKILL_MICRO_UZI, 999);
  2253. SetPlayerSkillLevel(playerid, WEAPONSKILL_MP5, 999);
  2254. SetPlayerSkillLevel(playerid, WEAPONSKILL_AK47, 999);
  2255. SetPlayerSkillLevel(playerid, WEAPONSKILL_M4, 999);
  2256. SetPlayerSkillLevel(playerid, WEAPONSKILL_SNIPERRIFLE, 999);
  2257. SetPlayerColor(playerid, WHITE);
  2258. if(PlayerInfo[playerid][PlayerSpawn] == 0)
  2259. {
  2260. SetPlayerPos(playerid, 1283.9332,169.4734,20.4338);
  2261. }
  2262. if(PlayerInfo[playerid][PlayerSpawn] == 2)
  2263. {
  2264. SetPlayerPos(playerid, 1352.8156,351.6037,20.4168);
  2265. }
  2266. SetPlayerVirtualWorld(playerid, 0);
  2267. TextDrawShowForPlayer(playerid, Time1);
  2268. PlayerPlaySound(playerid,1069,418.1829,2533.8340,16.5637);
  2269. SetPlayerWeather(playerid, GlobalWeather);
  2270. ResetPlayerWeapons(playerid);
  2271. GivePlayerSavedWeapons(playerid);
  2272. PlayerPlaySound(playerid,1069,418.1829,2533.8340,16.5637);
  2273. SetPlayerInterior(playerid, 0);
  2274. SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
  2275. return 1;
  2276. }
  2277.  
  2278.  
  2279. public OnPlayerDeath(playerid, killerid, reason)
  2280. {
  2281. new string[128];
  2282. if(GetDistanceBetweenPlayers(killerid, playerid) > 25 && reason > 1 && reason < 100 && IsPlayerConnected(killerid) && killerid != playerid)
  2283. {
  2284. new weapon[128];
  2285. GetWeaponName(reason, weapon, sizeof(weapon));
  2286. format(string, sizeof(string), "WARNING: %s has killed %s; from a long distance, using a %s.", GetName(killerid), GetName(playerid), weapon);
  2287. SendToAdmins(ADMINORANGE, string, 1);
  2288. print(string);
  2289. }
  2290. if(reason == 49)
  2291. {
  2292. format(string, sizeof(string), "WARNING: %s has car-rammed %s to death.", GetName(killerid), GetName(playerid));
  2293. SendToAdmins(ADMINORANGE, string, 1);
  2294. print(string);
  2295. }
  2296. if(reason == 50)
  2297. {
  2298. if(IsAHelicopter(GetPlayerVehicleID(killerid)))
  2299. {
  2300. format(string, sizeof(string), "WARNING: %s has heli-killed %s.", GetName(killerid), GetName(playerid));
  2301. SendToAdmins(ADMINORANGE, string, 1);
  2302. print(string);
  2303. }
  2304. else
  2305. {
  2306. if(GetPlayerWeapon(killerid) != 32 || GetPlayerWeapon(killerid) != 28 || GetPlayerWeapon(killerid) != 29)
  2307. {
  2308. format(string, sizeof(string), "WARNING: %s has car-parked %s.", GetName(killerid), GetName(playerid));
  2309. SendToAdmins(ADMINORANGE, string, 1);
  2310. print(string);
  2311. }
  2312. }
  2313. }
  2314. PlayerInfo[playerid][Animation] = 0;
  2315. TogglePlayerControllable(playerid, true);
  2316. PlayerInfo[killerid][Kills]++;
  2317. PlayerInfo[playerid][Deaths]++;
  2318. RemovePlayerWeapons(playerid);
  2319. return 1;
  2320. }
  2321.  
  2322. public OnVehicleSpawn(vehicleid)
  2323. {
  2324. Engine[vehicleid] = 0;
  2325. Lights[vehicleid] = 0;
  2326. Trunk[vehicleid] = 0;
  2327. Hood[vehicleid] = 0;
  2328. return 1;
  2329. }
  2330.  
  2331. public OnVehicleDeath(vehicleid, killerid)
  2332. {
  2333. return 1;
  2334. }
  2335.  
  2336. public OnPlayerText(playerid, text[])
  2337. {
  2338. if (realchat)
  2339. {
  2340. new sendername[MAX_PLAYER_NAME], string[128];
  2341. GetPlayerName(playerid, sendername, sizeof(sendername));
  2342. sendername[strfind(sendername,"_")] = ' ';
  2343. format(string, sizeof(string), "%s says: %s", sendername, text);
  2344. ProxDetector(20.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  2345. return 0;
  2346. }
  2347. return 1;
  2348. }
  2349.  
  2350. public OnPlayerCommandText(playerid, cmdtext[])
  2351. {
  2352. return 0;
  2353. }
  2354.  
  2355. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2356. {
  2357. TextDrawShowForPlayer(playerid,sdisplay[playerid]);
  2358. return 1;
  2359. }
  2360.  
  2361. public OnPlayerExitVehicle(playerid, vehicleid)
  2362. {
  2363. TextDrawHideForPlayer(playerid,sdisplay[playerid]);
  2364. return 1;
  2365. }
  2366.  
  2367. public OnPlayerStateChange(playerid, newstate, oldstate)
  2368. {
  2369. new carid = GetPlayerVehicleID(playerid);
  2370. if(newstate == PLAYER_STATE_ONFOOT && oldstate == PLAYER_STATE_DRIVER)
  2371. {
  2372. TextDrawHideForPlayer(playerid, sdisplay[playerid]);
  2373. KillTimer(stimer[playerid]); // This Stops Our Timer For When You Get Out Of Your Vehicle Your Speed Doesn't Keep Going
  2374. }
  2375. if(newstate == PLAYER_STATE_DRIVER && oldstate == PLAYER_STATE_ONFOOT)
  2376. {
  2377. if(carid == 407 || carid == 544 || carid == 416)
  2378. {
  2379. if(PlayerInfo[playerid][Group] == 2)
  2380. {
  2381. return 1;
  2382. }
  2383. else
  2384. {
  2385. SendClientMessage(playerid, WHITE, "You are not a member of the Fire Department!");
  2386. RemovePlayerFromVehicle(playerid);
  2387. }
  2388. }
  2389. TextDrawSetString(sdisplay[playerid], " "); // This Sets Our Textdraw To Blank And Freezes Because We Stop The Timer ^
  2390. 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
  2391. else if(newstate == 3) stimer[playerid] = SetTimerEx("speedometer", 250, true, "i", playerid);
  2392. }
  2393. return 1;
  2394. }
  2395.  
  2396. public OnPlayerEnterCheckpoint(playerid)
  2397. {
  2398. return 1;
  2399. }
  2400.  
  2401. public OnPlayerLeaveCheckpoint(playerid)
  2402. {
  2403. return 1;
  2404. }
  2405.  
  2406. public OnPlayerEnterRaceCheckpoint(playerid)
  2407. {
  2408. return 1;
  2409. }
  2410.  
  2411. public OnPlayerLeaveRaceCheckpoint(playerid)
  2412. {
  2413. return 1;
  2414. }
  2415.  
  2416. public OnRconCommand(cmd[])
  2417. {
  2418. return 1;
  2419. }
  2420.  
  2421. public OnPlayerRequestSpawn(playerid)
  2422. {
  2423. return 1;
  2424. }
  2425.  
  2426. public OnObjectMoved(objectid)
  2427. {
  2428. return 1;
  2429. }
  2430.  
  2431. public OnPlayerObjectMoved(playerid, objectid)
  2432. {
  2433. return 1;
  2434. }
  2435.  
  2436. public OnPlayerPickUpPickup(playerid, pickupid)
  2437. {
  2438. return 1;
  2439. }
  2440.  
  2441. public OnVehicleMod(playerid, vehicleid, componentid)
  2442. {
  2443. return 1;
  2444. }
  2445.  
  2446. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  2447. {
  2448. return 1;
  2449. }
  2450.  
  2451. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  2452. {
  2453. return 1;
  2454. }
  2455.  
  2456. public OnPlayerSelectedMenuRow(playerid, row)
  2457. {
  2458. return 1;
  2459. }
  2460.  
  2461. public OnPlayerExitedMenu(playerid)
  2462. {
  2463. return 1;
  2464. }
  2465.  
  2466. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  2467. {
  2468. return 1;
  2469. }
  2470.  
  2471. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2472. {
  2473. if(PlayerInfo[playerid][Animation] >= 1)
  2474. {
  2475. if(IsKeyJustDown(KEY_FIRE, newkeys, oldkeys))
  2476. {
  2477. PlayerInfo[playerid][Animation] = 0;
  2478. ClearAnimations(playerid);
  2479. StopLoopingAnimation(playerid);
  2480. TogglePlayerControllable(playerid, true);
  2481. SendClientMessage(playerid, WHITE, "You have cleared all animations.");
  2482. }
  2483. }
  2484. return 1;
  2485. }
  2486.  
  2487. public OnRconLoginAttempt(ip[], password[], success)
  2488. {
  2489. return 1;
  2490. }
  2491.  
  2492. public OnPlayerUpdate(playerid)
  2493. {
  2494. if(OnDuty[playerid] == 1)
  2495. {
  2496. if(PlayerInfo[playerid][Group] == 2)
  2497. {
  2498. SetPlayerColor(playerid, 0x00FF00FF);
  2499. }
  2500. }
  2501. new Float:health;
  2502. GetPlayerHealth(playerid, health);
  2503. if(health < 25.0)
  2504. {
  2505. ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 1, 1, 1, 1);
  2506. PlayerInfo[playerid][Animation] = 1;
  2507. }
  2508. if(PlayerInfo[playerid][Minutes] >= 60)
  2509. {
  2510. PlayerInfo[playerid][Minutes] -= 60;
  2511. PlayerInfo[playerid][pScore] += 1;
  2512. SendClientMessage(playerid, WHITE, "You have gained 1 Player Level Congratulations! (1 Hour of Playing)");
  2513. }
  2514. if(AdminDuty[playerid] == 1)
  2515. {
  2516. SetPlayerHealth(playerid, 50000);
  2517. SetPlayerArmour(playerid, 50000);
  2518. }
  2519. if(Fishing[playerid] == 1)
  2520. {
  2521. GameTextForPlayer(playerid, "~g~Fishing...", 30000, 4);
  2522. }
  2523. SetPlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  2524. SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
  2525. return 1;
  2526. }
  2527.  
  2528. public OnPlayerStreamIn(playerid, forplayerid)
  2529. {
  2530. return 1;
  2531. }
  2532.  
  2533. public OnPlayerStreamOut(playerid, forplayerid)
  2534. {
  2535. return 1;
  2536. }
  2537.  
  2538. public OnVehicleStreamIn(vehicleid, forplayerid)
  2539. {
  2540. return 1;
  2541. }
  2542.  
  2543. public OnVehicleStreamOut(vehicleid, forplayerid)
  2544. {
  2545. return 1;
  2546. }
  2547.  
  2548. public GivePlayerSavedWeapons(playerid)
  2549. {
  2550. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot0], 99999);
  2551. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot1], 99999);
  2552. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot2], 99999);
  2553. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot3], 99999);
  2554. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot4], 99999);
  2555. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot5], 99999);
  2556. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot6], 99999);
  2557. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot7], 99999);
  2558. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot8], 99999);
  2559. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot9], 99999);
  2560. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot10], 99999);
  2561. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot11], 99999);
  2562. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot12], 99999);
  2563. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot13], 99999);
  2564. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot14], 99999);
  2565. GivePlayerWeapon(playerid, PlayerInfo[playerid][WepSlot15], 99999);
  2566. return 1;
  2567. }
  2568.  
  2569. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2570. {
  2571. if(response)
  2572. {
  2573. switch(dialogid)
  2574. {
  2575. case 333:
  2576. {
  2577. switch(listitem)
  2578. {
  2579. case 0:
  2580. {
  2581. PlayerInfo[playerid][PlayerSpawn] = 0;
  2582. SendClientMessage(playerid, WHITE, "You will now spawn at the newbie spawn!");
  2583. }
  2584. case 1:
  2585. {
  2586. if(PlayerInfo[playerid][Group] > 0)
  2587. {
  2588. if(PlayerInfo[playerid][Group] == 2)
  2589. {
  2590. PlayerInfo[playerid][PlayerSpawn] = 2;
  2591. SendClientMessage(playerid, WHITE, "You are a member of the Fire Department, therefore you will spawn at their HQ!");
  2592. }
  2593. }
  2594. else
  2595. {
  2596. SendClientMessage(playerid, WHITE, "You do not belong to a group, therefore you will spawn at the Newbie Spawn!");
  2597. PlayerInfo[playerid][PlayerSpawn] = 0;
  2598. }
  2599. }
  2600. }
  2601. }
  2602. case 300:
  2603. {
  2604. new skinid, message[128];
  2605. skinid = strval(inputtext);
  2606. if(skinid < 0 || skinid > 299)
  2607. {
  2608. SendClientMessage(playerid, 0x33FF33AA, "Error: Choose a skin ID between 0 and 299.");
  2609. }
  2610. else
  2611. {
  2612. SetPlayerSkin(playerid, skinid);
  2613. format(message, sizeof(message), "You have successfully purchased a set of clothes(ID: %d)! It costed you $25.00.", skinid);
  2614. SendClientMessage(playerid, 0x33FF33AA, message);
  2615. PlayerInfo[playerid][Skin] = skinid;
  2616. PlayerInfo[playerid][pCash] -= 25;
  2617. }
  2618. }
  2619. case 6:
  2620. {
  2621. switch(listitem)
  2622. {
  2623. case 0:
  2624. {
  2625. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2626. Kick(playerid);
  2627. }
  2628. case 1:
  2629. {
  2630. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2631. Kick(playerid);
  2632. }
  2633. case 2:
  2634. {
  2635. SendClientMessage(playerid, WHITE, "CORRECT Answer, Next Question!");
  2636. ShowPlayerDialog(playerid, 7, DIALOG_STYLE_LIST, "Define Metagaming.", "Using IC information ICly\nUsing OOC Information ICly\nUsing OOC information OOCly", "Select", "Cancel");
  2637. }
  2638. }
  2639. }
  2640. case 7:
  2641. {
  2642. switch(listitem)
  2643. {
  2644. case 0:
  2645. {
  2646. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2647. Kick(playerid);
  2648. }
  2649. case 1:
  2650. {
  2651. SendClientMessage(playerid, WHITE, "CORRECT Answer, Next Question!");
  2652. 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");
  2653. }
  2654. case 2:
  2655. {
  2656. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2657. Kick(playerid);
  2658. }
  2659. }
  2660. }
  2661. case 8:
  2662. {
  2663. switch(listitem)
  2664. {
  2665. case 0:
  2666. {
  2667. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2668. Kick(playerid);
  2669. }
  2670. case 1:
  2671. {
  2672. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2673. Kick(playerid);
  2674. }
  2675. case 2:
  2676. {
  2677. SendClientMessage(playerid, WHITE, "CORRECT Answer, Next Question!");
  2678. ShowPlayerDialog(playerid, 90, DIALOG_STYLE_LIST, "Define IC.", "In Character\nI'm Crazy\nIts Cruel", "Select", "Cancel");
  2679. }
  2680. }
  2681. }
  2682. case 90:
  2683. {
  2684. switch(listitem)
  2685. {
  2686. case 0:
  2687. {
  2688. SendClientMessage(playerid, WHITE, "CORRECT Answer, Next Question!");
  2689. ShowPlayerDialog(playerid, 9, DIALOG_STYLE_LIST, "Define DM", "Death Matching\nDick Muncher\nDont Masturbate", "Select", "Cancel");
  2690. }
  2691. case 1:
  2692. {
  2693. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2694. Kick(playerid);
  2695. }
  2696. case 2:
  2697. {
  2698. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2699. Kick(playerid);
  2700. }
  2701. }
  2702. }
  2703. case 9:
  2704. {
  2705. switch(listitem)
  2706. {
  2707. case 0:
  2708. {
  2709. SendClientMessage(playerid, WHITE, "CORRECT Answer, Next Question!");
  2710. ShowPlayerDialog(playerid, 15, DIALOG_STYLE_LIST, "Define RK", "Rendered Knight\nRyan Knoblestone\nRevenge Killing", "Select", "Cancel");
  2711. }
  2712. case 1:
  2713. {
  2714. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2715. Kick(playerid);
  2716. }
  2717. case 2:
  2718. {
  2719. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2720. Kick(playerid);
  2721. }
  2722. }
  2723. }
  2724. case 15:
  2725. {
  2726. switch(listitem)
  2727. {
  2728. case 0:
  2729. {
  2730. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2731. Kick(playerid);
  2732. }
  2733. case 1:
  2734. {
  2735. SendClientMessage(playerid, WHITE, "WRONG Answer, if you wish to retry the RolePlay quiz, you may relog!");
  2736. Kick(playerid);
  2737. }
  2738. case 2:
  2739. {
  2740. SendClientMessage(playerid, WHITE, "CORRECT Answer, You have Passed the Quiz!");
  2741. SendClientMessage(playerid, WHITE, "To Ask Any Questions In Game, please use /n or /assistance!");
  2742. SendClientMessage(playerid, WHITE, "Have a nice day! Have Fun and remember, This server is RolePlay!");
  2743. SpawnPlayer(playerid);
  2744. }
  2745. }
  2746. }
  2747. case 100:
  2748. {
  2749. switch(listitem)
  2750. {
  2751. case 0:
  2752. {
  2753. if(PlayerInfo[playerid][pCash] >= 500)
  2754. {
  2755. if(PlayerInfo[playerid][PlayerCarModel] > 0)
  2756. {
  2757. SpawnOwnedCar(playerid, 1);
  2758. PlayerInfo[playerid][pCash] -= 500;
  2759. SendClientMessage(playerid, WHITE, "You have respawned your Slot 1 Vehicle.");
  2760. }
  2761. else
  2762. {
  2763. SendClientMessage(playerid, WHITE, "You do not have a vehicle in that slot!");
  2764. }
  2765. }
  2766. else
  2767. {
  2768. SendClientMessage(playerid, WHITE, "You do not have enough money to perfor this action!");
  2769. }
  2770. }
  2771. case 1:
  2772. {
  2773. if(PlayerInfo[playerid][pCash] >= 500)
  2774. {
  2775. if(PlayerInfo[playerid][PlayerCarModel2] > 0)
  2776. {
  2777. SpawnOwnedCar(playerid, 2);
  2778. PlayerInfo[playerid][pCash] -= 500;
  2779. SendClientMessage(playerid, WHITE, "You have respawned your Slot 2 Vehicle.");
  2780. }
  2781. else
  2782. {
  2783. SendClientMessage(playerid, WHITE, "You do not have a vehicle in that slot!");
  2784. }
  2785. }
  2786. else
  2787. {
  2788. SendClientMessage(playerid, WHITE, "You do not have enough money to perfor this action!");
  2789. }
  2790. }
  2791. case 2:
  2792. {
  2793. if(PlayerInfo[playerid][pCash] >= 500)
  2794. {
  2795. if(PlayerInfo[playerid][PlayerCarModel3] > 0)
  2796. {
  2797. SpawnOwnedCar(playerid, 3);
  2798. PlayerInfo[playerid][pCash] -= 500;
  2799. SendClientMessage(playerid, WHITE, "You have respawned your Slot 3 Vehicle.");
  2800. }
  2801. else
  2802. {
  2803. SendClientMessage(playerid, WHITE, "You do not have a vehicle in that slot!");
  2804. }
  2805. }
  2806. else
  2807. {
  2808. SendClientMessage(playerid, WHITE, "You do not have enough money to perfor this action!");
  2809. }
  2810. }
  2811. }
  2812. }
  2813. case 346:
  2814. {
  2815. switch(listitem)
  2816. {
  2817. case 0:
  2818. {
  2819. 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");
  2820. }
  2821. case 1:
  2822. {
  2823. 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");
  2824. }
  2825. case 2:
  2826. {
  2827. 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");
  2828. }
  2829. case 3:
  2830. {
  2831. 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");
  2832. }
  2833. case 4:
  2834. {
  2835. 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");
  2836. }
  2837. case 5:
  2838. {
  2839. 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");
  2840. }
  2841. case 6:
  2842. {
  2843. 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");
  2844. }
  2845. }
  2846. }
  2847. case 310:
  2848. {
  2849. switch(listitem)
  2850. {
  2851. case 0:
  2852. {
  2853. if(PlayerInfo[playerid][pCash] >= 15000)
  2854. {
  2855. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  2856. PlayerInfo[playerid][CarBeingCarried] = 586;
  2857. PlayerInfo[playerid][CarPriceBeingCarried] = 15000;
  2858. }
  2859. else
  2860. {
  2861. SendClientMessage(playerid, WHITE, "You don't have enough.");
  2862. }
  2863. }
  2864. case 1:
  2865. {
  2866. if(PlayerInfo[playerid][pCash] >= 20000)
  2867. {
  2868. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  2869. PlayerInfo[playerid][CarBeingCarried] = 521;
  2870. PlayerInfo[playerid][CarPriceBeingCarried] = 20000;
  2871. }
  2872. else
  2873. {
  2874. SendClientMessage(playerid, WHITE, "You don't have enough.");
  2875. }
  2876. }
  2877. case 2:
  2878. {
  2879. if(PlayerInfo[playerid][pCash] >= 20000)
  2880. {
  2881. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  2882. PlayerInfo[playerid][CarBeingCarried] = 461;
  2883. PlayerInfo[playerid][CarPriceBeingCarried] = 20000;
  2884. }
  2885. else
  2886. {
  2887. SendClientMessage(playerid, WHITE, "You don't have enough.");
  2888. }
  2889. }
  2890. case 3:
  2891. {
  2892. if(PlayerInfo[playerid][pCash] >= 21000)
  2893. {
  2894. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  2895. PlayerInfo[playerid][CarBeingCarried] = 463;
  2896. PlayerInfo[playerid][CarPriceBeingCarried] = 21000;
  2897. }
  2898. else
  2899. {
  2900. SendClientMessage(playerid, WHITE, "You don't have enough.");
  2901. }
  2902. }
  2903. }
  2904. }
  2905. case 352:
  2906. {
  2907. switch(listitem)
  2908. {
  2909. case 0:
  2910. {
  2911. if(PlayerInfo[playerid][pCash] >= 10000)
  2912. {
  2913. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  2914. PlayerInfo[playerid][CarBeingCarried] = 415;
  2915. PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
  2916. }
  2917. else
  2918. {
  2919. SendClientMessage(playerid, WHITE, "You don't have enough.");
  2920. }
  2921. }
  2922. case 1:
  2923. {
  2924. if(PlayerInfo[playerid][pCash] >= 10000)
  2925. {
  2926. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  2927. PlayerInfo[playerid][CarBeingCarried] = 541;
  2928. PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
  2929. }
  2930. else
  2931. {
  2932. SendClientMessage(playerid, WHITE, "You don't have enough.");
  2933. }
  2934. }
  2935. case 2:
  2936. {
  2937. if(PlayerInfo[playerid][pCash] >= 10000)
  2938. {
  2939. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  2940. PlayerInfo[playerid][CarBeingCarried] = 411;
  2941. PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
  2942. }
  2943. else
  2944. {
  2945. SendClientMessage(playerid, WHITE, "You don't have enough.");
  2946. }
  2947. }
  2948. case 3:
  2949. {
  2950. if(PlayerInfo[playerid][pCash] >= 10000)
  2951. {
  2952. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  2953. PlayerInfo[playerid][CarBeingCarried] = 522;
  2954. PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
  2955. }
  2956. else
  2957. {
  2958. SendClientMessage(playerid, WHITE, "You don't have enough.");
  2959. }
  2960. }
  2961. case 4:
  2962. {
  2963. if(PlayerInfo[playerid][pCash] >= 10000)
  2964. {
  2965. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  2966. PlayerInfo[playerid][CarBeingCarried] = 451;
  2967. PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
  2968. }
  2969. else
  2970. {
  2971. SendClientMessage(playerid, WHITE, "You don't have enough.");
  2972. }
  2973. }
  2974. case 5:
  2975. {
  2976. if(PlayerInfo[playerid][pCash] >= 10000)
  2977. {
  2978. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  2979. PlayerInfo[playerid][CarBeingCarried] = 487;
  2980. PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
  2981. }
  2982. else
  2983. {
  2984. SendClientMessage(playerid, WHITE, "You don't have enough.");
  2985. }
  2986. }
  2987. case 6:
  2988. {
  2989. if(PlayerInfo[playerid][pCash] >= 10000)
  2990. {
  2991. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  2992. PlayerInfo[playerid][CarBeingCarried] = 468;
  2993. PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
  2994. }
  2995. else
  2996. {
  2997. SendClientMessage(playerid, WHITE, "You don't have enough.");
  2998. }
  2999. }
  3000. case 7:
  3001. {
  3002. if(PlayerInfo[playerid][pCash] >= 10000)
  3003. {
  3004. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3005. PlayerInfo[playerid][CarBeingCarried] = 471;
  3006. PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
  3007. }
  3008. else
  3009. {
  3010. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3011. }
  3012. }
  3013. }
  3014. }
  3015. case 94:
  3016. {
  3017. if(PlayerInfo[playerid][CarBeingCarried] >= 1)
  3018. {
  3019. switch(listitem)
  3020. {
  3021. case 0:
  3022. {
  3023. if(PlayerInfo[playerid][pCash] >= PlayerInfo[playerid][CarPriceBeingCarried])
  3024. {
  3025. PurchaseCar(playerid, PlayerInfo[playerid][CarBeingCarried], PlayerInfo[playerid][CarPriceBeingCarried], 1);
  3026. }
  3027. else
  3028. {
  3029. SendClientMessage(playerid, WHITE, "You don't have enough money on you.");
  3030. }
  3031. }
  3032. case 1:
  3033. {
  3034. if(PlayerInfo[playerid][pCash] >= PlayerInfo[playerid][CarPriceBeingCarried])
  3035. {
  3036. PurchaseCar(playerid, PlayerInfo[playerid][CarBeingCarried], PlayerInfo[playerid][CarPriceBeingCarried], 2);
  3037. }
  3038. else
  3039. {
  3040. SendClientMessage(playerid, WHITE, "You don't have enough money on you.");
  3041. }
  3042. }
  3043. case 2:
  3044. {
  3045. if(PlayerInfo[playerid][pCash] >= PlayerInfo[playerid][CarPriceBeingCarried])
  3046. {
  3047. PurchaseCar(playerid, PlayerInfo[playerid][CarBeingCarried], PlayerInfo[playerid][CarPriceBeingCarried], 3);
  3048. }
  3049. else
  3050. {
  3051. SendClientMessage(playerid, WHITE, "You don't have enough money on you.");
  3052. }
  3053. }
  3054. }
  3055. }
  3056. }
  3057. case 347:
  3058. {
  3059. switch(listitem)
  3060. {
  3061. case 0:
  3062. {
  3063. if(PlayerInfo[playerid][pCash] >= 8000)
  3064. {
  3065. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3066. PlayerInfo[playerid][CarBeingCarried] = 496;
  3067. PlayerInfo[playerid][CarPriceBeingCarried] = 8000;
  3068. }
  3069. else
  3070. {
  3071. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3072. }
  3073. }
  3074. case 1:
  3075. {
  3076. if(PlayerInfo[playerid][pCash] >= 4300)
  3077. {
  3078. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3079. PlayerInfo[playerid][CarBeingCarried] = 542;
  3080. PlayerInfo[playerid][CarPriceBeingCarried] = 4300;
  3081. }
  3082. else
  3083. {
  3084. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3085. }
  3086. }
  3087. case 2:
  3088. {
  3089. if(PlayerInfo[playerid][pCash] >= 5700)
  3090. {
  3091. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3092. PlayerInfo[playerid][CarBeingCarried] = 439;
  3093. PlayerInfo[playerid][CarPriceBeingCarried] = 5700;
  3094. }
  3095. else
  3096. {
  3097. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3098. }
  3099. }
  3100. case 3:
  3101. {
  3102. if(PlayerInfo[playerid][pCash] >= 3800)
  3103. {
  3104. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3105. PlayerInfo[playerid][CarBeingCarried] = 549;
  3106. PlayerInfo[playerid][CarPriceBeingCarried] = 3800;
  3107. }
  3108. else
  3109. {
  3110. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3111. }
  3112. }
  3113. }
  3114. }
  3115. case 16:
  3116. {
  3117. switch(listitem)
  3118. {
  3119. case 0:
  3120. {
  3121. if(PlayerInfo[playerid][GivingSlot] == 1)
  3122. {
  3123. if(PlayerInfo[playerid][CarLinkID] >= 1)
  3124. {
  3125. DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
  3126. PlayerInfo[playerid][CarLinkID] = 0;
  3127. PlayerInfo[playerid][PlayerCarModel] = 0;
  3128. }
  3129.  
  3130. GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID], PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ]);
  3131.  
  3132. DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID]);
  3133. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID] = 0;
  3134.  
  3135. PlayerInfo[playerid][PlayerCarModel] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel];
  3136.  
  3137. PlayerInfo[playerid][PendingCarReceival] = -1;
  3138. SpawnOwnedCar(playerid, 1);
  3139.  
  3140. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel] = 0;
  3141. }
  3142.  
  3143. if(PlayerInfo[playerid][GivingSlot] == 2)
  3144. {
  3145. if(PlayerInfo[playerid][CarLinkID] >= 1)
  3146. {
  3147. DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
  3148. PlayerInfo[playerid][CarLinkID] = 0;
  3149. PlayerInfo[playerid][PlayerCarModel] = 0;
  3150. }
  3151.  
  3152. GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID], PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ]);
  3153.  
  3154. DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID]);
  3155. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID] = 0;
  3156.  
  3157. PlayerInfo[playerid][PlayerCarModel] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2];
  3158.  
  3159. PlayerInfo[playerid][PendingCarReceival] = -1;
  3160.  
  3161. SpawnOwnedCar(playerid, 1);
  3162.  
  3163. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2] = 0;
  3164. }
  3165.  
  3166. if(PlayerInfo[playerid][GivingSlot] == 3)
  3167. {
  3168. if(PlayerInfo[playerid][CarLinkID] >= 1)
  3169. {
  3170. DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
  3171. PlayerInfo[playerid][CarLinkID] = 0;
  3172. PlayerInfo[playerid][PlayerCarModel] = 0;
  3173. }
  3174.  
  3175. GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID], PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ]);
  3176.  
  3177. DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID]);
  3178. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID] = 0;
  3179.  
  3180. PlayerInfo[playerid][PlayerCarModel] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3];
  3181.  
  3182. PlayerInfo[playerid][PendingCarReceival] = -1;
  3183.  
  3184. SpawnOwnedCar(playerid, 1);
  3185.  
  3186. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3] = 0;
  3187. }
  3188. }
  3189. case 1:
  3190. {
  3191. if(PlayerInfo[playerid][GivingSlot] == 1)
  3192. {
  3193. if(PlayerInfo[playerid][Car2LinkID] >= 1)
  3194. {
  3195. DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
  3196. PlayerInfo[playerid][Car2LinkID] = 0;
  3197. PlayerInfo[playerid][PlayerCarModel2] = 0;
  3198. }
  3199.  
  3200. GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID], PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z]);
  3201.  
  3202. DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID]);
  3203. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID] = 0;
  3204.  
  3205. PlayerInfo[playerid][PlayerCarModel2] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel];
  3206.  
  3207. PlayerInfo[playerid][PendingCarReceival] = -1;
  3208.  
  3209. SpawnOwnedCar(playerid, 2);
  3210.  
  3211. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel] = 0;
  3212. }
  3213.  
  3214. if(PlayerInfo[playerid][GivingSlot] == 2)
  3215. {
  3216. if(PlayerInfo[playerid][Car2LinkID] >= 1)
  3217. {
  3218. DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
  3219. PlayerInfo[playerid][Car2LinkID] = 0;
  3220. PlayerInfo[playerid][PlayerCarModel2] = 0;
  3221. }
  3222.  
  3223. GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID], PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z]);
  3224.  
  3225. DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID]);
  3226. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID] = 0;
  3227.  
  3228. PlayerInfo[playerid][PlayerCarModel2] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2];
  3229.  
  3230. PlayerInfo[playerid][PendingCarReceival] = -1;
  3231.  
  3232. SpawnOwnedCar(playerid, 2);
  3233.  
  3234. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2] = 0;
  3235. }
  3236.  
  3237. if(PlayerInfo[playerid][GivingSlot] == 3)
  3238. {
  3239. if(PlayerInfo[playerid][Car2LinkID] >= 1)
  3240. {
  3241. DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
  3242. PlayerInfo[playerid][Car2LinkID] = 0;
  3243. PlayerInfo[playerid][PlayerCarModel2] = 0;
  3244. }
  3245.  
  3246. GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID], PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z]);
  3247.  
  3248. DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID]);
  3249. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID] = 0;
  3250.  
  3251. PlayerInfo[playerid][PlayerCarModel2] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3];
  3252.  
  3253. PlayerInfo[playerid][PendingCarReceival] = -1;
  3254.  
  3255. SpawnOwnedCar(playerid, 2);
  3256.  
  3257. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3] = 0;
  3258. }
  3259. }
  3260. case 2:
  3261. {
  3262. if(PlayerInfo[playerid][GivingSlot] == 1)
  3263. {
  3264. if(PlayerInfo[playerid][Car3LinkID] >= 1)
  3265. {
  3266. DestroyVehicle(PlayerInfo[playerid][Car3LinkID]);
  3267. PlayerInfo[playerid][Car3LinkID] = 0;
  3268. PlayerInfo[playerid][PlayerCarModel3] = 0;
  3269. }
  3270.  
  3271. GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID], PlayerInfo[playerid][Car3X], PlayerInfo[playerid][Car3Y], PlayerInfo[playerid][Car3Z]);
  3272.  
  3273. DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID]);
  3274. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][CarLinkID] = 0;
  3275.  
  3276. PlayerInfo[playerid][PlayerCarModel3] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel];
  3277.  
  3278. PlayerInfo[playerid][PendingCarReceival] = -1;
  3279.  
  3280. SpawnOwnedCar(playerid, 3);
  3281.  
  3282. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel] = 0;
  3283. }
  3284.  
  3285. if(PlayerInfo[playerid][GivingSlot] == 2)
  3286. {
  3287. if(PlayerInfo[playerid][Car3LinkID] >= 1)
  3288. {
  3289. DestroyVehicle(PlayerInfo[playerid][Car3LinkID]);
  3290. PlayerInfo[playerid][Car3LinkID] = 0;
  3291. PlayerInfo[playerid][PlayerCarModel3] = 0;
  3292. }
  3293.  
  3294. GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID], PlayerInfo[playerid][Car3X], PlayerInfo[playerid][Car3Y], PlayerInfo[playerid][Car3Z]);
  3295.  
  3296. DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID]);
  3297. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car2LinkID] = 0;
  3298.  
  3299. PlayerInfo[playerid][PlayerCarModel3] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2];
  3300.  
  3301. PlayerInfo[playerid][PendingCarReceival] = -1;
  3302.  
  3303. SpawnOwnedCar(playerid, 3);
  3304.  
  3305. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel2] = 0;
  3306. }
  3307.  
  3308. if(PlayerInfo[playerid][GivingSlot] == 3)
  3309. {
  3310. if(PlayerInfo[playerid][Car3LinkID] >= 1)
  3311. {
  3312. DestroyVehicle(PlayerInfo[playerid][Car3LinkID]);
  3313. PlayerInfo[playerid][Car3LinkID] = 0;
  3314. PlayerInfo[playerid][PlayerCarModel3] = 0;
  3315. }
  3316.  
  3317. GetVehiclePos(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID], PlayerInfo[playerid][Car3X], PlayerInfo[playerid][Car3Y], PlayerInfo[playerid][Car3Z]);
  3318.  
  3319. DestroyVehicle(PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID]);
  3320. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][Car3LinkID] = 0;
  3321.  
  3322. PlayerInfo[playerid][PlayerCarModel3] = PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3];
  3323.  
  3324. PlayerInfo[playerid][PendingCarReceival] = -1;
  3325.  
  3326. SpawnOwnedCar(playerid, 3);
  3327.  
  3328. PlayerInfo[PlayerInfo[playerid][PendingCarReceival]][PlayerCarModel3] = 0;
  3329. }
  3330. }
  3331. }
  3332. }
  3333. case 348:
  3334. {
  3335. switch(listitem)
  3336. {
  3337. case 0:
  3338. {
  3339. if(PlayerInfo[playerid][pCash] >= 22000)
  3340. {
  3341. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3342. PlayerInfo[playerid][CarBeingCarried] = 536;
  3343. PlayerInfo[playerid][CarPriceBeingCarried] = 22000;
  3344. }
  3345. else
  3346. {
  3347. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3348. }
  3349. }
  3350. case 1:
  3351. {
  3352. if(PlayerInfo[playerid][pCash] >= 28000)
  3353. {
  3354. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3355. PlayerInfo[playerid][CarBeingCarried] = 534;
  3356. PlayerInfo[playerid][CarPriceBeingCarried] = 28000;
  3357. }
  3358. else
  3359. {
  3360. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3361. }
  3362. }
  3363. case 2:
  3364. {
  3365. if(PlayerInfo[playerid][pCash] >= 30000)
  3366. {
  3367. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3368. PlayerInfo[playerid][CarBeingCarried] = 567;
  3369. PlayerInfo[playerid][CarPriceBeingCarried] = 30000;
  3370. }
  3371. else
  3372. {
  3373. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3374. }
  3375. }
  3376. case 3:
  3377. {
  3378. if(PlayerInfo[playerid][pCash] >= 32000)
  3379. {
  3380. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3381. PlayerInfo[playerid][CarBeingCarried] = 535;
  3382. PlayerInfo[playerid][CarPriceBeingCarried] = 32000;
  3383. }
  3384. else
  3385. {
  3386. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3387. }
  3388. }
  3389. case 4:
  3390. {
  3391. if(PlayerInfo[playerid][pCash] >= 24500)
  3392. {
  3393. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3394. PlayerInfo[playerid][CarBeingCarried] = 576;
  3395. PlayerInfo[playerid][CarPriceBeingCarried] = 24500;
  3396. }
  3397. else
  3398. {
  3399. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3400. }
  3401. }
  3402. }
  3403. }
  3404. case 349:
  3405. {
  3406. switch(listitem)
  3407. {
  3408. case 0:
  3409. {
  3410. if(PlayerInfo[playerid][pCash] >= 34000)
  3411. {
  3412. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3413. PlayerInfo[playerid][CarBeingCarried] = 507;
  3414. PlayerInfo[playerid][CarPriceBeingCarried] = 34000;
  3415. }
  3416. else
  3417. {
  3418. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3419. }
  3420. }
  3421. case 1:
  3422. {
  3423. if(PlayerInfo[playerid][pCash] >= 30000)
  3424. {
  3425. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3426. PlayerInfo[playerid][CarBeingCarried] = 526;
  3427. PlayerInfo[playerid][CarPriceBeingCarried] = 30000;
  3428. }
  3429. else
  3430. {
  3431. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3432. }
  3433. }
  3434. case 2:
  3435. {
  3436. if(PlayerInfo[playerid][pCash] >= 45000)
  3437. {
  3438. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3439. PlayerInfo[playerid][CarBeingCarried] = 405;
  3440. PlayerInfo[playerid][CarPriceBeingCarried] = 45000;
  3441. }
  3442. else
  3443. {
  3444. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3445. }
  3446. }
  3447. case 3:
  3448. {
  3449. if(PlayerInfo[playerid][pCash] >= 55000)
  3450. {
  3451. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3452. PlayerInfo[playerid][CarBeingCarried] = 409;
  3453. PlayerInfo[playerid][CarPriceBeingCarried] = 55000;
  3454. }
  3455. else
  3456. {
  3457. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3458. }
  3459. }
  3460. case 4:
  3461. {
  3462. if(PlayerInfo[playerid][pCash] >= 33000)
  3463. {
  3464. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3465. PlayerInfo[playerid][CarBeingCarried] = 550;
  3466. PlayerInfo[playerid][CarPriceBeingCarried] = 33000;
  3467. }
  3468. else
  3469. {
  3470. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3471. }
  3472. }
  3473. case 5:
  3474. {
  3475. if(PlayerInfo[playerid][pCash] >= 38000)
  3476. {
  3477. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3478. PlayerInfo[playerid][CarBeingCarried] = 421;
  3479. PlayerInfo[playerid][CarPriceBeingCarried] = 38000;
  3480. }
  3481. else
  3482. {
  3483. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3484. }
  3485. }
  3486. }
  3487. }
  3488. case 350:
  3489. {
  3490. switch(listitem)
  3491. {
  3492. case 0:
  3493. {
  3494. if(PlayerInfo[playerid][pCash] >= 48000)
  3495. {
  3496. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3497. PlayerInfo[playerid][CarBeingCarried] = 579;
  3498. PlayerInfo[playerid][CarPriceBeingCarried] = 48000;
  3499. }
  3500. else
  3501. {
  3502. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3503. }
  3504. }
  3505. case 1:
  3506. {
  3507. if(PlayerInfo[playerid][pCash] >= 37000)
  3508. {
  3509. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3510. PlayerInfo[playerid][CarBeingCarried] = 400;
  3511. PlayerInfo[playerid][CarPriceBeingCarried] = 37000;
  3512. }
  3513. else
  3514. {
  3515. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3516. }
  3517. }
  3518. case 2:
  3519. {
  3520. if(PlayerInfo[playerid][pCash] >= 35000)
  3521. {
  3522. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3523. PlayerInfo[playerid][CarBeingCarried] = 500;
  3524. PlayerInfo[playerid][CarPriceBeingCarried] = 35000;
  3525. }
  3526. else
  3527. {
  3528. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3529. }
  3530. }
  3531. case 3:
  3532. {
  3533. if(PlayerInfo[playerid][pCash] >= 43000)
  3534. {
  3535. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3536. PlayerInfo[playerid][CarBeingCarried] = 489;
  3537. PlayerInfo[playerid][CarPriceBeingCarried] = 43000;
  3538. }
  3539. else
  3540. {
  3541. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3542. }
  3543. }
  3544. case 4:
  3545. {
  3546. if(PlayerInfo[playerid][pCash] >= 60000)
  3547. {
  3548. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3549. PlayerInfo[playerid][CarBeingCarried] = 495;
  3550. PlayerInfo[playerid][CarPriceBeingCarried] = 60000;
  3551. }
  3552. else
  3553. {
  3554. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3555. }
  3556. }
  3557. case 5:
  3558. {
  3559. if(PlayerInfo[playerid][pCash] >= 10000)
  3560. {
  3561. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3562. PlayerInfo[playerid][CarBeingCarried] = 554;
  3563. PlayerInfo[playerid][CarPriceBeingCarried] = 10000;
  3564. }
  3565. else
  3566. {
  3567. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3568. }
  3569. }
  3570. }
  3571. }
  3572. case 351:
  3573. {
  3574. switch(listitem)
  3575. {
  3576. case 0:
  3577. {
  3578. if(PlayerInfo[playerid][pCash] >= 120000)
  3579. {
  3580. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3581. PlayerInfo[playerid][CarBeingCarried] = 429;
  3582. PlayerInfo[playerid][CarPriceBeingCarried] = 120000;
  3583. }
  3584. else
  3585. {
  3586. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3587. }
  3588. }
  3589. case 1:
  3590. {
  3591. if(PlayerInfo[playerid][pCash] >= 57000)
  3592. {
  3593. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3594. PlayerInfo[playerid][CarBeingCarried] = 402;
  3595. PlayerInfo[playerid][CarPriceBeingCarried] = 57000;
  3596. }
  3597. else
  3598. {
  3599. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3600. }
  3601. }
  3602. case 2:
  3603. {
  3604. if(PlayerInfo[playerid][pCash] >= 80000)
  3605. {
  3606. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3607. PlayerInfo[playerid][CarBeingCarried] = 480;
  3608. PlayerInfo[playerid][CarPriceBeingCarried] = 80000;
  3609. }
  3610. else
  3611. {
  3612. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3613. }
  3614. }
  3615. case 3:
  3616. {
  3617. if(PlayerInfo[playerid][pCash] >= 90000)
  3618. {
  3619. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3620. PlayerInfo[playerid][CarBeingCarried] = 603;
  3621. PlayerInfo[playerid][CarPriceBeingCarried] = 90000;
  3622. }
  3623. else
  3624. {
  3625. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3626. }
  3627. }
  3628. case 4:
  3629. {
  3630. if(PlayerInfo[playerid][pCash] >= 85000)
  3631. {
  3632. ShowPlayerDialog(playerid, 94, DIALOG_STYLE_LIST, "Select a Slot", "Vehicle Slot 1\nVehicle Slot 2\nVehicle Slot 3", "Select", "Cancel");
  3633. PlayerInfo[playerid][CarBeingCarried] = 560;
  3634. PlayerInfo[playerid][CarPriceBeingCarried] = 85000;
  3635. }
  3636. else
  3637. {
  3638. SendClientMessage(playerid, WHITE, "You don't have enough.");
  3639. }
  3640. }
  3641. }
  3642. }
  3643. case 1000:
  3644. {
  3645. new name[MAX_PLAYER_NAME], file[256], string[128];
  3646. GetPlayerName(playerid, name, sizeof(name));
  3647. format(file, sizeof(file), SERVER_USER_FILE, name);
  3648. if(!response) return Kick(playerid);
  3649. if (!strlen(inputtext)) return
  3650. ShowPlayerDialog(playerid, 1000, DIALOG_STYLE_INPUT, "Not Registered!", "You are not registered!", "Register", "Leave");
  3651. dini_Create(file);
  3652. dini_FloatSet(file, "CarX",PlayerInfo[playerid][CarX] = 0);
  3653. dini_FloatSet(file, "CarY",PlayerInfo[playerid][CarY] = 0);
  3654. dini_FloatSet(file, "CarZ",PlayerInfo[playerid][CarZ] = 0);
  3655. dini_IntSet(file, "GivingSlot", PlayerInfo[playerid][GivingSlot] = 0);
  3656. dini_IntSet(file, "PendingCarReceival", PlayerInfo[playerid][PendingCarReceival] = 0);
  3657. dini_IntSet(file, "CarPaintJobID",PlayerInfo[playerid][CarPaintJobID] = 0);
  3658. dini_IntSet(file, "PlayerCarModel2",PlayerInfo[playerid][PlayerCarModel2] = 0);
  3659. dini_IntSet(file, "PlayerCarModel3",PlayerInfo[playerid][PlayerCarModel3] = 0);
  3660. dini_FloatSet(file, "Car2ZAngle",PlayerInfo[playerid][Car2ZAngle] = 0);
  3661. dini_FloatSet(file, "Car3ZAngle",PlayerInfo[playerid][Car3ZAngle] = 0);
  3662. dini_IntSet(file, "Car2Col1",PlayerInfo[playerid][Car2Col1] = 0);
  3663. dini_IntSet(file, "Car2Col2",PlayerInfo[playerid][Car2Col2] = 0);
  3664. dini_IntSet(file, "Car3Col1",PlayerInfo[playerid][Car3Col1] = 0);
  3665. dini_IntSet(file, "Car3Col2",PlayerInfo[playerid][Car3Col2] = 0);
  3666. dini_IntSet(file, "CarLinkID",PlayerInfo[playerid][CarLinkID] = 0);
  3667. dini_IntSet(file, "Car2LinkID",PlayerInfo[playerid][CarLinkID] = 0);
  3668. dini_IntSet(file, "Car3LinkID",PlayerInfo[playerid][Car3LinkID] = 0);
  3669. dini_IntSet(file, "Car2PaintJobID",PlayerInfo[playerid][Car2PaintJobID] = 0);
  3670. dini_IntSet(file, "Car3PaintJobID",PlayerInfo[playerid][Car3PaintJobID] = 0);
  3671. dini_FloatSet(file, "Car2X",PlayerInfo[playerid][Car2X] = 0);
  3672. dini_FloatSet(file, "Car2Y",PlayerInfo[playerid][Car2Y] = 0);
  3673. dini_FloatSet(file, "Car2Z",PlayerInfo[playerid][Car2Z] = 0);
  3674. dini_FloatSet(file, "Car3X",PlayerInfo[playerid][Car3X] = 0);
  3675. dini_FloatSet(file, "Car3Y",PlayerInfo[playerid][Car3Y] = 0);
  3676. dini_FloatSet(file, "Car3Z",PlayerInfo[playerid][Car3Z] = 0);
  3677. dini_FloatSet(file, "CarZAngle",PlayerInfo[playerid][CarZAngle] = 0);
  3678. dini_IntSet(file, "PlayerCarModel",PlayerInfo[playerid][PlayerCarModel] = 0);
  3679. dini_IntSet(file, "CarCol1",PlayerInfo[playerid][CarCol1] = 0);
  3680. dini_IntSet(file, "CarCol2",PlayerInfo[playerid][CarCol2] = 0);
  3681. dini_IntSet(file, "Password",udb_hash(inputtext));
  3682. dini_IntSet(file, "AdminLevel",PlayerInfo[playerid][pAdminLevel] = 0);
  3683. dini_IntSet(file, "Money",PlayerInfo[playerid][pCash] = 500);
  3684. dini_IntSet(file, "Group",PlayerInfo[playerid][Group] = 0);
  3685. dini_IntSet(file, "GroupRank",PlayerInfo[playerid][GroupRank] = 0);
  3686. dini_IntSet(file, "Job",PlayerInfo[playerid][pJob] = 0);
  3687. dini_IntSet(file, "Skin", PlayerInfo[playerid][Skin] = 0);
  3688. dini_IntSet(file, "Fish",PlayerInfo[playerid][Fish] = 0);
  3689. dini_IntSet(file, "FishBait",PlayerInfo[playerid][FishBait] = 0);
  3690. dini_IntSet(file, "FishRod",PlayerInfo[playerid][FishRod] = 0);
  3691. dini_IntSet(file, "FishWeight",PlayerInfo[playerid][FishWeight] = 0);
  3692. dini_IntSet(file, "FishLicense",PlayerInfo[playerid][FishLicense] = 0);
  3693. dini_IntSet(file, "House",PlayerInfo[playerid][House] = 0);
  3694. dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0);
  3695. dini_IntSet(file, "Spawn",PlayerInfo[playerid][PlayerSpawn] = 0);
  3696. dini_IntSet(file, "Mats",PlayerInfo[playerid][pMats] = 0);
  3697. dini_IntSet(file, "BankMoney", PlayerInfo[playerid][BankMoney] = 0);
  3698. dini_IntSet(file, "Minutes", PlayerInfo[playerid][Minutes] = 0);
  3699. dini_IntSet(file, "Seconds", PlayerInfo[playerid][Seconds] = 0);
  3700. dini_IntSet(file, "Kills",PlayerInfo[playerid][Kills] = 0);
  3701. dini_IntSet(file, "Deaths",PlayerInfo[playerid][Deaths] = 0);
  3702. dini_IntSet(file, "Animcation", PlayerInfo[playerid][Animation] = 0);
  3703. dini_IntSet(file, "BeingDraggedBy",PlayerInfo[playerid][BeingDraggedBy] = 0);
  3704. dini_IntSet(file, "WepSlot0",PlayerInfo[playerid][WepSlot0] = 0);
  3705. dini_IntSet(file, "WepSlot1",PlayerInfo[playerid][WepSlot1] = 0);
  3706. dini_IntSet(file, "WepSlot2",PlayerInfo[playerid][WepSlot2] = 0);
  3707. dini_IntSet(file, "WepSlot3",PlayerInfo[playerid][WepSlot3] = 0);
  3708. dini_IntSet(file, "WepSlot4",PlayerInfo[playerid][WepSlot4] = 0);
  3709. dini_IntSet(file, "WepSlot5",PlayerInfo[playerid][WepSlot5] = 0);
  3710. dini_IntSet(file, "WepSlot6",PlayerInfo[playerid][WepSlot6] = 0);
  3711. dini_IntSet(file, "WepSlot7",PlayerInfo[playerid][WepSlot7] = 0);
  3712. dini_IntSet(file, "WepSlot8",PlayerInfo[playerid][WepSlot8] = 0);
  3713. dini_IntSet(file, "WepSlot9",PlayerInfo[playerid][WepSlot9] = 0);
  3714. dini_IntSet(file, "WepSlot10",PlayerInfo[playerid][WepSlot10] = 0);
  3715. dini_IntSet(file, "WepSlot11",PlayerInfo[playerid][WepSlot11] = 0);
  3716. dini_IntSet(file, "WepSlot12",PlayerInfo[playerid][WepSlot12] = 0);
  3717. dini_IntSet(file, "WepSlot13",PlayerInfo[playerid][WepSlot13] = 0);
  3718. dini_IntSet(file, "WepSlot14",PlayerInfo[playerid][WepSlot14] = 0);
  3719. dini_IntSet(file, "WepSlot15",PlayerInfo[playerid][WepSlot15] = 0);
  3720. dini_IntSet(file, "Level",PlayerInfo[playerid][pLevel] = 0);
  3721. dini_IntSet(file, "Score",PlayerInfo[playerid][pScore] = 0);
  3722. format(string, 128, "[SYSTEM]: You succesfully registered the name [ %s ] with password [ %s ]!", name, inputtext);
  3723. PutPlayerInTutorial(playerid);
  3724. SendClientMessage(playerid, COLOR_YELLOW, string);
  3725. gPlayerLogged[playerid] = 1;
  3726. }
  3727. case 2000:
  3728. {
  3729. new name[MAX_PLAYER_NAME], file[256];
  3730. GetPlayerName(playerid, name, sizeof(name));
  3731. format(file, sizeof(file), SERVER_USER_FILE, name);
  3732. if(!response) return Kick(playerid);
  3733. if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Registered!", "You are registered! Type in your password to login.", "Login", "Leave");
  3734. new tmp;
  3735. tmp = dini_Int(file, "Password");
  3736. if(udb_hash(inputtext) != tmp)
  3737. {
  3738. ShowPlayerDialog(playerid, 2000, DIALOG_STYLE_INPUT, "Registered!", "You are registered! Type in your password to login.", "Login", "Leave");
  3739. }
  3740. else
  3741. {
  3742. gPlayerLogged[playerid] = 1;
  3743. PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
  3744. PlayerInfo[playerid][pCash] = dini_Int(file, "Money");
  3745. PlayerInfo[playerid][Group] = dini_Int(file, "Group");
  3746. PlayerInfo[playerid][GroupRank] = dini_Int(file, "GroupRank");
  3747. PlayerInfo[playerid][pJob] = dini_Int(file, "Job");
  3748. PlayerInfo[playerid][Skin] = dini_Int(file, "Skin");
  3749. PlayerInfo[playerid][pScore] = dini_Int(file, "Score");
  3750. PlayerInfo[playerid][Deaths] = dini_Int(file, "Deaths");
  3751. PlayerInfo[playerid][Kills] = dini_Int(file, "Kills");
  3752. PlayerInfo[playerid][PendingCarReceival] = dini_Int(file, "PendingCarReceival");
  3753. PlayerInfo[playerid][GivingSlot] = dini_Int(file, "GivingSlot");
  3754. PlayerInfo[playerid][FishBait] = dini_Int(file, "FishBait");
  3755. PlayerInfo[playerid][FishWeight] = dini_Int(file, "FishWeight");
  3756. PlayerInfo[playerid][FishRod] = dini_Int(file, "FishRod");
  3757. PlayerInfo[playerid][FishLicense] = dini_Int(file, "FishLicense");
  3758. PlayerInfo[playerid][Fish] = dini_Int(file, "Fish");
  3759. PlayerInfo[playerid][pMats] = dini_Int(file, "Mats");
  3760. PlayerInfo[playerid][Minutes] = dini_Int(file, "Minutes");
  3761. PlayerInfo[playerid][Seconds] = dini_Int(file, "Seconds");
  3762. PlayerInfo[playerid][BankMoney] = dini_Int(file, "BankMoney");
  3763. PlayerInfo[playerid][WepSlot0] = dini_Int(file, "WepSlot0");
  3764. PlayerInfo[playerid][WepSlot1] = dini_Int(file, "WepSlot1");
  3765. PlayerInfo[playerid][WepSlot2] = dini_Int(file, "WepSlot2");
  3766. PlayerInfo[playerid][WepSlot3] = dini_Int(file, "WepSlot3");
  3767. PlayerInfo[playerid][WepSlot4] = dini_Int(file, "WepSlot4");
  3768. PlayerInfo[playerid][WepSlot5] = dini_Int(file, "WepSlot5");
  3769. PlayerInfo[playerid][WepSlot6] = dini_Int(file, "WepSlot6");
  3770. PlayerInfo[playerid][WepSlot7] = dini_Int(file, "WepSlot7");
  3771. PlayerInfo[playerid][WepSlot8] = dini_Int(file, "WepSlot8");
  3772. PlayerInfo[playerid][WepSlot9] = dini_Int(file, "WepSlot9");
  3773. PlayerInfo[playerid][WepSlot10] = dini_Int(file, "WepSlot10");
  3774. PlayerInfo[playerid][WepSlot11] = dini_Int(file, "WepSlot11");
  3775. PlayerInfo[playerid][WepSlot12] = dini_Int(file, "WepSlot12");
  3776. PlayerInfo[playerid][WepSlot13] = dini_Int(file, "WepSlot13");
  3777. PlayerInfo[playerid][WepSlot14] = dini_Int(file, "WepSlot14");
  3778. PlayerInfo[playerid][WepSlot15] = dini_Int(file, "WepSlot15");
  3779. PlayerInfo[playerid][CarX] = dini_Int(file, "CarX");
  3780. PlayerInfo[playerid][CarY] = dini_Int(file, "CarY");
  3781. PlayerInfo[playerid][CarZ] = dini_Int(file, "CarZ");
  3782. PlayerInfo[playerid][CarPaintJobID] = dini_Int(file, "CarPaintJobID");
  3783. PlayerInfo[playerid][PlayerCarModel2] = dini_Int(file, "PlayerCarModel2");
  3784. PlayerInfo[playerid][PlayerCarModel3] = dini_Int(file, "PlayerCarModel3");
  3785. PlayerInfo[playerid][Car2ZAngle] = dini_Int(file, "Car2ZAngle");
  3786. PlayerInfo[playerid][Car3ZAngle] = dini_Int(file, "Car3ZAngle");
  3787. PlayerInfo[playerid][Car2Col1] = dini_Int(file, "Car2Col1");
  3788. PlayerInfo[playerid][Car2Col2] = dini_Int(file, "Car2Col2");
  3789. PlayerInfo[playerid][Car3Col1] = dini_Int(file, "Car3Col1");
  3790. PlayerInfo[playerid][Car3Col2] = dini_Int(file, "Car3Col2");
  3791. PlayerInfo[playerid][CarLinkID] = dini_Int(file, "CarLinkID");
  3792. PlayerInfo[playerid][Car2LinkID] = dini_Int(file, "Car2LinkID");
  3793. PlayerInfo[playerid][Car3LinkID] = dini_Int(file, "Car3LinkID");
  3794. PlayerInfo[playerid][Car2PaintJobID] = dini_Int(file, "Car2PaitnJobID");
  3795. PlayerInfo[playerid][Car3PaintJobID] = dini_Int(file, "Car3PaitnJobID");
  3796. PlayerInfo[playerid][Car2X] = dini_Int(file, "Car2X");
  3797. PlayerInfo[playerid][Car2Y] = dini_Int(file, "Car2Y");
  3798. PlayerInfo[playerid][Car2Z] = dini_Int(file, "Car2Z");
  3799. PlayerInfo[playerid][Car3X] = dini_Int(file, "Car3X");
  3800. PlayerInfo[playerid][Car3Y] = dini_Int(file, "Car3Y");
  3801. PlayerInfo[playerid][Car3Z] = dini_Int(file, "Car3Z");
  3802. PlayerInfo[playerid][CarZAngle] = dini_Int(file, "CarZAngle");
  3803. PlayerInfo[playerid][PlayerCarModel] = dini_Int(file, "PlayerCarModel");
  3804. PlayerInfo[playerid][CarCol1] = dini_Int(file, "CarCol1");
  3805. PlayerInfo[playerid][CarCol2] = dini_Int(file, "CarCol2");
  3806. SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
  3807. GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
  3808. SendClientMessage(playerid,COLOR_RED, "[SYSTEM]: Successfully logged in!");
  3809. SpawnPlayerAlways(playerid);
  3810. }
  3811. }
  3812. case 1:
  3813. {
  3814. switch(listitem)
  3815. {
  3816. case 0:
  3817. {
  3818. SendClientMessage(playerid, WHITE, "/pm[playerid](ooc messages), /makegun");
  3819. }
  3820. case 1:
  3821. {
  3822. SendClientMessage(playerid, WHITE, "/bar, /hide, /handsup, /rap, /reload, /laugh, /dance, /sit, /gsit, /ko, /wave, /spank");
  3823. SendClientMessage(playerid, WHITE, "/fuckoff, /chat, /deal, /vomit, /bomb, /crack, /piss, /masturbate, /crossarms, /robman, /pedmove");
  3824. }
  3825. case 2:
  3826. {
  3827. SendClientMessage(playerid, WHITE, "/eon - Car Engine ON, /eoff - Car Engine OFF, /open(close)trunk - Open and Close Trunk");
  3828. SendClientMessage(playerid, WHITE, "/lon(off) - Turn lights on and off, /open(close)hood - Open and Close Hood");
  3829. }
  3830. }
  3831. }
  3832. case 10:
  3833. {
  3834. switch(listitem)
  3835. {
  3836. case 0:
  3837. {
  3838. if(PlayerInfo[playerid][pCash] >= 10)
  3839. {
  3840. if(PlayerInfo[playerid][FishBait] <= 500)
  3841. {
  3842. PlayerInfo[playerid][FishBait] += 25;
  3843. PlayerInfo[playerid][pCash] -= 10;
  3844. SendClientMessage(playerid, WHITE, "You have baught 25 Fishing Bait!");
  3845. }
  3846. else
  3847. {
  3848. SendClientMessage(playerid, WHITE, "You can only have a maximum of 500 Fish Bait!");
  3849. }
  3850. }
  3851. }
  3852. case 1:
  3853. {
  3854. if(PlayerInfo[playerid][pCash] >= 250)
  3855. {
  3856. if(PlayerInfo[playerid][FishLicense] == 0)
  3857. {
  3858. PlayerInfo[playerid][FishLicense] = 1;
  3859. PlayerInfo[playerid][pCash] -= 250;
  3860. SendClientMessage(playerid, WHITE, "You have purchased a Fishing License!");
  3861. }
  3862. }
  3863. else
  3864. {
  3865. SendClientMessage(playerid, WHITE, "You already have a Fishing License!");
  3866. }
  3867. }
  3868. case 2:
  3869. {
  3870. if(PlayerInfo[playerid][pCash] >= 150)
  3871. {
  3872. if(PlayerInfo[playerid][FishRod] == 0)
  3873. {
  3874. PlayerInfo[playerid][FishRod] = 1;
  3875. PlayerInfo[playerid][pCash] -= 150;
  3876. SendClientMessage(playerid, WHITE, "You have purchased a Fishing Rod!");
  3877. }
  3878. }
  3879. else
  3880. {
  3881. SendClientMessage(playerid, WHITE, "You already have a Fishing Rod!");
  3882. }
  3883. }
  3884. }
  3885. }
  3886. case 2:
  3887. {
  3888. switch(listitem)
  3889. {
  3890. case 0:
  3891. {
  3892. if(PlayerInfo[playerid][pMats] >= 100)
  3893. {
  3894. if(PlayerInfo[playerid][pCash] >= 100)
  3895. {
  3896. PlayerInfo[playerid][pCash] -= 100;
  3897. PlayerInfo[playerid][pMats] -= 100;
  3898. GivePlayerWeapon(playerid, 1, 1000);
  3899. SendClientMessage(playerid, WHITE, "You have made a pair of Brass Knuckles for 100 materials and $100.");
  3900. PlayerInfo[playerid][WepSlot0] = 1;
  3901. }
  3902. else
  3903. {
  3904. SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
  3905. }
  3906. }
  3907. else
  3908. {
  3909. SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
  3910. }
  3911. }
  3912. case 1:
  3913. {
  3914. if(PlayerInfo[playerid][pMats] >= 300)
  3915. {
  3916. if(PlayerInfo[playerid][pCash] >= 300)
  3917. {
  3918. PlayerInfo[playerid][pCash] -= 300;
  3919. PlayerInfo[playerid][pMats] -= 300;
  3920. GivePlayerWeapon(playerid, 4, 1000);
  3921. SendClientMessage(playerid, WHITE, "You have made an Assasin's Knife for 300 materials and $300.");
  3922. PlayerInfo[playerid][WepSlot1] = 4;
  3923. }
  3924. else
  3925. {
  3926. SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
  3927. }
  3928. }
  3929. else
  3930. {
  3931. SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
  3932. }
  3933. }
  3934. case 2:
  3935. {
  3936. if(PlayerInfo[playerid][pMats] >= 500)
  3937. {
  3938. if(PlayerInfo[playerid][pCash] >= 500)
  3939. {
  3940. PlayerInfo[playerid][pCash] -= 500;
  3941. PlayerInfo[playerid][pMats] -= 500;
  3942. GivePlayerWeapon(playerid, 22, 1000);
  3943. SendClientMessage(playerid, WHITE, "You have made a 9MM for 500 materials and $500.");
  3944. PlayerInfo[playerid][WepSlot2] = 22;
  3945. }
  3946. else
  3947. {
  3948. SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
  3949. }
  3950. }
  3951. else
  3952. {
  3953. SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
  3954. }
  3955. }
  3956. case 3:
  3957. {
  3958. if(PlayerInfo[playerid][pMats] >= 700)
  3959. {
  3960. if(PlayerInfo[playerid][pCash] >= 700)
  3961. {
  3962. PlayerInfo[playerid][pCash] -= 700;
  3963. PlayerInfo[playerid][pMats] -= 700;
  3964. GivePlayerWeapon(playerid, 24, 1000);
  3965. SendClientMessage(playerid, WHITE, "You have made a Desert Eagle for 700 materials and $700.");
  3966. PlayerInfo[playerid][WepSlot3] = 24;
  3967. }
  3968. else
  3969. {
  3970. SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
  3971. }
  3972. }
  3973. else
  3974. {
  3975. SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
  3976. }
  3977. }
  3978. case 4:
  3979. {
  3980. if(PlayerInfo[playerid][pMats] >= 900)
  3981. {
  3982. if(PlayerInfo[playerid][pCash] >= 900)
  3983. {
  3984. PlayerInfo[playerid][pCash] -= 900;
  3985. PlayerInfo[playerid][pMats] -= 900;
  3986. GivePlayerWeapon(playerid, 25, 1000);
  3987. SendClientMessage(playerid, WHITE, "You have made a Shotgun for 900 materials and $900.");
  3988. PlayerInfo[playerid][WepSlot4] = 25;
  3989. }
  3990. else
  3991. {
  3992. SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
  3993. }
  3994. }
  3995. else
  3996. {
  3997. SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
  3998. }
  3999. }
  4000. case 5:
  4001. {
  4002. if(PlayerInfo[playerid][pMats] >= 1100)
  4003. {
  4004. if(PlayerInfo[playerid][pCash] >= 1100)
  4005. {
  4006. PlayerInfo[playerid][pCash] -= 1100;
  4007. PlayerInfo[playerid][pMats] -= 1100;
  4008. GivePlayerWeapon(playerid, 29, 1000);
  4009. SendClientMessage(playerid, WHITE, "You have made an MP-5 for 1100 materials and $1100.");
  4010. PlayerInfo[playerid][WepSlot5] = 29;
  4011. }
  4012. else
  4013. {
  4014. SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
  4015. }
  4016. }
  4017. else
  4018. {
  4019. SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
  4020. }
  4021. }
  4022. case 6:
  4023. {
  4024. if(PlayerInfo[playerid][pMats] >= 1500)
  4025. {
  4026. if(PlayerInfo[playerid][pCash] >= 1500)
  4027. {
  4028. PlayerInfo[playerid][pCash] -= 1500;
  4029. PlayerInfo[playerid][pMats] -= 1500;
  4030. GivePlayerWeapon(playerid, 30, 1000);
  4031. SendClientMessage(playerid, WHITE, "You have made an AK-47 for 1500 materials and $1500.");
  4032. PlayerInfo[playerid][WepSlot6] = 30;
  4033. }
  4034. else
  4035. {
  4036. SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
  4037. }
  4038. }
  4039. else
  4040. {
  4041. SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
  4042. }
  4043. }
  4044. case 7:
  4045. {
  4046. if(PlayerInfo[playerid][pMats] >= 2000)
  4047. {
  4048. if(PlayerInfo[playerid][pCash] >= 2000)
  4049. {
  4050. PlayerInfo[playerid][pCash] -= 2000;
  4051. PlayerInfo[playerid][pMats] -= 2000;
  4052. GivePlayerWeapon(playerid, 31, 1000);
  4053. SendClientMessage(playerid, WHITE, "You have made an M4A1 for 2000 materials and $2000.");
  4054. PlayerInfo[playerid][WepSlot7] = 31;
  4055. }
  4056. else
  4057. {
  4058. SendClientMessage(playerid, WHITE, "You do not have enough money to do this!");
  4059. }
  4060. }
  4061. else
  4062. {
  4063. SendClientMessage(playerid, WHITE, "You do not have enough materials to do this!");
  4064. }
  4065. }
  4066. }
  4067. }
  4068. }
  4069.  
  4070. }
  4071. return 1;
  4072. }
  4073.  
  4074. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  4075. {
  4076. return 1;
  4077. }
  4078.  
  4079. public SetPlayerPosEx(playerid, Float: posx, Float: posy, Float: posz, interior, virtualworld)
  4080. {
  4081. if(GetPlayerState(playerid) == 2)
  4082. {
  4083. SetPlayerVirtualWorld(playerid, virtualworld);
  4084. SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), virtualworld);
  4085. LinkVehicleToInterior(GetPlayerVehicleID(playerid), interior);
  4086. SetPlayerInterior(playerid, interior);
  4087. SetVehiclePos(GetPlayerVehicleID(playerid), posx, posy, posz);
  4088. return 1;
  4089. }
  4090. else
  4091. {
  4092. SetPlayerVirtualWorld(playerid, virtualworld);
  4093. SetPlayerInterior(playerid, interior);
  4094. SetPlayerPos(playerid, posx, posy, posz);
  4095. return 1;
  4096. }
  4097. }
  4098.  
  4099. //zcmd commands below
  4100. command(set, playerid, params[])
  4101. {
  4102. new Usage[128], id, string[128], string2[128], amount;
  4103. if(sscanf(params, "zud", Usage, id, amount))
  4104. {
  4105. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4106. {
  4107. SendClientMessage(playerid, WHITE, "SYNTAX: /set [usage] [id] [amount]");
  4108. SendClientMessage(playerid, GREY, "Usages: Health, Armour, VirtualWorld");
  4109. }
  4110. }
  4111. else
  4112. {
  4113. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4114. {
  4115. if(strcmp(Usage, "Health", true) == 0)
  4116. {
  4117. SetPlayerHealth(id, amount);
  4118. format(string, sizeof(string), "Admin %s has set your Health to %d.", GetName(playerid), amount);
  4119. SendClientMessage(id, WHITE, string);
  4120. format(string2, sizeof(string2), "You have set %s's Health to %d.", GetName(id), amount);
  4121. SendClientMessage(playerid, WHITE, string2);
  4122. }
  4123. else if(strcmp(Usage, "Armour", true) == 0)
  4124. {
  4125. SetPlayerArmour(id, amount);
  4126. format(string, sizeof(string), "Admin %s has set your Armour to %d.", GetName(playerid), amount);
  4127. SendClientMessage(id, WHITE, string);
  4128. format(string2, sizeof(string2), "You have set %s's Armour to %d.", GetName(id), amount);
  4129. SendClientMessage(playerid, WHITE, string2);
  4130. }
  4131. else if(strcmp(Usage, "Virtualworld", true) == 0)
  4132. {
  4133. SetPlayerHealth(id, amount);
  4134. format(string, sizeof(string), "Admin %s has set your VirtualWorld to %d.", GetName(playerid), amount);
  4135. SendClientMessage(id, WHITE, string);
  4136. format(string2, sizeof(string2), "You have set %s's VirtualWorld to %d.", GetName(id), amount);
  4137. SendClientMessage(playerid, WHITE, string2);
  4138. }
  4139. }
  4140. }
  4141. return 1;
  4142. }
  4143.  
  4144. command(admins, playerid, params[])
  4145. {
  4146. #pragma unused params
  4147. new string[128];
  4148.  
  4149. SendClientMessage(playerid, WHITE, "---------------------------------------------------------------------------------------------------------------------------------");
  4150.  
  4151. for(new i = 0; i < MAX_PLAYERS; i++)
  4152. {
  4153. if(IsPlayerConnected(i))
  4154. {
  4155. if(AdminDuty[i] == 1)
  4156. {
  4157. if(Afk[i] == 0)
  4158. {
  4159. format(string, sizeof(string), "Administrator %s (Level %d): On Admin Duty (/assitance available).", GetName(i), PlayerInfo[i][pAdminLevel]);
  4160. SendClientMessage(playerid, GREEN, string);
  4161. }
  4162. }
  4163. if(AdminDuty[i] == 1)
  4164. {
  4165. if(Afk[i] == 1)
  4166. {
  4167. format(string, sizeof(string), "Administrator %s (Level %d): On Admin Duty & AFK.", GetName(i), PlayerInfo[i][pAdminLevel]);
  4168. SendClientMessage(playerid, GREEN, string);
  4169. }
  4170. }
  4171. if(AdminDuty[i] == 0)
  4172. {
  4173. format(string, sizeof(string), "Administrator %s (Level %d): Roleplaying.", GetName(i), PlayerInfo[i][pAdminLevel]);
  4174. SendClientMessage(playerid, GREEN, string);
  4175. }
  4176. }
  4177. }
  4178.  
  4179. SendClientMessage(playerid, WHITE, "---------------------------------------------------------------------------------------------------------------------------------");
  4180. return 1;
  4181. }
  4182.  
  4183. command(heal, playerid, params[])
  4184. {
  4185. new id, string[128];
  4186. if(sscanf(params, "u", id))
  4187. {
  4188. SendClientMessage(playerid, WHITE, "SYNTAX: /heal [playerid]");
  4189. }
  4190. else
  4191. {
  4192. if(IsPlayerConnected(id))
  4193. {
  4194. if(GetDistanceBetweenPlayers(playerid, id) < 2)
  4195. {
  4196. if(PlayerInfo[playerid][Group] == 2)
  4197. {
  4198. PlayerInfo[id][PendingHeal] = playerid;
  4199. format(string, sizeof(string), "You have requested to Heal %s.", GetName(id));
  4200. SendClientMessage(playerid, WHITE, string);
  4201. format(string, sizeof(string), "%s is requesting to Heal you... Type /approve heal to accept it!", GetName(playerid));
  4202. SendClientMessage(id, NICESKY, string);
  4203. }
  4204. else
  4205. {
  4206. SendClientMessage(playerid, WHITE, "You are not a member of the Fire Department!");
  4207. }
  4208. }
  4209. else
  4210. {
  4211. SendClientMessage(playerid, WHITE, "You must be closer to the player to perform this action!");
  4212. }
  4213. }
  4214. else
  4215. {
  4216. SendClientMessage(playerid, WHITE, "That player is not connected!");
  4217. }
  4218. }
  4219. return 1;
  4220. }
  4221.  
  4222. command(buyclothes, playerid, params[])
  4223. {
  4224. if(IsPlayerInRangeOfPoint(playerid, 5.0, 207.6361,-100.8324,1005.2578))
  4225. {
  4226. if(InClothesShop[playerid] == 1)
  4227. {
  4228. ShowPlayerDialog(playerid, 300, DIALOG_STYLE_INPUT, "Change Skin", "Enter a skin ID below to get started", "Confirm", "Cancel");
  4229. }
  4230. else
  4231. {
  4232. SendClientMessage(playerid, WHITE, "You are not in the clothes shop!");
  4233. }
  4234. }
  4235. else
  4236. {
  4237. SendClientMessage(playerid, WHITE, "You must be in the clothes shop at the register to purchase clothes!");
  4238. }
  4239. return 1;
  4240. }
  4241.  
  4242. command(shout, playerid, params[])
  4243. {
  4244. new message[128], string[128];
  4245. if(sscanf(params, "z", message))
  4246. {
  4247. SendClientMessage(playerid, WHITE, "SYNTAX: /(s)hout [message]");
  4248. }
  4249. else
  4250. {
  4251. format(string, sizeof(string), "%s shouts: %s!", GetName(playerid), message);
  4252. NearByMessageEx(playerid, WHITE, string, 30.0);
  4253. }
  4254. return 1;
  4255. }
  4256.  
  4257. command(aduty, playerid, params[])
  4258. {
  4259. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4260. {
  4261. if(AdminDuty[playerid] == 0)
  4262. {
  4263. AdminDuty[playerid] = 1;
  4264. SetPlayerHealth(playerid, 50000);
  4265. SetPlayerArmour(playerid, 50000);
  4266. SetPlayerColor(playerid, ADMINORANGE);
  4267. }
  4268. else
  4269. {
  4270. AdminDuty[playerid] = 0;
  4271. SetPlayerHealth(playerid, 100);
  4272. SetPlayerArmour(playerid, 100);
  4273. SetPlayerColor(playerid, WHITE);
  4274. }
  4275. }
  4276. else
  4277. {
  4278. SendClientMessage(playerid, WHITE, "You are not an Administrator!");
  4279. }
  4280. return 1;
  4281. }
  4282.  
  4283. command(s, playerid, params[])
  4284. {
  4285. return cmd_shout(playerid, params);
  4286. }
  4287.  
  4288. command(do, playerid, params[])
  4289. {
  4290. new Message[128], string[128];
  4291. if(sscanf(params, "z", Message))
  4292. {
  4293. SendClientMessage(playerid, WHITE, "SYNTAX: /do [action]");
  4294. }
  4295. else
  4296. {
  4297. if(strlen(Message) < 1 || !IsPlayerConnected(playerid))
  4298. {
  4299. return 1;
  4300. }
  4301. else
  4302. {
  4303. format(string, sizeof(string), "* %s ((%s)) ", Message, GetName(playerid));
  4304. NearByMessage(playerid, NICESKY, string);
  4305. }
  4306. }
  4307. return 1;
  4308. }
  4309.  
  4310. command(get, playerid, params[])
  4311. {
  4312. new id, string[128], Float: ToX, Float: ToY, Float: ToZ;
  4313. if(sscanf(params, "u", id))
  4314. {
  4315. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4316. {
  4317. SendClientMessage(playerid, LOGIN, "USAGE: /get [playerid]");
  4318. }
  4319. }
  4320. else
  4321. {
  4322. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4323. {
  4324. if(IsPlayerConnected(id))
  4325. {
  4326. GetPlayerPos(playerid, ToX, ToY, ToZ);
  4327. SetPlayerInterior(id, GetPlayerInterior(playerid));
  4328. SetPlayerVirtualWorld(id, GetPlayerVirtualWorld(playerid));
  4329. SetPlayerPos(id, ToX, ToY+2, ToZ);
  4330. format(string, sizeof(string), "%s has teleported you over to him / her.", GetName(playerid));
  4331. SendClientMessage(id, LOGIN, string);
  4332. format(string, sizeof(string), "You have teleported %s to you.", GetName(id));
  4333. SendClientMessage(playerid, LOGIN, string);
  4334. }
  4335. else
  4336. {
  4337. SendClientMessage(playerid, LOGIN, "That player is not connected or isn't logged in.");
  4338. }
  4339. }
  4340. }
  4341. return 1;
  4342. }
  4343.  
  4344. command(goto, playerid, params[])
  4345. {
  4346. new id, string[128], Float: ToX, Float: ToY, Float: ToZ;
  4347. if(sscanf(params, "u", id))
  4348. {
  4349. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4350. {
  4351. SendClientMessage(playerid, LOGIN, "USAGE: /goto [playerid]");
  4352. }
  4353. }
  4354. else
  4355. {
  4356. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4357. {
  4358. if(IsPlayerConnected(id))
  4359. {
  4360. GetPlayerPos(id, ToX, ToY, ToZ);
  4361. SetPlayerPosEx(playerid, ToX, ToY, ToZ, GetPlayerInterior(id), GetPlayerVirtualWorld(id));
  4362. format(string, sizeof(string), "You have teleported to %s.", GetName(id));
  4363. SendClientMessage(playerid, LOGIN, string);
  4364. }
  4365. else
  4366. {
  4367. SendClientMessage(playerid, LOGIN, "That player is not connected or isn't logged in.");
  4368. }
  4369. }
  4370. }
  4371. return 1;
  4372. }
  4373.  
  4374. command(kill, playerid, params[])
  4375. {
  4376. new id, string[128];
  4377. if(sscanf(params, "uz", id))
  4378. {
  4379. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4380. {
  4381. SendClientMessage(playerid, LOGIN, "USAGE: /kill [playerid]");
  4382. }
  4383. }
  4384. else
  4385. {
  4386. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4387. {
  4388. if(IsPlayerConnected(playerid))
  4389. {
  4390. if(PlayerInfo[playerid][pAdminLevel] > PlayerInfo[id][pAdminLevel])
  4391. {
  4392. format(string, sizeof(string), "[Kill] Admin %s has killed %s (/kill).", GetName(playerid), GetName(id));
  4393. SetPlayerHealth(id, 0);
  4394. SendClientMessageToAll(ADMINORANGE, string);
  4395. }
  4396. else
  4397. {
  4398. SendClientMessage(playerid, WHITE, "You are unable to kill that player!");
  4399. }
  4400. }
  4401. else
  4402. {
  4403. SendClientMessage(playerid, LOGIN, "That player is not connected!");
  4404. }
  4405. }
  4406. else
  4407. {
  4408. SendClientMessage(playerid, LOGIN, "You are not an admin!");
  4409. }
  4410. }
  4411. return 1;
  4412. }
  4413.  
  4414. command(ragequit, playerid, params[])
  4415. {
  4416. new reason[128], string[128];
  4417. if(sscanf(params, "uz", reason))
  4418. {
  4419. SendClientMessage(playerid, LOGIN, "USAGE: /ragequit(/rq) [reason]");
  4420. }
  4421. else
  4422. {
  4423. format(string, sizeof(string), "RAGEQUIT!: %s has ragequit! (Reason: %s)", GetName(playerid));
  4424. SendClientMessageToAll(COLOR_RED, string);
  4425. Kick(playerid);
  4426. }
  4427. return 1;
  4428. }
  4429.  
  4430. command(rq, playerid, params[])
  4431. {
  4432. new reason[128], string[128];
  4433. if(sscanf(params, "uz", reason))
  4434. {
  4435. SendClientMessage(playerid, LOGIN, "USAGE: /rq(/ragequit) [reason]");
  4436. }
  4437. else
  4438. {
  4439. format(string, sizeof(string), "RAGEQUIT!: %s has ragequit! (Reason: %s)", GetName(playerid));
  4440. SendClientMessageToAll(COLOR_RED, string);
  4441. Kick(playerid);
  4442. }
  4443. return 1;
  4444. }
  4445.  
  4446. command(pm, playerid, params[])
  4447. {
  4448. new string[128], message[128], id;
  4449. if(sscanf(params, "uz", id, message))
  4450. {
  4451. SendClientMessage(playerid, WHITE, "SYNTAX: /pm [playerid] [message]");
  4452. }
  4453. else
  4454. {
  4455. if(IsPlayerConnected(id))
  4456. {
  4457. if(strlen(message) >= 1)
  4458. {
  4459. format(string, sizeof(string), "((You have sent %s: %s)) ", GetName(id), message);
  4460. SendClientMessage(playerid, PLAYERCOM, string);
  4461. format(string, sizeof(string), "((PM from %s (ID: %d): %s)) ", GetName(playerid), playerid, message);
  4462.  
  4463. SendClientMessage(id, PLAYERCOM, string);
  4464.  
  4465. }
  4466. else
  4467. {
  4468. SendClientMessage(playerid, WHITE, "SYNTAX: /pm [playerid] [message]");
  4469. }
  4470. }
  4471. else
  4472. {
  4473. SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
  4474. }
  4475. }
  4476. return 1;
  4477. }
  4478.  
  4479. command(me, playerid, params[])
  4480. {
  4481. new string[128];
  4482. if(isnull(params))
  4483. {
  4484. SendClientMessage(playerid, WHITE, "SYNTAX: /me [action]");
  4485. }
  4486. else
  4487. {
  4488. format(string, sizeof(string), "* %s %s", GetName(playerid), params);
  4489. NearByMessage(playerid, NICESKY, string);
  4490. }
  4491. return 1;
  4492. }
  4493.  
  4494. command(vehname, playerid, params[])
  4495. {
  4496. new value[128], results, strings[128];
  4497. if(sscanf(params, "z", value))
  4498. {
  4499. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4500. {
  4501. SendClientMessage(playerid, WHITE, "SYNTAX: /vehname [name]");
  4502. }
  4503. }
  4504. else
  4505. {
  4506. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4507. {
  4508. SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
  4509. for(new i; i < sizeof(VehicleNames); i++)
  4510. {
  4511. if(strfind(VehicleNames[i], value, true) != -1)
  4512. {
  4513. if(results == 0)
  4514. {
  4515. format(strings, sizeof(strings), "%s", VehicleNames[i]);
  4516. }
  4517. else
  4518. {
  4519. format(strings, sizeof(strings), "%s, %s", strings, VehicleNames[i]);
  4520. }
  4521.  
  4522. results++;
  4523.  
  4524. if(strlen(strings) > 118)
  4525. {
  4526. SendClientMessage(playerid, WHITE, "Too many results found! Please search more specified!");
  4527. SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
  4528. return 1;
  4529. }
  4530. }
  4531. }
  4532.  
  4533. if(results == 0)
  4534. {
  4535. SendClientMessage(playerid, WHITE, "Sorry, no vehicles found.");
  4536. SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
  4537. }
  4538. else
  4539. {
  4540. SendClientMessage(playerid, WHITE, "Results:");
  4541. SendClientMessage(playerid, WHITE, strings);
  4542. SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
  4543. }
  4544. }
  4545. }
  4546. return 1;
  4547. }
  4548.  
  4549. command(despawncar, playerid, params[])
  4550. {
  4551. if(PlayerInfo[playerid][pAdminLevel] >= 3)
  4552. {
  4553. new string[128];
  4554.  
  4555. for(new i = 0; i < SpawnedVehicles; i++)
  4556. {
  4557. if(AdminSpawned[i] == GetPlayerVehicleID(playerid))
  4558. {
  4559. AdminSpawned[i] = 0;
  4560. }
  4561. }
  4562.  
  4563. SendClientMessage(playerid, WHITE, "Vehicle de-spawned.");
  4564. DestroyVehicle(GetPlayerVehicleID(playerid));
  4565. format(string, sizeof(string), "%s has de-spawned a vehicle.", GetName(playerid));
  4566. }
  4567. return 1;
  4568. }
  4569.  
  4570. command(respawncar, playerid, params[])
  4571. {
  4572. #pragma unused params
  4573. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  4574. {
  4575. if(IsPlayerInAnyVehicle(playerid))
  4576. {
  4577. SetVehicleToRespawn(GetPlayerVehicleID(playerid));
  4578. }
  4579. }
  4580. return 1;
  4581. }
  4582.  
  4583. command(spawncar, playerid, params[])
  4584. {
  4585. new carid, string[128], Float: CarToX, Float: CarToY, Float: CarToZ, physical_car_id;
  4586. if(sscanf(params, "d", carid))
  4587. {
  4588. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4589. {
  4590. SendClientMessage(playerid, WHITE, "SYNTAX: /spawncar [vehicleid]");
  4591. }
  4592. }
  4593. else
  4594. {
  4595. if(PlayerInfo[playerid][pAdminLevel] >= 3)
  4596. {
  4597. if(CarCount < MAX_VEHICLES)
  4598. {
  4599. if(carid < 400 || carid > 611)
  4600. {
  4601. SendClientMessage(playerid, WHITE, "Valid car IDs start from 400, ending at 611.");
  4602. return 1;
  4603. }
  4604.  
  4605. GetPlayerPos(playerid, CarToX, CarToY, CarToZ);
  4606. physical_car_id = CreateVehicle(carid, CarToX, CarToY+4, CarToZ, 90, -1, -1, -1);
  4607.  
  4608. format(string, sizeof(string), "You have spawned model ID %d.", carid);
  4609. SendClientMessage(playerid, WHITE, string);
  4610.  
  4611. AdminSpawned[SpawnedVehicles] = physical_car_id;
  4612. SpawnedVehicles++;
  4613.  
  4614. PutPlayerInVehicle(playerid, physical_car_id, 0);
  4615. LinkVehicleToInterior(physical_car_id, GetPlayerInterior(playerid));
  4616. SetVehicleVirtualWorld(physical_car_id, GetPlayerVirtualWorld(playerid));
  4617. }
  4618. else
  4619. {
  4620. SendClientMessage(playerid, WHITE, "Despawn the current spawned vehicles before spawning any more (or attempting to do so).");
  4621. }
  4622. }
  4623. }
  4624. return 1;
  4625. }
  4626.  
  4627. command(specoff, playerid, params[])
  4628. {
  4629. #pragma unused params
  4630. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4631. {
  4632. new string[128];
  4633.  
  4634. Spectator[playerid][SpecSpectatingPlayer] = -1;
  4635.  
  4636. TogglePlayerSpectating(playerid, false);
  4637. SetCameraBehindPlayer(playerid);
  4638.  
  4639. SetPlayerInterior(playerid, Spectator[playerid][SpecPlayerInterior]);
  4640. SetPlayerFacingAngle(playerid, Spectator[playerid][SpecPlayerAngle]);
  4641. SetPlayerVirtualWorld(playerid, Spectator[playerid][SpecPlayerWorld]);
  4642. SetPlayerPos(playerid, Spectator[playerid][SpecPlayerX], Spectator[playerid][SpecPlayerY], Spectator[playerid][SpecPlayerZ]);
  4643.  
  4644. SendClientMessage(playerid, WHITE, "You've finished your session of spectating.");
  4645.  
  4646. format(string, sizeof(string), "%s has finished spectating.", GetName(playerid));
  4647. }
  4648. return 1;
  4649. }
  4650.  
  4651. command(spec, playerid, params[])
  4652. {
  4653. new id, string[128], Float: health, Float: armour, healthf, armourf;
  4654. if(sscanf(params, "u", id))
  4655. {
  4656. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4657. {
  4658. SendClientMessage(playerid, WHITE, "SYNTAX: /spec [playerid] (type /specoff to finish spectating)");
  4659. }
  4660. }
  4661. else
  4662. {
  4663. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  4664. {
  4665. if(IsPlayerConnected(id))
  4666. {
  4667. if(Spectator[playerid][SpecSpectatingPlayer] == -1)
  4668. {
  4669. GetPlayerPos(playerid, Spectator[playerid][SpecPlayerX], Spectator[playerid][SpecPlayerY], Spectator[playerid][SpecPlayerZ]);
  4670. GetPlayerFacingAngle(playerid, Spectator[playerid][SpecPlayerAngle]);
  4671. Spectator[playerid][SpecPlayerWorld] = GetPlayerVirtualWorld(playerid);
  4672. Spectator[playerid][SpecPlayerInterior] = GetPlayerInterior(playerid);
  4673. }
  4674.  
  4675. format(string, sizeof(string), "You are now spectating Player %s.", GetName(id));
  4676. SendClientMessage(playerid, GREY, string);
  4677. GetPlayerHealth(id, health);
  4678. GetPlayerArmour(id, armour);
  4679. healthf = floatround(health, floatround_ceil);
  4680. armourf = floatround(armour, floatround_ceil);
  4681.  
  4682. SetPlayerInterior(playerid, GetPlayerInterior(id));
  4683. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(id));
  4684.  
  4685. format(string, sizeof(string), "Health: %d | Armour: %d | Money: %d", healthf, armourf, PlayerInfo[id][pCash]);
  4686. SendClientMessage(playerid, WHITE, string);
  4687. Spectator[playerid][SpecSpectatingPlayer] = id;
  4688. TogglePlayerSpectating(playerid, true);
  4689.  
  4690. if(IsPlayerInAnyVehicle(id))
  4691. {
  4692. PlayerSpectateVehicle(playerid, GetPlayerVehicleID(id));
  4693. Spectator[playerid][SpecSpectatingState] = 1;
  4694. }
  4695. else
  4696. {
  4697. PlayerSpectatePlayer(playerid, id);
  4698. Spectator[playerid][SpecSpectatingState] = 2;
  4699. }
  4700.  
  4701. Spectator[playerid][SpecSpectatingPlayer] = id;
  4702. SpectatorRefresh(playerid, id);
  4703. }
  4704. else
  4705. {
  4706. SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
  4707. }
  4708. }
  4709. }
  4710. return 1;
  4711. }
  4712.  
  4713. command(bar, playerid, params[])
  4714. {
  4715. new id;
  4716. if(sscanf(params, "d", id))
  4717. {
  4718. SendClientMessage(playerid, WHITE, "SYNTAX: /bar [1-12]");
  4719. }
  4720. else
  4721. {
  4722. switch(id)
  4723. {
  4724. case 1:
  4725. {
  4726. ApplyAnimation(playerid, "BAR", "Barcustom_get", 3.1, 0, 1, 1, 1, 1);
  4727. }
  4728. case 2:
  4729. {
  4730. ApplyAnimation(playerid, "BAR", "Barcustom_loop", 3.1, 1, 1, 1, 1, 1);
  4731. }
  4732. case 3:
  4733. {
  4734. ApplyAnimation(playerid, "BAR", "Barcustom_order", 3.1, 0, 1, 1, 1, 1);
  4735. }
  4736. case 4:
  4737. {
  4738. ApplyAnimation(playerid, "BAR", "BARman_idle", 3.1, 0, 1, 1, 1, 1);
  4739. }
  4740. case 5:
  4741. {
  4742. ApplyAnimation(playerid, "BAR", "Barserve_bottle", 3.1, 0, 1, 1, 1, 1);
  4743. }
  4744. case 6:
  4745. {
  4746. ApplyAnimation(playerid, "BAR", "Barserve_give", 3.1, 0, 1, 1, 1, 1);
  4747. }
  4748. case 7:
  4749. {
  4750. ApplyAnimation(playerid, "BAR", "Barserve_glass", 3.1, 0, 1, 1, 1, 1);
  4751. }
  4752. case 8:
  4753. {
  4754. ApplyAnimation(playerid, "BAR", "Barserve_in", 3.1, 0, 1, 1, 1, 1);
  4755. }
  4756. case 9:
  4757. {
  4758. ApplyAnimation(playerid, "BAR", "Barserve_loop", 3.1, 1, 1, 1, 1, 1);
  4759. }
  4760. case 10:
  4761. {
  4762. ApplyAnimation(playerid, "BAR", "Barserve_order", 3.1, 0, 1, 1, 1, 1);
  4763. }
  4764. case 11:
  4765. {
  4766. ApplyAnimation(playerid, "BAR", "dnk_stndF_loop", 3.1, 1, 1, 1, 1, 1);
  4767. }
  4768. case 12:
  4769. {
  4770. ApplyAnimation(playerid, "BAR", "dnk_stndM_loop", 3.1, 1, 1, 1, 1, 1);
  4771. }
  4772. }
  4773. }
  4774. return 1;
  4775. }
  4776.  
  4777. command(hide, playerid, params[])
  4778. {
  4779. #pragma unused params
  4780. ApplyAnimation(playerid, "ped", "cower", 4.1, 0, 1, 1, 0, 0);
  4781. PlayerInfo[playerid][Animation] = 1;
  4782. return 1;
  4783. }
  4784.  
  4785. command(handsup, playerid, params[])
  4786. {
  4787. #pragma unused params
  4788. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_HANDSUP);
  4789. PlayerInfo[playerid][Animation] = 1;
  4790. return 1;
  4791. }
  4792.  
  4793. command(rap, playerid, params[])
  4794. {
  4795. new id;
  4796. if(sscanf(params, "d", id))
  4797. {
  4798. SendClientMessage(playerid, WHITE, "SYNTAX: /rap [style: 1/2/3/4]");
  4799. }
  4800. else
  4801. {
  4802. switch(id)
  4803. {
  4804. case 1:
  4805. {
  4806. ApplyAnimation(playerid, "RAPPING", "RAP_A_Loop", 3.1, 1, 1, 1, 1, 1);
  4807. PlayerInfo[playerid][Animation] = 1;
  4808. }
  4809. case 2:
  4810. {
  4811. ApplyAnimation(playerid, "RAPPING", "RAP_C_Loop", 3.1, 1, 1, 1, 1, 1);
  4812. PlayerInfo[playerid][Animation] = 1;
  4813. }
  4814. case 3:
  4815. {
  4816. ApplyAnimation(playerid, "GANGS", "prtial_gngtlkD", 3.1, 1, 1, 1, 1, 1);
  4817. PlayerInfo[playerid][Animation] = 1;
  4818. }
  4819. case 4:
  4820. {
  4821. ApplyAnimation(playerid, "GANGS", "prtial_gngtlkH", 3.1, 1, 1, 1, 1, 1);
  4822. PlayerInfo[playerid][Animation] = 1;
  4823. }
  4824. default: SendClientMessage(playerid, WHITE, "SYNTAX: /rap [style: 1/2/3/4]");
  4825. }
  4826. }
  4827. return 1;
  4828. }
  4829.  
  4830. command(reload, playerid, params[])
  4831. {
  4832. new id;
  4833. if(sscanf(params, "d", id))
  4834. {
  4835. SendClientMessage(playerid, WHITE, "SYNTAX: /reload [1/2]");
  4836. }
  4837. else
  4838. {
  4839. switch(id)
  4840. {
  4841. case 1:
  4842. {
  4843. ApplyAnimation(playerid, "COLT45", "colt45_reload", 4.0, 0, 1, 1, 1, 1);
  4844. PlayerInfo[playerid][Animation] = 1;
  4845. }
  4846. case 2:
  4847. {
  4848. ApplyAnimation(playerid, "UZI", "UZI_reload", 4.0, 0, 1, 1, 1, 1);
  4849. PlayerInfo[playerid][Animation] = 1;
  4850. }
  4851. }
  4852. }
  4853. return 1;
  4854. }
  4855.  
  4856. command(laugh, playerid, params[])
  4857. {
  4858. #pragma unused params
  4859. ApplyAnimation(playerid, "RAPPING", "Laugh_01", 4.0, 1, 1, 1, 1, 1);
  4860. PlayerInfo[playerid][Animation] = 1;
  4861. return 1;
  4862. }
  4863.  
  4864. command(dance, playerid, params[])
  4865. {
  4866. new id;
  4867. if(sscanf(params, "d", id))
  4868. {
  4869. SendClientMessage(playerid, WHITE, "SYNTAX: /dance [style: 1/2/3/4]");
  4870. }
  4871. else
  4872. {
  4873. switch(id)
  4874. {
  4875. case 1:
  4876. {
  4877. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE1);
  4878. PlayerInfo[playerid][Animation] = 1;
  4879. }
  4880. case 2:
  4881. {
  4882. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE2);
  4883. PlayerInfo[playerid][Animation] = 1;
  4884. }
  4885. case 3:
  4886. {
  4887. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE3);
  4888. PlayerInfo[playerid][Animation] = 1;
  4889. }
  4890. case 4:
  4891. {
  4892. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DANCE4);
  4893. PlayerInfo[playerid][Animation] = 1;
  4894. }
  4895. default: SendClientMessage(playerid, WHITE, "SYNTAX: /dance [style: 1/2/3/4]");
  4896. }
  4897. }
  4898. return 1;
  4899. }
  4900.  
  4901. command(sit, playerid, params[])
  4902. {
  4903. #pragma unused params
  4904. ApplyAnimation(playerid, "PED", "SEAT_down", 3.1, 0, 1, 1, 1, 1);
  4905. PlayerInfo[playerid][Animation] = 1;
  4906. return 1;
  4907. }
  4908.  
  4909. command(gsit, playerid, params[])
  4910. {
  4911. #pragma unused params
  4912. ApplyAnimation(playerid, "BEACH", "ParkSit_M_loop", 3.1, 0, 1, 1, 1, 1);
  4913. PlayerInfo[playerid][Animation] = 1;
  4914. return 1;
  4915. }
  4916.  
  4917. command(ko, playerid, params[])
  4918. {
  4919. #pragma unused params
  4920. ApplyAnimation(playerid, "PED", "FLOOR_hit_f", 3.1, 0, 1, 1, 1, 1);
  4921. PlayerInfo[playerid][Animation] = 1;
  4922. return 1;
  4923. }
  4924.  
  4925. command(wave, playerid, params[])
  4926. {
  4927. #pragma unused params
  4928. ApplyAnimation(playerid, "ON_LOOKERS", "wave_loop", 3.1, 1, 1, 1, 1, 1);
  4929. PlayerInfo[playerid][Animation] = 1;
  4930. return 1;
  4931. }
  4932.  
  4933. command(spank, playerid, params[])
  4934. {
  4935. #pragma unused params
  4936. ApplyAnimation(playerid, "SWEET", "sweet_ass_slap", 3.1, 0, 1, 1, 1, 1);
  4937. PlayerInfo[playerid][Animation] = 1;
  4938. return 1;
  4939. }
  4940.  
  4941. command(fuckoff, playerid, params[])
  4942. {
  4943. #pragma unused params
  4944. ApplyAnimation(playerid, "PED", "fucku", 3.1, 0, 1, 1, 1, 1);
  4945. PlayerInfo[playerid][Animation] = 1;
  4946. return 1;
  4947. }
  4948.  
  4949. command(chat, playerid, params[])
  4950. {
  4951. #pragma unused params
  4952. ApplyAnimation(playerid, "PED", "IDLE_CHAT", 3.1, 1, 1, 1, 1, 1);
  4953. PlayerInfo[playerid][Animation] = 1;
  4954. return 1;
  4955. }
  4956.  
  4957. command(deal, playerid, params[])
  4958. {
  4959. #pragma unused params
  4960. ApplyAnimation(playerid, "DEALER", "DEALER_DEAL", 3.1, 1, 1, 1, 1, 1);
  4961. PlayerInfo[playerid][Animation] = 1;
  4962. return 1;
  4963. }
  4964.  
  4965. command(vomit, playerid, params[])
  4966. {
  4967. #pragma unused params
  4968. ApplyAnimation(playerid, "FOOD", "EAT_Vomit_P", 3.1, 0, 1, 1, 1, 1);
  4969. PlayerInfo[playerid][Animation] = 1;
  4970. return 1;
  4971. }
  4972.  
  4973. command(bomb, playerid, params[])
  4974. {
  4975. #pragma unused params
  4976. ApplyAnimation(playerid, "BOMBER", "BOM_Plant_Loop", 3.1, 0, 1, 1, 1, 1);
  4977. PlayerInfo[playerid][Animation] = 1;
  4978. return 1;
  4979. }
  4980.  
  4981.  
  4982. command(crack, playerid, params[])
  4983. {
  4984. #pragma unused params
  4985. ApplyAnimation(playerid, "CRACK", "crckdeth2", 4.1, 1, 1, 1, 1, 1);
  4986. PlayerInfo[playerid][Animation] = 1;
  4987. return 1;
  4988. }
  4989.  
  4990. command(piss, playerid, params[])
  4991. {
  4992. #pragma unused params
  4993. SetPlayerSpecialAction(playerid, 68);
  4994. PlayerInfo[playerid][Animation] = 1;
  4995. return 1;
  4996. }
  4997.  
  4998. command(masturbate, playerid, params[])
  4999. {
  5000. #pragma unused params
  5001. ApplyAnimation(playerid, "PAULNMAC", "wank_loop", 4.1, 1, 1, 1, 1, 1);
  5002. PlayerInfo[playerid][Animation] = 1;
  5003. return 1;
  5004. }
  5005.  
  5006. command(crossarms, playerid, params[])
  5007. {
  5008. #pragma unused params
  5009. ApplyAnimation(playerid, "COP_AMBIENT", "Coplook_loop", 1, 1, 0, 0, 0, 0);
  5010. PlayerInfo[playerid][Animation] = 1;
  5011. return 1;
  5012. }
  5013.  
  5014. command(robman, playerid, params[])
  5015. {
  5016. #pragma unused params
  5017. ApplyAnimation(playerid, "SHOP", "ROB_Loop_Threat", 4.1, 0, 1, 1, 0, 0);
  5018. PlayerInfo[playerid][Animation] = 1;
  5019. return 1;
  5020. }
  5021.  
  5022. command(pedmove, playerid, params[])
  5023. {
  5024. new id;
  5025. if(sscanf(params, "d", id))
  5026. {
  5027. SendClientMessage(playerid, WHITE, "SYNTAX: /pedmove [(1-10)]");
  5028. SendClientMessage(playerid, WHITE, "USAGES: 1 - Sexy Walk, 2 - Old Woman Walk, 3 - Normal Woman Walk, 4 - Woman Run (Old)");
  5029. SendClientMessage(playerid, WHITE, "USAGES: 5 - Woman Run - Panic, 6 - Drunk, 7 - Fat Walk, 8 - Old Fat Walk, 9/10 - Gang Walk");
  5030. }
  5031. else
  5032. {
  5033. switch(id)
  5034. {
  5035. case 1:
  5036. {
  5037. ApplyAnimation(playerid, "PED", "WOMAN_walksexy", 4.1, 1, 1, 1, 0, 0);
  5038. PlayerInfo[playerid][Animation] = 1;
  5039. }
  5040. case 2:
  5041. {
  5042. ApplyAnimation(playerid, "PED", "WOMAN_walkold", 4.1,1,1,1,0,0);
  5043. PlayerInfo[playerid][Animation] = 1;
  5044. }
  5045. case 3:
  5046. {
  5047. ApplyAnimation(playerid, "PED", "WOMAN_walknorm", 4.1,1,1,1,0,0);
  5048. PlayerInfo[playerid][Animation] = 1;
  5049. }
  5050. case 4:
  5051. {
  5052. ApplyAnimation(playerid, "PED", "WOMAN_runfatold", 4.1,1,1,1,0,0);
  5053. PlayerInfo[playerid][Animation] = 1;
  5054. }
  5055. case 5:
  5056. {
  5057. ApplyAnimation(playerid, "PED", "woman_runpanic", 4.1,1,1,1,0,0);
  5058. PlayerInfo[playerid][Animation] = 1;
  5059. }
  5060. case 6:
  5061. {
  5062. ApplyAnimation(playerid, "PED", "WALK_drunk", 4.1,1,1,1,0,0);
  5063. PlayerInfo[playerid][Animation] = 1;
  5064. }
  5065. case 7:
  5066. {
  5067. ApplyAnimation(playerid, "PED", "WALK_fat", 4.1,1,1,1,0,0);
  5068. PlayerInfo[playerid][Animation] = 1;
  5069. }
  5070. case 8:
  5071. {
  5072. ApplyAnimation(playerid, "PED", "WALK_fatold", 4.1,1,1,1,0,0);
  5073. PlayerInfo[playerid][Animation] = 1;
  5074. }
  5075. case 9:
  5076. {
  5077. ApplyAnimation(playerid, "PED", "WALK_csaw", 4.1,1,1,1,0,0);
  5078. PlayerInfo[playerid][Animation] = 1;
  5079. }
  5080. case 10:
  5081. {
  5082. ApplyAnimation(playerid, "PED", "WALK_gang2", 4.1,1,1,1,0,0);
  5083. PlayerInfo[playerid][Animation] = 1;
  5084. }
  5085. default:
  5086. {
  5087. SendClientMessage(playerid, WHITE, "SYNTAX: /pedmove [id (1-10)]");
  5088. SendClientMessage(playerid, WHITE, "USAGES: 1 - Sexy Walk, 2 - Old Woman Walk, 3 - Normal Woman Walk, 4 - Woman Run (Old)");
  5089. SendClientMessage(playerid, WHITE, "USAGES: 5 - Woman Run - Panic, 6 - Drunk, 7 - Fat Walk, 8 - Old Fat Walk, 9/10 - Gang Walk");
  5090. }
  5091. }
  5092. }
  5093. return 1;
  5094. }
  5095.  
  5096. command(approve, playerid, params[])
  5097. {
  5098. new Usage[128];
  5099. if(sscanf(params, "z", Usage))
  5100. {
  5101. SendClientMessage(playerid, WHITE, "SYNTAX: /approve [usage]");
  5102. SendClientMessage(playerid, GREY, "Usages: Handshake, Heal, Groupinvite");
  5103. }
  5104. else
  5105. {
  5106. if(strcmp(Usage, "Groupinvite", true) == 0)
  5107. {
  5108. if(PlayerInfo[playerid][PendingGroupInvite] != -1)
  5109. {
  5110. if(GetDistanceBetweenPlayers(playerid, PlayerInfo[playerid][PendingGroupInvite]) < 3)
  5111. {
  5112. PlayerInfo[playerid][PendingGroupInvite] = -1;
  5113. PlayerInfo[playerid][Group] = PlayerInfo[playerid][PendingGroup];
  5114. SendClientMessage(playerid, WHITE, "Group Invite Approved!");
  5115. SendClientMessage(playerid, WHITE, "You have accepted the Group Invite! You are now in a faction!");
  5116. }
  5117. }
  5118. }
  5119. if(strcmp(Usage, "Heal", true) == 0)
  5120. {
  5121. if(PlayerInfo[playerid][PendingHeal] != -1)
  5122. {
  5123. if(GetDistanceBetweenPlayers(playerid, PlayerInfo[playerid][PendingHeal]) < 3)
  5124. {
  5125. PlayerInfo[playerid][PendingHeal] = -1;
  5126. SendClientMessage(playerid, WHITE, "Heal approved.");
  5127. SetPlayerHealth(playerid, 100);
  5128. SetPlayerHealth(playerid, 100);
  5129. SendClientMessage(playerid, WHITE, "You have been healed!");
  5130. }
  5131. else
  5132. {
  5133. SendClientMessage(playerid, WHITE, "You must be closer to that player to perform this action!");
  5134. }
  5135. }
  5136. else
  5137. {
  5138. SendClientMessage(playerid, WHITE, "You do not have a pending heal request!");
  5139. }
  5140. }
  5141. else if(strcmp(Usage, "Handshake", true) == 0)
  5142. {
  5143. if(PlayerInfo[playerid][PendingHandshake] != -1)
  5144. {
  5145. if(GetDistanceBetweenPlayers(playerid, PlayerInfo[playerid][PendingHandshake]) < 3)
  5146. {
  5147. switch(PlayerInfo[playerid][PendingHandshakeStyle])
  5148. {
  5149. case 1:
  5150. {
  5151. PlayerInfo[playerid][PendingHandshake] = -1;
  5152. PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
  5153. ApplyAnimation(playerid, "GANGS", "hndshkaa", 4.0, 1, 1, 1, 0, 1000);
  5154. ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkaa", 4.0, 1, 1, 1, 0, 1000);
  5155. SendClientMessage(playerid, WHITE, "Handshake approved.");
  5156. }
  5157. case 2:
  5158. {
  5159. PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
  5160. ApplyAnimation(playerid, "GANGS", "hndshkba", 4.0, 1, 1, 1, 0, 1000);
  5161. ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkba", 4.0, 1, 1, 1, 0, 1000);
  5162. SendClientMessage(playerid, WHITE, "Handshake approved.");
  5163. PlayerInfo[playerid][PendingHandshake] = -1;
  5164. }
  5165. case 3:
  5166. {
  5167. PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
  5168. ApplyAnimation(playerid, "GANGS", "hndshkca", 4.0, 1, 1, 1, 0, 1000);
  5169. ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkca", 4.0, 1, 1, 1, 0, 1000);
  5170. SendClientMessage(playerid, WHITE, "Handshake approved.");
  5171. PlayerInfo[playerid][PendingHandshake] = -1;
  5172. }
  5173. case 4:
  5174. {
  5175. PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
  5176. ApplyAnimation(playerid, "GANGS", "hndshkcb", 4.0, 1, 1, 1, 0, 1000);
  5177. ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkcb", 4.0, 1, 1, 1, 0, 1000);
  5178. SendClientMessage(playerid, WHITE, "Handshake approved.");
  5179. PlayerInfo[playerid][PendingHandshake] = -1;
  5180. }
  5181. case 5:
  5182. {
  5183. PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
  5184. ApplyAnimation(playerid, "GANGS", "hndshkda", 4.0, 1, 1, 1, 0, 1000);
  5185. ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkda", 4.0, 1, 1, 1, 0, 1000);
  5186. SendClientMessage(playerid, WHITE, "Handshake approved.");
  5187. PlayerInfo[playerid][PendingHandshake] = -1;
  5188. }
  5189. case 6:
  5190. {
  5191. PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
  5192. ApplyAnimation(playerid, "GANGS", "hndshkea", 4.0, 1, 1, 1, 0, 1000);
  5193. ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkea", 4.0, 1, 1, 1, 0, 1000);
  5194. SendClientMessage(playerid, WHITE, "Handshake approved.");
  5195. PlayerInfo[playerid][PendingHandshake] = -1;
  5196. }
  5197. case 7:
  5198. {
  5199. PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
  5200. ApplyAnimation(playerid, "GANGS", "hndshkfa", 4.0, 1, 1, 1, 0, 1000);
  5201. ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkfa", 4.0, 1, 1, 1, 0, 1000);
  5202. SendClientMessage(playerid, WHITE, "Handshake approved.");
  5203. PlayerInfo[playerid][PendingHandshake] = -1;
  5204. }
  5205. case 8:
  5206. {
  5207. PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
  5208. ApplyAnimation(playerid, "GANGS", "hndshkfa_swt", 4.0, 1, 1, 1, 0, 1000);
  5209. ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "hndshkfa_swt", 4.0, 1, 1, 1, 0, 1000);
  5210. SendClientMessage(playerid, WHITE, "Handshake approved.");
  5211. PlayerInfo[playerid][PendingHandshake] = -1;
  5212. }
  5213. case 9:
  5214. {
  5215. PlayerFacePlayer(playerid, PlayerInfo[playerid][PendingHandshake]);
  5216. ApplyAnimation(playerid, "GANGS", "prtial_hndshk_01", 4.0, 1, 1, 1, 0, 1000);
  5217. ApplyAnimation(PlayerInfo[playerid][PendingHandshake], "GANGS", "prtial_hndshk_01", 4.0, 1, 1, 1, 0, 1000);
  5218. SendClientMessage(playerid, WHITE, "Handshake approved.");
  5219. PlayerInfo[playerid][PendingHandshake] = -1;
  5220. }
  5221. }
  5222. }
  5223. else
  5224. {
  5225. SendClientMessage(playerid, WHITE, "You're too far away.");
  5226. }
  5227. }
  5228. else
  5229. {
  5230. SendClientMessage(playerid, WHITE, "You don't have a pending handshake request.");
  5231. }
  5232. }
  5233. }
  5234. return 1;
  5235. }
  5236.  
  5237. command(attempt, playerid, params[])
  5238. {
  5239. new Message[128], string[128];
  5240. if(sscanf(params, "z", Message))
  5241. {
  5242. SendClientMessage(playerid, WHITE, "SYNTAX: /attempt [action]");
  5243. }
  5244. else
  5245. {
  5246. if(strlen(Message) < 1)
  5247. {
  5248. return 1;
  5249. }
  5250.  
  5251. if(random(10) < 6)
  5252. {
  5253. format(string, sizeof(string), "[ATTEMPT] * %s has attempted to %s, and succeeded.", GetName(playerid), Message);
  5254. NearByMessage(playerid, ME, string);
  5255. }
  5256. else
  5257. {
  5258. format(string, sizeof(string), "[ATTEMPT] * %s has attempted to %s, but failed.", GetName(playerid), Message);
  5259. NearByMessage(playerid, ME, string);
  5260. }
  5261. }
  5262. return 1;
  5263. }
  5264.  
  5265. command(stopanim, playerid, params[])
  5266. {
  5267. #pragma unused params
  5268. PlayerInfo[playerid][Animation] = 0;
  5269. ClearAnimations(playerid);
  5270. StopLoopingAnimation(playerid);
  5271. TogglePlayerControllable(playerid, true);
  5272. SendClientMessage(playerid, WHITE, "You have cleared all animations.");
  5273. return 1;
  5274. }
  5275.  
  5276. command(shakehand, playerid, params[])
  5277. {
  5278. new style, id, string[128];
  5279. if(sscanf(params, "ud", id, style))
  5280. {
  5281. SendClientMessage(playerid, WHITE, "SYNTAX: /shakehand [playerid] [1-9]");
  5282. }
  5283. else
  5284. {
  5285. if(IsPlayerConnected(id))
  5286. {
  5287. if(GetDistanceBetweenPlayers(playerid, id) < 2)
  5288. {
  5289. if(style >= 1 && style < 10)
  5290. {
  5291. PlayerInfo[id][PendingHandshakeStyle] = style;
  5292. PlayerInfo[id][PendingHandshake] = playerid;
  5293. format(string, sizeof(string), "You have requested to shake %s's hand.", GetName(id));
  5294. SendClientMessage(playerid, WHITE, string);
  5295. format(string, sizeof(string), "%s is requesting to shake your hand... Type /approve handshake to shake hands!", GetName(playerid));
  5296. SendClientMessage(id, NICESKY, string);
  5297. }
  5298. else
  5299. {
  5300. SendClientMessage(playerid, WHITE, "SYNTAX: /handshake [playerid] [1-9]");
  5301. }
  5302. }
  5303. else
  5304. {
  5305. SendClientMessage(playerid, WHITE, "Please stand closer to them.");
  5306. }
  5307. }
  5308. else
  5309. {
  5310. SendClientMessage(playerid, WHITE, "That player is not connected or is not logged in.");
  5311. }
  5312. }
  5313. return 1;
  5314. }
  5315.  
  5316. command(gunname, playerid, params[])
  5317. {
  5318. new value[128], results, strings[128];
  5319. if(sscanf(params, "z", value))
  5320. {
  5321. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5322. {
  5323. SendClientMessage(playerid, WHITE, "SYNTAX: /gunname [name/weaponid]");
  5324. }
  5325. }
  5326. else
  5327. {
  5328. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5329. {
  5330. SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
  5331. for(new i; i < sizeof(WeaponNames); i++)
  5332. {
  5333. if(strfind(WeaponNames[i], value, true) != -1)
  5334. {
  5335. if(results == 0)
  5336. {
  5337. format(strings, sizeof(strings), "%s", WeaponNames[i]);
  5338. }
  5339. else
  5340. {
  5341. format(strings, sizeof(strings), "%s, %s", strings, WeaponNames[i]);
  5342. }
  5343.  
  5344. results++;
  5345.  
  5346. if(strlen(strings) > 118)
  5347. {
  5348. SendClientMessage(playerid, WHITE, "Too many results found! Please search more specified!");
  5349. SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
  5350. return 1;
  5351. }
  5352. }
  5353. }
  5354.  
  5355. if(results == 0)
  5356. {
  5357. SendClientMessage(playerid, WHITE, "Sorry, no weapons found.");
  5358. SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
  5359. }
  5360. else
  5361. {
  5362. SendClientMessage(playerid, WHITE, "Results:");
  5363. SendClientMessage(playerid, WHITE, strings);
  5364. SendClientMessage(playerid, GREY, "---------------------------------------------------------------------------------------------------------------------------------");
  5365. }
  5366. }
  5367. }
  5368. return 1;
  5369. }
  5370.  
  5371. command(stopdrag, playerid, params[])
  5372. {
  5373. #pragma unused params
  5374.  
  5375. new string[73];
  5376.  
  5377. for(new i = 0; i < MAX_PLAYERS; i++)
  5378. {
  5379. if(IsPlayerConnected(i) && PlayerInfo[i][BeingDraggedBy] == playerid)
  5380. {
  5381. format(string, sizeof(string), "* %s has stopped dragging %s.", GetName(playerid), GetName(i));
  5382. NearByMessage(playerid, ME, string);
  5383. PlayerInfo[i][BeingDraggedBy] = -1;
  5384. }
  5385. }
  5386.  
  5387. return 1;
  5388. }
  5389.  
  5390. command(drag, playerid, params[])
  5391. {
  5392. new id, string[128];
  5393. if(sscanf(params, "u", id))
  5394. {
  5395. SendClientMessage(playerid, WHITE, "SYNTAX: /drag [playerid]");
  5396. }
  5397. else
  5398. {
  5399. if(GetDistanceBetweenPlayers(playerid, id) < 7)
  5400. {
  5401. PlayerInfo[id][BeingDraggedBy] = playerid;
  5402. format(string, sizeof(string), "You have started to drag %s.", GetName(id));
  5403. SendClientMessage(playerid, WHITE, string);
  5404. format(string, sizeof(string), "* %s grabs ahold of %s and starts dragging them.", GetName(playerid), GetName(id));
  5405. NearByMessage(playerid, ME, string);
  5406. }
  5407. else
  5408. {
  5409. SendClientMessage(playerid, WHITE, "You're too far away!");
  5410. }
  5411. }
  5412. return 1;
  5413. }
  5414.  
  5415. command(announce, playerid, params[])
  5416. {
  5417. new Announcement[128], string[128];
  5418. if(sscanf(params, "z", Announcement))
  5419. {
  5420. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5421. {
  5422. SendClientMessage(playerid, WHITE, "SYNTAX: /announce [message]");
  5423. }
  5424. }
  5425. else
  5426. {
  5427. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5428. {
  5429. if(strlen(Announcement) >= 1)
  5430. {
  5431. format(string, sizeof(string), "((Announcement from Server Admin %s: %s)) ", GetName(playerid), Announcement);
  5432. SendClientMessageToAll(LIGHTRED, string);
  5433. }
  5434. else
  5435. {
  5436. SendClientMessage(playerid, WHITE, "SYNTAX: /announce [message]");
  5437. }
  5438. }
  5439. }
  5440. return 1;
  5441. }
  5442.  
  5443. command(getid, playerid, params[])
  5444. {
  5445. new string[128], id;
  5446. if(sscanf(params, "u", id))
  5447. {
  5448. SendClientMessage(playerid, WHITE, "SYNTAX: /getid [playerid/name]");
  5449. }
  5450. else
  5451. {
  5452. if(IsPlayerConnected(id))
  5453. {
  5454. format(string, sizeof(string), "The ID that matches %s is %d.", GetName(id), id);
  5455. SendClientMessage(playerid, WHITE, string);
  5456. }
  5457. else
  5458. {
  5459. SendClientMessage(playerid, WHITE, "That player is not connected or is not logged in.");
  5460. }
  5461. }
  5462. return 1;
  5463. }
  5464.  
  5465. command(explode, playerid, params[])
  5466. {
  5467. new userid, string[128];
  5468. if(sscanf(params, "u", userid))
  5469. {
  5470. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  5471. {
  5472. SendClientMessage(playerid, WHITE, "SYNTAX: /explode [playerid]");
  5473. }
  5474. }
  5475. else
  5476. {
  5477. if(IsPlayerConnected(userid))
  5478. {
  5479. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  5480. {
  5481. if(userid == INVALID_PLAYER_ID)
  5482. {
  5483. SendClientMessage(playerid, WHITE, "Invalid ID.");
  5484. return 1;
  5485. }
  5486. else
  5487. {
  5488. if(PlayerInfo[playerid][pAdminLevel] >= PlayerInfo[userid][pAdminLevel])
  5489. {
  5490. new Float:px, Float:py, Float:pz;
  5491. GetPlayerPos(userid, px, py, pz);
  5492. SetPlayerHealth(userid, 50);
  5493. CreateExplosion(px+10, py, pz, 7, 100.0);
  5494. CreateExplosion(px, py+10, pz, 7, 100.0);
  5495. CreateExplosion(px-10, py, pz, 7, 100.0);
  5496. CreateExplosion(px, py-10, pz, 7, 100.0);
  5497. CreateExplosion(px, py, pz, 7, 100.0);
  5498. format(string, sizeof(string), "You have exploded %s.", GetName(userid));
  5499. SendClientMessage(playerid, WHITE, string);
  5500. }
  5501. }
  5502. }
  5503. }
  5504. else
  5505. {
  5506. SendClientMessage(playerid, WHITE, "That player is not connected or is logged in.");
  5507. }
  5508. }
  5509. return 1;
  5510. }
  5511.  
  5512. command(slap, playerid, params[])
  5513. {
  5514. new string[128], id, Float: pX, Float: pY, Float: pZ, MathsFlaw, Float: Mathematical;
  5515. if(sscanf(params, "u", id))
  5516. {
  5517. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5518. {
  5519. SendClientMessage(playerid, WHITE, "SYNTAX: /slap [playerid]");
  5520. }
  5521. }
  5522. else
  5523. {
  5524. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5525. {
  5526. if(IsPlayerConnected(id))
  5527. {
  5528. if(PlayerInfo[playerid][pAdminLevel] >= PlayerInfo[id][pAdminLevel])
  5529. {
  5530. GetPlayerPos(id, pX, pY, pZ);
  5531. SetPlayerPos(id, pX, pY, pZ+5);
  5532.  
  5533. GetPlayerHealth(id, Mathematical);
  5534. MathsFlaw = floatround(Mathematical, floatround_ceil);
  5535. SetPlayerHealth(id, MathsFlaw-5);
  5536.  
  5537. format(string, sizeof(string), "You have slapped %s.", GetName(id));
  5538. SendClientMessage(playerid, WHITE, string);
  5539. format(string, sizeof(string), "%s has been slapped.", GetName(id));
  5540. NearByMessage(id, ME, string);
  5541. }
  5542. }
  5543. else
  5544. {
  5545. SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
  5546. }
  5547. }
  5548. }
  5549. return 1;
  5550. }
  5551.  
  5552. command(setweather, playerid, params[])
  5553. {
  5554. new weatherid;
  5555. if(sscanf(params, "d", weatherid))
  5556. {
  5557. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  5558. {
  5559. SendClientMessage(playerid, WHITE, "USAGE: /setweather [weatherid]");
  5560. }
  5561. }
  5562. else
  5563. {
  5564. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  5565. {
  5566. if(weatherid >= 1 && weatherid < 46)
  5567. {
  5568. SetWeather(weatherid);
  5569. GlobalWeather = weatherid;
  5570. }
  5571. else
  5572. {
  5573. SendClientMessage(playerid, WHITE, "Invalid weather ID - must be between 1 and 45.");
  5574. }
  5575. }
  5576. }
  5577. return 1;
  5578. }
  5579.  
  5580. command(ban, playerid, params[])
  5581. {
  5582. new id, reason[35], name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], string[128];
  5583. if(!(PlayerInfo[playerid][pAdminLevel] >= 2)) return SendClientMessage(playerid, COLOR_RED,NOTADMIN);
  5584. if(sscanf(params,"uz", id, reason)) return SendClientMessage(playerid, COLOR_WHITE,"Syntax: /ban [playerid/partofname] [Reason]");
  5585. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY,"Invalid player id");
  5586. else
  5587. {
  5588. if(PlayerInfo[id][pAdminLevel] >= 1)
  5589. {
  5590. SendClientMessage(playerid,COLOR_GREY,"You can't ban him/her.");
  5591. return 1;
  5592. }
  5593. GetPlayerName(playerid, name1, sizeof(name1));
  5594. GetPlayerName(id, name2, sizeof(name2));
  5595. format(string, sizeof(string), "%s got banned. Reason: %s", name2, reason);
  5596. SendClientMessageToAll(COLOR_RED, string);
  5597. new plrIP[16];
  5598. GetPlayerIp(id,plrIP, sizeof(plrIP));
  5599. SendClientMessage(id,COLOR_YELLOW,"|___________[BAN INFO]___________|");
  5600. format(string, sizeof(string), "Your name: %s.",name2);
  5601. SendClientMessage(id, COLOR_WHITE, string);
  5602. format(string, sizeof(string), "Your IP: %s.",plrIP);
  5603. SendClientMessage(id, COLOR_WHITE, string);
  5604. format(string, sizeof(string), "Who banned you: %s.",name1);
  5605. SendClientMessage(id, COLOR_WHITE, string);
  5606. format(string, sizeof(string), "Reason: %s.",reason);
  5607. SendClientMessage(id, COLOR_WHITE, string);
  5608. SendClientMessage(id,COLOR_YELLOW,"|___________[BAN INFO]___________|");
  5609. Ban(id);
  5610. }
  5611. return 1;
  5612. }
  5613.  
  5614.  
  5615. command(freeze, playerid, params[])
  5616. {
  5617. new id, string[128];
  5618. if(sscanf(params, "u", id))
  5619. {
  5620. if(PlayerInfo[playerid][pAdminLevel] >= 2)
  5621. {
  5622. SendClientMessage(playerid, WHITE, "SYNTAX: /freeze [playerid]");
  5623. }
  5624. }
  5625. else
  5626. {
  5627. if(PlayerInfo[playerid][pAdminLevel] >= 2)
  5628. {
  5629. if(IsPlayerConnected(id))
  5630. {
  5631. TogglePlayerControllable(id, false);
  5632. format(string, sizeof(string), "You have frozen player %s.", GetName(id));
  5633. SendClientMessage(playerid, WHITE, string);
  5634. }
  5635. else
  5636. {
  5637. SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
  5638. }
  5639. }
  5640. }
  5641. return 1;
  5642. }
  5643.  
  5644. command(unfreeze, playerid, params[])
  5645. {
  5646. new id, string[128];
  5647. if(sscanf(params, "u", id))
  5648. {
  5649. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5650. {
  5651. SendClientMessage(playerid, WHITE, "SYNTAX: /unfreeze [playerid]");
  5652. }
  5653. }
  5654. else
  5655. {
  5656. if(PlayerInfo[playerid][pAdminLevel] >= 2)
  5657. {
  5658. if(IsPlayerConnected(id))
  5659. {
  5660. TogglePlayerControllable(id, true);
  5661. format(string, sizeof(string), "You have un-frozen player %s.", GetName(id));
  5662. SendClientMessage(playerid, WHITE, string);
  5663. }
  5664. else
  5665. {
  5666. SendClientMessage(playerid, WHITE, "That player is not connected or isn't logged in.");
  5667. }
  5668. }
  5669. }
  5670. return 1;
  5671. }
  5672.  
  5673. command(kick, playerid, params[])
  5674. {
  5675. new id, reason[128], string[128];
  5676. if(sscanf(params, "us", id, reason))
  5677. {
  5678. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5679. {
  5680. SendClientMessage(playerid, WHITE, "SYNTAX: /kick [playerid] [reason]");
  5681. }
  5682. }
  5683. else
  5684. {
  5685. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5686. {
  5687. if(IsPlayerConnected(id))
  5688. {
  5689. if(PlayerInfo[id][pAdminLevel] > PlayerInfo[playerid][pAdminLevel])
  5690. {
  5691. SendClientMessage(playerid, WHITE, "You do not have the authority to do that (higher rank).");
  5692. return 1;
  5693. }
  5694. format(string, sizeof(string), "Kick: %s has been kicked by %s, reason: %s", GetName(id), GetName(playerid), reason);
  5695. SendClientMessageToAll(LIGHTRED, string);
  5696. format(string, sizeof(string), "You have been kicked from the server for %s", reason);
  5697. SendClientMessage(id, WHITE, string);
  5698. Kick(id);
  5699. }
  5700. else
  5701. {
  5702. SendClientMessage(playerid, WHITE, "That player is not connected.");
  5703. return 1;
  5704. }
  5705. }
  5706. }
  5707. return 1;
  5708. }
  5709.  
  5710. command(eon, playerid, params[])
  5711. {
  5712. new vehicleid = GetPlayerVehicleID(playerid);
  5713. if(IsPlayerInAnyVehicle(playerid))
  5714. {
  5715. if(Engine[vehicleid] == 0)
  5716. {
  5717. Engine[vehicleid] = 1;
  5718. new engine,lights,alarm,doors,bonnet,boot,objective;
  5719. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  5720. SetVehicleParamsEx(vehicleid,1,lights,alarm,doors,bonnet,boot,objective);
  5721. new string[128];
  5722. format(string, sizeof(string), "* %s has turned their vehicles engine on.", GetName(playerid));
  5723. NearByMessage(playerid, PINK, string);
  5724. }
  5725. else
  5726. {
  5727. SendClientMessage(playerid, WHITE, "Your vehicles engine must be off to use this command!");
  5728. }
  5729. }
  5730. else
  5731. {
  5732. SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
  5733. }
  5734. return 1;
  5735. }
  5736.  
  5737. command(eoff, playerid, params[])
  5738. {
  5739. new vehicleid = GetPlayerVehicleID(playerid);
  5740. if(IsPlayerInAnyVehicle(playerid))
  5741. {
  5742. if(Engine[vehicleid] == 1)
  5743. {
  5744. Engine[vehicleid] = 0;
  5745. new engine,lights,alarm,doors,bonnet,boot,objective;
  5746. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  5747. SetVehicleParamsEx(vehicleid,0,lights,alarm,doors,bonnet,boot,objective);
  5748. new string[128];
  5749. format(string, sizeof(string), "* %s has turned their vehicles engine off.", GetName(playerid));
  5750. NearByMessage(playerid, PINK, string);
  5751. }
  5752. else
  5753. {
  5754. SendClientMessage(playerid, WHITE, "You vehicles engine must be turned on to use this command!");
  5755. }
  5756. }
  5757. else
  5758. {
  5759. SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
  5760. }
  5761. return 1;
  5762. }
  5763.  
  5764. command(lon, playerid, params[])
  5765. {
  5766. new vehicleid = GetPlayerVehicleID(playerid);
  5767. if(Lights[vehicleid] == 0)
  5768. {
  5769. if(IsPlayerInAnyVehicle(playerid))
  5770. {
  5771. Lights[vehicleid] = 1;
  5772. new engine,lights,alarm,doors,bonnet,boot,objective;
  5773. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  5774. SetVehicleParamsEx(vehicleid,engine,1,alarm,doors,bonnet,boot,objective);
  5775. new string[128];
  5776. format(string, sizeof(string), "* %s has turned their vehicles lights on.", GetName(playerid));
  5777. NearByMessage(playerid, PINK, string);
  5778. }
  5779. else
  5780. {
  5781. SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
  5782. }
  5783. }
  5784. else
  5785. {
  5786. SendClientMessage(playerid, WHITE, "Your vehicle's lights must me off to use this command!");
  5787. }
  5788. return 1;
  5789. }
  5790.  
  5791. command(loff, playerid, params[])
  5792. {
  5793. new vehicleid = GetPlayerVehicleID(playerid);
  5794. if(Lights[vehicleid] == 1)
  5795. {
  5796. if(IsPlayerInAnyVehicle(playerid))
  5797. {
  5798. Lights[vehicleid] = 0;
  5799. new engine,lights,alarm,doors,bonnet,boot,objective;
  5800. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  5801. SetVehicleParamsEx(vehicleid,engine,0,alarm,doors,bonnet,boot,objective);
  5802. new string[128];
  5803. format(string, sizeof(string), "* %s has turned their vehicles lights off.", GetName(playerid));
  5804. NearByMessage(playerid, PINK, string);
  5805. }
  5806. else
  5807. {
  5808. SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
  5809. }
  5810. }
  5811. else
  5812. {
  5813. SendClientMessage(playerid, WHITE, "Your vehicle's lights must me on to use this command!");
  5814. }
  5815. return 1;
  5816. }
  5817.  
  5818. command(opentrunk, playerid, params[])
  5819. {
  5820. new vehicleid = GetPlayerVehicleID(playerid);
  5821. if(Trunk[vehicleid] == 0)
  5822. {
  5823. if(IsPlayerInAnyVehicle(playerid))
  5824. {
  5825. Trunk[vehicleid] = 1;
  5826. new engine,lights,alarm,doors,bonnet,boot,objective;
  5827. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  5828. SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,1,objective);
  5829. new string[128];
  5830. format(string, sizeof(string), "* %s has opened their vehicles trunk.", GetName(playerid));
  5831. NearByMessage(playerid, PINK, string);
  5832. }
  5833. else
  5834. {
  5835. SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
  5836. }
  5837. }
  5838. else
  5839. {
  5840. SendClientMessage(playerid, WHITE, "Your vehicle's trunk must me closed to use this command!");
  5841. }
  5842. return 1;
  5843. }
  5844.  
  5845. command(closetrunk, playerid, params[])
  5846. {
  5847. new vehicleid = GetPlayerVehicleID(playerid);
  5848. if(Trunk[vehicleid] == 1)
  5849. {
  5850. if(IsPlayerInAnyVehicle(playerid))
  5851. {
  5852. Trunk[vehicleid] = 0;
  5853. new engine,lights,alarm,doors,bonnet,boot,objective;
  5854. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  5855. SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,0,objective);
  5856. new string[128];
  5857. format(string, sizeof(string), "* %s has closed their vehicles trunk.", GetName(playerid));
  5858. NearByMessage(playerid, PINK, string);
  5859. }
  5860. else
  5861. {
  5862. SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
  5863. }
  5864. }
  5865. else
  5866. {
  5867. SendClientMessage(playerid, WHITE, "Your vehicle's trunk must me open to use this command!");
  5868. }
  5869. return 1;
  5870. }
  5871.  
  5872. command(openhood, playerid, params[])
  5873. {
  5874. new vehicleid = GetPlayerVehicleID(playerid);
  5875. if(Hood[vehicleid] == 0)
  5876. {
  5877. if(IsPlayerInAnyVehicle(playerid))
  5878. {
  5879. Hood[vehicleid] = 1;
  5880. new engine,lights,alarm,doors,bonnet,boot,objective;
  5881. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  5882. SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,1,boot,objective);
  5883. new string[128];
  5884. format(string, sizeof(string), "* %s has opened their vehicles hood.", GetName(playerid));
  5885. NearByMessage(playerid, PINK, string);
  5886. }
  5887. else
  5888. {
  5889. SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
  5890. }
  5891. }
  5892. else
  5893. {
  5894. SendClientMessage(playerid, WHITE, "Your vehicle's hood must me closed to use this command!");
  5895. }
  5896. return 1;
  5897. }
  5898.  
  5899. command(closehood, playerid, params[])
  5900. {
  5901. new vehicleid = GetPlayerVehicleID(playerid);
  5902. if(Hood[vehicleid] == 1)
  5903. {
  5904. if(IsPlayerInAnyVehicle(playerid))
  5905. {
  5906. Hood[vehicleid] = 0;
  5907. new engine,lights,alarm,doors,bonnet,boot,objective;
  5908. GetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,bonnet,boot,objective);
  5909. SetVehicleParamsEx(vehicleid,engine,lights,alarm,doors,0,boot,objective);
  5910. new string[128];
  5911. format(string, sizeof(string), "* %s has closed their vehicles hood.", GetName(playerid));
  5912. NearByMessage(playerid, PINK, string);
  5913. }
  5914. else
  5915. {
  5916. SendClientMessage(playerid, WHITE, "You are not in a vehicle!");
  5917. }
  5918. }
  5919. else
  5920. {
  5921. SendClientMessage(playerid, WHITE, "Your vehicle's hood must me open to use this command!");
  5922. }
  5923. return 1;
  5924. }
  5925.  
  5926. command(stats, playerid, params[])
  5927. {
  5928. new calculation = PlayerInfo[playerid][Seconds]/60;
  5929. new namestring[380];
  5930. format(namestring, sizeof(namestring), "________________________________|%s's Stats|________________________________", GetName(playerid));
  5931. SendClientMessage(playerid, WHITE, namestring);
  5932. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5933. {
  5934. new astring[208];
  5935. 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]);
  5936. SendClientMessage(playerid, WHITE, astring);
  5937. 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]);
  5938. SendClientMessage(playerid, WHITE, astring);
  5939. format(astring, sizeof(astring),"Kills: %d | Deaths: %d | TotalSecondsConnected: %d | TotalMinutesConnected: %d", PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Seconds], calculation);
  5940. SendClientMessage(playerid, WHITE, astring);
  5941. SendClientMessage(playerid, WHITE, "Usage: 1 = YES, 0 = NO");
  5942. }
  5943. else
  5944. {
  5945. new string[128];
  5946. 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]);
  5947. SendClientMessage(playerid, WHITE, string);
  5948. 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]);
  5949. SendClientMessage(playerid, WHITE, string);
  5950. format(string, sizeof(string),"Kills: %d | Deaths: %d | TotalSecondsConnected: %d | TotalMinutesConnected: %d", PlayerInfo[playerid][Kills], PlayerInfo[playerid][Deaths], PlayerInfo[playerid][Seconds], calculation);
  5951. SendClientMessage(playerid, WHITE, string);
  5952. }
  5953. SendClientMessage(playerid, WHITE, "___________________________________________________________________________________");
  5954. return 1;
  5955. }
  5956.  
  5957. command(help, playerid, params[])
  5958. {
  5959. ShowPlayerDialog(playerid, 1, DIALOG_STYLE_LIST, "Help Menu - Select a Category", "General Commands\nAnimations\nVehicle", "Select", "Cancel");
  5960. return 1;
  5961. }
  5962.  
  5963. command(makegun, playerid, params[])
  5964. {
  5965. if(PlayerInfo[playerid][pJob] == 1)
  5966. {
  5967. if(PlayerInfo[playerid][pMats] > 0)
  5968. {
  5969. 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");
  5970. }
  5971. else
  5972. {
  5973. SendClientMessage(playerid, WHITE, "You do not have any materials!");
  5974. }
  5975. }
  5976. else
  5977. {
  5978. SendClientMessage(playerid, WHITE, "You are not an arms dealer!");
  5979. }
  5980. return 1;
  5981. }
  5982.  
  5983. command(agivemats, playerid, params[])
  5984. {
  5985. new id, string[128], string2[128], materials;
  5986. if(sscanf(params, "ud", id, materials))
  5987. {
  5988. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5989. {
  5990. SendClientMessage(playerid, WHITE, "SYNTAX: /agivemats [playerid] [amount]");
  5991. }
  5992. }
  5993. else
  5994. {
  5995. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  5996. {
  5997. PlayerInfo[id][pMats] += materials;
  5998. format(string2, sizeof(string2), "You have given Player %s %d materials successfully.", GetName(id), materials);
  5999. SendClientMessage(playerid, WHITE, string2);
  6000. format(string, sizeof(string), "Admin %s has given you %d materials (Admin Command)", GetName(playerid), materials);
  6001. SendClientMessage(id, WHITE, string);
  6002. }
  6003. }
  6004. return 1;
  6005. }
  6006.  
  6007. command(setadminlevel, playerid, params[])
  6008. {
  6009. new id, string[128], adminlevel;
  6010. if(sscanf(params, "ud", id, adminlevel))
  6011. {
  6012. if(PlayerInfo[playerid][pAdminLevel] >= 1330)
  6013. {
  6014. SendClientMessage(playerid, WHITE, "SYNTAX: /setadminlevel [playerid] [level]");
  6015. }
  6016. }
  6017. else
  6018. {
  6019. if(PlayerInfo[playerid][pAdminLevel] >= 1330)
  6020. {
  6021. if(PlayerInfo[playerid][pAdminLevel] > PlayerInfo[id][pAdminLevel])
  6022. {
  6023. PlayerInfo[id][pAdminLevel] = adminlevel;
  6024. format(string, sizeof(string), "%s is now a level %d Administrator! Congratulations!", GetName(id), adminlevel);
  6025. SendClientMessageToAll(WHITE, string);
  6026. }
  6027. else
  6028. {
  6029. SendClientMessage(playerid, WHITE, "That Admin is a higher rank than you.");
  6030. }
  6031. }
  6032. }
  6033. return 1;
  6034. }
  6035.  
  6036. command(createhouse, playerid, params[])
  6037. {
  6038. new Usage[128], string[128];
  6039. if(sscanf(params, "z", Usage))
  6040. {
  6041. if(PlayerInfo[playerid][pAdminLevel] >= 5)
  6042. {
  6043. SendClientMessage(playerid, WHITE, "SYNTAX: /createhouse [usage]");
  6044. SendClientMessage(playerid, GREY, "Usage: Interior, Exterior or Complete.");
  6045. }
  6046. }
  6047. else
  6048. {
  6049. if(PlayerInfo[playerid][pAdminLevel] >= 5)
  6050. {
  6051. if(strcmp(Usage, "exterior", true) == 0)
  6052. {
  6053. PlayerInfo[playerid][HouseExterior]++;
  6054. PlayerInfo[playerid][hExtID] = GetPlayerInterior(playerid);
  6055. GetPlayerPos(playerid, PlayerInfo[playerid][hExtX], PlayerInfo[playerid][hExtY], PlayerInfo[playerid][hExtZ]);
  6056. format(string, sizeof(string), "Exterior set! (X: %f, Y: %f, Z: %f).", PlayerInfo[playerid][hExtX], PlayerInfo[playerid][hExtY], PlayerInfo[playerid][hExtZ]);
  6057. SendClientMessage(playerid, WHITE, string);
  6058. }
  6059. if(strcmp(Usage, "interior", true) == 0)
  6060. {
  6061. PlayerInfo[playerid][HouseInterior]++;
  6062. PlayerInfo[playerid][hIntID] = GetPlayerInterior(playerid);
  6063. GetPlayerPos(playerid, PlayerInfo[playerid][hIntX], PlayerInfo[playerid][hIntY], PlayerInfo[playerid][hIntZ]);
  6064. format(string, sizeof(string), "Interior set! (X: %f, Y: %f, Z: %f).", PlayerInfo[playerid][hIntX], PlayerInfo[playerid][hIntY], PlayerInfo[playerid][hIntZ]);
  6065. SendClientMessage(playerid, WHITE, string);
  6066. }
  6067. if(strcmp(Usage, "complete", true) == 0)
  6068. {
  6069. if(PlayerInfo[playerid][HouseInterior] > 0 || PlayerInfo[playerid][HouseExterior] > 0)
  6070. {
  6071. new NewHouseID = SpawnedHouses+1;
  6072.  
  6073. if(NewHouseID >= MAX_HOUSES)
  6074. {
  6075. SendClientMessage(playerid, WHITE, "Too many houses are currently spawned!");
  6076. }
  6077. else
  6078. {
  6079. format(string, sizeof(string), "Houses/House_%d.ini", NewHouseID);
  6080.  
  6081. if(!fexist(string))
  6082. {
  6083. Houses[NewHouseID][hInteriorID] = PlayerInfo[playerid][hIntID];
  6084. Houses[NewHouseID][hExteriorID] = PlayerInfo[playerid][hExtID];
  6085. Houses[NewHouseID][hInteriorX] = PlayerInfo[playerid][hIntX];
  6086. Houses[NewHouseID][hInteriorY] = PlayerInfo[playerid][hIntY];
  6087. Houses[NewHouseID][hInteriorZ] = PlayerInfo[playerid][hIntZ];
  6088. Houses[NewHouseID][hExteriorX] = PlayerInfo[playerid][hExtX];
  6089. Houses[NewHouseID][hExteriorY] = PlayerInfo[playerid][hExtY];
  6090. Houses[NewHouseID][hExteriorZ] = PlayerInfo[playerid][hExtZ];
  6091. format(Houses[NewHouseID][hOwner], 255, "Nobody");
  6092. Houses[NewHouseID][HPickupID] = CreateDynamicPickup(1273, 23, Houses[NewHouseID][hExteriorX], Houses[NewHouseID][hExteriorY], Houses[NewHouseID][hExteriorZ], 0, -1, -1, 150.0);
  6093.  
  6094. dini_Create(string);
  6095. dini_IntSet(string, "InteriorID", Houses[NewHouseID][hInteriorID]);
  6096. dini_FloatSet(string, "InteriorX", Houses[NewHouseID][hInteriorX]);
  6097. dini_FloatSet(string, "InteriorY", Houses[NewHouseID][hInteriorY]);
  6098. dini_FloatSet(string, "InteriorZ", Houses[NewHouseID][hInteriorZ]);
  6099.  
  6100. dini_IntSet(string, "HousePrice", 0);
  6101.  
  6102. dini_IntSet(string, "ExteriorID", 0);
  6103. dini_FloatSet(string, "ExteriorX", Houses[NewHouseID][hExteriorX]);
  6104. dini_FloatSet(string, "ExteriorY", Houses[NewHouseID][hExteriorY]);
  6105. dini_FloatSet(string, "ExteriorZ", Houses[NewHouseID][hExteriorZ]);
  6106.  
  6107. dini_Set(string, "Owner", "Nobody");
  6108.  
  6109. PlayerInfo[playerid][HouseExterior]--;
  6110. PlayerInfo[playerid][HouseInterior]--;
  6111.  
  6112. SpawnedHouses++;
  6113. SendClientMessage(playerid, ME, "Successfully created house!");
  6114. SetPlayerInterior(playerid, Houses[NewHouseID][hExteriorID]);
  6115. SetPlayerPos(playerid, Houses[NewHouseID][hExteriorX], Houses[NewHouseID][hExteriorY], Houses[NewHouseID][hExteriorZ]);
  6116. }
  6117. else
  6118. {
  6119. SendClientMessage(playerid, WHITE, "Error: File already exists!");
  6120. }
  6121. }
  6122. }
  6123. else
  6124. {
  6125. SendClientMessage(playerid, WHITE, "You must select an exterior and an interior first!");
  6126. }
  6127. }
  6128. }
  6129. }
  6130. return 1;
  6131. }
  6132.  
  6133. command(buyhouse, playerid, params[])
  6134. {
  6135. #pragma unused params
  6136. new string[128];
  6137. if(PlayerInfo[playerid][House] == 0)
  6138. {
  6139. for(new h = 0; h < sizeof(Houses); h++)
  6140. {
  6141. if(IsPlayerInRangeOfPoint(playerid, 5, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ]))
  6142. {
  6143. if(strcmp(Houses[h][hOwner], "Nobody", true) == 0)
  6144. {
  6145. if(Houses[h][HousePrice] == -1)
  6146. {
  6147. SendClientMessage(playerid, WHITE, "This house isn't purchasable.");
  6148. }
  6149. else
  6150. {
  6151. if(PlayerInfo[playerid][pCash] >= Houses[h][HousePrice])
  6152. {
  6153. PlayerInfo[playerid][pCash] -= Houses[h][HousePrice];
  6154. format(Houses[h][hOwner], 128, "%s", GetName(playerid));
  6155. format(string, sizeof(string), "Congratulations! You are now the owner of this property (House %d)", h);
  6156. SendClientMessage(playerid, ANNOUNCEMENT, string);
  6157. PlayerInfo[playerid][House] = h;
  6158. DestroyDynamicPickup(Houses[h][HPickupID]);
  6159. Houses[h][HPickupID] = CreateDynamicPickup(1272, 23, Houses[h][hExteriorX], Houses[h][hExteriorY], Houses[h][hExteriorZ], 0, -1, -1, 150.0);
  6160. SaveHouse(h);
  6161. SendClientMessage(playerid, WHITE, "By purchasing a house, you've unlocked a bunch of new commands; use /help to find them out!");
  6162. }
  6163. else
  6164. {
  6165. SendClientMessage(playerid, WHITE, "You do not have enough money to purchase this house.");
  6166. }
  6167. }
  6168. }
  6169. else
  6170. {
  6171. SendClientMessage(playerid, WHITE, "Sorry, this house is not available!");
  6172. }
  6173. }
  6174. }
  6175. }
  6176. else
  6177. {
  6178. SendClientMessage(playerid, WHITE, "You already have a house, type /abandonhouse.");
  6179. }
  6180. return 1;
  6181. }
  6182.  
  6183. command(houseprice, playerid, params[])
  6184. {
  6185. new money, id, string[128];
  6186. if(sscanf(params, "dd", id, money))
  6187. {
  6188. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  6189. {
  6190. SendClientMessage(playerid, WHITE, "SYNTAX: /houseprice [houseid] [usage]");
  6191. }
  6192. }
  6193. else
  6194. {
  6195. if(PlayerInfo[playerid][pAdminLevel] >= 2)
  6196. {
  6197. format(string, sizeof(string), "Houses/House_%d.ini", id);
  6198. if(!fexist(string))
  6199. {
  6200. SendClientMessage(playerid, WHITE, "Invalid house ID!");
  6201. return 1;
  6202. }
  6203. else
  6204. {
  6205. Houses[id][HousePrice] = money;
  6206. SaveHouse(id);
  6207. }
  6208. }
  6209. }
  6210. return 1;
  6211. }
  6212.  
  6213. command(abandonhouse, playerid, params[])
  6214. {
  6215. new Confirmation[7];
  6216. if(sscanf(params, "z", Confirmation))
  6217. {
  6218. SendClientMessage(playerid, WHITE, "Are you SURE you want to abandon your house? Please type /abandonhouse confirm");
  6219. }
  6220. else
  6221. {
  6222. if(strcmp(Confirmation, "Confirm", true) == 0)
  6223. {
  6224. if(PlayerInfo[playerid][House] != 0)
  6225. {
  6226. format(Houses[PlayerInfo[playerid][House]][hOwner], 255, "Nobody");
  6227. SendClientMessage(playerid, WHITE, "You have now abandoned your house.");
  6228. SaveHouse(PlayerInfo[playerid][House]);
  6229. DestroyDynamicPickup(Houses[PlayerInfo[playerid][House]][HPickupID]);
  6230. 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);
  6231. PlayerInfo[playerid][House] = 0;
  6232. }
  6233. }
  6234. }
  6235. return 1;
  6236. }
  6237.  
  6238. command(asellhouse, playerid, params[])
  6239. {
  6240. new string[128], id;
  6241. if(sscanf(params, "d", id))
  6242. {
  6243. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  6244. {
  6245. SendClientMessage(playerid, WHITE, "SYNTAX: /asellhouse [house ID]");
  6246. }
  6247. }
  6248. else
  6249. {
  6250. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  6251. {
  6252. format(string, sizeof(string), "Houses/House_%d.ini", id);
  6253.  
  6254. if(fexist(string))
  6255. {
  6256. format(string, sizeof(string), "Accounts/%s.ini", Houses[id][hOwner]);
  6257. if(fexist(string))
  6258. {
  6259. dini_IntSet(string, "House", 0);
  6260. }
  6261.  
  6262. format(Houses[id][hOwner], 128, "Nobody");
  6263. format(string, sizeof(string), "You have sold house %d.", id);
  6264. SendClientMessage(playerid, WHITE, string);
  6265. SaveHouse(id);
  6266. DestroyDynamicPickup(Houses[id][HPickupID]);
  6267. Houses[id][HPickupID] = CreateDynamicPickup(1273, 23, Houses[id][hExteriorX], Houses[id][hExteriorY], Houses[id][hExteriorZ], 0, -1, -1, 150.0);
  6268.  
  6269. }
  6270. else
  6271. {
  6272. SendClientMessage(playerid, WHITE, "Invalid house ID!");
  6273. }
  6274. }
  6275. }
  6276. return 1;
  6277. }
  6278.  
  6279. command(deposit, playerid, params[])
  6280. {
  6281. new string[128], money;
  6282. new string2[128];
  6283. if(sscanf(params, "d", money))
  6284. {
  6285. if(IsPlayerConnected(playerid))
  6286. {
  6287. SendClientMessage(playerid, WHITE, "SYNTAX: /deposit [ammount]");
  6288. }
  6289. }
  6290. else
  6291. {
  6292. if(IsPlayerConnected(playerid))
  6293. {
  6294. if(PlayerInfo[playerid][pCash] >= money)
  6295. {
  6296. if(InBank[playerid] == 1)
  6297. {
  6298. if(money > 0)
  6299. {
  6300. PlayerInfo[playerid][pCash] -= money;
  6301. PlayerInfo[playerid][BankMoney] += money;
  6302. format(string, sizeof(string), "You have Deposited $%d into your Bank Account!", money);
  6303. SendClientMessage(playerid, WHITE, string);
  6304. format(string2, sizeof(string2), "Your new Balance: $%d", PlayerInfo[playerid][BankMoney]);
  6305. SendClientMessage(playerid, WHITE, string2);
  6306. }
  6307. else
  6308. {
  6309. SendClientMessage(playerid, WHITE, "Amount must be greater than 0!");
  6310. }
  6311. }
  6312. else
  6313. {
  6314. SendClientMessage(playerid, WHITE, "You must be in the bank to Deposit Money!");
  6315. }
  6316. }
  6317. else
  6318. {
  6319. SendClientMessage(playerid, WHITE, "You do not have that much money to Deposit!");
  6320. }
  6321. }
  6322. else
  6323. {
  6324. SendClientMessage(playerid, WHITE, "You are not connected!");
  6325. }
  6326. }
  6327. return 1;
  6328. }
  6329.  
  6330. command(balance, playerid, params[])
  6331. {
  6332. if(InBank[playerid] == 1)
  6333. {
  6334. new string[128];
  6335. format(string, sizeof(string), "Bank Balance: $%d", PlayerInfo[playerid][BankMoney]);
  6336. SendClientMessage(playerid, WHITE, string);
  6337. }
  6338. else
  6339. {
  6340. SendClientMessage(playerid, WHITE, "You must be in the bank to check your Balance!");
  6341. }
  6342. return 1;
  6343. }
  6344.  
  6345. command(withdraw, playerid, params[])
  6346. {
  6347. new string[128], money;
  6348. new string2[128];
  6349. if(sscanf(params, "d", money))
  6350. {
  6351. if(IsPlayerConnected(playerid))
  6352. {
  6353. SendClientMessage(playerid, WHITE, "SYNTAX: /withdraw [ammount]");
  6354. }
  6355. }
  6356. else
  6357. {
  6358. if(IsPlayerConnected(playerid))
  6359. {
  6360. if(PlayerInfo[playerid][BankMoney] >= money)
  6361. {
  6362. if(InBank[playerid] == 1)
  6363. {
  6364. if(money > 0)
  6365. {
  6366. PlayerInfo[playerid][pCash] += money;
  6367. PlayerInfo[playerid][BankMoney] -= money;
  6368. format(string, sizeof(string), "You have Withdrawed $%d from your Bank Account!", money);
  6369. SendClientMessage(playerid, WHITE, string);
  6370. format(string2, sizeof(string2), "Your new Balance: $%d", PlayerInfo[playerid][BankMoney]);
  6371. SendClientMessage(playerid, WHITE, string2);
  6372. }
  6373. else
  6374. {
  6375. SendClientMessage(playerid, WHITE, "Amount must be greater than 0!");
  6376. }
  6377. }
  6378. else
  6379. {
  6380. SendClientMessage(playerid, WHITE, "You must be in the bank to Withdraw Money!");
  6381. }
  6382. }
  6383. else
  6384. {
  6385. SendClientMessage(playerid, WHITE, "You do not have that much money in your account to Withdraw!");
  6386. }
  6387. }
  6388. else
  6389. {
  6390. SendClientMessage(playerid, WHITE, "You are not connected!");
  6391. }
  6392. }
  6393. return 1;
  6394. }
  6395.  
  6396. command(quitjob, playerid, params[])
  6397. {
  6398. if(PlayerInfo[playerid][pJob] >= 1)
  6399. {
  6400. PlayerInfo[playerid][pJob] = 0;
  6401. SendClientMessage(playerid, WHITE, "You have quit your job!");
  6402. }
  6403. else
  6404. {
  6405. SendClientMessage(playerid, WHITE, "You do not have a job to quit!");
  6406. }
  6407. return 1;
  6408. }
  6409.  
  6410. command(joinjob, playerid, params[])
  6411. {
  6412. new Usage[128];
  6413. if(sscanf(params, "z", Usage))
  6414. {
  6415. SendClientMessage(playerid, WHITE, "SYNTAX: /joinjob [usage]");
  6416. SendClientMessage(playerid, GREY, "Usages: ArmsDealer");
  6417. }
  6418. else
  6419. {
  6420. if(strcmp(Usage, "Armsdealer", true) == 0)
  6421. {
  6422. if(IsPlayerInRangeOfPoint(playerid, 5.0, 1302.1343,217.0710,19.5547))
  6423. {
  6424. if(PlayerInfo[playerid][pJob] == 0)
  6425. {
  6426. if(PlayerInfo[playerid][pScore] >= 3)
  6427. {
  6428. PlayerInfo[playerid][pJob] = 1;
  6429. SendClientMessage(playerid, WHITE, "You have now become an Arms Dealer, you can now use the command /makegun!");
  6430. }
  6431. else
  6432. {
  6433. SendClientMessage(playerid, WHITE, "You are not a high enough level to become an arms dealer! (Level 3).");
  6434. }
  6435. }
  6436. else
  6437. {
  6438. SendClientMessage(playerid, WHITE, "You already have a job!");
  6439. }
  6440. }
  6441. else
  6442. {
  6443. SendClientMessage(playerid, WHITE, "You are not in the Join Job area!");
  6444. }
  6445. }
  6446. }
  6447. return 1;
  6448. }
  6449.  
  6450. command(enter, playerid, params[])
  6451. {
  6452. for(new i = 0; i < sizeof(Houses); i++)
  6453. {
  6454. if(IsPlayerInRangeOfPoint(playerid, 3, Houses[i][hExteriorX], Houses[i][hExteriorY], Houses[i][hExteriorZ]))
  6455. {
  6456. PlayerInfo[playerid][InHouse] = i;
  6457. SetPlayerVirtualWorld(playerid, 55000+i);
  6458. SetPlayerInterior(playerid, Houses[i][hInteriorID]);
  6459. SetPlayerPos(playerid, Houses[i][hInteriorX], Houses[i][hInteriorY], Houses[i][hInteriorZ]);
  6460. }
  6461. if(IsPlayerInRangeOfPoint(playerid, 3, Groups[i][gExtX], Groups[i][gExtY], Groups[i][gExtZ]))
  6462. {
  6463. InHQ[playerid] = 1;
  6464. SetPlayerVirtualWorld(playerid, 55000+i);
  6465. SetPlayerInterior(playerid, Groups[i][gIntID]);
  6466. SetPlayerPos(playerid, Groups[i][gIntX], Groups[i][gIntY], Groups[i][gIntZ]);
  6467. }
  6468. if(IsPlayerInRangeOfPoint(playerid, 3, DepartmentExtX, DepartmentExtY, DepartmentExtZ))
  6469. {
  6470. InHQ[playerid] = 1;
  6471. SetPlayerVirtualWorld(playerid, 55000+i);
  6472. SetPlayerInterior(playerid, DepartmentIntID);
  6473. SetPlayerPos(playerid, DepartmentIntX, DepartmentIntY, DepartmentIntZ);
  6474. }
  6475. if(IsPlayerInRangeOfPoint(playerid, 3, BankExtX, BankExtY, BankExtZ))
  6476. {
  6477. InBank[playerid] = 1;
  6478. SetPlayerVirtualWorld(playerid, 55000+i);
  6479. SetPlayerInterior(playerid, BankIntID);
  6480. SendClientMessage(playerid, WHITE, "AVAILABLE COMMANDS: /deposit, /withdraw, /balance");
  6481. SetPlayerPos(playerid, BankIntX, BankIntY, BankIntZ);
  6482. }
  6483. if(IsPlayerInRangeOfPoint(playerid, 3, ClothesExtX, ClothesExtY, ClothesExtZ))
  6484. {
  6485. InClothesShop[playerid] = 1;
  6486. SetPlayerVirtualWorld(playerid, 55000+i);
  6487. SetPlayerInterior(playerid, ClothesIntID);
  6488. SetPlayerPos(playerid, ClothesIntX, ClothesIntY, ClothesIntZ);
  6489. }
  6490. }
  6491. return 1;
  6492. }
  6493.  
  6494. command(exit, playerid, params[])
  6495. {
  6496. for(new i = 0; i < sizeof(Houses); i++)
  6497. {
  6498. if(GetPlayerVirtualWorld(playerid) >= 55000 && GetPlayerVirtualWorld(playerid) < 65000 && IsPlayerInRangeOfPoint(playerid, 3, Houses[i][hInteriorX], Houses[i][hInteriorY], Houses[i][hInteriorZ]))
  6499. {
  6500. if(PlayerInfo[playerid][InHouse] != 0)
  6501. {
  6502. SetPlayerVirtualWorld(playerid, 0);
  6503. SetPlayerInterior(playerid, Houses[PlayerInfo[playerid][InHouse]][hExteriorID]);
  6504. SetPlayerPos(playerid, Houses[PlayerInfo[playerid][InHouse]][hExteriorX], Houses[PlayerInfo[playerid][InHouse]][hExteriorY], Houses[PlayerInfo[playerid][InHouse]][hExteriorZ]);
  6505. PlayerInfo[playerid][InHouse] = 0;
  6506. }
  6507. else
  6508. {
  6509. SetPlayerVirtualWorld(playerid, 0);
  6510. SetPlayerInterior(playerid, Houses[i][hExteriorID]);
  6511. SetPlayerPos(playerid, Houses[i][hExteriorX], Houses[i][hExteriorY], Houses[i][hExteriorZ]);
  6512. }
  6513. }
  6514. if(IsPlayerInRangeOfPoint(playerid, 3, Groups[i][gIntX], Groups[i][gIntY], Groups[i][gIntZ]))
  6515. {
  6516. SetPlayerVirtualWorld(playerid, 0);
  6517. SetPlayerInterior(playerid, 0);
  6518. SetPlayerPos(playerid, Groups[i][gExtX], Groups[i][gExtY], Groups[i][gExtZ]);
  6519. }
  6520. if(IsPlayerInRangeOfPoint(playerid, 3, DepartmentIntX, DepartmentIntY, DepartmentIntZ))
  6521. {
  6522. InHQ[playerid] = 0;
  6523. SetPlayerVirtualWorld(playerid, 0);
  6524. SetPlayerInterior(playerid, 0);
  6525. SetPlayerPos(playerid, DepartmentExtX, DepartmentExtY, DepartmentExtZ);
  6526. }
  6527. if(IsPlayerInRangeOfPoint(playerid, 3, BankIntX, BankIntY, BankIntZ))
  6528. {
  6529. InBank[playerid] = 0;
  6530. SetPlayerPos(playerid, BankExtX, BankExtY, BankExtZ);
  6531. SetPlayerVirtualWorld(playerid, 0);
  6532. SetPlayerInterior(playerid, 0);
  6533. }
  6534. if(IsPlayerInRangeOfPoint(playerid, 3, ClothesIntX, ClothesIntY, ClothesIntZ))
  6535. {
  6536. InClothesShop[playerid] = 0;
  6537. SetPlayerPos(playerid, ClothesExtX, ClothesExtY, ClothesExtZ);
  6538. SetPlayerVirtualWorld(playerid, 0);
  6539. SetPlayerInterior(playerid, 0);
  6540. }
  6541. }
  6542. return 1;
  6543. }
  6544.  
  6545. command(fish, playerid, params[])
  6546. {
  6547. if(IsPlayerInRangeOfPoint(playerid, 10, 2111.2566,-98.2426,2.1183))
  6548. {
  6549. if(PlayerInfo[playerid][FishRod] == 1)
  6550. {
  6551. if(PlayerInfo[playerid][FishLicense] == 1)
  6552. {
  6553. if(PlayerInfo[playerid][FishBait] >= 1)
  6554. {
  6555. if(PlayerInfo[playerid][Fish] < 10)
  6556. {
  6557. if(Fishing[playerid] == 0)
  6558. {
  6559. new rand = random(10);
  6560.  
  6561. switch(rand)
  6562. {
  6563. case 0, 1, 2, 3, 4, 5, 6, 7, 8, 9:
  6564. {
  6565. FishTimer = SetTimerEx("FishPublic", 10000, false, "i", playerid);
  6566. Fishing[playerid] = 1;
  6567. TogglePlayerControllable(playerid, false);
  6568. ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,0,1,1);
  6569. SetPlayerAttachedObject(playerid, 0,18632,6,0.079376,0.037070,0.007706,181.482910,0.000000,0.000000,1.000000,1.000000,1.000000);
  6570. }
  6571. case 1000:
  6572. {
  6573. FishTimer = SetTimerEx("WhalePublic", 10000, false, "i", playerid);
  6574. Fishing[playerid] = 1;
  6575. TogglePlayerControllable(playerid, false);
  6576. ApplyAnimation(playerid,"SWORD","sword_block",50.0,0,1,0,1,1);
  6577. SetPlayerAttachedObject(playerid, 0,18632,6,0.079376,0.037070,0.007706,181.482910,0.000000,0.000000,1.000000,1.000000,1.000000);
  6578. }
  6579. }
  6580. }
  6581. else
  6582. {
  6583. SendClientMessage(playerid, WHITE, "You are already fishing, please wait!");
  6584. }
  6585. }
  6586. else
  6587. {
  6588. SendClientMessage(playerid, WHITE, "You must sell some fish before you can fish again!");
  6589. }
  6590. }
  6591. else
  6592. {
  6593. SendClientMessage(playerid, WHITE, "You do not have any Fishing Bait!");
  6594. }
  6595. }
  6596. else
  6597. {
  6598. SendClientMessage(playerid, WHITE, "You do not have a Fishing License!");
  6599. }
  6600. }
  6601. else
  6602. {
  6603. SendClientMessage(playerid, WHITE, "You do not have a Fishing Rod!");
  6604. }
  6605. }
  6606. else
  6607. {
  6608. SendClientMessage(playerid, WHITE, "You must be at the pier to fish!");
  6609. }
  6610. return 1;
  6611. }
  6612.  
  6613. command(fishingshop, playerid, params[])
  6614. {
  6615. if(IsPlayerInRangeOfPoint(playerid, 5.0, 2160.6680,-98.3544,2.8150))
  6616. {
  6617. ShowPlayerDialog(playerid, 10, DIALOG_STYLE_LIST, "Fish Shop", "Fishing Bait(x25)($10)\nFishing License($250)\nFishing Rod($150)", "Select", "Cancel");
  6618. }
  6619. else
  6620. {
  6621. SendClientMessage(playerid, WHITE, "You are not at the fishing shop!");
  6622. }
  6623. return 1;
  6624. }
  6625.  
  6626. command(ajail, playerid, params[])
  6627. {
  6628. new id, string[128], time, Reason[128];
  6629. if(sscanf(params, "udz", id, time, Reason))
  6630. {
  6631. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  6632. {
  6633. SendClientMessage(playerid, WHITE, "SYNTAX: /prison [playerid] [time] [reason]");
  6634. }
  6635. }
  6636. else
  6637. {
  6638. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  6639. {
  6640. if(IsPlayerConnected(id))
  6641. {
  6642. if(PlayerInfo[playerid][pAdminLevel] >= PlayerInfo[id][pAdminLevel])
  6643. {
  6644. if(strlen(Reason) < 1)
  6645. {
  6646. SendClientMessage(playerid, WHITE, "SYNTAX: /prison [playerid] [time] [reason]");
  6647. }
  6648. else
  6649. {
  6650. if(time == 0)
  6651. {
  6652. if(PlayerInfo[id][PrisonDuration] >= 1)
  6653. {
  6654. format(string, sizeof(string), "Prison: %s has been released from prison by %s, reason: %s.", GetName(id), GetName(playerid), Reason);
  6655. SendClientMessageToAll(LIGHTRED, string);
  6656. PlayerInfo[id][PrisonDuration] = 0;
  6657. PlayerInfo[id][PrisonID] = 0;
  6658. SetPlayerPos(id, 608.1954,-543.5193,16.5681);
  6659. SetPlayerVirtualWorld(id, 0);
  6660. SetPlayerInterior(id, 0);
  6661. SendClientMessage(id, WHITE, "You have been released from prison.");
  6662. TogglePlayerControllable(id, true);
  6663. }
  6664. else
  6665. {
  6666. SendClientMessage(playerid, WHITE, "You can't release some-one who isn't even prisoned.");
  6667. }
  6668. }
  6669. else
  6670. {
  6671. format(string, sizeof(string), "Prison: %s has been prisoned by %s, reason: %s (%d minutes).", GetName(id), GetName(playerid), Reason, time);
  6672. SendClientMessageToAll(LIGHTRED, string);
  6673. PlayerInfo[id][PrisonDuration] = time*60;
  6674. PlayerInfo[id][PrisonID] = 1;
  6675.  
  6676. if(PlayerInfo[id][pAdminLevel] < 1)
  6677. {
  6678. SendClientMessage(playerid, WHITE, "You have earned an admin action!");
  6679. }
  6680.  
  6681. if(IsPlayerInAnyVehicle(id))
  6682. {
  6683. RemovePlayerFromVehicle(id);
  6684. }
  6685.  
  6686. ResetPlayerWeapons(id);
  6687.  
  6688. SetPlayerInterior(id, Prison1Int);
  6689. SetPlayerPos(id, Prison1X, Prison1Y, Prison1Z);
  6690. SetPlayerVirtualWorld(id, Prison1World);
  6691. }
  6692. }
  6693. }
  6694. else
  6695. {
  6696. SendClientMessage(playerid, WHITE, "You can't prison a higher level admin.");
  6697. }
  6698. }
  6699. else
  6700. {
  6701. SendClientMessage(playerid, WHITE, "That player isn't connected or isn't logged in.");
  6702. }
  6703. }
  6704. }
  6705. return 1;
  6706. }
  6707.  
  6708. command(sellfish, playerid, params[])
  6709. {
  6710. if(IsPlayerInRangeOfPoint(playerid, 5.0, 2160.6680,-98.3544,2.8150))
  6711. {
  6712. if(PlayerInfo[playerid][Fish] > 0)
  6713. {
  6714. new string[128];
  6715. new calculation = PlayerInfo[playerid][FishWeight]*3;
  6716. PlayerInfo[playerid][pCash] += calculation;
  6717. PlayerInfo[playerid][FishWeight] = 0;
  6718. format(string, sizeof(string), "You have recieved $%d for all of your fish!", calculation);
  6719. SendClientMessage(playerid, WHITE, string);
  6720. PlayerInfo[playerid][Fish] = 0;
  6721. }
  6722. else
  6723. {
  6724. SendClientMessage(playerid, WHITE, "You do not have any fish to sell!");
  6725. }
  6726. }
  6727. else
  6728. {
  6729. SendClientMessage(playerid, WHITE, "You are not at the Fishing Shop!");
  6730. }
  6731. return 1;
  6732. }
  6733.  
  6734. command(vbuy, playerid, params[])
  6735. {
  6736. if(IsPlayerInRangeOfPoint(playerid, 10, 1230.2791,139.5188,20.3028))
  6737. {
  6738. 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");
  6739. }
  6740. return 1;
  6741. }
  6742.  
  6743. command(pay, playerid, params[])
  6744. {
  6745. new id, string[128], string2[128], money;
  6746. new string3[128];
  6747. if(sscanf(params, "ud", id, money))
  6748. {
  6749. if(IsPlayerConnected(id))
  6750. {
  6751. SendClientMessage(playerid, WHITE, "SYNTAX: /pay [playerid] [ammount]");
  6752. }
  6753. }
  6754. else
  6755. {
  6756. if(IsPlayerConnected(id))
  6757. {
  6758. if(PlayerInfo[playerid][pCash] >= money)
  6759. {
  6760. if(GetDistanceBetweenPlayers(playerid, id) <= 10)
  6761. {
  6762. PlayerInfo[playerid][pCash] -= money;
  6763. PlayerInfo[id][pCash] += money;
  6764. format(string, sizeof(string), "You have given %s $%d.", GetName(id), money);
  6765. format(string2, sizeof(string2), "%s has given you $%d.", GetName(playerid), money);
  6766. format(string3, sizeof(string3), "%s has given %s $%d.", GetName(playerid), GetName(id), money);
  6767. SendClientMessage(playerid, WHITE, string);
  6768. SendClientMessage(id, WHITE, string2);
  6769. NearByMessage(playerid, WHITE, string3);
  6770. }
  6771. else
  6772. {
  6773. SendClientMessage(playerid, WHITE, "You must be closer to that player to Pay them!");
  6774. }
  6775. }
  6776. else
  6777. {
  6778. SendClientMessage(playerid, WHITE, "You do not have that much money to give!");
  6779. }
  6780. }
  6781. else
  6782. {
  6783. SendClientMessage(playerid, WHITE, "That player is not connected!");
  6784. }
  6785. }
  6786. return 1;
  6787. }
  6788.  
  6789. command(agivemoney, playerid, params[])
  6790. {
  6791. new id, string[128], string2[128], money;
  6792. if(sscanf(params, "ud", id, money))
  6793. {
  6794. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  6795. {
  6796. SendClientMessage(playerid, WHITE, "SYNTAX: /agivemoney [playerid] [amount]");
  6797. }
  6798. }
  6799. else
  6800. {
  6801. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  6802. {
  6803. PlayerInfo[id][pCash] += money;
  6804. format(string2, sizeof(string2), "You have given Player %s $%d successfully.", GetName(id), money);
  6805. SendClientMessage(playerid, WHITE, string2);
  6806. format(string, sizeof(string), "Admin %s has given you $%d (Admin Command)", GetName(playerid), money);
  6807. SendClientMessage(id, WHITE, string);
  6808. }
  6809. }
  6810. return 1;
  6811. }
  6812.  
  6813. command(parkcar, playerid, params[])
  6814. {
  6815. new vehslot;
  6816. if(sscanf(params, "d", vehslot))
  6817. {
  6818. SendClientMessage(playerid, WHITE, "SYNTAX: /parkcar [1-3]");
  6819. }
  6820. else
  6821. {
  6822. switch(vehslot)
  6823. {
  6824. case 1:
  6825. {
  6826. if(PlayerInfo[playerid][PlayerCarModel] > 0)
  6827. {
  6828. if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][CarLinkID])
  6829. {
  6830. if(PlayerInfo[playerid][CarModDelay] == 0)
  6831. {
  6832. new Float: tmpdamage;
  6833. GetVehicleHealth(PlayerInfo[playerid][CarLinkID], tmpdamage);
  6834. GetVehicleZAngle(PlayerInfo[playerid][CarLinkID], PlayerInfo[playerid][CarZAngle]);
  6835. GetVehiclePos(PlayerInfo[playerid][CarLinkID], PlayerInfo[playerid][CarX], PlayerInfo[playerid][CarY], PlayerInfo[playerid][CarZ]);
  6836. DestroyVehicle(PlayerInfo[playerid][CarLinkID]);
  6837.  
  6838. OwnedCarCount--;
  6839. CarCount--;
  6840.  
  6841. SpawnOwnedCar(playerid, 1);
  6842. PutPlayerInVehicle(playerid, PlayerInfo[playerid][CarLinkID], 0);
  6843. PlayerInfo[playerid][CarModDelay] = 1;
  6844. SetVehicleHealth(PlayerInfo[playerid][CarLinkID], tmpdamage);
  6845. }
  6846. else
  6847. {
  6848. SendClientMessage(playerid, WHITE, "Please wait your reload time (60 seconds).");
  6849. }
  6850. }
  6851. else
  6852. {
  6853. SendClientMessage(playerid, WHITE, "You have to be in your car to do this. Use /callcar if you've lost it.");
  6854. }
  6855. }
  6856. }
  6857. case 2:
  6858. {
  6859. if(PlayerInfo[playerid][PlayerCarModel2] > 0)
  6860. {
  6861. if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][Car2LinkID])
  6862. {
  6863. if(PlayerInfo[playerid][CarModDelay] == 0)
  6864. {
  6865. new Float: tmpdamage;
  6866. GetVehicleHealth(PlayerInfo[playerid][Car2LinkID], tmpdamage);
  6867. GetVehicleZAngle(PlayerInfo[playerid][Car2LinkID], PlayerInfo[playerid][Car2ZAngle]);
  6868. GetVehiclePos(PlayerInfo[playerid][Car2LinkID], PlayerInfo[playerid][Car2X], PlayerInfo[playerid][Car2Y], PlayerInfo[playerid][Car2Z]);
  6869. DestroyVehicle(PlayerInfo[playerid][Car2LinkID]);
  6870.  
  6871. OwnedCarCount--;
  6872. CarCount--;
  6873.  
  6874. SpawnOwnedCar(playerid, 2);
  6875. PutPlayerInVehicle(playerid, PlayerInfo[playerid][Car2LinkID], 0);
  6876. PlayerInfo[playerid][CarModDelay] = 1;
  6877. SetVehicleHealth(PlayerInfo[playerid][Car2LinkID], tmpdamage);
  6878. }
  6879. else
  6880. {
  6881. SendClientMessage(playerid, WHITE, "Please wait your reload time (60 seconds).");
  6882. }
  6883. }
  6884. else
  6885. {
  6886. SendClientMessage(playerid, WHITE, "You have to be in your car to do this. Use /callcar if you've lost it.");
  6887. }
  6888. }
  6889. }
  6890. case 3:
  6891. {
  6892. if(PlayerInfo[playerid][PlayerCarModel3] > 0)
  6893. {
  6894. if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][Car3LinkID])
  6895. {
  6896. if(PlayerInfo[playerid][CarModDelay] == 0)
  6897. {
  6898. new Float: tmpdamage;
  6899. GetVehicleHealth(PlayerInfo[playerid][Car3LinkID], tmpdamage);
  6900. GetVehicleZAngle(PlayerInfo[playerid][Car3LinkID], PlayerInfo[playerid][Car3ZAngle]);
  6901. GetVehiclePos(PlayerInfo[playerid][Car3LinkID], PlayerInfo[playerid][Car3X], PlayerInfo[playerid][Car3Y], PlayerInfo[playerid][Car3Z]);
  6902. DestroyVehicle(PlayerInfo[playerid][Car3LinkID]);
  6903.  
  6904. OwnedCarCount--;
  6905. CarCount--;
  6906.  
  6907. SpawnOwnedCar(playerid, 3);
  6908. PutPlayerInVehicle(playerid, PlayerInfo[playerid][Car3LinkID], 0);
  6909. PlayerInfo[playerid][CarModDelay] = 1;
  6910. SetVehicleHealth(PlayerInfo[playerid][Car3LinkID], tmpdamage);
  6911. }
  6912. else
  6913. {
  6914. SendClientMessage(playerid, WHITE, "Please wait your reload time (60 seconds).");
  6915. }
  6916. }
  6917. else
  6918. {
  6919. SendClientMessage(playerid, WHITE, "You have to be in your car to do this. Use /callcar if you've lost it.");
  6920. }
  6921. }
  6922. }
  6923. }
  6924. }
  6925. return 1;
  6926. }
  6927.  
  6928. command(respawnmycar, playerid, params[])
  6929. {
  6930. 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");
  6931. return 1;
  6932. }
  6933.  
  6934. GetVehicleFileID(gameid)
  6935. {
  6936. new result;
  6937. for(new i = 0; i < MAX_VEHICLES; i++)
  6938. {
  6939. if(gameid == Vehicles[i][GameID])
  6940. {
  6941. result = i;
  6942. }
  6943. }
  6944. return result;
  6945. }
  6946.  
  6947. command(afk, playerid, params[])
  6948. {
  6949. new string[128];
  6950. if(Afk[playerid] == 0)
  6951. {
  6952. Afk[playerid] = 1;
  6953. SetPlayerColor(playerid, AFK);
  6954. format(string, sizeof(string), "[AFK] A nearby player [%s] is now AFK (/afk).", GetName(playerid));
  6955. NearByMessage(playerid, AFK, string);
  6956. TogglePlayerControllable(playerid, false);
  6957. }
  6958. else
  6959. {
  6960. SetPlayerColor(playerid, WHITE);
  6961. Afk[playerid] = 0;
  6962. format(string, sizeof(string), "[BackFromAFK] A nearby player [%s] is now back from AFK (/afk).", GetName(playerid));
  6963. NearByMessage(playerid, AFK, string);
  6964. TogglePlayerControllable(playerid, true);
  6965. }
  6966. return 1;
  6967. }
  6968.  
  6969. command(unban, playerid, params[])
  6970. {
  6971. new Name[MAX_PLAYER_NAME], string[128], string2[128];
  6972. if(sscanf(params, "z", Name))
  6973. {
  6974. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  6975. {
  6976. SendClientMessage(playerid, WHITE, "SYNTAX: /unban [name]");
  6977. }
  6978. }
  6979. else
  6980. {
  6981. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  6982. {
  6983. format(string, sizeof(string), "Accounts/%s.ini", Name);
  6984. if(fexist(string))
  6985. {
  6986. if(dini_Isset(string, "Banned"))
  6987. {
  6988. if(dini_Int(string, "Banned") == 1)
  6989. {
  6990. dini_IntSet(string, "Banned", -1);
  6991. if(dini_Isset(string, "LastIP"))
  6992. {
  6993. format(string2, sizeof(string2), "Now attempting to unban players' last known IP (%s).", dini_Get(string, "LastIP"));
  6994. SendClientMessage(playerid, GREY, string2);
  6995. format(string2, sizeof(string2), "unbanip %s", dini_Get(string, "LastIP"));
  6996. SendRconCommand(string2);
  6997. SendRconCommand("reloadbans");
  6998. SendClientMessage(playerid, GREY, "IP unbanned and bans list reloaded.");
  6999. format(string, sizeof(string), "WARNING: %s has unbanned Player %s.", GetName(playerid), Name);
  7000. SendToAdmins(ADMINORANGE, string, 0);
  7001. new hour, minute, second, day, year, month, string3[128];
  7002. gettime(hour, minute, second);
  7003. getdate(year, month, day);
  7004. format(string3, sizeof(string3), "%s | %d/%d/%d | %d:%d | %s", Name, day, month, year, hour, minute, GetName(playerid));
  7005. }
  7006. else
  7007. {
  7008. SendClientMessage(playerid, WHITE, "Account unbanned, though the IP was not valid or even in the file. You'll have to manualy unban it.");
  7009. }
  7010. SendClientMessage(playerid, WHITE, "Account unbanned.");
  7011. }
  7012. else
  7013. {
  7014. if(dini_Int(string, "Banned") == 2 || dini_Int(string, "Banned") == 4)
  7015. {
  7016. if(PlayerInfo[playerid][pAdminLevel] >= 5)
  7017. {
  7018. dini_IntSet(string, "Banned", 0);
  7019.  
  7020. if(dini_Isset(string, "LastIP"))
  7021. {
  7022. if(dini_Int(string, "AdminLevel") == -1)
  7023. {
  7024. dini_IntSet(string, "AdminLevel", 0);
  7025. dini_Set(string, "Note", "You have been removed from the admin team.");
  7026. }
  7027. else
  7028. {
  7029. new ssadas[128];
  7030. format(ssadas, sizeof(ssadas), "You have been unbanned by %s.", GetName(playerid));
  7031. dini_Set(string, "Note", ssadas);
  7032. }
  7033.  
  7034. format(string2, sizeof(string2), "Now attempting to unban players' last known IP (%s).", dini_Get(string, "LastIP"));
  7035. SendClientMessage(playerid, GREY, string2);
  7036. format(string2, sizeof(string2), "unbanip %s", dini_Get(string, "LastIP"));
  7037. SendRconCommand(string2);
  7038. SendRconCommand("reloadbans");
  7039. SendClientMessage(playerid, GREY, "IP unbanned and bans list reloaded.");
  7040. format(string, sizeof(string), "WARNING: %s has unbanned Player %s.", GetName(playerid), Name);
  7041. SendToAdmins(ADMINORANGE, string, 0);
  7042. new hour, minute, second, day, year, month, string3[128];
  7043. gettime(hour, minute, second);
  7044. getdate(year, month, day);
  7045. format(string3, sizeof(string3), "%s | %d/%d/%d | %d:%d | %s", Name, day, month, year, hour, minute, GetName(playerid));
  7046. }
  7047. else
  7048. {
  7049. SendClientMessage(playerid, WHITE, "Account unbanned, though the IP was not valid or even in the file. You'll have to manualy unban it.");
  7050. }
  7051.  
  7052. SendClientMessage(playerid, WHITE, "Account unbanned.");
  7053. }
  7054. else
  7055. {
  7056. SendClientMessage(playerid, WHITE, "That account has been permabanned.");
  7057. }
  7058. }
  7059. }
  7060. }
  7061. }
  7062. else
  7063. {
  7064. SendClientMessage(playerid, WHITE, "Account not found.");
  7065. }
  7066. return 1;
  7067. }
  7068. }
  7069. return 1;
  7070. }
  7071.  
  7072. command(n, playerid, params[])
  7073. {
  7074. new
  7075. string[128];
  7076.  
  7077. if(isnull(params))
  7078. {
  7079. SendClientMessage(playerid, WHITE, "SYNTAX: /n [message]");
  7080. }
  7081. else
  7082. {
  7083. format(string, sizeof(string), "(([NewbieChat] %s: %s ))", GetName(playerid), params);
  7084. SendClientMessageToAll(NEWBIE, string);
  7085. }
  7086. return 1;
  7087. }
  7088.  
  7089. command(o, playerid, params[])
  7090. {
  7091. new
  7092. string[128];
  7093.  
  7094. if(isnull(params))
  7095. {
  7096. SendClientMessage(playerid, WHITE, "SYNTAX: /o(oc) [message]");
  7097. }
  7098. else
  7099. {
  7100. format(string, sizeof(string), "(([GlobalOOC] %s: %s ))", GetName(playerid), params);
  7101. SendClientMessageToAll(GREY, string);
  7102. }
  7103. return 1;
  7104. }
  7105.  
  7106. command(b, playerid, params[])
  7107. {
  7108. new
  7109. string[128];
  7110.  
  7111. if(isnull(params))
  7112. {
  7113. SendClientMessage(playerid, WHITE, "SYNTAX: /o(oc) [message]");
  7114. }
  7115. else
  7116. {
  7117. format(string, sizeof(string), "(([LocalOOC] %s: %s ))", GetName(playerid), params);
  7118. NearByMessage(playerid, POLICE, string);
  7119. }
  7120. return 1;
  7121. }
  7122.  
  7123. command(ooc, playerid, params[])
  7124. {
  7125. return cmd_o(playerid, params);
  7126. }
  7127.  
  7128. command(newbie, playerid, params[])
  7129. {
  7130. return cmd_n(playerid, params);
  7131. }
  7132.  
  7133. command(savecar, playerid, params[])
  7134. {
  7135. #pragma unused params
  7136. if(PlayerInfo[playerid][pAdminLevel] >= 5)
  7137. {
  7138. if(UnconfirmedSave[playerid] == 0)
  7139. {
  7140. SendClientMessage(playerid, WHITE, "Are you sure you want to save this vehicle? Please re-type this command to confirm this action.");
  7141. UnconfirmedSave[playerid] = 1;
  7142. }
  7143. else
  7144. {
  7145. UnconfirmedSave[playerid] = 0;
  7146. if(IsPlayerInAnyVehicle(playerid))
  7147. {
  7148. new id, Vehicle[16], vehicleid = GetPlayerVehicleID(playerid);
  7149.  
  7150. id = findAvailableVehicleID();
  7151.  
  7152. format(Vehicle, sizeof(Vehicle), "V_%d", id);
  7153. if(!djIsSet(VEHICLES_FILE, Vehicle)) // Fail-safe to prevent overwriting any current values
  7154. {
  7155. GetVehiclePos(vehicleid, Vehicles[id][CarPosX], Vehicles[id][CarPosY], Vehicles[id][CarPosZ]);
  7156. GetVehicleZAngle(vehicleid, Vehicles[id][CarZAngle]);
  7157.  
  7158. Vehicles[id][CarModel] = GetVehicleModel(vehicleid);
  7159. Vehicles[id][CarGroup] = 0;
  7160.  
  7161. Vehicles[id][CarColour1] = -1;
  7162. Vehicles[id][CarColour2] = -1;
  7163.  
  7164. djAutocommit(false);
  7165. format(Vehicle, sizeof(Vehicle), "V_%d/PosX", id);
  7166. djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosX], true);
  7167. format(Vehicle, sizeof(Vehicle), "V_%d/PosY", id);
  7168. djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosY], true);
  7169. format(Vehicle, sizeof(Vehicle), "V_%d/PosZ", id);
  7170. djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarPosZ], true);
  7171. format(Vehicle, sizeof(Vehicle), "V_%d/ZAngle", id);
  7172. djSetFloat(VEHICLES_FILE, Vehicle, Vehicles[id][CarZAngle], true);
  7173. format(Vehicle, sizeof(Vehicle), "V_%d/Model", id);
  7174. djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarModel], true);
  7175. format(Vehicle, sizeof(Vehicle), "V_%d/Col1", id);
  7176. djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarColour1], true);
  7177. format(Vehicle, sizeof(Vehicle), "V_%d/Col2", id);
  7178. djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarColour2], true);
  7179. format(Vehicle, sizeof(Vehicle), "V_%d/Group", id);
  7180. djSetInt(VEHICLES_FILE, Vehicle, Vehicles[id][CarGroup], true);
  7181. djCommit(VEHICLES_FILE);
  7182. djAutocommit(true);
  7183. CarCount++;
  7184.  
  7185. printf("[system] Vehicle %d has been saved to %s.", id, VEHICLES_FILE);
  7186. SendClientMessage(playerid, WHITE, "Vehicle saved!");
  7187.  
  7188. DestroyVehicle(vehicleid);
  7189. 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);
  7190. PutPlayerInVehicle(playerid, Vehicles[id][GameID], 0);
  7191.  
  7192. SendClientMessage(playerid, WHITE, "Do NOT despawn this vehicle.");
  7193.  
  7194. for(new i = 0; i < SpawnedVehicles; i++)
  7195. {
  7196. if(AdminSpawned[i] == GetPlayerVehicleID(playerid))
  7197. {
  7198. AdminSpawned[i] = 0;
  7199. }
  7200. }
  7201. }
  7202. }
  7203. }
  7204. }
  7205. return 1;
  7206. }
  7207.  
  7208. command(setcargroup, playerid, params[])
  7209. {
  7210. new id, string[128];
  7211. if(sscanf(params, "d", id))
  7212. {
  7213. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  7214. {
  7215. SendClientMessage(playerid, WHITE, "SYNTAX: /setcargroup [group ID]");
  7216. }
  7217. }
  7218. else
  7219. {
  7220. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  7221. {
  7222. if(IsPlayerInAnyVehicle(playerid))
  7223. {
  7224. if(id >= 0 && id < MAX_GROUPS)
  7225. {
  7226. if(GetVehicleFileID(GetPlayerVehicleID(playerid)) == 0)
  7227. {
  7228. SendClientMessage(playerid, WHITE, "That doesn't seem to be a saved vehicle.");
  7229. }
  7230. else
  7231. {
  7232. if(id == 0)
  7233. {
  7234. SendClientMessage(playerid, WHITE, "You have unlocked this vehicle.");
  7235. Vehicles[GetVehicleFileID(GetPlayerVehicleID(playerid))][CarGroup] = 0;
  7236. }
  7237. else
  7238. {
  7239. Vehicles[GetVehicleFileID(GetPlayerVehicleID(playerid))][CarGroup] = id;
  7240. format(string, sizeof(string), "You have locked this vehicle to Group %d.", id);
  7241. SendClientMessage(playerid, WHITE, string);
  7242. SaveExistingVehicle(GetPlayerVehicleID(playerid));
  7243. }
  7244. }
  7245. }
  7246. else
  7247. {
  7248. format(string, sizeof(string), "Invalid Group ID (groups vary from ID 1 to ID %d).", MAX_GROUPS);
  7249. SendClientMessage(playerid, WHITE, string);
  7250. }
  7251. }
  7252. else
  7253. {
  7254. SendClientMessage(playerid, WHITE, "You're not in a valid vehicle.");
  7255. }
  7256. }
  7257. }
  7258. return 1;
  7259. }
  7260.  
  7261. command(asetgroup, playerid, params[])
  7262. {
  7263. new id, string[128], string2[128], group, grouprank;
  7264. if(sscanf(params, "udd", id, group, grouprank))
  7265. {
  7266. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  7267. {
  7268. SendClientMessage(playerid, WHITE, "SYNTAX: /asetgroup [playerid] [groupid] [grouprank]");
  7269. }
  7270. }
  7271. else
  7272. {
  7273. if(PlayerInfo[playerid][pAdminLevel] >= 1)
  7274. {
  7275. PlayerInfo[id][Group] = group;
  7276. PlayerInfo[id][GroupRank] = grouprank;
  7277. format(string, sizeof(string), "Admin %s has set your group to %d and your grouprank to %d.", GetName(playerid), group, grouprank);
  7278. SendClientMessage(id, WHITE, string);
  7279. format(string2, sizeof(string2), "You have set %s's group to %d and his grouprank to %d.", GetName(id), group, grouprank);
  7280. SendClientMessage(playerid, WHITE, string2);
  7281. }
  7282. else
  7283. {
  7284. SendClientMessage(playerid, WHITE, "You are not an Administrator!");
  7285. }
  7286. }
  7287. return 1;
  7288. }
  7289.  
  7290. command(changespawn, playerid, params[])
  7291. {
  7292. ShowPlayerDialog(playerid, 333, DIALOG_STYLE_LIST, "Choose a Spawn", "Newbie Spawn\nGroup Spawn", "Select", "Cancel");
  7293. return 1;
  7294. }
  7295.  
  7296. command(creategroup, playerid, params[])
  7297. {
  7298. new Usage[128], string[128];
  7299. if(sscanf(params, "z", Usage))
  7300. {
  7301. if(PlayerInfo[playerid][pAdminLevel] >= 5)
  7302. {
  7303. SendClientMessage(playerid, WHITE, "SYNTAX: /creategroup [usage]");
  7304. SendClientMessage(playerid, GREY, "Usage: Interior, Exterior or Complete.");
  7305. }
  7306. }
  7307. else
  7308. {
  7309. if(PlayerInfo[playerid][pAdminLevel] >= 5)
  7310. {
  7311. if(strcmp(Usage, "exterior", true) == 0)
  7312. {
  7313. PlayerInfo[playerid][GroupExterior]++;
  7314. PlayerInfo[playerid][gExtID] = GetPlayerInterior(playerid);
  7315. GetPlayerPos(playerid, PlayerInfo[playerid][gExtX], PlayerInfo[playerid][gExtY], PlayerInfo[playerid][gExtZ]);
  7316. format(string, sizeof(string), "Exterior set! (X: %f, Y: %f, Z: %f).", PlayerInfo[playerid][gExtX], PlayerInfo[playerid][gExtY], PlayerInfo[playerid][gExtZ]);
  7317. SendClientMessage(playerid, WHITE, string);
  7318. }
  7319. if(strcmp(Usage, "interior", true) == 0)
  7320. {
  7321. PlayerInfo[playerid][GroupInterior]++;
  7322. PlayerInfo[playerid][gExtID] = GetPlayerInterior(playerid);
  7323. GetPlayerPos(playerid, PlayerInfo[playerid][gIntX], PlayerInfo[playerid][gIntY], PlayerInfo[playerid][gIntZ]);
  7324. format(string, sizeof(string), "Interior set! (X: %f, Y: %f, Z: %f).", PlayerInfo[playerid][gIntX], PlayerInfo[playerid][gIntY], PlayerInfo[playerid][gIntZ]);
  7325. SendClientMessage(playerid, WHITE, string);
  7326. }
  7327. if(strcmp(Usage, "complete", true) == 0)
  7328. {
  7329. if(PlayerInfo[playerid][GroupInterior] > 0 || PlayerInfo[playerid][GroupExterior] > 0)
  7330. {
  7331. new NewGroupID = SpawnedGroups+1;
  7332.  
  7333. if(NewGroupID >= MAX_GROUPS)
  7334. {
  7335. SendClientMessage(playerid, WHITE, "Too many groups are currently spawned!");
  7336. }
  7337. else
  7338. {
  7339. format(string, sizeof(string), "Groups/Group_%d.ini", NewGroupID);
  7340.  
  7341. if(!fexist(string))
  7342. {
  7343. Groups[NewGroupID][gIntID] = PlayerInfo[playerid][gIntID];
  7344. Groups[NewGroupID][gExtID] = PlayerInfo[playerid][gExtID];
  7345. Groups[NewGroupID][gIntX] = PlayerInfo[playerid][gIntX];
  7346. Groups[NewGroupID][gIntY] = PlayerInfo[playerid][gIntY];
  7347. Groups[NewGroupID][gIntZ] = PlayerInfo[playerid][gIntZ];
  7348. Groups[NewGroupID][gExtX] = PlayerInfo[playerid][gExtX];
  7349. Groups[NewGroupID][gExtY] = PlayerInfo[playerid][gExtY];
  7350. Groups[NewGroupID][gExtZ] = PlayerInfo[playerid][gExtZ];
  7351. format(Groups[NewGroupID][gName], 255, "Un-Named");
  7352. Groups[NewGroupID][gPickupID] = CreateDynamicPickup(1273, 23, Groups[NewGroupID][gExtX], Groups[NewGroupID][gExtY], Groups[NewGroupID][gExtZ], 0, -1, -1, 150.0);
  7353.  
  7354. dini_Create(string);
  7355. dini_IntSet(string, "IntID", Groups[NewGroupID][gIntID]);
  7356. dini_FloatSet(string, "IntX", Groups[NewGroupID][gIntX]);
  7357. dini_FloatSet(string, "IntY", Groups[NewGroupID][gIntY]);
  7358. dini_FloatSet(string, "IntZ", Groups[NewGroupID][gIntZ]);
  7359.  
  7360. dini_IntSet(string, "ExtID", 0);
  7361. dini_FloatSet(string, "ExtX", Groups[NewGroupID][gExtX]);
  7362. dini_FloatSet(string, "ExtY", Groups[NewGroupID][gExtY]);
  7363. dini_FloatSet(string, "ExtZ", Groups[NewGroupID][gExtZ]);
  7364.  
  7365. PlayerInfo[playerid][GroupExterior]--;
  7366. PlayerInfo[playerid][GroupInterior]--;
  7367.  
  7368. SpawnedGroups++;
  7369. SendClientMessage(playerid, ME, "Successfully created group HQ!");
  7370. SetPlayerInterior(playerid, Groups[NewGroupID][gExtID]);
  7371. SetPlayerPos(playerid, Groups[NewGroupID][gExtX], Groups[NewGroupID][gExtY], Groups[NewGroupID][gExtZ]);
  7372. }
  7373. else
  7374. {
  7375. SendClientMessage(playerid, WHITE, "Error: File already exists!");
  7376. }
  7377. }
  7378. }
  7379. else
  7380. {
  7381. SendClientMessage(playerid, WHITE, "You must select an exterior and an interior first!");
  7382. }
  7383. }
  7384. }
  7385. }
  7386. return 1;
  7387. }
  7388.  
  7389. command(ghqinterior, playerid, params[])
  7390. {
  7391. new GroupID, string[128];
  7392. if(sscanf(params, "d", GroupID))
  7393. {
  7394. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  7395. {
  7396. SendClientMessage(playerid, WHITE, "SYNTAX: /ghqinteror [group ID]");
  7397. }
  7398. }
  7399. else
  7400. {
  7401. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  7402. {
  7403. format(string, sizeof(string), "Groups/Group_%d.ini", GroupID);
  7404. if(fexist(string))
  7405. {
  7406. Groups[GroupID][gIntID] = GetPlayerInterior(playerid);
  7407. GetPlayerPos(playerid, Groups[GroupID][gIntX], Groups[GroupID][gIntY], Groups[GroupID][gIntZ]);
  7408. format(string, sizeof(string), "You have successfully moved Group %s's interior.", GroupID);
  7409. SendClientMessage(playerid, WHITE, string);
  7410. SaveGroup(GroupID);
  7411. }
  7412. }
  7413. }
  7414. return 1;
  7415. }
  7416.  
  7417. stock SaveGroup(i)
  7418. {
  7419. new FileName[21];
  7420. format(FileName, sizeof(FileName), "Groups/Group_%d.ini", i);
  7421. if(fexist(FileName))
  7422. {
  7423. dini_Set(FileName, "gName", Groups[i][gName]);
  7424. dini_IntSet(FileName, "gIntID", Groups[i][gIntID]);
  7425. dini_FloatSet(FileName, "gIntX", Groups[i][gIntX]);
  7426. dini_FloatSet(FileName, "gIntY", Groups[i][gIntY]);
  7427. dini_FloatSet(FileName, "gIntZ", Groups[i][gIntZ]);
  7428. dini_IntSet(FileName, "gExtID", Groups[i][gExtID]);
  7429. dini_FloatSet(FileName, "gExtX", Groups[i][gExtX]);
  7430. dini_FloatSet(FileName, "gExtY", Groups[i][gExtY]);
  7431. dini_FloatSet(FileName, "gExtZ", Groups[i][gExtZ]);
  7432.  
  7433. printf("[system] Group %d saved.", i);
  7434. }
  7435. else
  7436. {
  7437. printf("Could not execute SaveGroup(%d).", i);
  7438. }
  7439. }
  7440.  
  7441. command(ghqexterior, playerid, params[])
  7442. {
  7443. new GroupID, string[128];
  7444. if(sscanf(params, "d", GroupID))
  7445. {
  7446. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  7447. {
  7448. SendClientMessage(playerid, WHITE, "SYNTAX: /ghqexteror [group ID]");
  7449. }
  7450. }
  7451. else
  7452. {
  7453. if(PlayerInfo[playerid][pAdminLevel] >= 4)
  7454. {
  7455. format(string, sizeof(string), "Groups/Group_%d.ini", GroupID);
  7456. if(fexist(string))
  7457. {
  7458. DestroyDynamicPickup(Groups[GroupID][gPickupID]);
  7459. Groups[GroupID][gExtID] = GetPlayerInterior(playerid);
  7460. GetPlayerPos(playerid, Groups[GroupID][gExtX], Groups[GroupID][gExtY], Groups[GroupID][gExtZ]);
  7461. format(string, sizeof(string), "You have successfully moved Group %s's exterior.", GroupID);
  7462. SendClientMessage(playerid, WHITE, string);
  7463. Groups[GroupID][gPickupID] = CreateDynamicPickup(1239, 23, Groups[GroupID][gExtX], Groups[GroupID][gExtY], Groups[GroupID][gExtZ], 0, -1, -1, 150.0);
  7464. SaveGroup(GroupID);
  7465. }
  7466. }
  7467. }
  7468. return 1;
  7469. }
  7470.  
  7471. command(hire, playerid, params[])
  7472. {
  7473. new id, string[128];
  7474. if(sscanf(params, "u", playerid))
  7475. {
  7476. if(PlayerInfo[playerid][Group] >= 1)
  7477. {
  7478. SendClientMessage(playerid, WHITE, "SYNTAX: /hire [playerid]");
  7479. }
  7480. }
  7481. else
  7482. {
  7483. if(PlayerInfo[playerid][Group] >= 1)
  7484. {
  7485. PlayerInfo[id][PendingGroupInvite] = playerid;
  7486. PlayerInfo[id][PendingGroup] = PlayerInfo[playerid][Group];
  7487. format(string, sizeof(string), "You have requested to HIRE %d into the Group.", GetName(id));
  7488. SendClientMessage(playerid, WHITE, string);
  7489. format(string, sizeof(string), "%s is requesting to HIRE you into his/her faction... Type /approve groupinvite to join the group!", GetName(playerid));
  7490. SendClientMessage(id, NICESKY, string);
  7491. }
  7492. }
  7493. return 1;
  7494. }
  7495.  
  7496. command(duty, playerid, params[])
  7497. {
  7498. if(InHQ[playerid] == 1)
  7499. {
  7500. if(PlayerInfo[playerid][Group] == 2)
  7501. {
  7502. if(OnDuty[playerid] == 0)
  7503. {
  7504. if(PlayerInfo[playerid][GroupRank] == 1)
  7505. {
  7506. SetPlayerSkin(playerid, 277);
  7507. OnDuty[playerid] = 1;
  7508. }
  7509. if(PlayerInfo[playerid][GroupRank] == 2)
  7510. {
  7511. SetPlayerSkin(playerid, 274);
  7512. OnDuty[playerid] = 1;
  7513. }
  7514. if(PlayerInfo[playerid][GroupRank] == 3)
  7515. {
  7516. SetPlayerSkin(playerid, 278);
  7517. OnDuty[playerid] = 1;
  7518. }
  7519. if(PlayerInfo[playerid][GroupRank] == 4)
  7520. {
  7521. SetPlayerSkin(playerid, 275);
  7522. OnDuty[playerid] = 1;
  7523. }
  7524. if(PlayerInfo[playerid][GroupRank] == 5)
  7525. {
  7526. SetPlayerSkin(playerid, 276);
  7527. OnDuty[playerid] = 1;
  7528. }
  7529. if(PlayerInfo[playerid][GroupRank] == 6)
  7530. {
  7531. SetPlayerSkin(playerid, 279);
  7532. OnDuty[playerid] = 1;
  7533. }
  7534. }
  7535. else
  7536. {
  7537. OnDuty[playerid] = 0;
  7538. SetPlayerSkin(playerid, PlayerInfo[playerid][Skin]);
  7539. SetPlayerColor(playerid, WHITE);
  7540. }
  7541. }
  7542. }
  7543. return 1;
  7544. }
Add Comment
Please, Sign In to add comment