Calculating, k/d ratio.
Hello there,
For example someone has a 1.41 k/d ratio and he will unlock an achievement with a 1.50 k/d ratio how will I check if the user has a 1.50 k/d ratio? |
Re: Calculating, k/d ratio.
deaths = get deaths
if deaths is 0, deaths = 1 ratio = get frags / deaths if ratio is greater than or equal to 1.5, then give achievment |
Re: Calculating, k/d ratio.
Yea, my question was how will i check if its higher then 1,5?
Can i just use for example if (Ratio >= 1.5) |
Re: Calculating, k/d ratio.
Compiling and testing do wonders.
|
Re: Calculating, k/d ratio.
does it need 2 decimals?
|
Re: Calculating, k/d ratio.
Quote:
1..5? |
Re: Calculating, k/d ratio.
Use floats in the equation, if that's what you meant.
|
Re: Calculating, k/d ratio.
PHP Code:
|
Re: Calculating, k/d ratio.
PHP Code:
|
Re: Calculating, k/d ratio.
Yea, I used a FLOAT for my calculation, but I didnt know that it will catch the ratio's number like on this way :P
|
| All times are GMT -4. The time now is 15:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.