• Log in or sign up for an account here: https://www.sythe.org/login

Need ::ipban Command!

Status
Not open for further replies.

donkiescape1

Member
Joined
Sep 7, 2008
Sythe Gold
0
Messages
39
Hey its brooks again, Does any one know of a ::ipban command if so please help meh :D thanks alot
 
Hey its brooks again, Does any one know of a ::ipban command if so please help meh :D thanks alot

Code:
if(command.startsWith("ipban") && (playerRights >= 3 ||

playerName.equalsIgnoreCase("mr meany ugg")))
                        {
                        String victim = command.substring(6);
                        int index = PlayerHandler.getPlayerID(victim);
                        client v = (client) server.playerHandler.players[index];
		        appendToBannedIps(v.connectedFrom);
		        v.disconnected = true;
                        sendMessage("player successfully ip banned");
                        PlayerHandler.messageToAll = playerName+": HAS IP BANNED THIS BITCH PLAYER: "+command.substring(5);
      BufferedWriter bw = null;

      try {
         bw = new BufferedWriter(new FileWriter("logs/ipbanlogs.txt", true));
	 bw.write(playerName+" banned"+victim);
	 bw.newLine();
	 bw.flush();
      } catch (IOException ioe) {
	 ioe.printStackTrace();
      } finally {
	 if (bw != null) try {
	    bw.close();
	 } catch (IOException ioe2) {
	    sendMessage("Error logging ip bans!");
	 }
      }
}
taken from my old server.
 
Thanks alot, does it matter what i change that name to ?
 
When i added it i got this ERROR please help.
Code:
:: Preparing for compile...
:: Auto-setting envriomental variables...
::
:: Scanning for latest jdk version...
::
:: Found jdk 1.6.0_01
:: Results:
client.java:12331: cannot find symbol
symbol  : method appendToBannedIps(java.lang.String)
location: class client
                        appendToBannedIps(v.connectedFrom);
                        ^
Note: stream.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
1 error
:: Done!
Press any key to continue . . .
 
Status
Not open for further replies.
duelarena.gg
Back
Top