Advertisement
Wizdo

[FS] Real Time System

Aug 18th, 2014
388
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 0.96 KB | None | 0 0
  1. #include <a_samp>
  2.  
  3. new Text:Time;
  4.  
  5. forward settime(playerid);
  6.  
  7. public OnFilterScriptInit()
  8. {
  9.         SetTimer("settime",1000,true);
  10.  
  11.         Time = TextDrawCreate(547.000000,28.000000,"--");
  12.  
  13.         TextDrawFont(Time,3);
  14.         TextDrawLetterSize(Time,0.399999,1.600000);
  15.         TextDrawColor(Time,0xffffffff);
  16.         return 1;
  17. }
  18.  
  19. public OnFilterScriptExit()
  20. {
  21.         return 1;
  22. }
  23.  
  24. public OnPlayerSpawn(playerid)
  25. {
  26.         TextDrawShowForPlayer(playerid, Time);
  27.         return 1;
  28. }
  29.  
  30. public OnPlayerDisconnect(playerid, reason)
  31. {
  32.         TextDrawHideForPlayer(playerid, Time);
  33.         return 1;
  34. }
  35.  
  36. public settime(playerid)
  37. {
  38.         new string[256],hours,minutes,seconds;
  39.         gettime(hours, minutes, seconds);
  40.         format(string, sizeof string, "%s%d:%s%d:%s%d", (hours < 10) ? ("0") : (""), hours, (minutes < 10) ? ("0") : (""), minutes, (seconds < 10) ? ("0") : (""), seconds);
  41.         TextDrawSetString(Time, string);
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement