Advertisement
Guest User

RC Race System by Ravian

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