Advertisement
Guest User

[AJUDA] [FS]cRodrigo - GuiihCamargo

a guest
Mar 17th, 2012
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 61.48 KB | None | 0 0
  1. #define FILTERSCRIPT
  2. #include <a_samp>
  3. #include <dini>
  4.  
  5. #define AzulLindo 0x3FCFFFFF
  6. #define Azul 0x33CCFFAA
  7. #define Branco 0xFFFFFFAA
  8.  
  9. //Nome dos Carros
  10. new vehName[][] ={
  11. "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster",
  12. "Limosine","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulancia","Leviathan","Moonbeam","Esperanto",
  13. "Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Premier","Enforcer","Securicar","Banshee",
  14. "Predator","Bus","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo",
  15. "RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer",
  16. "Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer",
  17. "PCJ-600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot",
  18. "Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR-350","Walton","Regina","Comet","BMX",
  19. "Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo",
  20. "Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Maverick Policial","Boxville","Benson","Mesa",
  21. "RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT","Elegant",
  22. "Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic",
  23. "Buccaneer","Shamal","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona",
  24. "FBI Truck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight",
  25. "Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob",
  26. "Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A","Monster B","Uranus",
  27. "Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight",
  28. "Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford",
  29. "BF-400","Newsvan","Tug","Trailer A","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C",
  30. "Andromada","Dodo","RC Cam","Launch","Viatura (LSPD)","Viatura (SFPD)","Viatura (LVPD)","Police Ranger",
  31. "Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
  32. "Stair Trailer","Boxville","Farm Plow","Utility Trailer" };
  33.  
  34. //===[ Sistema PART 1 ]===
  35. #define MAX_cCARROS 101 // 1 a mais do máximo (Máximo = 50)
  36. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  37. forward CarregarCarros();
  38. forward SalvarCarro(cCarroid);
  39. forward ComprarCarro(playerid);
  40. forward FuncaocCarro(playerid);
  41. forward CarroVida(playerid);
  42. forward PrecoCarro(playerid);
  43. forward DiniCarro(playerid);
  44. new CarroVidaTimer;
  45. enum cInfo
  46. {
  47.     cDono[MAX_PLAYER_NAME],
  48.     cModelo,
  49.     Float:cSpawnX,
  50.     Float:cSpawnY,
  51.     Float:cSpawnZ,
  52.     Float:cAngulo,
  53.     cCarroON,
  54.     cCorUm,
  55.     cCorDois,
  56.     cChave[MAX_cCARROS],
  57.     cCID
  58. };
  59. new Carro[MAX_cCARROS][cInfo];
  60. new cCarro[MAX_cCARROS];
  61. //new cCarr[MAX_cCARROS];
  62. new TaNoCarro[MAX_PLAYERS];
  63. new ModeloCarro[MAX_PLAYERS];
  64. //------------------------------------------------------------------------------
  65. //===[ Sistema PART 2 ]===
  66. forward CarregarDono(playerid);
  67. forward SalvarDono(playerid);
  68. enum dInfo
  69. {
  70.     dChave,
  71.     dDono[MAX_PLAYER_NAME],
  72. };
  73. new Dono[MAX_PLAYERS][dInfo];
  74.  
  75. //Preços
  76. #define PRECO_Bravura 35000
  77. #define PRECO_Buffalo 45000
  78. #define PRECO_Perenniel 35000
  79. #define PRECO_Sentinel 35000
  80. #define PRECO_Limosine 60000
  81. #define PRECO_Manana 35000
  82. #define PRECO_Voodoo 40000
  83. #define PRECO_Cheetah 45000
  84. #define PRECO_Moonbeam 35000
  85. #define PRECO_Esperanto 35000
  86. #define PRECO_Washington 35000
  87. #define PRECO_Premier 35000
  88. #define PRECO_Banshee 50000
  89. #define PRECO_Hotknife 50000
  90. #define PRECO_Previon 35000
  91. #define PRECO_Stallion 35000
  92. #define PRECO_Romero 35000
  93. #define PRECO_Admiral 35000
  94. #define PRECO_Turismo 65000
  95. #define PRECO_Solair 35000
  96. #define PRECO_Glendale 35000
  97. #define PRECO_Oceanic 35000
  98. #define PRECO_Hermes 35000
  99. #define PRECO_Sabre 35000
  100. #define PRECO_ZR350 45000
  101. #define PRECO_Regina 35000
  102. #define PRECO_Comet 40000
  103. #define PRECO_Camper 35000
  104. #define PRECO_Virgo 35000
  105. #define PRECO_Greenwood 40000
  106. #define PRECO_BlistaCompact 35000
  107. #define PRECO_SuperGT 45000
  108. #define PRECO_Elegant 35000
  109. #define PRECO_Nebula 35000
  110. #define PRECO_Majestic 35000
  111. #define PRECO_Buccaneer 35000
  112. #define PRECO_Fortune 35000
  113. #define PRECO_Cadrona 35000
  114. #define PRECO_Willard 35000
  115. #define PRECO_Feltzer 35000
  116. #define PRECO_Remington 35000
  117. #define PRECO_Slamvan 35000
  118. #define PRECO_Blade 35000
  119. #define PRECO_Vincent 35000
  120. #define PRECO_Bullet 50000
  121. #define PRECO_Clover 35000
  122. #define PRECO_Hustler 35000
  123. #define PRECO_Intruder 35000
  124. #define PRECO_Primo 35000
  125. #define PRECO_Tampa 35000
  126. #define PRECO_Sunrise 35000
  127. #define PRECO_Merit 35000
  128. #define PRECO_Windsor 35000
  129. #define PRECO_Uranus 45000
  130. #define PRECO_Jester 40000
  131. #define PRECO_Sultan 45000
  132. #define PRECO_Stratum 35000
  133. #define PRECO_Elegy 45000
  134. #define PRECO_Flash 35000
  135. #define PRECO_Tahoma 35000
  136. #define PRECO_Savanna 40000
  137. #define PRECO_Broadway 35000
  138. #define PRECO_Tornado 35000
  139. #define PRECO_Stafford 35000
  140. #define PRECO_Emperor 35000
  141. #define PRECO_Euros 45000
  142. #define PRECO_Club 35000
  143. #define PRECO_Alpha 40000
  144. #define PRECO_Phoenix 45000
  145.  
  146. //------------------------------------------------------------------------------
  147.  
  148. /*strtok(const string[], &index)
  149. {
  150.     new length = strlen(string);
  151.     while ((index < length) && (string[index] <= ' '))
  152.     {
  153.         index++;
  154.     }
  155.  
  156.     new offset = index;
  157.     new result[20];
  158.     while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
  159.     {
  160.         result[index - offset] = string[index];
  161.         index++;
  162.     }
  163.     result[index - offset] = EOS;
  164.     return result;
  165. }*/
  166.  
  167. public CarroVida(playerid)
  168. {
  169.     new Float:Vida;
  170.     new VID = GetPlayerVehicleID(playerid);
  171.     GetVehicleHealth(VID, Vida);
  172.     if(Vida < 244)
  173.     {
  174.         new car = TaNoCarro[playerid];
  175.         if(car > 0)
  176.         {
  177.             DestroyVehicle(cCarro[car]);
  178.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Seu carro foi destruído... Lamentamos, sem re-imbolso.");
  179.             TaNoCarro[playerid] = 0;
  180.             strmid(Carro[car][cDono], "Ninguem", 0, strlen("Ninguem"), 256);
  181.             KillTimer(CarroVidaTimer);
  182.             return 1;
  183.         }
  184.     }
  185.     return 0;
  186. }
  187.  
  188. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  189. {
  190.     for(new c = 0; c < sizeof(Carro); c++)
  191.     {
  192.         if(Carro[c][cCID] == vehicleid)
  193.         {
  194.             new string[256];
  195.             format(string, sizeof(string), "[CONCESSIONÁRIA] Este(a) %s pertence à %s.", vehName[GetVehicleModel(vehicleid)-400], Carro[c][cDono]);
  196.             SendClientMessage(playerid, Branco, " ");
  197.             SendClientMessage(playerid, Azul, string);
  198.         }
  199.     }
  200.     return 1;
  201. }
  202.  
  203. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  204. {
  205.     if(dialogid == 1319)
  206.     {
  207.         if(response == 1)
  208.         {
  209.             if(listitem == 0)
  210.             {
  211.                 ShowPlayerDialog(playerid,1320,DIALOG_STYLE_MSGBOX,"Concessionária","Tem certeza que deseja vender seu carro?","Sim","Não");
  212.             }
  213.             if(listitem == 1)
  214.             {
  215.                 new textdialog[3000];
  216.                 strins(textdialog,"Bravura - R$35.000\n",strlen(textdialog)); //401
  217.                 strins(textdialog,"Buffalo - R$45.000\n",strlen(textdialog)); //402
  218.                 strins(textdialog,"Perenniel - R$35.000\n",strlen(textdialog)); //404
  219.                 strins(textdialog,"Sentinel - R$35.000\n",strlen(textdialog)); //405
  220.                 strins(textdialog,"Limosine - R$60.000\n",strlen(textdialog)); //409
  221.                 strins(textdialog,"Manana - R$35.000\n",strlen(textdialog)); //410
  222.                 strins(textdialog,"Voodoo - R$40.000\n",strlen(textdialog)); //412
  223.                 strins(textdialog,"Cheetah - R$45.000\n",strlen(textdialog)); //415
  224.                 strins(textdialog,"Moonbeam - R$35.000\n",strlen(textdialog)); //418 //350000
  225.                 strins(textdialog,"Esperanto - R$35.000\n",strlen(textdialog)); //419
  226.                 strins(textdialog,"Washington - R$35.000\n",strlen(textdialog)); //421
  227.                 strins(textdialog,"Premier - R$35.000\n",strlen(textdialog)); //426 //35.0000
  228.                 strins(textdialog,"Banshee - R$50.000\n",strlen(textdialog)); //429
  229.                 strins(textdialog,"Hotknife - R$50.000\n",strlen(textdialog)); //434
  230.                 strins(textdialog,"Previon - R$35.000\n",strlen(textdialog)); //436
  231.                 strins(textdialog,"Stallion - R$35.000\n",strlen(textdialog)); //439
  232.                 strins(textdialog,"Romero - R$35.000\n",strlen(textdialog)); //442
  233.                 strins(textdialog,"Admiral - R$35.000\n",strlen(textdialog)); //445
  234.                 strins(textdialog,"Turismo - R$65.000\n",strlen(textdialog)); //451
  235.                 strins(textdialog,"Solair - R$35.000\n",strlen(textdialog)); //458
  236.                 strins(textdialog,"Glendale - R$35.000\n",strlen(textdialog)); //466
  237.                 strins(textdialog,"Oceanic - R$35.000\n",strlen(textdialog)); //467
  238.                 strins(textdialog,"Hermes - R$35.000\n",strlen(textdialog)); //474
  239.                 strins(textdialog,"Sabre - R$35.000\n",strlen(textdialog)); //475
  240.                 strins(textdialog,"ZR-350 - R$45.000\n",strlen(textdialog)); //477
  241.                 strins(textdialog,"Regina - R$35.000\n",strlen(textdialog)); //479
  242.                 strins(textdialog,"Comet - R$40.000\n",strlen(textdialog)); //480
  243.                 strins(textdialog,"Camper - R$35.000\n",strlen(textdialog)); //483
  244.                 strins(textdialog,"Virgo - R$35.000\n",strlen(textdialog)); //491
  245.                 strins(textdialog,"Greenwood - R$40.000\n",strlen(textdialog)); //492
  246.                 strins(textdialog,"Blista Compact - R$35.000\n",strlen(textdialog)); //496
  247.                 strins(textdialog,"Super GT - R$45.000\n",strlen(textdialog)); //506
  248.                 strins(textdialog,"Elegant - R$35.000\n",strlen(textdialog)); //507
  249.                 strins(textdialog,"Nebula - R$35.000\n",strlen(textdialog)); //516
  250.                 strins(textdialog,"Majestic - R$35.000\n",strlen(textdialog)); //517
  251.                 strins(textdialog,"Buccaneer - R$35.000\n",strlen(textdialog)); //518
  252.                 strins(textdialog,"Fortune - R$35.000\n",strlen(textdialog)); //526
  253.                 strins(textdialog,"Cadrona - R$35.000\n",strlen(textdialog)); //527
  254.                 strins(textdialog,"Willard - R$35.000\n",strlen(textdialog)); //529
  255.                 strins(textdialog,"Feltzer - R$35.000\n",strlen(textdialog)); //533
  256.                 strins(textdialog,"Remington - R$35.000\n",strlen(textdialog)); //534
  257.                 strins(textdialog,"Slamvan - R$35.000\n",strlen(textdialog)); //535
  258.                 strins(textdialog,"Blade - R$35.000\n",strlen(textdialog)); //536
  259.                 strins(textdialog,"Vincent - R$35.000\n",strlen(textdialog)); //540
  260.                 strins(textdialog,"Bullet - R$35.000\n",strlen(textdialog)); //541
  261.                 strins(textdialog,"Clover - R$35.000\n",strlen(textdialog)); //542
  262.                 strins(textdialog,"Hustler - R$35.000\n",strlen(textdialog)); //545
  263.                 strins(textdialog,"Intruder - R$35.000\n",strlen(textdialog)); //546
  264.                 strins(textdialog,"Primo - R$35.000\n",strlen(textdialog)); //547
  265.                 strins(textdialog,"Tampa - R$35.000\n",strlen(textdialog)); //549
  266.                 strins(textdialog,"Sunrise - R$35.000\n",strlen(textdialog)); //550
  267.                 strins(textdialog,"Merit - R$35.000\n",strlen(textdialog)); //551
  268.                 strins(textdialog,"Windsor - R$35.000\n",strlen(textdialog)); //555
  269.                 strins(textdialog,"Uranus - R$45.000\n",strlen(textdialog)); //558
  270.                 strins(textdialog,"Jester - R$40.000\n",strlen(textdialog)); //559
  271.                 strins(textdialog,"Sultan - R$45.000\n",strlen(textdialog)); //560
  272.                 strins(textdialog,"Stratum - R$35.000\n",strlen(textdialog)); //561
  273.                 strins(textdialog,"Elegy - R$45.000\n",strlen(textdialog)); //562
  274.                 strins(textdialog,"Flash - R$35.000\n",strlen(textdialog)); //565
  275.                 strins(textdialog,"Tahoma - R$35.000\n",strlen(textdialog)); //566
  276.                 strins(textdialog,"Savanna - R$40.000\n",strlen(textdialog)); //567
  277.                 strins(textdialog,"Broadway - R$35.000\n",strlen(textdialog)); //575
  278.                 strins(textdialog,"Tornado - R$35.000\n",strlen(textdialog)); //576
  279.                 strins(textdialog,"Stafford - R$35.000\n",strlen(textdialog)); //580
  280.                 strins(textdialog,"Emperor - R$35.000\n",strlen(textdialog)); //585
  281.                 strins(textdialog,"Euros - R$45.000\n",strlen(textdialog)); //587
  282.                 strins(textdialog,"Club - R$35.000\n",strlen(textdialog)); //589
  283.                 strins(textdialog,"Alpha - R$40.000\n",strlen(textdialog)); //602
  284.                 strins(textdialog,"Phoenix - R$45.000",strlen(textdialog)); //603
  285.                 ShowPlayerDialog(playerid,1321,DIALOG_STYLE_LIST,"Qual carro você deseja comprar?",textdialog,"Selecionar","Cancelar");
  286.             }
  287.         }
  288.         else
  289.         {
  290.             //Tudo que vai acontecer no botão direito.
  291.         }
  292.     }
  293.     if(dialogid == 1320)
  294.     {
  295.         if(response == 1)
  296.         {
  297.             new PlayerNick[MAX_PLAYER_NAME];
  298.             GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
  299.             CarregarDono(playerid);
  300.             new arquivo[256];
  301.             format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
  302.             new carro = Dono[playerid][dChave];
  303.             if(dini_Exists(arquivo))
  304.             {
  305.                 strmid(Carro[carro][cDono], "Ninguem", 0, strlen("Ninguem"), 256);
  306.                 Carro[carro][cCarroON] = 0;
  307.                 Carro[carro][cModelo] = 0;
  308.                 Carro[carro][cSpawnX] = 0.000000;
  309.                 Carro[carro][cSpawnY] = 0.000000;
  310.                 Carro[carro][cSpawnZ] = 0.000000;
  311.                 Carro[carro][cAngulo] = 0.000000;
  312.                 Carro[carro][cCorUm] = 0;
  313.                 Carro[carro][cCorDois] = 0;
  314.                 dini_Remove(arquivo);
  315.                 DestroyVehicle(cCarro[carro]);
  316.                 SalvarCarro(carro);
  317.                 SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Carro vendido com sucesso!");
  318.             }
  319.             else
  320.             {
  321.                 SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Você não tem um carro!");
  322.             }
  323.         }
  324.         else
  325.         {
  326.             SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Venda do carro cancelada!");
  327.         }
  328.     }
  329.     if(dialogid == 1321)
  330.     {
  331.         if(response == 1)
  332.         {
  333.             if(listitem == 0){ ModeloCarro[playerid] = 401; PrecoCarro(playerid); }
  334.             if(listitem == 1){ ModeloCarro[playerid] = 402; PrecoCarro(playerid); }
  335.             if(listitem == 2){ ModeloCarro[playerid] = 404; PrecoCarro(playerid); }
  336.             if(listitem == 3){ ModeloCarro[playerid] = 405; PrecoCarro(playerid); }
  337.             if(listitem == 4){ ModeloCarro[playerid] = 409; PrecoCarro(playerid); }
  338.             if(listitem == 5){ ModeloCarro[playerid] = 410; PrecoCarro(playerid); }
  339.             if(listitem == 6){ ModeloCarro[playerid] = 412; PrecoCarro(playerid); }
  340.             if(listitem == 7){ ModeloCarro[playerid] = 415; PrecoCarro(playerid); }
  341.             if(listitem == 8){ ModeloCarro[playerid] = 418; PrecoCarro(playerid); }
  342.             if(listitem == 9){ ModeloCarro[playerid] = 419; PrecoCarro(playerid); }
  343.             if(listitem == 10){ ModeloCarro[playerid] = 421; PrecoCarro(playerid); }
  344.             if(listitem == 11){ ModeloCarro[playerid] = 426; PrecoCarro(playerid); }
  345.             if(listitem == 12){ ModeloCarro[playerid] = 429; PrecoCarro(playerid); }
  346.             if(listitem == 13){ ModeloCarro[playerid] = 434; PrecoCarro(playerid); }
  347.             if(listitem == 14){ ModeloCarro[playerid] = 436; PrecoCarro(playerid); }
  348.             if(listitem == 15){ ModeloCarro[playerid] = 439; PrecoCarro(playerid); }
  349.             if(listitem == 16){ ModeloCarro[playerid] = 442; PrecoCarro(playerid); }
  350.             if(listitem == 17){ ModeloCarro[playerid] = 445; PrecoCarro(playerid); }
  351.             if(listitem == 18){ ModeloCarro[playerid] = 451; PrecoCarro(playerid); }
  352.             if(listitem == 19){ ModeloCarro[playerid] = 458; PrecoCarro(playerid); }
  353.             if(listitem == 20){ ModeloCarro[playerid] = 466; PrecoCarro(playerid); }
  354.             if(listitem == 21){ ModeloCarro[playerid] = 467; PrecoCarro(playerid); }
  355.             if(listitem == 22){ ModeloCarro[playerid] = 474; PrecoCarro(playerid); }
  356.             if(listitem == 23){ ModeloCarro[playerid] = 475; PrecoCarro(playerid); }
  357.             if(listitem == 24){ ModeloCarro[playerid] = 477; PrecoCarro(playerid); }
  358.             if(listitem == 25){ ModeloCarro[playerid] = 479; PrecoCarro(playerid); }
  359.             if(listitem == 26){ ModeloCarro[playerid] = 480; PrecoCarro(playerid); }
  360.             if(listitem == 27){ ModeloCarro[playerid] = 483; PrecoCarro(playerid); }
  361.             if(listitem == 28){ ModeloCarro[playerid] = 491; PrecoCarro(playerid); }
  362.             if(listitem == 29){ ModeloCarro[playerid] = 492; PrecoCarro(playerid); }
  363.             if(listitem == 30){ ModeloCarro[playerid] = 496; PrecoCarro(playerid); }
  364.             if(listitem == 31){ ModeloCarro[playerid] = 506; PrecoCarro(playerid); }
  365.             if(listitem == 32){ ModeloCarro[playerid] = 507; PrecoCarro(playerid); }
  366.             if(listitem == 33){ ModeloCarro[playerid] = 516; PrecoCarro(playerid); }
  367.             if(listitem == 34){ ModeloCarro[playerid] = 517; PrecoCarro(playerid); }
  368.             if(listitem == 35){ ModeloCarro[playerid] = 518; PrecoCarro(playerid); }
  369.             if(listitem == 36){ ModeloCarro[playerid] = 526; PrecoCarro(playerid); }
  370.             if(listitem == 37){ ModeloCarro[playerid] = 527; PrecoCarro(playerid); }
  371.             if(listitem == 38){ ModeloCarro[playerid] = 529; PrecoCarro(playerid); }
  372.             if(listitem == 39){ ModeloCarro[playerid] = 533; PrecoCarro(playerid); }
  373.             if(listitem == 40){ ModeloCarro[playerid] = 534; PrecoCarro(playerid); }
  374.             if(listitem == 41){ ModeloCarro[playerid] = 535; PrecoCarro(playerid); }
  375.             if(listitem == 42){ ModeloCarro[playerid] = 536; PrecoCarro(playerid); }
  376.             if(listitem == 43){ ModeloCarro[playerid] = 540; PrecoCarro(playerid); }
  377.             if(listitem == 44){ ModeloCarro[playerid] = 541; PrecoCarro(playerid); }
  378.             if(listitem == 45){ ModeloCarro[playerid] = 542; PrecoCarro(playerid); }
  379.             if(listitem == 46){ ModeloCarro[playerid] = 545; PrecoCarro(playerid); }
  380.             if(listitem == 47){ ModeloCarro[playerid] = 546; PrecoCarro(playerid); }
  381.             if(listitem == 48){ ModeloCarro[playerid] = 547; PrecoCarro(playerid); }
  382.             if(listitem == 49){ ModeloCarro[playerid] = 549; PrecoCarro(playerid); }
  383.             if(listitem == 50){ ModeloCarro[playerid] = 550; PrecoCarro(playerid); }
  384.             if(listitem == 51){ ModeloCarro[playerid] = 551; PrecoCarro(playerid); }
  385.             if(listitem == 52){ ModeloCarro[playerid] = 555; PrecoCarro(playerid); }
  386.             if(listitem == 53){ ModeloCarro[playerid] = 558; PrecoCarro(playerid); }
  387.             if(listitem == 54){ ModeloCarro[playerid] = 559; PrecoCarro(playerid); }
  388.             if(listitem == 55){ ModeloCarro[playerid] = 560; PrecoCarro(playerid); }
  389.             if(listitem == 56){ ModeloCarro[playerid] = 561; PrecoCarro(playerid); }
  390.             if(listitem == 57){ ModeloCarro[playerid] = 562; PrecoCarro(playerid); }
  391.             if(listitem == 58){ ModeloCarro[playerid] = 565; PrecoCarro(playerid); }
  392.             if(listitem == 59){ ModeloCarro[playerid] = 566; PrecoCarro(playerid); }
  393.             if(listitem == 60){ ModeloCarro[playerid] = 567; PrecoCarro(playerid); }
  394.             if(listitem == 61){ ModeloCarro[playerid] = 575; PrecoCarro(playerid); }
  395.             if(listitem == 62){ ModeloCarro[playerid] = 576; PrecoCarro(playerid); }
  396.             if(listitem == 63){ ModeloCarro[playerid] = 580; PrecoCarro(playerid); }
  397.             if(listitem == 64){ ModeloCarro[playerid] = 585; PrecoCarro(playerid); }
  398.             if(listitem == 65){ ModeloCarro[playerid] = 587; PrecoCarro(playerid); }
  399.             if(listitem == 66){ ModeloCarro[playerid] = 589; PrecoCarro(playerid); }
  400.             if(listitem == 67){ ModeloCarro[playerid] = 602; PrecoCarro(playerid); }
  401.             if(listitem == 68){ ModeloCarro[playerid] = 603; PrecoCarro(playerid); }
  402.         }
  403.         else
  404.         {
  405.             SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Compra de carro cancelada.");
  406.         }
  407.     }
  408.     return 0;
  409. }
  410.  
  411. public OnPlayerDisconnect(playerid)
  412. {
  413.     new car = TaNoCarro[playerid];
  414.     if(car > 0)
  415.     {
  416.         DestroyVehicle(cCarro[car]);
  417.         TaNoCarro[playerid] = 0;
  418.         strmid(Carro[car][cDono], "Ninguem", 0, strlen("Ninguem"), 256);
  419.         return 1;
  420.     }
  421.     return 0;
  422. }
  423.  
  424. public OnPlayerExitVehicle(playerid, vehicleid)
  425. {
  426.     new tcar = TaNoCarro[playerid];
  427.     if(tcar > 0)
  428.     {
  429.         DestroyVehicle(cCarro[tcar]);
  430.         SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você foi avisado...");
  431.         TaNoCarro[playerid] = 0;
  432.         strmid(Carro[tcar][cDono], "Ninguem", 0, strlen("Ninguem"), 256);
  433.         return 1;
  434.     }
  435.     return 0;
  436. }
  437.  
  438. public OnPlayerCommandText(playerid, cmdtext[])
  439. {
  440. new idx;
  441. new cmd[256];
  442. cmd = strtok(cmdtext, idx);
  443. if(strcmp(cmd, "/admvcarrito", true) == 0)
  444. {
  445. if(IsPlayerConnected(playerid))
  446. {
  447. if(IsPlayerAdmin(playerid))
  448. {
  449. new comando[256];
  450. comando = strtok(cmdtext, idx);
  451. if(!strlen(comando))
  452. {
  453. SendClientMessage(playerid, Branco, "USE: /admv [ cCarro ID ]");
  454. return 1;
  455. }
  456. new carrito = strval(comando);
  457. if(Carro[carrito][cCarroON] > 0)
  458. {
  459. new arquivo[256];
  460. strmid(Carro[carrito][cDono], dini_Get(arquivo,"cDono"), 0, strlen(dini_Get(arquivo,"cDono")), 32);
  461. format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",Carro[carrito][cDono]);
  462. strmid(Carro[carrito][cDono], "Ninguem", 0, strlen("Ninguem"), 256);
  463. Carro[carrito][cCarroON] = 0;
  464. Carro[carrito][cModelo] = 0;
  465. Carro[carrito][cSpawnX] = 0.000000;
  466. Carro[carrito][cSpawnY] = 0.000000;
  467. Carro[carrito][cSpawnZ] = 0.000000;
  468. Carro[carrito][cAngulo] = 0.000000;
  469. Carro[carrito][cCorUm] = 0;
  470. Carro[carrito][cCorDois] = 0;
  471. DestroyVehicle(cCarro[carrito]);
  472. dini_Remove(arquivo);
  473. SalvarCarro(carrito);
  474. SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Carro vendido com sucesso!");
  475. }
  476. else
  477. {
  478. SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Esse carro não tem dono.");
  479. return 1;
  480. }
  481. }
  482. }
  483. return 1;
  484. }
  485. if(strcmp(cmdtext,"/carroestacionar",true)==0)
  486. {
  487. if(IsPlayerInAnyVehicle(playerid))
  488. {
  489. new Float:X,Float:Y,Float:Z;
  490. new Float:A;
  491. new VID = GetPlayerVehicleID(playerid);
  492. CarregarDono(playerid);
  493. new PlayerNick[MAX_PLAYER_NAME];
  494. GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
  495. new arquivo[256];
  496. format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
  497. if(dini_Exists(arquivo))
  498. {
  499. new carro = Dono[playerid][dChave];
  500. if(Carro[carro][cCID] == VID)
  501. {
  502. if(strcmp(PlayerNick,Carro[carro][cDono],true)==0)
  503. {
  504. GetVehicleZAngle(VID,A);
  505. GetVehiclePos(VID,X,Y,Z);
  506. Carro[carro][cSpawnX] = X;
  507. Carro[carro][cSpawnY] = Y;
  508. Carro[carro][cSpawnZ] = Z;
  509. Carro[carro][cAngulo] = A;
  510. strmid(Carro[carro][cDono], PlayerNick, 0, strlen(PlayerNick), MAX_PLAYER_NAME);
  511. Carro[carro][cCarroON] = 1;
  512. DestroyVehicle(cCarro[carro]);
  513. cCarro[carro] = AddStaticVehicle(Carro[carro][cModelo],Carro[carro][cSpawnX],Carro[carro][cSpawnY],Carro[carro][cSpawnZ],Carro[carro][cAngulo],Carro[carro][cCorUm],Carro[carro][cCorDois]);
  514. PutPlayerInVehicle(playerid, cCarro[carro], 0);
  515. Carro[carro][cCID] = VID;
  516. SalvarCarro(carro);
  517. CarregarCarros();
  518. SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Carro estacionado com sucesso!");
  519. return 1;
  520. }
  521. }
  522. else
  523. {
  524. SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Este carro não é seu!");
  525. return 1;
  526. }
  527. }
  528. new car = TaNoCarro[playerid];
  529. if(car > 0)
  530. {
  531. GetVehicleZAngle(VID,A);
  532. GetVehiclePos(VID,X,Y,Z);
  533. Carro[car][cSpawnX] = X;
  534. Carro[car][cSpawnY] = Y;
  535. Carro[car][cSpawnZ] = Z;
  536. Carro[car][cAngulo] = A;
  537. Carro[car][cCarroON] = 1;
  538. Dono[playerid][dChave] = car;
  539. DestroyVehicle(cCarro[car]);
  540. cCarro[car] = AddStaticVehicle(ModeloCarro[playerid],Carro[car][cSpawnX],Carro[car][cSpawnY],Carro[car][cSpawnZ],Carro[car][cAngulo],Carro[car][cCorUm],Carro[car][cCorDois]);
  541. PutPlayerInVehicle(playerid, cCarro[car], 0);
  542. Carro[car][cCID] = VID;
  543. ComprarCarro(playerid);
  544. SalvarCarro(car);
  545. SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Carro estacionado com sucesso!");
  546. TaNoCarro[playerid] = 0;
  547. return 1;
  548. }
  549. else
  550. {
  551. SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Você não está em um carro da concessionária...");
  552. return 1;
  553. }
  554. }
  555. return 1;
  556. }
  557. if(strcmp(cmdtext,"/concessionaria",true)==0)
  558. {
  559. if(PlayerToPoint(3, playerid, 2780.4939,-1812.2635,11.8438))
  560. {
  561. ShowPlayerDialog(playerid,1319,DIALOG_STYLE_LIST,"Concessionária","Vender Carro\nComprar Um Carro","Selecionar","Cancelar");
  562. TogglePlayerControllable(playerid, 1);
  563. return 1;
  564. }
  565. return 1;
  566. }
  567. if(strcmp(cmdtext,"/irconcessionaria",true)==0)
  568. {
  569. if(IsPlayerAdmin(playerid))
  570. {
  571. SendClientMessage(playerid, Branco, "Você foi teletransportado para a Concessionária.");
  572. SetPlayerPos(playerid, 2780.4939,-1812.2635,11.8438);
  573. return 1;
  574. }
  575. else
  576. {
  577. SendClientMessage(playerid, Branco, "Você não é um administrador rcon!");
  578. return 1;
  579. }
  580. }
  581. if(strcmp(cmdtext,"/dinicriar",true)==0)
  582. {
  583. if(IsPlayerAdmin(playerid))
  584. {
  585. DiniCarro(playerid);
  586. return 1;
  587. }
  588. else
  589. {
  590. SendClientMessage(playerid, Branco, "Você não tem autorização para isso.");
  591. return 1;
  592. }
  593. }
  594. if(strcmp(cmd,"/carrocor",true)==0)
  595. {
  596. if(IsPlayerInAnyVehicle(playerid))
  597. {
  598. CarregarDono(playerid);
  599. new PlayerNick[MAX_PLAYER_NAME];
  600. GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
  601. new Comando[256];
  602. new Comando2[256];
  603. Comando = strtok(cmdtext, idx);
  604. Comando2 = strtok(cmdtext, idx);
  605. new Cor1;
  606. new Cor2;
  607. Cor1 = strval(Comando);
  608. Cor2 = strval(Comando2);
  609. new arquivo[256];
  610. format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
  611. if(!strlen(Comando))
  612. {
  613. SendClientMessage(playerid, 0xFFFFFFFF, "[CONCESSIONÁRIA] Digite /carrocor [cor1] [cor2]");
  614. return 1;
  615. }
  616. if(!strlen(Comando2))
  617. {
  618. SendClientMessage(playerid, 0xFFFFFFFF, "[CONCESSIONÁRIA] Digite /carrocor [cor1] [cor2]");
  619. return 1;
  620. }
  621. if(dini_Exists(arquivo))
  622. {
  623. new carro = Dono[playerid][dChave];
  624. ChangeVehicleColor(cCarro[carro], Cor1, Cor2);
  625. Carro[carro][cCorUm] = Cor1;
  626. Carro[carro][cCorDois] = Cor2;
  627. SalvarCarro(carro);
  628. SendClientMessage(playerid, Azul, " ");
  629. SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Carro pintado com sucesso!");
  630. return 1;
  631. }
  632. }
  633. return 1;
  634. }
  635. return 0;
  636. }
  637.  
  638. public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
  639. {
  640.     if(newkeys == 16)
  641.     {
  642.         OnPlayerCommandText(playerid,"/concessionaria");
  643.     }
  644.     return 1;
  645. }
  646.  
  647. public OnFilterScriptInit()
  648. {
  649.     CarregarCarros();
  650.     for(new c = 0; c < sizeof(Carro); c++)
  651.     {
  652.         if(Carro[c][cCarroON] == 1)
  653.         {
  654.             cCarro[c] = CreateVehicle(Carro[c][cModelo],Carro[c][cSpawnX],Carro[c][cSpawnY],Carro[c][cSpawnZ],Carro[c][cAngulo],Carro[c][cCorUm],Carro[c][cCorDois], 60);
  655.             Carro[c][cCID] = cCarro[c];
  656.         }
  657.     }
  658.     CreatePickup(1272, 23, 2780.4939,-1812.2635,11.8438);
  659.     Create3DTextLabel("Concessionária\nAperte 'F' Para Acessar",AzulLindo,2780.4939,-1812.2635,11.8438,15, 0, 50);
  660.     return 0;
  661. }
  662.  
  663. public CarregarCarros()
  664. {
  665.     new arquivo[256];
  666.     new idx = 1;
  667.     while (idx < sizeof(Carro))
  668.     {
  669.         format(arquivo, sizeof(arquivo), "/Concessionaria/Carros/Carro%d.ini",idx);
  670.         strmid(Carro[idx][cDono], dini_Get(arquivo,"cDono"), 0, strlen(dini_Get(arquivo,"cDono")), 32);
  671.         Carro[idx][cCarroON] = dini_Int(arquivo,"cCarroON");
  672.         Carro[idx][cModelo] = dini_Int(arquivo,"cModelo");
  673.         Carro[idx][cSpawnX] = dini_Float(arquivo,"cSpawnX");
  674.         Carro[idx][cSpawnY] = dini_Float(arquivo,"cSpawnY");
  675.         Carro[idx][cSpawnZ] = dini_Float(arquivo,"cSpawnZ");
  676.         Carro[idx][cAngulo] = dini_Float(arquivo,"cAngulo");
  677.         Carro[idx][cCorUm] = dini_Int(arquivo,"CorUm");
  678.         Carro[idx][cCorDois] = dini_Int(arquivo,"cCorDois");
  679.         printf(" ");
  680.         printf(" ");
  681.         printf("=====[ CARREGANDO CARRO: %d ]=====",idx);
  682.         printf(" ");
  683.         printf(" ");
  684.         idx ++;
  685.     }
  686.     return 1;
  687. }
  688.  
  689. public DiniCarro(playerid)
  690. {
  691.     new arquivo[256];
  692.     new idx = 1;
  693.     new string[256];
  694.     while (idx < sizeof(Carro))
  695.     {
  696.         format(arquivo, sizeof(arquivo), "/Concessionaria/Carros/Carro%d.ini",idx);
  697.         if(!dini_Exists(arquivo))
  698.         {
  699.             new chave = idx;
  700.             dini_Create(arquivo);
  701.             dini_Set(arquivo,"cDono","Ninguem");
  702.             dini_IntSet(arquivo,"cCarroON",Carro[idx][cCarroON]);
  703.             dini_IntSet(arquivo,"cModelo",Carro[idx][cModelo]);
  704.             dini_FloatSet(arquivo,"cSpawnX",Carro[idx][cSpawnX]);
  705.             dini_FloatSet(arquivo,"cSpawnY",Carro[idx][cSpawnY]);
  706.             dini_FloatSet(arquivo,"cSpawnZ",Carro[idx][cSpawnZ]);
  707.             dini_FloatSet(arquivo,"cAngulo",Carro[idx][cAngulo]);
  708.             dini_IntSet(arquivo,"CorUm",Carro[idx][cCorUm]);
  709.             dini_IntSet(arquivo,"CorDois",Carro[idx][cCorDois]);
  710.             dini_IntSet(arquivo,"cChave", chave);
  711.             printf(" ");
  712.             printf(" ");
  713.             printf("=====[ DINI, Carro %d ]=====",idx);
  714.             printf("Criada");
  715.             printf(" ");
  716.             format(string, sizeof(string), "[CONCESSIONÁRIA] DINI do Carro ' %d ' criada com sucesso...",idx);
  717.             SendClientMessage(playerid, Azul, string);
  718.             idx ++;
  719.             CarregarCarros();
  720.         }
  721.         else
  722.         {
  723.             format(string, sizeof(string), "[CONCESSIONÁRIA] DINI do Carro ' %d ' já existe....",idx);
  724.             SendClientMessage(playerid, Branco, string);
  725.             idx ++;
  726.         }
  727.     }
  728.     return 1;
  729. }
  730.  
  731. forward SalvarCarros();
  732. public SalvarCarros()
  733. {
  734.     new arquivo[256];
  735.     new idx = 1;
  736.     while (idx < sizeof(Carro))
  737.     {
  738.         format(arquivo, sizeof(arquivo), "/Concessionaria/Carros/Carro%d.ini",idx);
  739.         dini_Set(arquivo,"cDono",Carro[idx][cDono]);
  740.         dini_IntSet(arquivo,"cCarroON",Carro[idx][cCarroON]);
  741.         dini_IntSet(arquivo,"cModelo",Carro[idx][cModelo]);
  742.         dini_FloatSet(arquivo,"cSpawnX",Carro[idx][cSpawnX]);
  743.         dini_FloatSet(arquivo,"cSpawnY",Carro[idx][cSpawnY]);
  744.         dini_FloatSet(arquivo,"cSpawnZ",Carro[idx][cSpawnZ]);
  745.         dini_FloatSet(arquivo,"cAngulo",Carro[idx][cAngulo]);
  746.         dini_IntSet(arquivo,"CorUm",Carro[idx][cCorUm]);
  747.         dini_IntSet(arquivo,"CorDois",Carro[idx][cCorDois]);
  748.         printf(" ");
  749.         printf(" ");
  750.         printf("=====[ SALVANDO CARRO: %d ]=====",idx);
  751.         printf(" ");
  752.         printf(" ");
  753.         idx ++;
  754.     }
  755.     return 1;
  756. }
  757.  
  758. public SalvarCarro(cCarroid)
  759. {
  760.     new arquivo[256];
  761.     format(arquivo, sizeof(arquivo), "/Concessionaria/Carros/Carro%d.ini",cCarroid);
  762.     dini_Set(arquivo,"cDono",Carro[cCarroid][cDono]);
  763.     dini_IntSet(arquivo,"cCarroON",Carro[cCarroid][cCarroON]);
  764.     dini_IntSet(arquivo,"cModelo",Carro[cCarroid][cModelo]);
  765.     dini_FloatSet(arquivo,"cSpawnX",Carro[cCarroid][cSpawnX]);
  766.     dini_FloatSet(arquivo,"cSpawnY",Carro[cCarroid][cSpawnY]);
  767.     dini_FloatSet(arquivo,"cSpawnZ",Carro[cCarroid][cSpawnZ]);
  768.     dini_FloatSet(arquivo,"cAngulo",Carro[cCarroid][cAngulo]);
  769.     dini_IntSet(arquivo,"CorUm",Carro[cCarroid][cCorUm]);
  770.     dini_IntSet(arquivo,"CorDois",Carro[cCarroid][cCorDois]);
  771.     printf(" ");
  772.     printf(" ");
  773.     printf("=====[ SALVANDO CARRO: %d ]=====",cCarroid);
  774.     printf(" ");
  775.     printf(" ");
  776.     return 1;
  777. }
  778.  
  779. public CarregarDono(playerid)
  780. {
  781.     new PlayerNick[MAX_PLAYER_NAME];
  782.     GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
  783.     new arquivo[256];
  784.     format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
  785.     if(dini_Exists(arquivo))
  786.     {
  787.         strmid(Dono[playerid][dDono], dini_Get(arquivo,"dDono"), 0, strlen(dini_Get(arquivo,"dDono")), 32);
  788.         Dono[playerid][dChave] = dini_Int(arquivo,"dChave");
  789.     }
  790.     return 1;
  791. }
  792.  
  793. public SalvarDono(playerid)
  794. {
  795.     new PlayerNick[MAX_PLAYER_NAME];
  796.     GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
  797.     new arquivo[256];
  798.     format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
  799.     dini_Set(arquivo,"dDono",Dono[playerid][dDono]);
  800.     dini_IntSet(arquivo,"dChave",Dono[playerid][dChave]);
  801.     return 1;
  802. }
  803.  
  804. public ComprarCarro(playerid)
  805. {
  806.     for(new i=0; i<MAX_PLAYERS; i++)
  807.     {
  808.         new PlayerNick[MAX_PLAYER_NAME];
  809.         GetPlayerName(i,PlayerNick,sizeof(PlayerNick));
  810.         new arquivo[256];
  811.         new arquivo2[256];
  812.         new car = TaNoCarro[i];
  813.         if(car > 0)
  814.         {
  815.             format(arquivo, sizeof(arquivo), "/Concessionaria/Carros/Carro%d.ini", car);
  816.             strmid(Carro[car][cDono], PlayerNick, 0, strlen(PlayerNick), MAX_PLAYER_NAME);
  817.             dini_Set(arquivo,"cDono",PlayerNick);
  818.             Carro[car][cModelo] = ModeloCarro[playerid];
  819.             dini_IntSet(arquivo,"cCarroON",Carro[car][cCarroON]);
  820.             dini_IntSet(arquivo,"cModelo",Carro[car][cModelo]);
  821.             dini_FloatSet(arquivo,"cSpawnX",Carro[car][cSpawnX]);
  822.             dini_FloatSet(arquivo,"cSpawnY",Carro[car][cSpawnY]);
  823.             dini_FloatSet(arquivo,"cSpawnZ",Carro[car][cSpawnZ]);
  824.             dini_FloatSet(arquivo,"cAngulo",Carro[car][cAngulo]);
  825.             dini_IntSet(arquivo,"CorUm",Carro[car][cCorUm]);
  826.             dini_IntSet(arquivo,"CorDois",Carro[car][cCorDois]);
  827.             format(arquivo2, sizeof(arquivo2), "/Concessionaria/Donos/%s.ini",PlayerNick);
  828.             if(!dini_Exists(arquivo2))
  829.             {
  830.                 dini_Create(arquivo2);
  831.                 dini_Set(arquivo2,"dDono",PlayerNick);
  832.                 dini_IntSet(arquivo2,"dChave",Dono[i][dChave]);
  833.                 ModeloCarro[playerid] = 0;
  834.             }
  835.             return 1;
  836.         }
  837.     }
  838.     return 1;
  839. }
  840. public PrecoCarro(playerid)
  841. {
  842.     if(ModeloCarro[playerid] == 401)
  843.     {
  844.         if(GetPlayerMoney(playerid) > PRECO_Bravura)
  845.         {
  846.             GivePlayerMoney(playerid, -PRECO_Bravura);
  847.             FuncaocCarro(playerid);
  848.         }
  849.         else
  850.         {
  851.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  852.         }
  853.     }
  854.     if(ModeloCarro[playerid] == 402)
  855.     {
  856.         if(GetPlayerMoney(playerid) > PRECO_Buffalo)
  857.         {
  858.             GivePlayerMoney(playerid, -PRECO_Buffalo);
  859.             FuncaocCarro(playerid);
  860.         }
  861.         else
  862.         {
  863.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  864.         }
  865.     }
  866.     if(ModeloCarro[playerid] == 404)
  867.     {
  868.         if(GetPlayerMoney(playerid) > PRECO_Perenniel)
  869.         {
  870.             GivePlayerMoney(playerid, -PRECO_Perenniel);
  871.             FuncaocCarro(playerid);
  872.         }
  873.         else
  874.         {
  875.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  876.         }
  877.     }
  878.     if(ModeloCarro[playerid] == 405)
  879.     {
  880.         if(GetPlayerMoney(playerid) > PRECO_Sentinel)
  881.         {
  882.             GivePlayerMoney(playerid, -PRECO_Sentinel);
  883.             FuncaocCarro(playerid);
  884.         }
  885.         else
  886.         {
  887.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  888.         }
  889.     }
  890.     if(ModeloCarro[playerid] == 409)
  891.     {
  892.         if(GetPlayerMoney(playerid) > PRECO_Limosine)
  893.         {
  894.             GivePlayerMoney(playerid, -PRECO_Limosine);
  895.             FuncaocCarro(playerid);
  896.         }
  897.         else
  898.         {
  899.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  900.         }
  901.     }
  902.     if(ModeloCarro[playerid] == 410)
  903.     {
  904.         if(GetPlayerMoney(playerid) > PRECO_Manana)
  905.         {
  906.             GivePlayerMoney(playerid, -PRECO_Manana);
  907.             FuncaocCarro(playerid);
  908.         }
  909.         else
  910.         {
  911.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  912.         }
  913.     }
  914.     if(ModeloCarro[playerid] == 412)
  915.     {
  916.         if(GetPlayerMoney(playerid) > PRECO_Voodoo)
  917.         {
  918.             GivePlayerMoney(playerid, -PRECO_Voodoo);
  919.             FuncaocCarro(playerid);
  920.         }
  921.         else
  922.         {
  923.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  924.         }
  925.     }
  926.     if(ModeloCarro[playerid] == 415)
  927.     {
  928.         if(GetPlayerMoney(playerid) > PRECO_Cheetah)
  929.         {
  930.             GivePlayerMoney(playerid, -PRECO_Cheetah);
  931.             FuncaocCarro(playerid);
  932.         }
  933.         else
  934.         {
  935.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  936.         }
  937.     }
  938.     if(ModeloCarro[playerid] == 418)
  939.     {
  940.         if(GetPlayerMoney(playerid) > PRECO_Moonbeam)
  941.         {
  942.             GivePlayerMoney(playerid, -PRECO_Moonbeam);
  943.             FuncaocCarro(playerid);
  944.         }
  945.         else
  946.         {
  947.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  948.         }
  949.     }
  950.     if(ModeloCarro[playerid] == 419)
  951.     {
  952.         if(GetPlayerMoney(playerid) > PRECO_Esperanto)
  953.         {
  954.             GivePlayerMoney(playerid, -PRECO_Esperanto);
  955.             FuncaocCarro(playerid);
  956.         }
  957.         else
  958.         {
  959.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  960.         }
  961.     }
  962.     if(ModeloCarro[playerid] == 421)
  963.     {
  964.         if(GetPlayerMoney(playerid) > PRECO_Washington)
  965.         {
  966.             GivePlayerMoney(playerid, -PRECO_Washington);
  967.             FuncaocCarro(playerid);
  968.         }
  969.         else
  970.         {
  971.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  972.         }
  973.     }
  974.     if(ModeloCarro[playerid] == 426)
  975.     {
  976.         if(GetPlayerMoney(playerid) > PRECO_Premier)
  977.         {
  978.             GivePlayerMoney(playerid, -PRECO_Premier);
  979.             FuncaocCarro(playerid);
  980.         }
  981.         else
  982.         {
  983.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  984.         }
  985.     }
  986.     if(ModeloCarro[playerid] == 429)
  987.     {
  988.         if(GetPlayerMoney(playerid) > PRECO_Banshee)
  989.         {
  990.             GivePlayerMoney(playerid, -PRECO_Banshee);
  991.             FuncaocCarro(playerid);
  992.         }
  993.         else
  994.         {
  995.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  996.         }
  997.     }
  998.     if(ModeloCarro[playerid] == 434)
  999.     {
  1000.         if(GetPlayerMoney(playerid) > PRECO_Hotknife)
  1001.         {
  1002.             GivePlayerMoney(playerid, -PRECO_Hotknife);
  1003.             FuncaocCarro(playerid);
  1004.         }
  1005.         else
  1006.         {
  1007.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1008.         }
  1009.     }
  1010.     if(ModeloCarro[playerid] == 436)
  1011.     {
  1012.         if(GetPlayerMoney(playerid) > PRECO_Previon)
  1013.         {
  1014.             GivePlayerMoney(playerid, -PRECO_Previon);
  1015.             FuncaocCarro(playerid);
  1016.         }
  1017.         else
  1018.         {
  1019.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1020.         }
  1021.     }
  1022.     if(ModeloCarro[playerid] == 439)
  1023.     {
  1024.         if(GetPlayerMoney(playerid) > PRECO_Stallion)
  1025.         {
  1026.             GivePlayerMoney(playerid, -PRECO_Stallion);
  1027.             FuncaocCarro(playerid);
  1028.         }
  1029.         else
  1030.         {
  1031.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1032.         }
  1033.     }
  1034.     if(ModeloCarro[playerid] == 442)
  1035.     {
  1036.         if(GetPlayerMoney(playerid) > PRECO_Romero)
  1037.         {
  1038.             GivePlayerMoney(playerid, -PRECO_Romero);
  1039.             FuncaocCarro(playerid);
  1040.         }
  1041.         else
  1042.         {
  1043.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1044.         }
  1045.     }
  1046.     if(ModeloCarro[playerid] == 445)
  1047.     {
  1048.         if(GetPlayerMoney(playerid) > PRECO_Admiral)
  1049.         {
  1050.             GivePlayerMoney(playerid, -PRECO_Admiral);
  1051.             FuncaocCarro(playerid);
  1052.         }
  1053.         else
  1054.         {
  1055.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1056.         }
  1057.     }
  1058.     if(ModeloCarro[playerid] == 451)
  1059.     {
  1060.         if(GetPlayerMoney(playerid) > PRECO_Turismo)
  1061.         {
  1062.             GivePlayerMoney(playerid, -PRECO_Turismo);
  1063.             FuncaocCarro(playerid);
  1064.         }
  1065.         else
  1066.         {
  1067.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1068.         }
  1069.     }
  1070.     if(ModeloCarro[playerid] == 458)
  1071.     {
  1072.         if(GetPlayerMoney(playerid) > PRECO_Solair)
  1073.         {
  1074.             GivePlayerMoney(playerid, -PRECO_Solair);
  1075.             FuncaocCarro(playerid);
  1076.         }
  1077.         else
  1078.         {
  1079.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1080.         }
  1081.     }
  1082.     if(ModeloCarro[playerid] == 466)
  1083.     {
  1084.         if(GetPlayerMoney(playerid) > PRECO_Glendale)
  1085.         {
  1086.             GivePlayerMoney(playerid, -PRECO_Glendale);
  1087.             FuncaocCarro(playerid);
  1088.         }
  1089.         else
  1090.         {
  1091.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1092.         }
  1093.     }
  1094.     if(ModeloCarro[playerid] == 467)
  1095.     {
  1096.         if(GetPlayerMoney(playerid) > PRECO_Oceanic)
  1097.         {
  1098.             GivePlayerMoney(playerid, -PRECO_Oceanic);
  1099.             FuncaocCarro(playerid);
  1100.         }
  1101.         else
  1102.         {
  1103.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1104.         }
  1105.     }
  1106.     if(ModeloCarro[playerid] == 474)
  1107.     {
  1108.         if(GetPlayerMoney(playerid) > PRECO_Hermes)
  1109.         {
  1110.             GivePlayerMoney(playerid, -PRECO_Hermes);
  1111.             FuncaocCarro(playerid);
  1112.         }
  1113.         else
  1114.         {
  1115.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1116.         }
  1117.     }
  1118.     if(ModeloCarro[playerid] == 475)
  1119.     {
  1120.         if(GetPlayerMoney(playerid) > PRECO_Sabre)
  1121.         {
  1122.             GivePlayerMoney(playerid, -PRECO_Sabre);
  1123.             FuncaocCarro(playerid);
  1124.         }
  1125.         else
  1126.         {
  1127.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1128.         }
  1129.     }
  1130.     if(ModeloCarro[playerid] == 477)
  1131.     {
  1132.         if(GetPlayerMoney(playerid) > PRECO_ZR350)
  1133.         {
  1134.             GivePlayerMoney(playerid, -PRECO_ZR350);
  1135.             FuncaocCarro(playerid);
  1136.         }
  1137.         else
  1138.         {
  1139.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1140.         }
  1141.     }
  1142.     if(ModeloCarro[playerid] == 479)
  1143.     {
  1144.         if(GetPlayerMoney(playerid) > PRECO_Regina)
  1145.         {
  1146.             GivePlayerMoney(playerid, -PRECO_Regina);
  1147.             FuncaocCarro(playerid);
  1148.         }
  1149.         else
  1150.         {
  1151.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1152.         }
  1153.     }
  1154.     if(ModeloCarro[playerid] == 480)
  1155.     {
  1156.         if(GetPlayerMoney(playerid) > PRECO_Comet)
  1157.         {
  1158.             GivePlayerMoney(playerid, -PRECO_Comet);
  1159.             FuncaocCarro(playerid);
  1160.         }
  1161.         else
  1162.         {
  1163.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1164.         }
  1165.     }
  1166.     if(ModeloCarro[playerid] == 483)
  1167.     {
  1168.         if(GetPlayerMoney(playerid) > PRECO_Camper)
  1169.         {
  1170.             GivePlayerMoney(playerid, -PRECO_Camper);
  1171.             FuncaocCarro(playerid);
  1172.         }
  1173.         else
  1174.         {
  1175.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1176.         }
  1177.     }
  1178.     if(ModeloCarro[playerid] == 491)
  1179.     {
  1180.         if(GetPlayerMoney(playerid) > PRECO_Virgo)
  1181.         {
  1182.             GivePlayerMoney(playerid, -PRECO_Virgo);
  1183.             FuncaocCarro(playerid);
  1184.         }
  1185.         else
  1186.         {
  1187.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1188.         }
  1189.     }
  1190.     if(ModeloCarro[playerid] == 492)
  1191.     {
  1192.         if(GetPlayerMoney(playerid) > PRECO_Greenwood)
  1193.         {
  1194.             GivePlayerMoney(playerid, -PRECO_Greenwood);
  1195.             FuncaocCarro(playerid);
  1196.         }
  1197.         else
  1198.         {
  1199.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1200.         }
  1201.     }
  1202.     if(ModeloCarro[playerid] == 496)
  1203.     {
  1204.         if(GetPlayerMoney(playerid) > PRECO_BlistaCompact)
  1205.         {
  1206.             GivePlayerMoney(playerid, -PRECO_BlistaCompact);
  1207.             FuncaocCarro(playerid);
  1208.         }
  1209.         else
  1210.         {
  1211.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1212.         }
  1213.     }
  1214.     if(ModeloCarro[playerid] == 506)
  1215.     {
  1216.         if(GetPlayerMoney(playerid) > PRECO_SuperGT)
  1217.         {
  1218.             GivePlayerMoney(playerid, -PRECO_SuperGT);
  1219.             FuncaocCarro(playerid);
  1220.         }
  1221.         else
  1222.         {
  1223.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1224.         }
  1225.     }
  1226.     if(ModeloCarro[playerid] == 507)
  1227.     {
  1228.         if(GetPlayerMoney(playerid) > PRECO_Elegant)
  1229.         {
  1230.             GivePlayerMoney(playerid, -PRECO_Elegant);
  1231.             FuncaocCarro(playerid);
  1232.         }
  1233.         else
  1234.         {
  1235.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1236.         }
  1237.     }
  1238.     if(ModeloCarro[playerid] == 516)
  1239.     {
  1240.         if(GetPlayerMoney(playerid) > PRECO_Nebula)
  1241.         {
  1242.             GivePlayerMoney(playerid, -PRECO_Nebula);
  1243.             FuncaocCarro(playerid);
  1244.         }
  1245.         else
  1246.         {
  1247.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1248.         }
  1249.     }
  1250.     if(ModeloCarro[playerid] == 517)
  1251.     {
  1252.         if(GetPlayerMoney(playerid) > PRECO_Majestic)
  1253.         {
  1254.             GivePlayerMoney(playerid, -PRECO_Majestic);
  1255.             FuncaocCarro(playerid);
  1256.         }
  1257.         else
  1258.         {
  1259.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1260.         }
  1261.     }
  1262.     if(ModeloCarro[playerid] == 518)
  1263.     {
  1264.         if(GetPlayerMoney(playerid) > PRECO_Buccaneer)
  1265.         {
  1266.             GivePlayerMoney(playerid, -PRECO_Buccaneer);
  1267.             FuncaocCarro(playerid);
  1268.         }
  1269.         else
  1270.         {
  1271.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1272.         }
  1273.     }
  1274.     if(ModeloCarro[playerid] == 526)
  1275.     {
  1276.         if(GetPlayerMoney(playerid) > PRECO_Fortune)
  1277.         {
  1278.             GivePlayerMoney(playerid, -PRECO_Fortune);
  1279.             FuncaocCarro(playerid);
  1280.         }
  1281.         else
  1282.         {
  1283.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1284.         }
  1285.     }
  1286.     if(ModeloCarro[playerid] == 527)
  1287.     {
  1288.         if(GetPlayerMoney(playerid) > PRECO_Cadrona)
  1289.         {
  1290.             GivePlayerMoney(playerid, -PRECO_Cadrona);
  1291.             FuncaocCarro(playerid);
  1292.         }
  1293.         else
  1294.         {
  1295.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1296.         }
  1297.     }
  1298.     if(ModeloCarro[playerid] == 529)
  1299.     {
  1300.         if(GetPlayerMoney(playerid) > PRECO_Willard)
  1301.         {
  1302.             GivePlayerMoney(playerid, -PRECO_Willard);
  1303.             FuncaocCarro(playerid);
  1304.         }
  1305.         else
  1306.         {
  1307.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1308.         }
  1309.     }
  1310.     if(ModeloCarro[playerid] == 533)
  1311.     {
  1312.         if(GetPlayerMoney(playerid) > PRECO_Feltzer)
  1313.         {
  1314.             GivePlayerMoney(playerid, -PRECO_Feltzer);
  1315.             FuncaocCarro(playerid);
  1316.         }
  1317.         else
  1318.         {
  1319.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1320.         }
  1321.     }
  1322.     if(ModeloCarro[playerid] == 534)
  1323.     {
  1324.         if(GetPlayerMoney(playerid) > PRECO_Remington)
  1325.         {
  1326.             GivePlayerMoney(playerid, -PRECO_Remington);
  1327.             FuncaocCarro(playerid);
  1328.         }
  1329.         else
  1330.         {
  1331.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1332.         }
  1333.     }
  1334.     if(ModeloCarro[playerid] == 535)
  1335.     {
  1336.         if(GetPlayerMoney(playerid) > PRECO_Slamvan)
  1337.         {
  1338.             GivePlayerMoney(playerid, -PRECO_Slamvan);
  1339.             FuncaocCarro(playerid);
  1340.         }
  1341.         else
  1342.         {
  1343.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1344.         }
  1345.     }
  1346.     if(ModeloCarro[playerid] == 536)
  1347.     {
  1348.         if(GetPlayerMoney(playerid) > PRECO_Blade)
  1349.         {
  1350.             GivePlayerMoney(playerid, -PRECO_Blade);
  1351.             FuncaocCarro(playerid);
  1352.         }
  1353.         else
  1354.         {
  1355.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1356.         }
  1357.     }
  1358.     if(ModeloCarro[playerid] == 540)
  1359.     {
  1360.         if(GetPlayerMoney(playerid) > PRECO_Vincent)
  1361.         {
  1362.             GivePlayerMoney(playerid, -PRECO_Vincent);
  1363.             FuncaocCarro(playerid);
  1364.         }
  1365.         else
  1366.         {
  1367.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1368.         }
  1369.     }
  1370.     if(ModeloCarro[playerid] == 541)
  1371.     {
  1372.         if(GetPlayerMoney(playerid) > PRECO_Bullet)
  1373.         {
  1374.             GivePlayerMoney(playerid, -PRECO_Bullet);
  1375.             FuncaocCarro(playerid);
  1376.         }
  1377.         else
  1378.         {
  1379.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1380.         }
  1381.     }
  1382.     if(ModeloCarro[playerid] == 542)
  1383.     {
  1384.         if(GetPlayerMoney(playerid) > PRECO_Clover)
  1385.         {
  1386.             GivePlayerMoney(playerid, -PRECO_Clover);
  1387.             FuncaocCarro(playerid);
  1388.         }
  1389.         else
  1390.         {
  1391.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1392.         }
  1393.     }
  1394.     if(ModeloCarro[playerid] == 545)
  1395.     {
  1396.         if(GetPlayerMoney(playerid) > PRECO_Hustler)
  1397.         {
  1398.             GivePlayerMoney(playerid, -PRECO_Hustler);
  1399.             FuncaocCarro(playerid);
  1400.         }
  1401.         else
  1402.         {
  1403.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1404.         }
  1405.     }
  1406.     if(ModeloCarro[playerid] == 546)
  1407.     {
  1408.         if(GetPlayerMoney(playerid) > PRECO_Intruder)
  1409.         {
  1410.             GivePlayerMoney(playerid, -PRECO_Intruder);
  1411.             FuncaocCarro(playerid);
  1412.         }
  1413.         else
  1414.         {
  1415.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1416.         }
  1417.     }
  1418.     if(ModeloCarro[playerid] == 547)
  1419.     {
  1420.         if(GetPlayerMoney(playerid) > PRECO_Primo)
  1421.         {
  1422.             GivePlayerMoney(playerid, -PRECO_Primo);
  1423.             FuncaocCarro(playerid);
  1424.         }
  1425.         else
  1426.         {
  1427.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1428.         }
  1429.     }
  1430.     if(ModeloCarro[playerid] == 549)
  1431.     {
  1432.         if(GetPlayerMoney(playerid) > PRECO_Tampa)
  1433.         {
  1434.             GivePlayerMoney(playerid, -PRECO_Tampa);
  1435.             FuncaocCarro(playerid);
  1436.         }
  1437.         else
  1438.         {
  1439.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1440.         }
  1441.     }
  1442.     if(ModeloCarro[playerid] == 550)
  1443.     {
  1444.         if(GetPlayerMoney(playerid) > PRECO_Sunrise)
  1445.         {
  1446.             GivePlayerMoney(playerid, -PRECO_Sunrise);
  1447.             FuncaocCarro(playerid);
  1448.         }
  1449.         else
  1450.         {
  1451.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1452.         }
  1453.     }
  1454.     if(ModeloCarro[playerid] == 551)
  1455.     {
  1456.         if(GetPlayerMoney(playerid) > PRECO_Merit)
  1457.         {
  1458.             GivePlayerMoney(playerid, -PRECO_Merit);
  1459.             FuncaocCarro(playerid);
  1460.         }
  1461.         else
  1462.         {
  1463.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1464.         }
  1465.     }
  1466.     if(ModeloCarro[playerid] == 555)
  1467.     {
  1468.         if(GetPlayerMoney(playerid) > PRECO_Windsor)
  1469.         {
  1470.             GivePlayerMoney(playerid, -PRECO_Windsor);
  1471.             FuncaocCarro(playerid);
  1472.         }
  1473.         else
  1474.         {
  1475.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1476.         }
  1477.     }
  1478.     if(ModeloCarro[playerid] == 558)
  1479.     {
  1480.         if(GetPlayerMoney(playerid) > PRECO_Uranus)
  1481.         {
  1482.             GivePlayerMoney(playerid, -PRECO_Uranus);
  1483.             FuncaocCarro(playerid);
  1484.         }
  1485.         else
  1486.         {
  1487.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1488.         }
  1489.     }
  1490.     if(ModeloCarro[playerid] == 559)
  1491.     {
  1492.         if(GetPlayerMoney(playerid) > PRECO_Jester)
  1493.         {
  1494.             GivePlayerMoney(playerid, -PRECO_Jester);
  1495.             FuncaocCarro(playerid);
  1496.         }
  1497.         else
  1498.         {
  1499.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1500.         }
  1501.     }
  1502.     if(ModeloCarro[playerid] == 560)
  1503.     {
  1504.         if(GetPlayerMoney(playerid) > PRECO_Sultan)
  1505.         {
  1506.             GivePlayerMoney(playerid, -PRECO_Sultan);
  1507.             FuncaocCarro(playerid);
  1508.         }
  1509.         else
  1510.         {
  1511.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1512.         }
  1513.     }
  1514.     if(ModeloCarro[playerid] == 561)
  1515.     {
  1516.         if(GetPlayerMoney(playerid) > PRECO_Stratum)
  1517.         {
  1518.             GivePlayerMoney(playerid, -PRECO_Stratum);
  1519.             FuncaocCarro(playerid);
  1520.         }
  1521.         else
  1522.         {
  1523.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1524.         }
  1525.     }
  1526.     if(ModeloCarro[playerid] == 562)
  1527.     {
  1528.         if(GetPlayerMoney(playerid) > PRECO_Elegy)
  1529.         {
  1530.             GivePlayerMoney(playerid, -PRECO_Elegy);
  1531.             FuncaocCarro(playerid);
  1532.         }
  1533.         else
  1534.         {
  1535.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1536.         }
  1537.     }
  1538.     if(ModeloCarro[playerid] == 565)
  1539.     {
  1540.         if(GetPlayerMoney(playerid) > PRECO_Flash)
  1541.         {
  1542.             GivePlayerMoney(playerid, -PRECO_Flash);
  1543.             FuncaocCarro(playerid);
  1544.         }
  1545.         else
  1546.         {
  1547.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1548.         }
  1549.     }
  1550.     if(ModeloCarro[playerid] == 566)
  1551.     {
  1552.         if(GetPlayerMoney(playerid) > PRECO_Tahoma)
  1553.         {
  1554.             GivePlayerMoney(playerid, -PRECO_Tahoma);
  1555.             FuncaocCarro(playerid);
  1556.         }
  1557.         else
  1558.         {
  1559.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1560.         }
  1561.     }
  1562.     if(ModeloCarro[playerid] == 567)
  1563.     {
  1564.         if(GetPlayerMoney(playerid) > PRECO_Savanna)
  1565.         {
  1566.             GivePlayerMoney(playerid, -PRECO_Savanna);
  1567.             FuncaocCarro(playerid);
  1568.         }
  1569.         else
  1570.         {
  1571.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1572.         }
  1573.     }
  1574.     if(ModeloCarro[playerid] == 575)
  1575.     {
  1576.         if(GetPlayerMoney(playerid) > PRECO_Broadway)
  1577.         {
  1578.             GivePlayerMoney(playerid, -PRECO_Broadway);
  1579.             FuncaocCarro(playerid);
  1580.         }
  1581.         else
  1582.         {
  1583.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1584.         }
  1585.     }
  1586.     if(ModeloCarro[playerid] == 576)
  1587.     {
  1588.         if(GetPlayerMoney(playerid) > PRECO_Tornado)
  1589.         {
  1590.             GivePlayerMoney(playerid, -PRECO_Tornado);
  1591.             FuncaocCarro(playerid);
  1592.         }
  1593.         else
  1594.         {
  1595.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1596.         }
  1597.     }
  1598.     if(ModeloCarro[playerid] == 580)
  1599.     {
  1600.         if(GetPlayerMoney(playerid) > PRECO_Stafford)
  1601.         {
  1602.             GivePlayerMoney(playerid, -PRECO_Stafford);
  1603.             FuncaocCarro(playerid);
  1604.         }
  1605.         else
  1606.         {
  1607.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1608.         }
  1609.     }
  1610.     if(ModeloCarro[playerid] == 585)
  1611.     {
  1612.         if(GetPlayerMoney(playerid) > PRECO_Emperor)
  1613.         {
  1614.             GivePlayerMoney(playerid, -PRECO_Emperor);
  1615.             FuncaocCarro(playerid);
  1616.         }
  1617.         else
  1618.         {
  1619.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1620.         }
  1621.     }
  1622.     if(ModeloCarro[playerid] == 587)
  1623.     {
  1624.         if(GetPlayerMoney(playerid) > PRECO_Euros)
  1625.         {
  1626.             GivePlayerMoney(playerid, -PRECO_Euros);
  1627.             FuncaocCarro(playerid);
  1628.         }
  1629.         else
  1630.         {
  1631.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1632.         }
  1633.     }
  1634.     if(ModeloCarro[playerid] == 589)
  1635.     {
  1636.         if(GetPlayerMoney(playerid) > PRECO_Club)
  1637.         {
  1638.             GivePlayerMoney(playerid, -PRECO_Club);
  1639.             FuncaocCarro(playerid);
  1640.         }
  1641.         else
  1642.         {
  1643.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1644.         }
  1645.     }
  1646.     if(ModeloCarro[playerid] == 602)
  1647.     {
  1648.         if(GetPlayerMoney(playerid) > PRECO_Alpha)
  1649.         {
  1650.             GivePlayerMoney(playerid, -PRECO_Alpha);
  1651.             FuncaocCarro(playerid);
  1652.         }
  1653.         else
  1654.         {
  1655.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1656.         }
  1657.     }
  1658.     if(ModeloCarro[playerid] == 603)
  1659.     {
  1660.         if(GetPlayerMoney(playerid) > PRECO_Phoenix)
  1661.         {
  1662.             GivePlayerMoney(playerid, -PRECO_Phoenix);
  1663.             FuncaocCarro(playerid);
  1664.         }
  1665.         else
  1666.         {
  1667.             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
  1668.         }
  1669.     }
  1670. }
  1671.  
  1672. public FuncaocCarro(playerid)
  1673. {
  1674.     if(IsPlayerConnected(playerid))
  1675.     {
  1676.  
  1677.         new PlayerNick[MAX_PLAYER_NAME];
  1678.         GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
  1679.         new arquivo[256];
  1680.         format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
  1681.         if(!dini_Exists(arquivo))
  1682.         {
  1683.             if(ModeloCarro[playerid] > 0)
  1684.             {
  1685.                 if(TaNoCarro[playerid] == 0)
  1686.                 {
  1687.                     new idx = 1;
  1688.                     while (idx < sizeof(Carro))
  1689.                     {
  1690.                         if(strcmp(Carro[idx][cDono],"Ninguem",true)==0)
  1691.                         {
  1692.                             new string[256];
  1693.                             format(string, sizeof(string), "[CONCESSIONÁRIA] Este é o carro número %d da Concessionária",idx);
  1694.                             strmid(Carro[idx][cDono], PlayerNick, 0, strlen(PlayerNick), MAX_PLAYER_NAME);
  1695.                             cCarro[idx] = AddStaticVehicle(ModeloCarro[playerid],2809.5098,-1822.0376,9.7244,86.4366,0,0);
  1696.                             PutPlayerInVehicle(playerid, cCarro[idx], 0);
  1697.                             TaNoCarro[playerid] = idx;
  1698.                             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Parabéns! Você acabou de comprar um carro novo!");
  1699.                             SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Estacione ele usando /carroestacionar, caso contrário, ele será destruído!");
  1700.                             SendClientMessage(playerid, Azul, string);
  1701.                             CarroVidaTimer = SetTimer("CarroVida", 1000, 1);
  1702.                             return 1;
  1703.                         }
  1704.                         else
  1705.                         {
  1706.                             idx++;
  1707.                         }
  1708.                     }
  1709.                 }
  1710.                 else
  1711.                 {
  1712.                     SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Você já está em um carro da concessionária...");
  1713.                     return 1;
  1714.                 }
  1715.             }
  1716.             else
  1717.             {
  1718.                 SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Você não definiu qual carro você quer.");
  1719.                 return 1;
  1720.             }
  1721.         }
  1722.         else
  1723.         {
  1724.             SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Você ja tem um carro...");
  1725.         }
  1726.     }
  1727.     return 1;
  1728. }
  1729.  
  1730. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  1731. {
  1732.     if(IsPlayerConnected(playerid))
  1733.     {
  1734.         new Float:oldposx, Float:oldposy, Float:oldposz;
  1735.         new Float:tempposx, Float:tempposy, Float:tempposz;
  1736.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  1737.         tempposx = (oldposx -x);
  1738.         tempposy = (oldposy -y);
  1739.         tempposz = (oldposz -z);
  1740.         //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  1741.         if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  1742.         {
  1743.             return 1;
  1744.         }
  1745.     }
  1746.     return 0;
  1747. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement