Advertisement
Guest User

FS CLOCK [TEXTDRAW]

a guest
Oct 9th, 2012
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.26 KB | None | 0 0
  1. // FS by Yagel/y2g3L
  2. #include <a_samp>
  3.  
  4. new Text:Clock[2];
  5. forward ClockUpdate(playerid);
  6.  
  7. public OnFilterScriptInit()
  8. {
  9.     SetTimer("ClockUpdate", 1000, true);
  10.     Clock[0] = TextDrawCreate(547.000000, 4.000000, "  ");
  11.     TextDrawFont(Clock[0], 3);
  12.     TextDrawLetterSize(Clock[0], 0.509999, 2.000000);
  13.     TextDrawSetShadow(Clock[0], 1);
  14.     TextDrawColor(Clock[0], -1);
  15.  
  16.     Clock[1] = TextDrawCreate(554.000000, 21.000000, "  ");
  17.     TextDrawFont(Clock[1], 3);
  18.     TextDrawLetterSize(Clock[1], 0.370000, 1.400000);
  19.     TextDrawSetShadow(Clock[1], 1);
  20.     TextDrawColor(Clock[1], 65535);
  21.     return 1;
  22. }
  23. public OnFilterScriptExit() return 1;
  24. public OnPlayerSpawn(playerid)
  25. {
  26.     TextDrawShowForPlayer(playerid, Clock[0]), TextDrawShowForPlayer(playerid, Clock[1]);
  27.     return 1;
  28. }
  29. public OnPlayerDisconnect(playerid, reason)
  30. {
  31.     TextDrawHideForPlayer(playerid, Clock[0]), TextDrawHideForPlayer(playerid, Clock[1]);
  32.     return 1;
  33. }
  34. public ClockUpdate(playerid)
  35. {
  36.     new str[256], date[3], time[3];
  37.     getdate(date[0], date[1], date[2]), gettime(time[0], time[1], time[2]);
  38.     format(str, sizeof(str), "%02d/%02d/%d", date[2], date[1], date[0]), TextDrawSetString(Clock[1], str);
  39.     format(str, sizeof(str), "%02d:%02d:%02d", time[0], time[1], time[2]), TextDrawSetString(Clock[0], str);
  40.     return 1;
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement