SA-MP Forums Archive
[Help] Time Division - 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: [Help] Time Division (/showthread.php?tid=662305)



[Help] Time Division - ApolloScripter - 28.12.2018

Hello there, It may seem simple, but I really do not know how to do this I've created a timer with a countdown, but currently it's popping up like this:

18000, 17999, 17998... (This is 5 Hours in seconds);

How to show it like this:

05:00:00, 05:59:59, 05:59:58...

Who can help me, I'll be eternally grateful.


Re: [Help] Time Division - m4karow - 28.12.2018

Maybe this is your function (i do not tested it)

Код:
ConvertToHours(time)
{
   new string[48];
   format(string, sizeof(string), "%02d:%02d:%02d", floatround((time / 3600), floatround_floor), floatround((time % 3600) / 60), time % 60);
   return string;
}