Thread: 667 Help. Adding Message when players Pk a certain Item

Results 1 to 2 of 2
  1. #1 667 Help. Adding Message when players Pk a certain Item 
    Registered Member
    Join Date
    Apr 2014
    Posts
    39
    Thanks given
    3
    Thanks received
    1
    Rep Power
    10
    I've been looking for this but I cant seem to find it. I want to make it where
    Code:
     public static String pkedItem = ItemDefinitions.getItemDefinitions(Item.getItemId()).getName().toUpperCase
                                       if{
                                pkedItem.contains("dragon claws")
                                          for (Player players : World.getPlayers()) {
    						if (players == null)
    							continue;
    			players.getPackets().sendGameMessage("<img=5><col=ff0000>" + killer.getDisplayName() + "</col> Has Just Pked A " + pkedItem.toUpperCase() + " from" + killed.getDisplayName());
    				}
    this is what I have.
    Code:
    String pkedItem = ItemDefinitions.getItemDefinitions(containedItems.getItemId()).getName();
    CopyOnWriteArrayList<Item> containedItems = new CopyOnWriteArrayList<Item>();
    but i get this error compiling...
    Code:
    src\com\rs\game\player\Player.java:2114: error: cannot find symbol
            String pkedItem = ItemDefinitions.getItemDefinitions(containedItems.getI
    temId()).getName();
                                                                 ^
      symbol:   variable containedItems
      location: class Player
    Note: src\com\rs\game\player\Inventory.java uses unchecked or unsafe operations.
    
    Note: Recompile with -Xlint:unchecked for details.
    1 error
    Press any key to continue . . .
    or something of that sort I'm not sure if anyone can help me but it would be nice.
    Thank you!
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Jun 2013
    Posts
    362
    Thanks given
    112
    Thanks received
    31
    Rep Power
    0
    You've got 2 codes which are both strings.

    Code:
      String pkedItem = ItemDefinitions.getItemDefinitions(containedItems.getItemId()).getName();
    CopyOnWriteArrayList<Item> containedItems = new CopyOnWriteArrayList<Item>();
    also
    Code:
    public static String pkedItem = ItemDefinitions.getItemDefinitions(Item.getItemId()).getName().toUpperCase
                                       if{
                                pkedItem.contains("dragon claws")
                                          for (Player players : World.getPlayers()) {
    						if (players == null)
    							continue;
    			players.getPackets().sendGameMessage("<img=5><col=ff0000>" + killer.getDisplayName() + "</col> Has Just Pked A " + pkedItem.toUpperCase() + " from" + killed.getDisplayName());
    				}
    I'd suggest to change the names, and fix it up. Using that code it won't work. "CopyOnWriteArrayList" This means to copy some item name. You have to make an array with all the item codes in it. Then you won't need " pkedItem.contains("dragon claws")" You can't possibly have that and a arraylist. Your "CopyOnWriteArrayList" method has nothing in it.
    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. 718+ World message when player achieves a 99.
    By Super Noodles in forum Snippets
    Replies: 6
    Last Post: 11-28-2013, 06:37 PM
  2. Replies: 1
    Last Post: 06-28-2013, 10:36 PM
  3. [667/7**] World message when a new player joins.
    By Mr Joopz in forum Snippets
    Replies: 6
    Last Post: 06-04-2013, 08:23 PM
  4. Replies: 3
    Last Post: 03-22-2013, 06:02 PM
  5. Server message when player gets a rare drop.
    By Mr Joopz in forum Requests
    Replies: 6
    Last Post: 01-26-2013, 10:07 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
  •