Thread: Printing a certain number for a value (PI)

Results 1 to 3 of 3
  1. #1 Printing a certain number for a value (PI) 
    Donator

    Join Date
    Jul 2013
    Posts
    488
    Thanks given
    21
    Thanks received
    42
    Rep Power
    0
    I've added the base for a bag system, after finishing it I have realised that there is a part I have done incorrectly... After spending too much time on this error I thought that I would ask the community here for any suggestions.

    Here is the code and below is what happens right now.
    Code:
    	if (itemId == 10834) {
    		
    		if (c.getPA().getTotalBagItems() > 0) {
    		
    			for (int i = 0; i < c.bagItems.length; i ++) {
    				int modifiedSlot = i + 1;
    				if (c.bagItems[i] == 0) {
    					return;
    				}
    				if (c.getItems().getItemCount((c.bagItems[i])) == 0) {
    					c.sendMessage("You have one "+c.getItems().getItemName(c.bagItems[i])+ "");
    				} if (c.getItems().getItemCount((c.bagItems[i])) > 1) {
    					c.sendMessage("You have "+c.getItems().getItemAmount(c.bagItems[i])+ ""+c.getItems().getItemName(c.bagItems[i])+ "");
    					return;
    				}
    Here it what happens, when the player has over 1 of an item in the loot bag and clicks the bag to see what is inside it, then it will print how many of that item is in the players inventory and not in the loot bag itself.


    Reply With Quote  
     

  2. #2  
    Donator

    Join Date
    Jul 2013
    Posts
    488
    Thanks given
    21
    Thanks received
    42
    Rep Power
    0
    bump
    Reply With Quote  
     

  3. #3  
    Community Veteran

    mige5's Avatar
    Join Date
    Aug 2008
    Posts
    5,528
    Thanks given
    573
    Thanks received
    1,410
    Rep Power
    2114
    Isnt this code:
    Code:
    c.getItems().getItemAmount(c.bagItems[i])
    basically this?
    Code:
    Inventory.getItemAmount(itemId)
    ^so theres where u are failing.
    Number of page #1 releases with most views & posts: (Updated: 2023)
    RS2 server section: 1
    RS2 client section: 2
    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: 17
    Last Post: 09-05-2013, 08:03 PM
  2. Replies: 3
    Last Post: 04-18-2011, 10:29 AM
  3. [pi] no random numbers for passwords
    By Rugrats in forum Help
    Replies: 3
    Last Post: 12-31-2010, 09:36 AM
  4. Finding the number of unique values for a 2 dimensional array
    By thefifthlord in forum Application Development
    Replies: 4
    Last Post: 03-09-2009, 10:07 AM
  5. Replies: 16
    Last Post: 09-06-2007, 05:12 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
  •