Thread: 667 - make it announce what item player receives?

Results 1 to 5 of 5
  1. #1 667 - make it announce what item player receives? 
    Registered Member
    Join Date
    Aug 2013
    Posts
    14
    Thanks given
    0
    Thanks received
    1
    Rep Power
    21
    hi ive added a crystal key on an item chest and i want it to send a game message saying what item the player received with the code ive put it announces the item ID not the actual name :/ - code



    Spoiler for code:
    public void sendkeyRandom() {
    int item = keyRandom();
    //int amount = Utils.random(3)+1;
    if (getInventory().containsItem(989, 1)) {
    if (item == -1) {
    if (getInventory().getFreeSlots() >= 1) {
    getInventory().addItem(995, Utils.random(500000, 1000000));
    }
    } else {
    getInventory().addItem(new Item(item));
    }
    getPackets().sendGameMessage("<col=ff0000><shad=00 0000>You use the Key on the Chest and receive an " +keyRandom+"");

    }
    }
    Reply With Quote  
     

  2. #2  
    Registered Member
    Stimulant's Avatar
    Join Date
    Jan 2013
    Age
    24
    Posts
    1,434
    Thanks given
    222
    Thanks received
    178
    Rep Power
    568
    Code:
    ItemDefinitions.getItemDefinitions(X).getName().toLowerCase();
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Aug 2013
    Posts
    14
    Thanks given
    0
    Thanks received
    1
    Rep Power
    21
    Quote Originally Posted by Stimulant View Post
    Code:
    ItemDefinitions.getItemDefinitions(X).getName().toLowerCase();
    hey sorry just seen your reply, but i tried doing this --

    getPackets().sendGameMessage("<col=ff0000><shad=00 0000>You use the Key on the Chest and receive an " + ItemDefinitons.getItemID + ".");


    and im not sure why it doesnt work? says error: cannont find symbol
    Reply With Quote  
     

  4. #4  
    Registered Member
    Stimulant's Avatar
    Join Date
    Jan 2013
    Age
    24
    Posts
    1,434
    Thanks given
    222
    Thanks received
    178
    Rep Power
    568
    Quote Originally Posted by lower211 View Post
    hey sorry just seen your reply, but i tried doing this --

    getPackets().sendGameMessage("<col=ff0000><shad=00 0000>You use the Key on the Chest and receive an " + ItemDefinitons.getItemID + ".");


    and im not sure why it doesnt work? says error: cannont find symbol
    Code:
    getPackets().sendGameMessage("<col=ff0000><shad=000000>You use the Key on the Chest and receive an " + ItemDefinitions.getItemDefinitions(item).getName().toLowerCase());
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Aug 2013
    Posts
    14
    Thanks given
    0
    Thanks received
    1
    Rep Power
    21
    Quote Originally Posted by Stimulant View Post
    Code:
    getPackets().sendGameMessage("<col=ff0000><shad=000000>You use the Key on the Chest and receive an " + ItemDefinitions.getItemDefinitions(item).getName().toLowerCase());
    much love bro worked
    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: 7
    Last Post: 09-07-2017, 05:45 AM
  2. Replies: 0
    Last Post: 10-01-2012, 04:23 PM
  3. Replies: 12
    Last Post: 06-23-2010, 04:40 AM
  4. Replies: 12
    Last Post: 12-09-2009, 03:40 PM
  5. Replies: 5
    Last Post: 02-18-2008, 05:55 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
  •