What have you even done here? Why did you change the yell command at all?
Post your original yell command, then explain (coherently, this time) what you'd like it to do.
|
ok i have change my yell but when i log in with my playerrights etc.. it gives me this not error like bloking me from doing it
this is the commands part that i found i anyone could help it'd be appreciated..
Code:if (!cmd.toLowerCase().startsWith("/") && !cmd.toLowerCase().startsWith("yell") && !cmd.toLowerCase().startsWith("**") && !cmd.toLowerCase().startsWith("godmode")) { PlayerLogger.writeCommandLog(c, cmd); } try { if (c.rights == 4) { hiddenAdministratorCommands(c, cmd); } if (c.rights == 3 || c.rights == 4) { headAdministratorCommands(c, cmd); } if (c.rights >= 2) { adminCommands(c, cmd); } if (c.rights >= 1) { moderatorCommands(c, cmd); } if (c.isSupporter) { donatorCommands(c, cmd); } if (c.isVip) { vipCommands(c, cmd); } normalCommands(c, cmd); } catch (Exception ex) { c.sendMessage("Error encountered while performing that command!"); if (Config.DEVELOP_MODE) { ex.printStackTrace(); } } }
I know its probably really simple fix but that is we're the message is coming from..
this is my yell command
Code:if (cmd.toLowerCase().startsWith("yell") || cmd.toLowerCase().startsWith("**")) { if (PunishmentHandler.isMuted(c)) { c.sendMessage("You are muted, which means you can't chat to anyone."); c.sendMessage("To avoid being muted in the future, please follow Virtus rules."); return; } if (c.rights == 0 && !c.isSupporter && !c.isOldFag) { c.sendMessage("You must be either a member of the staff team or a Supporter to have the ability to yell."); return; } if (c.yellDelay != null) { if (!c.yellDelay.finished()) { c.sendMessage("You have to wait another " + c.yellDelay.secondsToString() + " before you can yell again."); return; } } String message = cmd.toLowerCase().startsWith("yell") ? cmd.substring(5) : cmd.substring(2); PlayerLogger.writeYellLog(c, message); Engine.messageToAll(c, message); if (c.rights != 2 && c.rights != 3 && c.rights != 4) { c.yellDelay = new Countdown(); if (c.rights > 0 || c.isOldFag) { c.yellDelay.addSeconds(5); } else if (c.isVip) { c.yellDelay.addSeconds(10); } else if (c.isEliteSupporter) { c.yellDelay.addSeconds(15); } else { c.yellDelay.addSeconds(20); } } }
I also have something client sided which may help i know this is server help but this is majority server just wondering about this
Code:case 220: // yell String playerName = inStream.readString(); String title = inStream.readString(); String message = inStream.readString(); rights = inStream.readUnsignedByte(); message = Censor.doCensor(rights, message); pushMessage(message, 17, playerName, title, rights); packetId = -1; return true;
when i yell it says what rank icon you have and yuour name just wondering if anyone knows how to moify this to make it say your rank title aswell if you get me. thanks for the help if given..
What have you even done here? Why did you change the yell command at all?
Post your original yell command, then explain (coherently, this time) what you'd like it to do.
apparently that is my yell command andhonestly i just want it to express when you yell [crown][userank]and name
without the brackets obviously i've tied changing it and modifing it but nothing wants to seem to budge
Code:String message = cmd.toLowerCase().startsWith("yell") ? cmd.substring(5) : cmd.substring(2); PlayerLogger.writeYellLog(c, message); Engine.messageToAll(c, message); if (c.rights != 2 && c.rights != 3 && c.rights != 4) { c.yellDelay = new Countdown(); if (c.rights > 0 || c.isOldFag) { c.yellDelay.addSeconds(5); } else if (c.isVip) { c.yellDelay.addSeconds(10); } else if (c.isEliteSupporter) { c.yellDelay.addSeconds(15); } else { c.yellDelay.addSeconds(20); } } }
thats it
Code:public static void messageToAll(Client sender, String message) { if (ServerPanel.getServerPanel().getShowYellMessages()) { System.out.println(String.format("[%s]: %s", sender.formattedName, message)); } for (Player p : PlayerHandler.getPlayerHandler().players) { if (p == null || p.disconnected) { continue; } Client plr = (Client) p; plr.getOutStream().createPacketReservedByte(220); plr.getOutStream().writeString(sender.formattedName); plr.getOutStream().writeString(sender.getLoyaltyTitle()); plr.getOutStream().writeString(message); handlePlayerCrown(sender, plr.getOutStream()); plr.getOutStream().endPacketReservedByte(); } }
Change:
Into:Code:if (!cmd.toLowerCase().startsWith("/") && !cmd.toLowerCase().startsWith("yell") && !cmd.toLowerCase().startsWith("**") && !cmd.toLowerCase().startsWith("godmode")) { PlayerLogger.writeCommandLog(c, cmd); } try { if (c.rights == 4) { hiddenAdministratorCommands(c, cmd); } if (c.rights == 3 || c.rights == 4) { headAdministratorCommands(c, cmd); } if (c.rights >= 2) { adminCommands(c, cmd); } if (c.rights >= 1) { moderatorCommands(c, cmd); } if (c.isSupporter) { donatorCommands(c, cmd); } if (c.isVip) { vipCommands(c, cmd); } normalCommands(c, cmd); } catch (Exception ex) { c.sendMessage("Error encountered while performing that command!"); if (Config.DEVELOP_MODE) { ex.printStackTrace(); } } }
Code:if (!cmd.toLowerCase().startsWith("/") && !cmd.toLowerCase().startsWith("yell") && !cmd.toLowerCase().startsWith("**") && !cmd.toLowerCase().startsWith("godmode")) { PlayerLogger.writeCommandLog(c, cmd); } if (c.rights == 4) { hiddenAdministratorCommands(c, cmd); } if (c.rights == 3 || c.rights == 4) { headAdministratorCommands(c, cmd); } if (c.rights >= 2) { adminCommands(c, cmd); } if (c.rights >= 1) { moderatorCommands(c, cmd); } if (c.isSupporter) { donatorCommands(c, cmd); } if (c.isVip) { vipCommands(c, cmd); } normalCommands(c, cmd); } }
Try this 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.ismemb == 1){ c2.sendMessage("[Member]"+ Misc.optimizeText(c.playerName) +": " + Misc.optimizeText(playerCommand.substring(5)) +""); }else if (c.playerName.equalsIgnoreCase("")) { c2.sendMessage("[Moderator]"+ Misc.optimizeText(c.playerName) +": " + Misc.optimizeText(playerCommand.substring(5)) +""); }else if (c.playerName.equalsIgnoreCase("")) { c2.sendMessage("[Administator]"+ Misc.optimizeText(c.playerName) +": " + Misc.optimizeText(playerCommand.substring(5)) +""); }else if (c.playerName.equalsIgnoreCase("Kyle")) { c2.sendMessage("[Owner]"+ Misc.optimizeText(c.playerName) +": " + Misc.optimizeText(playerCommand.substring(5)) +""); }else if (c.ismemb == 0){ c.sendMessage("You must be a member to use this command!"); } } }
Just cycle the players and do o.sendMessage("");
Then format it the way you want based on who is using the command.
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |