-
Account Upgraded | Title Enabled!
[Tut] game banning command
NOTE: you must have the file Data/bannedips.txt for this to work.
NOTE: always make a backup before trying anything with client.java
1.Open up Client.JAVA and hold ctrl+F and search for
if(command.startsWith
and paste this right above the result:
if(command.startsWith("banuser") && (playerRights >= 2))
{
String victim = command.substring(8);
PlayerHandler.kickNick = victim;
System.out.println("Admin:"+playerName+" is banning "+victim);
sendMessage("Player "+victim+" successfully banned");
appendToBanned(victim);
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter("logs/banlogs.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 bans!");
}
}
try {
bw = new BufferedWriter(new FileWriter("./logs/banlogs.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 bans!");
enjoy
-
-
Apprentice
Re: [tut] in game banning command
hmm awsome tut but do u need to compile server after this? if u have to i cant cos i dont have JDK do u no the link 4 download? add meh msn plus900@hotmail.co.uk
-
There's no RL just AFK
Re: [tut] in game banning command
Nice.. straight out of a source, also you haven't put the code in code tags, and also just from a quick glance , that code will make people's servers throw errors as you have not supplied the whole extracted code from said source.
-
Account Upgraded | Title Enabled!
Re: [tut] in game banning command
Almost all servers got this, so its kinda useless.. And i tryed,