Advertisement
Guest User

Untitled

a guest
May 18th, 2014
458
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. /*
  2. _______
  3. | | | |__ __ __ _ _ __ __ _
  4. | |_| |\ \ /\ / // _` || `_ \ / _` |
  5. | _ | \ V V /| (_| || | | || (_| |
  6. |_| |_| \_/\_/ \__,_||_| |_| \__, |
  7. |___/
  8. PAWN Systems
  9.  
  10. */
  11.  
  12. new Time, TimeM, TimeS;
  13. new Text:Textdraw0;
  14. new Text:Textdraw1;
  15.  
  16. forward TimeShow(playerid);
  17. forward OnTimeOut();
  18.  
  19. public TimeShow(playerid)
  20. {
  21. TextDrawShowForPlayer(playerid, Textdraw0),TextDrawShowForPlayer(playerid, Textdraw1);
  22. return 1;
  23. }
  24.  
  25. stock TimeINIT(time)
  26. {
  27. Textdraw0 = TextDrawCreate(210.000000, 389.000000, "-");
  28. TextDrawBackgroundColor(Textdraw0, 300);
  29. TextDrawFont(Textdraw0, 1);
  30. TextDrawLetterSize(Textdraw0, 16.120025, 8.099998);
  31. TextDrawColor(Textdraw0, 50);
  32. TextDrawSetOutline(Textdraw0, 0);
  33. TextDrawSetProportional(Textdraw0, 1);
  34. TextDrawSetShadow(Textdraw0, 1);
  35. TextDrawSetSelectable(Textdraw0, 0);
  36. Textdraw1 = TextDrawCreate(306.000000, 432.000000, "00:00");
  37. TextDrawBackgroundColor(Textdraw1, 100);
  38. TextDrawFont(Textdraw1, 1);
  39. TextDrawLetterSize(Textdraw1, 0.360000, 0.799999);
  40. TextDrawColor(Textdraw1, -1);
  41. TextDrawSetOutline(Textdraw1, 0);
  42. TextDrawSetProportional(Textdraw1, 1);
  43. TextDrawSetShadow(Textdraw1, 1);
  44. TimeS = 0;
  45. Time = SetTimer("UpdateTime", 1000, true);
  46. TimeM = time;
  47. return 1;
  48. }
  49.  
  50. forward UpdateTime();
  51. public UpdateTime()
  52. {
  53. new Str[34];
  54. TimeS --;
  55. if(TimeM == 0 && TimeS == 0)
  56. {
  57. KillTimer(Time);
  58. OnTimeOut();
  59. }
  60. if(TimeS == -1)
  61. {
  62. TimeM--;
  63. TimeS = 59;
  64. }
  65. format(Str, sizeof(Str), "%02d:%02d", TimeM, TimeS);
  66. TextDrawSetString(Textdraw1, Str);
  67. return 1;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement