Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Miscellany
Saturday, March 15th, 2008 at 4:49:05pm MDT 

  1. #include <a_samp>
  2.  
  3. #if defined FILTERSCRIPT
  4.  
  5. new Text:Clock;
  6. new Text:Date;
  7.  
  8. public OnFilterScriptInit()
  9. {
  10.         print("\n--------------------------------------");
  11.         print("Time and Date v2 by b00m");
  12.         print("--------------------------------------\n");
  13.         return 1;
  14. }
  15.  
  16. public OnGameModeInit()
  17. {
  18.         Clock=TextDrawCreate(549,24, "00:00");
  19.         TextDrawLetterSize(Clock,0.55,2);
  20.         TextDrawFont(Clock,3);
  21.         TextDrawBackgroundColor(Clock,0x000000AA);
  22.         TextDrawSetOutline(Clock,2);
  23.  
  24.         Date=TextDrawCreate(500,3, "01.01.2008");
  25.         TextDrawLetterSize(Date,0.55,2);
  26.         TextDrawFont(Date,3);
  27.         TextDrawBackgroundColor(Date,0x000000AA);
  28.         TextDrawSetOutline(Date,2);
  29.        
  30.         SetTimer("time", 60000, 1); // After one minute you will se real time and date
  31.         return 1;
  32. }
  33.  
  34. public OnGameModeExit()
  35. {
  36.         return 1;
  37. }
  38.  
  39. public time()
  40. {
  41. // HOURS
  42. new hour,minute,second;
  43. gettime(hour,minute,second);
  44. new string[256];
  45. new string2[256];
  46. if (minute <= 9)
  47. {
  48.         format(string,25,"%d:0%d",hour,minute);
  49. }
  50. else
  51. {
  52.         format(string,25,"%d:%d",hour,minute);
  53. }
  54. // DATE
  55. new day,month,year;
  56. getdate(year,month,day);
  57.  
  58. if (day <= 9){
  59. format(string2,25,"0%d.%d.%d",day,month,year);
  60. }
  61. else if (month <= 9 && day >= 9) {
  62. format(string2,25,"%d.0%d.%d",day,month,year);
  63. }
  64. else {
  65. format(string2,25,"%d.%d.%d",day,month,year);
  66. }
  67.  
  68. if (hour == 0){SetWorldTime(0);}
  69. if (hour == 1){SetWorldTime(1);}
  70. if (hour == 2){SetWorldTime(2);}
  71. if (hour == 3){SetWorldTime(3);}
  72. if (hour == 4){SetWorldTime(4);}
  73. if (hour == 5){SetWorldTime(5);}
  74. if (hour == 6){SetWorldTime(6);}
  75. if (hour == 7){SetWorldTime(7);}
  76. if (hour == 8){SetWorldTime(8);}
  77. if (hour == 9){SetWorldTime(9);}
  78. if (hour == 10){SetWorldTime(10);}
  79. if (hour == 11){SetWorldTime(11);}
  80. if (hour == 12){SetWorldTime(12);}
  81. if (hour == 13){SetWorldTime(13);}
  82. if (hour == 14){SetWorldTime(14);}
  83. if (hour == 15){SetWorldTime(15);}
  84. if (hour == 16){SetWorldTime(16);}
  85. if (hour == 17){SetWorldTime(17);}
  86. if (hour == 18){SetWorldTime(18);}
  87. if (hour == 19){SetWorldTime(19);}
  88. if (hour == 20){SetWorldTime(20);}
  89. if (hour == 21){SetWorldTime(21);}
  90. if (hour == 22){SetWorldTime(22);}
  91. if (hour == 23){SetWorldTime(23);}
  92. if (hour == 24){SetWorldTime(24);}
  93.  
  94.  
  95. for(new i=0;i<MAX_PLAYERS;i++)
  96. {
  97.         TextDrawHideForPlayer(i,Clock);
  98.         TextDrawHideForPlayer(i,Date);
  99.  
  100.         TextDrawSetString(Clock,string);
  101.         TextDrawSetString(Datum,string2);
  102.  
  103.         TextDrawShowForPlayer(i,Clock);
  104.         TextDrawShowForPlayer(i,Date);
  105. }
  106. return 1;
  107. }
  108.  
  109. public OnPlayerSpawn(playerid)
  110. {
  111.         TextDrawShowForPlayer(playerid,Clock);
  112.         TextDrawShowForPlayer(playerid,Datum);
  113. }
  114. #endif

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

worth-right