Confused (timers)

Have questions about CoD2 mapping that aren't covered in the tutorials section? Post here!

Moderator: Core Staff

megazor
CJ Worshipper
CJ Worshipper
Posts: 414
Joined: July 22nd, 2009, 3:02 am
Location: Russia, Vladivostok

Re: Confused (timers)

Post by megazor » June 6th, 2010, 12:41 pm

I faced that issue in cod1, the accuracy of my timer was 1/10 of a second, but sometimes both hud and iprintlnbold were showing values like 15.9997 for a reason i coudln't realize.
i solved that shit by looping:

Code: Select all

value *= 10; // so 15.9997 becomes 159.997
value = (int)value; // 159;
value = (float)value/10;

User avatar
Drofder2004
Core Staff
Core Staff
Posts: 13313
Joined: April 13th, 2005, 8:22 pm
Location: UK, London

Re: Confused (timers)

Post by Drofder2004 » June 6th, 2010, 9:35 pm

megazor wrote:I faced that issue in cod1, the accuracy of my timer was 1/10 of a second, but sometimes both hud and iprintlnbold were showing values like 15.9997 for a reason i coudln't realize.
i solved that shit by looping:

Code: Select all

value *= 10; // so 15.9997 becomes 159.997
value = (int)value; // 159;
value = (float)value/10;
Just as it has already been done in the prvious posts, right? O_o
Image
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests