[Tutorial] Time System
#10

pawn Code:
if(Tsec<10) {                                 // This Adds a 0 Before The Mins Display For it To look like an actual clock
                                                  //formats string
        format(string,sizeof(string),"%d:%d0",THrs,Tsec);

    }
    if(Tsec>10) {                                 // This Removes a 0 Before The Mins Display after it has reached 10
                                                  //formats string
        format(string,sizeof(string),"%d:%d",THrs,Tsec);

    }
    if(THrs<10) {
                                                  //formats string
        format(string,sizeof(string),"0%d:%d",THrs,Tsec);

    }
This can be done with an easier way.
Change the '%d' to '%02d'. This will show the 0 in front of the (1-9) in the minutes, aswell as the hours.
Reply


Messages In This Thread
Time System - by AceFlyer - 10.09.2011, 09:36
Re: Time System - by Lorenc_ - 10.09.2011, 09:37
Re: Time System - by AceFlyer - 10.09.2011, 09:39
Re: Time System - by Xx_OutLawZ_xX - 10.09.2011, 09:42
Re: Time System - by Darnell - 10.09.2011, 09:58
Re: Time System - by System64 - 10.09.2011, 10:50
Re: Time System - by kurta999 - 10.09.2011, 10:56
Re: Time System - by =WoR=G4M3Ov3r - 10.09.2011, 11:30
Re: Time System - by Davz*|*Criss - 10.09.2011, 12:25
Re: Time System - by Wesley221 - 10.09.2011, 13:49
Re: Time System - by AceFlyer - 10.09.2011, 14:36
Re: Time System - by Basicz - 10.09.2011, 14:46
Re: Time System - by AceFlyer - 10.09.2011, 16:02
Re: Time System - by System64 - 10.09.2011, 16:07
Re: Time System - by AceFlyer - 10.09.2011, 16:10
Re: Time System - by AceFlyer - 10.09.2011, 16:20
Re: Time System - by System64 - 10.09.2011, 16:26
Re: Time System - by System64 - 10.09.2011, 19:07
Re: Time System - by AceFlyer - 11.09.2011, 04:08
Re: Time System - by System64 - 11.09.2011, 05:26
Re: Time System - by AceFlyer - 11.09.2011, 11:23
Re: Time System - by Millionaire - 11.09.2011, 12:03
Re: Time System - by GAMER_PS2 - 30.10.2011, 11:16
Re: Time System - by Tanush123 - 21.01.2012, 20:12

Forum Jump:


Users browsing this thread: 4 Guest(s)