Advertisement
Guest User

Untitled

a guest
Dec 18th, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 88.02 KB | None | 0 0
  1. #include <a_samp>
  2. #include <dini>
  3.  
  4. enum car_info
  5. {
  6. Model,
  7. Price,
  8. Float:CarX,
  9. Float:CarY,
  10. Float:CarZ,
  11. Float:CarRot,
  12. Locked,
  13. mod1,
  14. mod2,
  15. mod3,
  16. mod4,
  17. mod5,
  18. mod6,
  19. mod7,
  20. mod8,
  21. mod9,
  22. mod10,
  23. mod11,
  24. mod12,
  25. mod13,
  26. mod14,
  27. mod15,
  28. mod16,
  29. mod17,
  30. paintjob,
  31. colora,
  32. colorb
  33. };
  34. new VehicleInfo[MAX_PLAYERS][car_info];
  35. new DealerCars[8];
  36. new DealerCars[9];
  37. new DealerCars[10];
  38. new DealerCars[11];
  39. new DealerCars[12];
  40. new DealerCars[13];
  41. new DealerCars[14];
  42. new DealerCars[15];
  43. new DealerCars[16];
  44. new DealerCars[17];
  45. new DealerCars[18];
  46. new DealerCars[19];
  47. new DealerCars[20];
  48. new DealerCars[21];
  49. new DealerCars[22];
  50. new DealerCars[23];
  51. new string9[128];
  52. new string10[128];
  53. new string11[128];
  54. new string12[128];
  55. new string13[128];
  56. new string14[128];
  57. new string15[128];
  58. new string16[128];
  59. new string17[128];
  60. new string18[128];
  61. new string19[128];
  62. new string20[128];
  63. new string21[128];
  64. new string22[128];
  65. new string23[128];
  66. new string24[128];
  67. new Text3D:DealerCar[24];
  68. new Vehicle[MAX_PLAYERS];
  69. new OwnerID[MAX_VEHICLES];
  70. new CarPrice[MAX_VEHICLES];
  71. new VehOwned[MAX_VEHICLES];
  72. new ConfirmSale[MAX_PLAYERS];
  73. new gVehLocked[MAX_VEHICLES];
  74. new VehPlate[MAX_VEHICLES][256];
  75. new gPlayerHasCar[MAX_PLAYERS];
  76. new IsADealerCar[MAX_VEHICLES];
  77. new Checkpoint[MAX_PLAYERS];
  78. new bool:Destroyed[MAX_VEHICLES];
  79.  
  80. enum trunk_info
  81. {
  82. Slot1,
  83. Slot2,
  84. Slot3,
  85. Slot4,
  86. Slot5,
  87. Slot6,
  88. Slot7,
  89. Slot8,
  90. Slot9,
  91. Slot10,
  92. Ammo1,
  93. Ammo2,
  94. Ammo3,
  95. Ammo4,
  96. Ammo5,
  97. Ammo6,
  98. Ammo7,
  99. Ammo8,
  100. Ammo9,
  101. Ammo10
  102. };
  103. new TrunkInfo[MAX_VEHICLES][trunk_info];
  104. new TrunkOpen[MAX_VEHICLES];
  105.  
  106. forward RemovePlayerWeapon(playerid, weaponid);
  107. forward ini_GetKey(line[]);
  108. forward ini_GetValue(line[]);
  109. forward SaveTrunk(playerid);
  110. forward LoadTrunk(playerid);
  111.  
  112. stock ini_GetKey(line[])
  113. {
  114. new keyRes[256];
  115. keyRes[0] = 0;
  116. if(strfind(line, "=", true) == -1) return keyRes;
  117. strmid(keyRes, line, 0, strfind(line, "=", true), sizeof(keyRes));
  118. return keyRes;
  119. }
  120.  
  121. stock ini_GetValue(line[])
  122. {
  123. new valRes[256];
  124. valRes[0] = 0;
  125. if(strfind(line, "=", true) == -1) return valRes;
  126. strmid(valRes, line, strfind(line, "=", true) + 1, strlen(line), sizeof(valRes));
  127. return valRes;
  128. }
  129.  
  130. new spoiler[20][0] = {
  131. {1000},
  132. {1001},
  133. {1002},
  134. {1003},
  135. {1014},
  136. {1015},
  137. {1016},
  138. {1023},
  139. {1058},
  140. {1060},
  141. {1049},
  142. {1050},
  143. {1138},
  144. {1139},
  145. {1146},
  146. {1147},
  147. {1158},
  148. {1162},
  149. {1163},
  150. {1164}
  151. };
  152.  
  153. new nitro[3][0] = {
  154. {1008},
  155. {1009},
  156. {1010}
  157. };
  158.  
  159. new fbumper[23][0] = {
  160. {1117},
  161. {1152},
  162. {1153},
  163. {1155},
  164. {1157},
  165. {1160},
  166. {1165},
  167. {1167},
  168. {1169},
  169. {1170},
  170. {1171},
  171. {1172},
  172. {1173},
  173. {1174},
  174. {1175},
  175. {1179},
  176. {1181},
  177. {1182},
  178. {1185},
  179. {1188},
  180. {1189},
  181. {1192},
  182. {1193}
  183. };
  184.  
  185. new rbumper[22][0] = {
  186. {1140},
  187. {1141},
  188. {1148},
  189. {1149},
  190. {1150},
  191. {1151},
  192. {1154},
  193. {1156},
  194. {1159},
  195. {1161},
  196. {1166},
  197. {1168},
  198. {1176},
  199. {1177},
  200. {1178},
  201. {1180},
  202. {1183},
  203. {1184},
  204. {1186},
  205. {1187},
  206. {1190},
  207. {1191}
  208. };
  209.  
  210. new exhaust[28][0] = {
  211. {1018},
  212. {1019},
  213. {1020},
  214. {1021},
  215. {1022},
  216. {1028},
  217. {1029},
  218. {1037},
  219. {1043},
  220. {1044},
  221. {1045},
  222. {1046},
  223. {1059},
  224. {1064},
  225. {1065},
  226. {1066},
  227. {1089},
  228. {1092},
  229. {1104},
  230. {1105},
  231. {1113},
  232. {1114},
  233. {1126},
  234. {1127},
  235. {1129},
  236. {1132},
  237. {1135},
  238. {1136}
  239. };
  240.  
  241. new bventr[2][0] = {
  242. {1042},
  243. {1044}
  244. };
  245.  
  246. new bventl[2][0] = {
  247. {1043},
  248. {1045}
  249. };
  250.  
  251. new bscoop[4][0] = {
  252. {1004},
  253. {1005},
  254. {1011},
  255. {1012}
  256. };
  257.  
  258. new rscoop[13][0] = {
  259. {1006},
  260. {1032},
  261. {1033},
  262. {1035},
  263. {1038},
  264. {1053},
  265. {1054},
  266. {1055},
  267. {1061},
  268. {1067},
  269. {1068},
  270. {1088},
  271. {1091}
  272. };
  273.  
  274. new lskirt[21][0] = {
  275. {1007},
  276. {1026},
  277. {1031},
  278. {1036},
  279. {1039},
  280. {1042},
  281. {1047},
  282. {1048},
  283. {1056},
  284. {1057},
  285. {1069},
  286. {1070},
  287. {1090},
  288. {1093},
  289. {1106},
  290. {1108},
  291. {1118},
  292. {1119},
  293. {1133},
  294. {1122},
  295. {1134}
  296. };
  297.  
  298. new rskirt[21][0] = {
  299. {1017},
  300. {1027},
  301. {1030},
  302. {1040},
  303. {1041},
  304. {1051},
  305. {1052},
  306. {1062},
  307. {1063},
  308. {1071},
  309. {1072},
  310. {1094},
  311. {1095},
  312. {1099},
  313. {1101},
  314. {1102},
  315. {1107},
  316. {1120},
  317. {1121},
  318. {1124},
  319. {1137}
  320. };
  321.  
  322. new hydraulics[1][0] = {
  323. {1087}
  324. };
  325.  
  326. new base[1][0] = {
  327. {1086}
  328. };
  329.  
  330. new rbbars[2][0] = {
  331. {1109},
  332. {1110}
  333. };
  334.  
  335. new fbbars[2][0] = {
  336. {1115},
  337. {1116}
  338. };
  339.  
  340. new wheels[17][0] = {
  341. {1025},
  342. {1073},
  343. {1074},
  344. {1075},
  345. {1076},
  346. {1077},
  347. {1078},
  348. {1079},
  349. {1080},
  350. {1081},
  351. {1082},
  352. {1083},
  353. {1084},
  354. {1085},
  355. {1096},
  356. {1097},
  357. {1098}
  358. };
  359.  
  360. new light[2][0] = {
  361. {1013},
  362. {1024}
  363. };
  364.  
  365. InitComponents(componentid)
  366. {
  367. new i;
  368. for(i=0; i<20; i++)
  369. {
  370. if(spoiler[i][0]==componentid) { return 1; }
  371. }
  372. for(i=0; i<3; i++)
  373. {
  374. if(nitro[i][0]==componentid) { return 2; }
  375. }
  376. for(i=0; i<23; i++)
  377. {
  378. if(fbumper[i][0]==componentid) { return 3; }
  379. }
  380. for(i=0; i<22; i++)
  381. {
  382. if(rbumper[i][0]==componentid) { return 4; }
  383. }
  384. for(i=0; i<28; i++)
  385. {
  386. if(exhaust[i][0]==componentid) { return 5; }
  387. }
  388. for(i=0; i<2; i++)
  389. {
  390. if(bventr[i][0]==componentid) { return 6; }
  391. }
  392. for(i=0; i<2; i++)
  393. {
  394. if(bventl[i][0]==componentid) { return 7; }
  395. }
  396. for(i=0; i<4; i++)
  397. {
  398. if(bscoop[i][0]==componentid) { return 8; }
  399. }
  400. for(i=0; i<13; i++)
  401. {
  402. if(rscoop[i][0]==componentid) { return 9; }
  403. }
  404. for(i=0; i<21; i++)
  405. {
  406. if(lskirt[i][0]==componentid) { return 10; }
  407. }
  408. for(i=0; i<21; i++)
  409. {
  410. if(rskirt[i][0]==componentid) { return 11; }
  411. }
  412. if(hydraulics[0][0]==componentid) { return 12; }
  413. if(base[0][0]==componentid) { return 13; }
  414. for(i=0; i<2; i++)
  415. {
  416. if(rbbars[i][0]==componentid) { return 14; }
  417. }
  418. for(i=0; i<2; i++)
  419. {
  420. if(fbbars[i][0]==componentid) { return 15; }
  421. }
  422. for(i=0; i<17; i++)
  423. {
  424. if(wheels[i][0]==componentid) { return 16; }
  425. }
  426. for(i=0; i<2; i++)
  427. {
  428. if(light[i][0]==componentid) { return 17; }
  429. }
  430. return 0;
  431. }
  432.  
  433. stock GetVehicleNameFromID(vehicleid)
  434. {
  435. static const scVehicleNames[][18] = {
  436. "Landstalker",
  437. "Bravura",
  438. "Buffalo",
  439. "Linerunner",
  440. "Perrenial",
  441. "Sentinel",
  442. "Dumper",
  443. "Firetruck",
  444. "Trashmaster",
  445. "Stretch",
  446. "Manana",
  447. "Infernus",
  448. "Voodoo",
  449. "Pony",
  450. "Mule",
  451. "Cheetah",
  452. "Ambulance",
  453. "Leviathan",
  454. "Moonbeam",
  455. "Esperanto",
  456. "Taxi",
  457. "Washington",
  458. "Bobcat",
  459. "Mr Whoopee",
  460. "BF Injection",
  461. "Hunter",
  462. "Premier",
  463. "Enforcer",
  464. "Securicar",
  465. "Banshee",
  466. "Predator",
  467. "Bus",
  468. "Rhino",
  469. "Barracks",
  470. "Hotknife",
  471. "Trailer 1",
  472. "Previon",
  473. "Coach",
  474. "Cabbie",
  475. "Stallion",
  476. "Rumpo",
  477. "RC Bandit",
  478. "Romero",
  479. "Packer",
  480. "Monster",
  481. "Admiral",
  482. "Squalo",
  483. "Seasparrow",
  484. "Pizzaboy",
  485. "Tram",
  486. "Trailer 2",
  487. "Turismo",
  488. "Speeder",
  489. "Reefer",
  490. "Tropic",
  491. "Flatbed",
  492. "Yankee",
  493. "Caddy",
  494. "Solair",
  495. "Berkley's RC Van",
  496. "Skimmer",
  497. "PCJ-600",
  498. "Faggio",
  499. "Freeway",
  500. "RC Baron",
  501. "RC Raider",
  502. "Glendale",
  503. "Oceanic",
  504. "Sanchez",
  505. "Sparrow",
  506. "Patriot",
  507. "Quad",
  508. "Coastguard",
  509. "Dinghy",
  510. "Hermes",
  511. "Sabre",
  512. "Rustler",
  513. "ZR-350",
  514. "Walton",
  515. "Regina",
  516. "Comet",
  517. "BMX",
  518. "Burrito",
  519. "Camper",
  520. "Marquis",
  521. "Baggage",
  522. "Dozer",
  523. "Maverick",
  524. "News Chopper",
  525. "Rancher",
  526. "FBI Rancher",
  527. "Virgo",
  528. "Greenwood",
  529. "Jetmax",
  530. "Hotring",
  531. "Sandking",
  532. "Blista Compact",
  533. "Police Maverick",
  534. "Boxville",
  535. "Benson",
  536. "Mesa",
  537. "RC Goblin",
  538. "Hotring Racer A",
  539. "Hotring Racer B",
  540. "Bloodring Banger",
  541. "Rancher",
  542. "Super GT",
  543. "Elegant",
  544. "Journey",
  545. "Bike",
  546. "Mountain Bike",
  547. "Beagle",
  548. "Cropdust",
  549. "Stunt",
  550. "Tanker",
  551. "Roadtrain",
  552. "Nebula",
  553. "Majestic",
  554. "Buccaneer",
  555. "Shamal",
  556. "Hydra",
  557. "FCR-900",
  558. "NRG-500",
  559. "HPV1000",
  560. "Cement Truck",
  561. "Tow Truck",
  562. "Fortune",
  563. "Cadrona",
  564. "FBI Truck",
  565. "Willard",
  566. "Forklift",
  567. "Tractor",
  568. "Combine",
  569. "Feltzer",
  570. "Remington",
  571. "Slamvan",
  572. "Blade",
  573. "Freight",
  574. "Streak",
  575. "Vortex",
  576. "Vincent",
  577. "Bullet",
  578. "Clover",
  579. "Sadler",
  580. "Firetruck LA",
  581. "Hustler",
  582. "Intruder",
  583. "Primo",
  584. "Cargobob",
  585. "Tampa",
  586. "Sunrise",
  587. "Merit",
  588. "Utility",
  589. "Nevada",
  590. "Yosemite",
  591. "Windsor",
  592. "Monster A",
  593. "Monster B",
  594. "Uranus",
  595. "Jester",
  596. "Sultan",
  597. "Stratum",
  598. "Elegy",
  599. "Raindance",
  600. "RC Tiger",
  601. "Flash",
  602. "Tahoma",
  603. "Savanna",
  604. "Bandito",
  605. "Freight Flat",
  606. "Streak Carriage",
  607. "Kart",
  608. "Mower",
  609. "Duneride",
  610. "Sweeper",
  611. "Broadway",
  612. "Tornado",
  613. "AT-400",
  614. "DFT-30",
  615. "Huntley",
  616. "Stafford",
  617. "BF-400",
  618. "Newsvan",
  619. "Tug",
  620. "Trailer 3",
  621. "Emperor",
  622. "Wayfarer",
  623. "Euros",
  624. "Hotdog",
  625. "Club",
  626. "Freight Carriage",
  627. "Trailer 3",
  628. "Andromada",
  629. "Dodo",
  630. "RC Cam",
  631. "Launch",
  632. "LS Police Car",
  633. "SF Police Car",
  634. "LV Police Car",
  635. "Police Ranger",
  636. "Picador",
  637. "S.W.A.T. Van",
  638. "Alpha",
  639. "Phoenix",
  640. "Glendale",
  641. "Sadler",
  642. "Luggage Trailer A",
  643. "Luggage Trailer B",
  644. "Stair Trailer",
  645. "Boxville",
  646. "Farm Plow",
  647. "Utility Trailer"
  648. },
  649. scOnFoot[18] = "OnFoot";
  650. if (vehicleid > 0) {
  651. return scVehicleNames[GetVehicleModel(vehicleid) - 400];
  652. }
  653. else {
  654. return scOnFoot;
  655. }
  656. }
  657.  
  658. public OnFilterScriptInit()
  659. {
  660. new string[32], string2[32], string3[32], string4[32], string5[32], string6[32], string7[32], string8[32][32];
  661. DealerCars[0] = AddStaticVehicle(546,2135.7805,-1147.6683,24.2358,45.7344,1,1); // Intruder
  662. DealerCars[1] = AddStaticVehicle(547,2136.1267,-1142.5652,24.8062,48.5747,1,1); // Primo
  663. DealerCars[2] = AddStaticVehicle(550,2136.2810,-1137.8374,25.3877,49.0252,1,1); // Sunrise
  664. DealerCars[3] = AddStaticVehicle(551,2136.1887,-1132.9510,25.4904,50.6219,1,1); // Merit
  665. DealerCars[4] = AddStaticVehicle(522,2120.1875,-1122.7693,25.4782,236.7405,1,1); // NGR-500
  666. DealerCars[5] = AddStaticVehicle(561,2119.2405,-1127.4752,25.1522,235.1129,1,1); // Stratum
  667. DealerCars[6] = AddStaticVehicle(585,2119.3145,-1132.3177,24.8819,236.2470,1,1); // Emperor
  668. DealerCars[7] = AddStaticVehicle(451,2119.3181,-1136.4448,25.1078,231.7601,1,1); // Turismo
  669. DealerCars[8] = AddStaticVehicle(426,2161.8125,-1143.7963,24.6421,90.00000,1,1); // Premier
  670. DealerCars[9] = AddStaticVehicle(411,2162.0781,-1148.3701,24.1421,90.00000,1,1); // Infernus
  671. DealerCars[10] = AddStaticVehicle(477,2161.5012,-1152.9690,23.7137,90.00000,1,1); // ZR-350
  672. DealerCars[11] = AddStaticVehicle(415,2161.4060,-1157.9238,23.5126,90.00000,1,1); // Cheetah
  673. DealerCars[12] = AddStaticVehicle(402,2161.2078,-1163.0229,23.4964,90.00000,1,1); // Buffalo
  674. DealerCars[13] = AddStaticVehicle(400,2161.1135,-1167.8234,23.8164,90.00000,1,1); // Landstalker
  675. DealerCars[14] = AddStaticVehicle(496,2149.5315,-1134.0291,25.2337,268.00000,1,1); // Blista Compact
  676. DealerCars[15] = AddStaticVehicle(535,2149.1865,-1138.5100,25.2790,268.00000,1,1); // Slamvan
  677. DealerCars[16] = AddStaticVehicle(536,2149.3142,-1143.3750,24.7660,268.00000,1,1); // Blade
  678. DealerCars[17] = AddStaticVehicle(541,2148.6208,-1148.1307,24.1837,268.00000,1,1); // Bullet
  679. DealerCars[18] = AddStaticVehicle(559,2148.2832,-1152.8910,23.6138,268.00000,1,1); // Jester
  680. DealerCars[19] = AddStaticVehicle(579,2148.4387,-1157.2039,23.7428,268.00000,1,1); // Huntley
  681. DealerCars[20] = AddStaticVehicle(587,2148.6228,-1161.3578,23.5502,268.00000,1,1); // Euros
  682. DealerCars[21] = AddStaticVehicle(602,2148.3579,-1165.7821,23.5685,268.00000,1,1); // Alpha
  683. DealerCars[22] = AddStaticVehicle(603,2148.1128,-1170.6030,23.5485,268.00000,1,1); // Phoenix
  684. DealerCars[23] = AddStaticVehicle(513,2149.7500,-1182.3085,24.4670,0.00000,1,1); // Stuntplane
  685. DealerCars[24] = AddStaticVehicle(432,2160.6655,-1182.1256,23.8199,0.00000,1,1); // Rhino
  686. DealerCars[25] = AddStaticVehicle(487,2154.7053,-1198.7800,24.0067,0.00000,1,1); // Maverick
  687. IsADealerCar[DealerCars[0]] = true;
  688. IsADealerCar[DealerCars[1]] = true;
  689. IsADealerCar[DealerCars[2]] = true;
  690. IsADealerCar[DealerCars[3]] = true;
  691. IsADealerCar[DealerCars[4]] = true;
  692. IsADealerCar[DealerCars[5]] = true;
  693. IsADealerCar[DealerCars[6]] = true;
  694. IsADealerCar[DealerCars[7]] = true;
  695. IsADealerCar[DealerCars[8]] = true;
  696. IsADealerCar[DealerCars[9]] = true;
  697. IsADealerCar[DealerCars[10]] = true;
  698. IsADealerCar[DealerCars[11]] = true;
  699. IsADealerCar[DealerCars[12]] = true;
  700. IsADealerCar[DealerCars[13]] = true;
  701. IsADealerCar[DealerCars[14]] = true;
  702. IsADealerCar[DealerCars[15]] = true;
  703. IsADealerCar[DealerCars[16]] = true;
  704. IsADealerCar[DealerCars[17]] = true;
  705. IsADealerCar[DealerCars[18]] = true;
  706. IsADealerCar[DealerCars[19]] = true;
  707. IsADealerCar[DealerCars[20]] = true;
  708. IsADealerCar[DealerCars[21]] = true;
  709. IsADealerCar[DealerCars[22]] = true;
  710. IsADealerCar[DealerCars[23]] = true;
  711. IsADealerCar[DealerCars[24]] = true;
  712. IsADealerCar[DealerCars[25]] = true;
  713. CarPrice[DealerCars[0]] = 15000;
  714. CarPrice[DealerCars[1]] = 20000;
  715. CarPrice[DealerCars[2]] = 22500;
  716. CarPrice[DealerCars[3]] = 23500;
  717. CarPrice[DealerCars[4]] = 50000;
  718. CarPrice[DealerCars[5]] = 9000;
  719. CarPrice[DealerCars[6]] = 11500;
  720. CarPrice[DealerCars[7]] = 95000;
  721. CarPrice[DealerCars[8]] = 20000;
  722. CarPrice[DealerCars[9]] = 63000;
  723. CarPrice[DealerCars[10]] = 41000;
  724. CarPrice[DealerCars[11]] = 41000;
  725. CarPrice[DealerCars[12]] = 41000;
  726. CarPrice[DealerCars[13]] = 41000;
  727. CarPrice[DealerCars[14]] = 41000;
  728. CarPrice[DealerCars[15]] = 41000;
  729. CarPrice[DealerCars[16]] = 41000;
  730. CarPrice[DealerCars[17]] = 41000;
  731. CarPrice[DealerCars[18]] = 41000;
  732. CarPrice[DealerCars[19]] = 41000;
  733. CarPrice[DealerCars[20]] = 41000;
  734. CarPrice[DealerCars[21]] = 41000;
  735. CarPrice[DealerCars[22]] = 41000;
  736. CarPrice[DealerCars[23]] = 41000;
  737. CarPrice[DealerCars[24]] = 41000;
  738. CarPrice[DealerCars[25]] = 41000;
  739. format(string, sizeof(string), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[0]), CarPrice[DealerCars[0]]);
  740. format(string2, sizeof(string2), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[1]), CarPrice[DealerCars[1]]);
  741. format(string3, sizeof(string3), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[2]), CarPrice[DealerCars[2]]);
  742. format(string4, sizeof(string4), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[3]), CarPrice[DealerCars[3]]);
  743. format(string5, sizeof(string5), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[4]), CarPrice[DealerCars[4]]);
  744. format(string6, sizeof(string6), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[5]), CarPrice[DealerCars[5]]);
  745. format(string7, sizeof(string7), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[6]), CarPrice[DealerCars[6]]);
  746. format(string8, sizeof(string8), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[7]), CarPrice[DealerCars[7]]);
  747. format(string9, sizeof(string9), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[8]), CarPrice[DealerCars[8]]);
  748. format(string10, sizeof(string10), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[9]), CarPrice[DealerCars[9]]);
  749. format(string11, sizeof(string11), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[10]), CarPrice[DealerCars[10]]);
  750. format(string12, sizeof(string12), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[11]), CarPrice[DealerCars[11]]);
  751. format(string13, sizeof(string13), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[12]), CarPrice[DealerCars[12]]);
  752. format(string14, sizeof(string14), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[13]), CarPrice[DealerCars[13]]);
  753. format(string15, sizeof(string15), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[14]), CarPrice[DealerCars[14]]);
  754. format(string16, sizeof(string16), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[15]), CarPrice[DealerCars[15]]);
  755. format(string17, sizeof(string17), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[16]), CarPrice[DealerCars[16]]);
  756. format(string18, sizeof(string18), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[17]), CarPrice[DealerCars[17]]);
  757. format(string19, sizeof(string19), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[18]), CarPrice[DealerCars[18]]);
  758. format(string20, sizeof(string20), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[19]), CarPrice[DealerCars[19]]);
  759. format(string21, sizeof(string21), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[20]), CarPrice[DealerCars[20]]);
  760. format(string22, sizeof(string22), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[21]), CarPrice[DealerCars[21]]);
  761. format(string23, sizeof(string23), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[22]), CarPrice[DealerCars[22]]);
  762. format(string24, sizeof(string24), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[23]), CarPrice[DealerCars[23]]);
  763. format(string25, sizeof(string25), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[24]), CarPrice[DealerCars[24]]);
  764. format(string26, sizeof(string26), "Nome: %s\nPreço: $%i", GetVehicleNameFromID(DealerCars[25]), CarPrice[DealerCars[25]]);
  765. DealerCar[0] = Create3DTextLabel(string, 0x33CCFFAA, 2135.7805,-1147.6683,24.2358, 20.0, 0);
  766. DealerCar[1] = Create3DTextLabel(string2, 0x33CCFFAA, 2136.1267,-1142.5652,24.8062, 20.0, 0);
  767. DealerCar[2] = Create3DTextLabel(string3, 0x33CCFFAA, 2136.2810,-1137.8374,25.3877, 20.0, 0);
  768. DealerCar[3] = Create3DTextLabel(string4, 0x33CCFFAA, 2136.1887,-1132.9510,25.4904, 20.0, 0);
  769. DealerCar[4] = Create3DTextLabel(string5, 0x33CCFFAA, 2120.1875,-1122.7693,25.4782, 20.0, 0);
  770. DealerCar[5] = Create3DTextLabel(string6, 0x33CCFFAA, 2119.2405,-1127.4752,25.1522, 20.0, 0);
  771. DealerCar[6] = Create3DTextLabel(string7, 0x33CCFFAA, 2119.3145,-1132.3177,24.8819, 20.0, 0);
  772. DealerCar[7] = Create3DTextLabel(string8, 0x33CCFFAA, 2119.3181,-1136.4448,25.1078, 20.0, 0);
  773. DealerCar[8] = Create3DTextLabel(string9, 0x33CCFFAA, 2161.8125,-1143.7963,24.8221, 20.0, 0);
  774. DealerCar[9] = Create3DTextLabel(string10, 0x33CCFFAA, 2162.0781,-1148.3701,23.9821, 20.0, 0);
  775. DealerCar[10] = Create3DTextLabel(string11, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  776. DealerCar[11] = Create3DTextLabel(string12, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  777. DealerCar[12] = Create3DTextLabel(string13, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  778. DealerCar[13] = Create3DTextLabel(string14, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  779. DealerCar[14] = Create3DTextLabel(string15, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  780. DealerCar[15] = Create3DTextLabel(string16, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  781. DealerCar[16] = Create3DTextLabel(string17, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  782. DealerCar[17] = Create3DTextLabel(string18, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  783. DealerCar[18] = Create3DTextLabel(string19, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  784. DealerCar[19] = Create3DTextLabel(string20, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  785. DealerCar[20] = Create3DTextLabel(string21, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  786. DealerCar[21] = Create3DTextLabel(string22, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  787. DealerCar[22] = Create3DTextLabel(string23, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  788. DealerCar[23] = Create3DTextLabel(string24, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  789. DealerCar[24] = Create3DTextLabel(string25, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  790. DealerCar[25] = Create3DTextLabel(string26, 0x33CCFFAA, 2161.5012,-1152.9690,23.7137, 20.0, 0);
  791. return 1;
  792. }
  793.  
  794. public OnFilterScriptExit()
  795. {
  796. IsADealerCar[DealerCars[0]] = false;
  797. IsADealerCar[DealerCars[1]] = false;
  798. IsADealerCar[DealerCars[2]] = false;
  799. IsADealerCar[DealerCars[3]] = false;
  800. IsADealerCar[DealerCars[4]] = false;
  801. IsADealerCar[DealerCars[5]] = false;
  802. IsADealerCar[DealerCars[6]] = false;
  803. IsADealerCar[DealerCars[7]] = false;
  804. IsADealerCar[DealerCars[8]] = false;
  805. IsADealerCar[DealerCars[9]] = false;
  806. IsADealerCar[DealerCars[10]] = false;
  807. IsADealerCar[DealerCars[11]] = false;
  808. IsADealerCar[DealerCars[12]] = false;
  809. IsADealerCar[DealerCars[13]] = false;
  810. IsADealerCar[DealerCars[14]] = false;
  811. IsADealerCar[DealerCars[15]] = false;
  812. IsADealerCar[DealerCars[16]] = false;
  813. IsADealerCar[DealerCars[17]] = false;
  814. IsADealerCar[DealerCars[18]] = false;
  815. IsADealerCar[DealerCars[19]] = false;
  816. IsADealerCar[DealerCars[20]] = false;
  817. IsADealerCar[DealerCars[21]] = false;
  818. IsADealerCar[DealerCars[22]] = false;
  819. IsADealerCar[DealerCars[23]] = false;
  820. IsADealerCar[DealerCars[24]] = false;
  821. IsADealerCar[DealerCars[25]] = false;
  822. CarPrice[DealerCars[0]] = 0;
  823. CarPrice[DealerCars[1]] = 0;
  824. CarPrice[DealerCars[2]] = 0;
  825. CarPrice[DealerCars[3]] = 0;
  826. CarPrice[DealerCars[4]] = 0;
  827. CarPrice[DealerCars[5]] = 0;
  828. CarPrice[DealerCars[6]] = 0;
  829. CarPrice[DealerCars[7]] = 0;
  830. CarPrice[DealerCars[8]] = 0;
  831. CarPrice[DealerCars[9]] = 0;
  832. CarPrice[DealerCars[10]] = 0;
  833. CarPrice[DealerCars[11]] = 0;
  834. CarPrice[DealerCars[12]] = 0;
  835. CarPrice[DealerCars[13]] = 0;
  836. CarPrice[DealerCars[14]] = 0;
  837. CarPrice[DealerCars[15]] = 0;
  838. CarPrice[DealerCars[16]] = 0;
  839. CarPrice[DealerCars[17]] = 0;
  840. CarPrice[DealerCars[18]] = 0;
  841. CarPrice[DealerCars[19]] = 0;
  842. CarPrice[DealerCars[20]] = 0;
  843. CarPrice[DealerCars[21]] = 0;
  844. CarPrice[DealerCars[22]] = 0;
  845. CarPrice[DealerCars[23]] = 0;
  846. CarPrice[DealerCars[24]] = 0;
  847. CarPrice[DealerCars[25]] = 0;
  848. DestroyVehicle(DealerCars[0]);
  849. DestroyVehicle(DealerCars[1]);
  850. DestroyVehicle(DealerCars[2]);
  851. DestroyVehicle(DealerCars[3]);
  852. DestroyVehicle(DealerCars[4]);
  853. DestroyVehicle(DealerCars[5]);
  854. DestroyVehicle(DealerCars[6]);
  855. DestroyVehicle(DealerCars[7]);
  856. DestroyVehicle(DealerCars[8]);
  857. DestroyVehicle(DealerCars[9]);
  858. DestroyVehicle(DealerCars[10]);
  859. DestroyVehicle(DealerCars[11]);
  860. DestroyVehicle(DealerCars[12]);
  861. DestroyVehicle(DealerCars[13]);
  862. DestroyVehicle(DealerCars[14]);
  863. DestroyVehicle(DealerCars[15]);
  864. DestroyVehicle(DealerCars[16]);
  865. DestroyVehicle(DealerCars[17]);
  866. DestroyVehicle(DealerCars[18]);
  867. DestroyVehicle(DealerCars[19]);
  868. DestroyVehicle(DealerCars[20]);
  869. DestroyVehicle(DealerCars[21]);
  870. DestroyVehicle(DealerCars[22]);
  871. DestroyVehicle(DealerCars[23]);
  872. DestroyVehicle(DealerCars[24]);
  873. DestroyVehicle(DealerCars[25]);
  874. Delete3DTextLabel(DealerCar[0]);
  875. Delete3DTextLabel(DealerCar[1]);
  876. Delete3DTextLabel(DealerCar[2]);
  877. Delete3DTextLabel(DealerCar[3]);
  878. Delete3DTextLabel(DealerCar[4]);
  879. Delete3DTextLabel(DealerCar[5]);
  880. Delete3DTextLabel(DealerCar[6]);
  881. Delete3DTextLabel(DealerCar[7]);
  882. Delete3DTextLabel(DealerCar[8]);
  883. Delete3DTextLabel(DealerCar[9]);
  884. Delete3DTextLabel(DealerCar[10]);
  885. Delete3DTextLabel(DealerCar[11]);
  886. Delete3DTextLabel(DealerCar[12]);
  887. Delete3DTextLabel(DealerCar[13]);
  888. Delete3DTextLabel(DealerCar[14]);
  889. Delete3DTextLabel(DealerCar[15]);
  890. Delete3DTextLabel(DealerCar[16]);
  891. Delete3DTextLabel(DealerCar[17]);
  892. Delete3DTextLabel(DealerCar[18]);
  893. Delete3DTextLabel(DealerCar[19]);
  894. Delete3DTextLabel(DealerCar[20]);
  895. Delete3DTextLabel(DealerCar[21]);
  896. Delete3DTextLabel(DealerCar[22]);
  897. Delete3DTextLabel(DealerCar[23]);
  898. Delete3DTextLabel(DealerCar[24]);
  899. Delete3DTextLabel(DealerCar[25]);
  900. return 1;
  901. }
  902.  
  903. public OnPlayerConnect(playerid)
  904. {
  905. new file[256], name[MAX_PLAYER_NAME];
  906. GetPlayerName(playerid, name, sizeof(name));
  907. format(file,sizeof(file),"Carros/%s.sav",name);
  908. if(dini_Exists(file))
  909. {
  910. VehicleInfo[playerid][Model] = dini_Int(file, "Model");
  911. VehicleInfo[playerid][Price] = dini_Int(file, "Price");
  912. VehicleInfo[playerid][CarX] = dini_Float(file, "X");
  913. VehicleInfo[playerid][CarY] = dini_Float(file, "Y");
  914. VehicleInfo[playerid][CarZ] = dini_Float(file, "Z");
  915. VehicleInfo[playerid][CarRot] = dini_Float(file, "Rot");
  916. VehicleInfo[playerid][Locked] = dini_Int(file, "Locked");
  917. VehicleInfo[playerid][mod1] = dini_Int(file, "mod1");
  918. VehicleInfo[playerid][mod2] = dini_Int(file, "mod2");
  919. VehicleInfo[playerid][mod3] = dini_Int(file, "mod3");
  920. VehicleInfo[playerid][mod4] = dini_Int(file, "mod4");
  921. VehicleInfo[playerid][mod5] = dini_Int(file, "mod5");
  922. VehicleInfo[playerid][mod6] = dini_Int(file, "mod6");
  923. VehicleInfo[playerid][mod7] = dini_Int(file, "mod7");
  924. VehicleInfo[playerid][mod8] = dini_Int(file, "mod8");
  925. VehicleInfo[playerid][mod9] = dini_Int(file, "mod9");
  926. VehicleInfo[playerid][mod10] = dini_Int(file, "mod10");
  927. VehicleInfo[playerid][mod11] = dini_Int(file, "mod11");
  928. VehicleInfo[playerid][mod12] = dini_Int(file, "mod12");
  929. VehicleInfo[playerid][mod13] = dini_Int(file, "mod13");
  930. VehicleInfo[playerid][mod14] = dini_Int(file, "mod14");
  931. VehicleInfo[playerid][mod15] = dini_Int(file, "mod15");
  932. VehicleInfo[playerid][mod16] = dini_Int(file, "mod16");
  933. VehicleInfo[playerid][mod17] = dini_Int(file, "mod17");
  934. VehicleInfo[playerid][paintjob] = dini_Int(file, "paintjob");
  935. VehicleInfo[playerid][colora] = dini_Int(file, "color1");
  936. VehicleInfo[playerid][colorb] = dini_Int(file, "color2");
  937. Vehicle[playerid] = CreateVehicle(VehicleInfo[playerid][Model], VehicleInfo[playerid][CarX], VehicleInfo[playerid][CarY], VehicleInfo[playerid][CarZ], VehicleInfo[playerid][CarRot], -1, -1, 3600000);
  938. if(VehicleInfo[playerid][mod1]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod1]); }
  939. if(VehicleInfo[playerid][mod2]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod2]); }
  940. if(VehicleInfo[playerid][mod3]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod3]); }
  941. if(VehicleInfo[playerid][mod4]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod4]); }
  942. if(VehicleInfo[playerid][mod5]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod5]); }
  943. if(VehicleInfo[playerid][mod6]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod6]); }
  944. if(VehicleInfo[playerid][mod7]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod7]); }
  945. if(VehicleInfo[playerid][mod8]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod8]); }
  946. if(VehicleInfo[playerid][mod9]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod9]); }
  947. if(VehicleInfo[playerid][mod10]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod10]); }
  948. if(VehicleInfo[playerid][mod11]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod11]); }
  949. if(VehicleInfo[playerid][mod12]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod12]); }
  950. if(VehicleInfo[playerid][mod13]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod13]); }
  951. if(VehicleInfo[playerid][mod14]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod14]); }
  952. if(VehicleInfo[playerid][mod15]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod15]); }
  953. if(VehicleInfo[playerid][mod16]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod16]); }
  954. if(VehicleInfo[playerid][mod17]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod17]); }
  955. if(VehicleInfo[playerid][colora]!=0 || VehicleInfo[playerid][colorb]!=0)
  956. {
  957. ChangeVehicleColor(Vehicle[playerid],VehicleInfo[playerid][colora],VehicleInfo[playerid][colorb]);
  958. }
  959. if(VehicleInfo[playerid][paintjob]!=0)
  960. {
  961. ChangeVehiclePaintjob(Vehicle[playerid],VehicleInfo[playerid][paintjob]);
  962. }
  963. new tmp[256]; tmp = dini_Get(file, "Plate");
  964. gPlayerHasCar[playerid] = 1;
  965. VehOwned[Vehicle[playerid]] = 1;
  966. OwnerID[Vehicle[playerid]] = playerid;
  967. SetVehicleParamsForPlayer(Vehicle[playerid], playerid, 0, VehicleInfo[playerid][Locked]);
  968. gVehLocked[Vehicle[playerid]] = VehicleInfo[playerid][Locked];
  969. SetVehicleNumberPlate(Vehicle[playerid], tmp);
  970. VehPlate[Vehicle[playerid]] = tmp;
  971. LoadTrunk(playerid);
  972. }
  973. return 1;
  974. }
  975.  
  976.  
  977. public OnPlayerDisconnect(playerid)
  978. {
  979. new file[256], name[24];
  980. GetPlayerName(playerid, name, 24);
  981. format(file,sizeof(file),"Carros/%s.sav",name);
  982. if(dini_Exists(file))
  983. {
  984. dini_IntSet(file, "Model", GetVehicleModel(Vehicle[playerid]));
  985. dini_IntSet(file, "Price", VehicleInfo[playerid][Price]);
  986. dini_FloatSet(file, "X", VehicleInfo[playerid][CarX]);
  987. dini_FloatSet(file, "Y", VehicleInfo[playerid][CarY]);
  988. dini_FloatSet(file, "Z", VehicleInfo[playerid][CarZ]);
  989. dini_FloatSet(file, "Rot", VehicleInfo[playerid][CarRot]);
  990. dini_IntSet(file, "Locked", VehicleInfo[playerid][Locked]);
  991. dini_Set(file, "Plate", VehPlate[Vehicle[playerid]]);
  992. dini_IntSet(file, "mod1", VehicleInfo[playerid][mod1]);
  993. dini_IntSet(file, "mod2", VehicleInfo[playerid][mod2]);
  994. dini_IntSet(file, "mod3", VehicleInfo[playerid][mod3]);
  995. dini_IntSet(file, "mod4", VehicleInfo[playerid][mod4]);
  996. dini_IntSet(file, "mod5", VehicleInfo[playerid][mod5]);
  997. dini_IntSet(file, "mod6", VehicleInfo[playerid][mod6]);
  998. dini_IntSet(file, "mod7", VehicleInfo[playerid][mod7]);
  999. dini_IntSet(file, "mod8", VehicleInfo[playerid][mod8]);
  1000. dini_IntSet(file, "mod9", VehicleInfo[playerid][mod9]);
  1001. dini_IntSet(file, "mod10", VehicleInfo[playerid][mod10]);
  1002. dini_IntSet(file, "mod11", VehicleInfo[playerid][mod11]);
  1003. dini_IntSet(file, "mod12", VehicleInfo[playerid][mod12]);
  1004. dini_IntSet(file, "mod13", VehicleInfo[playerid][mod13]);
  1005. dini_IntSet(file, "mod14", VehicleInfo[playerid][mod14]);
  1006. dini_IntSet(file, "mod15", VehicleInfo[playerid][mod15]);
  1007. dini_IntSet(file, "mod16", VehicleInfo[playerid][mod16]);
  1008. dini_IntSet(file, "mod17", VehicleInfo[playerid][mod17]);
  1009. dini_IntSet(file, "paintjob", VehicleInfo[playerid][paintjob]);
  1010. dini_IntSet(file, "color1", VehicleInfo[playerid][colora]);
  1011. dini_IntSet(file, "color2", VehicleInfo[playerid][colorb]);
  1012. DestroyVehicle(Vehicle[playerid]);
  1013. SaveTrunk(playerid);
  1014. }
  1015. return 1;
  1016. }
  1017.  
  1018. public OnPlayerStateChange(playerid, newstate, oldstate)
  1019. {
  1020. if(newstate == PLAYER_STATE_DRIVER)
  1021. {
  1022. new veh = GetPlayerVehicleID(playerid);
  1023. if(VehOwned[veh] == 0)
  1024. {
  1025. if(IsADealerCar[veh] == 1)
  1026. {
  1027. new string[128];
  1028. format(string, sizeof(string), "Tem certeza que você gostaria de comprar este %s por $%i?", GetVehicleNameFromID(veh), CarPrice[veh]);
  1029. ShowPlayerDialog(playerid, 669, DIALOG_STYLE_MSGBOX, "Concessionária", string, "Sim", "Não");
  1030. return 1;
  1031. }
  1032. }
  1033. else if(VehOwned[veh] == 1)
  1034. {
  1035. new owner[24], string[128];
  1036. GetPlayerName(OwnerID[veh], owner, sizeof(owner));
  1037. format(string, sizeof(string), "Este %s é propriedade de %s.", GetVehicleNameFromID(veh), owner);
  1038. SendClientMessage(playerid, 0xFFFFFFAA, string);
  1039. return 1;
  1040. }
  1041. }
  1042. return 1;
  1043. }
  1044.  
  1045. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1046. {
  1047. if(dialogid == 669)
  1048. {
  1049. if(response)
  1050. {
  1051. new file[256], name[MAX_PLAYER_NAME];
  1052. GetPlayerName(playerid, name, sizeof(name));
  1053. format(file,sizeof(file),"Carros/%s.sav",name);
  1054. new veh = GetPlayerVehicleID(playerid);
  1055. new money = GetPlayerMoney(playerid);
  1056. if(money >= CarPrice[veh])
  1057. {
  1058. RemovePlayerFromVehicle(playerid);
  1059. if(gPlayerHasCar[playerid] == 1) return SendClientMessage(playerid, 0xFFFFFFFF, "Você já possui um carro.");
  1060. new string[64];
  1061. SendClientMessage(playerid, 0xAFAFAFAA, "Obrigado por comprar na Coutt e Schutz.");
  1062. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  1063. dini_Create(file);
  1064. Vehicle[playerid] = CreateVehicle(GetVehicleModel(veh), 2130.1914, -1109.5881, 25.1890, 76.2599, 1, 1, 3600000);
  1065. format(string, sizeof(string), "Criando o seu veículo %i.", veh);
  1066. SendClientMessage(playerid, 0xAFAFAFAA, string);
  1067. VehicleInfo[playerid][Model] = GetVehicleModel(veh);
  1068. VehicleInfo[playerid][Price] = CarPrice[veh];
  1069. VehicleInfo[playerid][CarX] = 2130.1914;
  1070. VehicleInfo[playerid][CarY] = -1109.5881;
  1071. VehicleInfo[playerid][CarZ] = 25.1890;
  1072. VehicleInfo[playerid][CarRot] = 76.2599;
  1073. gPlayerHasCar[playerid] = 1;
  1074. RemovePlayerFromVehicle(playerid);
  1075. OwnerID[Vehicle[playerid]] = playerid;
  1076. VehPlate[Vehicle[playerid]] = "XYZR 000";
  1077. PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
  1078. GivePlayerMoney(playerid, -VehicleInfo[playerid][Price]);
  1079. }
  1080. else
  1081. {
  1082. RemovePlayerFromVehicle(playerid);
  1083. SendClientMessage(playerid, 0xAFAFAFAA, "Você não tem dinheiro para comprar esse veículo.");
  1084. return 1;
  1085. }
  1086. }
  1087. else
  1088. {
  1089. RemovePlayerFromVehicle(playerid);
  1090. }
  1091. }
  1092. if(dialogid == 670)
  1093. {
  1094. if(response)
  1095. {
  1096. new file[256], name[24], license[10];
  1097. GetPlayerName(playerid, name, 24);
  1098. format(file,sizeof(file),"Carros/%s.sav",name);
  1099. dini_IntSet(file, "Model", VehicleInfo[playerid][Model]);
  1100. dini_IntSet(file, "Price", VehicleInfo[playerid][Price]);
  1101. dini_FloatSet(file, "X", VehicleInfo[playerid][CarX]);
  1102. dini_FloatSet(file, "Y", VehicleInfo[playerid][CarY]);
  1103. dini_FloatSet(file, "Z", VehicleInfo[playerid][CarZ]);
  1104. dini_FloatSet(file, "Rot", VehicleInfo[playerid][CarRot]);
  1105. dini_IntSet(file, "Locked", VehicleInfo[playerid][Locked]);
  1106. dini_IntSet(file, "mod1", VehicleInfo[playerid][mod1]);
  1107. dini_IntSet(file, "mod2", VehicleInfo[playerid][mod2]);
  1108. dini_IntSet(file, "mod3", VehicleInfo[playerid][mod3]);
  1109. dini_IntSet(file, "mod4", VehicleInfo[playerid][mod4]);
  1110. dini_IntSet(file, "mod5", VehicleInfo[playerid][mod5]);
  1111. dini_IntSet(file, "mod6", VehicleInfo[playerid][mod6]);
  1112. dini_IntSet(file, "mod7", VehicleInfo[playerid][mod7]);
  1113. dini_IntSet(file, "mod8", VehicleInfo[playerid][mod8]);
  1114. dini_IntSet(file, "mod9", VehicleInfo[playerid][mod9]);
  1115. dini_IntSet(file, "mod10", VehicleInfo[playerid][mod10]);
  1116. dini_IntSet(file, "mod11", VehicleInfo[playerid][mod11]);
  1117. dini_IntSet(file, "mod12", VehicleInfo[playerid][mod12]);
  1118. dini_IntSet(file, "mod13", VehicleInfo[playerid][mod13]);
  1119. dini_IntSet(file, "mod14", VehicleInfo[playerid][mod14]);
  1120. dini_IntSet(file, "mod15", VehicleInfo[playerid][mod15]);
  1121. dini_IntSet(file, "mod16", VehicleInfo[playerid][mod16]);
  1122. dini_IntSet(file, "mod17", VehicleInfo[playerid][mod17]);
  1123. dini_IntSet(file, "paintjob", VehicleInfo[playerid][paintjob]);
  1124. dini_IntSet(file, "color1", VehicleInfo[playerid][colora]);
  1125. dini_IntSet(file, "color2", VehicleInfo[playerid][colorb]);
  1126. new string[128], Float:CarHP, Float:OldCarHP, Float:X, Float:Y, Float:Z, Float:Rot;
  1127. new plate = strlen(inputtext);
  1128. if(plate < 4) return ShowPlayerDialog(playerid, 670, DIALOG_STYLE_INPUT, "Plate", "Placa deve ter pelo menos 4 caracteres.\n\nPor favor, tente novamente.", "OK", "Cancelar");
  1129. if(plate > 8) return ShowPlayerDialog(playerid, 670, DIALOG_STYLE_INPUT, "Plate", "Placa deve ter menos de 8 caracteres.\n\nPor favor, tente novamente.", "OK", "Cancelar");
  1130. GetVehicleHealth(Vehicle[playerid], CarHP);
  1131. OldCarHP = CarHP;
  1132. GetVehiclePos(Vehicle[playerid], X, Y, Z);
  1133. GetVehicleZAngle(Vehicle[playerid], Rot);
  1134. SetVehicleNumberPlate(Vehicle[playerid], inputtext);
  1135. SetVehicleToRespawn(Vehicle[playerid]);
  1136. SetVehiclePos(Vehicle[playerid], X, Y, Z);
  1137. SetVehicleZAngle(Vehicle[playerid], Rot);
  1138. PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
  1139. format(license, sizeof(license), "%s", inputtext);
  1140. VehPlate[Vehicle[playerid]] = license;
  1141. dini_Set(file, "Plate", VehPlate[Vehicle[playerid]]);
  1142. format(string, sizeof(string), "{FFFF00}Você definiu placa do seu veículo para:{FFFFFF} %s", inputtext);
  1143. SendClientMessage(playerid, 0xFFFFFFFF, string);
  1144. SendClientMessage(playerid, 0xFFFFFFFF, "NOTA:A saúde do seu veículo foi restaurada para o valor anterior (para impedir a exploração).");
  1145. SetVehicleHealth(Vehicle[playerid], OldCarHP);
  1146. VehicleInfo[playerid][Model] = dini_Int(file, "Model");
  1147. VehicleInfo[playerid][Price] = dini_Int(file, "Price");
  1148. VehicleInfo[playerid][CarX] = dini_Float(file, "X");
  1149. VehicleInfo[playerid][CarY] = dini_Float(file, "Y");
  1150. VehicleInfo[playerid][CarZ] = dini_Float(file, "Z");
  1151. VehicleInfo[playerid][CarRot] = dini_Float(file, "Rot");
  1152. VehicleInfo[playerid][Locked] = dini_Int(file, "Locked");
  1153. VehicleInfo[playerid][mod1] = dini_Int(file, "mod1");
  1154. VehicleInfo[playerid][mod2] = dini_Int(file, "mod2");
  1155. VehicleInfo[playerid][mod3] = dini_Int(file, "mod3");
  1156. VehicleInfo[playerid][mod4] = dini_Int(file, "mod4");
  1157. VehicleInfo[playerid][mod5] = dini_Int(file, "mod5");
  1158. VehicleInfo[playerid][mod6] = dini_Int(file, "mod6");
  1159. VehicleInfo[playerid][mod7] = dini_Int(file, "mod7");
  1160. VehicleInfo[playerid][mod8] = dini_Int(file, "mod8");
  1161. VehicleInfo[playerid][mod9] = dini_Int(file, "mod9");
  1162. VehicleInfo[playerid][mod10] = dini_Int(file, "mod10");
  1163. VehicleInfo[playerid][mod11] = dini_Int(file, "mod11");
  1164. VehicleInfo[playerid][mod12] = dini_Int(file, "mod12");
  1165. VehicleInfo[playerid][mod13] = dini_Int(file, "mod13");
  1166. VehicleInfo[playerid][mod14] = dini_Int(file, "mod14");
  1167. VehicleInfo[playerid][mod15] = dini_Int(file, "mod15");
  1168. VehicleInfo[playerid][mod16] = dini_Int(file, "mod16");
  1169. VehicleInfo[playerid][mod17] = dini_Int(file, "mod17");
  1170. VehicleInfo[playerid][paintjob] = dini_Int(file, "paintjob");
  1171. VehicleInfo[playerid][colora] = dini_Int(file, "color1");
  1172. VehicleInfo[playerid][colorb] = dini_Int(file, "color2");
  1173. if(VehicleInfo[playerid][mod1]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod1]); }
  1174. if(VehicleInfo[playerid][mod2]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod2]); }
  1175. if(VehicleInfo[playerid][mod3]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod3]); }
  1176. if(VehicleInfo[playerid][mod4]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod4]); }
  1177. if(VehicleInfo[playerid][mod5]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod5]); }
  1178. if(VehicleInfo[playerid][mod6]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod6]); }
  1179. if(VehicleInfo[playerid][mod7]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod7]); }
  1180. if(VehicleInfo[playerid][mod8]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod8]); }
  1181. if(VehicleInfo[playerid][mod9]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod9]); }
  1182. if(VehicleInfo[playerid][mod10]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod10]); }
  1183. if(VehicleInfo[playerid][mod11]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod11]); }
  1184. if(VehicleInfo[playerid][mod12]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod12]); }
  1185. if(VehicleInfo[playerid][mod13]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod13]); }
  1186. if(VehicleInfo[playerid][mod14]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod14]); }
  1187. if(VehicleInfo[playerid][mod15]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod15]); }
  1188. if(VehicleInfo[playerid][mod16]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod16]); }
  1189. if(VehicleInfo[playerid][mod17]!=0) { AddVehicleComponent(Vehicle[playerid],VehicleInfo[playerid][mod17]); }
  1190. if(VehicleInfo[playerid][colora]!=0 || VehicleInfo[playerid][colorb]!=0)
  1191. {
  1192. ChangeVehicleColor(Vehicle[playerid],VehicleInfo[playerid][colora],VehicleInfo[playerid][colorb]);
  1193. }
  1194. if(VehicleInfo[playerid][paintjob]!=0)
  1195. {
  1196. ChangeVehiclePaintjob(Vehicle[playerid],VehicleInfo[playerid][paintjob]);
  1197. }
  1198. SetVehicleParamsForPlayer(Vehicle[playerid], playerid, 0, VehicleInfo[playerid][Locked]);
  1199. gVehLocked[Vehicle[playerid]] = VehicleInfo[playerid][Locked];
  1200. CarHP = 0;
  1201. OldCarHP = 0;
  1202. return 1;
  1203. }
  1204. return 1;
  1205. }
  1206. return 1;
  1207. }
  1208.  
  1209. public OnVehicleMod(playerid,vehicleid,componentid)
  1210. {
  1211. new mods = InitComponents(componentid);
  1212. if(IsPlayerInVehicle(playerid, Vehicle[playerid]))
  1213. {
  1214. switch(mods)
  1215. {
  1216. case 1: { VehicleInfo[playerid][mod1] = componentid; }
  1217. case 2: { VehicleInfo[playerid][mod2] = componentid; }
  1218. case 3: { VehicleInfo[playerid][mod3] = componentid; }
  1219. case 4: { VehicleInfo[playerid][mod4] = componentid; }
  1220. case 5: { VehicleInfo[playerid][mod5] = componentid; }
  1221. case 6: { VehicleInfo[playerid][mod6] = componentid; }
  1222. case 7: { VehicleInfo[playerid][mod7] = componentid; }
  1223. case 8: { VehicleInfo[playerid][mod8] = componentid; }
  1224. case 9: { VehicleInfo[playerid][mod9] = componentid; }
  1225. case 10: { VehicleInfo[playerid][mod10] = componentid; }
  1226. case 11: { VehicleInfo[playerid][mod11] = componentid; }
  1227. case 12: { VehicleInfo[playerid][mod12] = componentid; }
  1228. case 13: { VehicleInfo[playerid][mod13] = componentid; }
  1229. case 14: { VehicleInfo[playerid][mod14] = componentid; }
  1230. case 15: { VehicleInfo[playerid][mod15] = componentid; }
  1231. case 16: { VehicleInfo[playerid][mod16] = componentid; }
  1232. case 17: { VehicleInfo[playerid][mod17] = componentid; }
  1233. }
  1234. }
  1235. return 1;
  1236. }
  1237.  
  1238. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  1239. {
  1240. if(IsPlayerInVehicle(playerid, Vehicle[playerid]))
  1241. {
  1242. if(GetVehicleModel(Vehicle[playerid]) == 483)
  1243. {
  1244. switch(paintjobid)
  1245. {
  1246. case 0: VehicleInfo[playerid][paintjob] = 0;
  1247. }
  1248. }
  1249. if(GetVehicleModel(Vehicle[playerid]) == 534)
  1250. {
  1251. switch(paintjobid)
  1252. {
  1253. case 0: VehicleInfo[playerid][paintjob] = 0;
  1254. case 1: VehicleInfo[playerid][paintjob] = 1;
  1255. case 2: VehicleInfo[playerid][paintjob] = 2;
  1256. }
  1257. }
  1258. if(GetVehicleModel(Vehicle[playerid]) == 535)
  1259. {
  1260. switch(paintjobid)
  1261. {
  1262. case 0: VehicleInfo[playerid][paintjob] = 0;
  1263. case 1: VehicleInfo[playerid][paintjob] = 1;
  1264. case 2: VehicleInfo[playerid][paintjob] = 2;
  1265. }
  1266. }
  1267. if(GetVehicleModel(Vehicle[playerid]) == 536)
  1268. {
  1269. switch(paintjobid)
  1270. {
  1271. case 0: VehicleInfo[playerid][paintjob] = 0;
  1272. case 1: VehicleInfo[playerid][paintjob] = 1;
  1273. case 2: VehicleInfo[playerid][paintjob] = 2;
  1274. }
  1275. }
  1276. if(GetVehicleModel(Vehicle[playerid]) == 558)
  1277. {
  1278. switch(paintjobid)
  1279. {
  1280. case 0: VehicleInfo[playerid][paintjob] = 0;
  1281. case 1: VehicleInfo[playerid][paintjob] = 1;
  1282. case 2: VehicleInfo[playerid][paintjob] = 2;
  1283. }
  1284. }
  1285. if(GetVehicleModel(Vehicle[playerid]) == 559)
  1286. {
  1287. switch(paintjobid)
  1288. {
  1289. case 0: VehicleInfo[playerid][paintjob] = 0;
  1290. case 1: VehicleInfo[playerid][paintjob] = 1;
  1291. case 2: VehicleInfo[playerid][paintjob] = 2;
  1292. }
  1293. }
  1294. if(GetVehicleModel(Vehicle[playerid]) == 560)
  1295. {
  1296. switch(paintjobid)
  1297. {
  1298. case 0: VehicleInfo[playerid][paintjob] = 0;
  1299. case 1: VehicleInfo[playerid][paintjob] = 1;
  1300. case 2: VehicleInfo[playerid][paintjob] = 2;
  1301. }
  1302. }
  1303. if(GetVehicleModel(Vehicle[playerid]) == 561)
  1304. {
  1305. switch(paintjobid)
  1306. {
  1307. case 0: VehicleInfo[playerid][paintjob] = 0;
  1308. case 1: VehicleInfo[playerid][paintjob] = 1;
  1309. case 2: VehicleInfo[playerid][paintjob] = 2;
  1310. }
  1311. }
  1312. if(GetVehicleModel(Vehicle[playerid]) == 562)
  1313. {
  1314. switch(paintjobid)
  1315. {
  1316. case 0: VehicleInfo[playerid][paintjob] = 0;
  1317. case 1: VehicleInfo[playerid][paintjob] = 1;
  1318. case 2: VehicleInfo[playerid][paintjob] = 2;
  1319. }
  1320. }
  1321. if(GetVehicleModel(Vehicle[playerid]) == 565)
  1322. {
  1323. switch(paintjobid)
  1324. {
  1325. case 0: VehicleInfo[playerid][paintjob] = 0;
  1326. case 1: VehicleInfo[playerid][paintjob] = 1;
  1327. case 2: VehicleInfo[playerid][paintjob] = 2;
  1328. }
  1329. }
  1330. if(GetVehicleModel(Vehicle[playerid]) == 567)
  1331. {
  1332. switch(paintjobid)
  1333. {
  1334. case 0: VehicleInfo[playerid][paintjob] = 0;
  1335. case 1: VehicleInfo[playerid][paintjob] = 1;
  1336. case 2: VehicleInfo[playerid][paintjob] = 2;
  1337. }
  1338. }
  1339. if(GetVehicleModel(Vehicle[playerid]) == 575)
  1340. {
  1341. switch(paintjobid)
  1342. {
  1343. case 0: VehicleInfo[playerid][paintjob] = 0;
  1344. case 1: VehicleInfo[playerid][paintjob] = 1;
  1345. }
  1346. }
  1347. if(GetVehicleModel(Vehicle[playerid]) == 576)
  1348. {
  1349. switch(paintjobid)
  1350. {
  1351. case 0: VehicleInfo[playerid][paintjob] = 0;
  1352. case 1: VehicleInfo[playerid][paintjob] = 1;
  1353. case 2: VehicleInfo[playerid][paintjob] = 2;
  1354. }
  1355. }
  1356. }
  1357. return 1;
  1358. }
  1359.  
  1360. public OnVehicleRespray(playerid,vehicleid, color1, color2)
  1361. {
  1362. if(IsPlayerInVehicle(playerid, Vehicle[playerid]))
  1363. {
  1364. VehicleInfo[playerid][colora] = color1;
  1365. VehicleInfo[playerid][colorb] = color2;
  1366. }
  1367. return 1;
  1368. }
  1369.  
  1370. strtok(const string[], &index)
  1371. {
  1372. new length = strlen(string);
  1373. while ((index < length) && (string[index] <= ' '))
  1374. {
  1375. index++;
  1376. }
  1377.  
  1378. new offset = index;
  1379. new result[20];
  1380. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  1381. {
  1382. result[index - offset] = string[index];
  1383. index++;
  1384. }
  1385. result[index - offset] = EOS;
  1386. return result;
  1387. }
  1388.  
  1389. public OnPlayerCommandText(playerid, cmdtext[])
  1390. {
  1391. new idx, tmp[128], cmd[128];
  1392. cmd = strtok(cmdtext, idx);
  1393. if(strcmp(cmd, "/portamalas", true) == 0)
  1394. {
  1395. if(gPlayerHasCar[playerid] == 0) return SendClientMessage(playerid, 0xAFAFAFAA, " Você não possui um carro !");
  1396. new x_nr[256];
  1397. x_nr = strtok(cmdtext, idx);
  1398. if(!strlen(x_nr))
  1399. {
  1400. SendClientMessage(playerid, 0xFFFFFFFF, "USE: /portamalas [item]");
  1401. SendClientMessage(playerid, 0xFFFFFFFF, "Itens disponíveis: abrir, fechar, colocararma, pegararma");
  1402. return 1;
  1403. }
  1404. if(strcmp(x_nr, "abrir", true) == 0)
  1405. {
  1406. if(TrunkOpen[Vehicle[playerid]] == 1) return SendClientMessage(playerid, 0xAFAFAFAA, " O porta-malas já está aberto !");
  1407. new engine, lights, alarm, doors, bonnet, boot, objective;
  1408. GetVehicleParamsEx(Vehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
  1409. SetVehicleParamsEx(Vehicle[playerid], engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_ON, objective);
  1410. TrunkOpen[Vehicle[playerid]] = 1;
  1411. return 1;
  1412. }
  1413. if(strcmp(x_nr, "fechar", true) == 0)
  1414. {
  1415. if(TrunkOpen[Vehicle[playerid]] == 0) return SendClientMessage(playerid, 0xAFAFAFAA, " O porta-malas já está fechado !");
  1416. new engine, lights, alarm, doors, bonnet, boot, objective;
  1417. GetVehicleParamsEx(Vehicle[playerid], engine, lights, alarm, doors, bonnet, boot, objective);
  1418. SetVehicleParamsEx(Vehicle[playerid], engine, lights, alarm, doors, bonnet, VEHICLE_PARAMS_OFF, objective);
  1419. TrunkOpen[Vehicle[playerid]] = 0;
  1420. return 1;
  1421. }
  1422. if(strcmp(x_nr, "colocararma", true) == 0)
  1423. {
  1424. if(TrunkOpen[Vehicle[playerid]] == 0) { SendClientMessage(playerid, 0xAFAFAFAA, " Você deve abrir o porta-malas primeiro !"); return 1; }
  1425. tmp = strtok(cmdtext, idx);
  1426. if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFFF, "USE: /portamalas colocararma [slot]"); return 1; }
  1427. new slot = strval(tmp), weapon = GetPlayerWeapon(playerid);
  1428. if(slot < 1 || slot > 10) { SendClientMessage(playerid, 0xAFAFAFAA, " Slot não pode ser menos do que 1 ou acima de 10 !"); return 1; }
  1429. if(weapon == 0) return SendClientMessage(playerid, 0xAFAFAFAA, "Você não tem uma arma !");
  1430. if(slot == 1)
  1431. {
  1432. new string[128], gunname[16];
  1433. new ammo = GetPlayerAmmo(playerid);
  1434. new v = Vehicle[playerid];
  1435. if(TrunkInfo[v][Slot1] > 0) return SendClientMessage(playerid, 0xAFAFAFAA, " Já existe alguma coisa nesse slot !");
  1436. TrunkInfo[v][Slot1] = weapon;
  1437. TrunkInfo[v][Ammo1] = ammo;
  1438. GetWeaponName(weapon, gunname, sizeof(gunname));
  1439. format(string, sizeof(string), "Você guardou o seu %s no slot 1 do seu porta-malas.",gunname);
  1440. SendClientMessage(playerid, 0xFFFF00FF, string);
  1441. RemovePlayerWeapon(playerid, weapon);
  1442. return 1;
  1443. }
  1444. if(slot == 2)
  1445. {
  1446. new string[128], gunname[16];
  1447. new ammo = GetPlayerAmmo(playerid);
  1448. new v = Vehicle[playerid];
  1449. if(TrunkInfo[v][Slot2] > 0) return SendClientMessage(playerid, 0xAFAFAFAA, " Já existe alguma coisa nesse slot !");
  1450. TrunkInfo[v][Slot2] = weapon;
  1451. TrunkInfo[v][Ammo2] = ammo;
  1452. GetWeaponName(weapon, gunname, sizeof(gunname));
  1453. format(string, sizeof(string), "Você guardou o seu %s no slot 2 do seu porta-malas.",gunname);
  1454. SendClientMessage(playerid, 0xFFFF00FF, string);
  1455. RemovePlayerWeapon(playerid, weapon);
  1456. return 1;
  1457. }
  1458. if(slot == 3)
  1459. {
  1460. new string[128], gunname[16];
  1461. new ammo = GetPlayerAmmo(playerid);
  1462. new v = Vehicle[playerid];
  1463. if(TrunkInfo[v][Slot3] > 0) return SendClientMessage(playerid, 0xAFAFAFAA, " Já existe alguma coisa nesse slot !");
  1464. TrunkInfo[v][Slot3] = weapon;
  1465. TrunkInfo[v][Ammo3] = ammo;
  1466. GetWeaponName(weapon, gunname, sizeof(gunname));
  1467. format(string, sizeof(string), "Você guardou o seu %s no slot 3 do seu porta-malas.",gunname);
  1468. SendClientMessage(playerid, 0xFFFF00FF, string);
  1469. RemovePlayerWeapon(playerid, weapon);
  1470. return 1;
  1471. }
  1472. if(slot == 4)
  1473. {
  1474. new string[128], gunname[16];
  1475. new ammo = GetPlayerAmmo(playerid);
  1476. new v = Vehicle[playerid];
  1477. if(TrunkInfo[v][Slot4] > 0) return SendClientMessage(playerid, 0xAFAFAFAA, " Já existe alguma coisa nesse slot !");
  1478. TrunkInfo[v][Slot4] = weapon;
  1479. TrunkInfo[v][Ammo4] = ammo;
  1480. GetWeaponName(weapon, gunname, sizeof(gunname));
  1481. format(string, sizeof(string), "Você guardou o seu %s no slot 4 do seu porta-malas",gunname);
  1482. SendClientMessage(playerid, 0xFFFF00FF, string);
  1483. RemovePlayerWeapon(playerid, weapon);
  1484. return 1;
  1485. }
  1486. if(slot == 5)
  1487. {
  1488. new string[128], gunname[16];
  1489. new ammo = GetPlayerAmmo(playerid);
  1490. new v = Vehicle[playerid];
  1491. if(TrunkInfo[v][Slot5] > 0) return SendClientMessage(playerid, 0xAFAFAFAA, " Já existe alguma coisa nesse slot !");
  1492. TrunkInfo[v][Slot5] = weapon;
  1493. TrunkInfo[v][Ammo5] = ammo;
  1494. GetWeaponName(weapon, gunname, sizeof(gunname));
  1495. format(string, sizeof(string), "Você guardou o seu %s no slot 5 do seu porta-malas",gunname);
  1496. SendClientMessage(playerid, 0xFFFF00FF, string);
  1497. RemovePlayerWeapon(playerid, weapon);
  1498. return 1;
  1499. }
  1500. if(slot == 6)
  1501. {
  1502. new string[128], gunname[16];
  1503. new ammo = GetPlayerAmmo(playerid);
  1504. new v = Vehicle[playerid];
  1505. if(TrunkInfo[v][Slot6] > 0) return SendClientMessage(playerid, 0xAFAFAFAA, " Já existe alguma coisa nesse slot !");
  1506. TrunkInfo[v][Slot6] = weapon;
  1507. TrunkInfo[v][Ammo6] = ammo;
  1508. GetWeaponName(weapon, gunname, sizeof(gunname));
  1509. format(string, sizeof(string), "Você guardou o seu %s no slot 6 do seu porta-malas",gunname);
  1510. SendClientMessage(playerid, 0xFFFF00FF, string);
  1511. RemovePlayerWeapon(playerid, weapon);
  1512. return 1;
  1513. }
  1514. if(slot == 7)
  1515. {
  1516. new string[128], gunname[16];
  1517. new ammo = GetPlayerAmmo(playerid);
  1518. new v = Vehicle[playerid];
  1519. if(TrunkInfo[v][Slot7] > 0) return SendClientMessage(playerid, 0xAFAFAFAA, " Já existe alguma coisa nesse slot !");
  1520. TrunkInfo[v][Slot7] = weapon;
  1521. TrunkInfo[v][Ammo7] = ammo;
  1522. GetWeaponName(weapon, gunname, sizeof(gunname));
  1523. format(string, sizeof(string), "Você guardou o seu %s no slot 7 do seu porta-malas",gunname);
  1524. SendClientMessage(playerid, 0xFFFF00FF, string);
  1525. RemovePlayerWeapon(playerid, weapon);
  1526. return 1;
  1527. }
  1528. if(slot == 8)
  1529. {
  1530. new string[128], gunname[16];
  1531. new ammo = GetPlayerAmmo(playerid);
  1532. new v = Vehicle[playerid];
  1533. if(TrunkInfo[v][Slot8] > 0) return SendClientMessage(playerid, 0xAFAFAFAA, " Já existe alguma coisa nesse slot !");
  1534. TrunkInfo[v][Slot8] = weapon;
  1535. TrunkInfo[v][Ammo8] = ammo;
  1536. GetWeaponName(weapon, gunname, sizeof(gunname));
  1537. format(string, sizeof(string), "Você guardou o seu %s no slot 8 do seu porta-malas",gunname);
  1538. SendClientMessage(playerid, 0xFFFF00FF, string);
  1539. RemovePlayerWeapon(playerid, weapon);
  1540. return 1;
  1541. }
  1542. if(slot == 9)
  1543. {
  1544. new string[128], gunname[16];
  1545. new ammo = GetPlayerAmmo(playerid);
  1546. new v = Vehicle[playerid];
  1547. if(TrunkInfo[v][Slot9] > 0) return SendClientMessage(playerid, 0xAFAFAFAA, " Já existe alguma coisa nesse slot !");
  1548. TrunkInfo[v][Slot9] = weapon;
  1549. TrunkInfo[v][Ammo9] = ammo;
  1550. GetWeaponName(weapon, gunname, sizeof(gunname));
  1551. format(string, sizeof(string), "Você guardou o seu %s no slot 9 do seu porta-malas",gunname);
  1552. SendClientMessage(playerid, 0xFFFF00FF, string);
  1553. RemovePlayerWeapon(playerid, weapon);
  1554. return 1;
  1555. }
  1556. if(slot == 10)
  1557. {
  1558. new string[128], gunname[16];
  1559. new ammo = GetPlayerAmmo(playerid);
  1560. new v = Vehicle[playerid];
  1561. if(TrunkInfo[v][Slot10] > 0) return SendClientMessage(playerid, 0xAFAFAFAA, " Já existe alguma coisa nesse slot !");
  1562. TrunkInfo[v][Slot10] = weapon;
  1563. TrunkInfo[v][Ammo10] = ammo;
  1564. GetWeaponName(weapon, gunname, sizeof(gunname));
  1565. format(string, sizeof(string), "Você guardou o seu %s no slot 10 do seu porta-malas",gunname);
  1566. SendClientMessage(playerid, 0xFFFF00FF, string);
  1567. RemovePlayerWeapon(playerid, weapon);
  1568. return 1;
  1569. }
  1570. }
  1571. if(strcmp(x_nr, "pegararma", true) == 0)
  1572. {
  1573. if(TrunkOpen[Vehicle[playerid]] == 0) { SendClientMessage(playerid, 0xAFAFAFAA, " Primeiro você deve abrir o porta-malas !"); return 1; }
  1574. tmp = strtok(cmdtext, idx);
  1575. if(!strlen(tmp)) { SendClientMessage(playerid, 0xFFFFFFFF, "USE: /portamalas pegararma [slot]"); return 1; }
  1576. new slot = strval(tmp);
  1577. if(slot < 1 || slot > 10) { SendClientMessage(playerid, 0xAFAFAFAA, " Slot não pode ser menor do que 1 ou acima de 10 !"); return 1; }
  1578. if(slot == 1)
  1579. {
  1580. new string[128], gunname[16];
  1581. new v = Vehicle[playerid];
  1582. if(TrunkInfo[v][Slot1] < 1) return SendClientMessage(playerid, 0xAFAFAFAA, " Não há nada nesse slot !");
  1583. GetWeaponName(TrunkInfo[v][Slot1], gunname, sizeof(gunname));
  1584. format(string, sizeof(string), "Você pegou seu %s que estava no slot 1 do seu porta-malas.",gunname);
  1585. SendClientMessage(playerid, 0xFFFF00FF, string);
  1586. GivePlayerWeapon(playerid, TrunkInfo[v][Slot1], TrunkInfo[v][Ammo1]);
  1587. TrunkInfo[v][Slot1] = 0;
  1588. TrunkInfo[v][Ammo1] = 0;
  1589. return 1;
  1590. }
  1591. if(slot == 2)
  1592. {
  1593. new string[128], gunname[16];
  1594. new v = Vehicle[playerid];
  1595. if(TrunkInfo[v][Slot2] < 1) return SendClientMessage(playerid, 0xAFAFAFAA, " Não há nada nesse slot !");
  1596. GetWeaponName(TrunkInfo[v][Slot2], gunname, sizeof(gunname));
  1597. format(string, sizeof(string), "Você pegou seu %s que estava no slot 2 do seu porta-malas.",gunname);
  1598. SendClientMessage(playerid, 0xFFFF00FF, string);
  1599. GivePlayerWeapon(playerid, TrunkInfo[v][Slot2], TrunkInfo[v][Ammo2]);
  1600. TrunkInfo[v][Slot2] = 0;
  1601. TrunkInfo[v][Ammo2] = 0;
  1602. return 1;
  1603. }
  1604. if(slot == 3)
  1605. {
  1606. new string[128], gunname[16];
  1607. new v = Vehicle[playerid];
  1608. if(TrunkInfo[v][Slot3] < 1) return SendClientMessage(playerid, 0xAFAFAFAA, " Não há nada nesse slot !");
  1609. GetWeaponName(TrunkInfo[v][Slot3], gunname, sizeof(gunname));
  1610. format(string, sizeof(string), "Você pegou seu %s que estava no slot 3 do seu porta-malas.",gunname);
  1611. SendClientMessage(playerid, 0xFFFF00FF, string);
  1612. GivePlayerWeapon(playerid, TrunkInfo[v][Slot3], TrunkInfo[v][Ammo3]);
  1613. TrunkInfo[v][Slot3] = 0;
  1614. TrunkInfo[v][Ammo3] = 0;
  1615. return 1;
  1616. }
  1617. if(slot == 4)
  1618. {
  1619. new string[128], gunname[16];
  1620. new v = Vehicle[playerid];
  1621. if(TrunkInfo[v][Slot4] < 1) return SendClientMessage(playerid, 0xAFAFAFAA, " Não há nada nesse slot !");
  1622. GetWeaponName(TrunkInfo[v][Slot4], gunname, sizeof(gunname));
  1623. format(string, sizeof(string), "Você pegou seu %s que estava no slot 4 do seu porta-malas.",gunname);
  1624. SendClientMessage(playerid, 0xFFFF00FF, string);
  1625. GivePlayerWeapon(playerid, TrunkInfo[v][Slot4], TrunkInfo[v][Ammo4]);
  1626. TrunkInfo[v][Slot4] = 0;
  1627. TrunkInfo[v][Ammo4] = 0;
  1628. return 1;
  1629. }
  1630. if(slot == 5)
  1631. {
  1632. new string[128], gunname[16];
  1633. new v = Vehicle[playerid];
  1634. if(TrunkInfo[v][Slot5] < 1) return SendClientMessage(playerid, 0xAFAFAFAA, " Não há nada nesse slot !");
  1635. GetWeaponName(TrunkInfo[v][Slot5], gunname, sizeof(gunname));
  1636. format(string, sizeof(string), "Você pegou seu %s que estava no slot 5 do seu porta-malas.",gunname);
  1637. SendClientMessage(playerid, 0xFFFF00FF, string);
  1638. GivePlayerWeapon(playerid, TrunkInfo[v][Slot5], TrunkInfo[v][Ammo5]);
  1639. TrunkInfo[v][Slot5] = 0;
  1640. TrunkInfo[v][Ammo5] = 0;
  1641. return 1;
  1642. }
  1643. if(slot == 6)
  1644. {
  1645. new string[128], gunname[16];
  1646. new v = Vehicle[playerid];
  1647. if(TrunkInfo[v][Slot6] < 1) return SendClientMessage(playerid, 0xAFAFAFAA, " Não há nada nesse slot !");
  1648. GetWeaponName(TrunkInfo[v][Slot6], gunname, sizeof(gunname));
  1649. format(string, sizeof(string), "Você pegou seu %s que estava no slot 6 do seu porta-malas.",gunname);
  1650. SendClientMessage(playerid, 0xFFFF00FF, string);
  1651. GivePlayerWeapon(playerid, TrunkInfo[v][Slot6], TrunkInfo[v][Ammo6]);
  1652. TrunkInfo[v][Slot6] = 0;
  1653. TrunkInfo[v][Ammo6] = 0;
  1654. return 1;
  1655. }
  1656. if(slot == 7)
  1657. {
  1658. new string[128], gunname[16];
  1659. new v = Vehicle[playerid];
  1660. if(TrunkInfo[v][Slot7] < 1) return SendClientMessage(playerid, 0xAFAFAFAA, " Não há nada nesse slot !");
  1661. GetWeaponName(TrunkInfo[v][Slot7], gunname, sizeof(gunname));
  1662. format(string, sizeof(string), "Você pegou seu %s que estava no slot 7 do seu porta-malas.",gunname);
  1663. SendClientMessage(playerid, 0xFFFF00FF, string);
  1664. GivePlayerWeapon(playerid, TrunkInfo[v][Slot7], TrunkInfo[v][Ammo7]);
  1665. TrunkInfo[v][Slot7] = 0;
  1666. TrunkInfo[v][Ammo7] = 0;
  1667. return 1;
  1668. }
  1669. if(slot == 8)
  1670. {
  1671. new string[128], gunname[16];
  1672. new v = Vehicle[playerid];
  1673. if(TrunkInfo[v][Slot8] < 1) return SendClientMessage(playerid, 0xAFAFAFAA, " Não há nada nesse slot !");
  1674. GetWeaponName(TrunkInfo[v][Slot8], gunname, sizeof(gunname));
  1675. format(string, sizeof(string), "Você pegou seu %s que estava no slot 8 do seu porta-malas.",gunname);
  1676. SendClientMessage(playerid, 0xFFFF00FF, string);
  1677. GivePlayerWeapon(playerid, TrunkInfo[v][Slot8], TrunkInfo[v][Ammo8]);
  1678. TrunkInfo[v][Slot8] = 0;
  1679. TrunkInfo[v][Ammo8] = 0;
  1680. return 1;
  1681. }
  1682. if(slot == 9)
  1683. {
  1684. new string[128], gunname[16];
  1685. new v = Vehicle[playerid];
  1686. if(TrunkInfo[v][Slot9] < 1) return SendClientMessage(playerid, 0xAFAFAFAA, " Não há nada nesse slot !");
  1687. GetWeaponName(TrunkInfo[v][Slot9], gunname, sizeof(gunname));
  1688. format(string, sizeof(string), "Você pegou seu %s que estava no slot 9 do seu porta-malas.",gunname);
  1689. SendClientMessage(playerid, 0xFFFF00FF, string);
  1690. GivePlayerWeapon(playerid, TrunkInfo[v][Slot9], TrunkInfo[v][Ammo9]);
  1691. TrunkInfo[v][Slot9] = 0;
  1692. TrunkInfo[v][Ammo9] = 0;
  1693. return 1;
  1694. }
  1695. if(slot == 10)
  1696. {
  1697. new string[128], gunname[16];
  1698. new v = Vehicle[playerid];
  1699. if(TrunkInfo[v][Slot10] < 1) return SendClientMessage(playerid, 0xAFAFAFAA, " Não há nada nesse slot !");
  1700. GetWeaponName(TrunkInfo[v][Slot10], gunname, sizeof(gunname));
  1701. format(string, sizeof(string), "Você pegou seu %s que estava no slot 10 do seu porta-malas.",gunname);
  1702. SendClientMessage(playerid, 0xFFFF00FF, string);
  1703. GivePlayerWeapon(playerid, TrunkInfo[v][Slot10], TrunkInfo[v][Ammo10]);
  1704. TrunkInfo[v][Slot10] = 0;
  1705. TrunkInfo[v][Ammo10] = 0;
  1706. return 1;
  1707. }
  1708. }
  1709. if(strcmp(cmd, "/limparchat", true) == 0)
  1710. {
  1711. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xC0C0C0AA, "Você não pode usar esse comando.");
  1712. new gunname[16], gunname2[16], gunname3[16], gunname4[16], gunname5[16], gunname6[16], gunname7[16], gunname8[16], gunname9[16],
  1713. gunname10[16], string[64], string2[64], string3[64], string4[64], string5[64], string6[64], string7[64], string8[64], string9[64], string10[64];
  1714. if(TrunkOpen[Vehicle[playerid]] == 0) { SendClientMessage(playerid, 0xAFAFAFAA, " Primeiro você deve abrir o porta-malas !"); return 1; }
  1715. GetWeaponName(TrunkInfo[Vehicle[playerid]][Slot1], gunname, sizeof(gunname));
  1716. GetWeaponName(TrunkInfo[Vehicle[playerid]][Slot2], gunname2, sizeof(gunname2));
  1717. GetWeaponName(TrunkInfo[Vehicle[playerid]][Slot3], gunname3, sizeof(gunname3));
  1718. GetWeaponName(TrunkInfo[Vehicle[playerid]][Slot4], gunname4, sizeof(gunname4));
  1719. GetWeaponName(TrunkInfo[Vehicle[playerid]][Slot5], gunname5, sizeof(gunname5));
  1720. GetWeaponName(TrunkInfo[Vehicle[playerid]][Slot6], gunname6, sizeof(gunname6));
  1721. GetWeaponName(TrunkInfo[Vehicle[playerid]][Slot7], gunname7, sizeof(gunname7));
  1722. GetWeaponName(TrunkInfo[Vehicle[playerid]][Slot8], gunname8, sizeof(gunname8));
  1723. GetWeaponName(TrunkInfo[Vehicle[playerid]][Slot9], gunname9, sizeof(gunname9));
  1724. GetWeaponName(TrunkInfo[Vehicle[playerid]][Slot10], gunname10, sizeof(gunname10));
  1725. SendClientMessage(playerid, 0x33AA33AA, "Chat Limpo");
  1726. if(TrunkInfo[Vehicle[playerid]][Slot1] != 0) { format(string, sizeof(string), "Slot 1: %s (%i Ammo)", gunname, TrunkInfo[Vehicle[playerid]][Ammo1]); } else { format(string, sizeof(string), "Slot 1: None (0 Ammo)"); }
  1727. if(TrunkInfo[Vehicle[playerid]][Slot2] != 0) { format(string, sizeof(string), "Slot 2: %s (%i Ammo)", gunname, TrunkInfo[Vehicle[playerid]][Ammo2]); } else { format(string, sizeof(string), "Slot 2: None (0 Ammo)"); }
  1728. if(TrunkInfo[Vehicle[playerid]][Slot3] != 0) { format(string, sizeof(string), "Slot 3: %s (%i Ammo)", gunname, TrunkInfo[Vehicle[playerid]][Ammo3]); } else { format(string, sizeof(string), "Slot 3: None (0 Ammo)"); }
  1729. if(TrunkInfo[Vehicle[playerid]][Slot4] != 0) { format(string, sizeof(string), "Slot 4: %s (%i Ammo)", gunname, TrunkInfo[Vehicle[playerid]][Ammo4]); } else { format(string, sizeof(string), "Slot 4: None (0 Ammo)"); }
  1730. if(TrunkInfo[Vehicle[playerid]][Slot5] != 0) { format(string, sizeof(string), "Slot 5: %s (%i Ammo)", gunname, TrunkInfo[Vehicle[playerid]][Ammo5]); } else { format(string, sizeof(string), "Slot 5: None (0 Ammo)"); }
  1731. if(TrunkInfo[Vehicle[playerid]][Slot6] != 0) { format(string, sizeof(string), "Slot 6: %s (%i Ammo)", gunname, TrunkInfo[Vehicle[playerid]][Ammo6]); } else { format(string, sizeof(string), "Slot 6: None (0 Ammo)"); }
  1732. if(TrunkInfo[Vehicle[playerid]][Slot7] != 0) { format(string, sizeof(string), "Slot 7: %s (%i Ammo)", gunname, TrunkInfo[Vehicle[playerid]][Ammo7]); } else { format(string, sizeof(string), "Slot 7: None (0 Ammo)"); }
  1733. if(TrunkInfo[Vehicle[playerid]][Slot8] != 0) { format(string, sizeof(string), "Slot 8: %s (%i Ammo)", gunname, TrunkInfo[Vehicle[playerid]][Ammo8]); } else { format(string, sizeof(string), "Slot 8: None (0 Ammo)"); }
  1734. if(TrunkInfo[Vehicle[playerid]][Slot9] != 0) { format(string, sizeof(string), "Slot 9: %s (%i Ammo)", gunname, TrunkInfo[Vehicle[playerid]][Ammo9]); } else { format(string, sizeof(string), "Slot 9: None (0 Ammo)"); }
  1735. if(TrunkInfo[Vehicle[playerid]][Slot10] != 0) { format(string, sizeof(string), "Slot 10: %s (%i Ammo)", gunname, TrunkInfo[Vehicle[playerid]][Ammo10]); } else { format(string, sizeof(string), "Slot 10: None (0 Ammo)"); }
  1736. SendClientMessage(playerid, 0xFFFFFFFF, string);
  1737. SendClientMessage(playerid, 0xFFFFFFFF, string2);
  1738. SendClientMessage(playerid, 0xFFFFFFFF, string3);
  1739. SendClientMessage(playerid, 0xFFFFFFFF, string4);
  1740. SendClientMessage(playerid, 0xFFFFFFFF, string5);
  1741. SendClientMessage(playerid, 0xFFFFFFFF, string6);
  1742. SendClientMessage(playerid, 0xFFFFFFFF, string7);
  1743. SendClientMessage(playerid, 0xFFFFFFFF, string8);
  1744. SendClientMessage(playerid, 0xFFFFFFFF, string9);
  1745. SendClientMessage(playerid, 0xFFFFFFFF, string10);
  1746. SendClientMessage(playerid, 0x33AA33AA, "Chat Limpo");
  1747. return 1;
  1748. }
  1749. return 1;
  1750. }
  1751. if(strcmp(cmd, "/trancar", true) == 0)
  1752. {
  1753. if(gPlayerHasCar[playerid] == 1)
  1754. {
  1755. new v, Float:vehx, Float:vehy, Float:vehz;
  1756. v = Vehicle[playerid];
  1757. GetVehiclePos(v, vehx, vehy, vehz);
  1758. if(IsPlayerInRangeOfPoint(playerid, 3.0, vehx, vehy, vehz))
  1759. {
  1760. if(VehicleInfo[playerid][Locked] == 0)
  1761. {
  1762. SetVehicleParamsForPlayer(v, playerid, 0, 1);
  1763. PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  1764. GameTextForPlayer(playerid, "~r~Carro trancado!", 3000, 6);
  1765. VehicleInfo[playerid][Locked] = 1;
  1766. gVehLocked[v] = 1;
  1767. return 1;
  1768. }
  1769. if(VehicleInfo[playerid][Locked] == 1)
  1770. {
  1771. SetVehicleParamsForPlayer(v, playerid, 0, 0);
  1772. PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  1773. GameTextForPlayer(playerid, "~g~Carro destrancado!", 3000, 6);
  1774. VehicleInfo[playerid][Locked] = 0;
  1775. gVehLocked[v] = 0;
  1776. return 1;
  1777. }
  1778. }
  1779. else
  1780. {
  1781. SendClientMessage(playerid, 0xAFAFAFAA, "Você está muito longe do seu veículo.");
  1782. return 1;
  1783. }
  1784. }
  1785. else
  1786. {
  1787. SendClientMessage(playerid, 0xAFAFAFAA, "Você não possui um veículo.");
  1788. }
  1789. return 1;
  1790. }
  1791. if(strcmp(cmd, "/carroajuda", true) == 0)
  1792. {
  1793. SendClientMessage(playerid, 0x33AA33AA, "_______________________________________");
  1794. SendClientMessage(playerid, 0xFFFFFFAA, "*** AJUDA *** digite um comando para obter mais ajuda");
  1795. SendClientMessage(playerid, 0xCBCCCEFF, "*** CARRRO *** /portamalas /estacionar /vendercarro /escolherplaca /localizarcarro /trancar");
  1796. return 1;
  1797. }
  1798. if(strcmp(cmd, "/escolherplaca", true) == 0)
  1799. {
  1800. if(IsPlayerConnected(playerid))
  1801. {
  1802. if(!IsPlayerInVehicle(playerid, Vehicle[playerid]))
  1803. {
  1804. SendClientMessage(playerid, 0xFFFFFFAA, "Você não está em seu carro.");
  1805. return 1;
  1806. }
  1807. if(IsACar(Vehicle[playerid]))
  1808. {
  1809. ShowPlayerDialog(playerid, 670, DIALOG_STYLE_INPUT, "Plate", "Defina placa do veículo.", "OK", "Cancelar");
  1810. return 1;
  1811. }
  1812. else
  1813. {
  1814. SendClientMessage(playerid, 0xAFAFAFAA, "Este veículo não tem uma placa.");
  1815. return 1;
  1816. }
  1817. }
  1818. return 1;
  1819. }
  1820. if(strcmp(cmd, "/estacionar", true) == 0)
  1821. {
  1822. new Float:X, Float:Y, Float:Z, Float:Rot;
  1823. if(!IsPlayerInVehicle(playerid, Vehicle[playerid]))
  1824. {
  1825. SendClientMessage(playerid, 0xFFFFFFAA, "Você não está em seu carro.");
  1826. return 1;
  1827. }
  1828. new file[256], name[24];
  1829. GetPlayerName(playerid, name, 24);
  1830. format(file,sizeof(file),"Carros/%s.sav",name);
  1831. dini_IntSet(file, "Model", VehicleInfo[playerid][Model]);
  1832. dini_IntSet(file, "Price", VehicleInfo[playerid][Price]);
  1833. dini_FloatSet(file, "X", VehicleInfo[playerid][CarX]);
  1834. dini_FloatSet(file, "Y", VehicleInfo[playerid][CarY]);
  1835. dini_FloatSet(file, "Z", VehicleInfo[playerid][CarZ]);
  1836. dini_FloatSet(file, "Rot", VehicleInfo[playerid][CarRot]);
  1837. dini_IntSet(file, "Locked", VehicleInfo[playerid][Locked]);
  1838. dini_Set(file, "Plate", VehPlate[Vehicle[playerid]]);
  1839. dini_IntSet(file, "mod1", VehicleInfo[playerid][mod1]);
  1840. dini_IntSet(file, "mod2", VehicleInfo[playerid][mod2]);
  1841. dini_IntSet(file, "mod3", VehicleInfo[playerid][mod3]);
  1842. dini_IntSet(file, "mod4", VehicleInfo[playerid][mod4]);
  1843. dini_IntSet(file, "mod5", VehicleInfo[playerid][mod5]);
  1844. dini_IntSet(file, "mod6", VehicleInfo[playerid][mod6]);
  1845. dini_IntSet(file, "mod7", VehicleInfo[playerid][mod7]);
  1846. dini_IntSet(file, "mod8", VehicleInfo[playerid][mod8]);
  1847. dini_IntSet(file, "mod9", VehicleInfo[playerid][mod9]);
  1848. dini_IntSet(file, "mod10", VehicleInfo[playerid][mod10]);
  1849. dini_IntSet(file, "mod11", VehicleInfo[playerid][mod11]);
  1850. dini_IntSet(file, "mod12", VehicleInfo[playerid][mod12]);
  1851. dini_IntSet(file, "mod13", VehicleInfo[playerid][mod13]);
  1852. dini_IntSet(file, "mod14", VehicleInfo[playerid][mod14]);
  1853. dini_IntSet(file, "mod15", VehicleInfo[playerid][mod15]);
  1854. dini_IntSet(file, "mod16", VehicleInfo[playerid][mod16]);
  1855. dini_IntSet(file, "mod17", VehicleInfo[playerid][mod17]);
  1856. dini_IntSet(file, "paintjob", VehicleInfo[playerid][paintjob]);
  1857. dini_IntSet(file, "color1", VehicleInfo[playerid][colora]);
  1858. dini_IntSet(file, "color2", VehicleInfo[playerid][colorb]);
  1859. SendClientMessage(playerid, 0xFFFF00FF, "Carro estacionado com sucesso, ele vai estar no local estacionado.");
  1860. GetVehiclePos(Vehicle[playerid], X, Y, Z);
  1861. GetVehicleZAngle(Vehicle[playerid], Rot);
  1862. VehicleInfo[playerid][Model] = GetVehicleModel(playerid);
  1863. VehicleInfo[playerid][CarX] = X;
  1864. VehicleInfo[playerid][CarY] = Y;
  1865. VehicleInfo[playerid][CarZ] = Z;
  1866. VehicleInfo[playerid][CarRot] = Rot;
  1867. return 1;
  1868. }
  1869. if(strcmp(cmd, "/vendercarro", true) == 0)
  1870. {
  1871. if(IsPlayerConnected(playerid))
  1872. {
  1873. if(!IsPlayerInVehicle(playerid, Vehicle[playerid]))
  1874. {
  1875. SendClientMessage(playerid, 0xFFFFFFAA, "Você não está em seu carro.");
  1876. return 1;
  1877. }
  1878. if(ConfirmSale[playerid] == 0) {
  1879. SendClientMessage(playerid, 0xFFFF00FF, "Você tem certeza que quer vender seu carro? (Digite /vendercarro novamente para confirmar).");
  1880. ConfirmSale[playerid] = 1;
  1881. return 1;
  1882. }
  1883. new string[128], file[256], name[MAX_PLAYER_NAME];
  1884. GetPlayerName(playerid, name, sizeof(name));
  1885. format(file,sizeof(file),"Carros/%s.sav",name);
  1886. format(string, sizeof(string), "Você vendeu seu carro por um valor de 50 por cento, para $%i.", VehicleInfo[playerid][Price]/2);
  1887. GivePlayerMoney(playerid, VehicleInfo[playerid][Price]/2);
  1888. DestroyVehicle(Vehicle[playerid]);
  1889. dini_Remove(file);
  1890. Vehicle[playerid] = 0;
  1891. gPlayerHasCar[playerid] = 0;
  1892. VehicleInfo[playerid][Model] = 0;
  1893. VehicleInfo[playerid][Price] = 0;
  1894. VehicleInfo[playerid][CarX] = 0;
  1895. VehicleInfo[playerid][CarY] = 0;
  1896. VehicleInfo[playerid][CarZ] = 0;
  1897. VehicleInfo[playerid][CarRot] = 0;
  1898. ConfirmSale[playerid] = 0;
  1899. SendClientMessage(playerid, 0xFFFF00FF, string);
  1900. return 1;
  1901. }
  1902. return 1;
  1903. }
  1904. if(strcmp(cmd, "/localizarcarro", true) == 0)
  1905. {
  1906. if(IsPlayerConnected(playerid))
  1907. {
  1908. if(gPlayerHasCar[playerid] == 1)
  1909. {
  1910. new Float:vx, Float:vy, Float:vz;
  1911. GetVehiclePos(Vehicle[playerid], vx, vy, vz);
  1912. SetPlayerCheckpoint(playerid, vx, vy, vz, 10.0);
  1913. Checkpoint[playerid] = 1;
  1914. SendClientMessage(playerid, 0xFFFFFFAA, "Vá para o checkpoint para encontrar o seu carro!");
  1915. return 1;
  1916. }
  1917. else {
  1918. SendClientMessage(playerid, 0xAFAFAFAA, "Você não possui um veículo.");
  1919. return 1;
  1920. }
  1921. }
  1922. return 1;
  1923. }
  1924. return 0;
  1925. }
  1926.  
  1927. public OnPlayerEnterCheckpoint(playerid)
  1928. {
  1929. if(Checkpoint[playerid] == 1)
  1930. {
  1931. PlayerPlaySound(playerid, 1149, 0.0, 0.0, 0.0);
  1932. DisablePlayerCheckpoint(playerid);
  1933. return 1;
  1934. }
  1935. return 1;
  1936. }
  1937.  
  1938. public OnVehicleStreamIn(vehicleid, forplayerid)
  1939. {
  1940. if(gVehLocked[vehicleid] == 1)
  1941. {
  1942. SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 1);
  1943. gVehLocked[vehicleid] = 1;
  1944. }
  1945. else
  1946. {
  1947. SetVehicleParamsForPlayer(vehicleid, forplayerid, 0, 0);
  1948. gVehLocked[vehicleid] = 0;
  1949. }
  1950. return 1;
  1951. }
  1952.  
  1953. public OnVehicleSpawn(vehicleid)
  1954. {
  1955. if(Destroyed[vehicleid] == true)
  1956. {
  1957. new file[256], name[MAX_PLAYER_NAME];
  1958. GetPlayerName(OwnerID[vehicleid], name, sizeof(name));
  1959. format(file,sizeof(file),"Carros/%s.sav",name);
  1960. if(dini_Exists(file))
  1961. {
  1962. VehicleInfo[OwnerID[vehicleid]][Model] = dini_Int(file, "Model");
  1963. VehicleInfo[OwnerID[vehicleid]][Price] = dini_Int(file, "Price");
  1964. VehicleInfo[OwnerID[vehicleid]][CarX] = dini_Float(file, "X");
  1965. VehicleInfo[OwnerID[vehicleid]][CarY] = dini_Float(file, "Y");
  1966. VehicleInfo[OwnerID[vehicleid]][CarZ] = dini_Float(file, "Z");
  1967. VehicleInfo[OwnerID[vehicleid]][CarRot] = dini_Float(file, "Rot");
  1968. VehicleInfo[OwnerID[vehicleid]][Locked] = dini_Int(file, "Locked");
  1969. VehicleInfo[OwnerID[vehicleid]][mod1] = dini_Int(file, "mod1");
  1970. VehicleInfo[OwnerID[vehicleid]][mod2] = dini_Int(file, "mod2");
  1971. VehicleInfo[OwnerID[vehicleid]][mod3] = dini_Int(file, "mod3");
  1972. VehicleInfo[OwnerID[vehicleid]][mod4] = dini_Int(file, "mod4");
  1973. VehicleInfo[OwnerID[vehicleid]][mod5] = dini_Int(file, "mod5");
  1974. VehicleInfo[OwnerID[vehicleid]][mod6] = dini_Int(file, "mod6");
  1975. VehicleInfo[OwnerID[vehicleid]][mod7] = dini_Int(file, "mod7");
  1976. VehicleInfo[OwnerID[vehicleid]][mod8] = dini_Int(file, "mod8");
  1977. VehicleInfo[OwnerID[vehicleid]][mod9] = dini_Int(file, "mod9");
  1978. VehicleInfo[OwnerID[vehicleid]][mod10] = dini_Int(file, "mod10");
  1979. VehicleInfo[OwnerID[vehicleid]][mod11] = dini_Int(file, "mod11");
  1980. VehicleInfo[OwnerID[vehicleid]][mod12] = dini_Int(file, "mod12");
  1981. VehicleInfo[OwnerID[vehicleid]][mod13] = dini_Int(file, "mod13");
  1982. VehicleInfo[OwnerID[vehicleid]][mod14] = dini_Int(file, "mod14");
  1983. VehicleInfo[OwnerID[vehicleid]][mod15] = dini_Int(file, "mod15");
  1984. VehicleInfo[OwnerID[vehicleid]][mod16] = dini_Int(file, "mod16");
  1985. VehicleInfo[OwnerID[vehicleid]][mod17] = dini_Int(file, "mod17");
  1986. VehicleInfo[OwnerID[vehicleid]][paintjob] = dini_Int(file, "paintjob");
  1987. VehicleInfo[OwnerID[vehicleid]][colora] = dini_Int(file, "color1");
  1988. VehicleInfo[OwnerID[vehicleid]][colorb] = dini_Int(file, "color2");
  1989. Vehicle[OwnerID[vehicleid]] = CreateVehicle(VehicleInfo[OwnerID[vehicleid]][Model], VehicleInfo[OwnerID[vehicleid]][CarX], VehicleInfo[OwnerID[vehicleid]][CarY], VehicleInfo[OwnerID[vehicleid]][CarZ], VehicleInfo[OwnerID[vehicleid]][CarRot], -1, -1, 3600000);
  1990. if(VehicleInfo[OwnerID[vehicleid]][mod1]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod1]); }
  1991. if(VehicleInfo[OwnerID[vehicleid]][mod2]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod2]); }
  1992. if(VehicleInfo[OwnerID[vehicleid]][mod3]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod3]); }
  1993. if(VehicleInfo[OwnerID[vehicleid]][mod4]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod4]); }
  1994. if(VehicleInfo[OwnerID[vehicleid]][mod5]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod5]); }
  1995. if(VehicleInfo[OwnerID[vehicleid]][mod6]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod6]); }
  1996. if(VehicleInfo[OwnerID[vehicleid]][mod7]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod7]); }
  1997. if(VehicleInfo[OwnerID[vehicleid]][mod8]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod8]); }
  1998. if(VehicleInfo[OwnerID[vehicleid]][mod9]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod9]); }
  1999. if(VehicleInfo[OwnerID[vehicleid]][mod10]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod10]); }
  2000. if(VehicleInfo[OwnerID[vehicleid]][mod11]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod11]); }
  2001. if(VehicleInfo[OwnerID[vehicleid]][mod12]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod12]); }
  2002. if(VehicleInfo[OwnerID[vehicleid]][mod13]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod13]); }
  2003. if(VehicleInfo[OwnerID[vehicleid]][mod14]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod14]); }
  2004. if(VehicleInfo[OwnerID[vehicleid]][mod15]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod15]); }
  2005. if(VehicleInfo[OwnerID[vehicleid]][mod16]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod16]); }
  2006. if(VehicleInfo[OwnerID[vehicleid]][mod17]!=0) { AddVehicleComponent(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][mod17]); }
  2007. if(VehicleInfo[OwnerID[vehicleid]][colora]!=0 || VehicleInfo[OwnerID[vehicleid]][colorb]!=0)
  2008. {
  2009. ChangeVehicleColor(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][colora],VehicleInfo[OwnerID[vehicleid]][colorb]);
  2010. }
  2011. if(VehicleInfo[OwnerID[vehicleid]][paintjob]!=0)
  2012. {
  2013. ChangeVehiclePaintjob(Vehicle[OwnerID[vehicleid]],VehicleInfo[OwnerID[vehicleid]][paintjob]);
  2014. }
  2015. new tmp[256]; tmp = dini_Get(file, "Plate");
  2016. gPlayerHasCar[OwnerID[vehicleid]] = 1;
  2017. VehOwned[Vehicle[OwnerID[vehicleid]]] = 1;
  2018. SetVehicleParamsForPlayer(Vehicle[OwnerID[vehicleid]], OwnerID[vehicleid], 0, VehicleInfo[OwnerID[vehicleid]][Locked]);
  2019. gVehLocked[Vehicle[OwnerID[vehicleid]]] = VehicleInfo[OwnerID[vehicleid]][Locked];
  2020. SetVehicleNumberPlate(Vehicle[OwnerID[vehicleid]], tmp);
  2021. VehPlate[Vehicle[OwnerID[vehicleid]]] = tmp;
  2022. Destroyed[vehicleid] = false;
  2023. }
  2024. }
  2025. return 1;
  2026. }
  2027.  
  2028. public OnVehicleDeath(vehicleid, killerid)
  2029. {
  2030. new string[32], playername[MAX_PLAYER_NAME];
  2031. GetPlayerName(killerid, playername, sizeof(playername));
  2032. format(string, sizeof(string), "Carros/PortaMalas/%s.sav", playername);
  2033. new File: hFile = fopen(string, io_write);
  2034. if(hFile)
  2035. {
  2036. //Veículo destruído, muito ruim ...
  2037. fclose(hFile);
  2038. fremove(string);
  2039. }
  2040. Destroyed[vehicleid] = true;
  2041. new file[256], name[24];
  2042. GetPlayerName(killerid, name, 24);
  2043. format(file,sizeof(file),"Carros/%s.sav",name);
  2044. if(dini_Exists(file))
  2045. {
  2046. dini_IntSet(file, "Model", GetVehicleModel(Vehicle[killerid]));
  2047. dini_IntSet(file, "Price", VehicleInfo[killerid][Price]);
  2048. dini_FloatSet(file, "X", VehicleInfo[killerid][CarX]);
  2049. dini_FloatSet(file, "Y", VehicleInfo[killerid][CarY]);
  2050. dini_FloatSet(file, "Z", VehicleInfo[killerid][CarZ]);
  2051. dini_FloatSet(file, "Rot", VehicleInfo[killerid][CarRot]);
  2052. dini_IntSet(file, "Locked", VehicleInfo[killerid][Locked]);
  2053. dini_Set(file, "Plate", VehPlate[Vehicle[killerid]]);
  2054. dini_IntSet(file, "mod1", VehicleInfo[killerid][mod1]);
  2055. dini_IntSet(file, "mod2", VehicleInfo[killerid][mod2]);
  2056. dini_IntSet(file, "mod3", VehicleInfo[killerid][mod3]);
  2057. dini_IntSet(file, "mod4", VehicleInfo[killerid][mod4]);
  2058. dini_IntSet(file, "mod5", VehicleInfo[killerid][mod5]);
  2059. dini_IntSet(file, "mod6", VehicleInfo[killerid][mod6]);
  2060. dini_IntSet(file, "mod7", VehicleInfo[killerid][mod7]);
  2061. dini_IntSet(file, "mod8", VehicleInfo[killerid][mod8]);
  2062. dini_IntSet(file, "mod9", VehicleInfo[killerid][mod9]);
  2063. dini_IntSet(file, "mod10", VehicleInfo[killerid][mod10]);
  2064. dini_IntSet(file, "mod11", VehicleInfo[killerid][mod11]);
  2065. dini_IntSet(file, "mod12", VehicleInfo[killerid][mod12]);
  2066. dini_IntSet(file, "mod13", VehicleInfo[killerid][mod13]);
  2067. dini_IntSet(file, "mod14", VehicleInfo[killerid][mod14]);
  2068. dini_IntSet(file, "mod15", VehicleInfo[killerid][mod15]);
  2069. dini_IntSet(file, "mod16", VehicleInfo[killerid][mod16]);
  2070. dini_IntSet(file, "mod17", VehicleInfo[killerid][mod17]);
  2071. dini_IntSet(file, "paintjob", VehicleInfo[killerid][paintjob]);
  2072. dini_IntSet(file, "color1", VehicleInfo[killerid][colora]);
  2073. dini_IntSet(file, "color2", VehicleInfo[killerid][colorb]);
  2074. }
  2075. SetVehicleToRespawn(vehicleid);
  2076. return 1;
  2077. }
  2078.  
  2079. stock IsACar(vehicleid)
  2080. {
  2081. switch(GetVehicleModel(vehicleid))
  2082. {
  2083. case 400,401,402,403,404,405,406,407,408,409,410,411,412,413,414,415,416,417,
  2084. 418,419,420,421,422,423,424,426,427,428,429,431,432,433,434,435,436,437,438,
  2085. 439,440,442,443,444,445,451,455,456,458,459,466,467,470,474,475,477,478,479,
  2086. 480,482,483,486,489,490,491,492,494,495,496,498,499,500,502,503,504,505,506,
  2087. 507,508,514,515,516,517,518,524,525,526,527,528,529,533,534,535,536,540,541,
  2088. 542,543,544,545,546,547,549,550,551,552,554,555,556,557,558,559,560,561,562,
  2089. 565,566,567,568,573,575,576,578,579,580,582,585,587,588, 589,596,597,598,599,
  2090. 600,601,602,603,604,605,609: return 1;
  2091. }
  2092. return 1;
  2093. }
  2094.  
  2095. public SaveTrunk(playerid)
  2096. {
  2097. if(IsPlayerConnected(playerid))
  2098. {
  2099. if(gPlayerHasCar[playerid] == 1)
  2100. {
  2101. new string[32];
  2102. new playername[MAX_PLAYER_NAME];
  2103. GetPlayerName(playerid, playername, sizeof(playername));
  2104. format(string, sizeof(string), "Carros/PortaMalas/%s.sav", playername);
  2105. new File: hFile = fopen(string, io_write);
  2106. if(hFile)
  2107. {
  2108. new var[64];
  2109. format(var, 32, "Slot1=%i\n", TrunkInfo[Vehicle[playerid]][Slot1]);
  2110. fwrite(hFile, var);
  2111. format(var, 32, "Slot2=%i\n", TrunkInfo[Vehicle[playerid]][Slot2]);
  2112. fwrite(hFile, var);
  2113. format(var, 32, "Slot3=%i\n", TrunkInfo[Vehicle[playerid]][Slot3]);
  2114. fwrite(hFile, var);
  2115. format(var, 32, "Slot4=%i\n", TrunkInfo[Vehicle[playerid]][Slot4]);
  2116. fwrite(hFile, var);
  2117. format(var, 32, "Slot5=%i\n", TrunkInfo[Vehicle[playerid]][Slot5]);
  2118. fwrite(hFile, var);
  2119. format(var, 32, "Slot6=%i\n", TrunkInfo[Vehicle[playerid]][Slot6]);
  2120. fwrite(hFile, var);
  2121. format(var, 32, "Slot7=%i\n", TrunkInfo[Vehicle[playerid]][Slot7]);
  2122. fwrite(hFile, var);
  2123. format(var, 32, "Slot8=%i\n", TrunkInfo[Vehicle[playerid]][Slot8]);
  2124. fwrite(hFile, var);
  2125. format(var, 32, "Slot9=%i\n", TrunkInfo[Vehicle[playerid]][Slot9]);
  2126. fwrite(hFile, var);
  2127. format(var, 32, "Slot10=%i\n", TrunkInfo[Vehicle[playerid]][Slot10]);
  2128. fwrite(hFile, var);
  2129. format(var, 32, "Ammo1=%i\n", TrunkInfo[Vehicle[playerid]][Ammo1]);
  2130. fwrite(hFile, var);
  2131. format(var, 32, "Ammo2=%i\n", TrunkInfo[Vehicle[playerid]][Ammo2]);
  2132. fwrite(hFile, var);
  2133. format(var, 32, "Ammo3=%i\n", TrunkInfo[Vehicle[playerid]][Ammo3]);
  2134. fwrite(hFile, var);
  2135. format(var, 32, "Ammo4=%i\n", TrunkInfo[Vehicle[playerid]][Ammo4]);
  2136. fwrite(hFile, var);
  2137. format(var, 32, "Ammo5=%i\n", TrunkInfo[Vehicle[playerid]][Ammo5]);
  2138. fwrite(hFile, var);
  2139. format(var, 32, "Ammo6=%i\n", TrunkInfo[Vehicle[playerid]][Ammo6]);
  2140. fwrite(hFile, var);
  2141. format(var, 32, "Ammo7=%i\n", TrunkInfo[Vehicle[playerid]][Ammo7]);
  2142. fwrite(hFile, var);
  2143. format(var, 32, "Ammo8=%i\n", TrunkInfo[Vehicle[playerid]][Ammo8]);
  2144. fwrite(hFile, var);
  2145. format(var, 32, "Ammo9=%i\n", TrunkInfo[Vehicle[playerid]][Ammo9]);
  2146. fwrite(hFile, var);
  2147. format(var, 32, "Ammo10=%i\n", TrunkInfo[Vehicle[playerid]][Ammo10]);
  2148. fwrite(hFile, var);
  2149. fclose(hFile);
  2150. }
  2151. }
  2152. }
  2153. return 1;
  2154. }
  2155.  
  2156. public LoadTrunk(playerid)
  2157. {
  2158. new string[128], Playername[24];
  2159. GetPlayerName(playerid, Playername, 24);
  2160. format(string, sizeof(string), "Carros/PortaMalas/%s.sav", Playername);
  2161. new File: UserFile = fopen(string, io_read);
  2162. if(UserFile)
  2163. {
  2164. new key[256], val[256], Data[256];
  2165. while(fread(UserFile, Data, sizeof(Data)))
  2166. {
  2167. key = ini_GetKey(Data);
  2168. if( strcmp( key , "Slot1" , true ) == 0 )
  2169. {
  2170. val = ini_GetValue(Data);
  2171. TrunkInfo[Vehicle[playerid]][Slot1] = strval(val);
  2172. }
  2173. if( strcmp( key , "Slot2" , true ) == 0 )
  2174. {
  2175. val = ini_GetValue(Data);
  2176. TrunkInfo[Vehicle[playerid]][Slot2] = strval(val);
  2177. }
  2178. if( strcmp( key , "Slot3" , true ) == 0 )
  2179. {
  2180. val = ini_GetValue(Data);
  2181. TrunkInfo[Vehicle[playerid]][Slot3] = strval(val);
  2182. }
  2183. if( strcmp( key , "Slot4" , true ) == 0 )
  2184. {
  2185. val = ini_GetValue(Data);
  2186. TrunkInfo[Vehicle[playerid]][Slot4] = strval(val);
  2187. }
  2188. if( strcmp( key , "Slot5" , true ) == 0 )
  2189. {
  2190. val = ini_GetValue(Data);
  2191. TrunkInfo[Vehicle[playerid]][Slot5] = strval(val);
  2192. }
  2193. if( strcmp( key , "Slot6" , true ) == 0 )
  2194. {
  2195. val = ini_GetValue(Data);
  2196. TrunkInfo[Vehicle[playerid]][Slot6] = strval(val);
  2197. }
  2198. if( strcmp( key , "Slot7" , true ) == 0 )
  2199. {
  2200. val = ini_GetValue(Data);
  2201. TrunkInfo[Vehicle[playerid]][Slot7] = strval(val);
  2202. }
  2203. if( strcmp( key , "Slot8" , true ) == 0 )
  2204. {
  2205. val = ini_GetValue(Data);
  2206. TrunkInfo[Vehicle[playerid]][Slot8] = strval(val);
  2207. }
  2208. if( strcmp( key , "Slot9" , true ) == 0 )
  2209. {
  2210. val = ini_GetValue(Data);
  2211. TrunkInfo[Vehicle[playerid]][Slot9] = strval(val);
  2212. }
  2213. if( strcmp( key , "Slot10" , true ) == 0 )
  2214. {
  2215. val = ini_GetValue(Data);
  2216. TrunkInfo[Vehicle[playerid]][Slot10] = strval(val);
  2217. }
  2218. if( strcmp( key , "Ammo1" , true ) == 0 )
  2219. {
  2220. val = ini_GetValue(Data);
  2221. TrunkInfo[Vehicle[playerid]][Ammo1] = strval(val);
  2222. }
  2223. if( strcmp( key , "Ammo2" , true ) == 0 )
  2224. {
  2225. val = ini_GetValue(Data);
  2226. TrunkInfo[Vehicle[playerid]][Ammo2] = strval(val);
  2227. }
  2228. if( strcmp( key , "Ammo3" , true ) == 0 )
  2229. {
  2230. val = ini_GetValue(Data);
  2231. TrunkInfo[Vehicle[playerid]][Ammo3] = strval(val);
  2232. }
  2233. if( strcmp( key , "Ammo4" , true ) == 0 )
  2234. {
  2235. val = ini_GetValue(Data);
  2236. TrunkInfo[Vehicle[playerid]][Ammo4] = strval(val);
  2237. }
  2238. if( strcmp( key , "Ammo5" , true ) == 0 )
  2239. {
  2240. val = ini_GetValue(Data);
  2241. TrunkInfo[Vehicle[playerid]][Ammo5] = strval(val);
  2242. }
  2243. if( strcmp( key , "Ammo6" , true ) == 0 )
  2244. {
  2245. val = ini_GetValue(Data);
  2246. TrunkInfo[Vehicle[playerid]][Ammo6] = strval(val);
  2247. }
  2248. if( strcmp( key , "Ammo7" , true ) == 0 )
  2249. {
  2250. val = ini_GetValue(Data);
  2251. TrunkInfo[Vehicle[playerid]][Ammo7] = strval(val);
  2252. }
  2253. if( strcmp( key , "Ammo8" , true ) == 0 )
  2254. {
  2255. val = ini_GetValue(Data);
  2256. TrunkInfo[Vehicle[playerid]][Ammo8] = strval(val);
  2257. }
  2258. if( strcmp( key , "Ammo9" , true ) == 0 )
  2259. {
  2260. val = ini_GetValue(Data);
  2261. TrunkInfo[Vehicle[playerid]][Ammo9] = strval(val);
  2262. }
  2263. if( strcmp( key , "Ammo10" , true ) == 0 )
  2264. {
  2265. val = ini_GetValue(Data);
  2266. TrunkInfo[Vehicle[playerid]][Ammo10] = strval(val);
  2267. }
  2268. }
  2269. fclose(UserFile);
  2270. }
  2271. return 1;
  2272. }
  2273.  
  2274. public RemovePlayerWeapon(playerid, weaponid)
  2275. {
  2276. new plyWeapons[12] = 0;
  2277. new plyAmmo[12] = 0;
  2278. for(new slot = 0; slot != 12; slot++)
  2279. {
  2280. new wep, ammo;
  2281. GetPlayerWeaponData(playerid, slot, wep, ammo);
  2282.  
  2283. if(wep != weaponid && ammo != 0)
  2284. {
  2285. GetPlayerWeaponData(playerid, slot, plyWeapons[slot], plyAmmo[slot]);
  2286. }
  2287. }
  2288. ResetPlayerWeapons(playerid);
  2289. for(new slot = 0; slot != 12; slot++)
  2290. {
  2291. if(plyAmmo[slot] != 0)
  2292. {
  2293. GivePlayerWeapon(playerid, plyWeapons[slot], plyAmmo[slot]);
  2294. }
  2295. }
  2296. return 1;
  2297. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement