AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Showing miliseconds (Timer) (https://forums.alliedmods.net/showthread.php?t=233936)

wAyz 01-22-2014 12:36

Showing miliseconds (Timer)
 
Hello,

I'm currently using Prokreedz 2.31 and changed the code so that the timer looks like that: "00:00:0".
Any ideas how to add the last digit of milisecond? I want it to look like that. "00:00:00"

Code:

                if( ShowTime[Alive[i]] == 1 )
                {
                    new colors[12], r[4], g[4], b[4];
                    new imin = floatround(kreedztime , floatround_floor)/60
                    new isec = kreedztime - (60*imin)
                    get_pcvar_string(kz_hud_color, colors, 11)
                    parse(colors, r, 3, g, 3, b, 4)
                       
                    set_hudmessage(str_to_num(r), str_to_num(g), str_to_num(b), 0.0265, 0.4764, 0, 0.0, 0.4, 0.0, 0.0, 2)   
                    show_hudmessage(Alive[i], "%02d:%s%.1f (%d|%d) %s ",imin,isec < 10 ? "0" : "",isec,checknumbers[Alive[i]], gochecknumbers[Alive[i]], IsPaused[Alive[i]] ? "| *Paused*" : "")
                }

I guess I have to change something in show_hudmessage line.

simanovich 01-22-2014 15:52

Re: Showing miliseconds (Timer)
 
%.2f

wAyz 01-23-2014 04:12

Re: Showing miliseconds (Timer)
 
Quote:

Originally Posted by simanovich (Post 2089604)
%.2f

Thank you. Unfortunately, the last digit is updating very slowly, is there anything
you can do about it?

SpeeDeeR 01-23-2014 07:17

Re: Showing miliseconds (Timer)
 
Code:
set_task(0.5,"timer_task",2000,"",0,"ab")
Set the first parameter to 0.1, it can't get any faster. If you want it ever faster you have to use a different approuch - using an entity to think.


All times are GMT -4. The time now is 10:12.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.