milanosie

Countdown.inc

Jun 9th, 2012
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. //=======Simple Countdown by Milan_Huizen/Milanosie====//
  2.  
  3. new countdownam;
  4. public OnGameModeInit()
  5. {
  6. countdownam = -1;
  7. }
  8.  
  9. forward countdownf();
  10. stock countdownf()
  11. {
  12. foreach(Player, i)
  13. {
  14. SetTimerEx("countdown_lower", 1100, false, "i", i);
  15. }
  16. return 1;
  17. }
  18.  
  19.  
  20.  
  21. forward countdown_lower(playerid);
  22. public countdown_lower(playerid)
  23. {
  24. new str[128];
  25. if(countdownam > 5)
  26. {
  27. format(str,sizeof(str),"%d",countdownam);
  28. GameTextForPlayer(playerid, str, 1000, 3);
  29. }
  30. if(countdownam == 5)
  31. {
  32. format(str,sizeof(str),"~r~%d",countdownam);
  33. GameTextForPlayer(playerid, str, 1000, 3);
  34. PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
  35. }
  36. if(countdownam == 4)
  37. {
  38. format(str,sizeof(str),"~b~%d",countdownam);
  39. GameTextForPlayer(playerid, str, 1000, 3);
  40. PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
  41. }
  42. if(countdownam == 3)
  43. {
  44. format(str,sizeof(str),"~y~%d",countdownam);
  45. GameTextForPlayer(playerid, str, 1000, 3);
  46. PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
  47. }
  48. if(countdownam == 2)
  49. {
  50. format(str,sizeof(str),"~g~%d",countdownam);
  51. GameTextForPlayer(playerid, str, 1000, 3);
  52. PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
  53. }
  54. if(countdownam == 1)
  55. {
  56. format(str,sizeof(str),"~r~%d",countdownam);
  57. GameTextForPlayer(playerid, str, 1000, 3);
  58. PlayerPlaySound(playerid,1056,0.0,0.0,0.0);
  59. }
  60. if(countdownam == 0)
  61. {
  62. format(str,sizeof(str),"~r~G~b~O",countdownam);
  63. GameTextForPlayer(playerid, str, 1000, 3);
  64. PlayerPlaySound(playerid,1057,0.0,0.0,0.0);
  65. }
  66. if(countdownam != -1)
  67. {
  68. countdownam--;
  69. foreach(Player, i)
  70. {
  71. SetTimerEx("countdown_lower", 1100, false, "i", playerid);
  72. }
  73. }
  74. return 1;
  75. }
Advertisement
Add Comment
Please, Sign In to add comment