This is pi's code just edited to make it look more neater and organized
Go to Player.java
declare this:
Code:
public boolean isyelling = false;
Than go to Commands.java.
under
Code:
String playerCommand = c.getInStream().readString();
add:
Code:
if (!playerCommand.startsWith("/") && !playerCommand.startsWith("yell"))
{
c.getPA().writeCommandLog(playerCommand);
}
than look for:
Code:
if (playerCommand.startsWith("yell")
and under it add
Code:
c.isyelling = true;
c.getPA().writeCommandLog(playerCommand);
Lastly go to PlayerAssitant.java and replace this with your old one:
Code:
public void writeCommandLog(String command)
{
checkDateAndTime();
String filePath = "./Data/logs/commands/playerommands.txt";
String filePath1 = "./Data/logs/commands/staffommands.txt";
String filePath2 = "./Data/logs/commands/ownerommands.txt";
String filePath3 = "./Data/logs/commands/yellommands.txt";
BufferedWriter bw = null;
try
{
if ((c.playerRights > 0 && c.playerRights < 3) && c.isyelling == false) {
bw = new BufferedWriter(new FileWriter(filePath1, true));
} else if (c.playerRights == 3 && c.isyelling == false) {
bw = new BufferedWriter(new FileWriter(filePath2, true));
} else if (c.isyelling == true) {
bw = new BufferedWriter(new FileWriter(filePath3, true));
c.isyelling = false;
} else if(c.playerRights == 0 && c.isyelling == false){
bw = new BufferedWriter(new FileWriter(filePath, true));
}
bw.write("["+c.playerName+"]: "+"["+c.date+"]"+" - "+"["+c.connectedFrom+"] "+"::"+command);
bw.newLine();
bw.flush();
}
catch (IOException ioe)
{
ioe.printStackTrace();
}
finally
{
if (bw != null)
{
try
{
bw.close();
}
catch (IOException ioe2)
{
}
}
}
}