• 0

# [PI] Choose XP Rate

## Question

Can someone help me with multiple Xp rates when you start out?
rookie = 0,
average = 0,
legend = 0,
in player class but im keep failing could someone show me good tutorial or someone team viewer me?

## Recommended Posts

• 0
Paste me what you have currently and I'll help you here.

##### Share on other sites
• 0
You gotta find your method that adds the xp should be something like this [QUOTE] public boolean addSkillXP(int xp, final int skill) {

if (skill < 0 || c.locked || c.canSpawn) {
return false;
}
if (c.inRandomEvent()) {
return false;
}
if (xp + c.playerXP[skill] < 0 || c.playerXP[skill] > 200000000) {
if (c.playerXP[skill] > 200000000) {
c.playerXP[skill] = 200000000;
}
return false;
}
xp *= SkillHandler.EXP_RATE[skill]; // XP multiplier
xp *= DoubleXP.doubleXp ? 2 : 1;
// xp *= c.newPlayer() ? 2 : 1;

if (xp < 0) {
xp = 0;
}
final int oldLevel = c.getPlayerLevel(skill);
c.playerXP[skill] += xp;
if (oldLevel < c.getPlayerLevel(skill)) {
if (skill != Config.HITPOINTS) {
c.playerLevel[skill] = c.getPlayerLevel(skill);
} else {
c.playerLevel[skill] += 1; // hp only increases by one
c.constitution += 1;
}
levelUp(skill);
c.gfx100(199);
}
// sendSkillXP(skill, (int) xp);

setSkillLevel(skill, c.playerLevel[skill], c.playerXP[skill]);
refreshSkill(skill);

return true;
}[/QUOTE]

Now all you gotta do is add at the beggining of it
[code]
if(c.rookie = 1)
xp = xp*MULTIPYER
if(c.average = 1)
xp = xp*MULTIPYER
if(c.legend = 1)
xp = xp*MULTIPYER[/code]

This will only work for your xp rate. You still might need a way to auto change players rank after a certain total xp or level or time played

##### Share on other sites
• 0
[quote name='Phat']You gotta find your method that adds the xp should be something like this

Now all you gotta do is add at the beggining of it
[code]
if(c.rookie = 1)
xp = xp*MULTIPYER
if(c.average = 1)
xp = xp*MULTIPYER
if(c.legend = 1)
xp = xp*MULTIPYER[/code]

This will only work for your xp rate. You still might need a way to auto change players rank after a certain total xp or level or time played[/QUOTE]

That's an insanely bad way of doing it. :L

##### Share on other sites
• 0
Like what file should i do it in? My player class is like all messed up?

##### Share on other sites
• 0
[quote name='Stacx']That's an insanely bad way of doing it. :L[/QUOTE]

You seem like you no what your doing can you help me?

##### Share on other sites
• 0
Can anybody help me please? Im trying this but what file is it in?

×
• Home

• RSPS List

• Clubs