16/01/2022 14:07
Código:
Convert(number)
{
new hours = 0, mins = 0, secs = 0, string[128];
hours = floatround(number / 3600);
mins = floatround((number / 60) - (hours * 60));
secs = floatround(number - ((hours * 3600) + (mins * 60)));
new days = 0;
if(hours >= 24)
{
days = floatround((hours/24), floatround_floor);
hours = hours % 24;
}
if(days > 0)
{
format(string, 100, "%ddias, %dh %dm e %ds", days, hours, mins, secs);
}
else if(hours > 0)
{
format(string, 100, "%dh %dm e %ds", hours, mins, secs);
}
else
{
format(string, 100, "%dm e %ds", mins, secs);
}
return string;
}