Guest User

Untitled

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