10.09.2012, 18:33
I've created a functioning time system, problem is, when it's say.. 7:04 PM, it will read: "7:4 PM", how would I add that other 0 into my current system?
pawn Код:
public UpdateTime ( )
{
new
str [ 24 ];
TimeMin ++;
if( TimeMin == 60 )
{
TimeHour ++;
TimeMin = 00;
if( strcmp( TimeSuffix, "A.M", false ) == 0 )
{
SetWorldTime( TimeHour );
}
else if( strcmp( TimeSuffix, "P.M", false ) == 0 )
{
SetWorldTime( TimeHour + 10 );
}
}
if( TimeHour > 12 && strcmp( TimeSuffix, "A.M", false ) == 0 )
{
TimeHour = 1, TimeMin = 00;
TimeSuffix = "P.M";
}
else if( TimeHour > 12 && strcmp( TimeSuffix, "P.M", false ) == 0 )
{
TimeHour = 1, TimeMin = 00;
TimeSuffix = "A.M";
}
format( str, 24, "%d:%d %s", TimeHour, TimeMin, TimeSuffix );
TextDrawSetString( TimeTag, str );
for( new u; u < MAX_PLAYERS; u ++ )
{
if( plLoggedIn [ u ] == true )
{
TextDrawHideForPlayer( u, TimeTag );
TextDrawShowForPlayer( u, TimeTag );
}
}
return true;
}