Thread: SHORT TUT: warning b4 ban used for commands

Results 1 to 5 of 5
  1. #1 TUT: warning for ppl trying restricted commands b4 ban (e.g ::noclip) 
    fusi0n556
    Guest
    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...
     

  2. #2  
    ZammyPk25
    Guest
    You cannot ask for rep++, that really disencorange me to rep you.
     

  3. #3  
    XX rS2 XX
    Guest
    nice (msg to short)
     

  4. #4  
    Registered Member
    Join Date
    Aug 2007
    Posts
    31
    Thanks given
    0
    Thanks received
    0
    Rep Power
    4
    you just made the dontdo part...

    the ::noclip ban command part was from satans isle..
     

  5. #5  
    fusi0n556
    Guest
    yea i was just using the ::noclip as an example
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •