Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Hecho por [sT]Alejo/xP_One para Español-Pawno
- El Menu De Autos Es De Camilo Yo Solo Modifique Y Agregue Unas Cosas
- Bloque Los Hunter, Hydras, Rhino y Eso Bye
- */
- #include <a_samp>
- #define ROJO 0xF10000FF //define el color ROJO
- #define VERDE 0x006500FF //define el color VERDE
- #define AZUL 0x000071FF //define el color AZUL
- #define NARANJA 0xBF6500FF //define el color NARANJA
- #define COLOR_AZUL 0x33CCFFAA
- #define rojo 0xFF0000AA
- enum AutoPlayer
- {
- pCar
- };
- new aVehicleNames[][] = {
- "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster",
- "Stretch","Manana","Infernus","Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto",
- "Taxi","Washington","Bobcat","Mr Whoopee","BF Injection","Hunter","Premier","Enforcer","Securicar","Banshee",
- "Predator","Bus","Rhino","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","ZR3 50","Walton","Regina","Comet","BMX",
- "Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo",
- "Greenwood","Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","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","Hydra","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","Police Car (LSPD)","Police Car (SFPD)","Police Car (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" };
- new AccInfo[MAX_PLAYERS][AutoPlayer];
- forward CarSpawner(playerid,model);
- forward ResAuto(vehicleid);
- forward BorrarAuto(vehicleid);
- ShowPlayerDefaultDialog( playerid )
- {
- ShowPlayerDialog( playerid, 2500, DIALOG_STYLE_LIST, "Vehiculos Disponibles", "Aviones\nHelicopteros\nMotos\nConvertibles
- \nIndustriales\nLowriders\nTodoterreno\nServicio Publico\nElegantes\nDeportivos\nVagones\nBarcos\nTrailers\nCarros Unicos
- \nRadio Control", "Aceptar", "Cancelar" );
- return 1;
- }
- public OnPlayerCommandText( playerid, cmdtext[] )
- {
- new cmd[200], idx,String[200],tmp[256];
- cmd = strtok(cmdtext, idx);
- tmp = strtok(cmdtext, idx);
- if(strcmp(cmd, "/car", true, 10) == 0)
- {
- if(!strlen(tmp)) return ShowPlayerDefaultDialog( playerid );
- new vehicle = GetVehicleModelIDFromName(tmp);
- if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, rojo, "Este Auto No Existe!");
- if((vehicle==520)||(vehicle==432)||(vehicle==447)||(vehicle==425)||(vehicle==464)||(vehicle==476)) return SendClientMessage
- (playerid, rojo, "Este Auto No Existe!");
- if(IsPlayerInAnyVehicle(playerid))
- SendClientMessage(playerid, rojo, "ERROR: Ya Estas En Un Auto!");
- else
- {
- new Float:x, Float:y, Float:z, Float:angle;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, angle);
- if(AccInfo[playerid][pCar] != -1)
- BorrarAuto(AccInfo[playerid][pCar]);
- new vehicleid=CreateVehicle(vehicle, x, y, z+2, angle, -1, -1, -1);
- PutPlayerInVehicle(playerid, vehicleid, 0);
- SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
- LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
- AccInfo[playerid][pCar] = vehicleid;
- }
- format(String, sizeof(String), "Has Aparecido Un %s", aVehicleNames[vehicle - 400]);
- SendClientMessage(playerid, 0x33FF33AA, String);
- return 1;
- }
- return 0;
- }
- public OnDialogResponse( playerid, dialogid, response, listitem, inputtext[] )
- {
- switch(dialogid)
- {
- case 2500 :
- {
- switch ( listitem )
- {
- case 0 : ShowPlayerDialog( playerid, 2501, DIALOG_STYLE_LIST, "Aviones",
- "Andromada\nAT-400\nBeagle\nCropduster\nDodo\nNevada\nRustler\nShamal\nSkimmer\nStuntplane\nAtras", "Aceptar",
- "Cancelar" );
- case 1 : ShowPlayerDialog( playerid, 2502, DIALOG_STYLE_LIST,
- "Helicopteros", "Cargobob\nLeviathan\nMaverick\nMaverick SATV\nMaverick De Policia\nRaindance\nSeasparrow\nSparrow
- \nAtras", "Aceptar", "Cancelar" );
- case 2 : ShowPlayerDialog( playerid, 2503, DIALOG_STYLE_LIST, "Motos",
- "BF-400\nBike\nBMX\nFaggio\nFCR-900\nFreeway\nMountain Bike\nNRG-500\nPCJ-600\nPizzaboy\nQuad\nSanchez
- \nWayfarer\nAtras", "Aceptar", "Cancelar" );
- case 3 : ShowPlayerDialog( playerid, 2504, DIALOG_STYLE_LIST,
- "Convertibles", "Comet\nFeltzer\nStallion\nWindsor\nAtras", "Aceptar", "Cancelar" );
- case 4 : ShowPlayerDialog( playerid, 2505, DIALOG_STYLE_LIST,
- "Industriales", "Benson\nBobcat\nBurrito\nBoxville\nBoxburg\nCement Truck\nDFT-30\nFlatbed\nLinerunner\nMule\nVan SATV
- \nPacker\nPetrol Tanker\nPony\nRoadtrain\nRumpo\nSadler\nSadler Shit\nTopfun\nTractor\nTrashmaster\nUtility Van\nWalton
- \nYankee\nYosemite\nAtras", "Aceptar", "Cancelar" );
- case 5 : ShowPlayerDialog( playerid, 2506, DIALOG_STYLE_LIST,
- "Lowriders", "Blade\nBroadway\nRemington\nSavanna\nSlamvan\nTahoma\nTornado\nVoodoo\nAtras", "Aceptar", "Cancelar" );
- case 6 : ShowPlayerDialog( playerid, 2507, DIALOG_STYLE_LIST,
- "Todoterreno", "Bandito\nBF Injection\nDune\nHuntley\nLandstalker\nMesa\nMonster\nMonster A\nMonster B\nPatriot\nRancher
- A\nRancher B\nSandking\nAtras", "Aceptar", "Cancelar" );
- case 7 : ShowPlayerDialog( playerid, 2508, DIALOG_STYLE_LIST, "Servicio
- Publico", "Ambulancia\nBarracks\nBus\nCabbie\nCoach\nMoto Policia (HPV-1000)\nEnforcer\nFBI Rancher\nFBI Truck\nFiretruck
- \nFiretruck LA\nPatrulla (LSPD)\nPatrulla (LVPD)\nPatrulla (SFPD)\nRanger\nS.W.A.T\nTaxi\nAtras", "Aceptar", "Cancelar" );
- case 8 : ShowPlayerDialog( playerid, 2509, DIALOG_STYLE_LIST,
- "Elegantes", "Admiral\nBloodring Banger\nBravura\nBuccaneer\nCadrona\nClover\nElegant\nElegy\nEmperor\nEsperanto
- \nFortune\nGlendale Shit\nGlendale\nGreenwood\nHermes\nIntruder\nMajestic\nManana\nMerit\nNebula\nOceanic\nPicador
- \nPremier\nPrevion\nPrimo\nSentinel\nStafford\nSultan\nSunrise\nTampa\nVincent\nVirgo\nWillard\nWashington\nAtras",
- "Aceptar", "Cancelar" );
- case 9 : ShowPlayerDialog( playerid, 2510, DIALOG_STYLE_LIST,
- "Deportivos", "Alpha\nBanshee\nBlista Compact\nBuffalo\nBullet\nCheetah\nClub\nEuros\nFlash\nHotring Racer\nHotring Racer
- A\nHotring Racer B\nInfernus\nJester\nPhoenix\nSabre\nSuper GT\nTurismo\nUranus\nZR-350\nAtras", "Aceptar", "Cancelar" );
- case 10 : ShowPlayerDialog( playerid, 2511, DIALOG_STYLE_LIST,
- "Vagones", "Moonbeam\nPerenniel\nRegina\nSolair\nStratum\nAtras", "Aceptar", "Cancelar" );
- case 11 : ShowPlayerDialog( playerid, 2512, DIALOG_STYLE_LIST, "Barcos",
- "Guardia Costera\nDinghy\nJetmax\nLaunch\nMarquis\nPredator\nReefer\nSpeeder\nSqualo\nTropic\nAtras", "Aceptar",
- "Cancelar" );
- case 12 : ShowPlayerDialog( playerid, 2513, DIALOG_STYLE_LIST, "Trailers",
- "Article Trailer\nArticle Trailer 2\nArticle Trailer 3\nBaggage Trailer A\nBaggage Trailer B\nFarm Trailer\nFreight Flat Trailer
- (Train)\nFreight Box Trailer (Train)\nPetrol Trailer\nStreak Trailer (Train)\nStairs Trailer\nUtility Trailer\nAtras", "Aceptar",
- "Cancelar" );
- case 13 : ShowPlayerDialog( playerid, 2514, DIALOG_STYLE_LIST, "Carros
- Unicos", "Baggage\nBrownstreak (Train)\nCaddy\nCamper\nCamper A\nCombine Harvester\nDozer\nDumper\nForklift\nFreight
- (Train)\nHotknife\nHustler\nHotdog\nKart\nMower\nMr Whoopee\nRomero\nSecuricar\nStretch\nSweeper\nTram\nTowtruck
- \nTug\nVortex\nAtras", "Aceptar", "Cancelar" );
- case 14 : ShowPlayerDialog( playerid, 2515, DIALOG_STYLE_LIST, "Radio
- Control", "RC Bandit\nRC Baron\nRC Raider\nRC Goblin\nRC Tiger\nRC Cam\nAtras", "Aceptar", "Cancelar" );
- }
- }
- case 2501 :
- {
- if ( listitem > 10 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 592, 577, 511, 512, 593, 553, 476, 519, 460, 513 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2502 :
- {
- if ( listitem > 8 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 548, 417, 487, 488, 497, 563, 447, 469 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2503 :
- {
- if ( listitem > 12 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 581, 509, 481, 462, 521, 463, 510, 522, 461, 448, 471, 468, 586
- };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2504 :
- {
- if ( listitem > 3 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 480, 533, 439, 555 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2505 :
- {
- if ( listitem > 24 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 499, 422, 482, 498, 609, 524, 578, 455, 403, 414, 582, 443, 514, 413, 515, 440,
- 543, 605, 459, 531, 408, 552, 478, 456, 554 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2506 :
- {
- if ( listitem > 7 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 536, 575, 534, 567, 535, 566, 576, 412 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2507 :
- {
- if ( listitem > 12 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 568, 424, 573, 579, 400, 500, 444, 556, 557, 470, 489, 505, 495 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2508 :
- {
- if ( listitem > 17 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 416, 433, 431, 438, 437, 523, 427, 490, 528, 407, 544, 596, 598, 597, 599, 601,
- 420 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2509 :
- {
- if ( listitem > 33 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 445, 504, 401, 518, 527, 542, 507, 562, 585, 419, 526, 604, 466, 492, 474, 546, 517, 410,
- 551, 516, 467, 600, 426, 436, 547, 405, 580, 560, 550, 549, 540, 491, 529, 421 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2510 :
- {
- if ( listitem > 19 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 602, 429, 496, 402, 541, 415, 589, 587, 565, 494, 502, 503, 411, 559, 603, 475, 506, 451,
- 558, 477 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2511 :
- {
- if ( listitem > 4 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 418, 404, 479, 458, 561 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2512 :
- {
- if ( listitem > 9 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 472, 473, 493, 595, 484, 430, 453, 452, 446, 454 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2513 :
- {
- if ( listitem > 11 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 435, 450, 591, 606, 607, 610, 569, 590, 584, 570, 608, 611 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2514 :
- {
- if ( listitem > 23 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 485, 537, 457, 483, 508, 532, 486, 406, 530, 538, 434, 545, 588, 571, 572, 423, 442, 428,
- 409, 574, 449, 525, 583, 539 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- case 2515 :
- {
- if ( listitem > 5 ) return ShowPlayerDefaultDialog( playerid );
- new
- modelo[] = { 441, 464, 465, 501, 564, 594 };
- return CarSpawner( playerid, modelo[ listitem ] );
- }
- }
- return 0;
- }
- //====================================================================================================
- public OnPlayerConnect(playerid)
- {
- AccInfo[playerid][pCar] = -1;
- return 1;
- }
- public OnPlayerDisconnect(playerid)
- {
- if(AccInfo[playerid][pCar] != -1) BorrarAuto(AccInfo[playerid][pCar]);
- return 1;
- }
- //=============================================NUEVA
- FUNCION===============================================
- public CarSpawner(playerid,model)
- {
- if(IsPlayerInAnyVehicle(playerid))
- SendClientMessage(playerid, rojo, "ERROR: Ya Estas En Un Auto!");
- else
- {
- new Float:x, Float:y, Float:z, Float:angle;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, angle);
- if(AccInfo[playerid][pCar] != -1)
- BorrarAuto(AccInfo[playerid][pCar]);
- new vehicleid=CreateVehicle(model, x, y, z+2, angle, -1, -1, -1);
- PutPlayerInVehicle(playerid, vehicleid, 0);
- SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
- LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
- AccInfo[playerid][pCar] = vehicleid;
- }
- return 1;
- }
- public BorrarAuto(vehicleid)
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- new Float:X,Float:Y,Float:Z;
- if(IsPlayerInVehicle(i, vehicleid))
- {
- RemovePlayerFromVehicle(i);
- GetPlayerPos(i,X,Y,Z);
- SetPlayerPos(i,X,Y+3,Z);
- }
- SetVehicleParamsForPlayer(vehicleid,i,0,1);
- }
- SetTimerEx("ResAuto",1500,0,"i",vehicleid);
- }
- public ResAuto(vehicleid)
- {
- DestroyVehicle(vehicleid);
- }
- public OnVehicleSpawn(vehicleid)
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- if(vehicleid==AccInfo[i][pCar])
- {
- BorrarAuto(vehicleid);
- AccInfo[i][pCar]=-1;
- }
- }
- return 1;
- }
- //=======================Termino De Autos================================
- 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;
- }
- GetVehicleModelIDFromName(vname[])
- {
- for(new i = 0; i < 211; i++)
- {
- if(strfind(aVehicleNames[i], vname, true) != -1)
- return i + 400;
- }
- return -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement