Thread: Yell command doesn't work

Results 1 to 5 of 5
  1. #1 Yell command doesn't work 
    Registered Member
    Join Date
    Oct 2013
    Posts
    28
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Ok, so.. My server is a spawnscape 614 remake, but I have made the yell command in a separate folder. with commands. so for example yell.java file would be made as a command. the command is



    package dragonkk.rs2rsps.net.commands;

    import dragonkk.rs2rsps.Server;
    import dragonkk.rs2rsps.model.World;
    import dragonkk.rs2rsps.model.player.Player;
    import dragonkk.rs2rsps.model.player.ChatMessage;
    import dragonkk.rs2rsps.net.Command;
    import dragonkk.rs2rsps.model.Container;
    import dragonkk.rs2rsps.util.Misc;

    public class Yell implements Command {

    @Override
    public void execute(String[] args, Player p) {
    if(p.playerMuted && p.getRights555() < 2) {
    p.getFrames().sendChatMessage(0, "You are muted and cannot talk.");
    return;
    }
    if(p.getRights555() < 1 && !p.trusted && /*!p.extremeDonator555 &&*/ !p.isForumMod && !p.getUsername().equals("") && !p.isForumDev //&& !p.isDonator555
    && p.additionalRanks == 0 && !p.superextremeDonator555 && !p.extremeDonator555
    ) {
    p.getFrames().sendChatMessage(0, "You must be staff, extreme donator+, trusted, or server support to use this command.");
    return;
    }
    if(Server.muteSystem == 1) {
    p.getFrames().sendChatMessage(0, "Yelling has been disabled for everyone at the moment.");
    return;
    }
    if(p.yellremoved) {
    p.getFrames().sendChatMessage(0, "Your yell has been disabled.");
    return;
    }
    if(p.yellTimer > 0) {
    p.getFrames().sendChatMessage(0, "You must wait "+p.yellTimer+" seconds to yell.");
    return;
    }
    Server.lastMute = p;
    String[] rights555 = {"Player", "<img=0>Moderator<img=0>", "<img=1>"};
    String name = Misc.formatPlayerNameForDisplay(p.getUsername().re placeAll("_", " "));
    int len = args.length;
    String yelled = "";
    String seperator = "";
    String right555 = rights555[p.getRights555()];
    if(p.getRights555() < 1) {
    if(p.isDonator555)
    right555 = "Donator";
    if(p.extremeDonator555)
    right555 = "Extreme Donator";
    if(p.getRights555() == 1)
    right555 = "<img=0>Moderator<img=0>";
    }
    for(int i = 1; i < len; i ++) {
    if(args[i].contains("free") && args[i].contains("fletcher") || args[i].contains("fr33") && args[i].contains("fletcher")) {
    p.getFrames().sendChatMessage(0, "Your account has been flagged.");
    return;
    }
    if(args[i].contains("<img=") || args[i].contains("<img") || args[i].contains("<euro>")) {
    p.getFrames().sendChatMessage(0, "You cannot use those symbols.");
    return;
    }
    seperator = i == 1? "" : " ";
    yelled = yelled+ seperator +args[i];
    }
    for (Player d: World.getPlayers()) {
    if(d == null)
    continue;
    p.yellTimer = 5;
    if(p.isForumMod) {
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=01DF01><shad=000000>[#MrPimpHair] ["+name+"] : "+yelled);
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=0174DF><shad=ff0000>[ the host] : " + yelled);
    }else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=9900CC><shad=ff0000>[Forum Developer] [" + name + "] : " + yelled);
    }else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=FFFFFF><shad=8904B1>[Unleash The] [" + name + "] : " + yelled);
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=8904B1><shad=0174DF>[Dutch ButtBuddy] [" + name + "] : " + yelled);
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=01DF01><shad=000000>[Mack-Daddy] <col=000000> [" + name + "] : " + yelled);
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=01DFD7><shad=000000>[<img=0>Head Moderator<img=0>] <col=01DFD7><shad=9900CC> [" +name + "] : " + yelled);


    When i try to yell in-game, it doesn't work and nothing happens.. sometimes it says There is a yell timer, but... after the timer is up, it doesn't work, someone please help me?
    In the quotes "Name" I put the players name, for example "Mrtwit" and I still can't yell in-game.
    Reply With Quote  
     

  2. #2  
    learning java
    alon's Avatar
    Join Date
    May 2013
    Posts
    1,209
    Thanks given
    202
    Thanks received
    62
    Rep Power
    15
    Quote Originally Posted by mrtwit View Post
    Ok, so.. My server is a spawnscape 614 remake, but I have made the yell command in a separate folder. with commands. so for example yell.java file would be made as a command. the command is



    package dragonkk.rs2rsps.net.commands;

    import dragonkk.rs2rsps.Server;
    import dragonkk.rs2rsps.model.World;
    import dragonkk.rs2rsps.model.player.Player;
    import dragonkk.rs2rsps.model.player.ChatMessage;
    import dragonkk.rs2rsps.net.Command;
    import dragonkk.rs2rsps.model.Container;
    import dragonkk.rs2rsps.util.Misc;

    public class Yell implements Command {

    @Override
    public void execute(String[] args, Player p) {
    if(p.playerMuted && p.getRights555() < 2) {
    p.getFrames().sendChatMessage(0, "You are muted and cannot talk.");
    return;
    }
    if(p.getRights555() < 1 && !p.trusted && /*!p.extremeDonator555 &&*/ !p.isForumMod && !p.getUsername().equals("") && !p.isForumDev //&& !p.isDonator555
    && p.additionalRanks == 0 && !p.superextremeDonator555 && !p.extremeDonator555
    ) {
    p.getFrames().sendChatMessage(0, "You must be staff, extreme donator+, trusted, or server support to use this command.");
    return;
    }
    if(Server.muteSystem == 1) {
    p.getFrames().sendChatMessage(0, "Yelling has been disabled for everyone at the moment.");
    return;
    }
    if(p.yellremoved) {
    p.getFrames().sendChatMessage(0, "Your yell has been disabled.");
    return;
    }
    if(p.yellTimer > 0) {
    p.getFrames().sendChatMessage(0, "You must wait "+p.yellTimer+" seconds to yell.");
    return;
    }
    Server.lastMute = p;
    String[] rights555 = {"Player", "<img=0>Moderator<img=0>", "<img=1>"};
    String name = Misc.formatPlayerNameForDisplay(p.getUsername().re placeAll("_", " "));
    int len = args.length;
    String yelled = "";
    String seperator = "";
    String right555 = rights555[p.getRights555()];
    if(p.getRights555() < 1) {
    if(p.isDonator555)
    right555 = "Donator";
    if(p.extremeDonator555)
    right555 = "Extreme Donator";
    if(p.getRights555() == 1)
    right555 = "<img=0>Moderator<img=0>";
    }
    for(int i = 1; i < len; i ++) {
    if(args[i].contains("free") && args[i].contains("fletcher") || args[i].contains("fr33") && args[i].contains("fletcher")) {
    p.getFrames().sendChatMessage(0, "Your account has been flagged.");
    return;
    }
    if(args[i].contains("<img=") || args[i].contains("<img") || args[i].contains("<euro>")) {
    p.getFrames().sendChatMessage(0, "You cannot use those symbols.");
    return;
    }
    seperator = i == 1? "" : " ";
    yelled = yelled+ seperator +args[i];
    }
    for (Player d: World.getPlayers()) {
    if(d == null)
    continue;
    p.yellTimer = 5;
    if(p.isForumMod) {
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=01DF01><shad=000000>[#MrPimpHair] ["+name+"] : "+yelled);
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=0174DF><shad=ff0000>[ the host] : " + yelled);
    }else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=9900CC><shad=ff0000>[Forum Developer] [" + name + "] : " + yelled);
    }else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=FFFFFF><shad=8904B1>[Unleash The] [" + name + "] : " + yelled);
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=8904B1><shad=0174DF>[Dutch ButtBuddy] [" + name + "] : " + yelled);
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=01DF01><shad=000000>[Mack-Daddy] <col=000000> [" + name + "] : " + yelled);
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=01DFD7><shad=000000>[<img=0>Head Moderator<img=0>] <col=01DFD7><shad=9900CC> [" +name + "] : " + yelled);


    When i try to yell in-game, it doesn't work and nothing happens.. sometimes it says There is a yell timer, but... after the timer is up, it doesn't work, someone please help me?
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=01DF01><shad=000000>[#MrPimpHair] ["+name+"] : "+yelled);
    Quitted RSPS AND RS
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Oct 2013
    Posts
    28
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by alon View Post
    } else if (p.getUsername().equals("Name")) {
    d.getFrames().sendChatMessage(0, "<col=01DF01><shad=000000>[#MrPimpHair] ["+name+"] : "+yelled);
    I have my name... "Mrtwit" In there, I used the names in the quotes.. to suggest that I'm putting names in the quotes, I put the player name in the quotes, and it's still not working
    Reply With Quote  
     

  4. #4  
    Registered Member
    Zach's Avatar
    Join Date
    Aug 2013
    Posts
    1,120
    Thanks given
    24
    Thanks received
    513
    Rep Power
    5000
    Quote Originally Posted by mrtwit View Post
    I have my name... "Mrtwit" In there, I used the names in the quotes.. to suggest that I'm putting names in the quotes, I put the player name in the quotes, and it's still not working
    May I ask why you have it in a separate folder..?
    ZachTX's RSPS Video Services (10,000+ Loyal RSPS Subscribers)
    CLICK HERE!

    Attached image
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Oct 2013
    Posts
    28
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    It was orginally in packets.java, On a source. But, I added all the commands to a commands folder, so all the commands run off this folder, Yell is in their, and should work.. But it's not.. idk what I'm doing wrong.
    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. [PI] Command doesn't work. [PI]
    By Brighter in forum Help
    Replies: 14
    Last Post: 05-11-2013, 09:31 PM
  2. npcreset command doesn't work?
    By Willixel+ in forum Help
    Replies: 5
    Last Post: 11-14-2012, 06:29 PM
  3. [pi] ::tele commands doesn't work
    By mr code in forum Help
    Replies: 10
    Last Post: 11-29-2011, 11:37 PM
  4. [PI] Mute command doesn't work
    By Beanerrr in forum Help
    Replies: 13
    Last Post: 02-13-2011, 10:54 PM
  5. My tele command doesn't work why?
    By Rasmux in forum Help
    Replies: 4
    Last Post: 03-28-2009, 02:24 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •