Page 2 of 2

Re: Confused (timers)

Posted: June 6th, 2010, 12:41 pm
by megazor
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;

Re: Confused (timers)

Posted: June 6th, 2010, 9:35 pm
by Drofder2004
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