Thread: 5 errors... help please :)

Results 1 to 3 of 3
  1. #1 5 errors... help please :) 
    Registered Member
    Join Date
    Nov 2011
    Posts
    120
    Thanks given
    7
    Thanks received
    1
    Rep Power
    11
    Code:
    src\server\model\players\packets\Commands.java:61: cannot find symbol
    symbol  : variable customYellTag
    location: class server.model.players.Client
       c.customYellTag = playerCommand.substring(8);
        ^
    src\server\model\players\packets\Commands.java:62: cannot find symbol
    symbol  : variable customYellTag
    location: class server.model.players.Client
       c.sendMessage("Your custom yell tag is now: " + c.customYellTag);
                                                        ^
    src\server\model\players\packets\Commands.java:86: cannot find symbol
    symbol  : variable customYellTag
    location: class server.model.players.Client
        ranks[1] = "[" + c.customYellTag + "]";
                          ^
    src\server\model\players\packets\Commands.java:89: cannot find symbol
    symbol  : variable yellDelay
    location: class server.model.players.Client
        c.yellDelay = 0;
         ^
    src\server\model\players\packets\Commands.java:90: incompatible types
    found   : java.lang.String
    required: long
        c.lastYell = playerCommand.substring(5);
                                            ^
    Note: src\server\world\map\C.java uses unchecked or unsafe operations.
    Note: Recompile with -Xlint:unchecked for details.
    5 errors
    Trykk en tast for å fortsette...

    THIS IS WHAT IM TRYING TO ADD

    Code:
     if (playerCommand.toLowerCase().startsWith("yelltag") && playerCommand.length() > 8) {
      try {
       String tempTag = playerCommand.substring(8);
       String[] blocked = { "coder", "owner", "gian", "mike", "www", "com", "tk", "no-ip", "scape", "join", "c0der", "0wner" };
       if (c.playerRights < 1) {
        c.sendMessage("Only special donators may use this feature.");
        return;
       }
       if (!c.playerName.equalsIgnoreCase("(Name Here|Name Here|Name Here)")) {
        if (tempTag.length() < 3 || tempTag.length() > 12)
         c.sendMessage("Custom yell tags must be 3-12 characters long!");
        for (int i = 0; i < blocked.length; i++)
         if (tempTag.toLowerCase().contains(blocked[i])) {
          c.sendMessage("The yell tag you have tried using contains words which arent allowed...");
          c.sendMessage("If you abuse the custom yell tag system your donator rights will be taken away.");
         }
        return;
       }
       c.customYellTag = playerCommand.substring(8);
       c.sendMessage("Your custom yell tag is now: " + c.customYellTag);
       c.sendMessage("If you abuse the custom yell tag system your donator rights will be taken away.");
      } catch(Exception e) {
       e.printStackTrace();
      }
     }
     
     if (playerCommand.toLowerCase().startsWith("yell")) {
      try {
       String[] colors = { "@dbl@", "@dbl@", "@dre@", "@red@", "@red@", "@red@" };
       String[] ranks = { "[Donator]", "[Donator]", "[Mod]", "[Admin]", "[yournamehere]", "[Owner]" };
       int arraySlot = -1;
       if (c.playerRights == 1)
        arraySlot = 2;
       if (c.playerRights == 2)
        arraySlot = 3;
       if (c.playerName.equalsIgnoreCase("Name Here"))
        arraySlot = 4;
       if (c.playerName.equalsIgnoreCase("Name Here"))
        arraySlot = 5;
       if (c.playerRights == 4) {
        if (arraySlot != -1)
         colors[1] = colors[arraySlot];
        arraySlot = 1;
        ranks[1] = "[" + c.customYellTag + "]";
       }
       if (arraySlot != -1) {
        c.yellDelay = 0;
        c.lastYell = playerCommand.substring(5);
        for (int j = 0; j < Server.playerHandler.players.length; j++)
         if (Server.playerHandler.players[j] != null) {
          Client p = (Client)Server.playerHandler.players[j];
          p.sendMessage(ranks[arraySlot] + " " + c.playerName + ": " + colors[arraySlot] + " " + Misc.optimizeText(playerCommand.substring(5)));
         }
       } else if (arraySlot == -1) {
        c.sendMessage("This feature is only available to Donators and members of Staff.");
        c.sendMessage("Donator rank can be purchased for $5 via 'Paypal.Com'.");
       }
      } catch(Exception e) {
       e.printStackTrace();
      }
     }
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Oct 2011
    Posts
    422
    Thanks given
    88
    Thanks received
    21
    Rep Power
    22
    Open up Client.java and under public class Client extends Player {

    Add:
    public int yellDelay = 0;
    public String lastYell = "";
    public String customYellTag = "Editable Rank";
    Reply With Quote  
     

  3. #3  
    Banned

    Join Date
    Mar 2011
    Posts
    4,062
    Thanks given
    194
    Thanks received
    689
    Rep Power
    0
    well dunno if youre actually applying these but declare the following in player class

    public String customYellTag;
    public long yellDelay;

    and c.lastYell can't be applied because

    c.lastYell = playerCommand.substring(5);

    c.lastYell is a long and substring(5) is a String
    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. Replies: 72
    Last Post: 01-24-2017, 02:03 PM
  2. Replies: 11
    Last Post: 11-07-2009, 08:43 PM
  3. Errors Erros Errors....
    By shotme in forum Help
    Replies: 5
    Last Post: 11-02-2009, 10:54 PM
  4. Replies: 1
    Last Post: 09-24-2009, 12:39 AM
  5. clanchat errors plz help only 7 errors
    By Snow Cat123 in forum Help
    Replies: 4
    Last Post: 07-12-2009, 03:23 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
  •