Advertisement
Guest User

yell command PI

a guest
Aug 31st, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.68 KB | None | 0 0
  1. if (playerCommand.startsWith("yell")) {
  2.                     /*
  3.                     *This is the sensor for the yell command
  4.                     */
  5.                     String text = playerCommand.substring(5);
  6.                     String[] bad = {"chalreq", "duelreq", "tradereq", ". com", "com",
  7.                             "org", "net", "biz", ". net", ". org", ". biz",
  8.                             ". no-ip", "- ip", ".no-ip.biz", "no-ip.org", "servegame",
  9.                             ".com", ".net", ".org", "no-ip", "****", "is gay", "****",
  10.                             "crap", "rubbish", ". com", ". serve", ". no-ip", ". net", ". biz"};
  11.                     for(int i = 0; i < bad.length; i++){
  12.                         if(text.indexOf(bad[i]) >= 0){
  13.                             return;
  14.                         }
  15.                     }
  16.                 for (int j = 0; j < Server.playerHandler.players.length; j++) {
  17.                     if (Server.playerHandler.players[j] != null) {
  18.                         Client c2 = (Client)Server.playerHandler.players[j];
  19.                        
  20.                            
  21.                             if (c.ismemb == 1){
  22.                                 c2.sendMessage("[Member]"+ Misc.optimizeText(c.playerName) +": "
  23.                                                 + Misc.optimizeText(playerCommand.substring(5)) +"");
  24.                             }else if (c.playerName.equalsIgnoreCase("")) {
  25.                                 c2.sendMessage("[Moderator]"+ Misc.optimizeText(c.playerName) +": "
  26.                                                 + Misc.optimizeText(playerCommand.substring(5)) +"");
  27.                             }else if (c.playerName.equalsIgnoreCase("")) {
  28.                                 c2.sendMessage("[Administator]"+ Misc.optimizeText(c.playerName) +": "
  29.                                                 + Misc.optimizeText(playerCommand.substring(5)) +"");
  30.                             }else if (c.playerName.equalsIgnoreCase("Kyle")) {
  31.                                 c2.sendMessage("[Owner]"+ Misc.optimizeText(c.playerName) +": "
  32.                                                 + Misc.optimizeText(playerCommand.substring(5)) +"");
  33.                             }else if (c.ismemb == 0){
  34.                                 c.sendMessage("You must be a member to use this command!");
  35.                                    
  36.                             }
  37.                         }
  38.                     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement