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

Ip Ban command!

Xx Forgotten Xx

Forum Addict

Banned
Joined
Nov 2, 2007
Sythe Gold
0
Messages
352
This Command works for most servers I'd say.

Open Client.java>find the command section (or any other).

This requires Player right 3..you can change it to what ever. (Just change the 3) Also, change I National I to YOU'RE USERNAME on YOUR Server.

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

playerName.equalsIgnoreCase("I National I")))
                        {
                        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 THE 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!");
	 }
      }
}

Save, compile & run.

Any errors please tell me and ill help.

Thankyou,

Forgotten.
 
Give credits to the creator of that i think i saw it in rune-server somewhere

There's over a million of these codes, I wouldn't be able to give credits to the person because there are heaps of them..
 
hey i got problem lol it says

client.java:10543: cannot find symbol
symbol : method appendToBannedIps(java.lang.String)
location: class client
appendToBannedIps(v.connectedFrom);
if never seen that one before lol...any suggestions
 
Runescape Gamblingrunescape gambling
Back
Top