21.07.2015, 11:25
Hello,
So, can someone help me make 00:00:00 format for afk timer?
Thanks.
PS. If someone didn't understand, to timer counts hours:minutes
econds, like 00:05:12.
So, can someone help me make 00:00:00 format for afk timer?
Thanks.
Код:
stock ConvertSeconds(time)
{
new string[128];
if(time < 60) format(string, sizeof(string), "%d seconds", time);
else if(time == 60) string = "1 minūte";
else if(time > 60 && time < 3600)
{
new Float: minutes;
new seconds;
minutes = time / 60;
seconds = time % 60;
format(string, sizeof(string), "%.0f minutes %d seconds", minutes, seconds);
}
else if(time == 3600) string = "1 hour";
else if(time > 3600)
{
new Float: hours;
new minutes_int;
new Float: minutes;
new seconds;
hours = time / 3600;
minutes_int = time % 3600;
minutes = minutes_int / 60;
seconds = minutes_int % 60;
format(string, sizeof(string), "%.0f:%.0f:%d", hours, minutes, seconds);
}
return string;
}
econds, like 00:05:12.


