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)
__________________