Okay so my problem is as the title sounds, I am making a rsps in which you choose to follow guthix or saradomin and you choose to follow them by clicking on their statue and you get their cape ect,ect. Anyway I made this:
This is in my playersave.java
Code:
} else if (token.equals("character-follows")) {
p.follows = Integer.parseInt(token2);
Code:
characterfile.write("character-follows = ", 0, 20);
characterfile.write(Integer.toString(p.follows), 0, Integer.toString(p.follows).length());
characterfile.newLine();
This is in my player.java
Code:
public int follows;
Anyway, on the statue I want them to change the character-follows=0 to like character-follows=1 when they click on the guthix statue and character-follows=2 when they click on the saradomin statue.
Thanks, tell me if you need more info this is my first time posting
Edit: Hey guys I thought this info would help
This is what the statue looks like in my ActionHandler.java
Saradomin:
Code:
case 2873:
if (!c.getItems().ownsCape()) {
c.startAnimation(645);
c.sendMessage("You choose to follow saradomin.");
c.getItems().addItem(2412, 1);
} else {
c.sendMessage("You already chose a god to follow!");
}
break;
Guthix:
Code:
case 2875:
if (!c.getItems().ownsCape()) {
c.startAnimation(645);
c.sendMessage("You choose to follow guthix.");
c.getItems().addItem(2413, 1);
} else {
c.sendMessage("You already chose a god to follow!");
}
break;
I did it myself, if anyone else is trying to do this I added this to the statues
Code:
Client p = (Client) Server.playerHandler.players[1];
p.follows = 1;
CLOSE TOPIC PLEASE