My script is below , I just have a problem , like i talk , it will go in John : [noob]John : blablabl .
But my occupation is BankaiRailer.
PHP Code:
public final void handlePacket(SeekableLittleEndianAccessor slea, MapleClient c) {
String text = slea.readMapleAsciiString();
try {
try {
if (!CommandProcessor.processCommand(c, text) && c.getPlayer().getCanTalk()) {
if (c.getPlayer().getOccupation() != (MapleOccupations.BankaiRailer)) { //if the player has any occupation (change this accordingly)
c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getChatText(c.getPlayer().getId(),"[BankaiRailer]" + c.getPlayer().getName() + ": " + text , c.getPlayer().getGMChat(), slea.readByte())); //don't blindly trust this part tho, read underneath
ChatLog.getInstance().add("["+ChatLog.getInstance().generateTime()+"]" + " [All] " + c.getPlayer().getName() + ": " + text);
if (ChatLog.getInstance().getChat().size() >= 0) ChatLog.getInstance().makeLog(); //change 500 to w/e
}
if (!c.getPlayer().getCheatTracker().Spam(300, 1)) {
if (c.getPlayer().isDonor()) {
c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.sendYellowTip("" + c.getPlayer().getName() + ": " + text));
c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getChatText(c.getPlayer().getId(), text, false, 1));
ChatLog.getInstance().add("["+ChatLog.getInstance().generateTime()+"]" + " [All] " + c.getPlayer().getName() + ": " + text);
if (ChatLog.getInstance().getChat().size() >= 0) ChatLog.getInstance().makeLog(); //change 500 to w/e
} else {
c.getPlayer().getMap().broadcastMessage(MaplePacketCreator.getChatText(c.getPlayer().getId(), text, c.getPlayer().getGMChat(), slea.readByte()));
ChatLog.getInstance().add("["+ChatLog.getInstance().generateTime()+"]" + " [All] " + c.getPlayer().getName() + ": " + text);
if (ChatLog.getInstance().getChat().size() >= 0) ChatLog.getInstance().makeLog(); //change 500 to w/e
}
}
}
} catch (RemoteException ex) {
Logger.getLogger(GeneralchatHandler.class.getName()).log(Level.SEVERE, null, ex);
} catch (IllegalCommandSyntaxException ex) {
Logger.getLogger(GeneralchatHandler.class.getName()).log(Level.SEVERE, null, ex);
}
} catch (SQLException ex) {
Logger.getLogger(GeneralchatHandler.class.getName()).log(Level.SEVERE, null, ex);
}
if (c.getPlayer().getWatcher() != null) {
c.getPlayer().getWatcher().dropMessage("[" + c.getPlayer().getName() + " All] : " + text);
}
}
}
Please tell me how to fix it .