Advertisement
Guest User

[FS]RealTime

a guest
Oct 10th, 2016
1,870
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Text:Reloginho1, Text:Reloginho2, Text:Reloginho3;
  4. public OnFilterScriptInit()
  5. {
  6. print("\n--------------------------------------");
  7. print(" [FS] Hora Real");
  8. print(" www.sampextremeoficial.blogspot.com");
  9. print("--------------------------------------\n");
  10. SetTimerEx("HoraReal",1000,false,"i",playerid);
  11. //HORA
  12. Reloginho2 = TextDrawCreate(551.000000, 28.000000, "~w~~h~00:00:00");
  13. TextDrawBackgroundColor(Reloginho2, 50);
  14. TextDrawFont(Reloginho2, 1);
  15. TextDrawLetterSize(Reloginho2, 0.360000, 1.900000);
  16. TextDrawColor(Reloginho2, -1);
  17. TextDrawSetOutline(Reloginho2, 1);
  18. TextDrawSetProportional(Reloginho2, 1);
  19. TextDrawSetShadow(Reloginho2, 1);
  20. TextDrawSetSelectable(Reloginho2, 0);
  21. //Data
  22. Reloginho1 = TextDrawCreate(543.000000, 1.000000, "~w~~h~00/00/0000");
  23. TextDrawBackgroundColor(Reloginho1, 50);
  24. TextDrawFont(Reloginho1, 1);
  25. TextDrawLetterSize(Reloginho1, 0.360000, 1.900000);
  26. TextDrawColor(Reloginho1, -1);
  27. TextDrawSetOutline(Reloginho1, 1);
  28. TextDrawSetProportional(Reloginho1, 1);
  29. TextDrawSetShadow(Reloginho1, 1);
  30. TextDrawSetSelectable(Reloginho1, 0);
  31. //Dia Da Semana
  32. Reloginho3 = TextDrawCreate(563.000000, 19.000000, "~b~~h~~h~sexta-feira");
  33. TextDrawBackgroundColor(Reloginho3, 0);
  34. TextDrawFont(Reloginho3, 1);
  35. TextDrawLetterSize(Reloginho3, 0.200000, 1.200000);
  36. TextDrawColor(Reloginho3, -1);
  37. TextDrawSetOutline(Reloginho3, 1);
  38. TextDrawSetProportional(Reloginho3, 1);
  39. TextDrawSetShadow(Reloginho3, 1);
  40. TextDrawSetSelectable(Reloginho3, 0);
  41. return 1;
  42. }
  43. public OnFilterScriptExit()
  44. {
  45. KillTimer(HoraReal);
  46. return 1;
  47. }
  48.  
  49. public OnPlayerConnect(playerid)
  50. {
  51. TextDrawShowForPlayer(playerid, Reloginho1);
  52. TextDrawShowForPlayer(playerid, Reloginho2);
  53. TextDrawShowForPlayer(playerid, Reloginho3);
  54. return 1;
  55. }
  56. static stock VerSemana(const PT_Dia, const PT_Mes, const PT_Ano)
  57. {
  58. new PT_A = (14 - PT_Mes) / 12, PT_B = PT_Ano - PT_A, PT_C = (PT_Mes + (12 * PT_A)) - 2, PT_D = (((((PT_Dia + ((31 * PT_C) / 12)) + PT_B) + (PT_B / 4)) - (PT_B / 100)) + (PT_B / 400)), PT_E = PT_D % 7;
  59. static const PTSemana[7][14] = { "Domingo", "Segunda-Feira", "Terca-Feira", "Quarta-Feira", "Quinta-Feira", "Sexta-Feira", "Sabado" };
  60. return PTSemana[PT_E];
  61. }
  62. forward HoraReal();
  63. public HoraReal()
  64. {
  65. new str[100];
  66. new
  67. ano,
  68. mes,
  69. dia,
  70. horas,
  71. minutos,
  72. segundos;
  73. getdate(ano, mes, dia);
  74. gettime(horas, minutos, segundos);
  75.  
  76. format( stringpayday, sizeof stringpayday, "~b~~h~~h~%s",VerSemana(dia,mes,ano));
  77. TextDrawSetString(Reloginho3, stringpayday);
  78.  
  79. format( str, sizeof(str), "~w~%02d:%02d:%02d",horas, minutos, segundos);
  80. TextDrawSetString(Reloginho2, str);
  81.  
  82. format( str, sizeof str, "~w~%02d/%02d/%d",dia, mes, ano);
  83. TextDrawSetString(Reloginho1, str);
  84. SetWorldTime(hora);
  85. TextDrawShowForPlayer(playerid, Reloginho1);
  86. TextDrawShowForPlayer(playerid, Reloginho2);
  87. TextDrawShowForPlayer(playerid, Reloginho3);
  88. return 1;
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement