Guest User

Untitled

a guest
Jul 27th, 2010
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 2.86 KB | None | 0 0
  1. /*  *  *  *  *  *  *  *  *  *  *
  2.  * @Creator - ViruZZzZZ_ChiLLL *
  3.  * @Version - 1.0.0            *
  4.  * @Release Date - 27/07/2010  *
  5.  * @Last Update - 27/07/2010   *
  6.  * * * * * * * * * * * * * * * */
  7.  
  8. /*
  9.    native ToggleVClock(toggle);
  10.    native SetVClockTime(hour, minute);
  11. */
  12.  
  13. new Text:VClockTD;
  14. new Vhour, Vminute;
  15.  
  16. stock ToggleVClock(toggle)
  17. {
  18.    if(toggle == 1){
  19.    VClockTD = TextDrawCreate(546.000000,23.000000,"0:00 AM");
  20.    TextDrawAlignment(VClockTD,0);
  21.    TextDrawBackgroundColor(VClockTD,0x000000ff);
  22.    TextDrawFont(VClockTD,2);
  23.    TextDrawLetterSize(VClockTD,0.299999,1.600000);
  24.    TextDrawColor(VClockTD,0xff0000ff);
  25.    TextDrawSetProportional(VClockTD,1);
  26.    TextDrawSetShadow(VClockTD,1);
  27.    SetTimer("VClock", 1000, true);
  28.    Vhour = 12;
  29.    Vminute = 00;
  30.    TextDrawShowForAll(VClockTD);}
  31.    return 0;
  32. }
  33.  
  34. stock SetVClockTime(hour, minute)
  35. {
  36.    Vhour = hour;
  37.    Vminute = minute;
  38.    return 0;
  39. }
  40.  
  41.  
  42. forward VClock(playerid);
  43. public VClock(playerid)
  44. {
  45.     Vminute++;
  46.     if(Vminute >= 60)
  47.     {
  48.         Vminute = 0;
  49.         Vhour++;
  50.     }
  51.     if(Vhour == 23 && Vminute == 59)
  52.     {
  53.         Vhour = 0;
  54.         Vminute = 0;
  55.     }
  56.     new string[178];
  57.  
  58.     if(Vminute>=10)
  59.     {
  60.         if(Vhour >= 12 && Vhour <= 23 && Vminute <= 59){
  61.         format(string,sizeof(string),"%d:%d PM",Vhour,Vminute);
  62.         TextDrawSetString(VClockTD,string);}
  63.         if(Vhour >= 0 && Vhour <= 11 && Vminute <= 59){
  64.         format(string,sizeof(string),"%d:%d AM",Vhour,Vminute);
  65.         TextDrawSetString(VClockTD,string);}
  66.     }
  67.  
  68.     if(Vminute<10)
  69.     {
  70.         if(Vhour >= 12 && Vhour <= 23 && Vminute <= 59){
  71.         format(string,sizeof(string),"%d:0%d PM",Vhour,Vminute);
  72.         TextDrawSetString(VClockTD,string);}
  73.         if(Vhour >= 0 && Vhour <= 11 && Vminute <= 59){
  74.         format(string,sizeof(string),"%d:0%d AM",Vhour,Vminute);
  75.         TextDrawSetString(VClockTD,string);}
  76.     }
  77.  
  78.  
  79.     if(Vhour == 0) return SetWorldTime(0);
  80.     if(Vhour == 1) return SetWorldTime(1);
  81.     if(Vhour == 2) return SetWorldTime(2);
  82.     if(Vhour == 3) return SetWorldTime(3);
  83.     if(Vhour == 4) return SetWorldTime(4);
  84.     if(Vhour == 5) return SetWorldTime(5);
  85.     if(Vhour == 6) return SetWorldTime(6);
  86.     if(Vhour == 7) return SetWorldTime(7);
  87.     if(Vhour == 8) return SetWorldTime(8);
  88.     if(Vhour == 9) return SetWorldTime(9);
  89.     if(Vhour == 10) return SetWorldTime(10);
  90.     if(Vhour == 11) return SetWorldTime(11);
  91.     if(Vhour == 12) return SetWorldTime(12);
  92.     if(Vhour == 13) return SetWorldTime(13);
  93.     if(Vhour == 14) return SetWorldTime(14);
  94.     if(Vhour == 15) return SetWorldTime(15);
  95.     if(Vhour == 16) return SetWorldTime(16);
  96.     if(Vhour == 17) return SetWorldTime(17);
  97.     if(Vhour == 18) return SetWorldTime(18);
  98.     if(Vhour == 19) return SetWorldTime(19);
  99.     if(Vhour == 20) return SetWorldTime(20);
  100.     if(Vhour == 21) return SetWorldTime(21);
  101.     if(Vhour == 22) return SetWorldTime(22);
  102.     if(Vhour == 23) return SetWorldTime(23);
  103.     return 1;
  104. }
Advertisement
Add Comment
Please, Sign In to add comment