Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FILTERSCRIPT
- #define MENUAUTOS 9050
- #pragma tabsize 0
- #define rojo 0xFF0000AA
- enum AutoPlayer
- {
- pCar
- };
- new AccInfo[MAX_PLAYERS][AutoPlayer];
- forward CarSpawner(playerid,model);
- forward ResAuto(vehicleid);
- forward BorrarAuto(vehicleid);
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print("<<<<<<<<<<<<DIALOG DE AUTOS>>>>>>>>>>>>>");
- print("<<<<<<<<<<<<<<<<HECHO POR:>>>>>>>>>>>>>>");
- print("<<<<<<<<<<<<<<<<<<<Genius>>>>>>>>>>>>>>>>>");
- print("<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>");
- print("--------------------------------------\n");
- return 1;
- }
- public OnPlayerCommandText(playerid, cmdtext[])
- {
- if (strcmp("/menuautos", cmdtext, true, 10) == 0)
- {
- if(!IsPlayerInAnyVehicle(playerid))
- {
- ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
- }
- else {
- SendClientMessage(playerid,rojo,"Ya estas en un vehiculo");
- }
- return 1;
- }
- return 0;
- }
- public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
- {
- if(dialogid == MENUAUTOS)
- {
- if(response)
- {
- if(listitem == 0)
- {
- ShowPlayerDialog(playerid, MENUAUTOS+1, DIALOG_STYLE_LIST, "AUTOS", "Admiral\nBlade\nBlistac\nBravura\nBroadway\nBuffalo\nCadrona\nCheetah\nClover\nComet\nCopCarla\nCopCarsf\nElegant\nElegy\nGlendale\nManana\nPremier\nSabre\nSavanna\nTaxi\nVoodoo\nZr350","Seleccionar","Atras");
- }
- if(listitem == 1)
- {
- ShowPlayerDialog(playerid, MENUAUTOS+2, DIALOG_STYLE_LIST, "AUTOS RAPIDOS", "Alpha\nBanshee\nBullet\nComet\nEuros\nHotrina\nHotring\nInfernus\nJester\nPhonix\nSultan\nSupergt\nTurismo\nUranus","Seleccionar","Atras");
- }
- if(listitem == 2)
- {
- ShowPlayerDialog(playerid, MENUAUTOS+3, DIALOG_STYLE_LIST, "MOTOS Y BICICLETAS", "NRG-500\nFaggio\nFCR-900\nPCJ-600\nFreeway\nBF-400\nPizzaBoy\nCopBike\nSanchez\nCuatrimoto\nBike\nBMX\nMountain Bike","Seleccionar","Atras");
- }
- if(listitem == 3)
- {
- ShowPlayerDialog(playerid, MENUAUTOS+4, DIALOG_STYLE_LIST, "CAMIONES Y CAMIONETAS", "Ambulance\nBenson\nBobCat\nBurrito\nBus\nCamper\nCoach\nFireTruck\nPatriot\nRancher\nWalton\nDuneride\nMonster\nVerga Movil","Seleccionar","Atras");
- }
- if(listitem == 4)
- {
- ShowPlayerDialog(playerid, MENUAUTOS+5, DIALOG_STYLE_LIST, "AVIONES", "Rustler\nDodo\nNevada\nStuntPlane\nBeagle\nSkimer\nShamal","Seleccionar","Atras");
- }
- if(listitem == 5)
- {
- ShowPlayerDialog(playerid, MENUAUTOS+6, DIALOG_STYLE_LIST, "HELICOPTEROS", "Cargobob\nLeviathn\nMaverick\nPolMav\nRainDanc\nSparrow\nVsnMav","Seleccionar","Atras");
- }
- if(listitem == 6)
- {
- ShowPlayerDialog(playerid, MENUAUTOS+7, DIALOG_STYLE_LIST, "BOTES", "CoastGuard\nDhingy\nJetMax\nLaunch\nMarquis\nPredato\nSpeedr\nSqualo\nVortex","Seleccionar","Atras");
- }
- }
- return 1;
- }
- if(dialogid == MENUAUTOS+1)
- {
- if(response == 1)
- {
- ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
- }
- if(response)
- {
- if(listitem == 1)
- {
- CarSpawner(playerid,445);
- }
- if(listitem == 1)
- {
- CarSpawner(playerid,536);
- }
- if(listitem == 2)
- {
- CarSpawner(playerid,401);
- }
- if(listitem == 3)
- {
- CarSpawner(playerid,496);
- }
- if(listitem == 4)
- {
- CarSpawner(playerid,575);
- }
- if(listitem == 5)
- {
- CarSpawner(playerid,402);
- }
- if(listitem == 6)
- {
- CarSpawner(playerid,527);
- }
- if(listitem == 7)
- {
- CarSpawner(playerid,415);
- }
- if(listitem == 8)
- {
- CarSpawner(playerid,542);
- }
- if(listitem == 9)
- {
- CarSpawner(playerid,480);
- }
- if(listitem == 10)
- {
- CarSpawner(playerid,596);
- }
- if(listitem == 11)
- {
- CarSpawner(playerid,597);
- }
- if(listitem == 12)
- {
- CarSpawner(playerid,507);
- }
- if(listitem == 13)
- {
- CarSpawner(playerid,562);
- }
- if(listitem == 14)
- {
- CarSpawner(playerid,466);
- }
- if(listitem == 15)
- {
- CarSpawner(playerid,410);
- }
- if(listitem == 16)
- {
- CarSpawner(playerid,426);
- }
- if(listitem == 17)
- {
- CarSpawner(playerid,475);
- }
- if(listitem == 18)
- {
- CarSpawner(playerid,467);
- }
- if(listitem == 19)
- {
- CarSpawner(playerid,420);
- }
- if(listitem == 20)
- {
- CarSpawner(playerid,412);
- }
- if(listitem == 21)
- {
- CarSpawner(playerid,477);
- }
- }
- return 1;
- }
- if(dialogid == MENUAUTOS+2)
- {
- if(response == 1)
- {
- ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
- }
- if(response)
- {
- if(listitem == 0)
- {
- CarSpawner(playerid,602);
- }
- if(listitem == 1)
- {
- CarSpawner(playerid,429);
- }
- if(listitem == 2)
- {
- CarSpawner(playerid,541);
- }
- if(listitem == 3)
- {
- CarSpawner(playerid,480);
- }
- if(listitem == 4)
- {
- CarSpawner(playerid,587);
- }
- if(listitem == 5)
- {
- CarSpawner(playerid,502);
- }
- if(listitem == 6)
- {
- CarSpawner(playerid,494);
- }
- if(listitem == 7)
- {
- CarSpawner(playerid,411);
- }
- if(listitem == 8)
- {
- CarSpawner(playerid,559);
- }
- if(listitem == 9)
- {
- CarSpawner(playerid,603);
- }
- if(listitem == 10)
- {
- CarSpawner(playerid,560);
- }
- if(listitem == 11)
- {
- CarSpawner(playerid,506);
- }
- if(listitem == 12)
- {
- CarSpawner(playerid,451);
- }
- if(listitem == 13)
- {
- CarSpawner(playerid,558);
- }
- }
- return 1;
- }
- if(dialogid == MENUAUTOS+4)
- {
- if(response == 0)
- {
- ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Perros\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
- }
- if(response)
- {
- if(listitem == 0)
- {
- CarSpawner(playerid,522);
- }
- if(listitem == 1)
- {
- CarSpawner(playerid,462);
- }
- if(listitem == 2)
- {
- CarSpawner(playerid,521);
- }
- if(listitem == 3)
- {
- CarSpawner(playerid,461);
- }
- if(listitem == 4)
- {
- CarSpawner(playerid,463);
- }
- if(listitem == 5)
- {
- CarSpawner(playerid,581);
- }
- if(listitem == 6)
- {
- CarSpawner(playerid,448);
- }
- if(listitem == 7)
- {
- CarSpawner(playerid,523);
- }
- if(listitem == 8)
- {
- CarSpawner(playerid,468);
- }
- if(listitem == 9)
- {
- CarSpawner(playerid,471);
- }
- if(listitem == 10)
- {
- CarSpawner(playerid,509);
- }
- if(listitem == 11)
- {
- CarSpawner(playerid,481);
- }
- if(listitem == 12)
- {
- CarSpawner(playerid,510);
- }
- }
- return 1;
- }
- if(dialogid == MENUAUTOS+4)
- {
- if(response == 0)
- {
- ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
- }
- if(response)
- {
- if(listitem == 0)
- {
- CarSpawner(playerid,416);
- }
- if(listitem == 1)
- {
- CarSpawner(playerid,499);
- }
- if(listitem == 2)
- {
- CarSpawner(playerid,422);
- }
- if(listitem == 3)
- {
- CarSpawner(playerid,482);
- }
- if(listitem == 4)
- {
- CarSpawner(playerid,431);
- }
- if(listitem == 5)
- {
- CarSpawner(playerid,483);
- }
- if(listitem == 6)
- {
- CarSpawner(playerid,437);
- }
- if(listitem == 7)
- {
- CarSpawner(playerid,407);
- }
- if(listitem == 8)
- {
- CarSpawner(playerid,470);
- }
- if(listitem == 9)
- {
- CarSpawner(playerid,489);
- }
- if(listitem == 10)
- {
- CarSpawner(playerid,578);
- }
- if(listitem == 11)
- {
- CarSpawner(playerid,573);
- }
- if(listitem == 12)
- {
- CarSpawner(playerid,444);
- }
- if(listitem == 13)
- {
- CarSpawner(playerid,423);
- }
- }
- return 1;
- }
- if(dialogid == MENUAUTOS+5)
- {
- if(response == 0)
- {
- ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
- }
- if(response)
- {
- if(listitem == 0)
- {
- CarSpawner(playerid,476);
- }
- if(listitem == 1)
- {
- CarSpawner(playerid,593);
- }
- if(listitem == 2)
- {
- CarSpawner(playerid,553);
- }
- if(listitem == 3)
- {
- CarSpawner(playerid,513);
- }
- if(listitem == 4)
- {
- CarSpawner(playerid,511);
- }
- if(listitem == 5)
- {
- CarSpawner(playerid,460);
- }
- if(listitem == 6)
- {
- CarSpawner(playerid,519);
- }
- }
- return 1;
- }
- if(dialogid == MENUAUTOS+6)
- {
- if(response == 0)
- {
- ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
- }
- if(response)
- {
- if(listitem == 0)
- {
- CarSpawner(playerid,548);
- }
- if(listitem == 1)
- {
- CarSpawner(playerid,417);
- }
- if(listitem == 2)
- {
- CarSpawner(playerid,487);
- }
- if(listitem == 3)
- {
- CarSpawner(playerid,497);
- }
- if(listitem == 4)
- {
- CarSpawner(playerid,563);
- }
- if(listitem == 5)
- {
- CarSpawner(playerid,469);
- }
- if(listitem == 6)
- {
- CarSpawner(playerid,488);
- }
- }
- return 1;
- }
- if(dialogid == MENUAUTOS+7)
- {
- if(response == 0)
- {
- ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
- }
- if(response)
- {
- if(listitem == 0)
- {
- CarSpawner(playerid,472);
- }
- if(listitem == 1)
- {
- CarSpawner(playerid,473);
- }
- if(listitem == 2)
- {
- CarSpawner(playerid,493);
- }
- if(listitem == 3)
- {
- CarSpawner(playerid,595);
- }
- if(listitem == 4)
- {
- CarSpawner(playerid,484);
- }
- if(listitem == 5)
- {
- CarSpawner(playerid,430);
- }
- if(listitem == 6)
- {
- CarSpawner(playerid,452);
- }
- if(listitem == 7)
- {
- CarSpawner(playerid,446);
- }
- if(listitem == 8)
- {
- CarSpawner(playerid,539);
- }
- }
- return 1;
- }
- 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;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement