Raised This Month: $13 Target: $400
 3% 

XP Percent


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ludak
Member
Join Date: Oct 2014
Old 08-25-2019 , 10:47   XP Percent
Reply With Quote #1

Hello everyone, I have a level system, and I want to display the percent of XP needed for the next level.

I have this formula for the leveling up:
PHP Code:
int CalculateXPint currentLevel )
    return 
currentLevel g_CvarXpMultiplier.IntValue
I have 2 variables for the player xp and level:
PHP Code:
int g_levelMAXPLAYERS ];
int g_xpMAXPLAYERS ]; 
Can someone give me a formula for that, I am not that good with the math?
Thank you.
Ludak is offline
CrazyHackGUT
AlliedModders Donor
Join Date: Feb 2016
Location: Izhevsk, Russia
Old 08-25-2019 , 10:56   Re: XP Percent
Reply With Quote #2

First, you need calc XP for next level. Next, from "required XP" subtract "required XP for current level", and next - divide current XP on result after subtracting.
__________________
My english is very bad. I am live in Russia. Learning english language - very hard task for me...
CrazyHackGUT is offline
Send a message via ICQ to CrazyHackGUT Send a message via Skype™ to CrazyHackGUT
iGANGNAM
AlliedModders Donor
Join Date: Sep 2012
Location: Lithuania
Old 08-26-2019 , 05:27   Re: XP Percent
Reply With Quote #3

Quote:
(g_xp[client]/CalculateXP(g_level[client]+1))*100
You are asking for this?
__________________

Last edited by iGANGNAM; 08-26-2019 at 05:27.
iGANGNAM is offline
Ludak
Member
Join Date: Oct 2014
Old 11-06-2019 , 12:24   Re: XP Percent
Reply With Quote #4

Quote:
Originally Posted by iGANGNAM View Post
You are asking for this?
Thank you
Ludak is offline
Reply


Thread Tools
Display Modes

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 04:33.


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