Guest User

TheChoosenOne

a guest
Jan 13th, 2009
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. #include <a_samp>
  2. #define FILTERSCRIPT
  3.  
  4. new Text:RealClock,Timer;
  5.  
  6. public OnFilterScriptInit()
  7. {
  8. print("-----------------------------------------");
  9. print("Clock by TheChoosenOne");
  10. print("-----------------------------------------");
  11.  
  12. RealClock = TextDrawCreate(547.000000,22.000000," ");
  13. TextDrawAlignment(RealClock,0);
  14. TextDrawBackgroundColor(RealClock,0x000000ff);
  15. TextDrawFont(RealClock,3);
  16. TextDrawLetterSize(RealClock,0.599999,2.299999);
  17. TextDrawColor(RealClock,0xffffffff);
  18. TextDrawSetOutline(RealClock,1);
  19. TextDrawSetProportional(RealClock,1);
  20. TextDrawSetShadow(RealClock,10);
  21. Timer = SetTimer("UpdateClock",300,1);
  22. return 1;
  23. }
  24.  
  25. public OnFilterScriptExit()
  26. {
  27. KillTimer(Timer);
  28. TextDrawHideForAll(RealClock);
  29. TextDrawDestroy(RealClock);
  30. return 1;
  31. }
  32.  
  33. forward UpdateClock();
  34. public UpdateClock()
  35. {
  36. new Hour,Minute,Sec,String[256];
  37. gettime(Hour,Minute,Sec);
  38. if(Hour<9 && Minute<9){format(String,sizeof(String),"0%d:0%d",Hour,Minute);}
  39. else if(Hour>9 && Minute<9){format(String,sizeof(String),"%d:0%d",Hour,Minute);}
  40. else if(Hour<9 && Minute>9){format(String,sizeof(String),"0%d:%d",Hour,Minute);}
  41. else{format(String,sizeof(String),"%d:%d",Hour,Minute);}
  42. TextDrawSetString(RealClock,String);
  43. SetWorldTime(Hour);
  44. return 1;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment