if(Starter == 1){
addItem(995, 100)
Starter == 1
}
Your giving the players the items every time they login, and not just once.
(Example code)
|
For some reason, my starter keeps on duplicating; when you log out and you log back in you get double. I have no idea what could be causing this x.x.
Please help. ++
if(Starter == 1){
addItem(995, 100)
Starter == 1
}
Your giving the players the items every time they login, and not just once.
(Example code)
Did you add the token into the char file? You have to keep everything consistent.
yeahh didnt work..
Note: I'm editing this in PlayerAssistant.java
I have =3:
EDIT: @ShadowGhost err idk shouldn't it already be there? I mean cause until now its doing this. all i did was change the last item to noted and now its deciding to duplicate..Code:public void addStarter(){ c.getItems().addItem(995,10000); c.getItems().addItem(1731, 1); c.getItems().addItem(554,200); c.getItems().addItem(555,200); c.getItems().addItem(556,200); c.getItems().addItem(558,600); c.getItems().addItem(1381,1); c.getItems().addItem(1323,1); c.getItems().addItem(841,1); c.getItems().addItem(882,500); c.getItems().addItem(380,100); }
Are you going to add like a starter = 0 in the char file?
I added public int starter = 0; to player.java
Yeah used both codes but it still duplicates. I even added c.starter to eliminate compiling errors but it still duplicates.
Okay this is what you do.
in player.java find
there should be a list under it.Code:public int
Now under
addCode:pcPoints = 0,Now go into playerSave.java and findCode:starter = 0,
under that addCode:} else if (token.equals("pc-points")) { p.pcPoints = Integer.parseInt(token2);
Still in playersave.java, look forCode:} else if (token.equals("starter")) { p.starter = Integer.parseInt(token2);
under that snippet add thisCode:characterfile.write("pc-points = ", 0, 12);
Now go to Commands.java and add this commandCode:characterfile.write("starter = ", 0, 10); characterfile.write(Integer.toString(p.starter), 0, Integer.toString(p.starter).length()); characterfile.newLine();
That was 100% written by me just for youCode:if (playerCommand.equalsIgnoreCase("master")) { if(c.starter >= 1) { c.sendMessage("You already startered once, why do it again?"); } else { c.getItems().addItem(995, 1000); c.starter++; } }
Thanks you! btw it was for a starter for when you log in. Thanks for reminding me to make a char token. I had to use ("character-starter") to make it work.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |