Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.83 KB | None | 0 0
  1. #include "zcommon.acs"
  2.  
  3. #DEFINE shortDelay 35
  4. #DEFINE longDelay 70
  5. #DEFINE foreverDelay 9999*9999
  6.  
  7. int playerAmount = 0;
  8. int crossedLine = 0;
  9.  
  10. bool raceStarted = false;
  11. bool raceFinished = false;
  12.  
  13.  
  14. ////////////////////////////////////////////////////////////////////////////////////////////////////// 1st Countdown
  15.  
  16. Script 01 OPEN
  17. {
  18. int countdown;
  19.  
  20. //Static scripts.
  21. Sector_SetFriction(40, 45);
  22.  
  23. //Countdown to bike.
  24. SetFont("BigFont");
  25. Delay(longDelay);
  26.  
  27. for (int i = 0; i < 10; i++)
  28. {
  29. countdown = 10 - i;
  30. HudmessageBold(s: "You have ", d:countdown, s:" seconds to enter a wavebike!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 0.2);
  31. Delay(35);
  32. }
  33.  
  34.  
  35. HudmessageBold(s: "There's still time to enter a wavebike before the race starts!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 1.5);
  36. Delay(longDelay);
  37. ACS_Execute(11,0);
  38. }
  39.  
  40. Script 02 (void) //Count down canceller.
  41. {
  42. for (int i = 0; i < 7; i++)
  43. {
  44. Suspend;
  45. }
  46.  
  47. ACS_Terminate(1,0);
  48. SetFont("BigFont");
  49. HudmessageBold (s: "Wavebikes are all taken!!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 1.5);
  50. Delay(longDelay);
  51. ACS_Execute(11,0);
  52. }
  53.  
  54.  
  55. ////////////////////////////////////////////////////////////////////////////////////////////////////// Telepoter Scripts
  56.  
  57. Script 03 (void) //Teleport 1
  58. {
  59. if (raceStarted)
  60. terminate;
  61.  
  62. Teleport(21, 0, 0);
  63. ACS_Execute(2,0);
  64. GiveInventory("BoatActivate",1);
  65. ACS_Execute(12,0);
  66. Floor_LowerInstant(9,0,6);
  67. Delay(foreverDelay); //Forever.
  68. }
  69.  
  70. Script 04 (void) //Teleport 2
  71. {
  72. if (raceStarted)
  73. terminate;
  74.  
  75. Teleport(22, 0, 0);
  76. ACS_Execute(2,0);
  77. GiveInventory("BoatActivate",1);
  78. ACS_Execute(12,0);
  79. Floor_LowerInstant(10,0,6);
  80. Delay(foreverDelay); //Forever.
  81. }
  82.  
  83. Script 05 (void) //Teleport 3
  84. {
  85. if (raceStarted)
  86. terminate;
  87.  
  88. Teleport(23, 0, 0);
  89. ACS_Execute(2,0);
  90. GiveInventory("BoatActivate",1);
  91. ACS_Execute(12,0);
  92. Floor_LowerInstant(11,0,6);
  93. Delay(foreverDelay); //Forever.
  94. }
  95.  
  96. Script 06 (void) //Teleport 4
  97. {
  98. if (raceStarted)
  99. terminate;
  100.  
  101. Teleport(24, 0, 0);
  102. ACS_Execute(2,0);
  103. GiveInventory("BoatActivate",1);
  104. ACS_Execute(12,0);
  105. Floor_LowerInstant(12,0,6);
  106. Delay(foreverDelay); //Forever.
  107. }
  108.  
  109. Script 07 (void) //Teleport 5
  110. {
  111. if (raceStarted)
  112. terminate;
  113.  
  114. Teleport(25, 0, 0);
  115. ACS_Execute(2,0);
  116. GiveInventory("BoatActivate",1);
  117. ACS_Execute(12,0);
  118. Floor_LowerInstant(13,0,6);
  119. Delay(foreverDelay); //Forever.
  120. }
  121.  
  122. Script 08 (void) //Teleport 6
  123. {
  124. if (raceStarted)
  125. terminate;
  126.  
  127. Teleport(26, 0, 0);
  128. ACS_Execute(2,0);
  129. GiveInventory("BoatActivate",1);
  130. ACS_Execute(12,0);
  131. Floor_LowerInstant(14,0,6);
  132. Delay(foreverDelay); //Forever.
  133. }
  134.  
  135. Script 09 (void) //Teleport 7
  136. {
  137. if (raceStarted)
  138. terminate;
  139.  
  140. Teleport(27, 0, 0);
  141. ACS_Execute(2,0);
  142. GiveInventory("BoatActivate",1);
  143. ACS_Execute(12,0);
  144. Floor_LowerInstant(15,0,6);
  145. Delay(foreverDelay); //Forever.
  146. }
  147.  
  148. Script 10 (void) //Teleport 8
  149. {
  150. if (raceStarted)
  151. terminate;
  152.  
  153. Teleport(28, 0, 0);
  154. ACS_Execute(2,0);
  155. GiveInventory("BoatActivate",1);
  156. ACS_Execute(12,0);
  157. Floor_LowerInstant(16,0,6);
  158. Delay(foreverDelay); //Forever.
  159. }
  160.  
  161.  
  162. ////////////////////////////////////////////////////////////////////////////////////////////////////// Race scripts
  163.  
  164.  
  165. Script 11 (void) //Countdown to RACE
  166. {
  167. int countdown;
  168.  
  169. //Countdown to bike.
  170. SetFont("BigFont");
  171. Delay(longDelay);
  172.  
  173. for (int i = 0; i < 10; i++)
  174. {
  175. countdown = 10 - i;
  176. HudmessageBold(s: "\cgYou have ", d:countdown, s:" seconds until the race starts!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 0.2);
  177. AmbientSound("hurp/derp", 127);
  178. Delay(35);
  179. }
  180.  
  181. HudmessageBold(s: "\cgThe race has started!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 0.2);
  182. Setmusic("CUTMUS");
  183. SetLineTexture(17,SIDE_FRONT,TEXTURE_MIDDLE,"-");
  184. SetLineTexture(17,SIDE_BACK,TEXTURE_MIDDLE,"-");
  185. SetLineBlocking(17,OFF);
  186. raceStarted = true;
  187. ACS_Execute(15,0);
  188. }
  189.  
  190. Script 12 (void) //Adds a value to the 'playerAmount' variable
  191. {
  192. if (playerAmount > 8)
  193. {
  194. playerAmount = 8;
  195.  
  196. HudmessageBold(s: "\chToo many racers!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 0.2);
  197. terminate;
  198. }
  199.  
  200. playerAmount++;
  201. }
  202. Script 13 (void) //Kills the losing player
  203. {
  204. /*
  205. if ((crossedLine + 1) == playerAmount)
  206. {
  207. Hudmessage(s: "You died."; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 0.2);
  208. crossedLine = 0;
  209. }*/
  210. }
  211. Script 14 (void) //Checks if someone passed the finish line
  212. {
  213. int laps = playerAmount - 1;
  214.  
  215. if (laps < 1)
  216. laps = 1;
  217.  
  218. Hudmessage(s: "Laps done: ", d:laps, s:""; 0, 1, 0, 0.5,0.5, 1);
  219. crossedLine++;
  220.  
  221. ACS_Execute(13,0);
  222. }
  223.  
  224. Script 15 (void) //Checks players for laps
  225. {
  226. int laptotal = 1;
  227. while (!raceFinished)
  228.  
  229. if (playerAmount == 1)
  230. {
  231. HudmessageBOLD(s: "Laps todo: Singleplayer"; 0, 2, 0, 0.5,0.4, 1);
  232. }
  233. else
  234. {
  235. HudmessageBOLD(s: "Laps todo: ", d:laptotal, s:""; 0, 2, 0, 0.5,0.4, 1);
  236. }
  237. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement