Advertisement
Guest User

HomerJay

a guest
Jul 27th, 2008
1,432
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.10 KB | None | 0 0
  1. /*
  2. .:: Homer's REAL Clock 1.2 ::.
  3. .:: All Rights Reserved ::.
  4. .:: PAWNTeam� 2008 ::.
  5. */
  6.  
  7. #include <a_samp>
  8.  
  9. new Text:HClock;
  10. new Text:HClock2;
  11. new Text:HClock3;
  12. new TimeTimer;
  13.  
  14. forward TimeUpdate();
  15.  
  16. public OnFilterScriptInit()
  17. {
  18. print("\n--------------------------------------");
  19. print(" Homer's REAL Clock 1.2 - PAWNTeam 2008");
  20. print("--------------------------------------\n");
  21.  
  22. TimeTimer = SetTimer("TimeUpdate",1000,1);
  23.  
  24. HClock = TextDrawCreate(547, 40, "--:--");
  25. TextDrawLetterSize(HClock, 0.5, 1.5);
  26. TextDrawFont(HClock, 2);
  27. TextDrawSetShadow(HClock, 2);
  28. TextDrawSetOutline(HClock,2);
  29.  
  30. HClock2 = TextDrawCreate(607, 40, "--");
  31. TextDrawLetterSize(HClock2, 0.4, 1.1);
  32. TextDrawFont(HClock2, 2);
  33. TextDrawSetShadow(HClock2, 2);
  34. TextDrawSetOutline(HClock2,2);
  35.  
  36. HClock3 = TextDrawCreate(520, 105, "--/--/----");
  37. TextDrawLetterSize(HClock3, 0.4, 1.1);
  38. TextDrawFont(HClock3, 2);
  39. TextDrawSetShadow(HClock3, 2);
  40. TextDrawSetOutline(HClock3,2);
  41. return 1;
  42. }
  43.  
  44. public OnFilterScriptExit()
  45. {
  46. KillTimer(TimeTimer);
  47. TextDrawDestroy(HClock);
  48. TextDrawDestroy(HClock2);
  49. TextDrawDestroy(HClock3);
  50. return 1;
  51. }
  52.  
  53. public TimeUpdate()
  54. {
  55. new Hour, Min, Sec, Day, Month, Year;
  56. new TimeString[256], TimeString2[256], TimeString3[256];
  57. gettime(Hour, Min, Sec);
  58. getdate(Year, Month, Day);
  59. if(Min <= 9)
  60. {
  61. format(TimeString,25,"%d:0%d",Hour, Min);
  62. }else{
  63. format(TimeString,25,"%d:%d",Hour, Min);
  64. }
  65. if(Sec <= 9)
  66. {
  67. format(TimeString2,25,"0%d", Sec);
  68. }else{
  69. format(TimeString2,25,"%d", Sec);
  70. }
  71. if(Day <= 9)
  72. {
  73. format(TimeString3,25,"0%d/%d/%d", Day, Month, Year);
  74. }else{
  75. format(TimeString3,25,"%d/%d/%d", Day, Month, Year);
  76. }
  77. TextDrawSetString(HClock,TimeString);
  78. TextDrawShowForAll(HClock);
  79. TextDrawSetString(HClock2,TimeString2);
  80. TextDrawShowForAll(HClock2);
  81. TextDrawSetString(HClock3,TimeString3);
  82. TextDrawShowForAll(HClock3);
  83. return 1;
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement