Thread: Question

Results 1 to 4 of 4
  1. #1 Question 
    Registered Member
    Join Date
    Mar 2014
    Posts
    131
    Thanks given
    0
    Thanks received
    3
    Rep Power
    30
    Pretty dumb question, but im learning.

    How do i make an item untradeable?
    Reply With Quote  
     

  2. #2  
    Registered Member Eberwolf's Avatar
    Join Date
    Nov 2008
    Age
    30
    Posts
    210
    Thanks given
    10
    Thanks received
    17
    Rep Power
    34
    Do something like
    Code:
    public static final int[] UNTRADEABLE_ITEMS = {xxxx,xxxx,xxxx};
    Switch the xxxx's with your item id's, then add

    Code:
    public boolean tradeable(int itemId) {
    		for (int j = 0; j < UNTRADEABLE_ITEMS.length; j++) {
    			if (itemId == UNTRADEABLE_ITEMS[j])
    				return false;
    		}
    		return true;
    	}
    Then just add a check for whether or not it's tradeable where ever your server handles trading


    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jan 2014
    Posts
    813
    Thanks given
    69
    Thanks received
    47
    Rep Power
    9
    Quote Originally Posted by Willms View Post
    Pretty dumb question, but im learning.

    How do i make an item untradeable?
    Use the search engine.
    Reply With Quote  
     

  4. #4  
    mush

    Danny's Avatar
    Join Date
    Sep 2013
    Posts
    1,221
    Thanks given
    38
    Thanks received
    316
    Rep Power
    551
    Config class
    Code:
    public static final int[] ITEM_UNTRADEABLE = {7806};
    ItemAssistant class
    Code:
    public static boolean tradeable(int itemId) {
            for (int j = 0; j < Config.ITEM_UNTRADEABLE.length; j++) {
                if (itemId == Config.ITEM_UNTRADEABLE[j]) {
                    return false;
                }
            }
            return true;
        }
    Code:
    newItemList.tradeAble = ItemAssistant.tradeable(itemId);
    Attached image
    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. My clientframe + question.
    By The kw in forum Graphics
    Replies: 14
    Last Post: 11-13-2007, 05:20 AM
  2. A Client Question
    By Mr Blah Man in forum RS2 Client
    Replies: 4
    Last Post: 10-27-2007, 10:38 AM
  3. A question
    By Fallen Azn SinZ in forum RS2 Client
    Replies: 2
    Last Post: 09-15-2007, 03:12 AM
  4. Ask your GFX Questions in this forum!
    By Bullet in forum General
    Replies: 0
    Last Post: 07-20-2007, 05:48 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
  •