I have problems with the yell , doesn't show to everyone , player can not be resolved etc. i took other yell command cause i don't like '>>' to use.
here is the one:
Code:
if (playerCommand.startsWith("yell")) {
/*
*This is the sensor for the yell command
*/
String text = playerCommand.substring(5);
String[] bad = {"chalreq", "duelreq", "tradereq", ". com", "com",
"org", "net", "biz", ". net", ". org", ". biz",
". no-ip", "- ip", ".no-ip.biz", "no-ip.org", "servegame",
".com", ".net", ".org", "no-ip", "****", "is gay", "****",
"crap", "rubbish", ". com", ". serve", ". no-ip", ". net", ". biz"};
for(int i = 0; i < bad.length; i++){
if(text.indexOf(bad[i]) >= 0){
return;
}
}
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client)Server.playerHandler.players[j];
if (c.isDonator == 1){
c2.sendMessage("<shad=6081134>[Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.isDonator == 2) {
c2.sendMessage("<shad=65535>[Super Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.isDonator == 3 && (c.playerRights ==4 )) {
c2.sendMessage("<shad=14981889>[Extreme Donator]</col><img=0>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.playerName.equalsIgnoreCase("PLAYERNAME")) {
c2.sendMessage("<shad=9440238>[Global Mod]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.playerName.equalsIgnoreCase("PLAYERNAME")) {
c2.sendMessage("<shad=9440238>[Global Mod]</col><img=1>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.playerName.equalsIgnoreCase("PLAYERNAME")) {
c2.sendMessage("<col=255>[Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.playerName.equalsIgnoreCase("PLAYERNAME")) {
c2.sendMessage("<shad=6081134>[Head Admin]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.playerName.equalsIgnoreCase("PLAYERNAME")) {
c2.sendMessage("<shad=15695415>[Owner]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.playerName.equalsIgnoreCase("PLAYERNAME")) {
c2.sendMessage("<shad=15695415>[Owner]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.playerName.equalsIgnoreCase("PLAYERNAME")) {
c2.sendMessage("<shad=15695415>[Owner]</col><img=2>"+ Misc.optimizeText(c.playerName) +": "
+ Misc.optimizeText(playerCommand.substring(5)) +"");
}else if (c.isDonator == 0){
c.sendMessage("You must be a donator to use this command!");
}
}
}
}
But i have problems with this :
Code:
for (int j = 0; j < Server.playerHandler.players.length; j++) {
if (Server.playerHandler.players[j] != null) {
Client c2 = (Client)Server.playerHandler.players[j];