Originally Posted by
Charles
Well the error just says the sendMassMessage method required 2 Strings and your only sending 1.
Post your sendMassMessage() to be sure. Also that message string looks really messed up....Why is there 2 quotation marks at the end..
Ehh it's yell command, i like to add so other ppl can see who jailed who x.x
here is my massmessage method :
Code:
public void sendMassMessage(String s, String s1) {
for (int j = 0; j < PlayerHandler.players.length; j++) {
if (PlayerHandler.players[j] != null) {
Client c2 = (Client)PlayerHandler.players[j];
c2.sendMessage("["+s+"]: "+s1);
}
}
}
There is my jail command .-.
Code:
if(playerCommand.startsWith("jail")) {
if(c.inWild()) {
c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, get out of the wild to jail-unjail!");
return;
}
if(c.InDung()) {
c.sendMessage("<shad=15695415>DO NOT ABUSE</col>, You can not jail when inside Dungeoneering");
return;
}
try {
String playerToBan = playerCommand.substring(5);
for(int i = 0; i < Config.MAX_PLAYERS; i++) {
if(PlayerHandler.players[i] != null) {
if(PlayerHandler.players[i].playerName.equalsIgnoreCase(playerToBan)) {
Client c2 = (Client)PlayerHandler.players[i];
if(c2.InDung()) {
c.sendMessage("You cannot Jail/Unjail somone in Dung.");
}
int randomjail = Misc.random(3);
if (randomjail == 1) {
c2.getPA().startTeleport(1928, 4999, 0, "modern");
}
if (randomjail == 2) {
c2.getPA().startTeleport(1928, 5000, 0, "modern");
}
if (randomjail == 3) {
c2.getPA().startTeleport(1928, 5001, 0, "modern");
}
if (randomjail == 0) {
c2.getPA().startTeleport(1928, 5002, 0, "modern");
}
c2.Jail = true;
c2.sendMessage("<shad=16711680>You have been jailed by "+c.playerName+"");
c.sendMessage("<shad=16711680>You have Jailed "+c2.playerName+".");
c.sendMassMessage("<shad=16745472>"+c.playerName+"</col> has jailed "+c2.playerName+"");
}
}
}
} catch(Exception e) {
c.sendMessage("Player Must Be Offline.");
}
}