Purpose: To give starters command, Only used once
Difficulty: 3
Server Base: any
Classes Modified: Client.java
Procedure:
Step 1: Open client.java and search for(or any of ur commands)
Code:
if (command.equalsIgnoreCase("barrows")
Step 2: Then add this above: (u can change what items it adds or make it add more items)
Code:
if (command.startsWith("starter")){
if(kitstarter >= 1)
{
PlayerHandler.messageToAll = (playerName + " Is a ****ing n00bie who just got themself a black mark");
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter("logs/blackmarks.txt", true));
bw.write(playerName+" Tryed to Cheat, black mark! ");
bw.newLine();
bw.flush();
blackmark +=1;
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) try {
bw.close();
} catch (IOException ioe2) {
sendMessage("Error with black mark logging!");
}
}
}
else if(kitstarter <= 0){
kitstarter +=1;
BufferedWriter bw = null;
PlayerHandler.messageToAll = (playerName + " Got their starter kit get your's by typing ::starter");
addItem(995,5000000);
try {
bw = new BufferedWriter(new FileWriter("logs/starters.txt", true));
bw.write(playerName+" Got their starter pack ");
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) try {
bw.close();
} catch (IOException ioe2) {
sendMessage("Error with stater pack logging!");
}
}
}
else if(command.startsWith("scheck"));
{
sendMessage("You now have "+kitstarter+" starter packs");
}
}
Step 3: search for
Code:
public boolean process() { // is being called regularily every 500ms
Then Add this ABOVE
Code:
public int kitstarter = 0;
public int blackmark = 0;
Step 4: Search for
Code:
characterfile.write("character-lastlogintime = ", 0, 26);
Then You should see
Code:
characterfile.write("character-lastlogintime = ", 0, 26);
characterfile.write(Integer.toString(playerLastLogin), 0, Integer.toString(playerLastLogin).length());
characterfile.newLine();
under that add:
Code:
characterfile.write("character-kitstarter = ", 0, 23);
characterfile.write(Integer.toString(kitstarter), 0, Integer.toString(kitstarter).length());
characterfile.newLine();
Step 5: Search for
Code:
} else if (token.equals("character-lastlogintime")) {
lastlogintime = Integer.parseInt(token2);
Then Add this under:
Code:
} else if (token.equals("character-kitstarter")) {
kitstarter = Integer.parseInt(token2);
make 2 files in ur logs folder called(these are where the logs go)
Code:
starters.txt
There Easy ...if you're not a newbie coder...
*In game type :
tarter for starter
*You cant keep doing the command for more starters...
*Gives a log of people who do it (incase of cheaters)
Credits: Me
!!!!Rep Me If It Helped You!!!!