Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FILTERSCRIPT
- #include <a_samp>
- #include <dini>
- #define AzulLindo 0x3FCFFFFF
- #define Azul 0x33CCFFAA
- #define Branco 0xFFFFFFAA
- //Nome dos Carros
- new vehName[][] ={
- "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster",
- "Limosine","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulancia","Leviathan","Moonbeam","Esperanto",
- "Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Premier","Enforcer","Securicar","Banshee",
- "Predator","Bus","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie","Stallion","Rumpo",
- "RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer",
- "Turismo","Speeder","Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer",
- "PCJ-600","Faggio","Freeway","RC Baron","RC Raider","Glendale","Oceanic","Sanchez","Sparrow","Patriot",
- "Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR-350","Walton","Regina","Comet","BMX",
- "Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo",
- "Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Maverick Policial","Boxville","Benson","Mesa",
- "RC Goblin","Hotring Racer A","Hotring Racer B","Bloodring Banger","Rancher","Super GT","Elegant",
- "Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain","Nebula","Majestic",
- "Buccaneer","Shamal","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona",
- "FBI Truck","Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight",
- "Streak","Vortex","Vincent","Bullet","Clover","Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob",
- "Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A","Monster B","Uranus",
- "Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight",
- "Trailer","Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford",
- "BF-400","Newsvan","Tug","Trailer A","Emperor","Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C",
- "Andromada","Dodo","RC Cam","Launch","Viatura (LSPD)","Viatura (SFPD)","Viatura (LVPD)","Police Ranger",
- "Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
- "Stair Trailer","Boxville","Farm Plow","Utility Trailer" };
- //===[ Sistema PART 1 ]===
- #define MAX_cCARROS 101 // 1 a mais do máximo (Máximo = 50)
- forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
- forward CarregarCarros();
- forward SalvarCarro(cCarroid);
- forward ComprarCarro(playerid);
- forward FuncaocCarro(playerid);
- forward CarroVida(playerid);
- forward PrecoCarro(playerid);
- forward DiniCarro(playerid);
- new CarroVidaTimer;
- enum cInfo
- {
- cDono[MAX_PLAYER_NAME],
- cModelo,
- Float:cSpawnX,
- Float:cSpawnY,
- Float:cSpawnZ,
- Float:cAngulo,
- cCarroON,
- cCorUm,
- cCorDois,
- cChave[MAX_cCARROS],
- cCID
- };
- new Carro[MAX_cCARROS][cInfo];
- new cCarro[MAX_cCARROS];
- //new cCarr[MAX_cCARROS];
- new TaNoCarro[MAX_PLAYERS];
- new ModeloCarro[MAX_PLAYERS];
- //------------------------------------------------------------------------------
- //===[ Sistema PART 2 ]===
- forward CarregarDono(playerid);
- forward SalvarDono(playerid);
- enum dInfo
- {
- dChave,
- dDono[MAX_PLAYER_NAME],
- };
- new Dono[MAX_PLAYERS][dInfo];
- //Preços
- #define PRECO_Bravura 35000
- #define PRECO_Buffalo 45000
- #define PRECO_Perenniel 35000
- #define PRECO_Sentinel 35000
- #define PRECO_Limosine 60000
- #define PRECO_Manana 35000
- #define PRECO_Voodoo 40000
- #define PRECO_Cheetah 45000
- #define PRECO_Moonbeam 35000
- #define PRECO_Esperanto 35000
- #define PRECO_Washington 35000
- #define PRECO_Premier 35000
- #define PRECO_Banshee 50000
- #define PRECO_Hotknife 50000
- #define PRECO_Previon 35000
- #define PRECO_Stallion 35000
- #define PRECO_Romero 35000
- #define PRECO_Admiral 35000
- #define PRECO_Turismo 65000
- #define PRECO_Solair 35000
- #define PRECO_Glendale 35000
- #define PRECO_Oceanic 35000
- #define PRECO_Hermes 35000
- #define PRECO_Sabre 35000
- #define PRECO_ZR350 45000
- #define PRECO_Regina 35000
- #define PRECO_Comet 40000
- #define PRECO_Camper 35000
- #define PRECO_Virgo 35000
- #define PRECO_Greenwood 40000
- #define PRECO_BlistaCompact 35000
- #define PRECO_SuperGT 45000
- #define PRECO_Elegant 35000
- #define PRECO_Nebula 35000
- #define PRECO_Majestic 35000
- #define PRECO_Buccaneer 35000
- #define PRECO_Fortune 35000
- #define PRECO_Cadrona 35000
- #define PRECO_Willard 35000
- #define PRECO_Feltzer 35000
- #define PRECO_Remington 35000
- #define PRECO_Slamvan 35000
- #define PRECO_Blade 35000
- #define PRECO_Vincent 35000
- #define PRECO_Bullet 50000
- #define PRECO_Clover 35000
- #define PRECO_Hustler 35000
- #define PRECO_Intruder 35000
- #define PRECO_Primo 35000
- #define PRECO_Tampa 35000
- #define PRECO_Sunrise 35000
- #define PRECO_Merit 35000
- #define PRECO_Windsor 35000
- #define PRECO_Uranus 45000
- #define PRECO_Jester 40000
- #define PRECO_Sultan 45000
- #define PRECO_Stratum 35000
- #define PRECO_Elegy 45000
- #define PRECO_Flash 35000
- #define PRECO_Tahoma 35000
- #define PRECO_Savanna 40000
- #define PRECO_Broadway 35000
- #define PRECO_Tornado 35000
- #define PRECO_Stafford 35000
- #define PRECO_Emperor 35000
- #define PRECO_Euros 45000
- #define PRECO_Club 35000
- #define PRECO_Alpha 40000
- #define PRECO_Phoenix 45000
- //------------------------------------------------------------------------------
- /*strtok(const string[], &index)
- {
- new length = strlen(string);
- while ((index < length) && (string[index] <= ' '))
- {
- index++;
- }
- new offset = index;
- new result[20];
- while ((index < length) && (string[index] > ' ') && ((index - offset) < (sizeof(result) - 1)))
- {
- result[index - offset] = string[index];
- index++;
- }
- result[index - offset] = EOS;
- return result;
- }*/
- public CarroVida(playerid)
- {
- new Float:Vida;
- new VID = GetPlayerVehicleID(playerid);
- GetVehicleHealth(VID, Vida);
- if(Vida < 244)
- {
- new car = TaNoCarro[playerid];
- if(car > 0)
- {
- DestroyVehicle(cCarro[car]);
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Seu carro foi destruído... Lamentamos, sem re-imbolso.");
- TaNoCarro[playerid] = 0;
- strmid(Carro[car][cDono], "Ninguem", 0, strlen("Ninguem"), 256);
- KillTimer(CarroVidaTimer);
- return 1;
- }
- }
- return 0;
- }
- public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
- {
- for(new c = 0; c < sizeof(Carro); c++)
- {
- if(Carro[c][cCID] == vehicleid)
- {
- new string[256];
- format(string, sizeof(string), "[CONCESSIONÁRIA] Este(a) %s pertence à %s.", vehName[GetVehicleModel(vehicleid)-400], Carro[c][cDono]);
- SendClientMessage(playerid, Branco, " ");
- SendClientMessage(playerid, Azul, string);
- }
- }
- return 1;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == 1319)
- {
- if(response == 1)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid,1320,DIALOG_STYLE_MSGBOX,"Concessionária","Tem certeza que deseja vender seu carro?","Sim","Não");
- }
- if(listitem == 1)
- {
- new textdialog[3000];
- strins(textdialog,"Bravura - R$35.000\n",strlen(textdialog)); //401
- strins(textdialog,"Buffalo - R$45.000\n",strlen(textdialog)); //402
- strins(textdialog,"Perenniel - R$35.000\n",strlen(textdialog)); //404
- strins(textdialog,"Sentinel - R$35.000\n",strlen(textdialog)); //405
- strins(textdialog,"Limosine - R$60.000\n",strlen(textdialog)); //409
- strins(textdialog,"Manana - R$35.000\n",strlen(textdialog)); //410
- strins(textdialog,"Voodoo - R$40.000\n",strlen(textdialog)); //412
- strins(textdialog,"Cheetah - R$45.000\n",strlen(textdialog)); //415
- strins(textdialog,"Moonbeam - R$35.000\n",strlen(textdialog)); //418 //350000
- strins(textdialog,"Esperanto - R$35.000\n",strlen(textdialog)); //419
- strins(textdialog,"Washington - R$35.000\n",strlen(textdialog)); //421
- strins(textdialog,"Premier - R$35.000\n",strlen(textdialog)); //426 //35.0000
- strins(textdialog,"Banshee - R$50.000\n",strlen(textdialog)); //429
- strins(textdialog,"Hotknife - R$50.000\n",strlen(textdialog)); //434
- strins(textdialog,"Previon - R$35.000\n",strlen(textdialog)); //436
- strins(textdialog,"Stallion - R$35.000\n",strlen(textdialog)); //439
- strins(textdialog,"Romero - R$35.000\n",strlen(textdialog)); //442
- strins(textdialog,"Admiral - R$35.000\n",strlen(textdialog)); //445
- strins(textdialog,"Turismo - R$65.000\n",strlen(textdialog)); //451
- strins(textdialog,"Solair - R$35.000\n",strlen(textdialog)); //458
- strins(textdialog,"Glendale - R$35.000\n",strlen(textdialog)); //466
- strins(textdialog,"Oceanic - R$35.000\n",strlen(textdialog)); //467
- strins(textdialog,"Hermes - R$35.000\n",strlen(textdialog)); //474
- strins(textdialog,"Sabre - R$35.000\n",strlen(textdialog)); //475
- strins(textdialog,"ZR-350 - R$45.000\n",strlen(textdialog)); //477
- strins(textdialog,"Regina - R$35.000\n",strlen(textdialog)); //479
- strins(textdialog,"Comet - R$40.000\n",strlen(textdialog)); //480
- strins(textdialog,"Camper - R$35.000\n",strlen(textdialog)); //483
- strins(textdialog,"Virgo - R$35.000\n",strlen(textdialog)); //491
- strins(textdialog,"Greenwood - R$40.000\n",strlen(textdialog)); //492
- strins(textdialog,"Blista Compact - R$35.000\n",strlen(textdialog)); //496
- strins(textdialog,"Super GT - R$45.000\n",strlen(textdialog)); //506
- strins(textdialog,"Elegant - R$35.000\n",strlen(textdialog)); //507
- strins(textdialog,"Nebula - R$35.000\n",strlen(textdialog)); //516
- strins(textdialog,"Majestic - R$35.000\n",strlen(textdialog)); //517
- strins(textdialog,"Buccaneer - R$35.000\n",strlen(textdialog)); //518
- strins(textdialog,"Fortune - R$35.000\n",strlen(textdialog)); //526
- strins(textdialog,"Cadrona - R$35.000\n",strlen(textdialog)); //527
- strins(textdialog,"Willard - R$35.000\n",strlen(textdialog)); //529
- strins(textdialog,"Feltzer - R$35.000\n",strlen(textdialog)); //533
- strins(textdialog,"Remington - R$35.000\n",strlen(textdialog)); //534
- strins(textdialog,"Slamvan - R$35.000\n",strlen(textdialog)); //535
- strins(textdialog,"Blade - R$35.000\n",strlen(textdialog)); //536
- strins(textdialog,"Vincent - R$35.000\n",strlen(textdialog)); //540
- strins(textdialog,"Bullet - R$35.000\n",strlen(textdialog)); //541
- strins(textdialog,"Clover - R$35.000\n",strlen(textdialog)); //542
- strins(textdialog,"Hustler - R$35.000\n",strlen(textdialog)); //545
- strins(textdialog,"Intruder - R$35.000\n",strlen(textdialog)); //546
- strins(textdialog,"Primo - R$35.000\n",strlen(textdialog)); //547
- strins(textdialog,"Tampa - R$35.000\n",strlen(textdialog)); //549
- strins(textdialog,"Sunrise - R$35.000\n",strlen(textdialog)); //550
- strins(textdialog,"Merit - R$35.000\n",strlen(textdialog)); //551
- strins(textdialog,"Windsor - R$35.000\n",strlen(textdialog)); //555
- strins(textdialog,"Uranus - R$45.000\n",strlen(textdialog)); //558
- strins(textdialog,"Jester - R$40.000\n",strlen(textdialog)); //559
- strins(textdialog,"Sultan - R$45.000\n",strlen(textdialog)); //560
- strins(textdialog,"Stratum - R$35.000\n",strlen(textdialog)); //561
- strins(textdialog,"Elegy - R$45.000\n",strlen(textdialog)); //562
- strins(textdialog,"Flash - R$35.000\n",strlen(textdialog)); //565
- strins(textdialog,"Tahoma - R$35.000\n",strlen(textdialog)); //566
- strins(textdialog,"Savanna - R$40.000\n",strlen(textdialog)); //567
- strins(textdialog,"Broadway - R$35.000\n",strlen(textdialog)); //575
- strins(textdialog,"Tornado - R$35.000\n",strlen(textdialog)); //576
- strins(textdialog,"Stafford - R$35.000\n",strlen(textdialog)); //580
- strins(textdialog,"Emperor - R$35.000\n",strlen(textdialog)); //585
- strins(textdialog,"Euros - R$45.000\n",strlen(textdialog)); //587
- strins(textdialog,"Club - R$35.000\n",strlen(textdialog)); //589
- strins(textdialog,"Alpha - R$40.000\n",strlen(textdialog)); //602
- strins(textdialog,"Phoenix - R$45.000",strlen(textdialog)); //603
- ShowPlayerDialog(playerid,1321,DIALOG_STYLE_LIST,"Qual carro você deseja comprar?",textdialog,"Selecionar","Cancelar");
- }
- }
- else
- {
- //Tudo que vai acontecer no botão direito.
- }
- }
- if(dialogid == 1320)
- {
- if(response == 1)
- {
- new PlayerNick[MAX_PLAYER_NAME];
- GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
- CarregarDono(playerid);
- new arquivo[256];
- format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
- new carro = Dono[playerid][dChave];
- if(dini_Exists(arquivo))
- {
- strmid(Carro[carro][cDono], "Ninguem", 0, strlen("Ninguem"), 256);
- Carro[carro][cCarroON] = 0;
- Carro[carro][cModelo] = 0;
- Carro[carro][cSpawnX] = 0.000000;
- Carro[carro][cSpawnY] = 0.000000;
- Carro[carro][cSpawnZ] = 0.000000;
- Carro[carro][cAngulo] = 0.000000;
- Carro[carro][cCorUm] = 0;
- Carro[carro][cCorDois] = 0;
- dini_Remove(arquivo);
- DestroyVehicle(cCarro[carro]);
- SalvarCarro(carro);
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Carro vendido com sucesso!");
- }
- else
- {
- SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Você não tem um carro!");
- }
- }
- else
- {
- SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Venda do carro cancelada!");
- }
- }
- if(dialogid == 1321)
- {
- if(response == 1)
- {
- if(listitem == 0){ ModeloCarro[playerid] = 401; PrecoCarro(playerid); }
- if(listitem == 1){ ModeloCarro[playerid] = 402; PrecoCarro(playerid); }
- if(listitem == 2){ ModeloCarro[playerid] = 404; PrecoCarro(playerid); }
- if(listitem == 3){ ModeloCarro[playerid] = 405; PrecoCarro(playerid); }
- if(listitem == 4){ ModeloCarro[playerid] = 409; PrecoCarro(playerid); }
- if(listitem == 5){ ModeloCarro[playerid] = 410; PrecoCarro(playerid); }
- if(listitem == 6){ ModeloCarro[playerid] = 412; PrecoCarro(playerid); }
- if(listitem == 7){ ModeloCarro[playerid] = 415; PrecoCarro(playerid); }
- if(listitem == 8){ ModeloCarro[playerid] = 418; PrecoCarro(playerid); }
- if(listitem == 9){ ModeloCarro[playerid] = 419; PrecoCarro(playerid); }
- if(listitem == 10){ ModeloCarro[playerid] = 421; PrecoCarro(playerid); }
- if(listitem == 11){ ModeloCarro[playerid] = 426; PrecoCarro(playerid); }
- if(listitem == 12){ ModeloCarro[playerid] = 429; PrecoCarro(playerid); }
- if(listitem == 13){ ModeloCarro[playerid] = 434; PrecoCarro(playerid); }
- if(listitem == 14){ ModeloCarro[playerid] = 436; PrecoCarro(playerid); }
- if(listitem == 15){ ModeloCarro[playerid] = 439; PrecoCarro(playerid); }
- if(listitem == 16){ ModeloCarro[playerid] = 442; PrecoCarro(playerid); }
- if(listitem == 17){ ModeloCarro[playerid] = 445; PrecoCarro(playerid); }
- if(listitem == 18){ ModeloCarro[playerid] = 451; PrecoCarro(playerid); }
- if(listitem == 19){ ModeloCarro[playerid] = 458; PrecoCarro(playerid); }
- if(listitem == 20){ ModeloCarro[playerid] = 466; PrecoCarro(playerid); }
- if(listitem == 21){ ModeloCarro[playerid] = 467; PrecoCarro(playerid); }
- if(listitem == 22){ ModeloCarro[playerid] = 474; PrecoCarro(playerid); }
- if(listitem == 23){ ModeloCarro[playerid] = 475; PrecoCarro(playerid); }
- if(listitem == 24){ ModeloCarro[playerid] = 477; PrecoCarro(playerid); }
- if(listitem == 25){ ModeloCarro[playerid] = 479; PrecoCarro(playerid); }
- if(listitem == 26){ ModeloCarro[playerid] = 480; PrecoCarro(playerid); }
- if(listitem == 27){ ModeloCarro[playerid] = 483; PrecoCarro(playerid); }
- if(listitem == 28){ ModeloCarro[playerid] = 491; PrecoCarro(playerid); }
- if(listitem == 29){ ModeloCarro[playerid] = 492; PrecoCarro(playerid); }
- if(listitem == 30){ ModeloCarro[playerid] = 496; PrecoCarro(playerid); }
- if(listitem == 31){ ModeloCarro[playerid] = 506; PrecoCarro(playerid); }
- if(listitem == 32){ ModeloCarro[playerid] = 507; PrecoCarro(playerid); }
- if(listitem == 33){ ModeloCarro[playerid] = 516; PrecoCarro(playerid); }
- if(listitem == 34){ ModeloCarro[playerid] = 517; PrecoCarro(playerid); }
- if(listitem == 35){ ModeloCarro[playerid] = 518; PrecoCarro(playerid); }
- if(listitem == 36){ ModeloCarro[playerid] = 526; PrecoCarro(playerid); }
- if(listitem == 37){ ModeloCarro[playerid] = 527; PrecoCarro(playerid); }
- if(listitem == 38){ ModeloCarro[playerid] = 529; PrecoCarro(playerid); }
- if(listitem == 39){ ModeloCarro[playerid] = 533; PrecoCarro(playerid); }
- if(listitem == 40){ ModeloCarro[playerid] = 534; PrecoCarro(playerid); }
- if(listitem == 41){ ModeloCarro[playerid] = 535; PrecoCarro(playerid); }
- if(listitem == 42){ ModeloCarro[playerid] = 536; PrecoCarro(playerid); }
- if(listitem == 43){ ModeloCarro[playerid] = 540; PrecoCarro(playerid); }
- if(listitem == 44){ ModeloCarro[playerid] = 541; PrecoCarro(playerid); }
- if(listitem == 45){ ModeloCarro[playerid] = 542; PrecoCarro(playerid); }
- if(listitem == 46){ ModeloCarro[playerid] = 545; PrecoCarro(playerid); }
- if(listitem == 47){ ModeloCarro[playerid] = 546; PrecoCarro(playerid); }
- if(listitem == 48){ ModeloCarro[playerid] = 547; PrecoCarro(playerid); }
- if(listitem == 49){ ModeloCarro[playerid] = 549; PrecoCarro(playerid); }
- if(listitem == 50){ ModeloCarro[playerid] = 550; PrecoCarro(playerid); }
- if(listitem == 51){ ModeloCarro[playerid] = 551; PrecoCarro(playerid); }
- if(listitem == 52){ ModeloCarro[playerid] = 555; PrecoCarro(playerid); }
- if(listitem == 53){ ModeloCarro[playerid] = 558; PrecoCarro(playerid); }
- if(listitem == 54){ ModeloCarro[playerid] = 559; PrecoCarro(playerid); }
- if(listitem == 55){ ModeloCarro[playerid] = 560; PrecoCarro(playerid); }
- if(listitem == 56){ ModeloCarro[playerid] = 561; PrecoCarro(playerid); }
- if(listitem == 57){ ModeloCarro[playerid] = 562; PrecoCarro(playerid); }
- if(listitem == 58){ ModeloCarro[playerid] = 565; PrecoCarro(playerid); }
- if(listitem == 59){ ModeloCarro[playerid] = 566; PrecoCarro(playerid); }
- if(listitem == 60){ ModeloCarro[playerid] = 567; PrecoCarro(playerid); }
- if(listitem == 61){ ModeloCarro[playerid] = 575; PrecoCarro(playerid); }
- if(listitem == 62){ ModeloCarro[playerid] = 576; PrecoCarro(playerid); }
- if(listitem == 63){ ModeloCarro[playerid] = 580; PrecoCarro(playerid); }
- if(listitem == 64){ ModeloCarro[playerid] = 585; PrecoCarro(playerid); }
- if(listitem == 65){ ModeloCarro[playerid] = 587; PrecoCarro(playerid); }
- if(listitem == 66){ ModeloCarro[playerid] = 589; PrecoCarro(playerid); }
- if(listitem == 67){ ModeloCarro[playerid] = 602; PrecoCarro(playerid); }
- if(listitem == 68){ ModeloCarro[playerid] = 603; PrecoCarro(playerid); }
- }
- else
- {
- SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Compra de carro cancelada.");
- }
- }
- return 0;
- }
- public OnPlayerDisconnect(playerid)
- {
- new car = TaNoCarro[playerid];
- if(car > 0)
- {
- DestroyVehicle(cCarro[car]);
- TaNoCarro[playerid] = 0;
- strmid(Carro[car][cDono], "Ninguem", 0, strlen("Ninguem"), 256);
- return 1;
- }
- return 0;
- }
- public OnPlayerExitVehicle(playerid, vehicleid)
- {
- new tcar = TaNoCarro[playerid];
- if(tcar > 0)
- {
- DestroyVehicle(cCarro[tcar]);
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você foi avisado...");
- TaNoCarro[playerid] = 0;
- strmid(Carro[tcar][cDono], "Ninguem", 0, strlen("Ninguem"), 256);
- return 1;
- }
- return 0;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- new idx;
- new cmd[256];
- cmd = strtok(cmdtext, idx);
- if(strcmp(cmd, "/admvcarrito", true) == 0)
- {
- if(IsPlayerConnected(playerid))
- {
- if(IsPlayerAdmin(playerid))
- {
- new comando[256];
- comando = strtok(cmdtext, idx);
- if(!strlen(comando))
- {
- SendClientMessage(playerid, Branco, "USE: /admv [ cCarro ID ]");
- return 1;
- }
- new carrito = strval(comando);
- if(Carro[carrito][cCarroON] > 0)
- {
- new arquivo[256];
- strmid(Carro[carrito][cDono], dini_Get(arquivo,"cDono"), 0, strlen(dini_Get(arquivo,"cDono")), 32);
- format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",Carro[carrito][cDono]);
- strmid(Carro[carrito][cDono], "Ninguem", 0, strlen("Ninguem"), 256);
- Carro[carrito][cCarroON] = 0;
- Carro[carrito][cModelo] = 0;
- Carro[carrito][cSpawnX] = 0.000000;
- Carro[carrito][cSpawnY] = 0.000000;
- Carro[carrito][cSpawnZ] = 0.000000;
- Carro[carrito][cAngulo] = 0.000000;
- Carro[carrito][cCorUm] = 0;
- Carro[carrito][cCorDois] = 0;
- DestroyVehicle(cCarro[carrito]);
- dini_Remove(arquivo);
- SalvarCarro(carrito);
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Carro vendido com sucesso!");
- }
- else
- {
- SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Esse carro não tem dono.");
- return 1;
- }
- }
- }
- return 1;
- }
- if(strcmp(cmdtext,"/carroestacionar",true)==0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- new Float:X,Float:Y,Float:Z;
- new Float:A;
- new VID = GetPlayerVehicleID(playerid);
- CarregarDono(playerid);
- new PlayerNick[MAX_PLAYER_NAME];
- GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
- new arquivo[256];
- format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
- if(dini_Exists(arquivo))
- {
- new carro = Dono[playerid][dChave];
- if(Carro[carro][cCID] == VID)
- {
- if(strcmp(PlayerNick,Carro[carro][cDono],true)==0)
- {
- GetVehicleZAngle(VID,A);
- GetVehiclePos(VID,X,Y,Z);
- Carro[carro][cSpawnX] = X;
- Carro[carro][cSpawnY] = Y;
- Carro[carro][cSpawnZ] = Z;
- Carro[carro][cAngulo] = A;
- strmid(Carro[carro][cDono], PlayerNick, 0, strlen(PlayerNick), MAX_PLAYER_NAME);
- Carro[carro][cCarroON] = 1;
- DestroyVehicle(cCarro[carro]);
- cCarro[carro] = AddStaticVehicle(Carro[carro][cModelo],Carro[carro][cSpawnX],Carro[carro][cSpawnY],Carro[carro][cSpawnZ],Carro[carro][cAngulo],Carro[carro][cCorUm],Carro[carro][cCorDois]);
- PutPlayerInVehicle(playerid, cCarro[carro], 0);
- Carro[carro][cCID] = VID;
- SalvarCarro(carro);
- CarregarCarros();
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Carro estacionado com sucesso!");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Este carro não é seu!");
- return 1;
- }
- }
- new car = TaNoCarro[playerid];
- if(car > 0)
- {
- GetVehicleZAngle(VID,A);
- GetVehiclePos(VID,X,Y,Z);
- Carro[car][cSpawnX] = X;
- Carro[car][cSpawnY] = Y;
- Carro[car][cSpawnZ] = Z;
- Carro[car][cAngulo] = A;
- Carro[car][cCarroON] = 1;
- Dono[playerid][dChave] = car;
- DestroyVehicle(cCarro[car]);
- cCarro[car] = AddStaticVehicle(ModeloCarro[playerid],Carro[car][cSpawnX],Carro[car][cSpawnY],Carro[car][cSpawnZ],Carro[car][cAngulo],Carro[car][cCorUm],Carro[car][cCorDois]);
- PutPlayerInVehicle(playerid, cCarro[car], 0);
- Carro[car][cCID] = VID;
- ComprarCarro(playerid);
- SalvarCarro(car);
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Carro estacionado com sucesso!");
- TaNoCarro[playerid] = 0;
- return 1;
- }
- else
- {
- SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Você não está em um carro da concessionária...");
- return 1;
- }
- }
- return 1;
- }
- if(strcmp(cmdtext,"/concessionaria",true)==0)
- {
- if(PlayerToPoint(3, playerid, 2780.4939,-1812.2635,11.8438))
- {
- ShowPlayerDialog(playerid,1319,DIALOG_STYLE_LIST,"Concessionária","Vender Carro\nComprar Um Carro","Selecionar","Cancelar");
- TogglePlayerControllable(playerid, 1);
- return 1;
- }
- return 1;
- }
- if(strcmp(cmdtext,"/irconcessionaria",true)==0)
- {
- if(IsPlayerAdmin(playerid))
- {
- SendClientMessage(playerid, Branco, "Você foi teletransportado para a Concessionária.");
- SetPlayerPos(playerid, 2780.4939,-1812.2635,11.8438);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, Branco, "Você não é um administrador rcon!");
- return 1;
- }
- }
- if(strcmp(cmdtext,"/dinicriar",true)==0)
- {
- if(IsPlayerAdmin(playerid))
- {
- DiniCarro(playerid);
- return 1;
- }
- else
- {
- SendClientMessage(playerid, Branco, "Você não tem autorização para isso.");
- return 1;
- }
- }
- if(strcmp(cmd,"/carrocor",true)==0)
- {
- if(IsPlayerInAnyVehicle(playerid))
- {
- CarregarDono(playerid);
- new PlayerNick[MAX_PLAYER_NAME];
- GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
- new Comando[256];
- new Comando2[256];
- Comando = strtok(cmdtext, idx);
- Comando2 = strtok(cmdtext, idx);
- new Cor1;
- new Cor2;
- Cor1 = strval(Comando);
- Cor2 = strval(Comando2);
- new arquivo[256];
- format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
- if(!strlen(Comando))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[CONCESSIONÁRIA] Digite /carrocor [cor1] [cor2]");
- return 1;
- }
- if(!strlen(Comando2))
- {
- SendClientMessage(playerid, 0xFFFFFFFF, "[CONCESSIONÁRIA] Digite /carrocor [cor1] [cor2]");
- return 1;
- }
- if(dini_Exists(arquivo))
- {
- new carro = Dono[playerid][dChave];
- ChangeVehicleColor(cCarro[carro], Cor1, Cor2);
- Carro[carro][cCorUm] = Cor1;
- Carro[carro][cCorDois] = Cor2;
- SalvarCarro(carro);
- SendClientMessage(playerid, Azul, " ");
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Carro pintado com sucesso!");
- return 1;
- }
- }
- return 1;
- }
- return 0;
- }
- public OnPlayerKeyStateChange(playerid,newkeys,oldkeys)
- {
- if(newkeys == 16)
- {
- OnPlayerCommandText(playerid,"/concessionaria");
- }
- return 1;
- }
- public OnFilterScriptInit()
- {
- CarregarCarros();
- for(new c = 0; c < sizeof(Carro); c++)
- {
- if(Carro[c][cCarroON] == 1)
- {
- 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);
- Carro[c][cCID] = cCarro[c];
- }
- }
- CreatePickup(1272, 23, 2780.4939,-1812.2635,11.8438);
- Create3DTextLabel("Concessionária\nAperte 'F' Para Acessar",AzulLindo,2780.4939,-1812.2635,11.8438,15, 0, 50);
- return 0;
- }
- public CarregarCarros()
- {
- new arquivo[256];
- new idx = 1;
- while (idx < sizeof(Carro))
- {
- format(arquivo, sizeof(arquivo), "/Concessionaria/Carros/Carro%d.ini",idx);
- strmid(Carro[idx][cDono], dini_Get(arquivo,"cDono"), 0, strlen(dini_Get(arquivo,"cDono")), 32);
- Carro[idx][cCarroON] = dini_Int(arquivo,"cCarroON");
- Carro[idx][cModelo] = dini_Int(arquivo,"cModelo");
- Carro[idx][cSpawnX] = dini_Float(arquivo,"cSpawnX");
- Carro[idx][cSpawnY] = dini_Float(arquivo,"cSpawnY");
- Carro[idx][cSpawnZ] = dini_Float(arquivo,"cSpawnZ");
- Carro[idx][cAngulo] = dini_Float(arquivo,"cAngulo");
- Carro[idx][cCorUm] = dini_Int(arquivo,"CorUm");
- Carro[idx][cCorDois] = dini_Int(arquivo,"cCorDois");
- printf(" ");
- printf(" ");
- printf("=====[ CARREGANDO CARRO: %d ]=====",idx);
- printf(" ");
- printf(" ");
- idx ++;
- }
- return 1;
- }
- public DiniCarro(playerid)
- {
- new arquivo[256];
- new idx = 1;
- new string[256];
- while (idx < sizeof(Carro))
- {
- format(arquivo, sizeof(arquivo), "/Concessionaria/Carros/Carro%d.ini",idx);
- if(!dini_Exists(arquivo))
- {
- new chave = idx;
- dini_Create(arquivo);
- dini_Set(arquivo,"cDono","Ninguem");
- dini_IntSet(arquivo,"cCarroON",Carro[idx][cCarroON]);
- dini_IntSet(arquivo,"cModelo",Carro[idx][cModelo]);
- dini_FloatSet(arquivo,"cSpawnX",Carro[idx][cSpawnX]);
- dini_FloatSet(arquivo,"cSpawnY",Carro[idx][cSpawnY]);
- dini_FloatSet(arquivo,"cSpawnZ",Carro[idx][cSpawnZ]);
- dini_FloatSet(arquivo,"cAngulo",Carro[idx][cAngulo]);
- dini_IntSet(arquivo,"CorUm",Carro[idx][cCorUm]);
- dini_IntSet(arquivo,"CorDois",Carro[idx][cCorDois]);
- dini_IntSet(arquivo,"cChave", chave);
- printf(" ");
- printf(" ");
- printf("=====[ DINI, Carro %d ]=====",idx);
- printf("Criada");
- printf(" ");
- format(string, sizeof(string), "[CONCESSIONÁRIA] DINI do Carro ' %d ' criada com sucesso...",idx);
- SendClientMessage(playerid, Azul, string);
- idx ++;
- CarregarCarros();
- }
- else
- {
- format(string, sizeof(string), "[CONCESSIONÁRIA] DINI do Carro ' %d ' já existe....",idx);
- SendClientMessage(playerid, Branco, string);
- idx ++;
- }
- }
- return 1;
- }
- forward SalvarCarros();
- public SalvarCarros()
- {
- new arquivo[256];
- new idx = 1;
- while (idx < sizeof(Carro))
- {
- format(arquivo, sizeof(arquivo), "/Concessionaria/Carros/Carro%d.ini",idx);
- dini_Set(arquivo,"cDono",Carro[idx][cDono]);
- dini_IntSet(arquivo,"cCarroON",Carro[idx][cCarroON]);
- dini_IntSet(arquivo,"cModelo",Carro[idx][cModelo]);
- dini_FloatSet(arquivo,"cSpawnX",Carro[idx][cSpawnX]);
- dini_FloatSet(arquivo,"cSpawnY",Carro[idx][cSpawnY]);
- dini_FloatSet(arquivo,"cSpawnZ",Carro[idx][cSpawnZ]);
- dini_FloatSet(arquivo,"cAngulo",Carro[idx][cAngulo]);
- dini_IntSet(arquivo,"CorUm",Carro[idx][cCorUm]);
- dini_IntSet(arquivo,"CorDois",Carro[idx][cCorDois]);
- printf(" ");
- printf(" ");
- printf("=====[ SALVANDO CARRO: %d ]=====",idx);
- printf(" ");
- printf(" ");
- idx ++;
- }
- return 1;
- }
- public SalvarCarro(cCarroid)
- {
- new arquivo[256];
- format(arquivo, sizeof(arquivo), "/Concessionaria/Carros/Carro%d.ini",cCarroid);
- dini_Set(arquivo,"cDono",Carro[cCarroid][cDono]);
- dini_IntSet(arquivo,"cCarroON",Carro[cCarroid][cCarroON]);
- dini_IntSet(arquivo,"cModelo",Carro[cCarroid][cModelo]);
- dini_FloatSet(arquivo,"cSpawnX",Carro[cCarroid][cSpawnX]);
- dini_FloatSet(arquivo,"cSpawnY",Carro[cCarroid][cSpawnY]);
- dini_FloatSet(arquivo,"cSpawnZ",Carro[cCarroid][cSpawnZ]);
- dini_FloatSet(arquivo,"cAngulo",Carro[cCarroid][cAngulo]);
- dini_IntSet(arquivo,"CorUm",Carro[cCarroid][cCorUm]);
- dini_IntSet(arquivo,"CorDois",Carro[cCarroid][cCorDois]);
- printf(" ");
- printf(" ");
- printf("=====[ SALVANDO CARRO: %d ]=====",cCarroid);
- printf(" ");
- printf(" ");
- return 1;
- }
- public CarregarDono(playerid)
- {
- new PlayerNick[MAX_PLAYER_NAME];
- GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
- new arquivo[256];
- format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
- if(dini_Exists(arquivo))
- {
- strmid(Dono[playerid][dDono], dini_Get(arquivo,"dDono"), 0, strlen(dini_Get(arquivo,"dDono")), 32);
- Dono[playerid][dChave] = dini_Int(arquivo,"dChave");
- }
- return 1;
- }
- public SalvarDono(playerid)
- {
- new PlayerNick[MAX_PLAYER_NAME];
- GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
- new arquivo[256];
- format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
- dini_Set(arquivo,"dDono",Dono[playerid][dDono]);
- dini_IntSet(arquivo,"dChave",Dono[playerid][dChave]);
- return 1;
- }
- public ComprarCarro(playerid)
- {
- for(new i=0; i<MAX_PLAYERS; i++)
- {
- new PlayerNick[MAX_PLAYER_NAME];
- GetPlayerName(i,PlayerNick,sizeof(PlayerNick));
- new arquivo[256];
- new arquivo2[256];
- new car = TaNoCarro[i];
- if(car > 0)
- {
- format(arquivo, sizeof(arquivo), "/Concessionaria/Carros/Carro%d.ini", car);
- strmid(Carro[car][cDono], PlayerNick, 0, strlen(PlayerNick), MAX_PLAYER_NAME);
- dini_Set(arquivo,"cDono",PlayerNick);
- Carro[car][cModelo] = ModeloCarro[playerid];
- dini_IntSet(arquivo,"cCarroON",Carro[car][cCarroON]);
- dini_IntSet(arquivo,"cModelo",Carro[car][cModelo]);
- dini_FloatSet(arquivo,"cSpawnX",Carro[car][cSpawnX]);
- dini_FloatSet(arquivo,"cSpawnY",Carro[car][cSpawnY]);
- dini_FloatSet(arquivo,"cSpawnZ",Carro[car][cSpawnZ]);
- dini_FloatSet(arquivo,"cAngulo",Carro[car][cAngulo]);
- dini_IntSet(arquivo,"CorUm",Carro[car][cCorUm]);
- dini_IntSet(arquivo,"CorDois",Carro[car][cCorDois]);
- format(arquivo2, sizeof(arquivo2), "/Concessionaria/Donos/%s.ini",PlayerNick);
- if(!dini_Exists(arquivo2))
- {
- dini_Create(arquivo2);
- dini_Set(arquivo2,"dDono",PlayerNick);
- dini_IntSet(arquivo2,"dChave",Dono[i][dChave]);
- ModeloCarro[playerid] = 0;
- }
- return 1;
- }
- }
- return 1;
- }
- public PrecoCarro(playerid)
- {
- if(ModeloCarro[playerid] == 401)
- {
- if(GetPlayerMoney(playerid) > PRECO_Bravura)
- {
- GivePlayerMoney(playerid, -PRECO_Bravura);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 402)
- {
- if(GetPlayerMoney(playerid) > PRECO_Buffalo)
- {
- GivePlayerMoney(playerid, -PRECO_Buffalo);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 404)
- {
- if(GetPlayerMoney(playerid) > PRECO_Perenniel)
- {
- GivePlayerMoney(playerid, -PRECO_Perenniel);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 405)
- {
- if(GetPlayerMoney(playerid) > PRECO_Sentinel)
- {
- GivePlayerMoney(playerid, -PRECO_Sentinel);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 409)
- {
- if(GetPlayerMoney(playerid) > PRECO_Limosine)
- {
- GivePlayerMoney(playerid, -PRECO_Limosine);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 410)
- {
- if(GetPlayerMoney(playerid) > PRECO_Manana)
- {
- GivePlayerMoney(playerid, -PRECO_Manana);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 412)
- {
- if(GetPlayerMoney(playerid) > PRECO_Voodoo)
- {
- GivePlayerMoney(playerid, -PRECO_Voodoo);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 415)
- {
- if(GetPlayerMoney(playerid) > PRECO_Cheetah)
- {
- GivePlayerMoney(playerid, -PRECO_Cheetah);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 418)
- {
- if(GetPlayerMoney(playerid) > PRECO_Moonbeam)
- {
- GivePlayerMoney(playerid, -PRECO_Moonbeam);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 419)
- {
- if(GetPlayerMoney(playerid) > PRECO_Esperanto)
- {
- GivePlayerMoney(playerid, -PRECO_Esperanto);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 421)
- {
- if(GetPlayerMoney(playerid) > PRECO_Washington)
- {
- GivePlayerMoney(playerid, -PRECO_Washington);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 426)
- {
- if(GetPlayerMoney(playerid) > PRECO_Premier)
- {
- GivePlayerMoney(playerid, -PRECO_Premier);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 429)
- {
- if(GetPlayerMoney(playerid) > PRECO_Banshee)
- {
- GivePlayerMoney(playerid, -PRECO_Banshee);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 434)
- {
- if(GetPlayerMoney(playerid) > PRECO_Hotknife)
- {
- GivePlayerMoney(playerid, -PRECO_Hotknife);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 436)
- {
- if(GetPlayerMoney(playerid) > PRECO_Previon)
- {
- GivePlayerMoney(playerid, -PRECO_Previon);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 439)
- {
- if(GetPlayerMoney(playerid) > PRECO_Stallion)
- {
- GivePlayerMoney(playerid, -PRECO_Stallion);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 442)
- {
- if(GetPlayerMoney(playerid) > PRECO_Romero)
- {
- GivePlayerMoney(playerid, -PRECO_Romero);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 445)
- {
- if(GetPlayerMoney(playerid) > PRECO_Admiral)
- {
- GivePlayerMoney(playerid, -PRECO_Admiral);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 451)
- {
- if(GetPlayerMoney(playerid) > PRECO_Turismo)
- {
- GivePlayerMoney(playerid, -PRECO_Turismo);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 458)
- {
- if(GetPlayerMoney(playerid) > PRECO_Solair)
- {
- GivePlayerMoney(playerid, -PRECO_Solair);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 466)
- {
- if(GetPlayerMoney(playerid) > PRECO_Glendale)
- {
- GivePlayerMoney(playerid, -PRECO_Glendale);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 467)
- {
- if(GetPlayerMoney(playerid) > PRECO_Oceanic)
- {
- GivePlayerMoney(playerid, -PRECO_Oceanic);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 474)
- {
- if(GetPlayerMoney(playerid) > PRECO_Hermes)
- {
- GivePlayerMoney(playerid, -PRECO_Hermes);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 475)
- {
- if(GetPlayerMoney(playerid) > PRECO_Sabre)
- {
- GivePlayerMoney(playerid, -PRECO_Sabre);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 477)
- {
- if(GetPlayerMoney(playerid) > PRECO_ZR350)
- {
- GivePlayerMoney(playerid, -PRECO_ZR350);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 479)
- {
- if(GetPlayerMoney(playerid) > PRECO_Regina)
- {
- GivePlayerMoney(playerid, -PRECO_Regina);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 480)
- {
- if(GetPlayerMoney(playerid) > PRECO_Comet)
- {
- GivePlayerMoney(playerid, -PRECO_Comet);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 483)
- {
- if(GetPlayerMoney(playerid) > PRECO_Camper)
- {
- GivePlayerMoney(playerid, -PRECO_Camper);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 491)
- {
- if(GetPlayerMoney(playerid) > PRECO_Virgo)
- {
- GivePlayerMoney(playerid, -PRECO_Virgo);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 492)
- {
- if(GetPlayerMoney(playerid) > PRECO_Greenwood)
- {
- GivePlayerMoney(playerid, -PRECO_Greenwood);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 496)
- {
- if(GetPlayerMoney(playerid) > PRECO_BlistaCompact)
- {
- GivePlayerMoney(playerid, -PRECO_BlistaCompact);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 506)
- {
- if(GetPlayerMoney(playerid) > PRECO_SuperGT)
- {
- GivePlayerMoney(playerid, -PRECO_SuperGT);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 507)
- {
- if(GetPlayerMoney(playerid) > PRECO_Elegant)
- {
- GivePlayerMoney(playerid, -PRECO_Elegant);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 516)
- {
- if(GetPlayerMoney(playerid) > PRECO_Nebula)
- {
- GivePlayerMoney(playerid, -PRECO_Nebula);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 517)
- {
- if(GetPlayerMoney(playerid) > PRECO_Majestic)
- {
- GivePlayerMoney(playerid, -PRECO_Majestic);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 518)
- {
- if(GetPlayerMoney(playerid) > PRECO_Buccaneer)
- {
- GivePlayerMoney(playerid, -PRECO_Buccaneer);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 526)
- {
- if(GetPlayerMoney(playerid) > PRECO_Fortune)
- {
- GivePlayerMoney(playerid, -PRECO_Fortune);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 527)
- {
- if(GetPlayerMoney(playerid) > PRECO_Cadrona)
- {
- GivePlayerMoney(playerid, -PRECO_Cadrona);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 529)
- {
- if(GetPlayerMoney(playerid) > PRECO_Willard)
- {
- GivePlayerMoney(playerid, -PRECO_Willard);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 533)
- {
- if(GetPlayerMoney(playerid) > PRECO_Feltzer)
- {
- GivePlayerMoney(playerid, -PRECO_Feltzer);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 534)
- {
- if(GetPlayerMoney(playerid) > PRECO_Remington)
- {
- GivePlayerMoney(playerid, -PRECO_Remington);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 535)
- {
- if(GetPlayerMoney(playerid) > PRECO_Slamvan)
- {
- GivePlayerMoney(playerid, -PRECO_Slamvan);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 536)
- {
- if(GetPlayerMoney(playerid) > PRECO_Blade)
- {
- GivePlayerMoney(playerid, -PRECO_Blade);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 540)
- {
- if(GetPlayerMoney(playerid) > PRECO_Vincent)
- {
- GivePlayerMoney(playerid, -PRECO_Vincent);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 541)
- {
- if(GetPlayerMoney(playerid) > PRECO_Bullet)
- {
- GivePlayerMoney(playerid, -PRECO_Bullet);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 542)
- {
- if(GetPlayerMoney(playerid) > PRECO_Clover)
- {
- GivePlayerMoney(playerid, -PRECO_Clover);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 545)
- {
- if(GetPlayerMoney(playerid) > PRECO_Hustler)
- {
- GivePlayerMoney(playerid, -PRECO_Hustler);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 546)
- {
- if(GetPlayerMoney(playerid) > PRECO_Intruder)
- {
- GivePlayerMoney(playerid, -PRECO_Intruder);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 547)
- {
- if(GetPlayerMoney(playerid) > PRECO_Primo)
- {
- GivePlayerMoney(playerid, -PRECO_Primo);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 549)
- {
- if(GetPlayerMoney(playerid) > PRECO_Tampa)
- {
- GivePlayerMoney(playerid, -PRECO_Tampa);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 550)
- {
- if(GetPlayerMoney(playerid) > PRECO_Sunrise)
- {
- GivePlayerMoney(playerid, -PRECO_Sunrise);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 551)
- {
- if(GetPlayerMoney(playerid) > PRECO_Merit)
- {
- GivePlayerMoney(playerid, -PRECO_Merit);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 555)
- {
- if(GetPlayerMoney(playerid) > PRECO_Windsor)
- {
- GivePlayerMoney(playerid, -PRECO_Windsor);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 558)
- {
- if(GetPlayerMoney(playerid) > PRECO_Uranus)
- {
- GivePlayerMoney(playerid, -PRECO_Uranus);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 559)
- {
- if(GetPlayerMoney(playerid) > PRECO_Jester)
- {
- GivePlayerMoney(playerid, -PRECO_Jester);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 560)
- {
- if(GetPlayerMoney(playerid) > PRECO_Sultan)
- {
- GivePlayerMoney(playerid, -PRECO_Sultan);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 561)
- {
- if(GetPlayerMoney(playerid) > PRECO_Stratum)
- {
- GivePlayerMoney(playerid, -PRECO_Stratum);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 562)
- {
- if(GetPlayerMoney(playerid) > PRECO_Elegy)
- {
- GivePlayerMoney(playerid, -PRECO_Elegy);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 565)
- {
- if(GetPlayerMoney(playerid) > PRECO_Flash)
- {
- GivePlayerMoney(playerid, -PRECO_Flash);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 566)
- {
- if(GetPlayerMoney(playerid) > PRECO_Tahoma)
- {
- GivePlayerMoney(playerid, -PRECO_Tahoma);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 567)
- {
- if(GetPlayerMoney(playerid) > PRECO_Savanna)
- {
- GivePlayerMoney(playerid, -PRECO_Savanna);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 575)
- {
- if(GetPlayerMoney(playerid) > PRECO_Broadway)
- {
- GivePlayerMoney(playerid, -PRECO_Broadway);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 576)
- {
- if(GetPlayerMoney(playerid) > PRECO_Tornado)
- {
- GivePlayerMoney(playerid, -PRECO_Tornado);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 580)
- {
- if(GetPlayerMoney(playerid) > PRECO_Stafford)
- {
- GivePlayerMoney(playerid, -PRECO_Stafford);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 585)
- {
- if(GetPlayerMoney(playerid) > PRECO_Emperor)
- {
- GivePlayerMoney(playerid, -PRECO_Emperor);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 587)
- {
- if(GetPlayerMoney(playerid) > PRECO_Euros)
- {
- GivePlayerMoney(playerid, -PRECO_Euros);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 589)
- {
- if(GetPlayerMoney(playerid) > PRECO_Club)
- {
- GivePlayerMoney(playerid, -PRECO_Club);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 602)
- {
- if(GetPlayerMoney(playerid) > PRECO_Alpha)
- {
- GivePlayerMoney(playerid, -PRECO_Alpha);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- if(ModeloCarro[playerid] == 603)
- {
- if(GetPlayerMoney(playerid) > PRECO_Phoenix)
- {
- GivePlayerMoney(playerid, -PRECO_Phoenix);
- FuncaocCarro(playerid);
- }
- else
- {
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Você não tem dinheiro suficiente.");
- }
- }
- }
- public FuncaocCarro(playerid)
- {
- if(IsPlayerConnected(playerid))
- {
- new PlayerNick[MAX_PLAYER_NAME];
- GetPlayerName(playerid,PlayerNick,sizeof(PlayerNick));
- new arquivo[256];
- format(arquivo, sizeof(arquivo), "/Concessionaria/Donos/%s.ini",PlayerNick);
- if(!dini_Exists(arquivo))
- {
- if(ModeloCarro[playerid] > 0)
- {
- if(TaNoCarro[playerid] == 0)
- {
- new idx = 1;
- while (idx < sizeof(Carro))
- {
- if(strcmp(Carro[idx][cDono],"Ninguem",true)==0)
- {
- new string[256];
- format(string, sizeof(string), "[CONCESSIONÁRIA] Este é o carro número %d da Concessionária",idx);
- strmid(Carro[idx][cDono], PlayerNick, 0, strlen(PlayerNick), MAX_PLAYER_NAME);
- cCarro[idx] = AddStaticVehicle(ModeloCarro[playerid],2809.5098,-1822.0376,9.7244,86.4366,0,0);
- PutPlayerInVehicle(playerid, cCarro[idx], 0);
- TaNoCarro[playerid] = idx;
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Parabéns! Você acabou de comprar um carro novo!");
- SendClientMessage(playerid, Azul, "[CONCESSIONÁRIA] Estacione ele usando /carroestacionar, caso contrário, ele será destruído!");
- SendClientMessage(playerid, Azul, string);
- CarroVidaTimer = SetTimer("CarroVida", 1000, 1);
- return 1;
- }
- else
- {
- idx++;
- }
- }
- }
- else
- {
- SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Você já está em um carro da concessionária...");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Você não definiu qual carro você quer.");
- return 1;
- }
- }
- else
- {
- SendClientMessage(playerid, Branco, "[CONCESSIONÁRIA] Você ja tem um carro...");
- }
- }
- return 1;
- }
- public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
- {
- if(IsPlayerConnected(playerid))
- {
- new Float:oldposx, Float:oldposy, Float:oldposz;
- new Float:tempposx, Float:tempposy, Float:tempposz;
- GetPlayerPos(playerid, oldposx, oldposy, oldposz);
- tempposx = (oldposx -x);
- tempposy = (oldposy -y);
- tempposz = (oldposz -z);
- //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
- if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
- {
- return 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement