SA-MP Forums Archive
Fast question (Hour) - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Fast question (Hour) (/showthread.php?tid=562275)



Fast question (Hour) - CoR3 - 07.02.2015

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


Re: Fast question (Hour) - Misiur - 07.02.2015

In format function use %02d instead of %d


Respuesta: Fast question (Hour) - Zume - 07.02.2015

Show code of the system.


Respuesta: Fast question (Hour) - CoR3 - 08.02.2015

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);
                    }
                } 



Re: Fast question (Hour) - PowerPC603 - 08.02.2015

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