Advertisement
Guest User

Untitled

a guest
Jul 21st, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.44 KB | None | 0 0
  1. #include "zcommon.acs"
  2. //#include "jumpmaze_ranker_solo.acs"
  3.  
  4. #DEFINE shortDelay 35
  5. #DEFINE longDelay 70
  6. #DEFINE foreverDelay 9999*9999
  7.  
  8. int playerAmount = 0;
  9. int crossedLine = 0;
  10. int laptotal;
  11. int lapsArray [8];
  12.  
  13. bool playerArray [8];
  14. bool raceStarted = false;
  15. bool raceFinished = false;
  16.  
  17. ////////////////////////////////////////////////////////////////////////////////////////////////////// 1st Countdown
  18.  
  19. Script 01 (void)
  20. {
  21. int countdown;
  22.  
  23. //Countdown to bike.
  24. Delay(longDelay);
  25.  
  26. for (int i = 0; i < 10; i++)
  27. {
  28. countdown = 10 - i;
  29. SetFont("BigFont");
  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. SetFont("BigFont");
  35. HudmessageBold(s: "Access to wavebikes removed."; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 2.5);
  36. raceStarted = true;
  37. Delay(longDelay);
  38. ACS_Execute(11,0);
  39. }
  40.  
  41. Script 02 (void) //Count down canceller.
  42. {
  43. for (int i = 0; i < 7; i++)
  44. {
  45. Suspend;
  46. }
  47.  
  48. ACS_Terminate(1,0);
  49. SetFont("BigFont");
  50. HudmessageBold (s: "Wavebikes are all taken!!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 1.5);
  51. Delay(longDelay);
  52. ACS_Execute(11,0);
  53. }
  54.  
  55.  
  56. ////////////////////////////////////////////////////////////////////////////////////////////////////// Telepoter Scripts
  57.  
  58. Script 03 (void) //Teleport 1
  59. {
  60. if (raceStarted)
  61. terminate;
  62.  
  63. Teleport(21, 0, 0);
  64. ACS_Execute(2,0);
  65. GiveInventory("BoatActivate",1);
  66. ACS_Execute(12,0);
  67. Floor_LowerInstant(9,0,6);
  68. playerArray[0] = true;
  69. Delay(foreverDelay); //Forever.
  70. }
  71.  
  72. Script 04 (void) //Teleport 2
  73. {
  74. if (raceStarted)
  75. terminate;
  76.  
  77. Teleport(22, 0, 0);
  78. ACS_Execute(2,0);
  79. GiveInventory("BoatActivate",1);
  80. ACS_Execute(12,0);
  81. Floor_LowerInstant(10,0,6);
  82. playerArray[1] = true;
  83. Delay(foreverDelay); //Forever.
  84. }
  85.  
  86. Script 05 (void) //Teleport 3
  87. {
  88. if (raceStarted)
  89. terminate;
  90.  
  91. Teleport(23, 0, 0);
  92. ACS_Execute(2,0);
  93. GiveInventory("BoatActivate",1);
  94. ACS_Execute(12,0);
  95. Floor_LowerInstant(11,0,6);
  96. playerArray[2] = true;
  97. Delay(foreverDelay); //Forever.
  98. }
  99.  
  100. Script 06 (void) //Teleport 4
  101. {
  102. if (raceStarted)
  103. terminate;
  104.  
  105. Teleport(24, 0, 0);
  106. ACS_Execute(2,0);
  107. GiveInventory("BoatActivate",1);
  108. ACS_Execute(12,0);
  109. Floor_LowerInstant(12,0,6);
  110. playerArray[3] = true;
  111. Delay(foreverDelay); //Forever.
  112. }
  113.  
  114. Script 07 (void) //Teleport 5
  115. {
  116. if (raceStarted)
  117. terminate;
  118.  
  119. Teleport(25, 0, 0);
  120. ACS_Execute(2,0);
  121. GiveInventory("BoatActivate",1);
  122. ACS_Execute(12,0);
  123. Floor_LowerInstant(13,0,6);
  124. playerArray[4] = true;
  125. Delay(foreverDelay); //Forever.
  126. }
  127.  
  128. Script 08 (void) //Teleport 6
  129. {
  130. if (raceStarted)
  131. terminate;
  132.  
  133. Teleport(26, 0, 0);
  134. ACS_Execute(2,0);
  135. GiveInventory("BoatActivate",1);
  136. ACS_Execute(12,0);
  137. Floor_LowerInstant(14,0,6);
  138. playerArray[5] = true;
  139. Delay(foreverDelay); //Forever.
  140. }
  141.  
  142. Script 09 (void) //Teleport 7
  143. {
  144. if (raceStarted)
  145. terminate;
  146.  
  147. Teleport(27, 0, 0);
  148. ACS_Execute(2,0);
  149. GiveInventory("BoatActivate",1);
  150. ACS_Execute(12,0);
  151. Floor_LowerInstant(15,0,6);
  152. playerArray[6] = true;
  153. Delay(foreverDelay); //Forever.
  154. }
  155.  
  156. Script 10 (void) //Teleport 8
  157. {
  158. if (raceStarted)
  159. terminate;
  160.  
  161. Teleport(28, 0, 0);
  162. ACS_Execute(2,0);
  163. GiveInventory("BoatActivate",1);
  164. ACS_Execute(12,0);
  165. Floor_LowerInstant(16,0,6);
  166. playerArray[7] = true;
  167. Delay(foreverDelay); //Forever.
  168. }
  169.  
  170.  
  171. ////////////////////////////////////////////////////////////////////////////////////////////////////// Race scripts
  172.  
  173.  
  174. Script 11 (void) //Countdown to RACE
  175. {
  176. int countdown;
  177.  
  178. //Countdown to bike.
  179. TakeInventory("lapCheck", 10);
  180. Delay(longDelay);
  181.  
  182. for (int i = 0; i < 10; i++)
  183. {
  184. countdown = 10 - i;
  185. SetFont("BigFont");
  186. HudmessageBold(s: "\cgYou have ", d:countdown, s:" seconds until the race starts!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 0.2);
  187. AmbientSound("hurp/derp", 127);
  188. Delay(shortDelay);
  189. }
  190.  
  191. SetFont("BigFont");
  192.  
  193. if (playerAmount > 0)
  194. {
  195. HudmessageBold(s: "\cgThe race has started!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 2.0);
  196. ACS_Execute(471, 0);
  197. HudmessageBOLD(s: "Lap: /0 ";HUDMSG_PLAIN, 2, 0, 0.95, 1, 0); ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  198. }
  199. else
  200. {
  201. HudmessageBold(s: "\cgNo racers, switching to the next map."; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 2.0);
  202. Delay(35*3);
  203. Exit_Normal(0);
  204. }
  205.  
  206. Setmusic("CUTMUS");
  207. SetLineTexture(17,SIDE_FRONT,TEXTURE_MIDDLE,"-");
  208. SetLineTexture(17,SIDE_BACK,TEXTURE_MIDDLE,"-");
  209. SetLineBlocking(17,OFF);
  210. ACS_Execute(15,0);
  211. }
  212.  
  213. Script 12 (void) //Adds a value to the 'playerAmount' variable
  214. {
  215. if (playerAmount > 8)
  216. {
  217. playerAmount = 8;
  218. SetFont("BigFont");
  219. HudmessageBold(s: "\chToo many racers!"; HUDMSG_FADEOUT, 0, 13, 0.5, 0.25, 2.0);
  220. terminate;
  221. }
  222.  
  223. playerAmount++;
  224. }
  225.  
  226. Script 13 (void) //Derp
  227. {
  228. }
  229.  
  230. Script 14 (void) //Checks if someone passed the finish line
  231. {
  232. int laps;
  233.  
  234. for (int i = 0; i < 8; i++)
  235. {
  236. if (playerArray[i] == true)
  237. lapsArray[i]++;
  238.  
  239. if (lapsArray[i] > (GetCVAR("winlimit")))
  240. {
  241. RecordFinishedPlayer();
  242. raceFinished = true;
  243. }
  244. else
  245. {
  246. SetFont("SmallFont");
  247. Hudmessage(s: " ", d:lapsArray[i], s:" /";HUDMSG_PLAIN, 1, 0, 0.95, 1, 0);
  248. }
  249. }
  250.  
  251. ACS_Execute(13,0);
  252. }
  253.  
  254. Script 15 (void) //Checks players for laps
  255. {
  256. while (!raceFinished)
  257. {
  258. SetFont("SmallFont");
  259. HudmessageBOLD(s: "Lap: ", d:GetCVAR("winlimit"), s:"";HUDMSG_PLAIN, 2, 0, 0.95, 1, 0);
  260.  
  261. Delay(shortDelay);
  262. }
  263. }
  264.  
  265. Script 30 OPEN //Static scripts.
  266. {
  267. Sector_SetFriction(40, 45);
  268. }
  269. /*
  270. Script 31 OPEN
  271. {
  272. int i = 0;
  273.  
  274. while(i < 1)
  275. {
  276. if (playerAmount > PlayerCount())
  277. playerAmount = PlayerCount();
  278. }
  279. }
  280. */
  281.  
  282. Script 32 OPEN //Static scripts.
  283. {
  284. if (GetCVAR("SV_DisallowSuidice") == 0)
  285. ConsoleCommand("SV_DisallowSuicide 1");
  286.  
  287. if (GetCVAR("winlimit") == 0)
  288. ConsoleCommand("winlimit 3");
  289.  
  290. if (GetCVAR("winlimit") > 9)
  291. ConsoleCommand("winlimit 9");
  292. }
  293.  
  294.  
  295.  
  296. //DoomThroughDoom- This script it taken from Jumpmaze.
  297. //Instead of writing my own script to try and get the same result,
  298. //I've just taken it and modified it.
  299.  
  300.  
  301.  
  302. // Description:
  303. // Simple JumpMaze rank script, allowing the adjustement
  304. // of the number of players to rank and display.
  305. //
  306. // New in version 1.2:
  307. // -- Made the individual time as default for single
  308. // player.
  309. //
  310. // New in version 1.1:
  311. // -- Added individual time when all rank places
  312. // have been exhausted.
  313. //
  314. // Required files ( must be #included before usage ):
  315. // -- zcommon.acs
  316. //
  317. // USAGE:
  318. // To use the solo JumpMaze ranker, simply #include the
  319. // jumpmaze_ranker_solo.acs file and call the public
  320. // RecordFinishedPlayer() function when a player has
  321. // crossed the finish line. One can create a dummy script
  322. // that will be executed when the player crosses the
  323. // line, which in turn calls the above function.
  324. //
  325. // Author: DuNR1DA2 ( Positron )
  326. // Last modified: March 8, 2010
  327. //
  328. // Feel free to modify and distribute this script in any
  329. // way you like, but please keep this block of text.
  330.  
  331. // Script numbers used:
  332. // If these numbers are used elsewhere, just changed these
  333. // numbers to something that doesn't exist and the
  334. // rest will be adjusted.
  335.  
  336. #define SECONDS_IN_MINUTE 60
  337. #define MAX_PLAYERS 32
  338.  
  339. #define RANKER_SOLO_PLAYER_ENTER 481
  340. #define RANKER_SOLO_MAIN_LOOP 482
  341. #define RANKER_SOLO_PLAYER_COMPLETED 483
  342. #define RANKER_SOLO_PLAYER_GONE 484
  343.  
  344. // Time to wait before displaying the results in tics
  345. // when a player crosses the finish line.
  346. #define RANK_DISPLAY_DELAY_TIME 16
  347. // Update time, in seconds, that will be used
  348. // to check whether the rank limit was altered.
  349. #define RANK_LIMIT_CHECK_TIME 1
  350. // The refresh time, on the other hand, is the
  351. // time in seconds it takes to re-display the table.
  352. // This is needed if people who are ranked change
  353. // their name, to reflect the changes.
  354. // We set it to ten seconds for performance reasons.
  355. #define RANK_TABLE_REFRESH_TIME 10
  356.  
  357. #define DISCONNECTED_LABEL "Disconnected"
  358. #define DISCONNECTED_LABEL_COLOR "g" // Red
  359.  
  360. #define RANK_LIMIT_CVAR "rank_limit"
  361. #define RANK_LIMIT_MIN 3
  362. #define RANK_LIMIT_MAX 8
  363. #define RANK_TABLE_X 250
  364. // The offset is used to prevent ID conflicts
  365. // in HudMessages from other scripts.
  366. #define RANK_ID_OFFSET 233
  367.  
  368. // This variable will store the amount of players to dispaly.
  369. int rank_limit = RANK_LIMIT_MAX;
  370. int rank_colors[ 8 ] = {
  371. "f", // Gold
  372. "j", // Silver
  373. "e", // Brown
  374. "d", // Green
  375. "n", // Light Blue
  376. "t", // Purple
  377. "u", // Gray
  378. "m", // Black
  379. };
  380.  
  381. #define RANK_TABLE_Y 45100
  382. #define RANK_PLACE_HEIGHT 2900
  383.  
  384. #define PLAYER_DISCONNECTED -1
  385. #define PLAYER_NOT_FINISHED -1
  386.  
  387. // Ranked player properties:
  388. #define IDX_NUM 0
  389. #define IDX_MINUTES 1
  390. #define IDX_SECONDS 2
  391.  
  392. int players[ RANK_LIMIT_MAX ][ 8 ];
  393. int players_ranked = 0;
  394. int players_displayed[ MAX_PLAYERS ];
  395. bool rank_is_single_player = false;
  396. bool is_single_player_finished = false;
  397.  
  398. // Public functions ( To be used by the user ):
  399. // ==========================================================
  400.  
  401. function void RecordFinishedPlayer( void ) {
  402. int player = playerNumber();
  403. if ( player >= 0 ) {
  404. if ( rank_is_single_player ) {
  405. if ( ! is_single_player_finished ) {
  406. is_single_player_finished = true;
  407. DisplayIndividualTime();
  408. }
  409. }
  410. // Multiplayer:
  411. else {
  412. // To solve the issue with duplicate scripts executing for
  413. // a single player when the player crosses a vertex that
  414. // connects to action linedefs, I decided to check whether
  415. // the player has finished earlier.
  416. if ( ! IsPlayerFinished( player ) ) {
  417. RememberFinishedPlayer( player );
  418. acs_ExecuteAlways( RANKER_SOLO_PLAYER_COMPLETED, 0, player );
  419. }
  420. }
  421. }
  422. }
  423.  
  424. // ==========================================================
  425.  
  426. script RANKER_SOLO_PLAYER_ENTER ENTER {
  427. if ( ! rank_is_single_player ) {
  428. DrawScoreTable();
  429. }
  430.  
  431. ClearIndividualTime();
  432. }
  433.  
  434. script RANKER_SOLO_MAIN_LOOP OPEN {
  435. // We don't need this loop in single player.
  436. if ( gameType() == GAME_SINGLE_PLAYER ) {
  437. rank_is_single_player = true;
  438. terminate;
  439. }
  440.  
  441. int time = 0;
  442. int check_time = shortDelay * RANK_LIMIT_CHECK_TIME;
  443.  
  444. while ( true ) {
  445. int limit = getCvar( RANK_LIMIT_CVAR );
  446. if ( limit != rank_limit ) {
  447. if ( limit >= RANK_LIMIT_MIN && limit <= rank_LIMIT_MAX ) {
  448. ClearTable();
  449. rank_limit = limit;
  450. DrawScoreTable();
  451. }
  452. }
  453.  
  454. if ( time % RANK_TABLE_REFRESH_TIME == 0 ) {
  455. DrawScoreTable();
  456. }
  457.  
  458. time += 1;
  459. delay( check_time );
  460. }
  461. }
  462.  
  463. script RANKER_SOLO_PLAYER_COMPLETED ( int player ) {
  464. // We first see if we can rank the player in the
  465. // score table.
  466. if ( FreeSpotAvailable() ) {
  467. RankFinishedPlayerInTable( player );
  468. // We only re-display the table if we haven't gone
  469. // over the limit. Otherwise, it has no effect.
  470. if ( players_ranked <= rank_limit ) {
  471. // To try and replicate the old script's delayed effect,
  472. // I've added a delay here. This will take some time
  473. // before finally displaying the results. Notice that
  474. // this won't affect the player's finish time, because
  475. // that is recorded in the above function.
  476. delay( RANK_DISPLAY_DELAY_TIME );
  477. DrawScoreTable();
  478. }
  479. // We display the individual time for the player if
  480. // we went over the rank display limit, even if we have
  481. // places still available in the rank table.
  482. else {
  483. DisplayIndividualTime();
  484. }
  485. }
  486. // If no more places remain in the score table, then
  487. // we just display the completion time to the player so
  488. // they can see the their individual time for the run.
  489. else {
  490. DisplayIndividualTime();
  491. }
  492. }
  493.  
  494. function void ClearIndividualTime( void ) {
  495. ClearMessage( RANK_ID_OFFSET + RANK_LIMIT_MAX );
  496. }
  497.  
  498. function void RememberFinishedPlayer( int player ) {
  499. players_displayed[ player ] = true;
  500. }
  501.  
  502. function void ForgetFinishedPlayer( int player ) {
  503. players_displayed[ player ] = false;
  504. }
  505.  
  506. function bool IsPlayerFinished( int player ) {
  507. return players_displayed[ player ];
  508. }
  509.  
  510. function bool FreeSpotAvailable( void ) {
  511. if ( players_ranked < RANK_LIMIT_MAX ) {
  512. return true;
  513. }
  514.  
  515. return false;
  516. }
  517.  
  518. function int GetPosition( int playerNum ) {
  519. for ( int place = 0; place < players_ranked; place++ ) {
  520. if ( players[ place ][ IDX_NUM ] == playerNum ) {
  521. return place;
  522. }
  523. }
  524.  
  525. return PLAYER_NOT_FINISHED;
  526. }
  527.  
  528. function void RankFinishedPlayerInTable( int playerNum ) {
  529. players[ players_ranked ][ IDX_NUM ] = playerNum;
  530.  
  531. int time = timer() / shortDelay;
  532. players[ players_ranked ][ IDX_MINUTES ] =
  533. time / SECONDS_IN_MINUTE;
  534. players[ players_ranked ][ IDX_SECONDS ] =
  535. time % SECONDS_IN_MINUTE;
  536.  
  537. players_ranked += 1;
  538. }
  539.  
  540. script RANKER_SOLO_PLAYER_GONE ( int player ) DISCONNECT {
  541. if ( IsPlayerFinished( player ) ) {
  542. // Free up the player number for potential players.
  543. ForgetFinishedPlayer( player );
  544. // We need to remove the player from the rank table if
  545. // the player was ever in it:
  546. if ( IsPlayerInRankTable( player ) ) {
  547. RemovePlayerFromRankTable( player );
  548. delay( RANK_DISPLAY_DELAY_TIME );
  549. DrawScoreTable();
  550. }
  551. }
  552. }
  553.  
  554. function bool IsPlayerInRankTable( int player ) {
  555. if ( GetPosition( player ) != PLAYER_NOT_FINISHED ) {
  556. return true;
  557. }
  558.  
  559. return false;
  560. }
  561.  
  562. function void RemovePlayerFromRankTable( int player ) {
  563. int position = GetPosition( player );
  564. // We indicate that a player has disconnected by
  565. // removing the player's number with a predefined value.
  566. players[ position ][ IDX_NUM ] = PLAYER_DISCONNECTED;
  567. }
  568.  
  569. // Drawing functions.
  570. // ==========================================================
  571.  
  572. function void DrawScoreTable( void ) {
  573. // We need to set the font to small. Otherwise,
  574. // the font will vary at different times.
  575. setFont( "SMALLFONT" );
  576.  
  577. // Determine the starting height of the table based
  578. // on the current rank limit.
  579. int rank_height = RANK_TABLE_Y +
  580. ( ( RANK_LIMIT_MAX - rank_limit ) * RANK_PLACE_HEIGHT );
  581.  
  582. // Determine the amount of iterations to loop.
  583. int places_to_display = players_ranked;
  584. if ( places_to_display > rank_limit ) {
  585. places_to_display = rank_limit;
  586. }
  587.  
  588. for ( int place = 0; place < places_to_display; place++ ) {
  589. int player = players[ place ][ IDX_NUM ];
  590. str ordinal_suffix = OrdinalSuffix( place + 1 );
  591.  
  592. int minutes = players[ place ][ IDX_MINUTES ];
  593. str minutes_prefix = DigitPrefix( minutes );
  594. int seconds = players[ place ][ IDX_SECONDS ];
  595. str seconds_prefix = DigitPrefix( seconds );
  596.  
  597. if ( player != PLAYER_DISCONNECTED ) {
  598. hudMessageBold(
  599. s : "\c", s : rank_colors[ place ],
  600. i : place + 1, s : ordinal_suffix, s : ":\c- ",
  601. n : player + 1,
  602. s : "\n\ciTime: ",
  603. s : minutes_prefix, i : minutes,
  604. s : ":",
  605. s : seconds_prefix, i : seconds,
  606. s : "\c-" ;
  607. HUDMSG_PLAIN, RANK_ID_OFFSET + place, 0,
  608. RANK_TABLE_X, rank_height, 0
  609. );
  610. }
  611. else {
  612. hudMessageBold(
  613. s : "\c", s : rank_colors[ place ],
  614. i : place + 1, s : ordinal_suffix, s : ": \c",
  615. s : DISCONNECTED_LABEL_COLOR,
  616. s : DISCONNECTED_LABEL,
  617. s : "\n\ciTime: ",
  618. s : minutes_prefix, i : minutes,
  619. s : ":",
  620. s : seconds_prefix, i : seconds,
  621. s : "\c-" ;
  622. HUDMSG_PLAIN, RANK_ID_OFFSET + place, 0,
  623. RANK_TABLE_X, rank_height, 0
  624. );
  625. }
  626.  
  627. rank_height += RANK_PLACE_HEIGHT;
  628. }
  629. }
  630.  
  631. function void ClearTable( void ) {
  632. for ( int place = 0; place < rank_limit; place++ ) {
  633. // We clear the previous rendition by using the same
  634. // message ID, but this time, using a blank string.
  635. ClearMessageBold( RANK_ID_OFFSET + place );
  636. }
  637. }
  638.  
  639. function void DisplayIndividualTime( void ) {
  640. setFont( "SMALLFONT" );
  641.  
  642. // Calculate the individual time to display:
  643. int time = timer() / shortDelay;
  644. int minutes = time / SECONDS_IN_MINUTE;
  645. int seconds = time % SECONDS_IN_MINUTE;
  646.  
  647. hudMessage(
  648. s : "\cuTime: \cc",
  649. s : DigitPrefix( minutes ), i : minutes,
  650. s : ":",
  651. s : DigitPrefix( seconds ), i : seconds,
  652. s : "\c-" ;
  653. HUDMSG_PLAIN, RANK_ID_OFFSET + RANK_LIMIT_MAX, 0, RANK_TABLE_X,
  654. RANK_TABLE_Y + ( RANK_PLACE_HEIGHT * RANK_LIMIT_MAX ), 0
  655. );
  656. }
  657.  
  658. // Utility functions ( Can be used in other scripts. )
  659. // ==========================================================
  660.  
  661. function str DigitPrefix( int digit ) {
  662. if ( digit >= 0 && digit <= 9 ) {
  663. return "0";
  664. }
  665.  
  666. return "";
  667. }
  668.  
  669. function str OrdinalSuffix( int value ) {
  670. if ( value == 11 || value == 12 || value == 13 ) {
  671. return "th";
  672. }
  673.  
  674. switch ( value % 10 ) {
  675. case 1: return "st";
  676. case 2: return "nd";
  677. case 3: return "rd";
  678. case 4: return "th";
  679. }
  680.  
  681. return "th";
  682. }
  683.  
  684. // Handy functions to clear messages from the screen.
  685. function void ClearMessage( int messageId ) {
  686. hudMessage(
  687. s : "" ;
  688. HUDMSG_PLAIN, messageId, 0, 0, 0, 0
  689. );
  690. }
  691.  
  692. function void ClearMessageBold( int messageId ) {
  693. hudMessageBold(
  694. s : "" ;
  695. HUDMSG_PLAIN, messageId, 0, 0, 0, 0
  696. );
  697. }
  698.  
  699.  
  700. // Timer and Par time:
  701. #define TIME_COLOR_TIMER CR_YELLOW
  702.  
  703. script 471 (void)
  704. {
  705. int raceTime;
  706.  
  707. while ( TRUE )
  708. {
  709. raceTime = timer() / shortDelay;
  710.  
  711. SetFont( "SMALLFONT" );
  712. HudMessage(
  713. d : raceTime / SECONDS_IN_MINUTE,
  714. s : " : ",
  715. d : ( raceTime % SECONDS_IN_MINUTE ) / 10,
  716. s : " ", d : raceTime % 10 ;
  717. HUDMSG_PLAIN, 434, TIME_COLOR_TIMER, 0.95, 0.95, 2.0
  718. );
  719.  
  720. delay( shortDelay );
  721. }
  722. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement