Guest User

Ciber007

a guest
Dec 18th, 2008
187
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.75 KB | None | 0 0
  1. /*-----------------------------------------------------------
  2. ------------------------------ BSN Park ---------------------
  3. --------------------------- von Ciber007 --------------------
  4. -------------------------------------------------------------*/
  5. /* Neues in Version 2.0 :
  6. - Aufzug nun mit Men�.
  7. - Pickups an den entsprechenden Men�stellen.
  8. Negatives:
  9. - Men� sieht man nur wenn man l�uft.
  10. - Men� wird einmal unten und Oben angezeigt aber man kann einfach weiterfahren.
  11. Verbesserungsvorschlag:
  12. - Wer will kann die Befehle von Version 1.0 einbauen sodass man im Auto nur /hoch eingeben muss.
  13. */
  14.  
  15. //------------------------------- Includes -------------------------------
  16. #include <a_samp>
  17. //------------------------------- Filterscript definieren ----------------
  18. #define FILTERSCRIPT
  19. #if defined FILTERSCRIPT
  20. //------------------------------- Farben definieren ----------------------
  21. #define COLOR_LIGHTBLUE 0x33CCFFAA
  22. #define COLOR_RED 0xAA3333AA
  23. //------------------------------- Pickups,Men�s,Objecte ------------------
  24. new Park;
  25. new Unten;
  26. new Oben;
  27. new Menu:BSN;
  28.  
  29. #pragma tabsize 0
  30. //------------------------------- PlayerToPoint ---------------------------
  31. forward PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z);
  32. public PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  33. {
  34. if(IsPlayerConnected(playerid))
  35. {
  36. new Float:oldposx, Float:oldposy, Float:oldposz;
  37. new Float:tempposx, Float:tempposy, Float:tempposz;
  38. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  39. tempposx = (oldposx -x);
  40. tempposy = (oldposy -y);
  41. tempposz = (oldposz -z);
  42. //printf("DEBUG: X:%f Y:%f Z:%f",posx,posy,posz);
  43. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  44. {
  45. return 1;
  46. }
  47. }
  48. return 0;
  49. }
  50.  
  51. public OnFilterScriptInit()
  52. {
  53. CreateObject(971, 1181.533569, -897.506592, 47.013580, 90.2409, 4.2972, 3.4377);// BSN Park
  54. CreateObject(971, 1183.869263, -911.674988, 46.826981, 90.2409, 4.2972, 4.2972);//BSN Park
  55. CreateObject(4639, 1183.000854, -910.254700, 43.990814, 0.0000, 0.0000, 186.0934);// BSN Park
  56. Park = CreateObject(971, 1182.252441, -904.438293, 42.308212, 90.2409, 4.2972, 3.4377);// Aufzug
  57. Oben = CreatePickup(1239,1,1181.9728,-904.4827,48.1644);//Men� Pickup Oben
  58. Unten = CreatePickup(1239,1,1181.9728,-904.4827,43.4915);//Men� Pickup Unten
  59. BSN = CreateMenu("BSN", 2, 200.0, 100.0, 150.0, 150.0);//Men�
  60. AddMenuItem(BSN, 0 ,"Hoch fahren (100$)");//Men� Auswahl 1
  61. AddMenuItem(BSN, 0 ,"Runter fahren");//Men� Auswahl 2
  62. AddMenuItem(BSN, 0 ,"Exit");//Men� Auswahl 3
  63. print("\n--------------------------------------");
  64. print(" BSN Park v.2.0 Script von Ciber007");
  65. print("--------------------------------------\n");
  66. return 1;
  67. }
  68.  
  69. public OnFilterScriptExit()
  70. {
  71. DestroyMenu(BSN);
  72. return 1;
  73. }
  74.  
  75. #else
  76.  
  77. main()
  78.  
  79.  
  80. #endif
  81.  
  82.  
  83.  
  84. public OnPlayerPickUpPickup(playerid, pickupid)
  85. {
  86. if(pickupid == Oben)
  87. {
  88. ShowMenuForPlayer(BSN,playerid);
  89. }
  90. if(pickupid == Unten)
  91. {
  92. ShowMenuForPlayer(BSN,playerid);
  93. }
  94. return 1;
  95. }
  96.  
  97. public OnPlayerSelectedMenuRow(playerid, row)
  98. {
  99. new Menu:CurrentMenu = GetPlayerMenu(playerid);
  100. if(CurrentMenu == BSN)
  101. {
  102. switch(row)
  103. {
  104. case 0: //Hoch
  105. {
  106. SendClientMessage(playerid, COLOR_RED, "Der Aufzug f�hrt Hoch!");
  107. GivePlayerMoney(playerid,-100);
  108. MoveObject(Park,1182.568237, -904.536377, 46.980690, 3.5);
  109. }
  110. case 1: //Runter
  111. {
  112. SendClientMessage(playerid, COLOR_RED, "Der Aufzug f�hrt runter!");
  113. MoveObject(Park,1182.252441, -904.438293, 42.308212, 3.5);
  114. }
  115. case 2: //Exit
  116. {
  117. HideMenuForPlayer(BSN,playerid);
  118. }
  119. }
  120. }
  121. return 1;
  122. }
  123.  
  124.  
  125.  
  126.  
Advertisement
Add Comment
Please, Sign In to add comment