Make it save in PlayerSave.java
|
I already added a skillpoint system and :killpoints to know how many skill points you have.
but i have problems when relogging.
Example: I have 150 SkillPoints But i Relogged and it became 0.
Thats the problem. I can't fix it I need ur help guys. Thanks.
My Skype:akosikuyakevz
Make it save in PlayerSave.java
Exactly what he said. To do this however you need to make sure that when the file is being read, it's reading a line in the file to which you want the variable store such as so.
To write to the file you would use something like this.Code:if(string.equals("point-system")) player.setPointSystem(Integer.parseInt(concatenatedString);
Wrote this on here, don't hate on me for conventional use.Code:file.write("point-system = "+p.getPointSystem()); file.newLine();
On my playerassistant.java. I added this code under "public void levelUp(int skill) {"
Code:c.skillPoints += getLevelForXP(c.playerXP[skill]); c.sendMessage("You gained " + getLevelForXP(c.playerXP[skill]) + " skill points.");
BUMP. I'm back from coding and this is still my problem
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |