Advertisement
Guest User

Menu Autos By davidxxx

a guest
Nov 22nd, 2011
1,025
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 10.93 KB | None | 0 0
  1. #include <a_samp>
  2. #define FILTERSCRIPT
  3. #define MENUAUTOS 9050
  4. #pragma tabsize 0
  5. #define rojo 0xFF0000AA
  6.  
  7.  
  8. enum AutoPlayer
  9.  
  10. {
  11. pCar
  12. };
  13.  
  14. new AccInfo[MAX_PLAYERS][AutoPlayer];
  15.  
  16.  
  17. forward CarSpawner(playerid,model);
  18. forward ResAuto(vehicleid);
  19. forward BorrarAuto(vehicleid);
  20.  
  21. public OnFilterScriptInit()
  22. {
  23.     print("\n--------------------------------------");
  24.     print("<<<<<<<<<<<<DIALOG DE AUTOS>>>>>>>>>>>>>");
  25.     print("<<<<<<<<<<<<<<<<HECHO POR:>>>>>>>>>>>>>>");
  26.     print("<<<<<<<<<<<<<<<<<<<Genius>>>>>>>>>>>>>>>>>");
  27.     print("<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>");
  28.     print("--------------------------------------\n");
  29.     return 1;
  30. }
  31.  
  32.  
  33.  
  34.  
  35. public OnPlayerCommandText(playerid, cmdtext[])
  36. {
  37.     if (strcmp("/menuautos", cmdtext, true, 10) == 0)
  38.     {
  39.     if(!IsPlayerInAnyVehicle(playerid))
  40.     {
  41.         ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
  42.         }
  43.         else {
  44.         SendClientMessage(playerid,rojo,"Ya estas en un vehiculo");
  45.         }
  46.         return 1;
  47.     }
  48.     return 0;
  49. }
  50.  
  51.  
  52.  
  53. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  54. {
  55. if(dialogid == MENUAUTOS)
  56. {
  57. if(response)
  58. {
  59. if(listitem == 0)
  60. {
  61. 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");
  62. }
  63. if(listitem == 1)
  64. {
  65. 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");
  66. }
  67. if(listitem == 2)
  68. {
  69. 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");
  70. }
  71. if(listitem == 3)
  72. {
  73. 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");
  74. }
  75. if(listitem == 4)
  76. {
  77. ShowPlayerDialog(playerid, MENUAUTOS+5, DIALOG_STYLE_LIST, "AVIONES", "Rustler\nDodo\nNevada\nStuntPlane\nBeagle\nSkimer\nShamal","Seleccionar","Atras");
  78. }
  79. if(listitem == 5)
  80. {
  81. ShowPlayerDialog(playerid, MENUAUTOS+6, DIALOG_STYLE_LIST, "HELICOPTEROS", "Cargobob\nLeviathn\nMaverick\nPolMav\nRainDanc\nSparrow\nVsnMav","Seleccionar","Atras");
  82. }
  83. if(listitem == 6)
  84. {
  85. ShowPlayerDialog(playerid, MENUAUTOS+7, DIALOG_STYLE_LIST, "BOTES", "CoastGuard\nDhingy\nJetMax\nLaunch\nMarquis\nPredato\nSpeedr\nSqualo\nVortex","Seleccionar","Atras");
  86. }
  87. }
  88.     return 1;
  89. }
  90. if(dialogid == MENUAUTOS+1)
  91. {
  92. if(response == 1)
  93. {
  94. ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
  95. }
  96. if(response)
  97. {
  98. if(listitem == 1)
  99. {
  100. CarSpawner(playerid,445);
  101. }
  102. if(listitem == 1)
  103. {
  104. CarSpawner(playerid,536);
  105. }
  106. if(listitem == 2)
  107. {
  108. CarSpawner(playerid,401);
  109. }
  110. if(listitem == 3)
  111. {
  112. CarSpawner(playerid,496);
  113. }
  114. if(listitem == 4)
  115. {
  116. CarSpawner(playerid,575);
  117. }
  118. if(listitem == 5)
  119. {
  120. CarSpawner(playerid,402);
  121. }
  122. if(listitem == 6)
  123. {
  124. CarSpawner(playerid,527);
  125. }
  126. if(listitem == 7)
  127. {
  128. CarSpawner(playerid,415);
  129. }
  130. if(listitem == 8)
  131. {
  132. CarSpawner(playerid,542);
  133. }
  134. if(listitem == 9)
  135. {
  136. CarSpawner(playerid,480);
  137. }
  138. if(listitem == 10)
  139. {
  140. CarSpawner(playerid,596);
  141. }
  142. if(listitem == 11)
  143. {
  144. CarSpawner(playerid,597);
  145. }
  146. if(listitem == 12)
  147. {
  148. CarSpawner(playerid,507);
  149. }
  150. if(listitem == 13)
  151. {
  152. CarSpawner(playerid,562);
  153. }
  154. if(listitem == 14)
  155. {
  156. CarSpawner(playerid,466);
  157. }
  158. if(listitem == 15)
  159. {
  160. CarSpawner(playerid,410);
  161. }
  162. if(listitem == 16)
  163. {
  164. CarSpawner(playerid,426);
  165. }
  166. if(listitem == 17)
  167. {
  168. CarSpawner(playerid,475);
  169. }
  170. if(listitem == 18)
  171. {
  172. CarSpawner(playerid,467);
  173. }
  174. if(listitem == 19)
  175. {
  176. CarSpawner(playerid,420);
  177. }
  178. if(listitem == 20)
  179. {
  180. CarSpawner(playerid,412);
  181. }
  182. if(listitem == 21)
  183. {
  184. CarSpawner(playerid,477);
  185. }
  186. }
  187. return 1;
  188. }
  189. if(dialogid == MENUAUTOS+2)
  190. {
  191. if(response == 1)
  192. {
  193. ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
  194. }
  195. if(response)
  196. {
  197. if(listitem == 0)
  198. {
  199. CarSpawner(playerid,602);
  200. }
  201. if(listitem == 1)
  202. {
  203. CarSpawner(playerid,429);
  204. }
  205. if(listitem == 2)
  206. {
  207. CarSpawner(playerid,541);
  208. }
  209. if(listitem == 3)
  210. {
  211. CarSpawner(playerid,480);
  212. }
  213. if(listitem == 4)
  214. {
  215. CarSpawner(playerid,587);
  216. }
  217. if(listitem == 5)
  218. {
  219. CarSpawner(playerid,502);
  220. }
  221. if(listitem == 6)
  222. {
  223. CarSpawner(playerid,494);
  224. }
  225. if(listitem == 7)
  226. {
  227. CarSpawner(playerid,411);
  228. }
  229. if(listitem == 8)
  230. {
  231. CarSpawner(playerid,559);
  232. }
  233. if(listitem == 9)
  234. {
  235. CarSpawner(playerid,603);
  236. }
  237. if(listitem == 10)
  238. {
  239. CarSpawner(playerid,560);
  240. }
  241. if(listitem == 11)
  242. {
  243. CarSpawner(playerid,506);
  244. }
  245. if(listitem == 12)
  246. {
  247. CarSpawner(playerid,451);
  248. }
  249. if(listitem == 13)
  250. {
  251. CarSpawner(playerid,558);
  252. }
  253. }
  254. return 1;
  255. }
  256. if(dialogid == MENUAUTOS+4)
  257. {
  258. if(response == 0)
  259. {
  260. ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Perros\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
  261. }
  262. if(response)
  263. {
  264. if(listitem == 0)
  265. {
  266. CarSpawner(playerid,522);
  267. }
  268. if(listitem == 1)
  269. {
  270. CarSpawner(playerid,462);
  271. }
  272. if(listitem == 2)
  273. {
  274. CarSpawner(playerid,521);
  275. }
  276. if(listitem == 3)
  277. {
  278. CarSpawner(playerid,461);
  279. }
  280. if(listitem == 4)
  281. {
  282. CarSpawner(playerid,463);
  283. }
  284. if(listitem == 5)
  285. {
  286. CarSpawner(playerid,581);
  287. }
  288. if(listitem == 6)
  289. {
  290. CarSpawner(playerid,448);
  291. }
  292. if(listitem == 7)
  293. {
  294. CarSpawner(playerid,523);
  295. }
  296. if(listitem == 8)
  297. {
  298. CarSpawner(playerid,468);
  299. }
  300. if(listitem == 9)
  301. {
  302. CarSpawner(playerid,471);
  303. }
  304. if(listitem == 10)
  305. {
  306. CarSpawner(playerid,509);
  307. }
  308. if(listitem == 11)
  309. {
  310. CarSpawner(playerid,481);
  311. }
  312. if(listitem == 12)
  313. {
  314. CarSpawner(playerid,510);
  315. }
  316. }
  317. return 1;
  318. }
  319. if(dialogid == MENUAUTOS+4)
  320. {
  321. if(response == 0)
  322. {
  323. ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
  324. }
  325. if(response)
  326. {
  327. if(listitem == 0)
  328. {
  329. CarSpawner(playerid,416);
  330. }
  331. if(listitem == 1)
  332. {
  333. CarSpawner(playerid,499);
  334. }
  335. if(listitem == 2)
  336. {
  337. CarSpawner(playerid,422);
  338. }
  339. if(listitem == 3)
  340. {
  341. CarSpawner(playerid,482);
  342. }
  343. if(listitem == 4)
  344. {
  345. CarSpawner(playerid,431);
  346. }
  347. if(listitem == 5)
  348. {
  349. CarSpawner(playerid,483);
  350. }
  351. if(listitem == 6)
  352. {
  353. CarSpawner(playerid,437);
  354. }
  355. if(listitem == 7)
  356. {
  357. CarSpawner(playerid,407);
  358. }
  359. if(listitem == 8)
  360. {
  361. CarSpawner(playerid,470);
  362. }
  363. if(listitem == 9)
  364. {
  365. CarSpawner(playerid,489);
  366. }
  367. if(listitem == 10)
  368. {
  369. CarSpawner(playerid,578);
  370. }
  371. if(listitem == 11)
  372. {
  373. CarSpawner(playerid,573);
  374. }
  375. if(listitem == 12)
  376. {
  377. CarSpawner(playerid,444);
  378. }
  379. if(listitem == 13)
  380. {
  381. CarSpawner(playerid,423);
  382. }
  383. }
  384. return 1;
  385. }
  386. if(dialogid == MENUAUTOS+5)
  387. {
  388. if(response == 0)
  389. {
  390. ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
  391. }
  392. if(response)
  393. {
  394. if(listitem == 0)
  395. {
  396. CarSpawner(playerid,476);
  397. }
  398. if(listitem == 1)
  399. {
  400. CarSpawner(playerid,593);
  401. }
  402. if(listitem == 2)
  403. {
  404. CarSpawner(playerid,553);
  405. }
  406. if(listitem == 3)
  407. {
  408. CarSpawner(playerid,513);
  409. }
  410. if(listitem == 4)
  411. {
  412. CarSpawner(playerid,511);
  413. }
  414. if(listitem == 5)
  415. {
  416. CarSpawner(playerid,460);
  417. }
  418. if(listitem == 6)
  419. {
  420. CarSpawner(playerid,519);
  421. }
  422. }
  423. return 1;
  424. }
  425. if(dialogid == MENUAUTOS+6)
  426. {
  427. if(response == 0)
  428. {
  429. ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
  430. }
  431. if(response)
  432. {
  433. if(listitem == 0)
  434. {
  435. CarSpawner(playerid,548);
  436. }
  437. if(listitem == 1)
  438. {
  439. CarSpawner(playerid,417);
  440. }
  441. if(listitem == 2)
  442. {
  443. CarSpawner(playerid,487);
  444. }
  445. if(listitem == 3)
  446. {
  447. CarSpawner(playerid,497);
  448. }
  449. if(listitem == 4)
  450. {
  451. CarSpawner(playerid,563);
  452. }
  453. if(listitem == 5)
  454. {
  455. CarSpawner(playerid,469);
  456. }
  457. if(listitem == 6)
  458. {
  459. CarSpawner(playerid,488);
  460. }
  461. }
  462. return 1;
  463. }
  464. if(dialogid == MENUAUTOS+7)
  465. {
  466. if(response == 0)
  467. {
  468. ShowPlayerDialog(playerid,MENUAUTOS,DIALOG_STYLE_LIST, "MENU DE AUTOS", "Autos\nAutos Rapidos\nMotos y Bicicletas\nCamiones y Camionetas\nAviones\nHelicopteros\nBotes", "Seleccionar","Cancelar");
  469. }
  470. if(response)
  471. {
  472. if(listitem == 0)
  473. {
  474. CarSpawner(playerid,472);
  475. }
  476. if(listitem == 1)
  477. {
  478. CarSpawner(playerid,473);
  479. }
  480. if(listitem == 2)
  481. {
  482. CarSpawner(playerid,493);
  483. }
  484. if(listitem == 3)
  485. {
  486. CarSpawner(playerid,595);
  487. }
  488. if(listitem == 4)
  489. {
  490. CarSpawner(playerid,484);
  491. }
  492. if(listitem == 5)
  493. {
  494. CarSpawner(playerid,430);
  495. }
  496. if(listitem == 6)
  497. {
  498. CarSpawner(playerid,452);
  499. }
  500. if(listitem == 7)
  501. {
  502. CarSpawner(playerid,446);
  503. }
  504. if(listitem == 8)
  505. {
  506. CarSpawner(playerid,539);
  507. }
  508. }
  509. return 1;
  510. }
  511. return 0;
  512. }
  513.  
  514.  
  515.  
  516. //====================================================================================================
  517.  
  518. public OnPlayerConnect(playerid)
  519. {
  520.     AccInfo[playerid][pCar]         = -1;
  521.     return 1;
  522. }
  523.  
  524. public OnPlayerDisconnect(playerid)
  525. {
  526. if(AccInfo[playerid][pCar] != -1) BorrarAuto(AccInfo[playerid][pCar]);
  527. return 1;
  528. }
  529. //=============================================NUEVA FUNCION===============================================
  530. public CarSpawner(playerid,model)
  531. {
  532.     if(IsPlayerInAnyVehicle(playerid))
  533.     SendClientMessage(playerid, rojo, "ERROR: Ya Estas En Un Auto!");
  534.     else
  535.     {
  536.         new Float:x, Float:y, Float:z, Float:angle;
  537.         GetPlayerPos(playerid, x, y, z);
  538.         GetPlayerFacingAngle(playerid, angle);
  539.  
  540.         if(AccInfo[playerid][pCar] != -1)
  541.         BorrarAuto(AccInfo[playerid][pCar]);
  542.         new vehicleid=CreateVehicle(model, x, y, z+2, angle, -1, -1, -1);
  543.         PutPlayerInVehicle(playerid, vehicleid, 0);
  544.         SetVehicleVirtualWorld(vehicleid, GetPlayerVirtualWorld(playerid));
  545.         LinkVehicleToInterior(vehicleid, GetPlayerInterior(playerid));
  546.         AccInfo[playerid][pCar] = vehicleid;
  547.     }
  548.     return 1;
  549. }
  550.  
  551.  
  552. public BorrarAuto(vehicleid)
  553. {
  554.     for(new i=0;i<MAX_PLAYERS;i++)
  555.     {
  556.         new Float:X,Float:Y,Float:Z;
  557.         if(IsPlayerInVehicle(i, vehicleid))
  558.         {
  559.         RemovePlayerFromVehicle(i);
  560.         GetPlayerPos(i,X,Y,Z);
  561.         SetPlayerPos(i,X,Y+3,Z);
  562.         }
  563.         SetVehicleParamsForPlayer(vehicleid,i,0,1);
  564.     }
  565.     SetTimerEx("ResAuto",1500,0,"i",vehicleid);
  566. }
  567. public ResAuto(vehicleid)
  568. {
  569.     DestroyVehicle(vehicleid);
  570. }
  571.  
  572. public OnVehicleSpawn(vehicleid)
  573. {
  574.     for(new i=0;i<MAX_PLAYERS;i++)
  575.     {
  576.         if(vehicleid==AccInfo[i][pCar])
  577.         {
  578.             BorrarAuto(vehicleid);
  579.             AccInfo[i][pCar]=-1;
  580.         }
  581.     }
  582.     return 1;
  583. }
  584.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement