declarein player.java..public int starter = 0;
|
Ok, I set my starter to 10m, but I want it so it can only be used once per account, can someone please explain how to do this.
In my command.Java this is what I have for starter:
}
if (cmd[0].equals("starter")) {
Engine.playerItems.addItem(p, 995, 10000000);
p.starter = 1;
But for some reason, I can keep on typing it and keep on getting 10m over and over again when I only want it to work once.
Can someone please tell me how to fix this, and if needed, what to change it to.
declarein player.java..public int starter = 0;
change it to
Code:if (cmd[0].equals("starter") && p.starter == 0)) { Engine.playerItems.addItem(p, 995, 10000000); p.starter = 1; }
The weird part is, if I change it to what you guys told me, it won't let me use :tarter at all, like I will type it in, and not get a starter.
Also with this command:
if (cmd[0].equals("starter") && p.starter == 0)) {
Engine.playerItems.addItem(p, 995, 10000000);
p.starter = 1;
}
after I do that, save and then compile, it shows up with one error, pointing to the second bracket-->) after p.starter == 0)) <---The one right there.
My brother tried helping me by changing it around a little bit, and it now works, but once you relog, you can type :tarter and get another 10m.
Here is what it looks like right now:
}
if (cmd[0].equals("starter") && p.starter == 0) {
Engine.playerItems.addItem(p, 995, 10000000);
p.starter = 1;
}
if (cmd[0].equals("starter")) {
I know it looks weird, but the problem with this one is you only get one starter, but if you relog you get 1 more, and you can keep on relogging and getting 1 starter per relog.
then in player,
int starter = 0;
I have, does it matter where I add the coeds, or do I have to do it in a certain spot?
BUMP!!!
Ok, so i'll explain the problem a little bit better,
So I have added a :tarter into the game, it's 10m cash.
If I log in and type :tarter, I will get the 10m cash, and if I try to type :tarter again, I will not get a second starter.
When I log out, and log back in, and try and type starter, on the same account, I will get another 10m cash, and you can keep on relogging and typing :tarter once per login, and keep on getting 10m cash.
I've tried adding Public int starter = 0; but that doesn't seem to help.
This is Codeusa btw, and it's z508, so it doesn't have login.java and stuff for some reason
Please help, i've been trying to find this for 4 days now.
Z508 has Rs2LoginProtocol almost the same like Login.java
in commands. use this
Player.java Under:if (cmd[0].equals("starter")) {
if (p.starter == 0) {
Engine.playerItems.addItem(p, 995, 1000000);
Add More items Here
p.starter = 1;
} else {
p.frames.sendMessage(p, "You already have your starter set");
}
}Add thispublic int wildernessLevel;
In Filemanager.javapublic int starter = 0;
Understream.writeString("starter:" + p.starter);
andstream.writeString("gender:" + p.gender);Underelse if (line.startsWith("starter:"))
p.starter = Integer.parseInt(line.substring(8));Bl1tzzelse if (line.startsWith("gender:"))
p.gender = Integer.parseInt(line.substring(7));
Thank you soo much, it finally worked!!
Rep for you
Thanks again, and thanks to everyone who tried helping!
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |