Guest User

FS C.O

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