Advertisement
Guest User

Delux CarWash system by niels44 aka [drifters]niels

a guest
Feb 25th, 2012
624
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.82 KB | None | 0 0
  1. // This is a comment
  2. // uncomment the line below if you want to write a filterscript
  3. //#define FILTERSCRIPT
  4.  
  5. #include <a_samp>
  6. #define COLOR_RED 0xFF0000FF
  7. new entrance;
  8. new ext;
  9. new water1;
  10. new water2;
  11. new water3;
  12. new water4;
  13. new gate1;
  14. new gate2;
  15. new gate3;
  16. new IsInWash[ MAX_PLAYERS ];
  17.  
  18. public OnFilterScriptInit()
  19. {
  20. // gates
  21. ext = CreateObject(2885,2446.50000000,-1460.59997559,29.70000076,0.00000000,0.00000000,270.00000000); //gatelaatste
  22. entrance = CreateObject(2885,2499.50000000,-1460.00000000,29.70000076,0.00000000,0.00000000,89.99450684); //gateeerste
  23. gate3 = CreateObject(968,2539.89990234,-1475.59997559,24.39999962,0.00000000,270.00000000,269.99975586); //oranje3open
  24. gate2 = CreateObject(968,2540.10009766,-1459.30004883,24.39999962,0.00000000,90.00000000,269.99636841); //oranje2open
  25. gate1 = CreateObject(968,2523.39990234,-1493.50000000,23.89999962,0.00000000,270.00000000,0.00000000); //oranje1open
  26. // objects
  27. CreateObject(16003,2502.39990234,-1465.59997559,23.89999962,0.00000000,0.00000000,0.00000000); //object(drvin_ticket) (1)
  28. CreateObject(8843,2483.10009766,-1460.90002441,23.10000038,0.00000000,0.00000000,88.00000000); //object(arrows01_lvs) (1)
  29. CreateObject(8041,2540.39990234,-1467.50000000,28.79999924,0.00000000,0.00000000,0.00000000); //object(apbarriergate06_lvs) (1)
  30. CreateObject(7073,2516.50000000,-1474.00000000,41.29999924,0.00000000,0.00000000,0.00000000); //object(vegascowboy1) (1)
  31. CreateObject(18285,2517.80004883,-1461.69995117,23.10000038,0.00000000,0.00000000,10.00000000); //object(cw_trucklines) (1)
  32. CreateObject(966,2523.50000000,-1493.50000000,23.00000000,0.00000000,0.00000000,0.00000000); //object(bar_gatebar01) (1)
  33. CreateObject(8843,2520.10009766,-1484.50000000,23.00000000,0.00000000,0.00000000,0.00000000); //object(arrows01_lvs) (2)
  34. CreateObject(4100,2472.60009766,-1465.19995117,29.29999924,0.00000000,0.00000000,320.00000000); //object(meshfence1_lan) (1)
  35. CreateObject(4100,2474.39990234,-1454.59997559,29.29999924,0.00000000,0.00000000,319.99877930); //object(meshfence1_lan) (2)
  36. CreateObject(7311,2461.50000000,-1460.90002441,25.20000076,0.00000000,0.00000000,0.00000000); //object(vgsn_carwash) (1)
  37. CreateObject(972,2473.60009766,-1465.59997559,26.29999924,4.99996948,270.00000000,272.00000000); //object(tunnelentrance) (1)
  38. CreateObject(972,2473.10009766,-1461.69995117,26.29999924,4.99877930,270.00000000,271.99951172); //object(tunnelentrance) (2)
  39. CreateObject(1337,2504.89990234,-1464.59997559,23.70000076,0.00000000,0.00000000,182.00000000); //object(binnt07_la) (1)
  40. CreateObject(1337,2542.39990234,-1467.80004883,23.70000076,0.00000000,0.00000000,85.99951172); //object(binnt07_la) (2)
  41. CreateObject(1337,2542.39990234,-1467.00000000,23.70000076,0.00000000,0.00000000,85.99548340); //object(binnt07_la) (3)
  42. CreateObject(1676,2525.39990234,-1459.19995117,24.50000000,0.00000000,0.00000000,270.00000000); //object(washgaspump) (1)
  43. CreateObject(1676,2520.19995117,-1459.40002441,24.50000000,0.00000000,0.00000000,269.99951172); //object(washgaspump) (2)
  44. CreateObject(1676,2530.19995117,-1459.40002441,24.50000000,0.00000000,0.00000000,269.99951172); //object(washgaspump) (3)
  45. CreateObject(970,2537.19995117,-1467.40002441,23.60000038,0.00000000,0.00000000,0.00000000); //object(fencesmallb) (1)
  46. CreateObject(970,2526.89990234,-1467.40002441,23.50000000,0.00000000,0.00000000,0.00000000); //object(fencesmallb) (2)
  47. CreateObject(970,2533.09960938,-1467.39941406,23.50000000,0.00000000,0.00000000,0.00000000); //object(fencesmallb) (3)
  48. CreateObject(970,2529.50000000,-1467.39941406,23.50000000,0.00000000,0.00000000,0.00000000); //object(fencesmallb) (4)
  49. CreateObject(970,2518.19995117,-1465.80004883,23.50000000,0.00000000,0.00000000,308.00000000); //object(fencesmallb) (5)
  50. CreateObject(970,2521.50000000,-1467.39941406,23.50000000,0.00000000,0.00000000,0.00000000); //object(fencesmallb) (6)
  51. CreateObject(970,2516.69995117,-1463.90002441,23.50000000,0.00000000,0.00000000,307.99621582); //object(fencesmallb) (7)
  52. CreateObject(970,2515.30004883,-1460.19995117,23.50000000,0.00000000,0.00000000,271.99621582); //object(fencesmallb) (8)
  53. CreateObject(970,2515.19995117,-1456.50000000,23.50000000,0.00000000,0.00000000,271.99401855); //object(fencesmallb) (9)
  54. CreateObject(970,2525.00000000,-1459.30004883,23.50000000,0.00000000,0.00000000,270.00000000); //object(fencesmallb) (10)
  55. CreateObject(970,2519.69995117,-1459.50000000,23.50000000,0.00000000,0.00000000,269.99450684); //object(fencesmallb) (11)
  56. CreateObject(970,2520.79980469,-1459.50000000,23.50000000,0.00000000,0.00000000,269.99450684); //object(fencesmallb) (12)
  57. CreateObject(970,2529.80004883,-1459.19995117,23.50000000,0.00000000,0.00000000,269.99450684); //object(fencesmallb) (13)
  58. CreateObject(970,2525.89941406,-1459.39941406,23.50000000,0.00000000,0.00000000,269.99450684); //object(fencesmallb) (14)
  59. CreateObject(970,2530.80004883,-1459.19995117,23.50000000,0.00000000,0.00000000,269.99450684); //object(fencesmallb) (15)
  60. CreateObject(970,2538.39990234,-1475.50000000,23.60000038,0.00000000,0.00000000,338.00000000); //object(fencesmallb) (16)
  61. CreateObject(970,2530.80004883,-1472.90002441,23.50000000,0.00000000,0.00000000,349.99987793); //object(fencesmallb) (17)
  62. CreateObject(970,2534.69921875,-1474.00000000,23.60000038,0.00000000,0.00000000,337.99987793); //object(fencesmallb) (18)
  63. CreateObject(970,2526.80004883,-1472.50000000,23.50000000,0.00000000,0.00000000,359.99694824); //object(fencesmallb) (19)
  64. CreateObject(970,2524.69995117,-1472.50000000,23.50000000,0.00000000,0.00000000,359.99450684); //object(fencesmallb) (20)
  65. CreateObject(970,2522.60009766,-1474.50000000,23.50000000,0.00000000,0.00000000,89.99450684); //object(fencesmallb) (21)
  66. CreateObject(970,2517.30004883,-1474.19995117,23.60000038,0.00000000,0.00000000,89.99450684); //object(fencesmallb) (22)
  67. CreateObject(970,2515.69995117,-1470.90002441,23.60000038,0.00000000,0.00000000,141.99450684); //object(fencesmallb) (23)
  68. CreateObject(970,2512.80004883,-1468.59997559,23.60000038,0.00000000,0.00000000,141.99276733); //object(fencesmallb) (24)
  69. CreateObject(970,2509.30004883,-1466.50000000,23.60000038,0.00000000,0.00000000,155.99279785); //object(fencesmallb) (25)
  70. CreateObject(970,2505.30004883,-1465.69995117,23.60000038,0.00000000,0.00000000,181.98937988); //object(fencesmallb) (26)
  71. Create3DTextLabel("Type /washcar to wash your car!", 0x008080FF,2502.39990234,-1465.59997559,23.89999962,40.0,0);
  72. return true;
  73. }
  74. public OnFilterScriptExit()
  75. {
  76. return 1;
  77. }
  78.  
  79. public OnPlayerConnect(playerid)
  80. {
  81. SendClientMessage(playerid, COLOR_RED, "This server uses the Lux CarWash system by [drifters]niels aka niels44");
  82. SetPlayerMapIcon(playerid, 18,2455.2258,-1461.0040,24.0000, 55, 0, MAPICON_LOCAL);
  83. return 1;
  84. }
  85. public OnPlayerCommandText(playerid, cmdtext[])
  86. {
  87. if( !strcmp( "/washcar", cmdtext, true, 8 ) )
  88. {
  89. if( !IsPlayerInAnyVehicle( playerid ) )
  90. return SendClientMessage( playerid, COLOR_RED, "ERROR: you are not in a Vehicle!" );
  91. if(IsPlayerInRangeOfPoint(playerid, 10.0, 2499.50000000,-1460.00000000,29.70000076))
  92. {
  93. GivePlayerMoney( playerid, -40 );
  94.  
  95. SendClientMessage( playerid, COLOR_RED, "you have paid $40 to wash your car" );
  96. SendClientMessage( playerid, COLOR_RED, "now drive in the red marker to wash your car" );
  97. MoveObject( entrance, 2496.30004883,-1460.40002441,29.70000076, 1.0, 291.99462891,0.00000000,89.99450684 );
  98. SetTimer( "CloseEntrance", 5000, 0 );
  99. SetPlayerCheckpoint( playerid, 2455.2258, -1461.0040, 24.0000, 3.0 );
  100. return 1;
  101. }
  102. else if(!IsPlayerInRangeOfPoint(playerid, 10.0, 2499.50000000,-1460.00000000,29.70000076)) return SendClientMessage(playerid, COLOR_RED, "ERROR: you are not at a CarWash!");
  103. }
  104. return 0;
  105. }
  106. forward CloseEntrance();
  107. public CloseEntrance()
  108. {
  109. MoveObject( entrance, 2499.50000000, -1460.00000000, 29.70000076, 1.0, 0.00000000, 0.00000000, 89.99450684 );
  110.  
  111. return 1;
  112. }
  113. public OnPlayerEnterCheckpoint(playerid)
  114. {
  115. water1 = CreateObject(2780,2459.69995117,-1457.30004883,23.10000038,0.00000000,0.00000000,0.00000000); //watersmoke
  116. water2 = CreateObject(2780,2461.00000000,-1464.80004883,23.00000000,0.00000000,0.00000000,186.00000000); //watersmoke
  117. water3 = CreateObject(2780,2452.50000000,-1464.00000000,23.00000000,0.00000000,0.00000000,185.99853516); //watersmoke
  118. water4 = CreateObject(2780,2454.10009766,-1458.30004883,23.00000000,0.00000000,0.00000000,185.99853516); //watersmoke
  119. SendClientMessage(playerid, COLOR_RED, "Please Wait while we wash your car...");
  120. TogglePlayerControllable(playerid, 0);
  121. SetPlayerCameraLookAt(playerid, 2445.7043,-1460.9468,24.0000);
  122. SetPlayerCameraPos(playerid, 2471.6687,-1460.2609,24.0000);
  123. IsInWash[ playerid ] = 1;
  124. SetTimer("OpenExt", 7000, 0);
  125. return 1;
  126. }
  127.  
  128. forward OpenExt(playerid);
  129. public OpenExt(playerid)
  130. {
  131. if(IsInWash[ playerid ] == 1)
  132. {
  133. MoveObject(ext, 2451.00000000,-1460.59997559,29.70000076, 1.0, 280.00000000,0.00000000,270.00000000);
  134. SetTimer("CloseExt", 13000, 0);
  135. SetPlayerPos(playerid, 2439.4900,-1460.9352,24.0000);
  136. SetPlayerFacingAngle(playerid, 267.6727);
  137. TogglePlayerControllable(playerid, 1);
  138. DisablePlayerCheckpoint(playerid);
  139. SetCameraBehindPlayer(playerid);
  140. DestroyObject(water1);
  141. DestroyObject(water2);
  142. DestroyObject(water3);
  143. DestroyObject(water4);
  144. IsInWash[ playerid ] = 0;
  145. new VehicleID = GetPlayerVehicleID(playerid);
  146. RepairVehicle(VehicleID);
  147. return 1;
  148. }
  149. return 1;
  150. }
  151. forward CloseExt(playerid);
  152. public CloseExt(playerid)
  153. {
  154. MoveObject(ext, 2446.50000000,-1460.59997559,29.70000076, 1.0, 0.00000000,0.00000000,270.00000000);
  155. return 1;
  156. }
  157.  
  158.  
  159. public OnPlayerUpdate(playerid)
  160. {
  161. if(IsPlayerInRangeOfPoint(playerid, 10.0, 2523.39990234,-1493.50000000,23.89999962))
  162. {
  163. MoveObject(gate1, 2523.60009766,-1493.50000000,23.89999962, 1.0, 0.00000000,348.00000000,0.00000000);
  164. SetTimer("CloseGate1", 5000, 1);
  165. return 1;
  166. }
  167. if(IsPlayerInRangeOfPoint(playerid, 10.0, 2540.10009766,-1459.30004883,24.39999962))
  168. {
  169. MoveObject(gate2, 2540.10009766,-1459.09997559,24.39999962, 1.0, 0.00000000,8.00000000,269.99645996);
  170. SetTimer("CloseGate2", 5000, 1);
  171. return 1;
  172. }
  173. if(IsPlayerInRangeOfPoint(playerid, 10.0, 2539.89990234,-1475.59997559,24.39999962))
  174. {
  175. MoveObject(gate3, 2539.89990234,-1475.80004883,24.39999962, 1.0, 0.00000000,345.99987793,269.99981689);
  176. SetTimer("CloseGate3", 5000, 1);
  177. return 1;
  178. }
  179. return 1;
  180. }
  181. forward CloseGate3();
  182. public CloseGate3()
  183. {
  184. MoveObject(gate3, 2539.89990234,-1475.59997559,24.39999962, 1.0, 0.00000000,270.00000000,269.99975586);
  185. return 1;
  186. }
  187. forward CloseGate2();
  188. public CloseGate2()
  189. {
  190. MoveObject(gate2, 2540.10009766,-1459.30004883,24.39999962, 1.0 ,0.00000000,90.00000000,269.99636841);
  191. return 1;
  192. }
  193. forward CloseGate1();
  194. public CloseGate1()
  195. {
  196. MoveObject(gate1, 2523.39990234,-1493.50000000,23.89999962, 1.0, 0.00000000,270.00000000,0.00000000);
  197. return 1;
  198. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement