KrisnaPradnya

Time Textdraw

Jul 7th, 2013
695
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 3.16 KB | None | 0 0
  1. /*
  2. Krisna Clock Textdraw:
  3. Credits
  4. [~]Zhamaroth TextDraw Editor
  5. [~]Shadow for filterscript World Clock
  6. [~]Krisna Pradnya edit Filterscript
  7. [~]SAMP Team
  8.  
  9. Thanks~
  10. visit our Facebook www.facebook.com/krisna.pradnya
  11.  
  12. +REP me please :D
  13.  
  14. [DO NOT REMOVE MY CREDITS]
  15. */
  16.  
  17.  
  18. #include <a_samp>
  19. #define FILTERSCRIPT
  20.  
  21. new Text:Time, Text:Date;
  22. new Text:Textdraw2;
  23. forward settime(playerid);
  24.  
  25. public OnFilterScriptInit()
  26. {
  27.     print("+--------------------------------------------------+");
  28.     print("| REALTIME CLOCK AND NEW TEXTDRAW BY KRISNA LOADED |");
  29.     print("+--------------------------------------------------+");
  30.  
  31.     SetTimer("settime",1000,true);
  32.  
  33.     Date = TextDrawCreate(566.000000, 137.000000,"     ");
  34.  
  35.     TextDrawAlignment(Date, 2);
  36.     TextDrawBackgroundColor(Date, 255);
  37.     TextDrawFont(Date, 3);
  38.     TextDrawLetterSize(Date, 0.519999, 1.500000);
  39.     TextDrawColor(Date, -1);
  40.     TextDrawSetOutline(Date, 0);
  41.     TextDrawSetProportional(Date, 1);
  42.     TextDrawSetShadow(Date, 1);
  43.     TextDrawUseBox(Date, 1);
  44.     TextDrawBoxColor(Date, 69359971);
  45.     TextDrawTextSize(Date, 184.000000, 123.000000);
  46.  
  47.     Time = TextDrawCreate(566.000000, 155.000000,"      ");
  48.  
  49.     TextDrawAlignment(Time, 2);
  50.     TextDrawBackgroundColor(Time, 255);
  51.     TextDrawFont(Time, 2);
  52.     TextDrawLetterSize(Time, 0.500000, 1.700000);
  53.     TextDrawColor(Time, -65281);
  54.     TextDrawSetOutline(Time, 0);
  55.     TextDrawSetProportional(Time, 1);
  56.     TextDrawSetShadow(Time, 1);
  57.     TextDrawUseBox(Time, 1);
  58.     TextDrawBoxColor(Time, 69359971);
  59.     TextDrawTextSize(Time, 184.000000, 123.000000);
  60.    
  61.     Textdraw2 = TextDrawCreate(566.000000, 121.000000, "CLOCK");
  62.     TextDrawAlignment(Textdraw2, 2);
  63.     TextDrawBackgroundColor(Textdraw2, 255);
  64.     TextDrawFont(Textdraw2, 2);
  65.     TextDrawLetterSize(Textdraw2, 0.500000, 1.300000);
  66.     TextDrawColor(Textdraw2, -1);
  67.     TextDrawSetOutline(Textdraw2, 0);
  68.     TextDrawSetProportional(Textdraw2, 1);
  69.     TextDrawSetShadow(Textdraw2, 1);
  70.     TextDrawUseBox(Textdraw2, 1);
  71.     TextDrawBoxColor(Textdraw2, 119690775);
  72.     TextDrawTextSize(Textdraw2, 181.000000, 123.000000);
  73.  
  74.  
  75.     SetTimer("settime",1000,true);
  76.     return 1;
  77. }
  78.  
  79. public OnFilterScriptExit()
  80. {
  81.     print("+-----------------------------------------------------+");
  82.     print("| REALTIME CLOCK AND NEW TEXTDRAW BY KRISNA UN-LOADED |");
  83.     print("+-----------------------------------------------------+");
  84.     return 1;
  85. }
  86.  
  87. public OnPlayerSpawn(playerid)
  88. {
  89.     TextDrawShowForPlayer(playerid, Time), TextDrawShowForPlayer(playerid, Date);
  90.     TextDrawShowForPlayer(playerid, Textdraw2);
  91.     return 1;
  92. }
  93.  
  94. public OnPlayerDisconnect(playerid, reason)
  95. {
  96.     TextDrawHideForPlayer(playerid, Time), TextDrawHideForPlayer(playerid, Date);
  97.     TextDrawHideForPlayer(playerid, Textdraw2);
  98.     return 1;
  99. }
  100.  
  101. public settime(playerid)
  102. {
  103.     new string[256],year,month,day,hours,minutes,seconds;
  104.     getdate(year, month, day), gettime(hours, minutes, seconds);
  105.     format(string, sizeof string, "%d/%s%d/%s%d", day, ((month < 10) ? ("0") : ("")), month, (year < 10) ? ("0") : (""), year);
  106.     TextDrawSetString(Date, string);
  107.     format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
  108.     TextDrawSetString(Time, string);
  109. }
Advertisement
Add Comment
Please, Sign In to add comment