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;
}
format( str, 24, "%d:%d %s", TimeHour, TimeMin, TimeSuffix );
to format( str, 24, "%02d:%02d %s", TimeHour, TimeMin, TimeSuffix ); Hope I helped |