Advertisement
Guest User

Clock.pwn

a guest
Nov 20th, 2012
305
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. /*--------------------------------------------------------------------------------------------*\
  2. | -GameMode/FilterScript : FilterScript |
  3. | -FilterScript Ime : Clock |
  4. | -FilterScript Skripter : VikkY™ |
  5. | -FilterScript Verzija : v1.0 |
  6. \*--------------------------------------------------------------------------------------------*/
  7.  
  8. /*=====================
  9. ======[Includ-ovi]=====
  10. =====================*/
  11. #include <a_samp>
  12.  
  13. /*=====================
  14. ========[Boje]========
  15. =====================*/
  16. #define COLOR_BLACK 0x000000FF
  17. #define COLOR_WHITE 0xFFFFFFFF
  18. #define COLOR_PURPLE 0xC2A2DAAA
  19.  
  20. /*=====================
  21. ===[TextDraw Format]===
  22. =====================*/
  23. new FALSE = false;
  24. #define TextDrawSetFormat(%0,%1) do{new _str[128]; format(_str,128,%1); TextDrawSetString(%0,_str);}while(FALSE)
  25.  
  26. /*=====================
  27. =====[TextDraw-ovi]====
  28. =====================*/
  29. new Text:Sati;
  30. new Text:Minuti;
  31.  
  32. /*=====================
  33. =====[Forward-ovi]=====
  34. =====================*/
  35. forward Sat();
  36.  
  37.  
  38. public OnFilterScriptInit()
  39. {
  40. //Print
  41. print("\n---------------------------------------------");
  42. print(" Clock v1.0 By VikkY™ je uspesno ucitan! ");
  43. print("---------------------------------------------\n");
  44. new ServerSat, ServerMinuti;
  45. gettime(ServerSat, ServerMinuti);
  46. NapraviTD();
  47. SetTimer("Sat", 1000, true);
  48. return 1;
  49. }
  50.  
  51. public OnFilterScriptExit()
  52. {
  53. UnistiTD();
  54. return 1;
  55. }
  56.  
  57. public OnPlayerConnect(playerid)
  58. {
  59. SakrijTD(playerid);
  60. }
  61.  
  62. public OnPlayerRequestClass(playerid, classid)
  63. {
  64. SakrijTD(playerid);
  65. return 1;
  66. }
  67.  
  68. public OnPlayerSpawn(playerid)
  69. {
  70. PokaziTD(playerid);
  71. return 1;
  72. }
  73.  
  74. public OnPlayerDisconnect(playerid, reason)
  75. {
  76. SakrijTD(playerid);
  77. return 1;
  78. }
  79.  
  80. public Sat()
  81. {
  82. new ServerSat, ServerMinuti;
  83. gettime(ServerSat,ServerMinuti);
  84. TextDrawSetFormat(Sati, "%02d", ServerSat);
  85. TextDrawSetFormat(Minuti, ":%02d", ServerMinuti);
  86. for(new i = 0; i < GetMaxPlayers(); i++){SetPlayerTime(i, ServerSat, ServerMinuti);}
  87. }
  88.  
  89. stock NapraviTD()
  90. {
  91. //TextDraw Hours
  92. Sati = TextDrawCreate(546.000000,22.000000,"--");
  93. TextDrawAlignment(Sati,0);
  94. TextDrawBackgroundColor(Sati,COLOR_BLACK);
  95. TextDrawFont(Sati,3);
  96. TextDrawLetterSize(Sati,0.634,2.4);
  97. TextDrawColor(Sati,COLOR_PURPLE);
  98. TextDrawSetOutline(Sati,1);
  99. TextDrawSetProportional(Sati,1);
  100. TextDrawSetShadow(Sati,1);
  101. //TextDraw Minuti
  102. Minuti = TextDrawCreate(570.200000,22.000000,"--");
  103. TextDrawAlignment(Minuti,0);
  104. TextDrawBackgroundColor(Minuti,COLOR_BLACK);
  105. TextDrawFont(Minuti,3);
  106. TextDrawLetterSize(Minuti,0.634,2.4);
  107. TextDrawColor(Minuti,COLOR_PURPLE);
  108. TextDrawSetOutline(Minuti,1);
  109. TextDrawSetProportional(Minuti,1);
  110. TextDrawSetShadow(Minuti,1);
  111. }
  112.  
  113. stock SakrijTD(playerid)
  114. {
  115. TextDrawHideForPlayer(playerid,Sati);
  116. TextDrawHideForPlayer(playerid,Minuti);
  117. }
  118.  
  119. stock PokaziTD(playerid)
  120. {
  121. TextDrawShowForPlayer(playerid,Sati);
  122. TextDrawShowForPlayer(playerid,Minuti);
  123. }
  124.  
  125. stock UnistiTD()
  126. {
  127. TextDrawDestroy(Sati);
  128. TextDrawDestroy(Minuti);
  129. }
  130. /*===========================================================================================================================================
  131. ===============================================================[Kraj FilterScript-a]=========================================================
  132. ===========================================================================================================================================*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement