Thread: [Solved] Time Format
View Single Post
Author Message
gabuch2
AlliedModders Donor
Join Date: Mar 2011
Location: Chile
Old 05-04-2019 , 01:24   Time Format
Reply With Quote #1

Hello

I'm using get_time_length() to display a time remaining hud message.
Code:
new hud[125] get_time_length(iPlayers[i], g_iRoundTime, timeunit_seconds, hud, charsmax(hud));

But it gets formated like this:


Is there anyway to use the HH:MM:SS format?

EDIT: Fixed it by borrowing the code from another plugin.

Code:
new hud[125] new m = g_iRoundTime/60 new h = m/60 new s = g_iRoundTime-m*60 m = m-h*60 if(h)     formatex(hud,charsmax(hud),"%d:%02d:%02d",h,m,s) else     formatex(hud,charsmax(hud),"%d:%02d",m,s)
__________________

Last edited by gabuch2; 05-05-2019 at 14:22.
gabuch2 is offline