Advertisement
Guest User

Untitled

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