Guest User

Untitled

a guest
Dec 7th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 4.11 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. // ==== [NEWS] ====
  4. new Text:Textdraw0;
  5. new Text:Textdraw3;
  6. new Text:Textdraw4;
  7. new Text:txtTimeDisp;
  8. new Text:txtDateDisp;
  9. // ==== [PUBLIC] ====
  10. static i_ServerSeconds;
  11. static i_ServerMinutes;
  12. static i_ServerHours;
  13. static i_ServerDays;
  14. static i_ServerMonths;
  15. static i_ServerYears;
  16.  
  17. forward ProcessGameTime();
  18. public ProcessGameTime()
  19. {
  20. new string[128];
  21. gettime(i_ServerHours, i_ServerMinutes, i_ServerSeconds);
  22. getdate(i_ServerYears, i_ServerMonths, i_ServerDays);
  23. format(string, sizeof string, "%02d:%02d:%02d", i_ServerHours, i_ServerMinutes, i_ServerSeconds);
  24. TextDrawSetString(txtTimeDisp, string);
  25. format(string, sizeof string, "%02d/%02d/%04d", i_ServerDays, i_ServerMonths, i_ServerYears);
  26. TextDrawSetString(txtDateDisp, string);
  27. SetWorldTime(i_ServerHours);
  28. for(new i = 0; i < MAX_PLAYERS; i++)SetPlayerTime(i, i_ServerHours, i_ServerMinutes);
  29. }
  30.  
  31. public OnFilterScriptInit()
  32. {
  33.     print("Textdraw Feita por Lucas Vinícius");
  34.     print("Eu crio e o burro copia");
  35.  
  36.     // Create the textdraws:
  37.     Textdraw0 = TextDrawCreate(510.000000, 372.000000, "~w~Thunder~w~ ~r~Games~r~");
  38.     TextDrawBackgroundColor(Textdraw0, 255);
  39.     TextDrawFont(Textdraw0, 1);
  40.     TextDrawLetterSize(Textdraw0, 0.430000, 2.499999);
  41.     TextDrawColor(Textdraw0, -1);
  42.     TextDrawSetOutline(Textdraw0, 1);
  43.     TextDrawSetProportional(Textdraw0, 1);
  44.  
  45.     txtDateDisp = TextDrawCreate(521.000000, 390.000000, "~r~DATA:~r~ ~w~00/00/0000~w~");
  46.     TextDrawBackgroundColor(txtDateDisp, 255);
  47.     TextDrawFont(txtDateDisp, 2);
  48.     TextDrawLetterSize(txtDateDisp, 0.220000, 1.800000);
  49.     TextDrawColor(txtDateDisp, -1);
  50.     TextDrawSetOutline(txtDateDisp, 1);
  51.     TextDrawSetProportional(txtDateDisp, 1);
  52.  
  53.     txtTimeDisp = TextDrawCreate(529.000000, 404.000000, "~r~HORA:~r~ ~w~--:--:--~w~");
  54.     TextDrawBackgroundColor(txtTimeDisp, 255);
  55.     TextDrawFont(txtTimeDisp, 2);
  56.     TextDrawLetterSize(txtTimeDisp, 0.220000, 1.700000);
  57.     TextDrawColor(txtTimeDisp, -1);
  58.     TextDrawSetOutline(txtTimeDisp, 1);
  59.     TextDrawSetProportional(txtTimeDisp, 1);
  60.     ProcessGameTime();
  61.     SetTimer("ProcessGameTime", 1000, 1);
  62.     return 1;
  63.     }
  64.  
  65.     Textdraw3 = TextDrawCreate(536.000000, 418.000000, "~r~Versao:~r~ ~w~v3.0");
  66.     TextDrawBackgroundColor(Textdraw3, 255);
  67.     TextDrawFont(Textdraw3, 2);
  68.     TextDrawLetterSize(Textdraw3, 0.220000, 1.500000);
  69.     TextDrawColor(Textdraw3, -1);
  70.     TextDrawSetOutline(Textdraw3, 1);
  71.     TextDrawSetProportional(Textdraw3, 1);
  72.  
  73.     Textdraw4 = TextDrawCreate(524.000000, 430.000000, "~w~Players On:~w~ ~r~0/50");
  74.     TextDrawBackgroundColor(Textdraw4, 255);
  75.     TextDrawFont(Textdraw4, 2);
  76.     TextDrawLetterSize(Textdraw4, 0.220000, 1.500000);
  77.     TextDrawColor(Textdraw4, -1);
  78.     TextDrawSetOutline(Textdraw4, 1);
  79.     TextDrawSetProportional(Textdraw4, 1);
  80.     SetTimer("Check", 1000, true);
  81.  
  82.     for(new i; i < MAX_PLAYERS; i ++)
  83.     {
  84.         if(IsPlayerConnected(i))
  85.         {
  86.             TextDrawShowForPlayer(i, Textdraw0);
  87.             TextDrawShowForPlayer(i, Textdraw1);
  88.             TextDrawShowForPlayer(i, Textdraw2);
  89.             TextDrawShowForPlayer(i, Textdraw3);
  90.             TextDrawShowForPlayer(i, Textdraw4);
  91.         }
  92.     }
  93.     return 1;
  94. }
  95. forward Check();
  96. public Check()
  97. {
  98.     new players, str[20];
  99.     for(new i = 0; i < MAX_PLAYERS; i ++)
  100.     {
  101.         if(IsPlayerConnected(i)) players++;
  102.     }
  103.     format(str, sizeof str, "Players On: %d/50", players);
  104.     TextDrawSetString(Textdraw3, str);
  105. }
  106.  
  107. public OnFilterScriptExit()
  108. {
  109.     TextDrawHideForAll(Textdraw0);
  110.     TextDrawDestroy(Textdraw0);
  111.     TextDrawHideForAll(Textdraw3);
  112.     TextDrawDestroy(Textdraw3);
  113.     TextDrawHideForAll(Textdraw4);
  114.     TextDrawDestroy(Textdraw4);
  115.     TextDrawHideForAll(txtTimeDisp);
  116.     TextDrawDestroy(txtTimeDisp);
  117.     TextDrawHideForAll(txtDateDisp);
  118.     TextDrawDestroy(txtDateDisp);
  119.     return 1;
  120. }
  121.  
  122. public OnPlayerConnect(playerid)
  123. {
  124.     TextDrawShowForPlayer(playerid, Textdraw0);
  125.     TextDrawShowForPlayer(playerid,txtTimeDisp);
  126.     TextDrawShowForPlayer(playerid,txtDateDisp);
  127.     TextDrawShowForPlayer(playerid, Textdraw3);
  128.     TextDrawShowForPlayer(playerid, Textdraw4);
  129.     return 1;
  130. }
  131.  
  132. public OnPlayerDeath(playerid, killerid, reason)
  133. {
  134.     TextDrawHideForPlayer(playerid,txtTimeDisp);
  135.     TextDrawHideForPlayer(playerid,txtDateDisp);
  136.     return 1;
  137. }
Add Comment
Please, Sign In to add comment