Guest User

Untitled

a guest
Feb 26th, 2010
443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.13 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. #pragma tabsize 0
  4.  
  5. // Based on Avenger678's Private Parking. Map and scripts by Charlie.
  6.  
  7. new Parkin;
  8. new Parkout;
  9. new infopickup;
  10.  
  11. forward GateClose();
  12. forward OnPlayerPickUpPickup(playerid, pickupid);
  13.  
  14. #define COLOR_YELLOW 0xFFCC33FF
  15.  
  16. #define Filterscript
  17. #if defined FILTERSCRIPT
  18.  
  19. public OnFilterScriptInit()
  20. {
  21. print("\n--------------------------------------");
  22. print(" Parking lot by Charlie ~ Loaded");
  23. print("--------------------------------------\n");
  24. return 1;
  25. }
  26.  
  27. public OnFilterScriptExit()
  28. {
  29. return 1;
  30. }
  31.  
  32. #else
  33.  
  34. main()
  35. {
  36. print("\n----------------------------------");
  37. print(" Parking lot by Charlie ~ Unloaded");
  38. print("----------------------------------\n");
  39. }
  40.  
  41. #endif
  42.  
  43. public OnGameModeInit()
  44. {
  45.  
  46. Parkin = CreateObject(986, 1101.5893554688, -1739.1286621094, 9.3185873031616, 0, 0, 270.67565917969);
  47. Parkout = CreateObject(986, 1101.5650634766, -1744.4025878906, 9.3185873031616, 0, 0, 270.67565917969);
  48.  
  49.  
  50.  
  51. AddStaticVehicle(430,5284.4639,-2040.4980,-0.2431,324.8803,2,2); //
  52. AddStaticVehicle(430,5267.8457,-2041.3950,0.3464,325.3297,2,2); //
  53. AddStaticVehicle(430,5260.8735,-2025.8702,0.4445,322.3928,2,2); //
  54. AddStaticVehicle(454,5401.6606,-2034.3774,-0.1165,348.6204,0,1); //
  55. AddStaticVehicle(453,5415.3672,-2038.8029,-0.8996,350.0270,1,0); //
  56. AddStaticVehicle(484,5389.6475,-2030.0148,0.7670,347.1714,1,0); //
  57. AddStaticVehicle(454,5378.5278,-2030.2928,0.7680,348.9799,1,0); //
  58. CreateObject(984, 1101.4180908203, -1752.7836914063, 12.980166435242, 0, 0, 0);
  59. CreateObject(984, 1101.3834228516, -1765.4821777344, 12.980166435242, 0, 0, 0);
  60. CreateObject(983, 1101.1169433594, -1774.4772949219, 13.02885055542, 0, 0, 354.04504394531);
  61. CreateObject(984, 1059.2642822266, -1742.458984375, 13.259499549866, 0, 0, 0);
  62. CreateObject(984, 1059.4967041016, -1755.2888183594, 13.073745727539, 0, 0, 0);
  63. CreateObject(984, 1059.515625, -1768.1898193359, 13.016991615295, 0, 0, 0);
  64. CreateObject(983, 1059.4903564453, -1773.6623535156, 13.039874076843, 0, 0, 0);
  65. CreateObject(984, 1065.8560791016, -1777.0593261719, 13.151827812195, 0, 0, 270.67565917969);
  66. CreateObject(984, 1078.548828125, -1777.0032958984, 12.978029251099, 0, 0, 270.67565917969);
  67. CreateObject(984, 1091.3845214844, -1776.888671875, 12.976320266724, 0, 0, 270.40515136719);
  68. CreateObject(984, 1094.5240478516, -1776.8763427734, 12.976341247559, 0, 0, 270.67565917969);
  69. CreateObject(984, 1065.6726074219, -1736.0697021484, 13.116521835327, 0, 0, 270.67565917969);
  70. CreateObject(984, 1078.4537353516, -1735.8502197266, 13.089923858643, 0, 0, 270.67565917969);
  71. CreateObject(984, 1091.3116455078, -1735.7734375, 13.126383781433, 0, 0, 270.67565917969);
  72. CreateObject(983, 1099.1799316406, -1735.71875, 13.256020545959, 0, 0, 270.67565917969);
  73. CreateObject(3660, 1111.7370605469, -1740.5815429688, 15.065198898315, 0, 0, 0);
  74. CreateObject(8406, 1122.6119384766, -1742.8967285156, 17.965801239014, 0, 0, 89.730285644531);
  75. CreateObject(3881, 1106.8354492188, -1733.1091308594, 14.625, 0, 0, 89.324493408203);
  76. CreateObject(8843, 1092.6254882813, -1738.3706054688, 12.761115074158, 0, 0, 91.309509277344);
  77. CreateObject(8843, 1074.7938232422, -1744.7119140625, 12.691846847534, 0, 0, 132.99450683594);
  78. CreateObject(8843, 1070.1348876953, -1763.0447998047, 12.691846847534, 0, 0, 192.53930664063);
  79. CreateObject(8843, 1079.8914794922, -1775.7092285156, 12.691846847534, 0, 0, 269.94995117188);
  80. CreateObject(8843, 1089.0885009766, -1767.4569091797, 12.691846847534, 0, 0, 359.26940917969);
  81. CreateObject(8843, 1095.2307128906, -1751.5197753906, 12.691846847534, 0, 0, 323.5341796875);
  82. CreateObject(2773, 1075.4031982422, -1772.59, 12.866847038269, 0, 0, 258.76574707031);
  83. CreateObject(2773, 1078.3104248047, -1772.59, 12.866847038269, 0, 0, 270.67565917969);
  84. CreateObject(2773, 1080.966796875, -1772.59, 12.866847038269, 0, 0, 270.67565917969);
  85. CreateObject(2773, 1083.4792480469, -1772.59, 12.866847038269, 0, 0, 270.67565917969);
  86. CreateObject(2773, 1085.9772949219, -1772.59, 12.866847038269, 0, 0, 270.67565917969);
  87.  
  88.  
  89.  
  90.  
  91.  
  92. AddStaticPickup(1318,1,1098.82, -1743.93, 13.44); //exit
  93.  
  94. infopickup = CreatePickup(1239,1,1107.41, -1738.94, 13.48); //entrance + ,,i" pickup
  95.  
  96. return 1;
  97. }
  98.  
  99. public OnGameModeExit()
  100. {
  101. return 1;
  102. }
  103.  
  104. public OnPlayerCommandText(playerid, cmdtext[])
  105. {
  106. if (strcmp(cmdtext, "/parkin", true)==0)
  107. {
  108. if(PlayerToPoint(5, playerid, 1107.41, -1738.94, 13.48)) // ,,i" pickup
  109. {
  110. GivePlayerMoney(playerid,-3000);
  111. MoveObject(Parkin, 1101.5893554688, -1739.1286621094, 0.3185873031616,100.5); // opens both gates
  112. MoveObject(Parkout, 1101.5650634766, -1744.4025878906, 0.3185873031616,100.5); // opens both gates
  113. SetTimer("GateClose", 5000, 0);
  114. SendClientMessage(playerid, COLOR_YELLOW,"Hello there! Alright, come in(-$3,000).");
  115. }
  116. return 1;
  117. }
  118.  
  119. if (strcmp(cmdtext, "/parkout", true)==0)
  120. {
  121. if(PlayerToPoint(5, playerid, 1098.82, -1743.93, 13.44)) // arrow pickup
  122. {
  123. MoveObject(Parkin,1101.5893554688, -1739.1286621094, 0.3185873031616,3.5); // opens both gates
  124. MoveObject(Parkout,1101.5893554688, -1739.1286621094, 0.3185873031616,3.5); // opens both gates
  125. SetTimer("GateClose", 5000, 0);
  126. SendClientMessage(playerid, COLOR_YELLOW,"Goodbye, come back later!");
  127. }
  128. return 1;
  129. }
  130. if(strcmp(cmdtext, "/parkinghelp", true) ==0)
  131. {
  132. if(IsPlayerConnected(playerid))
  133. {
  134. {
  135. SendClientMessage(playerid,COLOR_YELLOW,"*** Location *** It's located near Verona Beach at a place called Conference Center.");
  136. SendClientMessage(playerid,COLOR_YELLOW,"*** Parking - Commands *** /parkin | /parkout");
  137. SendClientMessage(playerid,COLOR_YELLOW,"*** Parking - $$ *** It only costs $3,000 to enter.");
  138. SendClientMessage(playerid,COLOR_YELLOW,"*** Parking - Arrows *** Follow the arrows, it shows where to drive, so people won't cause accidents.");
  139. SendClientMessage(playerid,COLOR_YELLOW,"*** Information *** Map and Script by Charlie (( SA-MP forum name: DRCharlie )). ");
  140. }
  141. }
  142. return 1;
  143. }
  144. return 0;
  145. }
  146.  
  147.  
  148. public GateClose()
  149. {
  150. MoveObject(Parkin,1101.5893554688, -1739.1286621094, 9.3185873031616,5.5);//opens both gates
  151. MoveObject(Parkout,1101.5650634766, -1744.4025878906, 9.3185873031616,5.5);//opens both gates
  152. return 1;
  153. }
  154.  
  155. public OnPlayerPickUpPickup(playerid, pickupid)
  156. {
  157. if (pickupid == infopickup)
  158. {
  159. GameTextForPlayer(playerid," ~r~ /parkinghelp ~b~/parkin ~y~/parkout",5000,5);
  160.  
  161. }
  162.  
  163. return 1;
  164. }
  165.  
  166.  
  167. public OnPlayerConnect(playerid)
  168. {
  169. SendClientMessage(playerid, COLOR_YELLOW,"This sever uses (DR)Charlie's parking lot(/parkinghelp).");
  170. }
  171.  
  172. PlayerToPoint(Float:radi, playerid, Float:x, Float:y, Float:z)
  173. {
  174. new Float:oldposx, Float:oldposy, Float:oldposz;
  175. new Float:tempposx, Float:tempposy, Float:tempposz;
  176. GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  177. tempposx = (oldposx -x);
  178. tempposy = (oldposy -y);
  179. tempposz = (oldposz -z);
  180. if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  181. {
  182. return 1;
  183. }
  184. return 0;
  185. }
Advertisement
Add Comment
Please, Sign In to add comment