Advertisement
Tyler_

Update worldtime rule

Apr 20th, 2014
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 1.00 KB | None | 0 0
  1. /*
  2.     This filterscript uses YSF by Y_Less
  3.     Donwnload it @ http://www.solidfiles.com/d/6f79d1ec26/YSF.rar
  4.     Made by Tyler (fgt)
  5. */
  6. #include <a_samp>
  7.  
  8. new Text:tdWorldTime,gHours,gMinutes;
  9.  
  10. native SetServerRule(name[],value[]);
  11.  
  12. public OnFilterScriptInit()
  13. {
  14.     SetTimer("GlobalTimer",996,1);
  15.     tdWorldTime = TextDrawCreate(605.0,25.0," ");
  16.     TextDrawUseBox(tdWorldTime,0);
  17.     TextDrawFont(tdWorldTime,3);
  18.     TextDrawColor(tdWorldTime,0x99CCFFFF);
  19.     TextDrawSetOutline(tdWorldTime,1);
  20.     TextDrawBackgroundColor(tdWorldTime,0x0066CCFF);
  21.     TextDrawSetShadow(tdWorldTime,0);
  22.     TextDrawAlignment(tdWorldTime,3);
  23.     TextDrawLetterSize(tdWorldTime,0.3,1.0);
  24.     TextDrawShowForAll(tdWorldTime);
  25.     return 1;
  26. }
  27.  
  28. forward GlobalTimer();
  29. public GlobalTimer()
  30. {
  31.     new string[24];
  32.     gMinutes ++;
  33.     if(gMinutes >= 60)
  34.     {
  35.         gHours ++;
  36.         if(gHours >= 24) gHours = 0;
  37.     }
  38.     format(string,sizeof(string),"%02d:%02d",gHours,gMinutes);
  39.     TextDrawSetString(tdWorldTime,string);
  40.     SetServerRule("worldtime",string);
  41.     return 1;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement