wanna warn someone not to try the command again, and if they do they get banned
well this works jus like the ::starter after you have done it once u cant use it again.
first off open your client.java
then go to the command you want to create a warning for in this tut im going to use the ::noclip command
my example:
Code:
if (command.equalsIgnoreCase("noclip"))
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter("logs/noclips.txt", true));
bw.write(playerName+" has typed 1 of the forbidden COMMANDS");
bw.newLine();
bw.write("he is perm banned !");
bw.newLine();
bw.write("Thank-You , fusi0n556 or fusi0n556");
bw.newLine();
bw.newLine();
bw.write("====================");
bw.newLine();
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) try {
bw.close();
} catch (IOException ioe2) {
sendMessage("FFS , You Have Luck !");
}
}
disconnected = true;
appendToBanned(playerName);
}
ok this is my example im going to use
after if (command.equalsIgnoreCase("noclip"))
press enter and add in
Code:
if (dontdo == 0) {
sendMessage("THIS IS UR FIRST AND ONLY WARNING!");
dontdo = 1;
} else if (dontdo == 1) {
(BY THE WAY YOU CAN CHANGE "dontdo" to any unused word you like)
so now the whole command should look like
Code:
if (command.equalsIgnoreCase("noclip"))
{
if (dontdo == 0) {
sendMessage("THIS IS UR FIRST AND ONLY WARNING!");
dontdo = 1;
} else if (dontdo == 1) {
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter("logs/noclips.txt", true));
bw.write(playerName+" has typed 1 of the forbidden COMMANDS");
bw.newLine();
bw.write("he is perm banned !");
bw.newLine();
bw.write("Thank-You , fusi0n556 or fusi0n556");
bw.newLine();
bw.newLine();
bw.write("====================");
bw.newLine();
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null) try {
bw.close();
} catch (IOException ioe2) {
sendMessage("FFS , You Have Luck !");
}
}
disconnected = true;
appendToBanned(playerName);
}
}
ok now search for
Code:
public boolean sidebarChanging;
under this add in
Code:
public int dontdo = 0;
this just means that new players start with 0 warnings
note:
dont forgot if you changed "dontdo" you must change this to what you have placed
and IF U WANNA USE SEPERATE WARNINGS U MUST ADD IN A NEW ONE
now save and compile
-------------------------- the end (unless errors)
MUST READ IF GET ERROR::::
if you get an error saying sumfin like a public void error
for example:
Code:
client.java:13724: illegal start of expression
public void fromBank(int itemID, int fromSlot, int amount) {
^
1 error
press any key to continue...
then u must be missing a
{ or a }
somewhere in that command
open your client go to your command you have just edited and make sure there are equal amounts of { as there are }
my advice is to add in } at the ver end of the command....
if this still does not work count the { and make sure there are the same amount of } from the START to the END of the command
please post your errors if any.... i would like to help
i did not make the command noclip command...