Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. forward Race::StartRace();
  2. public Race::StartRace()
  3. {
  4. foreach(Player, i)
  5. {
  6. if(Race::IsPlayerInRace(i))
  7. {
  8. new tString[128];
  9.  
  10. format(tString, sizeof(tString), "~r~RACE (%s): %s is starting,~n~~w~ good luck and have fun!", Race::GetRaceTypeName(), RaceData[RaceName]);
  11. TextDraw::ShowSubtitle(i, tString, 3000, true);
  12.  
  13. TogglePlayerControllable(i, 0);
  14. SetCameraBehindPlayer(i);
  15. }
  16. }
  17. RaceTimer = SetTimer("c26CountdownRace", 1000, 1);
  18. return 1;
  19. }
  20.  
  21. forward Race::CountdownRace();
  22. public Race::CountdownRace()
  23. {
  24. foreach(Player, i)
  25. {
  26. if(Race::IsPlayerInRace(i))
  27. {
  28. if(CountDown == 11)
  29. {
  30. DisablePlayerRaceCheckpoint(i);
  31. GameTextForPlayer(i, "~w~10", 600, 4);
  32. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  33. }
  34. else if(CountDown == 10)
  35. {
  36. GameTextForPlayer(i, "~w~9", 600, 4);
  37. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  38. }
  39. else if(CountDown == 9)
  40. {
  41. GameTextForPlayer(i, "~w~8", 600, 4);
  42. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  43. }
  44. else if(CountDown == 8)
  45. {
  46. GameTextForPlayer(i, "~w~7", 600, 4);
  47. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  48. }
  49. else if(CountDown == 7)
  50. {
  51. GameTextForPlayer(i, "~w~6", 600, 4);
  52. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  53. }
  54. else if(CountDown == 6)
  55. {
  56. GameTextForPlayer(i, "~w~5", 600, 4);
  57. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  58. }
  59. else if(CountDown == 5)
  60. {
  61. GameTextForPlayer(i, "~w~4", 600, 4);
  62. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  63. }
  64. else if(CountDown == 4)
  65. {
  66. GameTextForPlayer(i, "~r~3", 600, 4);
  67. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  68. }
  69. else if(CountDown == 3)
  70. {
  71. GameTextForPlayer(i, "~y~2", 600, 4);
  72. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  73. }
  74. else if(CountDown == 2)
  75. {
  76. GameTextForPlayer(i, "~y~1", 600, 4);
  77. PlayerPlaySound(i, 1056, 0.0, 0.0, 0.0);
  78. }
  79. else if(CountDown == 1)
  80. {
  81. GameTextForPlayer(i, "~g~~h~GO! GO! GO!", 1200, 4);
  82.  
  83. PlayerPlaySound(i, 1057, 0.0, 0.0, 0.0);
  84. SetPlayerRaceCheckpoint(i, 0, RaceData[RACE_X][1], RaceData[RACE_Y][1], RaceData[RACE_Z][1], RaceData[RACE_X][2], RaceData[RACE_Y][2], RaceData[RACE_Z][2], RACE_CHECKPOINT_SIZE);
  85. TogglePlayerControllable(i, 1);
  86.  
  87. Race::SetRacePosition(i, 1);
  88. Race::SetRaceProgression(i, 2);
  89.  
  90. KillTimer(RaceTimer);
  91.  
  92. CountDown = 11;
  93. RaceStarted = 1;
  94. }
  95. }
  96. }
  97. CountDown --;
  98. return 1;
  99. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement