Advertisement
Guest User

V-Count by -Viper- ENGLISH

a guest
Oct 25th, 2011
365
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Countdown, countdowntimer, CountdownStart;
  4. new Text:Sprite0, Text:Sprite1, Text:Sprite2, Text:Sprite3, Text:Sprite4, Text:Sprite5, Text:Sprite6, Text:Sprite7, Text:Sprite8;
  5.  
  6. forward OnCountdownStart();
  7.  
  8. public OnFilterScriptInit()
  9. {
  10. print("\n--------------------------------------");
  11. print(" V-Race Countdown loaded...");
  12. print("--------------------------------------\n");
  13.  
  14. Sprite0 = TextDrawCreate(430.000, 10.000, "LD_ROUL:roulbla");
  15. TextDrawFont(Sprite0, 4);
  16. TextDrawTextSize(Sprite0, 59.500, 79.000);
  17. TextDrawColor(Sprite0, -1);
  18.  
  19. Sprite1 = TextDrawCreate(430.000, 68.500, "LD_ROUL:roulbla");
  20. TextDrawFont(Sprite1, 4);
  21. TextDrawTextSize(Sprite1, 59.500, 79.000);
  22. TextDrawColor(Sprite1, -1);
  23.  
  24. Sprite2 = TextDrawCreate(430.000, 127.000, "LD_ROUL:roulbla");
  25. TextDrawFont(Sprite2, 4);
  26. TextDrawTextSize(Sprite2, 59.500, 79.000);
  27. TextDrawColor(Sprite2, -1);
  28.  
  29. Sprite3 = TextDrawCreate(430.000, 10.000, "LD_ROUL:roulred");
  30. TextDrawFont(Sprite3, 4);
  31. TextDrawTextSize(Sprite3, 59.500, 79.000);
  32. TextDrawColor(Sprite3, -1);
  33.  
  34. Sprite4 = TextDrawCreate(430.000, 68.500, "LD_ROUL:roulred");
  35. TextDrawFont(Sprite4, 4);
  36. TextDrawTextSize(Sprite4, 59.500, 79.000);
  37. TextDrawColor(Sprite4, -1);
  38.  
  39. Sprite5 = TextDrawCreate(430.000, 127.000, "LD_ROUL:roulred");
  40. TextDrawFont(Sprite5, 4);
  41. TextDrawTextSize(Sprite5, 59.500, 79.000);
  42. TextDrawColor(Sprite5, -1);
  43.  
  44. Sprite6 = TextDrawCreate(430.000, 10.000, "LD_ROUL:roulgre");
  45. TextDrawFont(Sprite6, 4);
  46. TextDrawTextSize(Sprite6, 59.500, 79.000);
  47. TextDrawColor(Sprite6, -1);
  48.  
  49. Sprite7 = TextDrawCreate(430.000, 68.500, "LD_ROUL:roulgre");
  50. TextDrawFont(Sprite7, 4);
  51. TextDrawTextSize(Sprite7, 59.500, 79.000);
  52. TextDrawColor(Sprite7, -1);
  53.  
  54. Sprite8 = TextDrawCreate(430.000, 127.000, "LD_ROUL:roulgre");
  55. TextDrawFont(Sprite8, 4);
  56. TextDrawTextSize(Sprite8, 59.500, 79.000);
  57. TextDrawColor(Sprite8, -1);
  58. return 1;
  59. }
  60.  
  61. public OnFilterScriptExit()
  62. {
  63. TextDrawHideForAll(Sprite0);
  64. TextDrawDestroy(Sprite0);
  65. TextDrawHideForAll(Sprite1);
  66. TextDrawDestroy(Sprite1);
  67. TextDrawHideForAll(Sprite2);
  68. TextDrawDestroy(Sprite2);
  69. TextDrawHideForAll(Sprite3);
  70. TextDrawDestroy(Sprite3);
  71. TextDrawHideForAll(Sprite4);
  72. TextDrawDestroy(Sprite4);
  73. TextDrawHideForAll(Sprite5);
  74. TextDrawDestroy(Sprite5);
  75. TextDrawHideForAll(Sprite6);
  76. TextDrawDestroy(Sprite6);
  77. TextDrawHideForAll(Sprite7);
  78. TextDrawDestroy(Sprite7);
  79. TextDrawHideForAll(Sprite8);
  80. TextDrawDestroy(Sprite8);
  81. Countdown = 0;
  82. CountdownStart = 0;
  83. KillTimer(countdowntimer);
  84. return 1;
  85. }
  86.  
  87. public OnPlayerCommandText(playerid, cmdtext[])
  88. {
  89. if (strcmp("/vcountdown", cmdtext, true, 10) == 0)
  90. {
  91. if(CountdownStart == 0)
  92. {
  93. new string[128], pname[24];
  94. GetPlayerName(playerid, pname, sizeof(pname));
  95. format(string, sizeof(string), "*%s has start a Countdown!", pname);
  96. SendClientMessageToAll(0xFFFFFFFF, string);
  97. countdowntimer = SetTimer("OnCountdownStart", 1000, true);
  98. CountdownStart = 1;
  99. Countdown = 6;
  100. }
  101. else if(CountdownStart == 1)
  102. {
  103. SendClientMessage(playerid, 0xFFFFFFFF, "Its already startet a Countdown please Wait!");
  104. }
  105. return 1;
  106. }
  107. return 0;
  108. }
  109.  
  110. public OnCountdownStart()
  111. {
  112. if(Countdown == 6)
  113. {
  114. TextDrawShowForAll(Sprite0); //Blank
  115. TextDrawShowForAll(Sprite1); //Blank
  116. TextDrawShowForAll(Sprite2); //Blank
  117. Countdown = 5;
  118. }
  119. else if(Countdown == 5)
  120. {
  121. TextDrawShowForAll(Sprite3); //Red
  122. Countdown = 4;
  123. for (new i = 0; i < MAX_PLAYERS; i++)
  124. {
  125. PlayerPlaySound(i, 1056, 0, 0, 0);
  126. }
  127. }
  128. else if(Countdown == 4)
  129. {
  130. TextDrawShowForAll(Sprite4); //Red
  131. Countdown = 3;
  132. for (new i = 0; i < MAX_PLAYERS; i++)
  133. {
  134. PlayerPlaySound(i, 1056, 0, 0, 0);
  135. }
  136. }
  137. else if(Countdown == 3)
  138. {
  139. TextDrawShowForAll(Sprite5); //Red
  140. Countdown = 2;
  141. for (new i = 0; i < MAX_PLAYERS; i++)
  142. {
  143. PlayerPlaySound(i, 1056, 0, 0, 0);
  144. }
  145. }
  146. else if(Countdown == 2)
  147. {
  148. TextDrawShowForAll(Sprite6); //Green
  149. TextDrawShowForAll(Sprite7); //Green
  150. TextDrawShowForAll(Sprite8); //Green
  151. Countdown = 1;
  152. for (new i = 0; i < MAX_PLAYERS; i++)
  153. {
  154. PlayerPlaySound(i, 1057, 0, 0, 0);
  155. }
  156. }
  157. else if(Countdown == 1)
  158. {
  159. TextDrawHideForAll(Sprite0);
  160. TextDrawHideForAll(Sprite1);
  161. TextDrawHideForAll(Sprite2);
  162. TextDrawHideForAll(Sprite3);
  163. TextDrawHideForAll(Sprite4);
  164. TextDrawHideForAll(Sprite5);
  165. TextDrawHideForAll(Sprite6);
  166. TextDrawHideForAll(Sprite7);
  167. TextDrawHideForAll(Sprite8);
  168. CountdownStart = 0;
  169. KillTimer(countdowntimer);
  170. }
  171. return 1;
  172. }
  173.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement