How Can I calculate percentage to next rank ( based on frags) )
Hello guys, how can I calculate percentage of my rank? I mean that, so if I have got 3 frags of 29 how can I calculate percent? Something like that. How it should look if its possible? Can you send me a tip? Thanks
Code:
public xp(id) |
Re: How Can I calculate percentage to next rank ( based on frags) )
PHP Code:
|
Re: How Can I calculate percentage to next rank ( based on frags) )
So it should look, or it's wrong? And how to get next_rank_frags?
PHP Code:
|
Re: How Can I calculate percentage to next rank ( based on frags) )
You got it wrong. In this case current_rank_frags is 0, next_rank_frags is 29, so you can reduce the formula to:
PHP Code:
- you forgot to use brackets { } - using if(...) else ... to check rank is wrong. You should store kills required for each rank in an array and use loop to calculate rank (check this: https://forums.alliedmods.net/showth...82#post1672682) |
Re: How Can I calculate percentage to next rank ( based on frags) )
Uhh, I got it, so next rank ( from 29 to 40 ) should be
PHP Code:
Thank you Sylwester Cheers |
Re: How Can I calculate percentage to next rank ( based on frags) )
Show full code, and we will think ;)
|
Re: How Can I calculate percentage to next rank ( based on frags) )
PHP Code:
Cheers |
Re: How Can I calculate percentage to next rank ( based on frags) )
You got it wrong again.
PHP Code:
|
| All times are GMT -4. The time now is 20:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.