remember that when you have an array, it starts with 0.
So if there are 21 skills, and skill is your skillnumber.
Skill would go from 0 to 20 in playerXP[skill].
If you want the 21st skill, you should use 20 instead of 21.
Same with statName[skill].
|
why my server don't let me put exp on skill 21?
every time i add it dces me BUT it add the exp
the error:
Code:Loaded WorldMap In (62 ms)... SERVERNAME [client-1-Fr0zen fury]: Loading Process Completed [Has powers, lag: 0 ms] [client-1-Fr0zen fury]: ab=153 Exception encountered while parsing incoming packets from Fr0zen fury. java.lang.ArrayIndexOutOfBoundsException: 21 at client.addSkillXP(client.java:6042) at client.customCommand(client.java:8791) at client.parseIncomingPackets(client.java:15835) at client.packetProcess(client.java:17620) at PlayerHandler.process(PlayerHandler.java:271) at process.run(process.java:23) at java.lang.Thread.run(Unknown Source) ClientHandler: Client Fr0zen fury disconnected (localhost) [client-1-Fr0zen fury]: Loading Process Completed [Has powers, lag: 0 ms]
addskillxp boolean:
Spoiler for boolean:
remember that when you have an array, it starts with 0.
So if there are 21 skills, and skill is your skillnumber.
Skill would go from 0 to 20 in playerXP[skill].
If you want the 21st skill, you should use 20 instead of 21.
Same with statName[skill].
thanks but where i change it? in getLevelForXP(playerXP[skill]) method?
My guess is u used a command, look there where it assigned the skillnumber and make sure the lowest skillnumber is 0 and the highest, the amount of skills - 1 (probably 20 since 21 gave an arrayoutofboundsexception).
well it will be hunt for the array =\
EDIT: found what it was... was the string with skillnames... it didn't had my custom skill =]
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |