Advertisement
Guest User

masini

a guest
Jun 26th, 2014
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 112.42 KB | None | 0 0
  1. //===========================Section: Includes==================================
  2. #include <a_samp>
  3. #include <utils>
  4. //===========================Section: Definations===============================
  5. #define COLOR_GRAD1 0xB4B5B7FF
  6. #define COLOR_GRAD2 0xBFC0C2FF
  7. #define COLOR_GRAD3 0xCBCCCEFF
  8. #define COLOR_GRAD4 0xD8D8D8FF
  9. #define COLOR_GRAD5 0xE3E3E3FF
  10. #define COLOR_GRAD6 0xF0F0F0FF
  11. #define COLOR_GREEN 0x33AA33AA
  12. #define COLOR_GREY 0xAFAFAFAA
  13. #define COLOR_WHITE 0xFFFFFFAA
  14. #define COLOR_YELLOW 0xFFFF00AA
  15. #define COLOR_YELLOW2 0xF5DEB3AA
  16. #define COLOR_BLUE 0x2641FEAA
  17.  
  18. #define DIALOGID 9999
  19. //===========================Section: Forwards==================================
  20. forward split(const strsrc[], strdest[][], delimiter);
  21. forward LoadCar();
  22. forward SaveCarCoords();
  23. forward LoadComponents(vehicleid);
  24. forward OnPropUpdate();
  25. forward PlayerPlayMusic(playerid);
  26. forward IsAnOwnableCar(vehicleid);
  27. forward IsAtDealership(playerid);
  28. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  29. forward CarMods(vehicleid);
  30.  
  31. forward CarKeys(playerid);
  32. forward SavePlayerData(playerid);
  33. forward ini_GetKey( line[] );
  34. forward ini_GetValue( line[] );
  35.  
  36. new carsonserver = 921;
  37. //===========================Section: Variables=================================
  38.  
  39. enum pInfo
  40. {
  41. pPcarkey,
  42. pPcarkey2,
  43. pPcarkey3,
  44. pAdmin,
  45. }
  46. new PlayerInfo[256][pInfo];
  47.  
  48. enum cInfo
  49. {
  50. cModel,
  51. Float:cLocationx,
  52. Float:cLocationy,
  53. Float:cLocationz,
  54. Float:cAngle,
  55. cColorOne,
  56. cColorTwo,
  57. cOwner[MAX_PLAYER_NAME],
  58. cDescription[12],
  59. cValue,
  60. cLicense[14],
  61. cRegistration,
  62. cOwned,
  63. cLock,
  64. mod1,
  65. mod2,
  66. mod3,
  67. mod4,
  68. mod5,
  69. mod6,
  70. mod7,
  71. mod8,
  72. mod9,
  73. mod10,
  74. mod11,
  75. mod12,
  76. mod13,
  77. mod14,
  78. mod15,
  79. mod16,
  80. mod17,
  81. paintjob,
  82. };
  83.  
  84. new CarInfo[1000][cInfo];
  85.  
  86. new spoiler[20][0] = {
  87. {1000},
  88. {1001},
  89. {1002},
  90. {1003},
  91. {1014},
  92. {1015},
  93. {1016},
  94. {1023},
  95. {1058},
  96. {1060},
  97. {1049},
  98. {1050},
  99. {1138},
  100. {1139},
  101. {1146},
  102. {1147},
  103. {1158},
  104. {1162},
  105. {1163},
  106. {1164}
  107. };
  108.  
  109. new nitro[3][0] = {
  110. {1008},
  111. {1009},
  112. {1010}
  113. };
  114.  
  115. new fbumper[23][0] = {
  116. {1117},
  117. {1152},
  118. {1153},
  119. {1155},
  120. {1157},
  121. {1160},
  122. {1165},
  123. {1167},
  124. {1169},
  125. {1170},
  126. {1171},
  127. {1172},
  128. {1173},
  129. {1174},
  130. {1175},
  131. {1179},
  132. {1181},
  133. {1182},
  134. {1185},
  135. {1188},
  136. {1189},
  137. {1192},
  138. {1193}
  139. };
  140.  
  141. new rbumper[22][0] = {
  142. {1140},
  143. {1141},
  144. {1148},
  145. {1149},
  146. {1150},
  147. {1151},
  148. {1154},
  149. {1156},
  150. {1159},
  151. {1161},
  152. {1166},
  153. {1168},
  154. {1176},
  155. {1177},
  156. {1178},
  157. {1180},
  158. {1183},
  159. {1184},
  160. {1186},
  161. {1187},
  162. {1190},
  163. {1191}
  164. };
  165.  
  166. new exhaust[28][0] = {
  167. {1018},
  168. {1019},
  169. {1020},
  170. {1021},
  171. {1022},
  172. {1028},
  173. {1029},
  174. {1037},
  175. {1043},
  176. {1044},
  177. {1045},
  178. {1046},
  179. {1059},
  180. {1064},
  181. {1065},
  182. {1066},
  183. {1089},
  184. {1092},
  185. {1104},
  186. {1105},
  187. {1113},
  188. {1114},
  189. {1126},
  190. {1127},
  191. {1129},
  192. {1132},
  193. {1135},
  194. {1136}
  195. };
  196.  
  197. new bventr[2][0] = {
  198. {1042},
  199. {1044}
  200. };
  201.  
  202. new bventl[2][0] = {
  203. {1043},
  204. {1045}
  205. };
  206.  
  207. new bscoop[4][0] = {
  208. {1004},
  209. {1005},
  210. {1011},
  211. {1012}
  212. };
  213.  
  214. new rscoop[13][0] = {
  215. {1006},
  216. {1032},
  217. {1033},
  218. {1035},
  219. {1038},
  220. {1053},
  221. {1054},
  222. {1055},
  223. {1061},
  224. {1067},
  225. {1068},
  226. {1088},
  227. {1091}
  228. };
  229.  
  230. new lskirt[21][0] = {
  231. {1007},
  232. {1026},
  233. {1031},
  234. {1036},
  235. {1039},
  236. {1042},
  237. {1047},
  238. {1048},
  239. {1056},
  240. {1057},
  241. {1069},
  242. {1070},
  243. {1090},
  244. {1093},
  245. {1106},
  246. {1108},
  247. {1118},
  248. {1119},
  249. {1133},
  250. {1122},
  251. {1134}
  252. };
  253.  
  254. new rskirt[21][0] = {
  255. {1017},
  256. {1027},
  257. {1030},
  258. {1040},
  259. {1041},
  260. {1051},
  261. {1052},
  262. {1062},
  263. {1063},
  264. {1071},
  265. {1072},
  266. {1094},
  267. {1095},
  268. {1099},
  269. {1101},
  270. {1102},
  271. {1107},
  272. {1120},
  273. {1121},
  274. {1124},
  275. {1137}
  276. };
  277.  
  278. new hydraulics[1][0] = {
  279. {1087}
  280. };
  281.  
  282. new base[1][0] = {
  283. {1086}
  284. };
  285.  
  286. new rbbars[2][0] = {
  287. {1109},
  288. {1110}
  289. };
  290.  
  291. new fbbars[2][0] = {
  292. {1115},
  293. {1116}
  294. };
  295.  
  296. new wheels[17][0] = {
  297. {1025},
  298. {1073},
  299. {1074},
  300. {1075},
  301. {1076},
  302. {1077},
  303. {1078},
  304. {1079},
  305. {1080},
  306. {1081},
  307. {1082},
  308. {1083},
  309. {1084},
  310. {1085},
  311. {1096},
  312. {1097},
  313. {1098}
  314. };
  315.  
  316. new light[2][0] = {
  317. {1013},
  318. {1024}
  319. };
  320.  
  321. InitComponents(componentid)
  322. {
  323. new i;
  324. for(i=0; i<20; i++)
  325. {
  326. if(spoiler[i][0]==componentid) { return 1; }
  327. }
  328. for(i=0; i<3; i++)
  329. {
  330. if(nitro[i][0]==componentid) { return 2; }
  331. }
  332. for(i=0; i<23; i++)
  333. {
  334. if(fbumper[i][0]==componentid) { return 3; }
  335. }
  336. for(i=0; i<22; i++)
  337. {
  338. if(rbumper[i][0]==componentid) { return 4; }
  339. }
  340. for(i=0; i<28; i++)
  341. {
  342. if(exhaust[i][0]==componentid) { return 5; }
  343. }
  344. for(i=0; i<2; i++)
  345. {
  346. if(bventr[i][0]==componentid) { return 6; }
  347. }
  348. for(i=0; i<2; i++)
  349. {
  350. if(bventl[i][0]==componentid) { return 7; }
  351. }
  352. for(i=0; i<4; i++)
  353. {
  354. if(bscoop[i][0]==componentid) { return 8; }
  355. }
  356. for(i=0; i<13; i++)
  357. {
  358. if(rscoop[i][0]==componentid) { return 9; }
  359. }
  360. for(i=0; i<21; i++)
  361. {
  362. if(lskirt[i][0]==componentid) { return 10; }
  363. }
  364. for(i=0; i<21; i++)
  365. {
  366. if(rskirt[i][0]==componentid) { return 11; }
  367. }
  368. if(hydraulics[0][0]==componentid) { return 12; }
  369. if(base[0][0]==componentid) { return 13; }
  370. for(i=0; i<2; i++)
  371. {
  372. if(rbbars[i][0]==componentid) { return 14; }
  373. }
  374. for(i=0; i<2; i++)
  375. {
  376. if(fbbars[i][0]==componentid) { return 15; }
  377. }
  378. for(i=0; i<17; i++)
  379. {
  380. if(wheels[i][0]==componentid) { return 16; }
  381. }
  382. for(i=0; i<2; i++)
  383. {
  384. if(light[i][0]==componentid) { return 17; }
  385. }
  386. return 0;
  387. }
  388.  
  389. //===========================Section: strtok & split============================
  390. strtok(const string[], &index)
  391. {
  392. new length = strlen(string);
  393. while ((index < length) && (string[index] <= ' '))
  394. {
  395. index++;
  396. }
  397.  
  398. new offset = index;
  399. new result[20];
  400. while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  401. {
  402. result[index - offset] = string[index];
  403. index++;
  404. }
  405. result[index - offset] = EOS;
  406. return result;
  407. }
  408.  
  409. public split(const strsrc[], strdest[][], delimiter)
  410. {
  411. new i, li;
  412. new aNum;
  413. new len;
  414. while(i <= strlen(strsrc)){
  415. if(strsrc[i]==delimiter || i==strlen(strsrc)){
  416. len = strmid(strdest[aNum], strsrc, li, i, 128);
  417. strdest[aNum][len] = 0;
  418. li = i+1;
  419. aNum++;
  420. }
  421. i++;
  422. }
  423. return 1;
  424. }
  425. //===========================Section: Callbacks & Functions=====================
  426. public OnFilterScriptInit()
  427. {
  428. printf("Filterscript carownership.amx Initiated\n");
  429. LoadCar();
  430.  
  431. for(new h = carsonserver; h < sizeof(CarInfo); h++)
  432. {
  433. AddStaticVehicleEx(CarInfo[h][cModel],CarInfo[h][cLocationx],CarInfo[h][cLocationy],CarInfo[h][cLocationz]+1.0,CarInfo[h][cAngle],CarInfo[h][cColorOne],CarInfo[h][cColorTwo],60000);
  434. LoadComponents(h);
  435. }
  436. return 1;
  437. }
  438.  
  439. public OnFilterScriptExit() { return 1; }
  440.  
  441. public SavePlayerData(playerid)
  442. {
  443. if(IsPlayerConnected(playerid))
  444. {
  445. new string3[32];
  446. new playername3[MAX_PLAYER_NAME];
  447. GetPlayerName(playerid, playername3, sizeof(playername3));
  448. format(string3, sizeof(string3), "carkeys/%s.ini", playername3);
  449. new File: hFile = fopen(string3, io_write);
  450. if (hFile)
  451. {
  452. new var[32];
  453. format(var, 32, "CarKey=%d\n",PlayerInfo[playerid][pPcarkey]);fwrite(hFile, var);
  454. format(var, 32, "CarKey2=%d\n",PlayerInfo[playerid][pPcarkey2]);fwrite(hFile, var);
  455. format(var, 32, "CarKey3=%d\n",PlayerInfo[playerid][pPcarkey3]);fwrite(hFile, var);
  456. fclose(hFile);
  457. }
  458. }
  459. return 1;
  460. }
  461.  
  462. public CarKeys(playerid)
  463. {
  464. new string2[64];
  465. new playername2[MAX_PLAYER_NAME];
  466. GetPlayerName(playerid, playername2, sizeof(playername2));
  467. format(string2, sizeof(string2), "carkeys/%s.ini", playername2);
  468. new File: UserFile = fopen(string2, io_read);
  469. if ( UserFile )
  470. {
  471. new key[ 256 ] , val[ 256 ];
  472. new Data[ 256 ];
  473. while ( fread( UserFile , Data , sizeof( Data ) ) )
  474. {
  475. key = ini_GetKey( Data );
  476. if( strcmp( key , "CarKey" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey] = strval( val ); }
  477. if( strcmp( key , "CarKey2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey2] = strval( val ); }
  478. if( strcmp( key , "CarKey3" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerInfo[playerid][pPcarkey3] = strval( val ); }
  479. }
  480. fclose(UserFile);
  481. SendClientMessage(playerid, COLOR_WHITE,"Car Keys Loaded!!!");
  482. }
  483. return 1;
  484. }
  485.  
  486. public CarMods(vehicleid)
  487. {
  488. if(CarInfo[vehicleid][paintjob] > -1 || CarInfo[vehicleid][mod1] > 0 || CarInfo[vehicleid][mod2] > 0 || CarInfo[vehicleid][mod3] > 0 || CarInfo[vehicleid][mod4] > 0 || CarInfo[vehicleid][mod5] > 0 || CarInfo[vehicleid][mod6] > 0 || CarInfo[vehicleid][mod7] > 0 || CarInfo[vehicleid][mod8] > 0)
  489. {
  490. return 1;
  491. }
  492. else if (CarInfo[vehicleid][mod9] > 0 || CarInfo[vehicleid][mod10] > 0 || CarInfo[vehicleid][mod11] > 0 || CarInfo[vehicleid][mod12] > 0|| CarInfo[vehicleid][mod13] > 0|| CarInfo[vehicleid][mod14] > 0|| CarInfo[vehicleid][mod15] > 0|| CarInfo[vehicleid][mod16] > 0|| CarInfo[vehicleid][mod17] > 0)
  493. {
  494. return 1;
  495. }
  496. return 0;
  497. }
  498.  
  499. public IsAtDealership(playerid)
  500. {
  501. if(IsPlayerConnected(playerid))
  502. {
  503. if(PlayerToPoint(25.0,playerid,2128.0864,-1135.3912,25.5855) || PlayerToPoint(50,playerid,537.3366,-1293.2140,17.2422) || PlayerToPoint(35,playerid,2521.5544,-1524.4504,23.8365) || PlayerToPoint(50,playerid,2155.0146,-1177.3333,23.8211) || PlayerToPoint(50,playerid,299.1723,-1518.6627,24.6007))
  504. {
  505. return 1;
  506. }
  507. }
  508. return 0;
  509. }
  510.  
  511. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  512. {
  513. if(IsPlayerConnected(playerid))
  514. {
  515. new Float:oldposx, Float:oldposy, Float:oldposz;
  516. new Float:tempposx, Float:tempposy, Float:tempposz;
  517. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  518. tempposx = (oldposx -x);
  519. tempposy = (oldposy -y);
  520. tempposz = (oldposz -z);
  521. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  522. {
  523. return 1;
  524. }
  525. }
  526. return 0;
  527. }
  528.  
  529. public OnVehicleMod(playerid,vehicleid,componentid)
  530. {
  531. new mods = InitComponents(componentid);
  532. if(IsPlayerInVehicle(playerid, vehicleid))
  533. {
  534. switch(mods)
  535. {
  536. case 1: { CarInfo[vehicleid][mod1] = componentid; }
  537. case 2: { CarInfo[vehicleid][mod2] = componentid; }
  538. case 3: { CarInfo[vehicleid][mod3] = componentid; }
  539. case 4: { CarInfo[vehicleid][mod4] = componentid; }
  540. case 5: { CarInfo[vehicleid][mod5] = componentid; }
  541. case 6: { CarInfo[vehicleid][mod6] = componentid; }
  542. case 7: { CarInfo[vehicleid][mod7] = componentid; }
  543. case 8: { CarInfo[vehicleid][mod8] = componentid; }
  544. case 9: { CarInfo[vehicleid][mod9] = componentid; }
  545. case 10: { CarInfo[vehicleid][mod10] = componentid; }
  546. case 11: { CarInfo[vehicleid][mod11] = componentid; }
  547. case 12: { CarInfo[vehicleid][mod12] = componentid; }
  548. case 13: { CarInfo[vehicleid][mod13] = componentid; }
  549. case 14: { CarInfo[vehicleid][mod14] = componentid; }
  550. case 15: { CarInfo[vehicleid][mod15] = componentid; }
  551. case 16: { CarInfo[vehicleid][mod16] = componentid; }
  552. case 17: { CarInfo[vehicleid][mod17] = componentid; }
  553. }
  554. }
  555. return 1;
  556. }
  557.  
  558. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  559. {
  560. if(IsPlayerInVehicle(playerid, vehicleid))
  561. {
  562. if(GetVehicleModel(vehicleid) == 483)
  563. {
  564. switch(paintjobid)
  565. {
  566. case 0: CarInfo[vehicleid][paintjob] = 0;
  567. }
  568. }
  569. if(GetVehicleModel(vehicleid) == 534)
  570. {
  571. switch(paintjobid)
  572. {
  573. case 0: CarInfo[vehicleid][paintjob] = 0;
  574. case 1: CarInfo[vehicleid][paintjob] = 1;
  575. case 2: CarInfo[vehicleid][paintjob] = 2;
  576. }
  577. }
  578. if(GetVehicleModel(vehicleid) == 535)
  579. {
  580. switch(paintjobid)
  581. {
  582. case 0: CarInfo[vehicleid][paintjob] = 0;
  583. case 1: CarInfo[vehicleid][paintjob] = 1;
  584. case 2: CarInfo[vehicleid][paintjob] = 2;
  585. }
  586. }
  587. if(GetVehicleModel(vehicleid) == 536)
  588. {
  589. switch(paintjobid)
  590. {
  591. case 0: CarInfo[vehicleid][paintjob] = 0;
  592. case 1: CarInfo[vehicleid][paintjob] = 1;
  593. case 2: CarInfo[vehicleid][paintjob] = 2;
  594. }
  595. }
  596. if(GetVehicleModel(vehicleid) == 558)
  597. {
  598. switch(paintjobid)
  599. {
  600. case 0: CarInfo[vehicleid][paintjob] = 0;
  601. case 1: CarInfo[vehicleid][paintjob] = 1;
  602. case 2: CarInfo[vehicleid][paintjob] = 2;
  603. }
  604. }
  605. if(GetVehicleModel(vehicleid) == 559)
  606. {
  607. switch(paintjobid)
  608. {
  609. case 0: CarInfo[vehicleid][paintjob] = 0;
  610. case 1: CarInfo[vehicleid][paintjob] = 1;
  611. case 2: CarInfo[vehicleid][paintjob] = 2;
  612. }
  613. }
  614. if(GetVehicleModel(vehicleid) == 560)
  615. {
  616. switch(paintjobid)
  617. {
  618. case 0: CarInfo[vehicleid][paintjob] = 0;
  619. case 1: CarInfo[vehicleid][paintjob] = 1;
  620. case 2: CarInfo[vehicleid][paintjob] = 2;
  621. }
  622. }
  623. if(GetVehicleModel(vehicleid) == 561)
  624. {
  625. switch(paintjobid)
  626. {
  627. case 0: CarInfo[vehicleid][paintjob] = 0;
  628. case 1: CarInfo[vehicleid][paintjob] = 1;
  629. case 2: CarInfo[vehicleid][paintjob] = 2;
  630. }
  631. }
  632. if(GetVehicleModel(vehicleid) == 562)
  633. {
  634. switch(paintjobid)
  635. {
  636. case 0: CarInfo[vehicleid][paintjob] = 0;
  637. case 1: CarInfo[vehicleid][paintjob] = 1;
  638. case 2: CarInfo[vehicleid][paintjob] = 2;
  639. }
  640. }
  641. if(GetVehicleModel(vehicleid) == 565)
  642. {
  643. switch(paintjobid)
  644. {
  645. case 0: CarInfo[vehicleid][paintjob] = 0;
  646. case 1: CarInfo[vehicleid][paintjob] = 1;
  647. case 2: CarInfo[vehicleid][paintjob] = 2;
  648. }
  649. }
  650. if(GetVehicleModel(vehicleid) == 567)
  651. {
  652. switch(paintjobid)
  653. {
  654. case 0: CarInfo[vehicleid][paintjob] = 0;
  655. case 1: CarInfo[vehicleid][paintjob] = 1;
  656. case 2: CarInfo[vehicleid][paintjob] = 2;
  657. }
  658. }
  659. if(GetVehicleModel(vehicleid) == 575)
  660. {
  661. switch(paintjobid)
  662. {
  663. case 0: CarInfo[vehicleid][paintjob] = 0;
  664. case 1: CarInfo[vehicleid][paintjob] = 1;
  665. }
  666. }
  667. if(GetVehicleModel(vehicleid) == 576)
  668. {
  669. switch(paintjobid)
  670. {
  671. case 0: CarInfo[vehicleid][paintjob] = 0;
  672. case 1: CarInfo[vehicleid][paintjob] = 1;
  673. case 2: CarInfo[vehicleid][paintjob] = 2;
  674. }
  675. }
  676. }
  677. return 1;
  678. }
  679.  
  680. public OnPropUpdate()
  681. {
  682. new idx;
  683. new File: file2;
  684. idx = carsonserver;
  685. while (idx < sizeof(CarInfo))
  686. {
  687. new coordsstring[256];
  688. format(coordsstring, sizeof(coordsstring), "%d,%f,%f,%f,%f,%d,%d,%s,%s,%d,%s,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",
  689. CarInfo[idx][cModel],
  690. CarInfo[idx][cLocationx],
  691. CarInfo[idx][cLocationy],
  692. CarInfo[idx][cLocationz],
  693. CarInfo[idx][cAngle],
  694. CarInfo[idx][cColorOne],
  695. CarInfo[idx][cColorTwo],
  696. CarInfo[idx][cOwner],
  697. CarInfo[idx][cDescription],
  698. CarInfo[idx][cValue],
  699. CarInfo[idx][cLicense],
  700. CarInfo[idx][cOwned],
  701. CarInfo[idx][cLock],
  702. CarInfo[idx][mod1],
  703. CarInfo[idx][mod2],
  704. CarInfo[idx][mod3],
  705. CarInfo[idx][mod4],
  706. CarInfo[idx][mod5],
  707. CarInfo[idx][mod6],
  708. CarInfo[idx][mod7],
  709. CarInfo[idx][mod8],
  710. CarInfo[idx][mod9],
  711. CarInfo[idx][mod10],
  712. CarInfo[idx][mod11],
  713. CarInfo[idx][mod12],
  714. CarInfo[idx][mod13],
  715. CarInfo[idx][mod14],
  716. CarInfo[idx][mod15],
  717. CarInfo[idx][mod16],
  718. CarInfo[idx][mod17],
  719. CarInfo[idx][paintjob]);
  720. if(idx == carsonserver)
  721. {
  722. file2 = fopen("masini.cfg", io_write);
  723. }
  724. else
  725. {
  726. file2 = fopen("masini.cfg", io_append);
  727. }
  728. fwrite(file2, coordsstring);
  729. idx++;
  730. fclose(file2);
  731. }
  732. return 1;
  733. }
  734.  
  735. public PlayerPlayMusic(playerid)
  736. {
  737. if(IsPlayerConnected(playerid))
  738. {
  739. SetTimer("StopMusic", 5000, 0);
  740. PlayerPlaySound(playerid, 1068, 0.0, 0.0, 0.0);
  741. }
  742. }
  743.  
  744. public IsAnOwnableCar(vehicleid)
  745. {
  746. if(vehicleid >= carsonserver && vehicleid <= 1000) { return 1; }
  747. return 0;
  748. }
  749.  
  750. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  751. {
  752. new sendername[MAX_PLAYER_NAME];
  753. new vehid;
  754. vehid = GetPlayerVehicleID(playerid);
  755. if(response)
  756. {
  757. if(dialogid == DIALOGID)
  758. {
  759. if(response)
  760. {
  761. if(listitem==0)
  762. {
  763. if (GetPlayerMoney(playerid) >= 100000)
  764. {
  765. GivePlayerMoney(playerid,-100000); //infernus
  766. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  767. new thiscar = CreateVehicle(411,X,Y,Z,1,0,0,99999999);
  768. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  769. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  770. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  771. else { return 1; }
  772. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 411; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  773. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  774. CarInfo[thiscar][cValue] = 90000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  775. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  776. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  777. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  778. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  779. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  780. format(CarInfo[thiscar][cDescription], 32, "Infernus"); OnPropUpdate(); SavePlayerData(playerid);
  781. }
  782. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  783. }
  784. if(listitem==1)
  785. {
  786. if (GetPlayerMoney(playerid) >= 90000)
  787. {
  788. GivePlayerMoney(playerid,-90000); //bullet
  789. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  790. new thiscar = CreateVehicle(541,X,Y,Z,1,0,0,99999999);
  791. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  792. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  793. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  794. else { return 1; }
  795. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 541; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  796. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  797. CarInfo[thiscar][cValue] = 90000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  798. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  799. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  800. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  801. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  802. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  803. format(CarInfo[thiscar][cDescription], 32, "Bullet"); OnPropUpdate(); SavePlayerData(playerid);
  804. }
  805. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  806. }
  807. if(listitem==2)
  808. {
  809. if (GetPlayerMoney(playerid) >= 85000)
  810. {
  811. GivePlayerMoney(playerid,-85000); //cheetah
  812. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  813. new thiscar = CreateVehicle(415,X,Y,Z,1,0,0,99999999);
  814. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  815. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  816. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  817. else { return 1; }
  818. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 415; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  819. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  820. CarInfo[thiscar][cValue] = 85000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  821. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  822. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  823. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  824. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  825. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  826. format(CarInfo[thiscar][cDescription], 32, "Cheetah"); OnPropUpdate(); SavePlayerData(playerid);
  827. }
  828. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  829. }
  830. if(listitem==3)
  831. {
  832. if (GetPlayerMoney(playerid) >= 98000)
  833. {
  834. GivePlayerMoney(playerid,-98000); //turismo
  835. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  836. new thiscar = CreateVehicle(451,X,Y,Z,1,0,0,99999999);
  837. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  838. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  839. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  840. else { return 1; }
  841. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 451; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  842. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  843. CarInfo[thiscar][cValue] = 98000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  844. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  845. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  846. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  847. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  848. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  849. format(CarInfo[thiscar][cDescription], 32, "Turismo"); OnPropUpdate(); SavePlayerData(playerid);
  850. }
  851. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  852. }
  853. if(listitem==4)
  854. {
  855. if (GetPlayerMoney(playerid) >= 94000)
  856. {
  857. GivePlayerMoney(playerid,-94000); //supergt
  858. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  859. new thiscar = CreateVehicle(506,X,Y,Z,1,0,0,99999999);
  860. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  861. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  862. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  863. else { return 1; }
  864. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 506; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  865. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  866. CarInfo[thiscar][cValue] = 94000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  867. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  868. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  869. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  870. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  871. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  872. format(CarInfo[thiscar][cDescription], 32, "Supergt"); OnPropUpdate(); SavePlayerData(playerid);
  873. }
  874. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  875. }
  876. if(listitem==5)
  877. {
  878. if (GetPlayerMoney(playerid) >= 82000)
  879. {
  880. GivePlayerMoney(playerid,-82000); //Banshee
  881. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  882. new thiscar = CreateVehicle(429,X,Y,Z,1,0,0,99999999);
  883. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  884. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  885. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  886. else { return 1; }
  887. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 429; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  888. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  889. CarInfo[thiscar][cValue] = 82000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  890. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  891. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  892. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  893. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  894. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  895. format(CarInfo[thiscar][cDescription], 32, "Banshee"); OnPropUpdate(); SavePlayerData(playerid);
  896. }
  897. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  898. }
  899. if(listitem==6)
  900. {
  901. if (GetPlayerMoney(playerid) >= 83000)
  902. {
  903. GivePlayerMoney(playerid,-83000); //ZR-350
  904. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  905. new thiscar = CreateVehicle(477,X,Y,Z,1,0,0,99999999);
  906. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  907. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  908. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  909. else { return 1; }
  910. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 477; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  911. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  912. CarInfo[thiscar][cValue] = 83000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  913. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  914. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  915. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  916. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  917. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  918. format(CarInfo[thiscar][cDescription], 32, "ZR-350"); OnPropUpdate(); SavePlayerData(playerid);
  919. }
  920. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  921. }
  922. if(listitem==7)
  923. {
  924. if (GetPlayerMoney(playerid) >= 80000)
  925. {
  926. GivePlayerMoney(playerid,-80000); //Elegy
  927. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  928. new thiscar = CreateVehicle(562,X,Y,Z,1,0,0,99999999);
  929. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  930. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  931. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  932. else { return 1; }
  933. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 562; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  934. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  935. CarInfo[thiscar][cValue] = 80000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  936. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  937. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  938. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  939. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  940. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  941. format(CarInfo[thiscar][cDescription], 32, "Elegy"); OnPropUpdate(); SavePlayerData(playerid);
  942. }
  943. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  944. }
  945. if(listitem==8)
  946. {
  947. if (GetPlayerMoney(playerid) >= 81000)
  948. {
  949. GivePlayerMoney(playerid,-81000); //Jester
  950. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  951. new thiscar = CreateVehicle(559,X,Y,Z,1,0,0,99999999);
  952. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  953. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  954. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  955. else { return 1; }
  956. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 559; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  957. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  958. CarInfo[thiscar][cValue] = 81000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  959. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  960. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  961. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  962. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  963. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  964. format(CarInfo[thiscar][cDescription], 32, "Jester"); OnPropUpdate(); SavePlayerData(playerid);
  965. }
  966. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  967. }
  968. if(listitem==9)
  969. {
  970. if (GetPlayerMoney(playerid) >= 83000)
  971. {
  972. GivePlayerMoney(playerid,-83000); //Sultan
  973. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  974. new thiscar = CreateVehicle(560,X,Y,Z,1,0,0,99999999);
  975. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  976. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  977. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  978. else { return 1; }
  979. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 560; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  980. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  981. CarInfo[thiscar][cValue] = 83000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  982. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  983. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  984. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  985. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  986. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  987. format(CarInfo[thiscar][cDescription], 32, "Sultan"); OnPropUpdate(); SavePlayerData(playerid);
  988. }
  989. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  990. }
  991. if(listitem==10)
  992. {
  993. if (GetPlayerMoney(playerid) >= 79000)
  994. {
  995. GivePlayerMoney(playerid,-79000); //Uranus
  996. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  997. new thiscar = CreateVehicle(558,X,Y,Z,1,0,0,99999999);
  998. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  999. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1000. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1001. else { return 1; }
  1002. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 558; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1003. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1004. CarInfo[thiscar][cValue] = 79000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1005. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1006. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1007. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1008. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1009. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1010. format(CarInfo[thiscar][cDescription], 32, "Uranus"); OnPropUpdate(); SavePlayerData(playerid);
  1011. }
  1012. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1013. }
  1014. if(listitem==11)
  1015. {
  1016. if (GetPlayerMoney(playerid) >= 75000)
  1017. {
  1018. GivePlayerMoney(playerid,-75000); //Flash
  1019. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1020. new thiscar = CreateVehicle(565,X,Y,Z,1,0,0,99999999);
  1021. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1022. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1023. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1024. else { return 1; }
  1025. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 565; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1026. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1027. CarInfo[thiscar][cValue] = 75000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1028. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1029. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1030. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1031. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1032. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1033. format(CarInfo[thiscar][cDescription], 32, "Flash"); OnPropUpdate(); SavePlayerData(playerid);
  1034. }
  1035. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1036. }
  1037. if(listitem==12)
  1038. {
  1039. if (GetPlayerMoney(playerid) >= 70000)
  1040. {
  1041. GivePlayerMoney(playerid,-70000); //Stratum
  1042. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1043. new thiscar = CreateVehicle(561,X,Y,Z,1,0,0,99999999);
  1044. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1045. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1046. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1047. else { return 1; }
  1048. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 561; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1049. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1050. CarInfo[thiscar][cValue] = 70000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1051. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1052. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1053. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1054. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1055. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1056. format(CarInfo[thiscar][cDescription], 32, "Stratum"); OnPropUpdate(); SavePlayerData(playerid);
  1057. }
  1058. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1059. }
  1060. if(listitem==13)
  1061. {
  1062. if (GetPlayerMoney(playerid) >= 68000)
  1063. {
  1064. GivePlayerMoney(playerid,-68000); //Alpha
  1065. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1066. new thiscar = CreateVehicle(602,X,Y,Z,1,0,0,99999999);
  1067. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1068. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1069. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1070. else { return 1; }
  1071. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 602; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1072. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1073. CarInfo[thiscar][cValue] = 68000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1074. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1075. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1076. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1077. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1078. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1079. format(CarInfo[thiscar][cDescription], 32, "Alpha"); OnPropUpdate(); SavePlayerData(playerid);
  1080. }
  1081. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1082. }
  1083. if(listitem==14)
  1084. {
  1085. SendClientMessage(playerid, COLOR_WHITE,"Ai accesat pagina 2!!");
  1086. ShowPlayerDialog(playerid, DIALOGID+1, DIALOG_STYLE_LIST, "Lista Masini 2", "Phoenix 65.000$\nBuffalo 69.000$\nEuros 62.000$\nClub 60.000$\nSabre 42.000$\nSlamvan 58.000$\nRemington 57.000$\nTahoma 51.000$\nVoodoo 54.000$\nBlade 56.000$\nSavanna 55.000$\nClover 24.000$\nStallion 32.000$\nComet 31.000$\nBurrito 30.000$\n<<<Inapoi","Cumpara", "Cancel");
  1087. }
  1088. }
  1089. }
  1090. if(dialogid == DIALOGID+1)
  1091. {
  1092. if(response)
  1093. {
  1094. if(listitem==0)
  1095. {
  1096. if (GetPlayerMoney(playerid) >= 65000)
  1097. {
  1098. GivePlayerMoney(playerid,-65000); //Phoenix
  1099. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1100. new thiscar = CreateVehicle(603,X,Y,Z,1,0,0,99999999);
  1101. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1102. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1103. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1104. else { return 1; }
  1105. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 603; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1106. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1107. CarInfo[thiscar][cValue] = 65000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1108. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1109. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1110. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1111. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1112. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1113. format(CarInfo[thiscar][cDescription], 32, "Phoenix"); OnPropUpdate(); SavePlayerData(playerid);
  1114. }
  1115. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1116. }
  1117. if(listitem==1)
  1118. {
  1119. if (GetPlayerMoney(playerid) >= 69000)
  1120. {
  1121. GivePlayerMoney(playerid,-69000); //Buffalo
  1122. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1123. new thiscar = CreateVehicle(402,X,Y,Z,1,0,0,99999999);
  1124. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1125. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1126. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1127. else { return 1; }
  1128. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 402; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1129. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1130. CarInfo[thiscar][cValue] = 69000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1131. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1132. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1133. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1134. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1135. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1136. format(CarInfo[thiscar][cDescription], 32, "Buffalo"); OnPropUpdate(); SavePlayerData(playerid);
  1137. }
  1138. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1139. }
  1140. if(listitem==2)
  1141. {
  1142. if (GetPlayerMoney(playerid) >= 62000)
  1143. {
  1144. GivePlayerMoney(playerid,-62000); //Euros
  1145. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1146. new thiscar = CreateVehicle(587,X,Y,Z,1,0,0,99999999);
  1147. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1148. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1149. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1150. else { return 1; }
  1151. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 587; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1152. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1153. CarInfo[thiscar][cValue] = 62000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1154. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1155. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1156. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1157. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1158. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1159. format(CarInfo[thiscar][cDescription], 32, "Euros"); OnPropUpdate(); SavePlayerData(playerid);
  1160. }
  1161. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1162. }
  1163. if(listitem==3)
  1164. {
  1165. if (GetPlayerMoney(playerid) >= 60000)
  1166. {
  1167. GivePlayerMoney(playerid,-60000); //Club
  1168. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1169. new thiscar = CreateVehicle(589,X,Y,Z,1,0,0,99999999);
  1170. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1171. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1172. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1173. else { return 1; }
  1174. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 589; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1175. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1176. CarInfo[thiscar][cValue] = 60000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1177. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1178. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1179. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1180. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1181. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1182. format(CarInfo[thiscar][cDescription], 32, "Club"); OnPropUpdate(); SavePlayerData(playerid);
  1183. }
  1184. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1185. }
  1186. if(listitem==4)
  1187. {
  1188. if (GetPlayerMoney(playerid) >= 42000)
  1189. {
  1190. GivePlayerMoney(playerid,-42000); //Sabre
  1191. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1192. new thiscar = CreateVehicle(475,X,Y,Z,1,0,0,99999999);
  1193. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1194. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1195. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1196. else { return 1; }
  1197. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 475; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1198. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1199. CarInfo[thiscar][cValue] = 42000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1200. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1201. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1202. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1203. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1204. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1205. format(CarInfo[thiscar][cDescription], 32, "Sabre"); OnPropUpdate(); SavePlayerData(playerid);
  1206. }
  1207. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1208. }
  1209. if(listitem==5)
  1210. {
  1211. if (GetPlayerMoney(playerid) >= 58000)
  1212. {
  1213. GivePlayerMoney(playerid,-58000); //Slamvan
  1214. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1215. new thiscar = CreateVehicle(535,X,Y,Z,1,0,0,99999999);
  1216. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1217. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1218. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1219. else { return 1; }
  1220. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 535; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1221. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1222. CarInfo[thiscar][cValue] = 58000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1223. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1224. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1225. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1226. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1227. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1228. format(CarInfo[thiscar][cDescription], 32, "Slamvan"); OnPropUpdate(); SavePlayerData(playerid);
  1229. }
  1230. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1231. }
  1232. if(listitem==6)
  1233. {
  1234. if (GetPlayerMoney(playerid) >= 57000)
  1235. {
  1236. GivePlayerMoney(playerid,-57000); //Remington
  1237. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1238. new thiscar = CreateVehicle(534,X,Y,Z,1,0,0,99999999);
  1239. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1240. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1241. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1242. else { return 1; }
  1243. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 534; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1244. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1245. CarInfo[thiscar][cValue] = 57000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1246. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1247. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1248. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1249. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1250. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1251. format(CarInfo[thiscar][cDescription], 32, "Remington"); OnPropUpdate(); SavePlayerData(playerid);
  1252. }
  1253. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1254. }
  1255. if(listitem==7)
  1256. {
  1257. if (GetPlayerMoney(playerid) >= 51000)
  1258. {
  1259. GivePlayerMoney(playerid,-51000); //Tahoma
  1260. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1261. new thiscar = CreateVehicle(566,X,Y,Z,1,0,0,99999999);
  1262. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1263. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1264. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1265. else { return 1; }
  1266. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 566; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1267. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1268. CarInfo[thiscar][cValue] = 51000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1269. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1270. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1271. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1272. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1273. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1274. format(CarInfo[thiscar][cDescription], 32, "Tahoma"); OnPropUpdate(); SavePlayerData(playerid);
  1275. }
  1276. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1277. }
  1278. if(listitem==8)
  1279. {
  1280. if (GetPlayerMoney(playerid) >= 54000)
  1281. {
  1282. GivePlayerMoney(playerid,-54000); //Voodoo
  1283. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1284. new thiscar = CreateVehicle(412,X,Y,Z,1,0,0,99999999);
  1285. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1286. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1287. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1288. else { return 1; }
  1289. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 412; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1290. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1291. CarInfo[thiscar][cValue] = 54000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1292. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1293. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1294. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1295. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1296. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1297. format(CarInfo[thiscar][cDescription], 32, "Voodoo"); OnPropUpdate(); SavePlayerData(playerid);
  1298. }
  1299. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1300. }
  1301. if(listitem==9)
  1302. {
  1303. if (GetPlayerMoney(playerid) >= 56000)
  1304. {
  1305. GivePlayerMoney(playerid,-56000); //Blade
  1306. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1307. new thiscar = CreateVehicle(536,X,Y,Z,1,0,0,99999999);
  1308. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1309. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1310. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1311. else { return 1; }
  1312. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 536; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1313. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1314. CarInfo[thiscar][cValue] = 56000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1315. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1316. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1317. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1318. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1319. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1320. format(CarInfo[thiscar][cDescription], 32, "Tahoma"); OnPropUpdate(); SavePlayerData(playerid);
  1321. }
  1322. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1323. }
  1324. if(listitem==10)
  1325. {
  1326. if (GetPlayerMoney(playerid) >= 55000)
  1327. {
  1328. GivePlayerMoney(playerid,-55000); //Savanna
  1329. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1330. new thiscar = CreateVehicle(567,X,Y,Z,1,0,0,99999999);
  1331. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1332. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1333. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1334. else { return 1; }
  1335. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 567; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1336. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1337. CarInfo[thiscar][cValue] = 55000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1338. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1339. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1340. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1341. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1342. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1343. format(CarInfo[thiscar][cDescription], 32, "Savanna"); OnPropUpdate(); SavePlayerData(playerid);
  1344. }
  1345. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1346. }
  1347. if(listitem==11)
  1348. {
  1349. if (GetPlayerMoney(playerid) >= 24000)
  1350. {
  1351. GivePlayerMoney(playerid,-24000); //Clover
  1352. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1353. new thiscar = CreateVehicle(542,X,Y,Z,1,0,0,99999999);
  1354. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1355. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1356. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1357. else { return 1; }
  1358. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 542; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1359. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1360. CarInfo[thiscar][cValue] = 24000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1361. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1362. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1363. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1364. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1365. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1366. format(CarInfo[thiscar][cDescription], 32, "Clover"); OnPropUpdate(); SavePlayerData(playerid);
  1367. }
  1368. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1369. }
  1370. if(listitem==12)
  1371. {
  1372. if (GetPlayerMoney(playerid) >= 32000)
  1373. {
  1374. GivePlayerMoney(playerid,-32000); //Stallion
  1375. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1376. new thiscar = CreateVehicle(439,X,Y,Z,1,0,0,99999999);
  1377. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1378. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1379. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1380. else { return 1; }
  1381. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 439; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1382. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1383. CarInfo[thiscar][cValue] = 32000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1384. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1385. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1386. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1387. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1388. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1389. format(CarInfo[thiscar][cDescription], 32, "Stallion"); OnPropUpdate(); SavePlayerData(playerid);
  1390. }
  1391. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1392. }
  1393. if(listitem==13)
  1394. {
  1395. if (GetPlayerMoney(playerid) >= 31000)
  1396. {
  1397. GivePlayerMoney(playerid,-31000); //Comet
  1398. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1399. new thiscar = CreateVehicle(480,X,Y,Z,1,0,0,99999999);
  1400. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1401. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1402. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1403. else { return 1; }
  1404. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 480; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1405. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1406. CarInfo[thiscar][cValue] = 31000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1407. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1408. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1409. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1410. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1411. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1412. format(CarInfo[thiscar][cDescription], 32, "Comet"); OnPropUpdate(); SavePlayerData(playerid);
  1413. }
  1414. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1415. }
  1416. if(listitem==14)
  1417. {
  1418. if (GetPlayerMoney(playerid) >= 30000)
  1419. {
  1420. GivePlayerMoney(playerid,-30000); //Burrito
  1421. new Float:X,Float:Y,Float:Z; GetPlayerPos(playerid, X,Y,Z);
  1422. new thiscar = CreateVehicle(482,X,Y,Z,1,0,0,99999999);
  1423. if(PlayerInfo[playerid][pPcarkey] == -1) { PlayerInfo[playerid][pPcarkey] = thiscar; }
  1424. else if(PlayerInfo[playerid][pPcarkey2] == -1) { PlayerInfo[playerid][pPcarkey2] = thiscar; }
  1425. else if(PlayerInfo[playerid][pPcarkey3] == -1) { PlayerInfo[playerid][pPcarkey3] = thiscar; }
  1426. else { return 1; }
  1427. CarInfo[thiscar][cOwned] = 1; CarInfo[thiscar][cModel] = 482; CarInfo[thiscar][cColorOne] = 0; CarInfo[thiscar][cColorTwo] = 0;
  1428. CarInfo[thiscar][cLocationx] = X; CarInfo[thiscar][cLocationy] = Y; CarInfo[thiscar][cLocationz] = Z; CarInfo[thiscar][cAngle] = 1;
  1429. CarInfo[thiscar][cValue] = 30000; CarInfo[thiscar][cLock] = 0; CarInfo[thiscar][paintjob] = -1;
  1430. PutPlayerInVehicle(playerid,thiscar,0); GetPlayerName(playerid, sendername, sizeof(sendername));
  1431. strmid(CarInfo[thiscar][cOwner], sendername, 0, strlen(sendername), 999); PlayerPlayMusic(playerid);
  1432. GameTextForPlayer(playerid, "~w~Felicitari~n~Nu uita sa o parchezi cu /v park!", 5000, 3);
  1433. SendClientMessage(playerid, COLOR_GRAD2, "Felicitari ti-ai cumparat o masina noua!");
  1434. SendClientMessage(playerid, COLOR_GRAD2, "Scrie /vehiclehelp pentru manualul masini!");
  1435. format(CarInfo[thiscar][cDescription], 32, "Burrito"); OnPropUpdate(); SavePlayerData(playerid);
  1436. }
  1437. else { SendClientMessage(playerid, COLOR_WHITE, " Nu ai suficienti bani pentru a cumpara masina aceasta !"); }
  1438. }
  1439. if(listitem==15)
  1440. {
  1441. SendClientMessage(playerid, COLOR_WHITE,"Ai accesat pagina 1 !!");
  1442. ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Lista Masini", "Infernus 100.000$\nBullet 90.000$\nCheetah 85.000$\nTurismo 98.000$\nSupergt 94.000$\nBanshee 82.000$\nZR-350 83.000$\nElegy 80.000$\nJester 81.000$\nSultan 83.000$\nUranus 79.000$\nFlash 75.000$\nStratum 70.000$\nAlpha 68.000$ \nLista Urmatoare>>>","Cumpara", "Cancel");
  1443. }
  1444. }
  1445. }
  1446. if(dialogid == DIALOGID+2)
  1447. {
  1448. if(response)
  1449. {
  1450. if(listitem==0)
  1451. {
  1452. if(CarInfo[vehid][mod1] > 0)
  1453. {
  1454. new Float:XX,Float:YY,Float:ZZ; new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
  1455. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1456. GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
  1457. GetVehiclePos(vehid,XX,YY,ZZ); CarInfo[vehid][mod1] = 0;
  1458. SetVehicleToRespawn(vehid); SetVehiclePos(vehid,XX,YY,ZZ);
  1459. PutPlayerInVehicle(playerid,vehid,0); SetVehicleHealth(vehid, OldCarHP);
  1460. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1461. SendClientMessage(playerid, COLOR_BLUE,"* Eleronul a fost scos cu succes!!!");
  1462. LoadComponents(vehid); OnPropUpdate(); SavePlayerData(playerid);
  1463. }
  1464. else
  1465. {
  1466. SendClientMessage(playerid, COLOR_WHITE,"* Masina ta nu are Eleron Instalat!!!");
  1467. }
  1468. }
  1469. if(listitem==1)
  1470. {
  1471. if(CarInfo[vehid][mod3] > 0)
  1472. {
  1473. new Float:XX,Float:YY,Float:ZZ,Float:CarHP,Float:OldCarHP; new panels,doors,lights,tires;
  1474. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1475. GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
  1476. GetVehiclePos(vehid,XX,YY,ZZ); CarInfo[vehid][mod3] = 0;
  1477. SetVehicleToRespawn(vehid); SetVehiclePos(vehid,XX,YY,ZZ);
  1478. PutPlayerInVehicle(playerid,vehid,0); SetVehicleHealth(vehid, OldCarHP);
  1479. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1480. SendClientMessage(playerid, COLOR_BLUE,"* Spoilerul din fata a fost scos cu succes!!!");
  1481. LoadComponents(vehid); OnPropUpdate(); SavePlayerData(playerid);
  1482. }
  1483. else
  1484. {
  1485. SendClientMessage(playerid, COLOR_WHITE,"* Masina ta nu are Spoilerul din fata Instalat!!!");
  1486. }
  1487. }
  1488. if(listitem==2)
  1489. {
  1490. if(CarInfo[vehid][mod4] > 0)
  1491. {
  1492. new Float:XX,Float:YY,Float:ZZ; new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
  1493. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1494. GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
  1495. GetVehiclePos(vehid,XX,YY,ZZ); CarInfo[vehid][mod4] = 0;
  1496. SetVehicleToRespawn(vehid); SetVehiclePos(vehid,XX,YY,ZZ);
  1497. PutPlayerInVehicle(playerid,vehid,0); SetVehicleHealth(vehid, OldCarHP);
  1498. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1499. SendClientMessage(playerid, COLOR_BLUE,"* Spoilerul din spate a fost scos cu succes!!!");
  1500. LoadComponents(vehid); OnPropUpdate(); SavePlayerData(playerid);
  1501. }
  1502. else
  1503. {
  1504. SendClientMessage(playerid, COLOR_WHITE,"* Masina ta nu are Spoilerul din spate Instalat!!!");
  1505. }
  1506. }
  1507. if(listitem==3)
  1508. {
  1509. if(CarInfo[vehid][mod10] > 0 && CarInfo[vehid][mod11] > 0)
  1510. {
  1511. new Float:XX,Float:YY,Float:ZZ; new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
  1512. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1513. GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
  1514. GetVehiclePos(vehid,XX,YY,ZZ); CarInfo[vehid][mod11] = 0; CarInfo[vehid][mod10] = 0;
  1515. SetVehicleToRespawn(vehid); SetVehiclePos(vehid,XX,YY,ZZ);
  1516. PutPlayerInVehicle(playerid,vehid,0); SetVehicleHealth(vehid, OldCarHP);
  1517. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1518. SendClientMessage(playerid, COLOR_BLUE,"* Lateralele au fost scoase cu succes!!!");
  1519. LoadComponents(vehid); OnPropUpdate(); SavePlayerData(playerid);
  1520. }
  1521. else
  1522. {
  1523. SendClientMessage(playerid, COLOR_WHITE,"* Masina ta nu are Laterale Instalate!!!");
  1524. }
  1525. }
  1526. if(listitem==4)
  1527. {
  1528. if(CarInfo[vehid][mod9] > 0)
  1529. {
  1530. new Float:XX,Float:YY,Float:ZZ; new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
  1531. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1532. GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
  1533. GetVehiclePos(vehid,XX,YY,ZZ); CarInfo[vehid][mod9] = 0;
  1534. SetVehicleToRespawn(vehid); SetVehiclePos(vehid,XX,YY,ZZ);
  1535. PutPlayerInVehicle(playerid,vehid,0); SetVehicleHealth(vehid, OldCarHP);
  1536. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1537. SendClientMessage(playerid, COLOR_BLUE,"* Roof Scoops au fost scoase cu succes!!!");
  1538. LoadComponents(vehid); OnPropUpdate(); SavePlayerData(playerid);
  1539. }
  1540. else
  1541. {
  1542. SendClientMessage(playerid, COLOR_WHITE,"* Masina ta nu are Roof Scoops Instalat!!!");
  1543. }
  1544. }
  1545. if(listitem==5)
  1546. {
  1547. if(CarInfo[vehid][mod5] > 0)
  1548. {
  1549. new Float:XX,Float:YY,Float:ZZ; new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
  1550. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1551. GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
  1552. GetVehiclePos(vehid,XX,YY,ZZ); CarInfo[vehid][mod5] = 0;
  1553. SetVehicleToRespawn(vehid); SetVehiclePos(vehid,XX,YY,ZZ);
  1554. PutPlayerInVehicle(playerid,vehid,0); SetVehicleHealth(vehid, OldCarHP);
  1555. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1556. SendClientMessage(playerid, COLOR_BLUE,"* Tobele de Esapament au fost scoase cu succes!!!");
  1557. LoadComponents(vehid); OnPropUpdate(); SavePlayerData(playerid);
  1558. }
  1559. else
  1560. {
  1561. SendClientMessage(playerid, COLOR_WHITE,"* Masina ta nu are Tobe de Esapament Instalate!!!");
  1562. }
  1563. }
  1564. if(listitem==6)
  1565. {
  1566. if(CarInfo[vehid][mod2] > 0)
  1567. {
  1568. new Float:XX,Float:YY,Float:ZZ; new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
  1569. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1570. GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
  1571. GetVehiclePos(vehid,XX,YY,ZZ); CarInfo[vehid][mod2] = 0;
  1572. SetVehicleToRespawn(vehid); SetVehiclePos(vehid,XX,YY,ZZ);
  1573. PutPlayerInVehicle(playerid,vehid,0); SetVehicleHealth(vehid, OldCarHP);
  1574. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1575. SendClientMessage(playerid, COLOR_BLUE,"* Nitro a fost scos cu succes!!!");
  1576. LoadComponents(vehid); OnPropUpdate(); SavePlayerData(playerid);
  1577. }
  1578. else
  1579. {
  1580. SendClientMessage(playerid, COLOR_WHITE,"* Masina ta nu are Nitro Instalat!!!");
  1581. }
  1582. }
  1583. if(listitem==7)
  1584. {
  1585. if(CarInfo[vehid][mod12] > 0)
  1586. {
  1587. new Float:XX,Float:YY,Float:ZZ; new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
  1588. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1589. GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
  1590. GetVehiclePos(vehid,XX,YY,ZZ); CarInfo[vehid][mod12] = 0;
  1591. SetVehicleToRespawn(vehid); SetVehiclePos(vehid,XX,YY,ZZ);
  1592. PutPlayerInVehicle(playerid,vehid,0); SetVehicleHealth(vehid, OldCarHP);
  1593. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1594. SendClientMessage(playerid, COLOR_BLUE,"* Hidraulica a fost scoasa cu succes!!!");
  1595. LoadComponents(vehid); OnPropUpdate(); SavePlayerData(playerid);
  1596. }
  1597. else
  1598. {
  1599. SendClientMessage(playerid, COLOR_WHITE,"* Masina ta nu are Hidraulica Instalata!!!");
  1600. }
  1601. }
  1602. if(listitem==8)
  1603. {
  1604. if(CarInfo[vehid][mod16] > 0)
  1605. {
  1606. new Float:XX,Float:YY,Float:ZZ; new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
  1607. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1608. GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
  1609. GetVehiclePos(vehid,XX,YY,ZZ); CarInfo[vehid][mod16] = 0;
  1610. SetVehicleToRespawn(vehid); SetVehiclePos(vehid,XX,YY,ZZ);
  1611. PutPlayerInVehicle(playerid,vehid,0); SetVehicleHealth(vehid, OldCarHP);
  1612. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1613. SendClientMessage(playerid, COLOR_BLUE,"* Rotile au fost scoase cu succes!!!");
  1614. LoadComponents(vehid); OnPropUpdate(); SavePlayerData(playerid);
  1615. }
  1616. else
  1617. {
  1618. SendClientMessage(playerid, COLOR_WHITE,"* Masina ta nu are Roti Instalate!!!");
  1619. }
  1620. }
  1621. if(listitem==9)
  1622. {
  1623. if(CarInfo[vehid][paintjob] > -1)
  1624. {
  1625. new Float:XX,Float:YY,Float:ZZ; new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
  1626. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1627. GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
  1628. GetVehiclePos(vehid,XX,YY,ZZ); CarInfo[vehid][paintjob] = -1;
  1629. SetVehicleToRespawn(vehid); SetVehiclePos(vehid,XX,YY,ZZ);
  1630. PutPlayerInVehicle(playerid,vehid,0); SetVehicleHealth(vehid, OldCarHP);
  1631. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1632. SendClientMessage(playerid, COLOR_BLUE,"* Tatuajul a fost indepartat cu succes!!!");
  1633. LoadComponents(vehid); OnPropUpdate(); SavePlayerData(playerid);
  1634. }
  1635. else
  1636. {
  1637. SendClientMessage(playerid, COLOR_WHITE,"* Masina ta nu are Tatuaj!!!");
  1638. }
  1639. }
  1640. if(listitem==10)
  1641. {
  1642. if(CarMods(vehid))
  1643. {
  1644. new Float:XX,Float:YY,Float:ZZ; new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
  1645. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1646. GetVehicleHealth(vehid, CarHP); OldCarHP = CarHP;
  1647. GetVehiclePos(vehid,XX,YY,ZZ); CarInfo[vehid][paintjob] = -1; CarInfo[vehid][mod1] = 0; CarInfo[vehid][mod2] = 0;
  1648. CarInfo[vehid][mod3] = 0; CarInfo[vehid][mod4] = 0; CarInfo[vehid][mod5] = 0; CarInfo[vehid][mod6] = 0; CarInfo[vehid][mod7] = 0;
  1649. CarInfo[vehid][mod8] = 0; CarInfo[vehid][mod9] = 0; CarInfo[vehid][mod10] = 0; CarInfo[vehid][mod11] = 0; CarInfo[vehid][mod12] = 0;
  1650. CarInfo[vehid][mod13] = 0; CarInfo[vehid][mod14] = 0; CarInfo[vehid][mod15] = 0; CarInfo[vehid][mod16] = 0; CarInfo[vehid][mod17] = 0;
  1651. SetVehicleToRespawn(vehid); SetVehiclePos(vehid,XX,YY,ZZ);
  1652. PutPlayerInVehicle(playerid,vehid,0); SetVehicleHealth(vehid, OldCarHP);
  1653. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  1654. SendClientMessage(playerid, COLOR_BLUE,"* Tuningul a fost indepartat cu succes!!!");
  1655. LoadComponents(vehid); OnPropUpdate(); SavePlayerData(playerid);
  1656. }
  1657. else
  1658. {
  1659. SendClientMessage(playerid, COLOR_WHITE,"* Masina ta nu este Tunata!!!");
  1660. }
  1661. }
  1662. }
  1663. }
  1664. }
  1665. else
  1666. {
  1667. SendClientMessage(playerid, COLOR_WHITE,"* Dialog has been hidden");
  1668. }
  1669. return 1;
  1670. }
  1671.  
  1672. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  1673. {
  1674. if(IsAnOwnableCar(vehicleid) && CarInfo[vehicleid][cLock] == 1 && CarInfo[vehicleid][cOwned] == 1)
  1675. {
  1676. new Float:cx, Float:cy, Float:cz;
  1677. GetPlayerPos(playerid, cx, cy, cz);
  1678. SetPlayerPos(playerid, cx, cy, cz);
  1679. }
  1680. return 1;
  1681. }
  1682.  
  1683. public OnVehicleSpawn(vehicleid)
  1684. {
  1685. LoadComponents(vehicleid);
  1686. return 1;
  1687. }
  1688.  
  1689. public LoadComponents(vehicleid)
  1690. {
  1691. if(CarInfo[vehicleid][cOwned] == 1)
  1692. {
  1693. if(CarInfo[vehicleid][mod1] >= 1000 && CarInfo[vehicleid][mod1] <= 1193)
  1694. {
  1695. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod1])) != CarInfo[vehicleid][mod1]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod1]); }
  1696. }
  1697. if(CarInfo[vehicleid][mod2] >= 1000 && CarInfo[vehicleid][mod2] <= 1193)
  1698. {
  1699. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod2])) != CarInfo[vehicleid][mod2]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod2]); }
  1700. }
  1701. if(CarInfo[vehicleid][mod3] >= 1000 && CarInfo[vehicleid][mod3] <= 1193)
  1702. {
  1703. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod3])) != CarInfo[vehicleid][mod3]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod3]); }
  1704. }
  1705. if(CarInfo[vehicleid][mod4] >= 1000 && CarInfo[vehicleid][mod4] <= 1193)
  1706. {
  1707. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod4])) != CarInfo[vehicleid][mod4]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod4]); }
  1708. }
  1709. if(CarInfo[vehicleid][mod5] >= 1000 && CarInfo[vehicleid][mod5] <= 1193)
  1710. {
  1711. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod5])) != CarInfo[vehicleid][mod5]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod5]); }
  1712. }
  1713. if(CarInfo[vehicleid][mod6] >= 1000 && CarInfo[vehicleid][mod6] <= 1193)
  1714. {
  1715. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod6])) != CarInfo[vehicleid][mod6]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod6]); }
  1716. }
  1717. if(CarInfo[vehicleid][mod7] >= 1000 && CarInfo[vehicleid][mod7] <= 1193)
  1718. {
  1719. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod7])) != CarInfo[vehicleid][mod7]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod7]); }
  1720. }
  1721. if(CarInfo[vehicleid][mod8] >= 1000 && CarInfo[vehicleid][mod8] <= 1193)
  1722. {
  1723. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod8])) != CarInfo[vehicleid][mod8]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod8]); }
  1724. }
  1725. if(CarInfo[vehicleid][mod9] >= 1000 && CarInfo[vehicleid][mod9] <= 1193)
  1726. {
  1727. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod9])) != CarInfo[vehicleid][mod9]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod9]); }
  1728. }
  1729. if(CarInfo[vehicleid][mod10] >= 1000 && CarInfo[vehicleid][mod10] <= 1193)
  1730. {
  1731. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod10])) != CarInfo[vehicleid][mod10]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod10]); }
  1732. }
  1733. if(CarInfo[vehicleid][mod11] >= 1000 && CarInfo[vehicleid][mod11] <= 1193)
  1734. {
  1735. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod11])) != CarInfo[vehicleid][mod11]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod11]); }
  1736. }
  1737. if(CarInfo[vehicleid][mod12] >= 1000 && CarInfo[vehicleid][mod12] <= 1193)
  1738. {
  1739. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod12])) != CarInfo[vehicleid][mod12]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod12]); }
  1740. }
  1741. if(CarInfo[vehicleid][mod13] >= 1000 && CarInfo[vehicleid][mod13] <= 1193)
  1742. {
  1743. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod13])) != CarInfo[vehicleid][mod13]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod13]); }
  1744. }
  1745. if(CarInfo[vehicleid][mod14] >= 1000 && CarInfo[vehicleid][mod14] <= 1193)
  1746. {
  1747. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod14])) != CarInfo[vehicleid][mod14]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod14]); }
  1748. }
  1749. if(CarInfo[vehicleid][mod15] >= 1000 && CarInfo[vehicleid][mod15] <= 1193)
  1750. {
  1751. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod15])) != CarInfo[vehicleid][mod15]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod15]); }
  1752. }
  1753. if(CarInfo[vehicleid][mod16] >= 1000 && CarInfo[vehicleid][mod16] <= 1193)
  1754. {
  1755. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod16])) != CarInfo[vehicleid][mod16]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod16]); }
  1756. }
  1757. if(CarInfo[vehicleid][mod17] >= 1000 && CarInfo[vehicleid][mod17] <= 1193)
  1758. {
  1759. if(GetVehicleComponentInSlot(vehicleid,GetVehicleComponentType(CarInfo[vehicleid][mod17])) != CarInfo[vehicleid][mod17]) { AddVehicleComponent(vehicleid,CarInfo[vehicleid][mod17]); }
  1760. }
  1761. if(CarInfo[vehicleid][paintjob] > -1) { ChangeVehiclePaintjob(vehicleid,CarInfo[vehicleid][paintjob]); ChangeVehicleColor(vehicleid, 1, 1); }
  1762. else { ChangeVehicleColor(vehicleid, CarInfo[vehicleid][cColorOne], CarInfo[vehicleid][cColorTwo]); }
  1763. if(CarInfo[vehicleid][cLicense] > 0) { SetVehicleNumberPlate(vehicleid,CarInfo[vehicleid][cLicense]); }
  1764. }
  1765. return 1;
  1766. }
  1767.  
  1768. public OnPlayerSpawn(playerid)
  1769. {
  1770. CarKeys(playerid);
  1771. return 1;
  1772. }
  1773.  
  1774. public OnPlayerConnect(playerid)
  1775. {
  1776. PlayerInfo[playerid][pPcarkey] = -1;
  1777. PlayerInfo[playerid][pPcarkey2] = -1;
  1778. PlayerInfo[playerid][pPcarkey3] = -1;
  1779. for(new h = carsonserver; h < sizeof(CarInfo); h++)
  1780. {
  1781. SetVehicleParamsForPlayer(h,playerid,0,CarInfo[h][cLock]);
  1782. }
  1783. return 1;
  1784. }
  1785.  
  1786. public OnPlayerCommandText(playerid, cmdtext[])
  1787. {
  1788. new idx;
  1789. new string[256];
  1790. new cmd[256];
  1791. new tmp[256];
  1792. new sendername[MAX_PLAYER_NAME];
  1793. new playername[MAX_PLAYER_NAME];
  1794. new giveplayerid;
  1795. cmd = strtok(cmdtext, idx);
  1796. new vehid;
  1797. vehid = GetPlayerVehicleID(playerid);
  1798.  
  1799. if (strcmp(cmd, "/mycars", true) == 0)
  1800. {
  1801. if(IsPlayerConnected(playerid))
  1802. {
  1803. new carkey = PlayerInfo[playerid][pPcarkey];
  1804. new carkey2 = PlayerInfo[playerid][pPcarkey2];
  1805. new carkey3 = PlayerInfo[playerid][pPcarkey3];
  1806. if (PlayerInfo[playerid][pPcarkey] != -1)
  1807. {
  1808. format(string, sizeof(string), "1| VehModel:[%s] VehValue:[%d] VehColor1:[%d] VehColor2:[%d] VehLocked:[%d]", CarInfo[carkey][cDescription], CarInfo[carkey][cValue], CarInfo[carkey][cColorOne], CarInfo[carkey][cColorTwo], CarInfo[carkey][cLock]);
  1809. SendClientMessage(playerid, COLOR_GRAD5,string);
  1810. }
  1811. if (PlayerInfo[playerid][pPcarkey2] != -1)
  1812. {
  1813. format(string, sizeof(string), "2| VehModel:[%s] VehValue:[%d] VehColor1:[%d] VehColor2:[%d] VehLocked:[%d]", CarInfo[carkey2][cDescription], CarInfo[carkey2][cValue], CarInfo[carkey2][cColorOne], CarInfo[carkey2][cColorTwo], CarInfo[carkey2][cLock]);
  1814. SendClientMessage(playerid, COLOR_GRAD5,string);
  1815. }
  1816. if (PlayerInfo[playerid][pPcarkey3] != -1)
  1817. {
  1818. format(string, sizeof(string), "3| VehModel:[%s] VehValue:[%d] VehColor1:[%d] VehColor2:[%d] VehLocked:[%d]", CarInfo[carkey3][cDescription], CarInfo[carkey3][cValue], CarInfo[carkey3][cColorOne], CarInfo[carkey3][cColorTwo], CarInfo[carkey3][cLock]);
  1819. SendClientMessage(playerid, COLOR_GRAD5,string);
  1820. }
  1821. }
  1822. return 1;
  1823. }
  1824.  
  1825. if(strcmp(cmd, "/asetkey", true) == 0)
  1826. {
  1827. if(IsPlayerConnected(playerid))
  1828. {
  1829. tmp = strtok(cmdtext, idx);
  1830. if(!strlen(tmp))
  1831. {
  1832. SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /asetkey [playerid/PartOfName] [carkey] [amount]");
  1833. SendClientMessage(playerid, COLOR_GRAD4, "|1 CarKey |2 CarKey2 |3 CarKey3");
  1834. return 1;
  1835. }
  1836. giveplayerid = ReturnUser(tmp);
  1837. if(IsPlayerConnected(playerid))
  1838. {
  1839. if(giveplayerid != INVALID_PLAYER_ID)
  1840. {
  1841. tmp = strtok(cmdtext, idx);
  1842. if(!strlen(tmp))
  1843. {
  1844. SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /asetkey [playerid/PartOfName] [carkey] [amount]");
  1845. SendClientMessage(playerid, COLOR_GRAD4, "|1 CarKey |2 CarKey2 |3 CarKey3");
  1846. return 1;
  1847. }
  1848. new stat;
  1849. stat = strval(tmp);
  1850. tmp = strtok(cmdtext, idx);
  1851. if(!strlen(tmp))
  1852. {
  1853. SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /asetkey [playerid/PartOfName] [carkey] [amount]");
  1854. SendClientMessage(playerid, COLOR_GRAD4, "|1 CarKey |2 CarKey2 |3 CarKey3");
  1855. return 1;
  1856. }
  1857. new amount;
  1858. amount = strval(tmp);
  1859. switch (stat)
  1860. {
  1861. case 1:
  1862. {
  1863. PlayerInfo[giveplayerid][pPcarkey] = amount;
  1864. format(string, sizeof(string), " The Player Car Key Was Set To %d", amount);
  1865. SavePlayerData(playerid);
  1866. }
  1867. case 2:
  1868. {
  1869. PlayerInfo[giveplayerid][pPcarkey2] = amount;
  1870. format(string, sizeof(string), " The Player Car Key 2 Was Set To %d", amount);
  1871. SavePlayerData(playerid);
  1872. }
  1873. case 3:
  1874. {
  1875. PlayerInfo[giveplayerid][pPcarkey3] = amount;
  1876. format(string, sizeof(string), " The Player Car Key 3 Was Set To %d", amount);
  1877. SavePlayerData(playerid);
  1878. }
  1879. default:
  1880. {
  1881. format(string, sizeof(string), " Invalid Car Key Code", amount);
  1882. }
  1883. }
  1884. SendClientMessage(playerid, COLOR_GRAD1, string);
  1885. }
  1886. }
  1887. }
  1888. return 1;
  1889. }
  1890.  
  1891. if (strcmp(cmd, "/buycar", true) == 0)
  1892. {
  1893. if(IsPlayerConnected(playerid))
  1894. {
  1895. if(IsAtDealership(playerid))
  1896. {
  1897. if(PlayerInfo[playerid][pPcarkey] == -1) { } else if(PlayerInfo[playerid][pPcarkey2] == -1) { } else if(PlayerInfo[playerid][pPcarkey3] == -1) { } else { SendClientMessage(playerid, COLOR_GREY, " Ai deja 3 masini!!Daca vrei sa iti iei alta noua vinde 1 din masinile pe care le ai!"); return 1; }
  1898. ShowPlayerDialog(playerid, DIALOGID, DIALOG_STYLE_LIST, "Lista Masini", "Infernus 100.000$\nBullet 90.000$\nCheetah 85.000$\nTurismo 98.000$\nSupergt 94.000$\nBanshee 82.000$\nZR-350 83.000$\nElegy 80.000$\nJester 81.000$\nSultan 83.000$\nUranus 79.000$\nFlash 75.000$\nStratum 70.000$\nAlpha 68.000$ \nLista Urmatoare>>>","Cumpara", "Cancel");
  1899. }
  1900. else { SendClientMessage(playerid, COLOR_WHITE," Nu esti la Magazinul de Masini!!!"); }
  1901. }
  1902. return 1;
  1903. }
  1904.  
  1905. if(strcmp(cmd, "/removetuning", true) == 0)
  1906. {
  1907. if(IsPlayerInVehicle(playerid, vehid))
  1908. {
  1909. if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
  1910. {
  1911. ShowPlayerDialog(playerid, DIALOGID+2, DIALOG_STYLE_LIST, "Lista Tuning", "Eleron\nSpoiler Fata\nSpoiler Spate\nLaterale\nRoof\nToba Esapament\nNitro\nHidraulica\nRoti\nTatuaj\nToate Componentele","Scoate", "Cancel");
  1912. }
  1913. else
  1914. {
  1915. SendClientMessage(playerid, COLOR_WHITE, "Nu poti scoate tuningul pentru ca aceasta masina nu iti apartine.");
  1916. return 1;
  1917. }
  1918. }
  1919. else
  1920. {
  1921. SendClientMessage(playerid, COLOR_WHITE, "Trebuie sa fii in masina pentru a scoate tuningul!!");
  1922. return 1;
  1923. }
  1924. }
  1925.  
  1926. if(strcmp(cmd, "/v", true) == 0 || strcmp(cmd, "/vehicle", true) == 0)
  1927. {
  1928. if(IsPlayerConnected(playerid))
  1929. {
  1930. new x_nr[64];
  1931. x_nr = strtok(cmdtext, idx);
  1932. if(!strlen(x_nr))
  1933. {
  1934. SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
  1935. SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock(1-3), sell, color, setplate");
  1936. return 1;
  1937. }
  1938. if(strcmp(x_nr,"sell",true) == 0)
  1939. {
  1940. if(IsAtDealership(playerid))
  1941. {
  1942. if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2] || GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3])
  1943. {
  1944. GetPlayerName(playerid, sendername, sizeof(sendername));
  1945. new ownvehkey;
  1946. if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { ownvehkey = PlayerInfo[playerid][pPcarkey]; }
  1947. else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { ownvehkey = PlayerInfo[playerid][pPcarkey2]; }
  1948. else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { ownvehkey = PlayerInfo[playerid][pPcarkey3]; }
  1949. else { return 1; }
  1950. if(strcmp(sendername, CarInfo[ownvehkey][cOwner], true) == 0)
  1951. {
  1952. new carsellprice = CarInfo[ownvehkey][cValue] / 4 * 3;
  1953. CarInfo[ownvehkey][cOwned] = 0;
  1954. strmid(CarInfo[ownvehkey][cOwner], "0", 0, strlen("0"), -1);
  1955. GivePlayerMoney(playerid,carsellprice);
  1956. PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  1957. format(string, sizeof(string), "~w~You have sold your car for: ~n~~g~$%d", carsellprice);
  1958. GameTextForPlayer(playerid, string, 10000, 3);
  1959. CarInfo[ownvehkey][cOwned] = 0;
  1960. CarInfo[ownvehkey][cModel] = 0;
  1961. CarInfo[ownvehkey][cColorOne] = 0;
  1962. CarInfo[ownvehkey][cColorTwo] = 0;
  1963. CarInfo[ownvehkey][cLocationx] = 0;
  1964. CarInfo[ownvehkey][cLocationy] = 0;
  1965. CarInfo[ownvehkey][cLocationz] = 0;
  1966. CarInfo[ownvehkey][cAngle] = 0;
  1967. CarInfo[ownvehkey][cDescription] = 0;
  1968. CarInfo[ownvehkey][cValue] = 0;
  1969. CarInfo[ownvehkey][cLock] = 0;
  1970. CarInfo[ownvehkey][cLicense] = 0;
  1971. if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { PlayerInfo[playerid][pPcarkey] = -1; }
  1972. else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { PlayerInfo[playerid][pPcarkey2] = -1; }
  1973. else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { PlayerInfo[playerid][pPcarkey3] = -1; }
  1974. RemovePlayerFromVehicle(playerid);
  1975. TogglePlayerControllable(playerid, 1);
  1976. OnPropUpdate(); SavePlayerData(playerid);
  1977. DestroyVehicle(ownvehkey);
  1978. return 1;
  1979. }
  1980. }
  1981. else
  1982. {
  1983. SendClientMessage(playerid, COLOR_GREY, " You have to sit at your own car to sell it! ");
  1984. return 1;
  1985. }
  1986. }
  1987. else
  1988. {
  1989. SendClientMessage(playerid, COLOR_GREY, "You are not at a dealership");
  1990. return 1;
  1991. }
  1992. }
  1993. else if(strcmp(x_nr,"park",true) == 0)
  1994. {
  1995. new Float:x,Float:y,Float:z;
  1996. new Float:a;
  1997. new carid;
  1998. new getcarid;
  1999. if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { carid = PlayerInfo[playerid][pPcarkey]; }
  2000. else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { carid = PlayerInfo[playerid][pPcarkey2]; }
  2001. else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { carid = PlayerInfo[playerid][pPcarkey3]; }
  2002. else { return 1; }
  2003. getcarid = GetPlayerVehicleID(playerid);
  2004. GetPlayerName(playerid, playername, sizeof(playername));
  2005. GetVehiclePos(carid, x, y, z);
  2006. GetVehicleZAngle(carid, a);
  2007. if(IsPlayerInVehicle(playerid,carid) && CarInfo[carid][cOwned] == 1)
  2008. {
  2009. if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1 && PlayerInfo[playerid][pPcarkey3] == -1)
  2010. {
  2011. SendClientMessage(playerid, COLOR_GREY, "You don't own a car.");
  2012. return 1;
  2013. }
  2014. if(getcarid == carid)
  2015. {
  2016. new Float:CarHP, Float:OldCarHP; new panels,doors,lights,tires;
  2017. CarInfo[carid][cLocationx] = x;
  2018. CarInfo[carid][cLocationy] = y;
  2019. CarInfo[carid][cLocationz] = z;
  2020. CarInfo[carid][cAngle] = a;
  2021. GetVehicleDamageStatus(carid,panels,doors,lights,tires);
  2022. GetVehicleHealth(carid, CarHP); OldCarHP = CarHP;
  2023. format(string, sizeof(string), "~n~ You have parked your vehicle in this location. ~n~");
  2024. GameTextForPlayer(playerid, "You have parked your vehicle in this position. It will respawn here.", 10000, 3);
  2025. OnPropUpdate(); SavePlayerData(playerid); DestroyVehicle(carid);
  2026. CreateVehicle(CarInfo[carid][cModel],CarInfo[carid][cLocationx],CarInfo[carid][cLocationy],CarInfo[carid][cLocationz]+1.0,CarInfo[carid][cAngle],CarInfo[carid][cColorOne],CarInfo[carid][cColorTwo],60000);
  2027. LoadComponents(carid);
  2028. PutPlayerInVehicle(playerid,carid,0); SetVehicleHealth(carid, OldCarHP);
  2029. UpdateVehicleDamageStatus(carid,panels,doors,lights,tires);
  2030. TogglePlayerControllable(playerid, 1);
  2031. return 1;
  2032. }
  2033. }
  2034. }
  2035. else if(strcmp(x_nr,"setplate",true) == 0)
  2036. {
  2037. if(IsPlayerInVehicle(playerid, vehid) || PlayerInfo[vehid][pPcarkey] != -1 && PlayerInfo[vehid][pPcarkey2] != -1 && PlayerInfo[vehid][pPcarkey3] != -1)
  2038. {
  2039. if(cmdtext[idx++] != 32 || cmdtext[idx] == EOS)
  2040. {
  2041. SendClientMessage(playerid,0xFFFFFFAA,"USAGE: /v setplate [newplate]");
  2042. return 1;
  2043. }
  2044. new Float:XX,Float:YY,Float:ZZ,Float:AA;
  2045. new Float:CarHP, Float:OldCarHP;
  2046. new panels,doors,lights,tires;
  2047. GetVehicleHealth(vehid, CarHP);
  2048. GetVehicleDamageStatus(vehid,panels,doors,lights,tires);
  2049. OldCarHP = CarHP;
  2050. format(CarInfo[vehid][cLicense], 32 ,"%s",cmdtext[idx]);
  2051. SetVehicleNumberPlate(vehid,CarInfo[vehid][cLicense]);
  2052. GetVehiclePos(vehid,XX,YY,ZZ);
  2053. GetVehicleZAngle(vehid, AA);
  2054. SetVehicleToRespawn(vehid);
  2055. SetVehiclePos(vehid,XX,YY,ZZ);
  2056. SetVehicleZAngle(vehid, AA);
  2057. PutPlayerInVehicle(playerid,vehid,0);
  2058. SetVehicleHealth(vehid, OldCarHP);
  2059. UpdateVehicleDamageStatus(vehid,panels,doors,lights,tires);
  2060. format(string, sizeof(string), "{FFFF00}You have set your vehicle's plate to:{FFFFFF} %s", CarInfo[vehid][cLicense]);
  2061. SendClientMessage(playerid, 0xFFFFFFFF, string);
  2062. OnPropUpdate(); SavePlayerData(playerid);
  2063. }
  2064. else
  2065. {
  2066. SendClientMessage(playerid, 0xFFFFFFAA, "Nu esti in masina ta personala pentru a putea schimba NR de Inmatriculare.");
  2067. return 1;
  2068. }
  2069. }
  2070.  
  2071. else if(strcmp(x_nr,"lock1",true) == 0)
  2072. {
  2073. new keycar = PlayerInfo[playerid][pPcarkey];
  2074. if(keycar != -1)
  2075. {
  2076. new locked[256];
  2077. locked = strtok(cmdtext, idx);
  2078. if(CarInfo[keycar][cLock] == 1)
  2079. {
  2080. for(new i = 0; i < MAX_PLAYERS; i++)
  2081. {
  2082. if (IsPlayerConnected(i))
  2083. {
  2084. SetVehicleParamsForPlayer(keycar,i,0,0);
  2085. }
  2086. }
  2087. format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
  2088. GameTextForPlayer(playerid, string, 4000, 3);
  2089. CarInfo[keycar][cLock] = 0;
  2090. OnPropUpdate(); SavePlayerData(playerid);
  2091. return 1;
  2092. }
  2093. else if(CarInfo[keycar][cLock] == 0)
  2094. {
  2095. for(new i = 0; i < MAX_PLAYERS; i++)
  2096. {
  2097. if (IsPlayerConnected(i))
  2098. {
  2099. SetVehicleParamsForPlayer(keycar,i,0,1);
  2100. }
  2101. }
  2102. format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
  2103. GameTextForPlayer(playerid, string, 4000, 3);
  2104. CarInfo[keycar][cLock] = 1;
  2105. OnPropUpdate(); SavePlayerData(playerid);
  2106. return 1;
  2107. }
  2108. }
  2109. else
  2110. {
  2111. SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 1");
  2112. return 1;
  2113. }
  2114. }
  2115. else if(strcmp(x_nr,"lock2",true) == 0)
  2116. {
  2117. new keycar = PlayerInfo[playerid][pPcarkey2];
  2118. if(keycar != -1)
  2119. {
  2120. new locked[256];
  2121. locked = strtok(cmdtext, idx);
  2122. if(CarInfo[keycar][cLock] == 1)
  2123. {
  2124. for(new i = 0; i < MAX_PLAYERS; i++)
  2125. {
  2126. if (IsPlayerConnected(i))
  2127. {
  2128. SetVehicleParamsForPlayer(keycar,i,0,0);
  2129. }
  2130. }
  2131. format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
  2132. GameTextForPlayer(playerid, string, 4000, 3);
  2133. CarInfo[keycar][cLock] = 0;
  2134. OnPropUpdate(); SavePlayerData(playerid);
  2135. return 1;
  2136. }
  2137. else if(CarInfo[keycar][cLock] == 0)
  2138. {
  2139. for(new i = 0; i < MAX_PLAYERS; i++)
  2140. {
  2141. if (IsPlayerConnected(i))
  2142. {
  2143. SetVehicleParamsForPlayer(keycar,i,0,1);
  2144. }
  2145. }
  2146. format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
  2147. GameTextForPlayer(playerid, string, 4000, 3);
  2148. CarInfo[keycar][cLock] = 1;
  2149. OnPropUpdate(); SavePlayerData(playerid);
  2150. return 1;
  2151. }
  2152. }
  2153. else
  2154. {
  2155. SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 2");
  2156. return 1;
  2157. }
  2158. }
  2159. else if(strcmp(x_nr,"lock3",true) == 0)
  2160. {
  2161. new keycar = PlayerInfo[playerid][pPcarkey3];
  2162. if(keycar != -1)
  2163. {
  2164. new locked[256];
  2165. locked = strtok(cmdtext, idx);
  2166. if(CarInfo[keycar][cLock] == 1)
  2167. {
  2168. for(new i = 0; i < MAX_PLAYERS; i++)
  2169. {
  2170. if (IsPlayerConnected(i))
  2171. {
  2172. SetVehicleParamsForPlayer(keycar,i,0,0);
  2173. }
  2174. }
  2175. format(string, sizeof(string), "~w~Vehicle~n~~g~Unlocked");
  2176. GameTextForPlayer(playerid, string, 4000, 3);
  2177. CarInfo[keycar][cLock] = 0;
  2178. OnPropUpdate(); SavePlayerData(playerid);
  2179. return 1;
  2180. }
  2181. else if(CarInfo[keycar][cLock] == 0)
  2182. {
  2183. for(new i = 0; i < MAX_PLAYERS; i++)
  2184. {
  2185. if (IsPlayerConnected(i))
  2186. {
  2187. SetVehicleParamsForPlayer(keycar,i,0,1);
  2188. }
  2189. }
  2190. format(string, sizeof(string), "~w~Vehicle~n~~r~Locked");
  2191. GameTextForPlayer(playerid, string, 4000, 3);
  2192. CarInfo[keycar][cLock] = 1;
  2193. OnPropUpdate(); SavePlayerData(playerid);
  2194. return 1;
  2195. }
  2196. }
  2197. else
  2198. {
  2199. SendClientMessage(playerid, COLOR_GREY, " You don't have a vehicle at slot 3");
  2200. return 1;
  2201. }
  2202. }
  2203. else if(strcmp(x_nr,"color",true) == 0)
  2204. {
  2205. if(PlayerInfo[playerid][pPcarkey] == -1 && PlayerInfo[playerid][pPcarkey2] == -1 && PlayerInfo[playerid][pPcarkey3] == -1)
  2206. {
  2207. SendClientMessage(playerid, COLOR_GREY," You don't have a vehicle to respray.");
  2208. return 1;
  2209. }
  2210. if(GetPlayerMoney(playerid) < 1000)
  2211. {
  2212. SendClientMessage(playerid, COLOR_GREY," You don't have enough money for vehicle respray.");
  2213. return 1;
  2214. }
  2215. tmp = strtok(cmdtext, idx);
  2216. if(!strlen(tmp))
  2217. {
  2218. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]");
  2219. return 1;
  2220. }
  2221. new color1;
  2222. color1 = strval(tmp);
  2223. if(color1 < 0 && color1 > 126)
  2224. {
  2225. SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
  2226. return 1;
  2227. }
  2228. tmp = strtok(cmdtext, idx);
  2229. if(!strlen(tmp))
  2230. {
  2231. SendClientMessage(playerid, COLOR_WHITE, "USAGE: /v color [ColorOneID] [ColorTwoID]");
  2232. return 1;
  2233. }
  2234. new color2;
  2235. color2 = strval(tmp);
  2236. if(color2 < 0 && color2 > 126)
  2237. {
  2238. SendClientMessage(playerid, COLOR_GREY, " Wrong color id!");
  2239. return 1;
  2240. }
  2241.  
  2242. if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey]) { vehid = PlayerInfo[playerid][pPcarkey]; }
  2243. else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey2]) { vehid = PlayerInfo[playerid][pPcarkey2]; }
  2244. else if(GetPlayerVehicleID(playerid) == PlayerInfo[playerid][pPcarkey3]) { vehid = PlayerInfo[playerid][pPcarkey3]; }
  2245. else { return 1; }
  2246.  
  2247. if(IsPlayerInVehicle(playerid, vehid))
  2248. {
  2249. CarInfo[vehid][cColorOne] = color1;
  2250. CarInfo[vehid][cColorTwo] = color2;
  2251. GivePlayerMoney(playerid, -1000);
  2252. GameTextForPlayer(playerid, "~w~Bill for a Paint Respray~n~~r~-$1000", 5000, 1);
  2253. ChangeVehicleColor(vehid, color1, color2);
  2254. OnPropUpdate(); SavePlayerData(playerid);
  2255. return 1;
  2256. }
  2257. else
  2258. {
  2259. SendClientMessage(playerid, COLOR_GREY," You are not in your vehicle.");
  2260. return 1;
  2261. }
  2262. }
  2263. else
  2264. {
  2265. SendClientMessage(playerid, COLOR_WHITE, "HINT: (/v)ehicle [name]");
  2266. SendClientMessage(playerid, COLOR_WHITE, "Available names: park, lock(1-3), sell, color");
  2267. return 1;
  2268. }
  2269. }
  2270. return 1;
  2271. }
  2272. return 0;
  2273. }
  2274. /*----------Car Save Functions----------*/
  2275.  
  2276. public LoadCar()
  2277. {
  2278. new arrCoords[31][64];
  2279. new strFromFile2[256];
  2280. new File: file = fopen("masini.cfg", io_read);
  2281. if (file)
  2282. {
  2283. new idx = carsonserver;
  2284. while (idx < sizeof(CarInfo))
  2285. {
  2286. fread(file, strFromFile2);
  2287. split(strFromFile2, arrCoords, ',');
  2288. CarInfo[idx][cModel] = strval(arrCoords[0]);
  2289. CarInfo[idx][cLocationx] = floatstr(arrCoords[1]);
  2290. CarInfo[idx][cLocationy] = floatstr(arrCoords[2]);
  2291. CarInfo[idx][cLocationz] = floatstr(arrCoords[3]);
  2292. CarInfo[idx][cAngle] = floatstr(arrCoords[4]);
  2293. CarInfo[idx][cColorOne] = strval(arrCoords[5]);
  2294. CarInfo[idx][cColorTwo] = strval(arrCoords[6]);
  2295. strmid(CarInfo[idx][cOwner], arrCoords[7], 0, strlen(arrCoords[7]), 255);
  2296. strmid(CarInfo[idx][cDescription], arrCoords[8], 0, strlen(arrCoords[8]), 255);
  2297. CarInfo[idx][cValue] = strval(arrCoords[9]);
  2298. strmid(CarInfo[idx][cLicense], arrCoords[10], 0, strlen(arrCoords[10]), 255);
  2299. CarInfo[idx][cOwned] = strval(arrCoords[11]);
  2300. CarInfo[idx][cLock] = strval(arrCoords[12]);
  2301. CarInfo[idx][mod1] = strval(arrCoords[13]);
  2302. CarInfo[idx][mod2] = strval(arrCoords[14]);
  2303. CarInfo[idx][mod3] = strval(arrCoords[15]);
  2304. CarInfo[idx][mod4] = strval(arrCoords[16]);
  2305. CarInfo[idx][mod5] = strval(arrCoords[17]);
  2306. CarInfo[idx][mod6] = strval(arrCoords[18]);
  2307. CarInfo[idx][mod7] = strval(arrCoords[19]);
  2308. CarInfo[idx][mod8] = strval(arrCoords[20]);
  2309. CarInfo[idx][mod9] = strval(arrCoords[21]);
  2310. CarInfo[idx][mod10] = strval(arrCoords[22]);
  2311. CarInfo[idx][mod11] = strval(arrCoords[23]);
  2312. CarInfo[idx][mod12] = strval(arrCoords[24]);
  2313. CarInfo[idx][mod13] = strval(arrCoords[25]);
  2314. CarInfo[idx][mod14] = strval(arrCoords[26]);
  2315. CarInfo[idx][mod15] = strval(arrCoords[27]);
  2316. CarInfo[idx][mod16] = strval(arrCoords[28]);
  2317. CarInfo[idx][mod17] = strval(arrCoords[29]);
  2318. CarInfo[idx][paintjob] = strval(arrCoords[30]);
  2319. printf("CarInfo: %d Owner:%s LicensePlate %s",idx,CarInfo[idx][cOwner],CarInfo[idx][cLicense]);
  2320. idx++;
  2321. }
  2322. }
  2323. return 1;
  2324. }
  2325.  
  2326. public SaveCarCoords()
  2327. {
  2328. new idx;
  2329. new File: file2;
  2330. while (idx < sizeof(CarInfo))
  2331. {
  2332. new coordsstring[256];
  2333. format(coordsstring, sizeof(coordsstring), "%d|%f|%f|%f|%f|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d|%d\n",
  2334. CarInfo[idx][cModel],
  2335. CarInfo[idx][cLocationx],
  2336. CarInfo[idx][cLocationy],
  2337. CarInfo[idx][cLocationz],
  2338. CarInfo[idx][cAngle],
  2339. CarInfo[idx][cColorOne],
  2340. CarInfo[idx][cColorTwo],
  2341. CarInfo[idx][mod1],
  2342. CarInfo[idx][mod2],
  2343. CarInfo[idx][mod3],
  2344. CarInfo[idx][mod4],
  2345. CarInfo[idx][mod5],
  2346. CarInfo[idx][mod6],
  2347. CarInfo[idx][mod7],
  2348. CarInfo[idx][mod8],
  2349. CarInfo[idx][mod9],
  2350. CarInfo[idx][mod10],
  2351. CarInfo[idx][mod11],
  2352. CarInfo[idx][mod12],
  2353. CarInfo[idx][mod13],
  2354. CarInfo[idx][mod14],
  2355. CarInfo[idx][mod15],
  2356. CarInfo[idx][mod16],
  2357. CarInfo[idx][mod17],
  2358. CarInfo[idx][paintjob]);
  2359. if(idx == carsonserver)
  2360. {
  2361. file2 = fopen("masini.cfg", io_write);
  2362. }
  2363. else
  2364. {
  2365. file2 = fopen("masini.cfg", io_append);
  2366. }
  2367. fwrite(file2, coordsstring);
  2368. idx++;
  2369. fclose(file2);
  2370. }
  2371. return 1;
  2372. }
  2373.  
  2374. public OnPlayerStateChange(playerid, newstate, oldstate)
  2375. {
  2376. new string[128];
  2377. new vehicle = GetPlayerVehicleID(playerid);
  2378. if(newstate == PLAYER_STATE_DRIVER)
  2379. {
  2380. new newcar = GetPlayerVehicleID(playerid);
  2381. if(IsAnOwnableCar(newcar))
  2382. {
  2383. if(CarInfo[newcar][cOwned]==1)
  2384. {
  2385. format(string,sizeof(string),"Vehicle registered to %s",CarInfo[newcar][cOwner]);
  2386. SendClientMessage(playerid, COLOR_BLUE, string);
  2387. if(PlayerInfo[playerid][pPcarkey] == vehicle) { }
  2388. else if(PlayerInfo[playerid][pPcarkey2] == vehicle) { }
  2389. else if(PlayerInfo[playerid][pPcarkey3] == vehicle) { }
  2390. else
  2391. {
  2392. RemovePlayerFromVehicle(playerid);
  2393. SendClientMessage(playerid, COLOR_GREY, "You don't have a key of this vehicle");
  2394. }
  2395. }
  2396. }
  2397. }
  2398. return 1;
  2399. }
  2400.  
  2401. stock ini_GetKey( line[] )
  2402. {
  2403. new keyRes[256];
  2404. keyRes[0] = 0;
  2405. if ( strfind( line , "=" , true ) == -1 ) return keyRes;
  2406. strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
  2407. return keyRes;
  2408. }
  2409.  
  2410. stock ini_GetValue( line[] )
  2411. {
  2412. new valRes[256];
  2413. valRes[0]=0;
  2414. if ( strfind( line , "=" , true ) == -1 ) return valRes;
  2415. strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
  2416. return valRes;
  2417. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement