Advertisement
Guest User

Untitled

a guest
Apr 29th, 2011
869
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 63.40 KB | None | 0 0
  1. // (C) BY [DT]SNIPER from sa-mp.de edit by StreetGT
  2. // Never remove credits!
  3.  
  4. #include <a_samp>
  5. #include <utils>
  6.  
  7. // Functions:
  8. #define MaxVeh 2 // Vehicle a person can own.
  9. new Srt_OtherVehicle = 1; // set 0 if you don't want see categorie Cheap Cars open
  10. new Srt_LockOnSpawn = 0; // set to 1 if cars get after logging, etc. are to locked/unlocked
  11. new Srt_LiveView = 0; // Live view on, or off ( 0 )
  12.  
  13. new Float:ParkPos_Autos[3][4] = {
  14. {974.7033, -925.4849, 45.7656, 90.0},
  15. {974.7033, -920.4849, 45.7656, 90.0},
  16. {974.7033, -915.4849, 45.7656, 90.0}
  17. };
  18.  
  19. new Float:ParkPos_Bikes[4][4] = {
  20. {955.1473, -936.0457, 42.3294, 0.0},
  21. {955.0228, -931.0831, 42.3255, 0.0},
  22. {953.8707, -937.0492, 42.7656, 0.0},
  23. {953.7427, -934.3327, 42.7656, 0.0}
  24. };
  25.  
  26. new Float:SrtOthers[5][4] = {
  27. {951.7833, -933.9078, 42.5685, 353.4855}, // Limo ParkPos
  28. {952.8622,-910.6187,45.7656, 0.0}, // Info Zeichen etc.
  29. {959.2946, -905.6293, 45.7656, 184.6502}, // Others ParkPos
  30. {943.9965, -934.0697, 61.2627, 261.1646}, // LiveView Car
  31. {940.2521, -939.5271, 60.7009, 0.0} // LiveView Cam
  32. };
  33.  
  34. new CatName[][] =
  35. {
  36.     "Bikes", "Cheap Vehicles", "Normal Vehicles", "Fast Vehicle", "Other Vehicles"
  37. };
  38.  
  39. new RadVehicle[8][2] = {
  40. {462,1000}, // Faggio ($1000)
  41. {586,1700}, // Wayfarer ($1700)
  42. {521,2500}, // FCR-900($2500)
  43. {461,3100}, // PCJ-600 ($3100)
  44. {463,3800}, // Freeway ($3800)
  45. {468,4200}, // Sanchez ($4200)
  46. {581,4900}, // BF-400 ($4900)
  47. {522,6000}  // NRG-500 ($6000)
  48. };
  49.  
  50. new FastVehicle[10][2] = {
  51. {558,20000}, // Uranus ($20000)
  52. {560,22500}, // Sultan ($22500)
  53. {603,24000}, // Phoenix ($24000)
  54. {506,26200}, // Super GT ($26200)
  55. {562,28800}, // Elegy ($28800)
  56. {541,30000}, // Bullet ($30000)
  57. {415,31500}, // Cheetah ($31500)
  58. {451,33200}, // Turismo ($33200)
  59. {429,35000}, // Banshee ($35000)
  60. {411,40000}  // Infernus ($40000)
  61. };
  62.  
  63. new NormVehicle[9][2] = {
  64. {529,11000}, // Willard ($11000)
  65. {492,11800}, // Greenwood ($11800)
  66. {475,12500}, // Subre ($12500)
  67. {436,13200}, // Previon ($13200)
  68. {405,14000}, // Sentinel ($14000)
  69. {401,14900}, // Bravura ($14900)
  70. {589,15800}, // Club ($15800)
  71. {458,16500}, // Solair ($16500)
  72. {559,17000}  // Jester ($17000)
  73. };
  74.  
  75. new CheapVehicle[8][2] = {
  76. {605,5000}, // 1. Gebrauchtwagen ($5000)
  77. {604,5900}, // 2. Gebrauchtwagen ($5900)
  78. {418,6200}, // Moonbeam ($6200)
  79. {467,7100}, // Oceanic ($7100)
  80. {422,7600}, // Bobcat ($7600)
  81. {527,8300}, // Cadrona ($8300)
  82. {496,8900}, // Blista Compact ($8900)
  83. {500,9400}  // Mesa ($9400)
  84. };
  85.  
  86. new OtherVehicle[5][2] = {
  87. {409,15000}, // Stretch ($15000)
  88. {471,7000},  // Quad ($7000)
  89. {457,2500},  // Caddy ($2500)
  90. {572,900},   // Mower ($900)
  91. {424,45000}  // BF-Injection ($45000)
  92. };
  93.  
  94. // Functions
  95.  
  96. #define COLOR_YELLOW 0xFFFF00AA
  97. #define COLOR_WHITE 0xFFFFFFFF
  98. #define COLOR_GREY 0xAFAFAFAA
  99. #define COLOR_LIGHTBLUE 0x33CCFFAA
  100.  
  101. forward OnPlayerBuyCar(playerid,Model,Price);
  102. forward SetParkPos(playerid,Model);
  103. forward OnPlayerCarLogin(playerid);
  104. forward OnPlayerCarUpdate(playerid);
  105. forward PlayerCarSpawn(playerid,Slot);
  106. forward ini_GetKey( line[] );
  107. forward ini_GetValue( line[] );
  108. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  109. forward IsAWheel(componentid);
  110. forward IsAExhaust(componentid);
  111. forward IsASideR(componentid);
  112. forward IsASideL(componentid);
  113. forward IsAFB(componentid);
  114. forward IsARB(componentid);
  115. forward IsASpoiler(componentid);
  116. forward IsARoof(componentid);
  117. forward Srt_LockCar(carid);
  118. forward Srt_UnLockCar(carid);
  119. forward CarTuning(playerid,slot);
  120. forward LetDoorsLocked();
  121. forward IsASrtcar(car);
  122.  
  123. new SideL, SideR, Srt_Info;
  124. new Menu: Srt_HauptMenu, Menu: Srt_2RadMenu, Menu: Srt_FastMenu, Menu: Srt_NormMenu, Menu: Srt_CheapMenu, Menu: Srt_OtherMenu;
  125. new Srt_PlayerHaveCar[MAX_PLAYERS][MaxVeh];
  126. new Srt_PlayerKey[MAX_PLAYERS];
  127. new Srt_CarKey[MAX_PLAYERS];
  128. new Srt_ParkRights[MAX_PLAYERS];
  129. new RadZahl = 0, CarZahl = 0;
  130. new Srt_Carlock[700];
  131. new Text: CarKauf[MAX_PLAYERS];
  132. new Srt_CarownerCar[MAX_PLAYERS],Srt_CarownerCat[MAX_PLAYERS],Srt_CarownerSCar[MAX_PLAYERS];
  133.  
  134. enum Srt_PlayerCar
  135. {
  136.     CarId,
  137.     CarModel,
  138.     Float:CarPos_x,
  139.     Float:CarPos_y,
  140.     Float:CarPos_z,
  141.     Float:CarRotate,
  142.     CarNitro,
  143.     CarHyd,
  144.     CarWheel,
  145.     CarAusp,
  146.     CarSideL,
  147.     CarSideR,
  148.     CarFB,
  149.     CarRB,
  150.     CarSpoiler,
  151.     CarRoof,
  152.     CarHood,
  153.     CarVents,
  154.     CarLamps,
  155.     CarPJ,
  156.     CarC1,
  157.     CarC2,
  158.     CarPrice,
  159. };
  160.  
  161. new PlayerCar[MAX_PLAYERS][MaxVeh][Srt_PlayerCar];
  162.  
  163. new CarName[][] =
  164. {
  165.     "Landstalker", "Bravura", "Buffalo", "Linerunner", "Perrenial", "Sentinel",
  166.     "Dumper", "Firetruck", "Trashmaster", "Stretch", "Manana", "Infernus",
  167.     "Voodoo", "Pony", "Mule", "Cheetah", "Ambulance", "Leviathan", "Moonbeam",
  168.     "Esperanto", "Taxi", "Washington", "Bobcat", "Whoopee", "BF Injection",
  169.     "Hunter", "Premier", "Enforcer", "Securicar", "Banshee", "Predator", "Bus",
  170.     "Rhino", "Barracks", "Hotknife", "Trailer", "Previon", "Coach", "Cabbie",
  171.     "Stallion", "Rumpo", "RC Bandit", "Romero", "Packer", "Monster", "Admiral",
  172.     "Squalo", "Seasparrow", "Pizzaboy", "Tram", "Trailer", "Turismo", "Speeder",
  173.     "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy", "Solair", "Berkley's RC Van",
  174.     "Skimmer", "PCJ-600", "Faggio", "Freeway", "RC Baron", "RC Raider", "Glendale",
  175.     "Oceanic","Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy",
  176.     "Hermes", "Sabre", "Rustler", "ZR-350", "Walton", "Regina", "Comet", "BMX",
  177.     "Burrito", "Camper", "Marquis", "Baggage", "Dozer", "Maverick", "News Chopper",
  178.     "Rancher", "FBI Rancher", "Virgo", "Greenwood", "Jetmax", "Hotring", "Sandking",
  179.     "Blista Compact", "Police Maverick", "Boxvillde", "Benson", "Mesa", "RC Goblin",
  180.     "Hotring Racer A", "Hotring Racer B", "Bloodring Banger", "Rancher", "Super GT",
  181.     "Elegant", "Journey", "Bike", "Mountain Bike", "Beagle", "Cropduster", "Stunt",
  182.     "Tanker", "Roadtrain", "Nebula", "Majestic", "Buccaneer", "Shamal", "Hydra",
  183.     "FCR-900", "NRG-500", "HPV1000", "Cement Truck", "Tow Truck", "Fortune",
  184.     "Cadrona", "FBI Truck", "Willard", "Forklift", "Tractor", "Combine", "Feltzer",
  185.     "Remington", "Slamvan", "Blade", "Freight", "Streak", "Vortex", "Vincent",
  186.     "Bullet", "Clover", "Sadler", "Firetruck", "Hustler", "Intruder", "Primo",
  187.     "Cargobob", "Tampa", "Sunrise", "Merit", "Utility", "Nevada", "Yosemite",
  188.     "Windsor", "Monster", "Monster", "Uranus", "Jester", "Sultan", "Stratum",
  189.     "Elegy", "Raindance", "RC Tiger", "Flash", "Tahoma", "Savanna", "Bandito",
  190.     "Freight Flat", "Streak Carriage", "Kart", "Mower", "Dune", "Sweeper",
  191.     "Broadway", "Tornado", "AT-400", "DFT-30", "Huntley", "Stafford", "BF-400",
  192.     "News Van", "Tug", "Trailer", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club",
  193.     "Freight Box", "Trailer", "Andromada", "Dodo", "RC Cam", "Launch", "Police Car",
  194.     "Police Car", "Police Car", "Police Ranger", "Picador", "S.W.A.T", "Alpha",
  195.     "Phoenix", "2. Gebrauchtwagen", "1. Gebrauchtwagen", "Luggage", "Luggage", "Stairs", "Boxville",
  196.     "Tiller", "Utility Trailer"
  197. };
  198.  
  199. public OnFilterScriptInit()
  200. {
  201.     print("\n--------------------------------------");
  202.     print(" SRT_Car edited by StreetGT ");
  203.     print("--------------------------------------\n");
  204.  
  205.     Srt_Info = CreatePickup(1239, 2, SrtOthers[1][0],SrtOthers[1][1],SrtOthers[1][2],-1);
  206.     if(!Srt_LiveView)
  207.     {
  208.         //Hauptmenu
  209.         Srt_HauptMenu = CreateMenu("LS CarOwner",2,200,100,150,75);
  210.         SetMenuColumnHeader(Srt_HauptMenu, 0, "LS CarOwner");
  211.         AddMenuItem(Srt_HauptMenu, 0, "Fast Vehicle");
  212.         AddMenuItem(Srt_HauptMenu, 0, "Normal Vehicles");
  213.         AddMenuItem(Srt_HauptMenu, 0, "Cheap Vehicles");
  214.         AddMenuItem(Srt_HauptMenu, 0, "Bikes");
  215.         if(Srt_OtherVehicle){ AddMenuItem(Srt_HauptMenu, 0, "Others"); }
  216.         AddMenuItem(Srt_HauptMenu, 0, "Exit");
  217.         //2RadMenu
  218.         Srt_2RadMenu = CreateMenu("Bikes",2,200,100,150,75);
  219.         SetMenuColumnHeader(Srt_2RadMenu, 0, "Bikes");
  220.         for(new x=0; x < sizeof(RadVehicle); x++) {
  221.             new string[128];
  222.             format(string, sizeof(string), "%s ($%d)",CarName[RadVehicle[x][0]-400],RadVehicle[x][1]);
  223.             AddMenuItem(Srt_2RadMenu, 0, string);
  224.         }
  225.         //FastMenu
  226.         Srt_FastMenu = CreateMenu("Fast Vehicle",2,200,100,150,75);
  227.         SetMenuColumnHeader(Srt_FastMenu, 0, "Fast Vehicle");
  228.         for(new x=0; x < sizeof(FastVehicle); x++) {
  229.             new string[128];
  230.             format(string, sizeof(string), "%s ($%d)",CarName[FastVehicle[x][0]-400],FastVehicle[x][1]);
  231.             AddMenuItem(Srt_FastMenu, 0, string);
  232.         }
  233.         //NormMenu
  234.         Srt_NormMenu = CreateMenu("Cheap Vehicles",2,200,100,150,75);
  235.         SetMenuColumnHeader(Srt_NormMenu, 0, "Normal Vehicles");
  236.         for(new x=0; x < sizeof(NormVehicle); x++) {
  237.             new string[128];
  238.             format(string, sizeof(string), "%s ($%d)",CarName[NormVehicle[x][0]-400],NormVehicle[x][1]);
  239.             AddMenuItem(Srt_NormMenu, 0, string);
  240.         }
  241.         //CheapMenu
  242.         Srt_CheapMenu = CreateMenu("Cheap Vehicles",2,200,100,150,75);
  243.         SetMenuColumnHeader(Srt_CheapMenu, 0, "Cheap Vehicles");
  244.         for(new x=0; x < sizeof(CheapVehicle); x++) {
  245.             new string[128];
  246.             format(string, sizeof(string), "%s ($%d)",CarName[CheapVehicle[x][0]-400],CheapVehicle[x][1]);
  247.             AddMenuItem(Srt_CheapMenu, 0, string);
  248.         }
  249.         //OtherMenu
  250.         Srt_OtherMenu = CreateMenu("Others",2,200,100,150,75);
  251.         SetMenuColumnHeader(Srt_OtherMenu, 0, "Others");
  252.         for(new x=0; x < sizeof(OtherVehicle); x++) {
  253.             new string[128];
  254.             format(string, sizeof(string), "%s ($%d)",CarName[OtherVehicle[x][0]-400],OtherVehicle[x][1]);
  255.             AddMenuItem(Srt_OtherMenu, 0, string);
  256.         }
  257.     }
  258.     SetTimer("LetDoorsLocked", 1000, 1);
  259.     return 1;
  260. }
  261.  
  262. public OnFilterScriptExit()
  263. {
  264.     for(new i = 0; i < MAX_PLAYERS; i++)
  265.     {
  266.         OnPlayerCarUpdate(i);
  267.     }
  268.     DestroyPickup(Srt_Info);
  269.     return 1;
  270. }
  271.  
  272. main()
  273. {
  274.     print("\n----------------------------------");
  275.     print(" DT_Car by [DT]Sniper and www.darkTnetwork.de");
  276.     print("----------------------------------\n");
  277. }
  278.  
  279. public SetParkPos(playerid,Model)
  280. {
  281.     if(IsPlayerConnected(playerid) && !Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  282.     {
  283.         for(new x=0; x < sizeof(RadVehicle); x++) {
  284.             if(Model == RadVehicle[x][0])
  285.             {
  286.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_x] = ParkPos_Bikes[RadZahl][0];
  287.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_y] = ParkPos_Bikes[RadZahl][1];
  288.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_z] = ParkPos_Bikes[RadZahl][2];
  289.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarRotate] = ParkPos_Bikes[RadZahl][3];
  290.                 RadZahl += 1;
  291.                 if(RadZahl == 4)
  292.                 {
  293.                     RadZahl = 0;
  294.                 }
  295.             }
  296.         }
  297.         for(new x=0; x < sizeof(FastVehicle); x++) {
  298.             if(Model == FastVehicle[x][0])
  299.             {
  300.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_x] = ParkPos_Autos[CarZahl][0];
  301.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_y] = ParkPos_Autos[CarZahl][1];
  302.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_z] = ParkPos_Autos[CarZahl][2];
  303.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarRotate] = ParkPos_Autos[CarZahl][3];
  304.                 CarZahl += 1;
  305.                 if(CarZahl == 3)
  306.                 {
  307.                     CarZahl = 0;
  308.                 }
  309.             }
  310.         }
  311.         for(new x=0; x < sizeof(NormVehicle); x++) {
  312.             if(Model == NormVehicle[x][0])
  313.             {
  314.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_x] = ParkPos_Autos[CarZahl][0];
  315.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_y] = ParkPos_Autos[CarZahl][1];
  316.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_z] = ParkPos_Autos[CarZahl][2];
  317.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarRotate] = ParkPos_Autos[CarZahl][3];
  318.                 CarZahl += 1;
  319.                 if(CarZahl == 3)
  320.                 {
  321.                     CarZahl = 0;
  322.                 }
  323.             }
  324.         }
  325.         for(new x=0; x < sizeof(CheapVehicle); x++) {
  326.             if(Model == CheapVehicle[x][0])
  327.             {
  328.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_x] = ParkPos_Autos[CarZahl][0];
  329.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_y] = ParkPos_Autos[CarZahl][1];
  330.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_z] = ParkPos_Autos[CarZahl][2];
  331.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarRotate] = ParkPos_Autos[CarZahl][3];
  332.                 CarZahl += 1;
  333.                 if(CarZahl == 3)
  334.                 {
  335.                     CarZahl = 0;
  336.                 }
  337.             }
  338.         }
  339.         for(new x=0; x < sizeof(OtherVehicle); x++) {
  340.             if(Model == OtherVehicle[x][0])
  341.             {
  342.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_x] = SrtOthers[2][0];
  343.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_y] = SrtOthers[2][1];
  344.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_z] = SrtOthers[2][2];
  345.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarRotate] = SrtOthers[2][3];
  346.             }
  347.         }
  348.         if(Model == 409)
  349.         {
  350.             PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_x] = SrtOthers[0][0];
  351.             PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_y] = SrtOthers[0][1];
  352.             PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_z] = SrtOthers[0][2];
  353.             PlayerCar[playerid][Srt_PlayerKey[playerid]][CarRotate] = SrtOthers[0][3];
  354.         }
  355.     }
  356. }
  357.  
  358. public OnPlayerBuyCar(playerid,Model,Price)
  359. {
  360.     if(IsPlayerConnected(playerid) && !Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  361.     {
  362.         GivePlayerMoney(playerid, -Price);
  363.         SetParkPos(playerid,Model);
  364.         new name[MAX_PLAYER_NAME], str[128];
  365.         GetPlayerName(playerid, name, sizeof name);
  366.         format(str, sizeof str, "/SRT_Cars/%s%d.Srtcar", name,Srt_PlayerKey[playerid]);
  367.         new File: hFile = fopen(str, io_write);
  368.         if (hFile)
  369.         {
  370.             new var[32];
  371.             format(var, 32, "CarId=0\n");fwrite(hFile, var);
  372.             format(var, 32, "CarModel=%d\n",Model);fwrite(hFile, var);
  373.             format(var, 32, "CarPos_x=%.3f\n",PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_x]);fwrite(hFile, var);
  374.             format(var, 32, "CarPos_y=%.3f\n",PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_y]);fwrite(hFile, var);
  375.             format(var, 32, "CarPos_z=%.3f\n",PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_z]);fwrite(hFile, var);
  376.             format(var, 32, "CarRotate=%.3f\n",PlayerCar[playerid][Srt_PlayerKey[playerid]][CarRotate]);fwrite(hFile, var);
  377.             format(var, 32, "CarNitro=0\n");fwrite(hFile, var);
  378.             format(var, 32, "CarHyd=0\n");fwrite(hFile, var);
  379.             format(var, 32, "CarWheel=0\n");fwrite(hFile, var);
  380.             format(var, 32, "CarAusp=0\n");fwrite(hFile, var);
  381.             format(var, 32, "CarSideL=0\n");fwrite(hFile, var);
  382.             format(var, 32, "CarSideR=0\n");fwrite(hFile, var);
  383.             format(var, 32, "CarFB=0\n");fwrite(hFile, var);
  384.             format(var, 32, "CarRB=0\n");fwrite(hFile, var);
  385.             format(var, 32, "CarSpoiler=0\n");fwrite(hFile, var);
  386.             format(var, 32, "CarRoof=0\n");fwrite(hFile, var);
  387.             format(var, 32, "CarHood=0\n");fwrite(hFile, var);
  388.             format(var, 32, "CarVents=0\n");fwrite(hFile, var);
  389.             format(var, 32, "CarLamps=0\n");fwrite(hFile, var);
  390.             format(var, 32, "CarPJ=-1\n");fwrite(hFile, var);
  391.             format(var, 32, "CarC1=-1\n");fwrite(hFile, var);
  392.             format(var, 32, "CarC2=-1\n");fwrite(hFile, var);
  393.             format(var, 32, "Price=%d\n",Price);fwrite(hFile, var);
  394.             fclose(hFile);
  395.         }
  396.         OnPlayerCarLogin(playerid);
  397.     }
  398. }
  399.  
  400. public OnPlayerCarLogin(playerid)
  401. {
  402.     for(new x = 0; x < MaxVeh; x++)
  403.     {
  404.         if(!Srt_PlayerHaveCar[playerid][x])
  405.         {
  406.             new string2[128];
  407.             new playername2[MAX_PLAYER_NAME];
  408.             GetPlayerName(playerid, playername2, sizeof(playername2));
  409.             format(string2, sizeof(string2), "/SRT_Cars/%s%d.Srtcar", playername2,x);
  410.             new File: UserFile = fopen(string2, io_read);
  411.             if (UserFile)
  412.             {
  413.                 Srt_PlayerHaveCar[playerid][x] = 1;
  414.                 new key[ 256 ] , val[ 256 ];
  415.                 new Data[ 256 ];
  416.                 while ( fread( UserFile , Data , sizeof( Data ) ) )
  417.                 {
  418.                     key = ini_GetKey( Data );
  419.                     if( strcmp( key , "CarId" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarId] = strval( val ); }
  420.                     if( strcmp( key , "CarModel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarModel] = strval( val ); }
  421.                     if( strcmp( key , "CarPos_x" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_x] = floatstr( val ); }
  422.                     if( strcmp( key , "CarPos_y" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_y] = floatstr( val ); }
  423.                     if( strcmp( key , "CarPos_z" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPos_z] = floatstr( val ); }
  424.                     if( strcmp( key , "CarRotate" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRotate] = floatstr( val ); }
  425.                     if( strcmp( key , "CarNitro" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarNitro] = strval( val ); }
  426.                     if( strcmp( key , "CarHyd" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarHyd] = strval( val ); }
  427.                     if( strcmp( key , "CarWheel" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarWheel] = strval( val ); }
  428.                     if( strcmp( key , "CarAusp" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarAusp] = strval( val ); }
  429.                     if( strcmp( key , "CarSideL" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSideL] = strval( val ); }
  430.                     if( strcmp( key , "CarSideR" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSideR] = strval( val ); }
  431.                     if( strcmp( key , "CarFB" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarFB] = strval( val ); }
  432.                     if( strcmp( key , "CarRB" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRB] = strval( val ); }
  433.                     if( strcmp( key , "CarSpoiler" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarSpoiler] = strval( val ); }
  434.                     if( strcmp( key , "CarRoof" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarRoof] = strval( val ); }
  435.                     if( strcmp( key , "CarHood" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarHood] = strval( val ); }
  436.                     if( strcmp( key , "CarVents" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarVents] = strval( val ); }
  437.                     if( strcmp( key , "CarLamps" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarLamps] = strval( val ); }
  438.                     if( strcmp( key , "CarPJ" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPJ] = strval( val ); }
  439.                     if( strcmp( key , "CarC1" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarC1] = strval( val ); }
  440.                     if( strcmp( key , "CarC2" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarC2] = strval( val ); }
  441.                     if( strcmp( key , "Price" , true ) == 0 ) { val = ini_GetValue( Data ); PlayerCar[playerid][x][CarPrice] = strval( val ); }
  442.                 }
  443.                 fclose(UserFile);
  444.                 PlayerCarSpawn(playerid,x);
  445.             }
  446.         }
  447.     }
  448. }
  449.  
  450. public PlayerCarSpawn(playerid,Slot)
  451. {
  452.     if(IsPlayerConnected(playerid))
  453.     {
  454.         if(Srt_PlayerHaveCar[playerid][Slot])
  455.         {
  456.             PlayerCar[playerid][Slot][CarId] = CreateVehicle(PlayerCar[playerid][Slot][CarModel],PlayerCar[playerid][Slot][CarPos_x],PlayerCar[playerid][Slot][CarPos_y],PlayerCar[playerid][Slot][CarPos_z],PlayerCar[playerid][Slot][CarRotate],PlayerCar[playerid][Slot][CarC1],PlayerCar[playerid][Slot][CarC2], 60000);/*vehicle spawn*/
  457.             ChangeVehicleColor(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarC1],PlayerCar[playerid][Slot][CarC2]);
  458.             if(PlayerCar[playerid][Slot][CarPJ] >= 0) {ChangeVehiclePaintjob(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarPJ]);}
  459.             if(PlayerCar[playerid][Slot][CarNitro] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarNitro]);}
  460.             if(PlayerCar[playerid][Slot][CarHyd] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarHyd]);}
  461.             if(PlayerCar[playerid][Slot][CarWheel] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarWheel]);}
  462.             if(PlayerCar[playerid][Slot][CarAusp] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarAusp]);}
  463.             if(PlayerCar[playerid][Slot][CarSideL] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSideL]);}
  464.             if(PlayerCar[playerid][Slot][CarSideR] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSideR]);}
  465.             if(PlayerCar[playerid][Slot][CarFB] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarFB]);}
  466.             if(PlayerCar[playerid][Slot][CarRB] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarRB]);}
  467.             if(PlayerCar[playerid][Slot][CarSpoiler] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarSpoiler]);}
  468.             if(PlayerCar[playerid][Slot][CarRoof] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarRoof]);}
  469.             if(PlayerCar[playerid][Slot][CarHood] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarHood]);}
  470.             if(PlayerCar[playerid][Slot][CarVents] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarVents]);}
  471.             if(PlayerCar[playerid][Slot][CarLamps] != 0) {AddVehicleComponent(PlayerCar[playerid][Slot][CarId],PlayerCar[playerid][Slot][CarLamps]);}
  472.             if(Srt_LockOnSpawn)
  473.             {
  474.                 Srt_Carlock[PlayerCar[playerid][Slot][CarId]] = 1;
  475.                 Srt_LockCar(PlayerCar[playerid][Slot][CarId]);
  476.             }
  477.         }
  478.     }
  479. }
  480. public OnPlayerCarUpdate(playerid)
  481. {
  482.     if(IsPlayerConnected(playerid))
  483.     {
  484.         for(new x = 0; x < MaxVeh; x++)
  485.         {
  486.             if(Srt_PlayerHaveCar[playerid][x])
  487.             {
  488.                 DestroyVehicle(PlayerCar[playerid][x][CarId]);
  489.                 Srt_Carlock[PlayerCar[playerid][x][CarId]] = 0;
  490.                 Srt_LockCar(PlayerCar[playerid][x][CarId]);
  491.                 new string3[128];
  492.                 new playername3[MAX_PLAYER_NAME];
  493.                 GetPlayerName(playerid, playername3, sizeof(playername3));
  494.                 format(string3, sizeof(string3), "/SRT_Cars/%s%d.Srtcar", playername3,x);
  495.                 new File: hFile = fopen(string3, io_write);
  496.                 if (hFile)
  497.                 {
  498.                     new var[32];
  499.                     format(var, 32, "CarId=%d\n",PlayerCar[playerid][x][CarId]);fwrite(hFile, var);
  500.                     format(var, 32, "CarModel=%d\n",PlayerCar[playerid][x][CarModel]);fwrite(hFile, var);
  501.                     format(var, 32, "CarPos_x=%.3f\n",PlayerCar[playerid][x][CarPos_x]);fwrite(hFile, var);
  502.                     format(var, 32, "CarPos_y=%.3f\n",PlayerCar[playerid][x][CarPos_y]);fwrite(hFile, var);
  503.                     format(var, 32, "CarPos_z=%.3f\n",PlayerCar[playerid][x][CarPos_z]);fwrite(hFile, var);
  504.                     format(var, 32, "CarRotate=%.3f\n",PlayerCar[playerid][x][CarRotate]);fwrite(hFile, var);
  505.                     format(var, 32, "CarNitro=%d\n",PlayerCar[playerid][x][CarNitro]);fwrite(hFile, var);
  506.                     format(var, 32, "CarHyd=%d\n",PlayerCar[playerid][x][CarHyd]);fwrite(hFile, var);
  507.                     format(var, 32, "CarWheel=%d\n",PlayerCar[playerid][x][CarWheel]);fwrite(hFile, var);
  508.                     format(var, 32, "CarAusp=%d\n",PlayerCar[playerid][x][CarAusp]);fwrite(hFile, var);
  509.                     format(var, 32, "CarSideL=%d\n",PlayerCar[playerid][x][CarSideL]);fwrite(hFile, var);
  510.                     format(var, 32, "CarSideR=%d\n",PlayerCar[playerid][x][CarSideR]);fwrite(hFile, var);
  511.                     format(var, 32, "CarFB=%d\n",PlayerCar[playerid][x][CarFB]);fwrite(hFile, var);
  512.                     format(var, 32, "CarRB=%d\n",PlayerCar[playerid][x][CarRB]);fwrite(hFile, var);
  513.                     format(var, 32, "CarSpoiler=%d\n",PlayerCar[playerid][x][CarSpoiler]);fwrite(hFile, var);
  514.                     format(var, 32, "CarRoof=%d\n",PlayerCar[playerid][x][CarRoof]);fwrite(hFile, var);
  515.                     format(var, 32, "CarHood=%d\n",PlayerCar[playerid][x][CarHood]);fwrite(hFile, var);
  516.                     format(var, 32, "CarVents=%d\n",PlayerCar[playerid][x][CarVents]);fwrite(hFile, var);
  517.                     format(var, 32, "CarLamps=%d\n",PlayerCar[playerid][x][CarLamps]);fwrite(hFile, var);
  518.                     format(var, 32, "CarPJ=%d\n",PlayerCar[playerid][x][CarPJ]);fwrite(hFile, var);
  519.                     format(var, 32, "CarC1=%d\n",PlayerCar[playerid][x][CarC1]);fwrite(hFile, var);
  520.                     format(var, 32, "CarC2=%d\n",PlayerCar[playerid][x][CarC2]);fwrite(hFile, var);
  521.                     format(var, 32, "Price=%d\n",PlayerCar[playerid][x][CarPrice]);fwrite(hFile, var);
  522.                     fclose(hFile);
  523.                 }
  524.             }
  525.         }
  526.     }
  527.  }
  528.  
  529. public OnPlayerConnect(playerid)
  530. {
  531.     Srt_CarownerCar[playerid] = 0;
  532.     Srt_CarownerCat[playerid] = 0;
  533.     Srt_CarownerSCar[playerid] = 0;
  534.     Srt_PlayerKey[playerid] = 0;
  535.     Srt_CarKey[playerid] = 0;
  536.     Srt_ParkRights[playerid] = 0;
  537.     for(new i = 0; i < MaxVeh; i++)
  538.     {
  539.         Srt_PlayerHaveCar[playerid][i] = 0;
  540.     }
  541.     OnPlayerCarLogin(playerid);
  542.     for(new i = 0; i < 700; i++)
  543.     {
  544.         if(Srt_Carlock[i])
  545.         {
  546.             SetVehicleParamsForPlayer(i,playerid,0,1);
  547.         }
  548.     }
  549.     return 1;
  550. }
  551.  
  552. public OnPlayerSpawn(playerid)
  553. {
  554.     SetPlayerMapIcon(playerid, 30, SrtOthers[1][0],SrtOthers[1][1],SrtOthers[1][2], 55, COLOR_YELLOW);
  555.     return 1;
  556. }
  557.  
  558. public OnPlayerDisconnect(playerid, reason)
  559. {
  560.     OnPlayerCarUpdate(playerid);
  561.     return 1;
  562. }
  563.  
  564. public OnPlayerCommandText(playerid, cmdtext[])
  565. {
  566.     new idx, cmd[256], tmp[256], string[126];
  567.     cmd = strtok(cmdtext, idx);
  568.     if (strcmp("/carhelp", cmdtext, true, 10) == 0)
  569.     {
  570.         SendClientMessage(playerid, COLOR_LIGHTBLUE,"   ----------------[CARHELP]----------------");
  571.         SendClientMessage(playerid, COLOR_WHITE,    "   | COMMANDS | /park /carlock /carkey /carsell");
  572.         SendClientMessage(playerid, COLOR_WHITE,    "   | COMMANDS | /giveparkrights /givecarkey /carkeylock");
  573.         SendClientMessage(playerid, COLOR_LIGHTBLUE,"   -----------------------------------------");
  574.         return 1;
  575.     }
  576.     if (strcmp("/carsell", cmdtext, true, 10) == 0)
  577.     {
  578.         if(Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  579.         {
  580.             GivePlayerMoney(playerid,PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPrice] / 2);
  581.             Srt_Carlock[PlayerCar[playerid][Srt_PlayerKey[playerid]][CarId]] = 0;
  582.             Srt_UnLockCar(PlayerCar[playerid][Srt_PlayerKey[playerid]][CarId]);
  583.             DestroyVehicle(PlayerCar[playerid][Srt_PlayerKey[playerid]][CarId]);
  584.             new string3[32];
  585.             new playername3[MAX_PLAYER_NAME];
  586.             GetPlayerName(playerid, playername3, sizeof(playername3));
  587.             format(string3, sizeof(string3), "/SRT_Cars/%s%d.Srtcar", playername3,Srt_PlayerKey[playerid]);
  588.             fremove(string3);
  589.             Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]] = 0;
  590.             SendClientMessage(playerid, COLOR_YELLOW, "    You sold your vehicle sucefully!");
  591.         }
  592.         else
  593.         {
  594.             SendClientMessage(playerid, COLOR_GREY, "    You don't have the right key to use this command!");
  595.             return 1;
  596.         }
  597.         return 1;
  598.     }
  599.     if (strcmp("/park", cmdtext, true, 10) == 0)
  600.     {
  601.         if(Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  602.         {
  603.                 new newcar = GetPlayerVehicleID(playerid);
  604.                 if (newcar == PlayerCar[playerid][Srt_PlayerKey[playerid]][CarId])
  605.                 {
  606.                     new Float:X,Float:Y,Float:Z;
  607.                     new Float:z_rot;
  608.                     GetPlayerPos(playerid, X,Y,Z);
  609.                     GetVehicleZAngle(newcar, z_rot);
  610.                     PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_x] = X;
  611.                     PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_y] = Y;
  612.                     PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_z] = Z;
  613.                     PlayerCar[playerid][Srt_PlayerKey[playerid]][CarRotate] = z_rot;
  614.                     SendClientMessage(playerid, COLOR_YELLOW, "    You parked your vehicle, you can find them here now!");
  615.                 }
  616.                 else if (newcar == Srt_ParkRights[playerid])
  617.                 {
  618.                     new Float:X,Float:Y,Float:Z;
  619.                     new Float:z_rot;
  620.                     GetPlayerPos(playerid, X,Y,Z);
  621.                     GetVehicleZAngle(newcar, z_rot);
  622.                     PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_x] = X;
  623.                     PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_y] = Y;
  624.                     PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_z] = Z;
  625.                     PlayerCar[playerid][Srt_PlayerKey[playerid]][CarRotate] = z_rot;
  626.                     SendClientMessage(playerid, COLOR_YELLOW, "    You parked your vehicle, you can find them here now!");
  627.                 }
  628.                 else
  629.                 {
  630.                     SendClientMessage(playerid,COLOR_GREY,"  You are not in your vehicle or you don't have the right keys!");
  631.                     return 1;
  632.                 }
  633.         }
  634.         else if (Srt_ParkRights[playerid] != 0)
  635.         {
  636.             new newcar = GetPlayerVehicleID(playerid);
  637.             if (newcar == Srt_ParkRights[playerid])
  638.             {
  639.                 new Float:X,Float:Y,Float:Z;
  640.                 new Float:z_rot;
  641.                 GetPlayerPos(playerid, X,Y,Z);
  642.                 GetVehicleZAngle(newcar, z_rot);
  643.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_x] = X;
  644.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_y] = Y;
  645.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarPos_z] = Z;
  646.                 PlayerCar[playerid][Srt_PlayerKey[playerid]][CarRotate] = z_rot;
  647.                 SendClientMessage(playerid, COLOR_YELLOW, "    You parked your vehicle, you can find them here now!");
  648.             }
  649.         }
  650.         else
  651.         {
  652.             SendClientMessage(playerid, COLOR_GREY, "    You are not in your vehicle or you don't have the right keys!");
  653.             return 1;
  654.         }
  655.         return 1;
  656.     }
  657.     if (strcmp("/carlock", cmdtext, true, 10) == 0)
  658.     {
  659.         if(Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  660.         {
  661.             new Status = Srt_Carlock[PlayerCar[playerid][Srt_PlayerKey[playerid]][CarId]];
  662.             switch (Status)
  663.             {
  664.                 case 0:
  665.                 {
  666.                     GameTextForPlayer(playerid, "~w~Vehicle ~r~closed", 5000, 6);
  667.                     PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  668.                     Srt_Carlock[PlayerCar[playerid][Srt_PlayerKey[playerid]][CarId]] = 1;
  669.                     Srt_LockCar(PlayerCar[playerid][Srt_PlayerKey[playerid]][CarId]);
  670.                 }
  671.                 case 1:
  672.                 {
  673.                     GameTextForPlayer(playerid, "~w~Vehicle ~g~open", 5000, 6);
  674.                     PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  675.                     Srt_Carlock[PlayerCar[playerid][Srt_PlayerKey[playerid]][CarId]] = 0;
  676.                     Srt_UnLockCar(PlayerCar[playerid][Srt_PlayerKey[playerid]][CarId]);
  677.                 }
  678.             }
  679.         }
  680.         else
  681.         {
  682.             SendClientMessage(playerid, COLOR_GREY, "    You are not in your vehicle or you don't have the right keys!");
  683.             return 1;
  684.         }
  685.         return 1;
  686.     }
  687.     if (strcmp("/carkeylock", cmdtext, true, 10) == 0)
  688.     {
  689.         if(Srt_ParkRights[playerid] != 0)
  690.         {
  691.             new Status = Srt_Carlock[Srt_ParkRights[playerid]];
  692.             switch (Status)
  693.             {
  694.                 case 0:
  695.                 {
  696.                     GameTextForPlayer(playerid, "~w~Vehicle ~r~closed", 5000, 6);
  697.                     PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  698.                     Srt_Carlock[Srt_ParkRights[playerid]] = 1;
  699.                     Srt_LockCar(Srt_ParkRights[playerid]);
  700.                 }
  701.                 case 1:
  702.                 {
  703.                     GameTextForPlayer(playerid, "~w~Vehicle ~g~open", 5000, 6);
  704.                     PlayerPlaySound(playerid, 1145, 0.0, 0.0, 0.0);
  705.                     Srt_Carlock[Srt_ParkRights[playerid]] = 0;
  706.                     Srt_UnLockCar(Srt_ParkRights[playerid]);
  707.                 }
  708.             }
  709.         }
  710.         else
  711.         {
  712.             SendClientMessage(playerid, COLOR_GREY, "    You don't have the right key to use this command!");
  713.             return 1;
  714.         }
  715.         return 1;
  716.     }
  717.     if (strcmp("/carkey", cmdtext, true, 10) == 0)
  718.     {
  719.         new mv = MaxVeh;
  720.         if(mv > 1)
  721.         {
  722.             Srt_PlayerKey[playerid] += 1;
  723.             if(Srt_PlayerKey[playerid] == MaxVeh)
  724.             {
  725.                 Srt_PlayerKey[playerid] = 0;
  726.             }
  727.             if(Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  728.             {
  729.                 format(string, sizeof(string), "You change your %dth key ,  to vehicle %s!",Srt_PlayerKey[playerid]+1,CarName[PlayerCar[playerid][Srt_PlayerKey[playerid]][CarModel]-400]);
  730.             }
  731.             else
  732.             {
  733.                 format(string, sizeof(string), "You have now key %dth",Srt_PlayerKey[playerid]+1);
  734.             }
  735.             SendClientMessage(playerid,COLOR_YELLOW,string);
  736.         }
  737.         return 1;
  738.     }
  739.     if (strcmp("/parkrights", cmd, true, 10) == 0)
  740.     {
  741.         if(Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  742.         {
  743.             tmp = strtok(cmdtext, idx);
  744.             if(!strlen(tmp))
  745.             {
  746.                 SendClientMessage(playerid, COLOR_GREY, "USAGE: /giveparkrights  [playerid]");
  747.                 return 1;
  748.             }
  749.             new Srt_giveplayerid = ReturnUser(tmp);
  750.             if(IsPlayerConnected(Srt_giveplayerid))
  751.             {
  752.                 if(Srt_giveplayerid != INVALID_PLAYER_ID)
  753.                 {
  754.                     new Srt_giveplayer[MAX_PLAYER_NAME];
  755.                     new Srt_sendername[MAX_PLAYER_NAME];
  756.                     GetPlayerName(Srt_giveplayerid, Srt_giveplayer, sizeof(Srt_giveplayer));
  757.                     GetPlayerName(playerid, Srt_sendername, sizeof(Srt_sendername));
  758.                     Srt_ParkRights[Srt_giveplayerid] = PlayerCar[playerid][Srt_PlayerKey[playerid]][CarId];
  759.                     format(string, sizeof(string), "You gived to %s vehicle park rights!",Srt_giveplayer);
  760.                     SendClientMessage(playerid,COLOR_YELLOW,string);
  761.                     format(string, sizeof(string), "%s give you to vehicle park rights!",Srt_sendername);
  762.                     SendClientMessage(Srt_giveplayerid,COLOR_YELLOW,string);
  763.                 }
  764.             }
  765.             else
  766.             {
  767.                 SendClientMessage(playerid, COLOR_GREY, "    The player is offline");
  768.                 return 1;
  769.             }
  770.         }
  771.         else
  772.         {
  773.             SendClientMessage(playerid, COLOR_GREY, "    You don't have the right key to use this command!");
  774.             return 1;
  775.         }
  776.         return 1;
  777.     }
  778.     if (strcmp("/givecarkey", cmd, true, 10) == 0)
  779.     {
  780.         if(Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  781.         {
  782.             tmp = strtok(cmdtext, idx);
  783.             if(!strlen(tmp))
  784.             {
  785.                 SendClientMessage(playerid, COLOR_GREY, "USAGE: /givecarkey  [playerid]");
  786.                 return 1;
  787.             }
  788.             new Srt_giveplayerid = ReturnUser(tmp);
  789.             if(IsPlayerConnected(Srt_giveplayerid))
  790.             {
  791.                 if(Srt_giveplayerid != INVALID_PLAYER_ID)
  792.                 {
  793.                     new Srt_giveplayer[MAX_PLAYER_NAME];
  794.                     new Srt_sendername[MAX_PLAYER_NAME];
  795.                     GetPlayerName(Srt_giveplayerid, Srt_giveplayer, sizeof(Srt_giveplayer));
  796.                     GetPlayerName(playerid, Srt_sendername, sizeof(Srt_sendername));
  797.                     Srt_CarKey[Srt_giveplayerid] = PlayerCar[playerid][Srt_PlayerKey[playerid]][CarId];
  798.                     format(string, sizeof(string), "You gived to %s your vehicle key!",Srt_giveplayer);
  799.                     SendClientMessage(playerid,COLOR_YELLOW,string);
  800.                     format(string, sizeof(string), "%s gived you a vehicle key",Srt_sendername);
  801.                     SendClientMessage(Srt_giveplayerid,COLOR_YELLOW,string);
  802.                 }
  803.             }
  804.             else
  805.             {
  806.                 SendClientMessage(playerid, COLOR_GREY, "    The player is offline");
  807.                 return 1;
  808.             }
  809.         }
  810.         else
  811.         {
  812.             SendClientMessage(playerid, COLOR_GREY, "    You don't have the right key to use this command!");
  813.             return 1;
  814.         }
  815.         return 1;
  816.     }
  817.     return 0;
  818. }
  819.  
  820. public OnVehicleSpawn(vehicleid)
  821. {
  822.     for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  823.     {
  824.         for(new x = 0; x < MaxVeh; x++)
  825.         {
  826.             if(IsPlayerConnected(playerid) && Srt_PlayerHaveCar[playerid][x])
  827.             {
  828.                 if (vehicleid == PlayerCar[playerid][x][CarId])
  829.                 {
  830.                     SetTimerEx("CarTuning",700,0,"ii",playerid,x);
  831.                 }
  832.             }
  833.         }
  834.     }
  835. }
  836.  
  837. public OnVehicleDeath(vehicleid,killerid)
  838. {
  839.     for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  840.     {
  841.         for(new x = 0; x < MaxVeh; x++)
  842.         {
  843.             if(IsPlayerConnected(playerid) && Srt_PlayerHaveCar[playerid][x])
  844.             {
  845.                 if (vehicleid == PlayerCar[playerid][x][CarId])
  846.                 {
  847.                     DestroyVehicle(PlayerCar[playerid][x][CarId]);
  848.                     PlayerCarSpawn(playerid,x);
  849.                 }
  850.             }
  851.         }
  852.     }
  853. }
  854.  
  855. public LetDoorsLocked()
  856. {
  857.     for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  858.     {
  859.         if(IsPlayerConnected(playerid))
  860.         {
  861.             for(new i = 0; i < 700; i++)
  862.             {
  863.                 if(Srt_Carlock[i])
  864.                 {
  865.                     SetVehicleParamsForPlayer(i,playerid,0,1);
  866.                 }
  867.             }
  868.         }
  869.     }
  870. }
  871.  
  872. public CarTuning(playerid,slot)
  873. {
  874.     ChangeVehicleColor(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarC1],PlayerCar[playerid][slot][CarC2]);
  875.     if(PlayerCar[playerid][slot][CarPJ] >= 0) {ChangeVehiclePaintjob(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarPJ]);}
  876.     if(PlayerCar[playerid][slot][CarNitro] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarNitro]);}
  877.     if(PlayerCar[playerid][slot][CarHyd] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarHyd]);}
  878.     if(PlayerCar[playerid][slot][CarWheel] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarWheel]);}
  879.     if(PlayerCar[playerid][slot][CarAusp] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarAusp]);}
  880.     if(PlayerCar[playerid][slot][CarSideL] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarSideL]);}
  881.     if(PlayerCar[playerid][slot][CarSideR] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarSideR]);}
  882.     if(PlayerCar[playerid][slot][CarFB] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarFB]);}
  883.     if(PlayerCar[playerid][slot][CarRB] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarRB]);}
  884.     if(PlayerCar[playerid][slot][CarSpoiler] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarSpoiler]);}
  885.     if(PlayerCar[playerid][slot][CarRoof] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarRoof]);}
  886.     if(PlayerCar[playerid][slot][CarHood] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarHood]);}
  887.     if(PlayerCar[playerid][slot][CarVents] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarVents]);}
  888.     if(PlayerCar[playerid][slot][CarLamps] != 0) {AddVehicleComponent(PlayerCar[playerid][slot][CarId],PlayerCar[playerid][slot][CarLamps]);}
  889.     if(Srt_LockOnSpawn)
  890.     {
  891.         Srt_Carlock[PlayerCar[playerid][slot][CarId]] = 1;
  892.         Srt_LockCar(PlayerCar[playerid][slot][CarId]);
  893.     }
  894. }
  895.  
  896. public OnVehiclePaintjob(playerid,vehicleid,paintjobid)
  897. {
  898.     for(new x = 0; x < MaxVeh; x++)
  899.     {
  900.         if (vehicleid == PlayerCar[playerid][x][CarId] && Srt_PlayerHaveCar[playerid][x])
  901.         {
  902.             PlayerCar[playerid][x][CarPJ] = paintjobid;
  903.             PlayerCar[playerid][x][CarC1] = 1;
  904.             PlayerCar[playerid][x][CarC2] = 1;
  905.         }
  906.     }
  907.     return 1;
  908. }
  909.  
  910. public OnVehicleRespray(playerid,vehicleid,color1,color2)
  911. {
  912.     for(new x = 0; x < MaxVeh; x++)
  913.     {
  914.         if (vehicleid == PlayerCar[playerid][x][CarId] && Srt_PlayerHaveCar[playerid][x])
  915.         {
  916.             PlayerCar[playerid][x][CarC1] = color1;
  917.             PlayerCar[playerid][x][CarC2] = color2;
  918.         }
  919.     }
  920.     return 1;
  921. }
  922.  
  923. public OnVehicleMod(playerid,vehicleid,componentid)
  924. {
  925.     for(new x = 0; x < MaxVeh; x++)
  926.     {
  927.         if (vehicleid == PlayerCar[playerid][x][CarId] && Srt_PlayerHaveCar[playerid][x])
  928.         {
  929.             if((componentid >= 1008) && (componentid <= 1010)) {PlayerCar[playerid][x][CarNitro] = componentid;}
  930.             if((componentid >= 1142) && (componentid <= 1145)) {PlayerCar[playerid][x][CarVents] = componentid;}
  931.             if((componentid == 1013) || (componentid == 1024)) {PlayerCar[playerid][x][CarLamps] = componentid;}
  932.             if((componentid >= 1004) && (componentid <= 1005)||(componentid >= 1011) && (componentid <= 1012)) {PlayerCar[playerid][x][CarHood] = componentid;}
  933.             if(componentid == 1087) {PlayerCar[playerid][x][CarHyd] = componentid;}
  934.             if(componentid == 1086) {PlayerCar[playerid][x][CarHyd] = componentid;}
  935.             if(IsAWheel(componentid)) {PlayerCar[playerid][x][CarWheel] = componentid;}
  936.             if(IsAExhaust(componentid)) {PlayerCar[playerid][x][CarAusp] = componentid;}
  937.             if(IsASideL(componentid)) {PlayerCar[playerid][x][CarSideL] = componentid; PlayerCar[playerid][x][CarSideR] = SideR;}
  938.             if(IsASideR(componentid)) {PlayerCar[playerid][x][CarSideR] = componentid; PlayerCar[playerid][x][CarSideL] = SideL;}
  939.             if(IsAFB(componentid)) {PlayerCar[playerid][x][CarFB] = componentid;}
  940.             if(IsARB(componentid)) {PlayerCar[playerid][x][CarRB] = componentid;}
  941.             if(IsASpoiler(componentid)) {PlayerCar[playerid][x][CarSpoiler] = componentid;}
  942.             if(IsARoof(componentid)) {PlayerCar[playerid][x][CarRoof] = componentid;}
  943.         }
  944.     }
  945.     return 1;
  946. }
  947.  
  948. public OnPlayerPickUpPickup(playerid, pickupid)
  949. {
  950.     if(!Srt_LiveView)
  951.     {
  952.         if(PlayerToPoint(1.5, playerid, SrtOthers[1][0],SrtOthers[1][1],SrtOthers[1][2]) && !Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]] || pickupid == Srt_Info && !Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  953.         {
  954.             TogglePlayerControllable(playerid, 0);
  955.             ShowMenuForPlayer(Srt_HauptMenu, playerid);
  956.         }
  957.         else if(PlayerToPoint(1.5, playerid, SrtOthers[1][0],SrtOthers[1][1],SrtOthers[1][2]) && Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]] || pickupid == Srt_Info && Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  958.         {
  959.             new mv = MaxVeh;
  960.             if(mv > 1)
  961.             {
  962.                 SendClientMessage(playerid, COLOR_GREY, "    You have now your car key!");
  963.                 SendClientMessage(playerid, COLOR_GREY, "    Sell your car with /carsell or change to your vehicle key!");
  964.             }
  965.             else
  966.             {
  967.                 SendClientMessage(playerid, COLOR_GREY, "    You already own a Owner Car! Sell it with /carsell");
  968.             }
  969.         }
  970.     }
  971.     if(Srt_LiveView)
  972.     {
  973.         if(PlayerToPoint(1.5, playerid, SrtOthers[1][0],SrtOthers[1][1],SrtOthers[1][2]) && !Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]] || pickupid == Srt_Info && !Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  974.         {
  975.             TogglePlayerControllable(playerid, 0);
  976.             SetPlayerVirtualWorld(playerid,55+playerid);
  977.             new string[246];
  978.             Srt_CarownerCar[playerid] = 0;
  979.             Srt_CarownerCat[playerid] = 1;
  980.             new c1 = random(120);
  981.             new c2 = random(120);
  982.             new car = RadVehicle[0][0];
  983.             new Price = RadVehicle[0][1];
  984.             SetPlayerCameraPos(playerid, SrtOthers[4][0], SrtOthers[4][1], SrtOthers[4][2]+2);
  985.             SetPlayerCameraLookAt(playerid, SrtOthers[3][0], SrtOthers[3][1], SrtOthers[3][2]);
  986.             Srt_CarownerSCar[playerid] = CreateVehicle(car, SrtOthers[3][0], SrtOthers[3][1], SrtOthers[3][2], SrtOthers[3][3],c1,c2,-1);
  987.             SetVehicleVirtualWorld(Srt_CarownerSCar[playerid],55+playerid);
  988.             format(string,sizeof(string),"~r~---------- CAROWNER ----------~n~~g~Categorie: ~w~%s~n~~g~Vehicle: ~w~%s~n~~g~Price: ~w~$%d~n~~n~~b~Auswaehlen mit Hilfe~n~von Numpad 4 und 6~n~und der Entertaste!~n~Abbrechen mit TAB!",CatName[Srt_CarownerCat[playerid]-1],CarName[car-400],Price);
  989.             if(!CarKauf[playerid])
  990.             {
  991.                 CarKauf[playerid] = TextDrawCreate(200,310,string);
  992.                 TextDrawAlignment(CarKauf[playerid],1);
  993.                 TextDrawUseBox(CarKauf[playerid],1);
  994.                 TextDrawBoxColor(CarKauf[playerid],0x000000FF);
  995.                 TextDrawSetOutline(CarKauf[playerid],1);
  996.                 TextDrawBackgroundColor(CarKauf[playerid],COLOR_GREY);
  997.                 TextDrawFont(CarKauf[playerid], 2);
  998.                 TextDrawSetProportional(CarKauf[playerid], 2);
  999.                 TextDrawTextSize(CarKauf[playerid],450,410);
  1000.                 TextDrawShowForPlayer(playerid,CarKauf[playerid]);
  1001.             }
  1002.             else
  1003.             {
  1004.                 TextDrawHideForPlayer(playerid,CarKauf[playerid]);
  1005.                 TextDrawSetString(CarKauf[playerid],string);
  1006.                 TextDrawShowForPlayer(playerid,CarKauf[playerid]);
  1007.             }
  1008.         }
  1009.         else if(PlayerToPoint(1.5, playerid, SrtOthers[1][0],SrtOthers[1][1],SrtOthers[1][2]) && Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]] || pickupid == Srt_Info && Srt_PlayerHaveCar[playerid][Srt_PlayerKey[playerid]])
  1010.         {
  1011.             new mv = MaxVeh;
  1012.             if(mv > 1)
  1013.             {
  1014.                 SendClientMessage(playerid, COLOR_GREY, "    You have now your car key!");
  1015.                 SendClientMessage(playerid, COLOR_GREY, "    Sell your car with /carsell or change to your vehicle key!");
  1016.             }
  1017.             else
  1018.             {
  1019.                 SendClientMessage(playerid, COLOR_GREY, "    You already own a Owner Car! Sell it with /carsell");
  1020.             }
  1021.         }
  1022.     }
  1023.     return 1;
  1024. }
  1025.  
  1026. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1027. {
  1028.     if(Srt_CarownerCat[playerid] != 0 && Srt_LiveView)
  1029.     {
  1030.         if(newkeys == KEY_ANALOG_RIGHT || newkeys == KEY_LOOK_RIGHT) //right (6 Numpad/e)
  1031.         {
  1032.             new carid = Srt_CarownerCar[playerid] +1;
  1033.             new car,Price;
  1034.             if(Srt_CarownerCat[playerid] == 1)
  1035.             {
  1036.                 if(carid >= sizeof(RadVehicle))
  1037.                 {
  1038.                     carid = 0;
  1039.                     Srt_CarownerCat[playerid] =2;
  1040.                 }
  1041.             }
  1042.             else if(Srt_CarownerCat[playerid] == 2)
  1043.             {
  1044.                 if(carid >= sizeof(CheapVehicle))
  1045.                 {
  1046.                     carid = 0;
  1047.                     Srt_CarownerCat[playerid] =3;
  1048.                 }
  1049.             }
  1050.             else if(Srt_CarownerCat[playerid] == 3)
  1051.             {
  1052.                 if(carid >= sizeof(NormVehicle))
  1053.                 {
  1054.                     carid = 0;
  1055.                     Srt_CarownerCat[playerid] =4;
  1056.                 }
  1057.             }
  1058.             else if(Srt_CarownerCat[playerid] == 4)
  1059.             {
  1060.                 if(carid >= sizeof(FastVehicle))
  1061.                 {
  1062.                     carid = 0;
  1063.                     if(Srt_OtherVehicle){Srt_CarownerCat[playerid] =5;} else {Srt_CarownerCat[playerid] =1;}
  1064.                 }
  1065.             }
  1066.             else if(Srt_CarownerCat[playerid] == 5 && Srt_OtherVehicle)
  1067.             {
  1068.                 if(carid >= sizeof(OtherVehicle))
  1069.                 {
  1070.                     carid = 0;
  1071.                     Srt_CarownerCat[playerid] =1;
  1072.                 }
  1073.             }
  1074.             if(Srt_CarownerCat[playerid] == 1){car = RadVehicle[carid][0]; Price = RadVehicle[carid][1];}
  1075.             if(Srt_CarownerCat[playerid] == 2){car = CheapVehicle[carid][0]; Price = CheapVehicle[carid][1];}
  1076.             if(Srt_CarownerCat[playerid] == 3){car = NormVehicle[carid][0]; Price = NormVehicle[carid][1];}
  1077.             if(Srt_CarownerCat[playerid] == 4){car = FastVehicle[carid][0]; Price = FastVehicle[carid][1];}
  1078.             if(Srt_CarownerCat[playerid] == 5){car = OtherVehicle[carid][0]; Price = OtherVehicle[carid][1];}
  1079.             Srt_CarownerCar[playerid] = carid;
  1080.             new c1 = random(120);
  1081.             new c2 = random(120);
  1082.             DestroyVehicle(Srt_CarownerSCar[playerid]);
  1083.             Srt_CarownerSCar[playerid] = CreateVehicle(car, SrtOthers[3][0], SrtOthers[3][1], SrtOthers[3][2], SrtOthers[3][3],c1,c2,-1);
  1084.             SetVehicleVirtualWorld(Srt_CarownerSCar[playerid],55+playerid);
  1085.             new string[246];
  1086.             format(string,sizeof(string),"~r~---------- CAROWNER ----------~n~~g~Categorie: ~w~%s~n~~g~Vehicle: ~w~%s~n~~g~Price: ~w~$%d~n~~n~~b~Auswaehlen mit Hilfe~n~von Numpad 4 und 6~n~und der Entertaste!~n~Abbrechen mit TAB!",CatName[Srt_CarownerCat[playerid]-1],CarName[car-400],Price);
  1087.             TextDrawHideForPlayer(playerid,CarKauf[playerid]);
  1088.             TextDrawSetString(CarKauf[playerid],string);
  1089.             TextDrawShowForPlayer(playerid,CarKauf[playerid]);
  1090.         }
  1091.         if(newkeys == KEY_ANALOG_LEFT || newkeys == KEY_LOOK_LEFT) //left (4 Numpad/q)
  1092.         {
  1093.             new carid = Srt_CarownerCar[playerid] -1;
  1094.             new car,Price;
  1095.             if(Srt_CarownerCat[playerid] == 1)
  1096.             {
  1097.                 if(carid < 0)
  1098.                 {
  1099.                     if(Srt_OtherVehicle){carid = sizeof(OtherVehicle)-1;} else {carid = sizeof(FastVehicle)-1;}
  1100.                     if(Srt_OtherVehicle){Srt_CarownerCat[playerid] =5;} else {Srt_CarownerCat[playerid] =4;}
  1101.                 }
  1102.             }
  1103.             else if(Srt_CarownerCat[playerid] == 2)
  1104.             {
  1105.                 if(carid < 0)
  1106.                 {
  1107.                     carid = sizeof(RadVehicle)-1;
  1108.                     Srt_CarownerCat[playerid] =1;
  1109.                 }
  1110.             }
  1111.             else if(Srt_CarownerCat[playerid] == 3)
  1112.             {
  1113.                 if(carid < 0)
  1114.                 {
  1115.                     carid = sizeof(CheapVehicle)-1;
  1116.                     Srt_CarownerCat[playerid] =2;
  1117.                 }
  1118.             }
  1119.             else if(Srt_CarownerCat[playerid] == 4)
  1120.             {
  1121.                 if(carid < 0)
  1122.                 {
  1123.                     carid = sizeof(NormVehicle)-1;
  1124.                     Srt_CarownerCat[playerid] =3;
  1125.                 }
  1126.             }
  1127.             else if(Srt_CarownerCat[playerid] == 5 && Srt_OtherVehicle)
  1128.             {
  1129.                 if(carid < 0)
  1130.                 {
  1131.                     carid = sizeof(FastVehicle)-1;
  1132.                     Srt_CarownerCat[playerid] =4;
  1133.                 }
  1134.             }
  1135.             if(Srt_CarownerCat[playerid] == 1){car = RadVehicle[carid][0]; Price = RadVehicle[carid][1];}
  1136.             if(Srt_CarownerCat[playerid] == 2){car = CheapVehicle[carid][0]; Price = CheapVehicle[carid][1];}
  1137.             if(Srt_CarownerCat[playerid] == 3){car = NormVehicle[carid][0]; Price = NormVehicle[carid][1];}
  1138.             if(Srt_CarownerCat[playerid] == 4){car = FastVehicle[carid][0]; Price = FastVehicle[carid][1];}
  1139.             if(Srt_CarownerCat[playerid] == 5){car = OtherVehicle[carid][0]; Price = OtherVehicle[carid][1];}
  1140.             Srt_CarownerCar[playerid] = carid;
  1141.             new c1 = random(120);
  1142.             new c2 = random(120);
  1143.             DestroyVehicle(Srt_CarownerSCar[playerid]);
  1144.             Srt_CarownerSCar[playerid] = CreateVehicle(car, SrtOthers[3][0], SrtOthers[3][1], SrtOthers[3][2], SrtOthers[3][3],c1,c2,-1);
  1145.             SetVehicleVirtualWorld(Srt_CarownerSCar[playerid],55+playerid);
  1146.             new string[246];
  1147.             format(string,sizeof(string),"~r~---------- CAROWNER ----------~n~~g~Categorie: ~w~%s~n~~g~Vehicle: ~w~%s~n~~g~Price: ~w~$%d~n~~n~~b~Auswaehlen mit Hilfe~n~von Numpad 4 und 6~n~und der Entertaste!~n~Abbrechen mit TAB!",CatName[Srt_CarownerCat[playerid]-1],CarName[car-400],Price);
  1148.             TextDrawHideForPlayer(playerid,CarKauf[playerid]);
  1149.             TextDrawSetString(CarKauf[playerid],string);
  1150.             TextDrawShowForPlayer(playerid,CarKauf[playerid]);
  1151.         }
  1152.         if(newkeys == 16)//Enter
  1153.         {
  1154.             //"Bikes", "Cheap Vehicles", "Normal Vehicles", "Fast Vehicle", "Other Vehicles"
  1155.             switch(Srt_CarownerCat[playerid])
  1156.             {
  1157.                 case 1:
  1158.                 {
  1159.                     if(GetPlayerMoney(playerid) < RadVehicle[Srt_CarownerCar[playerid]][1])
  1160.                     {
  1161.                         new string[128];
  1162.                         format(string, sizeof(string), "    You don't have $%d !", RadVehicle[Srt_CarownerCar[playerid]][1]);
  1163.                         SendClientMessage(playerid, COLOR_GREY, string);
  1164.                         return 0;
  1165.                     }
  1166.                     OnPlayerBuyCar(playerid,RadVehicle[Srt_CarownerCar[playerid]][0],RadVehicle[Srt_CarownerCar[playerid]][1]);
  1167.                 }
  1168.                 case 2:
  1169.                 {
  1170.                     if(GetPlayerMoney(playerid) < CheapVehicle[Srt_CarownerCar[playerid]][1])
  1171.                     {
  1172.                         new string[128];
  1173.                         format(string, sizeof(string), "    You don't have $%d !", CheapVehicle[Srt_CarownerCar[playerid]][1]);
  1174.                         SendClientMessage(playerid, COLOR_GREY, string);
  1175.                         return 0;
  1176.                     }
  1177.                     OnPlayerBuyCar(playerid,CheapVehicle[Srt_CarownerCar[playerid]][0],CheapVehicle[Srt_CarownerCar[playerid]][1]);
  1178.                 }
  1179.                 case 3:
  1180.                 {
  1181.                     if(GetPlayerMoney(playerid) < NormVehicle[Srt_CarownerCar[playerid]][1])
  1182.                     {
  1183.                         new string[128];
  1184.                         format(string, sizeof(string), "    You don't have $%d !", NormVehicle[Srt_CarownerCar[playerid]][1]);
  1185.                         SendClientMessage(playerid, COLOR_GREY, string);
  1186.                         return 0;
  1187.                     }
  1188.                     OnPlayerBuyCar(playerid,NormVehicle[Srt_CarownerCar[playerid]][0],NormVehicle[Srt_CarownerCar[playerid]][1]);
  1189.                 }
  1190.                 case 4:
  1191.                 {
  1192.                     if(GetPlayerMoney(playerid) < FastVehicle[Srt_CarownerCar[playerid]][1])
  1193.                     {
  1194.                         new string[128];
  1195.                         format(string, sizeof(string), "    You don't have $%d !", FastVehicle[Srt_CarownerCar[playerid]][1]);
  1196.                         SendClientMessage(playerid, COLOR_GREY, string);
  1197.                         return 0;
  1198.                     }
  1199.                     OnPlayerBuyCar(playerid,FastVehicle[Srt_CarownerCar[playerid]][0],FastVehicle[Srt_CarownerCar[playerid]][1]);
  1200.                 }
  1201.                 case 5:
  1202.                 {
  1203.                     if(GetPlayerMoney(playerid) < OtherVehicle[Srt_CarownerCar[playerid]][1])
  1204.                     {
  1205.                         new string[128];
  1206.                         format(string, sizeof(string), "    You don't have $%d !", OtherVehicle[Srt_CarownerCar[playerid]][1]);
  1207.                         SendClientMessage(playerid, COLOR_GREY, string);
  1208.                         return 0;
  1209.                     }
  1210.                     OnPlayerBuyCar(playerid,OtherVehicle[Srt_CarownerCar[playerid]][0],OtherVehicle[Srt_CarownerCar[playerid]][1]);
  1211.                 }
  1212.             }
  1213.             //ResetPlayer
  1214.             SetCameraBehindPlayer(playerid);
  1215.             DestroyVehicle(Srt_CarownerSCar[playerid]);
  1216.             Srt_CarownerCar[playerid] = 0;
  1217.             Srt_CarownerCat[playerid] = 0;
  1218.             SetPlayerVirtualWorld(playerid,0);
  1219.             TextDrawHideForPlayer(playerid,CarKauf[playerid]);
  1220.             TogglePlayerControllable(playerid,1);
  1221.         }
  1222.         if(newkeys == KEY_ACTION) //Tab
  1223.         {
  1224.             //ResetPlayer
  1225.             SetCameraBehindPlayer(playerid);
  1226.             DestroyVehicle(Srt_CarownerSCar[playerid]);
  1227.             Srt_CarownerCar[playerid] = 0;
  1228.             Srt_CarownerCat[playerid] = 0;
  1229.             SetPlayerVirtualWorld(playerid,0);
  1230.             TextDrawHideForPlayer(playerid,CarKauf[playerid]);
  1231.             TogglePlayerControllable(playerid,1);
  1232.         }
  1233.     }
  1234.     return 1;
  1235. }
  1236.  
  1237. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  1238. {
  1239.     if(IsPlayerConnected(playerid))
  1240.     {
  1241.         new Float:oldposx, Float:oldposy, Float:oldposz;
  1242.         new Float:tempposx, Float:tempposy, Float:tempposz;
  1243.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  1244.         tempposx = (oldposx -x);
  1245.         tempposy = (oldposy -y);
  1246.         tempposz = (oldposz -z);
  1247.         //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  1248.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  1249.         {
  1250.             return 1;
  1251.         }
  1252.     }
  1253.     return 0;
  1254. }
  1255.  
  1256. public OnPlayerSelectedMenuRow(playerid, row)
  1257. {
  1258.     new Menu:CurrentMenu = GetPlayerMenu(playerid);
  1259.     if(CurrentMenu == Srt_HauptMenu && Srt_OtherVehicle)
  1260.     {
  1261.         switch(row)
  1262.         {
  1263.             case 0: // Fast
  1264.             {
  1265.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1266.                 ShowMenuForPlayer(Srt_FastMenu,playerid);
  1267.             }
  1268.             case 1: // Normal
  1269.             {
  1270.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1271.                 ShowMenuForPlayer(Srt_NormMenu,playerid);
  1272.             }
  1273.             case 2: // Cheap
  1274.             {
  1275.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1276.                 ShowMenuForPlayer(Srt_CheapMenu,playerid);
  1277.             }
  1278.             case 3: // 2R?der
  1279.             {
  1280.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1281.                 ShowMenuForPlayer(Srt_2RadMenu,playerid);
  1282.             }
  1283.             case 4: // Others
  1284.             {
  1285.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1286.                 ShowMenuForPlayer(Srt_OtherMenu,playerid);
  1287.             }
  1288.             case 5: // Exit
  1289.             {
  1290.                 TogglePlayerControllable(playerid, 0);
  1291.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1292.             }
  1293.         }
  1294.     }
  1295.     if(CurrentMenu == Srt_HauptMenu && !Srt_OtherVehicle)
  1296.     {
  1297.         switch(row)
  1298.         {
  1299.             case 0: // Fast
  1300.             {
  1301.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1302.                 ShowMenuForPlayer(Srt_FastMenu,playerid);
  1303.             }
  1304.             case 1: // Normale
  1305.             {
  1306.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1307.                 ShowMenuForPlayer(Srt_NormMenu,playerid);
  1308.             }
  1309.             case 2: // Cheap
  1310.             {
  1311.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1312.                 ShowMenuForPlayer(Srt_CheapMenu,playerid);
  1313.             }
  1314.             case 3: // 2R?der
  1315.             {
  1316.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1317.                 ShowMenuForPlayer(Srt_2RadMenu,playerid);
  1318.             }
  1319.             case 4: // Others
  1320.             {
  1321.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1322.                 ShowMenuForPlayer(Srt_OtherMenu,playerid);
  1323.             }
  1324.             case 5: // Exit
  1325.             {
  1326.                 TogglePlayerControllable(playerid, 0);
  1327.                 HideMenuForPlayer(Srt_HauptMenu,playerid);
  1328.             }
  1329.         }
  1330.     }
  1331.     if(CurrentMenu == Srt_2RadMenu) // 2Rad Menu
  1332.     {
  1333.         HideMenuForPlayer(Srt_2RadMenu,playerid);
  1334.         TogglePlayerControllable(playerid, 1);
  1335.         if(GetPlayerMoney(playerid) < RadVehicle[row][1])
  1336.         {
  1337.             new string[128];
  1338.             format(string, sizeof(string), "    You don't have $%d !", RadVehicle[row][1]);
  1339.             SendClientMessage(playerid, COLOR_GREY, string);
  1340.             return 1;
  1341.         }
  1342.         OnPlayerBuyCar(playerid,RadVehicle[row][0],RadVehicle[row][1]);
  1343.     }
  1344.     if(CurrentMenu == Srt_OtherMenu) // Other Menu
  1345.     {
  1346.         HideMenuForPlayer(Srt_OtherMenu,playerid);
  1347.         TogglePlayerControllable(playerid, 1);
  1348.         if(GetPlayerMoney(playerid) < OtherVehicle[row][1])
  1349.         {
  1350.             new string[128];
  1351.             format(string, sizeof(string), "    You don't have $%d !", OtherVehicle[row][1]);
  1352.             SendClientMessage(playerid, COLOR_GREY, string);
  1353.             return 1;
  1354.         }
  1355.         OnPlayerBuyCar(playerid,OtherVehicle[row][0],OtherVehicle[row][1]);
  1356.     }
  1357.     if(CurrentMenu == Srt_CheapMenu) // Cheap Menu
  1358.     {
  1359.         HideMenuForPlayer(Srt_CheapMenu,playerid);
  1360.         TogglePlayerControllable(playerid, 1);
  1361.         if(GetPlayerMoney(playerid) < CheapVehicle[row][1])
  1362.         {
  1363.             new string[128];
  1364.             format(string, sizeof(string), "    You don't have $%d !", CheapVehicle[row][1]);
  1365.             SendClientMessage(playerid, COLOR_GREY, string);
  1366.             return 1;
  1367.         }
  1368.         OnPlayerBuyCar(playerid,CheapVehicle[row][0],CheapVehicle[row][1]);
  1369.     }
  1370.     if(CurrentMenu == Srt_NormMenu) // Norm Menu
  1371.     {
  1372.         HideMenuForPlayer(Srt_NormMenu,playerid);
  1373.         TogglePlayerControllable(playerid, 1);
  1374.         if(GetPlayerMoney(playerid) < NormVehicle[row][1])
  1375.         {
  1376.             new string[128];
  1377.             format(string, sizeof(string), "    You don't have $%d !", NormVehicle[row][1]);
  1378.             SendClientMessage(playerid, COLOR_GREY, string);
  1379.             return 1;
  1380.         }
  1381.         OnPlayerBuyCar(playerid,NormVehicle[row][0],NormVehicle[row][1]);
  1382.     }
  1383.     if(CurrentMenu == Srt_FastMenu) // Fast Menu
  1384.     {
  1385.         HideMenuForPlayer(Srt_FastMenu,playerid);
  1386.         TogglePlayerControllable(playerid, 1);
  1387.         if(GetPlayerMoney(playerid) < FastVehicle[row][1])
  1388.         {
  1389.             new string[128];
  1390.             format(string, sizeof(string), "    You don't have $%d !", FastVehicle[row][1]);
  1391.             SendClientMessage(playerid, COLOR_GREY, string);
  1392.             return 1;
  1393.         }
  1394.         OnPlayerBuyCar(playerid,FastVehicle[row][0],FastVehicle[row][1]);
  1395.     }
  1396.     return 1;
  1397. }
  1398.  
  1399. public OnPlayerExitedMenu(playerid)
  1400. {
  1401.     TogglePlayerControllable(playerid, 1);
  1402.     return 1;
  1403. }
  1404.  
  1405. public IsASideR(componentid)
  1406. {
  1407.     if(componentid == 1007)
  1408.     {
  1409.         SideL = 1017;
  1410.         return 1;
  1411.     }
  1412.     if(componentid == 1026)
  1413.     {
  1414.         SideL = 1027;
  1415.         return 1;
  1416.     }
  1417.     if(componentid == 1030)
  1418.     {
  1419.         SideL = 1031;
  1420.         return 1;
  1421.     }
  1422.     if(componentid == 1040)
  1423.     {
  1424.         SideL = 1036;
  1425.         return 1;
  1426.     }
  1427.     if(componentid == 1041)
  1428.     {
  1429.         SideL = 1039;
  1430.         return 1;
  1431.     }
  1432.     if(componentid == 1042)
  1433.     {
  1434.         SideL = 1099;
  1435.         return 1;
  1436.     }
  1437.     if(componentid == 1051)
  1438.     {
  1439.         SideL = 1047;
  1440.         return 1;
  1441.     }
  1442.     if(componentid == 1048)
  1443.     {
  1444.         SideL = 1052;
  1445.         return 1;
  1446.     }
  1447.     if(componentid == 1056)
  1448.     {
  1449.         SideL = 1062;
  1450.         return 1;
  1451.     }
  1452.     if(componentid == 1063)
  1453.     {
  1454.         SideL = 1057;
  1455.         return 1;
  1456.     }
  1457.     if(componentid == 1069)
  1458.     {
  1459.         SideL = 1071;
  1460.         return 1;
  1461.     }
  1462.     if(componentid == 1072)
  1463.     {
  1464.         SideL = 1070;
  1465.         return 1;
  1466.     }
  1467.     if(componentid == 1094)
  1468.     {
  1469.         SideL = 1090;
  1470.         return 1;
  1471.     }
  1472.     if(componentid == 1093)
  1473.     {
  1474.         SideL = 1095;
  1475.         return 1;
  1476.     }
  1477.     if(componentid == 1122)
  1478.     {
  1479.         SideL = 1101;
  1480.         return 1;
  1481.     }
  1482.     if(componentid == 1102)
  1483.     {
  1484.         SideL = 1133;
  1485.         return 1;
  1486.     }
  1487.     if(componentid == 1124)
  1488.     {
  1489.         SideL = 1106;
  1490.         return 1;
  1491.     }
  1492.     if(componentid == 1107)
  1493.     {
  1494.         SideL = 1108;
  1495.         return 1;
  1496.     }
  1497.     if(componentid == 1118)
  1498.     {
  1499.         SideL = 1120;
  1500.         return 1;
  1501.     }
  1502.     if(componentid == 1137)
  1503.     {
  1504.         SideL = 1134;
  1505.         return 1;
  1506.     }
  1507.     return 0;
  1508. }
  1509.  
  1510. public IsASideL(componentid)
  1511. {
  1512.     if(componentid == 1134)
  1513.     {
  1514.         SideR = 1137;
  1515.         return 1;
  1516.     }
  1517.     if(componentid == 1119)
  1518.     {
  1519.         SideR = 1121;
  1520.         return 1;
  1521.     }
  1522.     if(componentid == 1120)
  1523.     {
  1524.         SideR = 1118;
  1525.         return 1;
  1526.     }
  1527.     if(componentid == 1108)
  1528.     {
  1529.         SideR = 1107;
  1530.         return 1;
  1531.     }
  1532.     if(componentid == 1017)
  1533.     {
  1534.         SideR = 1007;
  1535.         return 1;
  1536.     }
  1537.     if(componentid == 1027)
  1538.     {
  1539.         SideR = 1026;
  1540.         return 1;
  1541.     }
  1542.     if(componentid == 1031)
  1543.     {
  1544.         SideR = 1030;
  1545.         return 1;
  1546.     }
  1547.     if(componentid == 1036)
  1548.     {
  1549.         SideR = 1040;
  1550.         return 1;
  1551.     }
  1552.     if(componentid == 1039)
  1553.     {
  1554.         SideR = 1041;
  1555.         return 1;
  1556.     }
  1557.     if(componentid == 1099)
  1558.     {
  1559.         SideR = 1042;
  1560.         return 1;
  1561.     }
  1562.     if(componentid == 1047)
  1563.     {
  1564.         SideR = 1051;
  1565.         return 1;
  1566.     }
  1567.     if(componentid == 1052)
  1568.     {
  1569.         SideR = 1048;
  1570.         return 1;
  1571.     }
  1572.     if(componentid == 1062)
  1573.     {
  1574.         SideR = 1056;
  1575.         return 1;
  1576.     }
  1577.     if(componentid == 1057)
  1578.     {
  1579.         SideR = 1063;
  1580.         return 1;
  1581.     }
  1582.     if(componentid == 1071)
  1583.     {
  1584.         SideR = 1069;
  1585.         return 1;
  1586.     }
  1587.     if(componentid == 1070)
  1588.     {
  1589.         SideR = 1072;
  1590.         return 1;
  1591.     }
  1592.     if(componentid == 1090)
  1593.     {
  1594.         SideR = 1094;
  1595.         return 1;
  1596.     }
  1597.     if(componentid == 1095)
  1598.     {
  1599.         SideR = 1093;
  1600.         return 1;
  1601.     }
  1602.     if(componentid == 1095)
  1603.     {
  1604.         SideR = 1093;
  1605.         return 1;
  1606.     }
  1607.     if(componentid == 1101)
  1608.     {
  1609.         SideR = 1122;
  1610.         return 1;
  1611.     }
  1612.     if(componentid == 1133)
  1613.     {
  1614.         SideR = 1102;
  1615.         return 1;
  1616.     }
  1617.     if(componentid == 1106)
  1618.     {
  1619.         SideR = 1124;
  1620.         return 1;
  1621.     }
  1622.     return 0;
  1623. }
  1624.  
  1625. public IsAFB(componentid)
  1626. {
  1627.     if(componentid >= 1152 && componentid <= 1153 || componentid >= 1165 && componentid <= 1166)
  1628.     {
  1629.         return 1;
  1630.     }
  1631.     if(componentid == 1155 || componentid == 1157 || componentid == 1160 || componentid == 1176 || componentid == 1179 || componentid == 1185)
  1632.     {
  1633.         return 1;
  1634.     }
  1635.     if(componentid >= 1169 && componentid <= 1174 || componentid >= 1181 && componentid <= 1182)
  1636.     {
  1637.         return 1;
  1638.     }
  1639.     if(componentid >= 1188 && componentid <= 1191)
  1640.     {
  1641.         return 1;
  1642.     }
  1643.     return 0;
  1644. }
  1645.  
  1646. public IsARB(componentid)
  1647. {
  1648.     if(componentid >= 1140 && componentid <= 1141 || componentid >= 1148 && componentid <= 1151)
  1649.     {
  1650.         return 1;
  1651.     }
  1652.     if(componentid == 1154 || componentid == 1156 || componentid == 1159 || componentid == 1161 || componentid == 1175 || componentid == 1180)
  1653.     {
  1654.         return 1;
  1655.     }
  1656.     if(componentid >= 1167 && componentid <= 1168 || componentid >= 1177 && componentid <= 1178)
  1657.     {
  1658.         return 1;
  1659.     }
  1660.     if(componentid >= 1183 && componentid <= 1184 || componentid >= 1186 && componentid <= 1187)
  1661.     {
  1662.         return 1;
  1663.     }
  1664.     if(componentid >= 1192 && componentid <= 1193)
  1665.     {
  1666.         return 1;
  1667.     }
  1668.     return 0;
  1669. }
  1670.  
  1671. public IsASpoiler(componentid)
  1672. {
  1673.     if(componentid >= 1000 && componentid <= 1003 || componentid >= 1014 && componentid <= 1016)
  1674.     {
  1675.         return 1;
  1676.     }
  1677.     if(componentid == 1023 || componentid == 1058 || componentid == 1158)
  1678.     {
  1679.         return 1;
  1680.     }
  1681.     if(componentid >= 1049 && componentid <= 1050 || componentid >= 1138 && componentid <= 1139)
  1682.     {
  1683.         return 1;
  1684.     }
  1685.     if(componentid >= 1146 && componentid <= 1147 || componentid >= 1162 && componentid <= 1164)
  1686.     {
  1687.         return 1;
  1688.     }
  1689.     return 0;
  1690. }
  1691.  
  1692. public IsARoof(componentid)
  1693. {
  1694.     if(componentid >= 1032 && componentid <= 1033 || componentid >= 1053 && componentid <= 1055)
  1695.     {
  1696.         return 1;
  1697.     }
  1698.     if(componentid == 1035 || componentid == 1038 || componentid == 1061 || componentid == 1088 || componentid == 1091)
  1699.     {
  1700.         return 1;
  1701.     }
  1702.     if(componentid == 1103 || componentid == 1128)
  1703.     {
  1704.         return 1;
  1705.     }
  1706.     if(componentid >= 1067 && componentid <= 1068 || componentid >= 1130 && componentid <= 1131)
  1707.     {
  1708.         return 1;
  1709.     }
  1710.     return 0;
  1711. }
  1712.  
  1713. public IsAExhaust(componentid)
  1714. {
  1715.     if(componentid >= 1018 && componentid <= 1022)
  1716.     {
  1717.         return 1;
  1718.     }
  1719.     if(componentid >= 1028 && componentid <= 1029)
  1720.     {
  1721.         return 1;
  1722.     }
  1723.     if(componentid == 1037 || componentid == 1059 || componentid == 1089 || componentid == 1092 || componentid == 1132)
  1724.     {
  1725.         return 1;
  1726.     }
  1727.     if(componentid == 1104 || componentid == 1105 || componentid == 1113 || componentid == 1114 || componentid == 1129)
  1728.     {
  1729.         return 1;
  1730.     }
  1731.     if(componentid == 1135 || componentid == 1136)
  1732.     {
  1733.         return 1;
  1734.     }
  1735.     if(componentid >= 1043 && componentid <= 1046)
  1736.     {
  1737.         return 1;
  1738.     }
  1739.     if(componentid >= 1126 && componentid <= 1127)
  1740.     {
  1741.         return 1;
  1742.     }
  1743.     if(componentid >= 1064 && componentid <= 1066)
  1744.     {
  1745.         return 1;
  1746.     }
  1747.     return 0;
  1748. }
  1749.  
  1750. public IsAWheel(componentid)
  1751. {
  1752.     if(componentid >= 1073 && componentid <= 1085)
  1753.     {
  1754.         return 1;
  1755.     }
  1756.     if(componentid >= 1096 && componentid <= 1098)
  1757.     {
  1758.         return 1;
  1759.     }
  1760.     if(componentid == 1025)
  1761.     {
  1762.         return 1;
  1763.     }
  1764.     return 0;
  1765. }
  1766.  
  1767. stock ini_GetKey( line[] )
  1768. {
  1769.     new keyRes[256];
  1770.     keyRes[0] = 0;
  1771.     if ( strfind( line , "=" , true ) == -1 ) return keyRes;
  1772.     strmid( keyRes , line , 0 , strfind( line , "=" , true ) , sizeof( keyRes) );
  1773.     return keyRes;
  1774. }
  1775.  
  1776. stock ini_GetValue( line[] )
  1777. {
  1778.     new valRes[256];
  1779.     valRes[0]=0;
  1780.     if ( strfind( line , "=" , true ) == -1 ) return valRes;
  1781.     strmid( valRes , line , strfind( line , "=" , true )+1 , strlen( line ) , sizeof( valRes ) );
  1782.     return valRes;
  1783. }
  1784.  
  1785. public Srt_LockCar(carid)
  1786. {
  1787.     for(new i = 0; i < MAX_PLAYERS; i++)
  1788.     {
  1789.         if(IsPlayerConnected(i))
  1790.         {
  1791.             SetVehicleParamsForPlayer(carid,i,0,1);
  1792.         }
  1793.     }
  1794. }
  1795.  
  1796. public Srt_UnLockCar(carid)
  1797. {
  1798.     for(new i = 0; i < MAX_PLAYERS; i++)
  1799.     {
  1800.         if(IsPlayerConnected(i))
  1801.         {
  1802.             SetVehicleParamsForPlayer(carid,i,0,0);
  1803.         }
  1804.     }
  1805. }
  1806.  
  1807. public IsASrtcar(car) //!CallRemoteFunction("IsASrtcar","i",c)
  1808. {
  1809.     for(new playerid = 0; playerid < MAX_PLAYERS; playerid++)
  1810.     {
  1811.         for(new x = 0; x < MaxVeh; x++)
  1812.         {
  1813.             if(IsPlayerConnected(playerid) && Srt_PlayerHaveCar[playerid][x])
  1814.             {
  1815.                 if (car == PlayerCar[playerid][x][CarId])
  1816.                 {
  1817.                     return 1;
  1818.                 }
  1819.             }
  1820.         }
  1821.     }
  1822.     return 0;
  1823. }
  1824.  
  1825. strtok(const string[], &index)
  1826. {
  1827.     new length = strlen(string);
  1828.     while ((index < length) && (string[index] <= ' '))
  1829.     {
  1830.         index++;
  1831.     }
  1832.  
  1833.     new offset = index;
  1834.     new result[20];
  1835.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  1836.     {
  1837.         result[index - offset] = string[index];
  1838.         index++;
  1839.     }
  1840.     result[index - offset] = EOS;
  1841.     return result;
  1842. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement