Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* * * * * * * * * * *
- * @Creator - ViruZZzZZ_ChiLLL *
- * @Version - 1.0.0 *
- * @Release Date - 27/07/2010 *
- * @Last Update - 27/07/2010 *
- * * * * * * * * * * * * * * * */
- /*
- native ToggleVClock(toggle);
- native SetVClockTime(hour, minute);
- */
- new Text:VClockTD;
- new Vhour, Vminute;
- stock ToggleVClock(toggle)
- {
- if(toggle == 1){
- VClockTD = TextDrawCreate(546.000000,24.000000,"0:00 AM");
- TextDrawAlignment(VClockTD,0);
- TextDrawBackgroundColor(VClockTD,0x000000ff);
- TextDrawFont(VClockTD,3);
- TextDrawLetterSize(VClockTD,0.399999,1.600000);
- TextDrawColor(VClockTD,0xffffffff);
- TextDrawSetOutline(VClockTD,1);
- TextDrawSetProportional(VClockTD,1);
- TextDrawSetShadow(VClockTD,1);
- SetTimer("VClock", 1000, true);
- Vhour = 12;
- Vminute = 00;
- TextDrawShowForAll(VClockTD);}
- return 0;
- }
- stock SetVClockTime(hour, minute)
- {
- Vhour = hour;
- Vminute = minute;
- return 0;
- }
- forward VClock(playerid);
- public VClock(playerid)
- {
- Vminute++;
- if(Vminute >= 60)
- {
- Vminute = 0;
- Vhour++;
- }
- if(Vhour == 23 && Vminute == 59)
- {
- Vhour = 0;
- Vminute = 0;
- }
- new string[178];
- if(Vminute>=10)
- {
- if(Vhour >= 12 && Vhour <= 23 && Vminute <= 59){
- format(string,sizeof(string),"%d:%d PM",Vhour,Vminute);
- TextDrawSetString(VClockTD,string);}
- if(Vhour >= 0 && Vhour <= 11 && Vminute <= 59){
- format(string,sizeof(string),"%d:%d AM",Vhour,Vminute);
- TextDrawSetString(VClockTD,string);}
- }
- if(Vminute<10)
- {
- if(Vhour >= 12 && Vhour <= 23 && Vminute <= 59){
- format(string,sizeof(string),"%d:0%d PM",Vhour,Vminute);
- TextDrawSetString(VClockTD,string);}
- if(Vhour >= 0 && Vhour <= 11 && Vminute <= 59){
- format(string,sizeof(string),"%d:0%d AM",Vhour,Vminute);
- TextDrawSetString(VClockTD,string);}
- }
- if(Vhour == 0) return SetWorldTime(0);
- if(Vhour == 1) return SetWorldTime(1);
- if(Vhour == 2) return SetWorldTime(2);
- if(Vhour == 3) return SetWorldTime(3);
- if(Vhour == 4) return SetWorldTime(4);
- if(Vhour == 5) return SetWorldTime(5);
- if(Vhour == 6) return SetWorldTime(6);
- if(Vhour == 7) return SetWorldTime(7);
- if(Vhour == 8) return SetWorldTime(8);
- if(Vhour == 9) return SetWorldTime(9);
- if(Vhour == 10) return SetWorldTime(10);
- if(Vhour == 11) return SetWorldTime(11);
- if(Vhour == 12) return SetWorldTime(12);
- if(Vhour == 13) return SetWorldTime(13);
- if(Vhour == 14) return SetWorldTime(14);
- if(Vhour == 15) return SetWorldTime(15);
- if(Vhour == 16) return SetWorldTime(16);
- if(Vhour == 17) return SetWorldTime(17);
- if(Vhour == 18) return SetWorldTime(18);
- if(Vhour == 19) return SetWorldTime(19);
- if(Vhour == 20) return SetWorldTime(20);
- if(Vhour == 21) return SetWorldTime(21);
- if(Vhour == 22) return SetWorldTime(22);
- if(Vhour == 23) return SetWorldTime(23);
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement