Guest User

Untitled

a guest
May 28th, 2012
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.81 KB | None | 0 0
  1. #define function:%1(%2) forward %1(%2); public %1(%2)
  2. if(!strcmp(cmdtext,"/newcar",true))
  3. {
  4. ShowPlayerDialog(playerid,Dialog_NewCar_VehicleSorts,DIALOG_STYLE_LIST,"{00FF00}Fahrzeug-Sorten - Admincar erstellen",ReturnAllKindsOfVehicles(),"Auswählen","Abbrechen");
  5. return 1;
  6. }
  7. case Dialog_NewCar_VehicleSorts:
  8. {
  9. if(response)
  10. {
  11. switch(listitem)
  12. {
  13. case 0:
  14. {
  15. SetPVarInt(playerid,"NewCar",1);
  16. ShowPlayerDialog(playerid,Dialog_ChooseNewCar,DIALOG_STYLE_LIST,"{00FF00}Flugzeuge/Helis - NewCar Auswahl",ReturnAirVehicles(),"Auswählen","Zurück");
  17. return 1;
  18. }
  19. case 1:
  20. {
  21. SetPVarInt(playerid,"NewCar",2);
  22. ShowPlayerDialog(playerid,Dialog_ChooseNewCar,DIALOG_STYLE_LIST,"{00FF00}Landfahrzeuge - NewCar Auswahl",ReturnLandVehicles(),"Auswählen","Zurück");
  23. return 1;
  24. }
  25. case 2:
  26. {
  27. SetPVarInt(playerid,"NewCar",5);
  28. ShowPlayerDialog(playerid,Dialog_ChooseNewCar,DIALOG_STYLE_LIST,"{00FF00}Landfahrzeuge Teil 2 - NewCar",ReturnLandVehiclesSecond(),"Auswählen","Zurück");
  29. return 1;
  30. }
  31. case 3:
  32. {
  33. SetPVarInt(playerid,"NewCar",6);
  34. ShowPlayerDialog(playerid,Dialog_ChooseNewCar,DIALOG_STYLE_LIST,"{00FF00}Landfahrzeuge Teil 3 - NewCar",ReturnLandVehiclesThird(),"Auswählen","Zurück");
  35. return 1;
  36. }
  37. case 4:
  38. {
  39. SetPVarInt(playerid,"NewCar",3);
  40. ShowPlayerDialog(playerid,Dialog_ChooseNewCar,DIALOG_STYLE_LIST,"{00FF00}Boote - NewCar Auswahl",ReturnSeaVehicles(),"Auswählen","Zurück");
  41. return 1;
  42. }
  43. case 5:
  44. {
  45. SetPVarInt(playerid,"NewCar",4);
  46. ShowPlayerDialog(playerid,Dialog_ChooseNewCar,DIALOG_STYLE_LIST,"{00FF00}Anhänger - NewCar Auswahl",ReturnAllTrailers(),"Auswählen","Zurück");
  47. return 1;
  48. }
  49. }
  50. }
  51. }
  52. case Dialog_ChooseNewCar:
  53. {
  54. if(response)
  55. {
  56. if(GetPVarInt(playerid,"NewCar") == 1) // 1 == Flugzeuge/Helis
  57. {
  58. new j = ReturnAirVehicleNumber();
  59. for(new k = 0; k < j; k++)
  60. {
  61. if(listitem == k)
  62. {
  63. new Float:x,Float:y,Float:z,Float:rotation;
  64. GetPlayerPos(playerid,x,y,z);
  65. GetPlayerFacingAngle(playerid,rotation);
  66. CreateVehicle(GetModelIDOfAirVehicle(k),x+2,y+2,z,rotation,0+random(126),0+random(126),-1);
  67.  
  68. DeletePVar(playerid,"NewCar");
  69. return 1;
  70. }
  71. }
  72. }
  73. else if(GetPVarInt(playerid,"NewCar") == 2) // 2 == Landfahrzeuge
  74. {
  75. new j = ReturnLandVehicleNumber();
  76. for(new k = 0; k < j; k++)
  77. {
  78. if(listitem == k)
  79. {
  80. new Float:x,Float:y,Float:z,Float:rotation;
  81. GetPlayerPos(playerid,x,y,z);
  82. GetPlayerFacingAngle(playerid,rotation);
  83. CreateVehicle(GetModelIDOfLandVehicle(k),x+2,y+2,z,rotation,0+random(126),0+random(126),-1); //
  84.  
  85. DeletePVar(playerid,"NewCar");
  86. return 1;
  87. }
  88. }
  89. }
  90. else if(GetPVarInt(playerid,"NewCar") == 3) // 3 == Boote
  91. {
  92. new j = ReturnBootVehicleNumber();
  93. for(new k = 0; k < j; k++)
  94. {
  95. if(listitem == k)
  96. {
  97. new Float:x,Float:y,Float:z,Float:rotation;
  98. GetPlayerPos(playerid,x,y,z);
  99. GetPlayerFacingAngle(playerid,rotation);
  100. CreateVehicle(GetModelIDOfBootVehicle(k),x+2,y+2,z,rotation,0+random(126),0+random(126),-1); //
  101.  
  102. DeletePVar(playerid,"NewCar");
  103. return 1;
  104. }
  105. }
  106. }
  107. else if(GetPVarInt(playerid,"NewCar") == 4) // 4 == Anhänger
  108. {
  109. new j = ReturnTrailerNumber();
  110. for(new k = 0; k < j; k++)
  111. {
  112. if(listitem == k)
  113. {
  114. new Float:x,Float:y,Float:z,Float:rotation;
  115. GetPlayerPos(playerid,x,y,z);
  116. GetPlayerFacingAngle(playerid,rotation);
  117. AddStaticVehicleEx(GetModelIDOfTrailer(k),x+2,y+2,z,rotation,0+random(126),0+random(126),-1); //
  118.  
  119. DeletePVar(playerid,"NewCar");
  120. return 1;
  121. }
  122. }
  123. }
  124. else if(GetPVarInt(playerid,"NewCar") == 5) // 5 == Landfahrzeuge Teil 2
  125. {
  126. new j = ReturnLandVehicleNumberSecond();
  127. for(new k = 0; k < j; k++)
  128. {
  129. if(listitem == k)
  130. {
  131. new Float:x,Float:y,Float:z,Float:rotation;
  132. GetPlayerPos(playerid,x,y,z);
  133. GetPlayerFacingAngle(playerid,rotation);
  134. CreateVehicle(GetModelIDOfLandVehicleSecond(k),x+2,y+2,z,rotation,0+random(126),0+random(126),-1); //
  135.  
  136. DeletePVar(playerid,"NewCar");
  137. return 1;
  138. }
  139. }
  140. }
  141. else if(GetPVarInt(playerid,"NewCar") == 6) // 6 == Landfahrzeuge Teil 3
  142. {
  143. new j = ReturnLandVehicleNumberThird();
  144. for(new k = 0; k < j; k++)
  145. {
  146. if(listitem == k)
  147. {
  148. new Float:x,Float:y,Float:z,Float:rotation;
  149. GetPlayerPos(playerid,x,y,z);
  150. GetPlayerFacingAngle(playerid,rotation);
  151. CreateVehicle(GetModelIDOfLandVehicleThird(k),x+2,y+2,z,rotation,0+random(126),0+random(126),-1);
  152. DeletePVar(playerid,"NewCar");
  153. return 1;
  154. }
  155. }
  156. }
  157. else return SendClientMessage(playerid,Color_Rot,"Error! Es gab einen Fehler, probier es bitte noch einmal!");
  158. }
  159. else
  160. {
  161. DeletePVar(playerid,"NewCar");
  162. ShowPlayerDialog(playerid,Dialog_NewCar_VehicleSorts,DIALOG_STYLE_LIST,"{00FF00}Fahrzeug-Sorten - Admincar erstellen",ReturnAllKindsOfVehicles(),"Auswählen","Abbrechen");
  163. return 1;
  164. }
  165. }
  166.  
  167. ReturnAllKindsOfVehicles()
  168. {
  169. new string[150];
  170. format(string,sizeof(string),"Flugzeuge/Helis\nLandfahrzeuge(bis ID:502)\nLandfahrzeuge(bis ID:603)\nLandfahrzeuge(Rest)\nBoote\nAnhänger");
  171. return string;
  172. }
  173. ReturnAirVehicles()
  174. {
  175. new string[1024],i = 400;
  176. while(i != 612)
  177. {
  178. if(IstEinHeliOrPlane(i))
  179. {
  180. format(string,sizeof(string),"%s\n%s(%d)",string,Carname[i-400],i);
  181. }
  182. i++;
  183. }
  184. return string;
  185. }
  186.  
  187. ReturnLandVehicles()
  188. {
  189. new string[1024],i = 400;
  190. while(i != 503)
  191. {
  192. if(IstEinAuto(i) || IstEinMotorrad(i) || IstEinLKW(i) || IstEinBus(i) || IstEinFahrrad(i))
  193. {
  194. format(string,sizeof(string),"%s\n%s(%d)",string,Carname[i-400],i);
  195. }
  196. i++;
  197. }
  198. return string;
  199. }
  200. ReturnLandVehiclesSecond()
  201. {
  202. new string[1024],i = 503;
  203. while(i != 604)
  204. {
  205. if(IstEinAuto(i) || IstEinMotorrad(i) || IstEinLKW(i) || IstEinBus(i) || IstEinFahrrad(i))
  206. {
  207. format(string,sizeof(string),"%s\n%s(%d)",string,Carname[i-400],i);
  208. }
  209. i++;
  210. }
  211. return string;
  212. }
  213. ReturnLandVehiclesThird()
  214. {
  215. new string[1024],i = 604;
  216. while(i != 612)
  217. {
  218. if(IstEinAuto(i) || IstEinMotorrad(i) || IstEinLKW(i) || IstEinBus(i) || IstEinFahrrad(i))
  219. {
  220. format(string,sizeof(string),"%s\n%s(%d)",string,Carname[i-400],i);
  221. }
  222. i++;
  223. }
  224. return string;
  225. }
  226.  
  227. ReturnSeaVehicles()
  228. {
  229. new string[1024],i = 400;
  230. while(i != 612)
  231. {
  232. if(IstEinBoot(i))
  233. {
  234. format(string,sizeof(string),"%s\n%s(%d)",string,Carname[i-400],i);
  235. }
  236. i++;
  237. }
  238. return string;
  239. }
  240.  
  241. ReturnAllTrailers()
  242. {
  243. new string[1024],i = 400;
  244. while(i != 612)
  245. {
  246. if(IstEinTrailer(i))
  247. {
  248. format(string,sizeof(string),"%s\n%s(%d)",string,Carname[i-400],i);
  249. }
  250. i++;
  251. }
  252. return string;
  253. }
  254. GetModelIDOfAirVehicle(number)
  255. {
  256. new returnID = 0,i = 400;
  257. while(i != 612)
  258. {
  259. if(IstEinHeliOrPlane(i))
  260. {
  261. if(number == returnID) return i;
  262. returnID++;
  263. }
  264. i++;
  265. }
  266. return 0;
  267. }
  268.  
  269. GetModelIDOfLandVehicle(number)
  270. {
  271. new returnID = 0,i = 400;
  272. while(i != 503)
  273. {
  274. if(IstEinAuto(i) || IstEinMotorrad(i) || IstEinLKW(i) || IstEinBus(i) || IstEinFahrrad(i))
  275. {
  276. if(number == returnID) return i;
  277. returnID++;
  278. }
  279. i++;
  280. }
  281. return 0;
  282. }
  283.  
  284. GetModelIDOfLandVehicleSecond(number)
  285. {
  286. new returnID = 0,i = 503;
  287. while(i != 604)
  288. {
  289. if(IstEinAuto(i) || IstEinMotorrad(i) || IstEinLKW(i) || IstEinBus(i) || IstEinFahrrad(i))
  290. {
  291. if(number == returnID) return i;
  292. returnID++;
  293. }
  294. i++;
  295. }
  296. return 0;
  297. }
  298.  
  299. GetModelIDOfLandVehicleThird(number)
  300. {
  301. new returnID = 0,i = 604;
  302. while(i != 612)
  303. {
  304. if(IstEinAuto(i) || IstEinMotorrad(i) || IstEinLKW(i) || IstEinBus(i) || IstEinFahrrad(i))
  305. {
  306. if(number == returnID) return i;
  307. returnID++;
  308. }
  309. i++;
  310. }
  311. return 0;
  312. }
  313.  
  314. GetModelIDOfBootVehicle(number)
  315. {
  316. new returnID = 0,i = 400;
  317. while(i != 612)
  318. {
  319. if(IstEinBoot(i))
  320. {
  321. if(number == returnID) return i;
  322. returnID++;
  323. }
  324. i++;
  325. }
  326. return 0;
  327. }
  328.  
  329. GetModelIDOfTrailer(number)
  330. {
  331. new returnID = 0,i = 400;
  332. while(i != 612)
  333. {
  334. if(IstEinTrailer(i))
  335. {
  336. if(number == returnID) return i;
  337. returnID++;
  338. }
  339. i++;
  340. }
  341. return 0;
  342. }
  343.  
  344. ReturnAirVehicleNumber()
  345. {
  346. new amount = 0,i = 400;
  347. while(i < 612)
  348. {
  349. if(IstEinHeliOrPlane(i))
  350. { amount++; }
  351. i++;
  352. }
  353. return amount;
  354. }
  355.  
  356. ReturnLandVehicleNumber()
  357. {
  358. new amount = 0,i = 400;
  359. while(i != 503)
  360. {
  361. if(IstEinAuto(i) || IstEinMotorrad(i) || IstEinLKW(i) || IstEinBus(i) || IstEinFahrrad(i))
  362. {
  363. amount++;
  364. }
  365. i++;
  366. }
  367. return amount;
  368. }
  369.  
  370. ReturnLandVehicleNumberSecond()
  371. {
  372. new amount = 0,i = 503;
  373. while(i != 604)
  374. {
  375. if(IstEinAuto(i) || IstEinMotorrad(i) || IstEinLKW(i) || IstEinBus(i) || IstEinFahrrad(i))
  376. {
  377. amount++;
  378. }
  379. i++;
  380. }
  381. return amount;
  382. }
  383.  
  384. ReturnLandVehicleNumberThird()
  385. {
  386. new amount = 0,i = 604;
  387. while(i != 612)
  388. {
  389. if(IstEinAuto(i) || IstEinMotorrad(i) || IstEinLKW(i) || IstEinBus(i) || IstEinFahrrad(i))
  390. {
  391. amount++;
  392. }
  393. i++;
  394. }
  395. return amount;
  396. }
  397.  
  398. ReturnBootVehicleNumber()
  399. {
  400. new amount = 0,i = 400;
  401. while(i != 612)
  402. {
  403. if(IstEinBoot(i))
  404. {
  405. amount++;
  406. }
  407. i++;
  408. }
  409. return amount;
  410. }
  411.  
  412. ReturnTrailerNumber()
  413. {
  414. new amount = 0,i = 400;
  415. while(i < 612)
  416. {
  417. if(IstEinTrailer(i))
  418. {
  419. amount++;
  420. }
  421. i++;
  422. }
  423. return amount;
  424. }
  425. function:IstEinAuto(a)
  426. {
  427. if(a == 400 || a == 401 || a == 402 || a == 404 || a == 405 || a == 406 || a == 407 || a == 408 || a == 409 || a == 410 || a == 411 || a == 412 || a == 413 || a == 414 || a == 415 || a == 416
  428. || a == 418 || a == 419 || a == 420 || a == 421 || a == 422 || a == 423 || a == 426 || a == 427 || a == 428 || a == 429 || a == 432 || a == 433 || a == 434 || a == 436
  429. || a == 438 || a == 439 || a == 440 || a == 442 || a == 444 || a == 445 || a == 451 || a == 458 || a == 459 || a == 466 || a == 467 || a == 470 || a == 475 || a == 477 || a == 478 || a == 479
  430. || a == 480 || a == 482 || a == 483 || a == 486 || a == 489 || a == 490 || a == 491 || a == 492 || a == 494 || a == 495 || a == 496 || a == 498 || a == 499 || a == 500 || a == 502 || a == 503
  431. || a == 504 || a == 505 || a == 506 || a == 507 || a == 508 || a == 516 || a == 517 || a == 518 || a == 525 || a == 526 || a == 527 || a == 528 || a == 529 || a == 532 || a == 533 || a == 534
  432. || a == 535 || a == 536 || a == 540 || a == 541 || a == 542 || a == 543 || a == 544 || a == 545 || a == 546 || a == 547 || a == 549 || a == 550 || a == 551 || a == 552 || a == 554 || a == 555
  433. || a == 556 || a == 557 || a == 558 || a == 559 || a == 560 || a == 561 || a == 562 || a == 565 || a == 566 || a == 567 || a == 568 || a == 575 || a == 576 || a == 579 || a == 580 || a == 582
  434. || a == 585 || a == 587 || a == 588 || a == 589 || a == 596 || a == 597 || a == 598 || a == 599 || a == 600 || a == 601 || a == 602 || a == 603 || a == 609 /*Kart etc*/ || a == 571 || a == 572 || a == 574 || a == 583) { return 1; }
  435. return 0;
  436. }
  437. function:IstEinFahrrad(a)
  438. {
  439. if(a == 481 || a == 509 || a == 510) { return 1; }
  440. return 0;
  441. }
  442. function:IstEinMotorrad(a)
  443. {
  444. if(a == 448 || a == 461 || a == 462 || a == 463 || a == 468 || a == 521 || a == 522 || a == 523 || a == 581 || a == 586) { return 1; }
  445. return 0;
  446. }
  447. function:IstEinBoot(a)
  448. {
  449. if(a == 430 || a == 446 || a == 452 || a == 453 || a == 454 || a == 472 || a == 473 || a == 484 || a == 493 || a == 595) { return 1; }
  450. return 0;
  451. }
  452. function:IstEinHeliOrPlane(a)
  453. {
  454. if(a == 417 || a == 425 || a == 447 || a == 460 || a == 469 || a == 476 || a == 487 || a == 488 || a == 497 || a == 511 || a == 512 || a == 513 || a == 519 || a == 520 || a == 548 || a == 553 || a == 563 || a == 577 || a == 592 || a == 593) { return 1; }
  455. return 0;
  456. }
  457. function:IstEinLKW(a)
  458. {
  459. if(a == 403 || a == 408 || a == 443 || a == 455 || a == 456 || a == 514 || a == 515) { return 1; }
  460. return 0;
  461. }
  462. function:IstEinZug(a)
  463. {
  464. if(a == 449 || a == 537 || a == 538) return 1;
  465. return 0;
  466. }
  467. function:IstEinBus(a)
  468. {
  469. if(a == 431 || a == 437) return 1;
  470. return 0;
  471. }
  472. function:IstEinTrailer(a)
  473. {
  474. if(a == 435 || a == 450 || a == 569 || a == 570 || a == 584 || a == 590 || a == 591 || a == 606 || a == 607 || a == 608 || a == 610 || a == 611) return 1;
  475. return 0;
  476. }
  477. function:IstEinMotorFahrzeug(i)
  478. {
  479. if(IstEinAuto(i) || IstEinMotorrad(i) || IstEinLKW(i) || IstEinBoot(i) || IstEinHeliOrPlane(i) || IstEinZug(i) || IstEinBus(i)) return 1;
  480. return 0;
  481. }
Advertisement
Add Comment
Please, Sign In to add comment