Thread: help with yell

Results 1 to 10 of 10
  1. #1 help with yell 
    Registered Member
    Join Date
    Mar 2012
    Age
    27
    Posts
    45
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    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..
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Dec 2011
    Posts
    793
    Thanks given
    204
    Thanks received
    176
    Rep Power
    173
    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.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Mar 2012
    Age
    27
    Posts
    45
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Psychotic View Post
    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);
    				}
    			}
    		}
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Dec 2011
    Posts
    793
    Thanks given
    204
    Thanks received
    176
    Rep Power
    173
    Quote Originally Posted by RuneEvolve View Post
    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);
    				}
    			}
    		}
    Code:
    Engine.messageToAll(c, message);
    That's the method you'd have to modify. Post that.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Mar 2012
    Age
    27
    Posts
    45
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    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();
    		}
    	}
    Reply With Quote  
     

  6. #6  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Change:
    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();
    			}
    		}
    	}
    Into:
    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);
    		}
    	}


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Mar 2012
    Age
    27
    Posts
    45
    Thanks given
    1
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by arch337 View Post
    Change:
    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();
    			}
    		}
    	}
    Into:
    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);
    		}
    	}
    didnt change anything still the same yell
    Reply With Quote  
     

  8. #8  
    Registered Member Rs Owner 126's Avatar
    Join Date
    Jul 2015
    Posts
    70
    Thanks given
    41
    Thanks received
    13
    Rep Power
    25
    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!");
    									
    							}
    						}
    					}
    Reply With Quote  
     

  9. #9  
    Community Veteran


    Arch337's Avatar
    Join Date
    Sep 2008
    Posts
    2,950
    Thanks given
    210
    Thanks received
    349
    Rep Power
    1376
    Quote Originally Posted by RuneEvolve View Post
    didnt change anything still the same yell
    It made it so no msg has been giving cause you simple do not need a try statement there. Now you can make sure it reads the command correctly by debuging it or make sure you type the command correct.


    "A fail act is something you do regular, but a dumb act is something you can learn from"
    Spoiler for Problem?:
    Reply With Quote  
     

  10. #10  
    Donator

    Join Date
    Mar 2015
    Posts
    456
    Thanks given
    45
    Thanks received
    49
    Rep Power
    58
    Just cycle the players and do o.sendMessage("");
    Then format it the way you want based on who is using the command.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [Yell] need help with yell
    By oh hi broski in forum Help
    Replies: 5
    Last Post: 05-22-2011, 12:21 PM
  2. need help with yell..
    By Phoebe in forum Help
    Replies: 0
    Last Post: 04-27-2011, 06:22 PM
  3. Help with yell.
    By Cody_ in forum Requests
    Replies: 7
    Last Post: 12-27-2010, 11:24 PM
  4. Help with ::yell for premium.
    By Maximum ZxZ in forum Help
    Replies: 4
    Last Post: 12-29-2009, 01:35 AM
  5. Help With Yell
    By Drake11 in forum Help
    Replies: 5
    Last Post: 05-30-2009, 12:26 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •