Raised This Month: $ Target: $400
 0% 

How Can I calculate percentage to next rank ( based on frags) )


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 01-26-2013 , 06:06   Re: How Can I calculate percentage to next rank ( based on frags) )
Reply With Quote #4

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:
exp 100 stats[0] / 29 
But there are other problems:
- 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)
__________________
Impossible is Nothing

Last edited by Sylwester; 01-26-2013 at 06:08.
Sylwester is offline
 



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 20:30.


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