Guest User

RC Race filterscript by Flaken

a guest
Dec 27th, 2013
467
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.70 KB | None | 0 0
  1. // RC Race by Flaken
  2.  
  3. #include <a_samp>
  4. #include <zcmd>
  5.  
  6. #define COLOR_YELLOW 0xFFFF00AA
  7. #define COLOR_GREY 0xAFAFAFAA
  8. #define COLOR_PURPLE 0xC2A2DAAA
  9. #define COLOR_PINK 0xFF66FFAA
  10. #define COLOR_BLUE 0x2641FEAA
  11. #define MAX_RC 4
  12.  
  13. new elevator, door3, door2, door1;
  14. new ElevatorStatus;
  15. //new go[6];
  16. //new gostatus[6];
  17. //new gate;
  18. //new GateStatus;
  19. new Text3D:first, Text3D:second, Text3D:third, Text3D:flyingtext[4];
  20. new rcid[8];
  21. new RCUsed[8];
  22. new rmin, rsec, rmilsec;
  23. new info;
  24. new racetime, gotime;
  25. new Float:SpawnPos[4][3] =
  26. {
  27. {40.65, 622.09, 7.48},
  28. {40.65, 620.72, 7.48},
  29. {40.65, 619.37, 7.48},
  30. {40.65, 617.77, 7.48}
  31. };
  32.  
  33. public OnFilterScriptInit()
  34. {
  35. #pragma tabsize 0
  36. // Tag
  37. print("\n -------------------------------------");
  38. print(" | |");
  39. print(" | Remote Control Circuit Filterscript |");
  40. print(" | by Flaken |");
  41. print(" | |");
  42. print(" -------------------------------------\n");
  43.  
  44. // Map
  45. CreateObject(7665, 62.77, 600.52, 8.24, 0.00, 0.00, 0.00);
  46. CreateObject(8838, 36.97, 593.46, 12.67, 0.00, 0.00, 90.00);
  47. CreateObject(7665, 62.77, 600.51, 8.24, 180.00, 180.00, 0.00);
  48. CreateObject(3850, 39.23, 600.14, 11.78, 0.00, 0.00, 0.00);
  49. CreateObject(3850, 39.22, 596.67, 11.78, 0.00, 0.00, 0.00);
  50. CreateObject(3850, 39.21, 593.19, 11.78, 0.00, 0.00, 0.00);
  51. CreateObject(3850, 39.20, 589.78, 11.78, 0.00, 0.00, 0.00);
  52. CreateObject(3850, 39.19, 586.36, 11.78, 0.00, 0.00, 0.00);
  53. CreateObject(3850, 39.18, 582.86, 11.78, 0.00, 0.00, 0.00);
  54. CreateObject(3850, 39.16, 579.36, 11.78, 0.00, 0.00, 0.00);
  55. CreateObject(8838, 36.97, 593.46, 9.63, 0.00, 0.00, 90.00);
  56. CreateObject(5820, 35.23, 575.19, 7.63, 0.00, 0.00, 0.00);
  57. CreateObject(3850, 38.43, 590.66, 7.55, 0.00, 0.00, 0.00);
  58. CreateObject(3850, 38.43, 594.09, 7.55, 0.00, -0.18, 0.00);
  59. CreateObject(3850, 38.43, 597.59, 7.55, 0.00, 0.00, 0.00);
  60. CreateObject(3850, 38.43, 601.05, 7.55, 0.00, 0.00, 0.00);
  61. CreateObject(3850, 38.43, 604.51, 7.55, 0.00, 0.00, 0.00);
  62. CreateObject(3850, 38.44, 607.98, 7.55, 0.00, 0.00, 0.00);
  63. CreateObject(3850, 38.43, 587.23, 7.55, 0.06, 0.00, 0.00);
  64. CreateObject(3850, 38.43, 583.76, 7.55, 0.00, 0.00, 0.00);
  65. CreateObject(3850, 38.44, 580.28, 7.55, 0.00, 0.00, 0.00);
  66. CreateObject(970, 34.99, 607.60, 11.78, 0.00, 0.00, 90.00);
  67. CreateObject(3350, 38.60, 578.12, 14.19, 0.00, 0.00, 135.00);
  68. CreateObject(3350, 35.00, 623.11, 8.06, 0.00, 0.00, 45.00);
  69. CreateObject(3350, 90.53, 623.03, 8.06, 0.00, 0.00, -45.00);
  70. CreateObject(3350, 90.30, 577.92, 8.06, 0.00, 0.00, -135.00);
  71. CreateObject(2184, 39.79, 609.33, 11.15, 0.00, 0.00, 90.00);
  72. CreateObject(1806, 38.11, 610.09, 11.15, 0.00, 0.00, -110.00);
  73. CreateObject(1806, 37.98, 610.94, 11.15, 0.00, 0.00, -70.00);
  74. CreateObject(17522, 68.54, 603.59, -21.79, 0.00, -0.06, 90.00);
  75. CreateObject(3406, 34.54, 579.29, 5.15, 0.00, 0.00, 0.00);
  76. CreateObject(3406, 34.54, 581.27, 5.15, 0.00, 0.00, 0.00);
  77. CreateObject(3406, 34.54, 583.18, 5.15, 0.00, 0.00, 0.00);
  78. CreateObject(3406, 34.54, 585.17, 5.15, 0.00, 0.00, 0.00);
  79. CreateObject(3406, 34.54, 587.17, 5.12, 0.00, 0.00, 0.00);
  80. CreateObject(3406, 34.54, 589.16, 5.12, 0.00, 0.00, 0.00);
  81. CreateObject(3406, 34.54, 591.15, 5.12, 0.00, 0.00, 0.00);
  82. CreateObject(3406, 34.54, 593.16, 5.12, 0.00, 0.00, 0.00);
  83. CreateObject(3406, 34.54, 595.17, 5.12, 0.00, 0.00, 0.00);
  84. CreateObject(3406, 34.54, 597.18, 5.12, 0.00, 0.00, 0.00);
  85. CreateObject(3406, 34.54, 599.19, 5.12, 0.00, 0.00, 0.00);
  86. CreateObject(3406, 34.54, 601.21, 5.12, 0.00, 0.00, 0.00);
  87. CreateObject(3406, 34.54, 603.23, 5.12, 0.00, 0.00, 0.00);
  88. CreateObject(3406, 34.54, 605.21, 5.12, 0.00, 0.00, 0.00);
  89. CreateObject(3406, 34.54, 607.22, 5.08, 0.00, 0.00, 0.00);
  90. CreateObject(3406, 34.54, 609.16, 5.02, 0.00, 0.00, 0.00);
  91. CreateObject(970, 34.99, 599.39, 11.78, 0.00, 0.00, 90.00);
  92. CreateObject(970, 34.99, 595.29, 11.78, 0.00, 0.00, 90.00);
  93. CreateObject(970, 34.99, 591.20, 11.78, 0.00, 0.00, 90.00);
  94. CreateObject(970, 34.99, 587.10, 11.78, 0.00, 0.00, 90.00);
  95. CreateObject(970, 34.99, 583.01, 11.78, 0.00, 0.00, 90.00);
  96. CreateObject(970, 34.99, 579.28, 11.78, 0.00, 0.00, 90.00);
  97. CreateObject(14874, 36.47, 612.72, 9.29, 0.00, 0.00, 90.00);
  98. CreateObject(0, 42.69, 608.84, 10.51, 0.00, 0.00, 359.29);
  99. CreateObject(3117, 38.44, 610.35, 11.02, 0.00, 0.00, 90.00);
  100. CreateObject(3440, 40.14, 610.96, 8.54, 0.00, 0.00, 0.00);
  101. CreateObject(3117, 38.98, 607.23, 11.02, 0.00, 0.00, -107.25);
  102. CreateObject(3850, 40.32, 610.28, 11.70, 0.00, 0.00, 0.00);
  103. CreateObject(3117, 39.44, 610.35, 11.02, 0.00, 0.00, 90.00);
  104. CreateObject(3850, 39.83, 606.99, 11.70, 0.00, 0.00, -17.00);
  105. CreateObject(3850, 39.23, 603.54, 11.78, 0.00, 0.00, 0.00);
  106. CreateObject(3406, 34.54, 611.13, 5.02, 0.00, 0.00, 0.00);
  107. CreateObject(3406, 34.54, 612.83, 5.02, 0.00, 0.00, 0.00);
  108. CreateObject(3850, 38.44, 611.44, 7.55, 0.00, 0.00, 0.00);
  109. CreateObject(3406, 34.54, 614.84, 5.02, 0.00, 0.00, 0.00);
  110. CreateObject(979, 47.40, 616.99, 7.12, 0.00, 0.00, 2.64);
  111. CreateObject(979, 55.10, 613.80, 7.12, 0.00, 0.00, 312.59);
  112. CreateObject(979, 42.94, 606.36, 7.12, 0.00, 0.00, 79.59);
  113. CreateObject(978, 60.55, 613.89, 7.12, 0.00, 0.00, 115.47);
  114. CreateObject(978, 55.13, 620.71, 7.12, 0.00, 0.00, 140.55);
  115. CreateObject(979, 56.94, 606.26, 7.12, 0.00, 0.00, 256.97);
  116. CreateObject(978, 61.12, 605.51, 7.12, 0.00, 0.00, 75.02);
  117. CreateObject(979, 56.86, 598.18, 7.12, 0.00, 0.00, 282.59);
  118. CreateObject(978, 63.60, 604.13, 7.12, 0.00, 0.00, 215.62);
  119. CreateObject(979, 68.49, 600.79, 7.12, 0.00, 0.00, 54.40);
  120. CreateObject(979, 62.17, 595.40, 7.12, 0.00, 0.00, 23.82);
  121. CreateObject(978, 65.95, 611.12, 7.12, 0.00, 0.00, 287.89);
  122. CreateObject(979, 70.95, 609.13, 7.12, 0.00, 0.00, 92.09);
  123. CreateObject(978, 67.99, 618.96, 7.12, 0.00, 0.00, 225.38);
  124. CreateObject(979, 74.52, 616.50, 7.12, 0.00, 0.00, 33.27);
  125. CreateObject(979, 81.35, 615.40, 7.12, 0.00, 0.00, 308.50);
  126. CreateObject(978, 89.38, 614.55, 7.12, 0.00, 0.00, 98.21);
  127. CreateObject(979, 83.62, 606.89, 7.12, 0.00, 0.00, 101.98);
  128. CreateObject(979, 84.22, 606.98, 7.12, 0.00, 0.00, 271.79);
  129. CreateObject(978, 79.95, 602.11, 7.12, 0.00, 0.00, 282.47);
  130. CreateObject(978, 77.54, 601.94, 7.12, 0.00, 0.00, 68.32);
  131. CreateObject(979, 78.43, 611.78, 7.12, 0.00, 0.00, 167.95);
  132. CreateObject(979, 73.31, 608.18, 7.12, 0.00, 0.00, 261.96);
  133. CreateObject(979, 71.28, 600.71, 7.12, 0.00, 0.00, 251.51);
  134. CreateObject(979, 80.91, 588.81, 7.12, 0.00, 0.00, 304.19);
  135. CreateObject(978, 79.65, 595.56, 7.12, 0.00, 0.00, 149.39);
  136. CreateObject(978, 74.12, 594.53, 7.12, 0.00, 0.00, 157.38);
  137. CreateObject(978, 89.11, 582.40, 7.120, 0.00, 0.00, 89.51);
  138. CreateObject(979, 78.58, 585.93, 7.12, 0.00, 0.00, 179.17);
  139. CreateObject(978, 74.73, 580.10, 7.12, 0.00, 0.00, 339.62);
  140. CreateObject(979, 69.82, 587.20, 7.12, 0.00, 0.00, 167.03);
  141. CreateObject(978, 75.72, 622.48, 7.12, 0.00, 0.00, 179.84);
  142. CreateObject(978, 84.63, 620.93, 7.12, 0.00, 0.00, 162.25);
  143. CreateObject(978, 89.94, 605.23, 7.12, 0.00, 0.00, 89.61);
  144. CreateObject(978, 85.45, 599.15, 7.12, 0.00, 0.00, 16.76);
  145. CreateObject(978, 86.33, 589.97, 7.12, 0.00, 0.00, 128.60);
  146. CreateObject(978, 84.07, 578.40, 7.12, 0.00, 0.00, 0.04);
  147. CreateObject(978, 66.31, 579.95, 7.12, 0.00, 0.00, 22.46);
  148. CreateObject(979, 61.37, 586.41, 7.12, 0.00, 0.00, 204.56);
  149. CreateObject(978, 57.73, 578.45, 7.12, 0.00, 0.00, 1.11);
  150. CreateObject(979, 56.55, 589.00, 7.12, 0.00, 0.00, 102.46);
  151. CreateObject(978, 52.23, 582.94, 7.12, 0.00, 0.00, 285.32);
  152. CreateObject(979, 54.57, 606.91, 7.12, 0.00, 0.00, 94.15);
  153. CreateObject(979, 55.18, 597.91, 7.12, 0.00, 0.00, 94.15);
  154. CreateObject(979, 49.28, 611.98, 7.12, 0.00, 0.00, 179.42);
  155. CreateObject(978, 51.44, 591.99, 7.12, 0.00, 0.00, 265.74);
  156. CreateObject(978, 51.55, 601.15, 7.12, 0.00, 0.00, 274.30);
  157. CreateObject(978, 49.64, 601.16, 7.12, 0.00, 0.00, 67.35);
  158. CreateObject(979, 44.53, 607.10, 7.12, 0.00, 0.00, 265.70);
  159. CreateObject(978, 47.85, 592.62, 7.12, 0.00, 0.00, 89.38);
  160. CreateObject(979, 44.37, 597.87, 7.12, 0.00, 0.00, 269.45);
  161. CreateObject(978, 48.55, 583.68, 7.12, 0.00, 0.00, 99.05);
  162. CreateObject(979, 44.36, 588.62, 7.12, 0.00, 0.00, 269.45);
  163. CreateObject(978, 44.49, 578.63, 7.12, 0.00, 0.00, 2.52);
  164. CreateObject(978, 38.80, 592.34, 7.12, 0.00, 0.00, 269.23);
  165. CreateObject(979, 43.28, 588.52, 7.12, 0.00, 0.00, 103.57);
  166. CreateObject(978, 39.47, 583.08, 7.12, 0.00, 0.00, 278.09);
  167. CreateObject(978, 38.85, 601.46, 7.12, 0.00, 0.00, 269.23);
  168. CreateObject(978, 38.96, 610.70, 7.12, 0.00, 0.00, 269.23);
  169. CreateObject(979, 42.16, 597.55, 7.12, 0.00, 0.00, 89.80);
  170. CreateObject(979, 43.08, 612.33, 7.12, 0.00, 0.00, 93.38);
  171. CreateObject(747, 59.71, 620.72, 6.69, 0.00, 0.00, 0.00);
  172. CreateObject(747, 64.04, 606.76, 7.01, 0.00, 0.00, 215.00);
  173. CreateObject(826, 63.72, 619.73, 6.98, 0.00, 0.00, 0.00);
  174. CreateObject(844, 63.66, 612.89, 8.03, 0.00, 0.00, 341.24);
  175. CreateObject(760, 67.75, 621.16, 6.81, 0.00, 0.00, 0.00);
  176. CreateObject(832, 79.29, 601.39, 7.05, 0.00, 0.00, 0.00);
  177. CreateObject(835, 86.23, 590.15, 7.14, 0.00, 0.00, 0.31);
  178. CreateObject(839, 88.48, 598.23, 9.63, 0.00, 0.00, 359.48);
  179. CreateObject(823, 85.96, 595.52, 7.12, 0.00, 0.00, 0.00);
  180. CreateObject(672, 86.24, 593.87, 10.06, 0.00, 0.00, 0.00);
  181. CreateObject(669, 64.83, 592.69, 7.29, 0.00, 0.00, 0.00);
  182. CreateObject(831, 78.55, 598.02, 7.05, 0.00, 0.00, 336.00);
  183. CreateObject(833, 80.90, 596.09, 7.65, 0.00, 0.00, 230.37);
  184. CreateObject(822, 76.80, 589.16, 7.09, 0.00, 0.00, 0.00);
  185. CreateObject(824, 70.03, 592.84, 7.06, 0.00, 0.00, 0.00);
  186. CreateObject(812, 64.99, 592.19, 8.59, 0.00, 0.00, 0.00);
  187. CreateObject(824, 59.83, 590.61, 7.06, 0.00, 0.00, 0.00);
  188. CreateObject(966, 39.14, 615.47, 6.73, 0.00, 0.00, 299.81);
  189. CreateObject(8838, 36.97, 593.46, 15.49, 0.00, 0.00, 90.00);
  190. CreateObject(8838, 36.97, 593.46, 18.32, 0.00, 0.00, 90.00);
  191. CreateObject(3850, 39.16, 579.36, 17.56, 0.00, 0.00, 0.00);
  192. CreateObject(3850, 39.18, 582.86, 17.58, 0.00, 0.00, 0.00);
  193. CreateObject(3850, 39.19, 586.36, 17.56, 0.00, 0.00, 0.00);
  194. CreateObject(3850, 39.20, 589.78, 17.55, 0.00, 0.00, 0.00);
  195. CreateObject(3850, 39.21, 593.19, 17.54, 0.00, 0.00, 0.00);
  196. CreateObject(3850, 39.22, 596.67, 17.53, 0.00, 0.00, 0.00);
  197. CreateObject(3850, 39.23, 600.14, 17.52, 0.00, 0.00, 0.00);
  198. CreateObject(3850, 39.23, 603.54, 17.53, 0.00, 0.00, 0.00);
  199. CreateObject(3850, 39.15, 579.36, 14.70, 0.00, 0.00, 0.00);
  200. CreateObject(3850, 39.17, 582.86, 14.68, 0.00, 0.00, 0.00);
  201. CreateObject(3850, 39.18, 586.36, 14.66, 0.00, 0.00, 0.00);
  202. CreateObject(3850, 39.19, 589.78, 14.69, 0.00, 0.00, 0.00);
  203. CreateObject(3850, 39.20, 593.19, 14.67, 0.00, 0.00, 0.00);
  204. CreateObject(3850, 39.21, 596.67, 14.70, 0.00, 0.00, 0.00);
  205. CreateObject(3850, 39.22, 600.14, 14.68, 0.00, 0.00, 0.00);
  206. CreateObject(3850, 39.22, 603.54, 14.71, 0.00, 0.00, 0.00);
  207. CreateObject(970, 34.98, 607.61, 14.68, 0.00, 0.00, 90.00);
  208. CreateObject(970, 34.98, 599.40, 14.71, 0.00, 0.00, 90.00);
  209. CreateObject(970, 34.98, 595.30, 14.69, 0.00, 0.00, 90.00);
  210. CreateObject(970, 34.98, 591.21, 14.72, 0.00, 0.00, 90.00);
  211. CreateObject(970, 34.98, 587.11, 14.65, 0.00, 0.00, 90.00);
  212. CreateObject(970, 34.98, 583.02, 14.82, 0.00, 0.00, 90.00);
  213. CreateObject(970, 34.98, 579.29, 14.81, 0.00, 0.00, 90.00);
  214. CreateObject(970, 35.00, 607.60, 17.57, 0.00, 0.00, 90.00);
  215. CreateObject(970, 35.00, 599.39, 17.58, 0.00, 0.00, 90.00);
  216. CreateObject(970, 35.00, 595.29, 17.59, 0.00, 0.00, 90.00);
  217. CreateObject(970, 35.00, 591.20, 17.60, -0.05, 0.00, 90.00);
  218. CreateObject(970, 35.00, 587.10, 17.61, 0.00, 0.00, 90.00);
  219. CreateObject(970, 35.00, 583.01, 17.63, 0.00, 0.00, 90.00);
  220. CreateObject(970, 35.00, 579.28, 17.64, 0.00, 0.00, 90.00);
  221. CreateObject(3850, 39.22, 606.94, 14.71, 0.00, 0.00, 0.00);
  222. CreateObject(3850, 39.23, 606.94, 17.53, 0.00, 0.00, 0.00);
  223. CreateObject(984, 34.21, 605.73, 13.36, 90.00, 0.00, 0.00);
  224. CreateObject(984, 34.21, 601.53, 13.36, 90.00, 180.00, 0.00);
  225. CreateObject(7665, 62.77, 600.51, 5.40, 0.00, 180.00, 0.00);
  226. CreateObject(7665, 62.77, 600.51, 5.54, 180.00, 0.00, 0.00);
  227. CreateObject(970, 37.09, 577.48, 17.64, 0.00, 0.00, 0.00);
  228. CreateObject(970, 37.09, 577.48, 14.72, 0.00, 0.00, 0.00);
  229. CreateObject(3850, 39.16, 575.95, 11.78, 0.00, 0.00, 0.00);
  230. CreateObject(970, 37.14, 608.61, 17.57, 0.00, 0.00, 0.00);
  231. CreateObject(970, 37.14, 608.61, 14.84, 0.00, 0.00, 0.00);
  232.  
  233. //gate = CreateObject(968, 39.12, 615.55, 7.53, 0.00, 90.00, 120.11);
  234. elevator = CreateObject(18755, 32.2979, 603.80, 18.75, 0.00, 0.00, 180.00);
  235. door3 = CreateObject(970, 35.00, 607.59, 17.52, 0.00, 0.00, 90.00);
  236. door2 = CreateObject(970, 34.99, 603.55, 14.68, 0.00, 0.00, 90.00);
  237. door1 = CreateObject(970, 34.99, 603.49, 11.78, 0.00, 0.00, 90.00);
  238. //go[0] = CreateObject(968, 41.92, 624.17, 6.77, 0.00, 90.00, 269.00);
  239. //go[1] = CreateObject(968, 40.08, 624.18, 6.70, 0.00, 90.00, 269.00);
  240. //go[2] = CreateObject(968, 34.79, 621.42, 6.64, 0.00, 90.00, 0.00);
  241. //go[3] = CreateObject(968, 34.79, 620.02, 6.65, 0.00, 89.50, 0.00);
  242. //go[4] = CreateObject(968, 34.78, 618.61, 6.64, 0.00, 88.91, 0.00);
  243. //go[5] = CreateObject(968, 34.77, 617.17, 6.65, 0.00, 88.50, 0.00);
  244. CreateObject(968, 34.79, 621.42, 6.64, 0.00, 90.00, 0.00);
  245. CreateObject(968, 34.79, 620.02, 6.65, 0.00, 89.50, 0.00);
  246. CreateObject(968, 34.78, 618.61, 6.64, 0.00, 88.91, 0.00);
  247. CreateObject(968, 34.77, 617.17, 6.65, 0.00, 88.50, 0.00);
  248.  
  249. //status
  250. ElevatorStatus = 3;
  251. for(new i; i<MAX_PLAYERS; i++)
  252. {
  253. SetPVarInt(i, "OnRC", -1);
  254. }
  255.  
  256. //timer
  257. SetTimer("MoveToSecondDown", 10000, 0);
  258.  
  259. //Labels
  260. first = Create3DTextLabel("", COLOR_BLUE, 35.1825, 603.6802, 17.8232+1.5, 3, 0, 0);
  261. second = Create3DTextLabel("", COLOR_BLUE, 35.1825, 603.6802, 14.6732+1.5, 3, 0, 0);
  262. third = Create3DTextLabel("", COLOR_BLUE, 35.1825, 603.6802, 11.8382+1.5, 3, 0, 0);
  263. flyingtext[3] = Create3DTextLabel("Use (/tryrc) to play the RC car", 0xFF0000AA, 39.3410, 619.4432, 7.4325+0.2, 10, 0, 0);
  264. flyingtext[2] = Create3DTextLabel("Third Floor", 0xFF0000AA, 35.1825, 603.6802, 17.8232, 4, 0, 0);
  265. flyingtext[1] = Create3DTextLabel("Second Floor", 0xFF0000AA, 35.1825, 603.6802, 14.6732, 4, 0, 0);
  266. flyingtext[0] = Create3DTextLabel("First Floor", 0xFF0000AA, 35.1825, 603.6802, 11.8382, 4, 0, 0);
  267. info = CreatePickup(1239, 23, 39.3410, 619.4432, 7.4325-0.3, -1);
  268.  
  269. //end of OnFilterScriptInIt
  270. return 1;
  271. }
  272.  
  273. public OnPlayerConnect(playerid)
  274. {
  275. SetPVarInt(playerid, "OnRC", -1);
  276. return 1;
  277. }
  278.  
  279. public OnPlayerDisconnect(playerid)
  280. {
  281. new x = GetPVarInt(playerid, "OnRC");
  282. DestroyVehicle(rcid[x]);
  283. SetPVarInt(playerid, "OnRC", -1);
  284. SetPVarInt(playerid, "phase1", 1);
  285. SetPVarInt(playerid, "phase2", 0);
  286. SetPVarInt(playerid, "phase3", 0);
  287. SetPVarInt(playerid, "phase4", 0);
  288. SetPVarInt(playerid, "phase5", 0);
  289. return 1;
  290. }
  291.  
  292. public OnFilterScriptExit()
  293. {
  294. new params[32];
  295. for(new i; i < MAX_OBJECTS; i++)
  296. {
  297. DestroyObject(i);
  298. }
  299. for(new i=0; i < 4; i++)
  300. {
  301. Delete3DTextLabel(flyingtext[i]);
  302. }
  303. for(new i; i < MAX_RC; i++)
  304. {
  305. DestroyVehicle(rcid[i]);
  306. }
  307. Delete3DTextLabel(first);
  308. Delete3DTextLabel(second);
  309. Delete3DTextLabel(third);
  310. DestroyPickup(info);
  311. for(new i; i<MAX_PLAYERS; i++)
  312. {
  313. return cmd_exitrc(i, params);
  314. }
  315. return 1;
  316. }
  317.  
  318. forward TheTime(playerid);
  319. public TheTime(playerid)
  320. {
  321. rmilsec += 1;
  322. if(rmilsec == 100)
  323. {
  324. rsec += 1;
  325. rmilsec = 0;
  326. }
  327. if(rsec == 59)
  328. {
  329. rmin += 1;
  330. rsec = 0;
  331. }
  332. return 1;
  333. }
  334.  
  335. forward MoveToThird();
  336. public MoveToThird()
  337. {
  338. new string[128];
  339. MoveObject(elevator, 32.2979, 603.5980, 18.8486, 3);
  340. MoveObject(door2, 34.99, 603.55, 14.68, 3);
  341. ElevatorStatus = 3;
  342. format(string, sizeof(string), "The Elevator is now moving to the Third Floor");
  343. Update3DTextLabelText(first, COLOR_BLUE, string);
  344. Update3DTextLabelText(second, COLOR_BLUE, string);
  345. Update3DTextLabelText(third, COLOR_BLUE, string);
  346. return 1;
  347. }
  348.  
  349. forward MoveToSecondDown();
  350. public MoveToSecondDown()
  351. {
  352. new string[128];
  353. MoveObject(elevator, 32.2979, 603.5980, 16.1376, 3);
  354. MoveObject(door3, 34.99, 603.55, 17.52, 3);
  355. ElevatorStatus = 2;
  356. format(string, sizeof(string), "The Elevator is now moving the Second Floor");
  357. Update3DTextLabelText(first, COLOR_BLUE, string);
  358. Update3DTextLabelText(second, COLOR_BLUE, string);
  359. Update3DTextLabelText(third, COLOR_BLUE, string);
  360. return 1;
  361. }
  362.  
  363. forward MoveToFirst();
  364. public MoveToFirst()
  365. {
  366. new string[128];
  367. MoveObject(elevator, 32.2979, 603.5980, 12.9356, 3);
  368. MoveObject(door2, 34.99, 603.55, 14.68, 3);
  369. ElevatorStatus = 1;
  370. format(string, sizeof(string), "The Elevator is now moving to the First Floor");
  371. Update3DTextLabelText(first, COLOR_BLUE, string);
  372. Update3DTextLabelText(second, COLOR_BLUE, string);
  373. Update3DTextLabelText(third, COLOR_BLUE, string);
  374. return 1;
  375. }
  376.  
  377. forward MoveToSecondUp();
  378. public MoveToSecondUp()
  379. {
  380. new string[128];
  381. MoveObject(elevator, 32.2979, 603.5980, 16.1356, 3);
  382. MoveObject(door1, 34.99, 603.55, 11.78, 3);
  383. ElevatorStatus = 4;
  384. format(string, sizeof(string), "The Elevator is now at the Second Floor");
  385. Update3DTextLabelText(first, COLOR_BLUE, string);
  386. Update3DTextLabelText(second, COLOR_BLUE, string);
  387. Update3DTextLabelText(third, COLOR_BLUE, string);
  388. return 1;
  389. }
  390.  
  391. CMD:tryrc(playerid, params[])
  392. {
  393. if(!IsPlayerInRangeOfPoint(playerid, 5.0, 39.3410, 619.4432, 7.4325))
  394. {
  395. SendClientMessage(playerid, COLOR_GREY, "You have to be in the RC Circuit to drive a RC");
  396. return 1;
  397. }
  398. if(GetPVarInt(playerid, "OnRC") != -1)
  399. {
  400. SendClientMessage(playerid, 0xff0000ff, "You already drive a RC");
  401. return 1;
  402. }
  403.  
  404. for(new x; x<MAX_RC+1; x++)
  405. {
  406. if(RCUsed[x] == 0 && x < MAX_RC)
  407. {
  408. new string[64];
  409. new engine, lights, alarm, doors, boonet, boot, objective;
  410. new i = random(3);
  411. {
  412. rcid[x] = CreateVehicle(441, SpawnPos[i][0], SpawnPos[i][1], SpawnPos[i][2], -90.0000, -1, -1, 7200);
  413. }
  414. GetVehicleParamsEx(rcid[x], engine, lights, alarm, doors, boonet, boot, objective);
  415. SetVehicleParamsEx(rcid[x], 1, lights, alarm, doors, boonet, boot, objective);
  416. SetPlayerPos(playerid, 40.4026, 621.7995, -107.4325);
  417. PutPlayerInVehicle(playerid, rcid[x], 0);
  418. SetPVarInt(playerid, "OnRC", x);
  419. gotime = SetTimerEx("ReadyToGo", 1000, 1, "i", playerid);
  420. SetPVarInt(playerid, "phase1", 1);
  421. SetPVarInt(playerid, "phase2", 0);
  422. SetPVarInt(playerid, "phase3", 0);
  423. SetPVarInt(playerid, "phase4", 0);
  424. SetPVarInt(playerid, "phase5", 0);
  425. TogglePlayerControllable(playerid, 0);
  426. RCUsed[x] = 1;
  427. format(string, sizeof(string), "You're on RC number %d", x);//debug
  428. SendClientMessage(playerid, COLOR_YELLOW, string);//debug
  429. break;
  430. }
  431. if(x == MAX_RC)
  432. {
  433. SendClientMessage(playerid, COLOR_GREY, "All RC is being used");
  434. return 1;
  435. }
  436. }
  437. return 1;
  438. }
  439.  
  440. forward ReadyToGo(playerid);
  441. public ReadyToGo(playerid)
  442. {
  443. if(GetPVarInt(playerid, "phase1") == 1)
  444. {
  445. SendClientMessage(playerid,COLOR_PURPLE, "Get Ready!");
  446. SetPVarInt(playerid, "phase1", 0);
  447. SetPVarInt(playerid, "phase2", 1);
  448. }
  449. else if(GetPVarInt(playerid, "phase2") == 1)
  450. {
  451. SendClientMessage(playerid,COLOR_PINK, "3!");
  452. SetPVarInt(playerid, "phase2", 0);
  453. SetPVarInt(playerid, "phase3", 1);
  454. }
  455. else if(GetPVarInt(playerid, "phase3") == 1)
  456. {
  457. SendClientMessage(playerid,COLOR_PINK, "2!");
  458. SetPVarInt(playerid, "phase3", 0);
  459. SetPVarInt(playerid, "phase4", 1);
  460. }
  461. else if(GetPVarInt(playerid, "phase4") == 1)
  462. {
  463. SendClientMessage(playerid,COLOR_PINK, "1!");
  464. SetPVarInt(playerid, "phase4", 0);
  465. SetPVarInt(playerid, "phase5", 1);
  466. }
  467. else if(GetPVarInt(playerid, "phase5") == 1)
  468. {
  469. SendClientMessage(playerid, COLOR_BLUE, "GO!");
  470. TogglePlayerControllable(playerid, 1);
  471. SetPVarInt(playerid, "phase5", 0);
  472. racetime = SetTimerEx("TheTime", 10, 1, "i", playerid);
  473. KillTimer(gotime);
  474. SetPlayerCheckpoint(playerid, 84.77, 600.98, 8.15, 3);
  475. }
  476. return 1;
  477. }
  478.  
  479. public OnPlayerEnterCheckpoint(playerid)
  480. {
  481. if(GetPVarInt(playerid, "OnRC") != -1)
  482. {
  483. DisablePlayerCheckpoint(playerid);
  484. SetPlayerRaceCheckpoint(playerid, 2, 41.09, 614.48, 7.66, 41.09, 614.48, 7.66, 2.5);
  485. }
  486. return 1;
  487. }
  488.  
  489. public OnPlayerEnterRaceCheckpoint(playerid)
  490. {
  491. if(GetPVarInt(playerid, "OnRC") != -1)
  492. {
  493. new string[128], name[32];
  494. new Float:health;
  495. DisablePlayerRaceCheckpoint(playerid);
  496. GetVehicleHealth(GetPlayerVehicleID(playerid), health);
  497. GetPlayerName(playerid, name, sizeof(name));
  498. format(string, sizeof(string), "%s's time is %d minutes and %d.%d seconds, with %.2f vehicle damage", name, rmin, rsec, rmilsec, 1000-health);
  499. for(new i; i<MAX_PLAYERS; i++)
  500. if(IsPlayerInRangeOfPoint(i, 35, 67.50, 602.01, 8.03))
  501. {
  502. SendClientMessage(i, COLOR_YELLOW, string);
  503. }
  504. KillTimer(racetime);
  505. rsec = 0;
  506. rmilsec = 0;
  507. rmin = 0;
  508. RemovePlayerFromVehicle(playerid);
  509. SetPlayerPos(playerid, 39.3410, 619.4432, 7.4325);
  510. new x = GetPVarInt(playerid, "OnRC");
  511. DestroyVehicle(rcid[x]);
  512. RCUsed[x] = 0;
  513. SetPVarInt(playerid, "OnRC", -1);
  514. }
  515. return 1;
  516. }
  517.  
  518. CMD:exitrc(playerid, params[])
  519. {
  520. if(GetPVarInt(playerid, "OnRC") != -1)
  521. {
  522. new string[128], name[32];
  523. DisablePlayerRaceCheckpoint(playerid);
  524. DisablePlayerCheckpoint(playerid);
  525. GetPlayerName(playerid, name, sizeof(name));
  526. format(string, sizeof(string), "%s exits the RC Circuit", name);
  527. for(new i; i<MAX_PLAYERS; i++)
  528. if(IsPlayerInRangeOfPoint(i, 35, 67.50, 602.01, 8.03))
  529. {
  530. SendClientMessage(i, COLOR_YELLOW, string);
  531. }
  532. KillTimer(racetime);
  533. rsec = 0;
  534. rmilsec = 0;
  535. rmin = 0;
  536. RemovePlayerFromVehicle(playerid);
  537. SetPlayerPos(playerid, 39.3410, 619.4432, 7.4325);
  538. new x = GetPVarInt(playerid, "OnRC");
  539. DestroyVehicle(rcid[x]);
  540. RCUsed[x] = 0;
  541. SetPVarInt(playerid, "OnRC", -1);
  542. TogglePlayerControllable(playerid, 1);
  543. }
  544. else
  545. {
  546. SendClientMessage(playerid, 0xffffffff, "You aren't driving the RC in the RC Circuit!");
  547. }
  548. return 1;
  549. }
  550.  
  551. CMD:gotorc(playerid, params[])
  552. {
  553. SetPlayerPos(playerid, 31.48, 575.75, 8.50);
  554. return 1;
  555. }
  556.  
  557. public OnObjectMoved(objectid)
  558. {
  559. if(objectid == elevator)
  560. {
  561. if(ElevatorStatus == 1)
  562. {
  563. new string[128];
  564. MoveObject(door1, 34.99, 607.59, 11.78,2);
  565. SetTimer("MoveToSecondUp", 10000, 0);
  566. format(string, sizeof(string), "The Elevator is now at the First Floor");
  567. Update3DTextLabelText(first, COLOR_BLUE, string);
  568. Update3DTextLabelText(second, COLOR_BLUE, string);
  569. Update3DTextLabelText(third, COLOR_BLUE, string);
  570. return 1;
  571. }
  572. else if(ElevatorStatus == 2)
  573. {
  574. new string[128];
  575. MoveObject(door2, 34.99, 607.59, 14.68,2);
  576. SetTimer("MoveToFirst", 10000, 0);
  577. format(string, sizeof(string), "The Elevator is now at the Second Floor");
  578. Update3DTextLabelText(first, COLOR_BLUE, string);
  579. Update3DTextLabelText(second, COLOR_BLUE, string);
  580. Update3DTextLabelText(third, COLOR_BLUE, string);
  581. return 1;
  582. }
  583. else if(ElevatorStatus == 3)
  584. {
  585. new string[128];
  586. MoveObject(door3, 34.99, 607.59, 17.56, 2);
  587. SetTimer("MoveToSecondDown", 10000, 0);
  588. format(string, sizeof(string), "The Elevator is now at the Third Floor");
  589. Update3DTextLabelText(first, COLOR_BLUE, string);
  590. Update3DTextLabelText(second, COLOR_BLUE, string);
  591. Update3DTextLabelText(third, COLOR_BLUE, string);
  592. return 1;
  593. }
  594. else if(ElevatorStatus == 4)
  595. {
  596. new string[128];
  597. MoveObject(door2, 34.99, 607.59, 14.68,2);
  598. SetTimer("MoveToThird", 10000, 0);
  599. format(string, sizeof(string), "The Elevator is now at the Second Floor");
  600. Update3DTextLabelText(first, COLOR_BLUE, string);
  601. Update3DTextLabelText(second, COLOR_BLUE, string);
  602. Update3DTextLabelText(third, COLOR_BLUE, string);
  603. return 1;
  604. }
  605. }
  606. return 1;
  607. }
Advertisement
Add Comment
Please, Sign In to add comment