Ugh are people still making shit code like this? Freezia, l2 conventions.
Replace your yell command with this:
Code:
if (playerCommand.startsWith("yell")) {
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] == null)
continue;
Client c2 = (Client)Server.playerHandler.players[j];
c2.getItems().deleteItem(4045, 9999);
if (Connection.isMuted(c))
return;
if (c.Jail == true){
c.sendMessage("You can't yell whilst in jail!");
return;
}
c2.sendMessage(c.getRank() + Misc.optimizeText(c.playerName) +": "+ Misc.optimizeText(playerCommand.substring(5)) +"");
}
}
And add this method to the Player class (Player.java for teh newbs)
Code:
public static String getRank() {
if(playerName.equals("Ali"))
return "<shad=15695415>[Beast Coder]</col><img=5>";
switch(playerRights) {
case 0:
if(c.isDonator == 1)
return "<shad=6081134>[Donator]</col><img=0>";
return "[Player]";
case 1:
return "<shad=123456>[Head Mod]</col><img=1>";
case 2:
return "<shad=65535>[Admin]</col><img=2>";
case 3:
return "<shad=255>[Co-Owner]</col><img=2>";
case 5:
return "<shad=6081134>[Super Donator]</col><img=0>;
}
}