Thread: Wealth Problem

Results 1 to 2 of 2
  1. #1 Wealth Problem 
    Registered Member
    Join Date
    Jan 2011
    Posts
    309
    Thanks given
    9
    Thanks received
    26
    Rep Power
    28
    Close.
    Reply With Quote  
     

  2. #2 Help [Paying RSGP] 
    Registered Member
    Join Date
    Jan 2011
    Posts
    309
    Thanks given
    9
    Thanks received
    26
    Rep Power
    28
    Source: DSPK
    Problem: Incorrect Wealth Updating?
    Info: The problem I'm having is when I equip certain items it updates to the correct amount, but when it's in the inventory it seems to load an incorrect item price.

    Pictures:




    Calculating Code:
    Code:
    	public int getEquipmentNet() {
    		int toReturn = 0;
    		for (int i = 0; i < c.playerEquipment.length; i++) {
    			toReturn += (c.getShops().getItemShopValue(c.playerEquipment[i]) * c.playerEquipmentN[i]);
    		}
    		return toReturn;
    	}
    
    	public int getInventoryNet() {
    		int toReturn = 0;
    		for (int i = 0; i < c.playerItems.length; i++) {
    			toReturn += (c.getShops().getItemShopValue(c.playerItems[i]) * c.playerItemsN[i]);
    		}
    		return toReturn;
    	}
    Display Code:
    Code:
    	public void DisplayWealthSafe() {
    	//int wealth = getItems().getCarriedWealth() + getPA().getWearingAmount2();
    	int wealth = getItems().getEquipmentNet() + getItems().getInventoryNet();
    	String wealthAdd = "";
    	if (wealth < 1000) {
    			wealthAdd = (""+wealth+"GP");		
    		} else if (wealth >= 1000 && wealth < 1000000) {
    			wealthAdd = (""+wealth/1000+"K");
    		} else if (wealth >= 1000000 && wealth < 1000000000) {
    			wealthAdd = (""+wealth/1000000+" Million");
    		} else if (wealth >= 1000000000) {
    			wealthAdd = (""+wealth/1000000000+" Billion");	
    		}	
    		getPA().sendFrame126(""+wealthAdd+"", 21708);
    	}
    The problem most likely is with the 'getInventoryNet()', any help would be much appreciated thanks.

    MSN: [email protected]
    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 account wealth.
    By ZammyPk25 in forum Media
    Replies: 64
    Last Post: 04-04-2011, 06:58 AM
  2. my wealth
    By Stuie in forum Media
    Replies: 7
    Last Post: 03-10-2011, 12:49 AM
  3. Trade Wealth Help
    By hitman in forum Help
    Replies: 2
    Last Post: 12-01-2009, 08:58 PM
  4. Ring of wealth help please
    By shoopdawhoop in forum Help
    Replies: 0
    Last Post: 11-04-2009, 10:56 AM
  5. help wid wealth
    By devildreams54 in forum Help
    Replies: 24
    Last Post: 07-10-2009, 03:55 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
  •