View Full Version : How do you make a ::explock && ::unlock command?
Shadow Ranqe
June 18th, 2010, 00:12
Exactly what the title says...
bloodpk3r
June 18th, 2010, 01:07
this is what i use for it :) -- didnt leech this -- straight from my bbs source i added this in last summer
go into client.java
public boolean addSkillXP(int amount, int skill) {
underneath that add
if(expLock) {
return true;
}
then where you add your commands put
if (command.equalsIgnoreCase("lock")) {
expLock = true;
sM("EXP Lock Activated.");
}
if (command.equalsIgnoreCase("unlock")) {
expLock = false;
sM("EXP Lock De-Activated.");
}
in player.java add
public boolean expLock = false;
also if you want it to save to character files your going to want to add it in:
} else if (token.equals("character-expLock")) {
expLock = Boolean.parseBoolean(token2);
and
characterfile.newLine();
characterfile.write("character-expLock = ", 0, 20);
characterfile.write(Boolean.toString(expLock), 0, Boolean.toString(expLock).length());
anyways hope this helped :)
Shadow Ranqe
June 18th, 2010, 01:19
Umm I don't have that first public boolean O_o
Aaron
June 18th, 2010, 01:20
What do you mean Public Boolean?
Sunni
June 18th, 2010, 01:20
He means he can't find
public boolean addSkillXP(int amount, int skill) {
Shadow Ranqe
June 18th, 2010, 01:22
Read bloodpk3r's post?
Shadow Ranqe
June 18th, 2010, 01:22
Ugh..I'm sorry not that good at coding, I'm only just learning how and I don't have another coder to help me so... =[
The Soul
June 18th, 2010, 01:32
this is what i use for it :) -- didnt leech this -- straight from my bbs source i added this in last summer
go into client.java
public boolean addSkillXP(int amount, int skill) {
underneath that add
if(expLock) {
return true;
}
then where you add your commands put
if (command.equalsIgnoreCase("lock")) {
expLock = true;
sM("EXP Lock Activated.");
}
if (command.equalsIgnoreCase("unlock")) {
expLock = false;
sM("EXP Lock De-Activated.");
}
in player.java add
public boolean expLock = false;
also if you want it to save to character files your going to want to add it in:
} else if (token.equals("character-expLock")) {
expLock = Boolean.parseBoolean(token2);
and
characterfile.newLine();
characterfile.write("character-expLock = ", 0, 20);
characterfile.write(Boolean.toString(expLock), 0, Boolean.toString(expLock).length());
anyways hope this helped :)
You're checking if the variable 'expLock' is true, then return true - you need to be returning false.
Shadow Ranqe
June 18th, 2010, 01:35
There's still the problem that I can't find " public boolean addSkillXP(int amount, int skill) {" in client.java.....Is it named something else in Delta? O_o
bloodpk3r
June 18th, 2010, 01:37
i had it returning false to begin with and it would only work by command on the server -- i changed it so i can have players start of not gaining exp throughout my
tutorial island (for skillers purposes) then when they reach the main land they get explock turned off and they can start to play.. i shouldnt need to prove to you that it works like this but it works for me tested it three times on different accounts and had my friend also in beta test it :) but the commands shud still work no matter what ive put there it still works on my server atm so i dont see why it shouldnt. :/ err as to the earlier question of i cant find
public boolean addSkillXP(int amount, int skill) {
look for things that are similar to that -- what source are you using?
i use delta atm it might be different for other sources but im fairly sure there will be something similar somewhere and
thats where you should put it.. try just searching for (addSkillXP) or something similar sometimes between sources names change but only slightly so i would
have a good search before dismissing that it exists
ofc i might be wrong and it doesnt exist altho have a search first i dont know much about other sources than delta
Shadow Ranqe
June 18th, 2010, 01:40
I'm using a delta based, just edited- Para's source. I searched "public boolean addSkillXP" and didn't find it.
client.java - 667 Kb (Only the registered members can see the link.) There's my client.java if you want to see it...I don't like Para's methods but I liked the base layout for everything so I stuck with it.
The Soul
June 18th, 2010, 01:43
I'm using a delta based, just edited- Para's source. I searched "public boolean addSkillXP" and didn't find it.
client.java - 667 Kb (Only the registered members can see the link.) There's my client.java if you want to see it...I don't like Para's methods but I liked the base layout for everything so I stuck with it.
Well I just took a look and it's definitely in there. ;)
Sunni
June 18th, 2010, 01:46
Indeed it is, but I see it as acting as a genie lamp :/
bloodpk3r
June 18th, 2010, 01:48
mate go to edit in ur client.java press find
public boolean addSkillXP(int amount, int skill) {
thats straight from your client.java mate :)
put it there
Shadow Ranqe
June 18th, 2010, 01:51
LOL my bad. My notepad is weird. If there's spaces before the code it won't find it =[ Thank you :D
Sunni
June 18th, 2010, 01:56
Like I said, that method is used as a genie lamp in his client.java, I don't know if that means anything in this case.
bloodpk3r
June 18th, 2010, 02:20
no the genie lamp is a part of that case thats not the be all and end all of his method theres more to it if you read the rest.. yes thats where you need to put it mate :)
Powered by vBulletin® Version 4.1.9 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.