Fast question (Hour)
#1

Well, i did a watch system but when it show the time, it doesn't print the zero "0"

For example:


15:2 ---> And i want to see 15:02
1:1 ----> And i want to see 01:01
Reply
#2

In format function use %02d instead of %d
Reply
#3

Show code of the system.
Reply
#4

PHP код:
                if (PlayerInfo[playerid][pJailTime] > 0)
                {
                    if(
PlayerInfo[playerid][pWatch] > 0)
                    {
                        new 
s_string[128];
                        new 
enminutos;
                        
enminutos PlayerInfo[playerid][pJailTime] / 60;
                        
format(s_string128"%d %s |%0d:%0d| - Tiempo de condena: %d segundos (%d Minutos)"daymtexthourminuitePlayerInfo[playerid][pJailTime], enminutos);
                        
SendClientMessage(playeridCOLOR_REDs_string);
                    }
                    else
                    {
                        new 
s_string[128];
                        
format(s_string128"Tiempo de condena: %d segundos"PlayerInfo[playerid][pJailTime]);
                        
SendClientMessage(playeridCOLOR_REDs_string);
                    }
                } 
Reply
#5

pawn Код:
format(s_string, 128, "%d %s |%02d:%02d| - Tiempo de condena: %d segundos (%d Minutos)", day, mtext, hour, minuite, PlayerInfo[playerid][pJailTime], enminutos);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)