Guest User

SAMP CLOCK

a guest
Jul 17th, 2015
1,295
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.90 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Text:Clock[2];
  4.  
  5. public OnFilterScriptInit()
  6. {
  7.     Clock[0] = TextDrawCreate(576.267517, 13.818528, "05.02.2015");
  8.     TextDrawLetterSize(Clock[0], 0.275997, 1.409183);
  9.     TextDrawAlignment(Clock[0], 2);
  10.     TextDrawColor(Clock[0], -1);
  11.     TextDrawSetShadow(Clock[0], 0);
  12.     TextDrawSetOutline(Clock[0], 1);
  13.     TextDrawBackgroundColor(Clock[0], 255);
  14.     TextDrawFont(Clock[0], 3);
  15.     TextDrawSetProportional(Clock[0], 1);
  16.     TextDrawSetShadow(Clock[0], 0);
  17.  
  18.     Clock[1] = TextDrawCreate(576.400695, 25.018529, "15:27");
  19.     TextDrawLetterSize(Clock[1], 0.512664, 2.551999);
  20.     TextDrawAlignment(Clock[1], 2);
  21.     TextDrawColor(Clock[1], -1);
  22.     TextDrawSetShadow(Clock[1], 0);
  23.     TextDrawSetOutline(Clock[1], 1);
  24.     TextDrawBackgroundColor(Clock[1], 255);
  25.     TextDrawFont(Clock[1], 3);
  26.     TextDrawSetProportional(Clock[1], 1);
  27.     TextDrawSetShadow(Clock[1], 0);
  28.  
  29.     SetTimer("UpdateTime", 6000, true);
  30.     return 1;
  31. }
  32. public OnFilterScriptExit()
  33. {
  34.     for(new i = 0; i < MAX_PLAYERS; i++)
  35.     {
  36.         TextDrawHideForPlayer(i, Clock[0]);
  37.             TextDrawHideForPlayer(i, Clock[1]);
  38.     }
  39.     return 1;
  40. }
  41. public OnPlayerConnect(playerid)
  42. {
  43.         TextDrawShowForPlayer(playerid, Clock[0]);
  44.     TextDrawShowForPlayer(playerid, Clock[1]);
  45.     return 1;
  46. }
  47. forward UpdateTime();
  48. public UpdateTime()
  49. {
  50.     new
  51.         day,
  52.         year,
  53.         month,
  54.         hours,
  55.         minute,
  56.         sec,
  57.         string[128]
  58.     ;
  59.     getdate(year, month, day);
  60.     format(string, sizeof(string), "%02d.%02d.%04d", day, month, year);
  61.     TextDrawSetString(Clock[0], string);
  62.     gettime(hours, minute, sec);
  63.     format(string, sizeof(string), "%02d:%02d", hours, minute);
  64.     TextDrawSetString(Clock[1], string);
  65.     for(new i = 0; i < MAX_PLAYERS; i++)
  66.     {
  67.         TextDrawHideForPlayer(i, Clock[0]);
  68.             TextDrawHideForPlayer(i, Clock[1]);
  69.             TextDrawShowForPlayer(i, Clock[0]);
  70.         TextDrawShowForPlayer(i, Clock[1]);
  71.     }
  72.     return 1;
  73. }
Advertisement
Add Comment
Please, Sign In to add comment