Thread: Sell price [REP++]

Page 1 of 2 12 LastLast
Results 1 to 10 of 17
  1. #1 Sell price [REP++] 
    Registered Member alexsandro's Avatar
    Join Date
    Apr 2013
    Age
    28
    Posts
    346
    Thanks given
    109
    Thanks received
    27
    Rep Power
    0
    Fixed.
    "Death is not the greatest loss in life.
    The greatest loss is what dies inside while still alive.
    Never surrender." - Tupac Shakur
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Apr 2014
    Posts
    68
    Thanks given
    14
    Thanks received
    7
    Rep Power
    0
    What base is it?
    Reply With Quote  
     

  3. #3  
    Registered Member alexsandro's Avatar
    Join Date
    Apr 2013
    Age
    28
    Posts
    346
    Thanks given
    109
    Thanks received
    27
    Rep Power
    0
    Still need this.
    "Death is not the greatest loss in life.
    The greatest loss is what dies inside while still alive.
    Never surrender." - Tupac Shakur
    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Jul 2014
    Posts
    305
    Thanks given
    62
    Thanks received
    40
    Rep Power
    0
    Post your shopAssistant.java / Shop Handler and Prices.txt
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Feb 2014
    Posts
    209
    Thanks given
    20
    Thanks received
    6
    Rep Power
    11
    Quote Originally Posted by alexsandro View Post
    Still need this.
    if this is pi - Project Insanity ( source )
    go to ur source folder - data - cfg and openup prices.txt
    search for the item id u want to change the price for
    online item list : ItemDB | 745
    as an example (whip)
    4151 120001

    4151 is the itemID
    120001 is the amount of coins its worth (selling for)

    so it would cost 120001 coins
    Reply With Quote  
     

  6. #6  
    Registered Member alexsandro's Avatar
    Join Date
    Apr 2013
    Age
    28
    Posts
    346
    Thanks given
    109
    Thanks received
    27
    Rep Power
    0
    Quote Originally Posted by inkk View Post
    Post your shopAssistant.java / Shop Handler and Prices.txt
    What part do you need?

    Quote Originally Posted by distryct View Post
    if this is pi - Project Insanity ( source )
    go to ur source folder - data - cfg and openup prices.txt
    search for the item id u want to change the price for
    online item list : ItemDB | 745
    as an example (whip)
    4151 120001

    4151 is the itemID
    120001 is the amount of coins its worth (selling for)

    so it would cost 120001 coins
    Did you saw what the problem is?
    "Death is not the greatest loss in life.
    The greatest loss is what dies inside while still alive.
    Never surrender." - Tupac Shakur
    Reply With Quote  
     

  7. #7  
    Registered Member alexsandro's Avatar
    Join Date
    Apr 2013
    Age
    28
    Posts
    346
    Thanks given
    109
    Thanks received
    27
    Rep Power
    0
    Bump.
    "Death is not the greatest loss in life.
    The greatest loss is what dies inside while still alive.
    Never surrender." - Tupac Shakur
    Reply With Quote  
     

  8. #8  
    Ratted Donor

    Join Date
    Feb 2013
    Posts
    675
    Thanks given
    117
    Thanks received
    59
    Rep Power
    21
    Quote Originally Posted by alexsandro View Post
    Bump.
    If its the problem that it sells for less (or doesn't show that it will sell for less) then post your 'sellItem' and your 'sellItemPrice' methods here.
    [CENTER]
    Spoiler for Vouches (2):

    Quote Originally Posted by SHIFT_ View Post
    Great doing business! Bought 75M purchased relatively smoothly.
    Quote Originally Posted by Luzoxpk View Post
    bug fixed thanks linas


    Spoiler for Peeps i respect::

    Arham 4 , Sheepmonger , Linus, LuzoxPk (ipkmills)
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Oct 2013
    Posts
    775
    Thanks given
    48
    Thanks received
    104
    Rep Power
    14
    post your sell method
    Reply With Quote  
     

  10. #10  
    Registered Member alexsandro's Avatar
    Join Date
    Apr 2013
    Age
    28
    Posts
    346
    Thanks given
    109
    Thanks received
    27
    Rep Power
    0
    Quote Originally Posted by linas View Post
    If its the problem that it sells for less (or doesn't show that it will sell for less) then post your 'sellItem' and your 'sellItemPrice' methods here.
    Quote Originally Posted by Our Promise View Post
    post your sell method
    I fixed that problem, but now i have another one.

    In my prices.txt for exemple my AGS is defined to by 500m but when i check how mutch the shop buy for it say 440m, and if i sell i will get440m not the price defined.


    Sell to shop price:

    Code:
    	public void sellToShopPrice(int removeId, int removeSlot) {
    		for (int i : Config.ITEM_SELLABLE) {
    			if (i == removeId) {
    				c.sendMessage("You can't sell "+ItemAssistant.getItemName(removeId).toLowerCase() +".");
    				return;
    			}
    		}
    		boolean IsIn = false;
    		if (ShopHandler.ShopSModifier[c.myShopId] > 1) {
    		for (int j = 0; j <= ShopHandler.ShopItemsStandard[c.myShopId]; j++) {
    		if (removeId == (ShopHandler.ShopItems[c.myShopId][j] - 1)) {
    		IsIn = true;
    		break;
    		}
    		}
    		} else {
    		IsIn = true;
    		}
    		if (IsIn == false) {
    		c.sendMessage("You can't sell "+ItemAssistant.getItemName(removeId).toLowerCase() +" to this store.");
    		} else {
    		int ShopValue = (int)Math.round(getItemShopValue(removeId, 1, removeSlot) * 0.80);
    		String ShopAdd = "";
    		if (ShopValue >= 1000 && ShopValue < 1000000) {
    		ShopAdd = " (" + (ShopValue / 1000) + "K)";
    		} else if (ShopValue >= 1000000) {
    		ShopAdd = " (" + (ShopValue / 1000000) + " million)";
    		}
    		c.sendMessage(ItemAssistant.getItemName(removeId)+" : shop will buy for "+ShopValue+" coins"+ShopAdd);
    		}
    		}
    Sell item:

    Code:
    	public boolean sellItem(int itemID, int fromSlot, int amount) {
    		if (c.myShopId == 14) {
    			return false;
    		}
    		if(c.inTrade) {
    			return false;
    		}
    		for (int i : Config.ITEM_SELLABLE) {
    			if (i == itemID) {
    				c.sendMessage("You can't sell "+ItemAssistant.getItemName(itemID).toLowerCase()+".");
    				return false;
    			} 
    		}
    		if(c.playerRights == 2 && !Config.ADMIN_CAN_SELL_ITEMS) {
    			c.sendMessage("Administrators cannot sell.");
    			return false;
    		}
    		if (amount > 0 && itemID == (c.playerItems[fromSlot] - 1)) {
    			if (ShopHandler.ShopSModifier[c.myShopId] > 1) {
    				boolean IsIn = false;
    				for (int i = 0; i <= ShopHandler.ShopItemsStandard[c.myShopId]; i++) {
    					if (itemID == (ShopHandler.ShopItems[c.myShopId][i] - 1)) {
    						IsIn = true;
    						break;
    					}
    				}
    				if (IsIn == false) {
    					c.sendMessage("You can't sell "+ItemAssistant.getItemName(itemID).toLowerCase()+" to this store.");
    					return false;
    				}
    			}
    
    			if (amount > c.playerItemsN[fromSlot] && (Item.itemIsNote[(c.playerItems[fromSlot] - 1)] == true || Item.itemStackable[(c.playerItems[fromSlot] - 1)] == true)) {
    				amount = c.playerItemsN[fromSlot];
    			} else if (amount > c.getItems().getItemAmount(itemID) && Item.itemIsNote[(c.playerItems[fromSlot] - 1)] == false && Item.itemStackable[(c.playerItems[fromSlot] - 1)] == false) {
    				amount = c.getItems().getItemAmount(itemID);
    			}
    			//double ShopValue;
    			//double TotPrice;
    			int TotPrice2 = 0;
    			//int Overstock;
    			for (int i = amount; i > 0; i--) {
    				TotPrice2 = (int)Math.floor(getItemShopValue(itemID, 1, fromSlot));
    				if (c.getItems().freeSlots() > 0 || c.getItems().playerHasItem(995)) {
    					if (Item.itemStackable[itemID] && c.getItems().playerHasItem(itemID, amount)) {
    						c.getItems().addItem(995, TotPrice2*amount);
    						c.getItems().deleteItem(itemID,c.getItems().getItemSlot(itemID),amount);
    						addShopItem(itemID, amount);
    						Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
    						c.getItems().resetItems(3823);
    						resetShop(c.myShopId);
    						updatePlayerShop();
    						return false;
    					}
    					if (Item.itemIsNote[itemID] == false) {
    						c.getItems().deleteItem(itemID, c.getItems().getItemSlot(itemID), 1);
    					} else {
    						c.getItems().deleteItem(itemID, fromSlot, 1);
    					}
    					c.getItems().addItem(995, TotPrice2 *= 0.80);
    					//addShopItem(itemID, 1);
    				} else {
    					c.sendMessage("You don't have enough space in your inventory.");
    					break;
    				}
    			}
    			c.getItems().resetItems(3823);
    			resetShop(c.myShopId);
    			updatePlayerShop();
    			return true;
    		}
    		return true;
    	}
    "Death is not the greatest loss in life.
    The greatest loss is what dies inside while still alive.
    Never surrender." - Tupac Shakur
    Reply With Quote  
     

  11. Thankful user:


Page 1 of 2 12 LastLast

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. PI Slayer shop prices? REP
    By Tzej in forum Help
    Replies: 7
    Last Post: 12-02-2011, 04:06 AM
  2. Replies: 2
    Last Post: 03-21-2011, 05:43 AM
  3. [PI]Fixing Sell price display
    By Zuyi in forum Snippets
    Replies: 9
    Last Post: 09-01-2010, 01:24 AM
  4. Replies: 1
    Last Post: 06-16-2010, 09:33 PM
  5. [Project InSanity] Sell Prices
    By Throat in forum Help
    Replies: 6
    Last Post: 06-01-2010, 07:49 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
  •