Thread: ::Yell command help

Results 1 to 6 of 6
  1. #1 ::Yell command help 
    Registered Member
    Join Date
    Jan 2013
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Alright so basically I have been using the source Explicity and everything has been going smooth so far but there is one command that doesn't work right which is the ::yell command. . Basically the problem is that its not that the command works itself but anything above players rights 2 does not work. So for example, whenever I set myself to players rights 3 it gives me a message, you must be a donator to use this command. Here is the code.... If anyone could help would be much appreciated.






    if (playerCommand.startsWith("yell")) {
    /*
    *This is the sensor for the yell command
    */
    String text = playerCommand.substring(5);
    String[] bad = {"<img=1>", "<img=2>", "<img=0>", "Fuck", "Nigger", "Cunt", "Faggot"};
    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.playerName.equalsIgnoreCase("")) {
    c2.sendMessage("<shad=15369497>[Extreme Donator]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerName.equalsIgnoreCase("Predator")) {
    c2.sendMessage("<shad=15695415>[Owner]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.isDonator == 1 && (c.playerRights == 1 )) {
    c2.sendMessage("<shad=6081134>[Donator]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerRights == 1) {
    c2.sendMessage("<shad=3781373>[Moderator]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerRights == 2) {
    c2.sendMessage("<shad=16112652>[Administrator]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerName.equalsIgnoreCase("Mr Terror")) {
    c2.sendMessage("<shad=15695415>[Owner]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerName.equalsIgnoreCase("Skillz")) {
    c2.sendMessage("<shad=15695415>[Co-Owner]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerName.equalsIgnoreCase("Wet Dreams")) {
    c2.sendMessage("<shad=15695415>[Developer]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerName.equalsIgnoreCase("")) {
    c2.sendMessage("<shad=15695415>[Owner]"+ 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!");
    } else {
    if (c.isInJail()) {
    c.sendMessage("You cannot yell while you are in Jail!");
    return;
    }
    Reply With Quote  
     

  2. #2  
    Registered Member
    Karma_K's Avatar
    Join Date
    Nov 2012
    Posts
    4,283
    Thanks given
    152
    Thanks received
    610
    Rep Power
    108
    Quote Originally Posted by Puffy Fawter View Post
    Alright so basically I have been using the source Explicity and everything has been going smooth so far but there is one command that doesn't work right which is the ::yell command. . Basically the problem is that its not that the command works itself but anything above players rights 2 does not work. So for example, whenever I set myself to players rights 3 it gives me a message, you must be a donator to use this command. Here is the code.... If anyone could help would be much appreciated.






    if (playerCommand.startsWith("yell")) {
    /*
    *This is the sensor for the yell command
    */
    String text = playerCommand.substring(5);
    String[] bad = {"<img=1>", "<img=2>", "<img=0>", "Fuck", "Nigger", "Cunt", "Faggot"};
    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.playerName.equalsIgnoreCase("")) {
    c2.sendMessage("<shad=15369497>[Extreme Donator]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerName.equalsIgnoreCase("Predator")) {
    c2.sendMessage("<shad=15695415>[Owner]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.isDonator == 1 && (c.playerRights == 1 )) {
    c2.sendMessage("<shad=6081134>[Donator]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerRights == 1) {
    c2.sendMessage("<shad=3781373>[Moderator]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerRights == 2) {
    c2.sendMessage("<shad=16112652>[Administrator]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerName.equalsIgnoreCase("Mr Terror")) {
    c2.sendMessage("<shad=15695415>[Owner]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerName.equalsIgnoreCase("Skillz")) {
    c2.sendMessage("<shad=15695415>[Co-Owner]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerName.equalsIgnoreCase("Wet Dreams")) {
    c2.sendMessage("<shad=15695415>[Developer]"+ Misc.optimizeText(c.playerName) +": "
    + Misc.optimizeText(playerCommand.substring(5)) +"");
    } else if (c.playerName.equalsIgnoreCase("")) {
    c2.sendMessage("<shad=15695415>[Owner]"+ 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!");
    } else {
    if (c.isInJail()) {
    c.sendMessage("You cannot yell while you are in Jail!");
    return;
    }
    Have you tried setting yourself to a donator?
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jan 2013
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Karma_K View Post
    Have you tried setting yourself to a donator?
    Yes I have actually, all 3 of them. It still gives me that message. The only 2 players rights that work are moderator and admin. None of the donators work. Donator rights are 4,5,and 6
    Reply With Quote  
     

  4. #4  
    🍥🍥🍥


    Join Date
    Dec 2008
    Posts
    1,702
    Thanks given
    664
    Thanks received
    293
    Rep Power
    621
    Code:
    (c.playerRights == 1)
    to

    Code:
    (c.playerRights >= 1)
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jan 2013
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by Global View Post
    Code:
    (c.playerRights == 1)
    to

    Code:
    (c.playerRights >= 1)
    Every right works now. Except for now whenever it posts i come up as a moderator even if im a donator, or admin, or owner.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jan 2013
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Nvm fixed.
    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] Yell Command Help [Please]
    By GasMask in forum Help
    Replies: 9
    Last Post: 01-08-2011, 02:03 PM
  2. Yell Command Help?
    By Real 99s in forum Help
    Replies: 11
    Last Post: 12-31-2010, 05:30 AM
  3. I need a Yell Command Help =]
    By Bondie8 in forum Help
    Replies: 2
    Last Post: 10-24-2010, 11:08 AM
  4. Replies: 52
    Last Post: 04-19-2009, 04:48 PM
  5. Yell command Help
    By wildjjbug in forum Help
    Replies: 1
    Last Post: 03-10-2009, 02:36 AM
Tags for this Thread

View Tag Cloud

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •