Raised This Month: $ Target: $400
 0% 

Showing miliseconds (Timer)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
wAyz
Senior Member
Join Date: Feb 2010
Location: Germany
Old 01-22-2014 , 12:36   Showing miliseconds (Timer)
Reply With Quote #1

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.

Last edited by wAyz; 01-22-2014 at 12:37.
wAyz is offline
simanovich
AlliedModders Donor
Join Date: Jun 2012
Location: Israel
Old 01-22-2014 , 15:52   Re: Showing miliseconds (Timer)
Reply With Quote #2

%.2f
__________________
simanovich is offline
wAyz
Senior Member
Join Date: Feb 2010
Location: Germany
Old 01-23-2014 , 04:12   Re: Showing miliseconds (Timer)
Reply With Quote #3

Quote:
Originally Posted by simanovich View Post
%.2f
Thank you. Unfortunately, the last digit is updating very slowly, is there anything
you can do about it?
wAyz is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 01-23-2014 , 07:17   Re: Showing miliseconds (Timer)
Reply With Quote #4

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.

Last edited by SpeeDeeR; 01-23-2014 at 07:17.
SpeeDeeR is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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