Thread: Shop Issue

Results 1 to 5 of 5
  1. #1 Shop Issue 
    Donator


    Join Date
    Sep 2011
    Posts
    2,730
    Thanks given
    1,150
    Thanks received
    907
    Rep Power
    668
    I have this custom shop that is supposed to take tokens.

    If the player doesn't have enough tokens for the priced item, it does come back with a return message saying they don't have enough tokens.

    If they do have enough, the player receives the items, but no tokens are taken.

    Code:
    public void handleOtherShop(int itemID) {
    		int Slot = c.getItems().getItemSlot(6183);
    		if (c.myShopId == 14) { // Noob Token Shop
    			if (c.playerItemsN[Slot] >= getSpecialNoobValue(itemID)) {
    				if (c.getItems().freeSlots() > 0) {
    					c.getItems().deleteItem(6183, c.getItems().getItemSlot(6183), getSpecialItemValue(itemID));
    					c.getItems().addItem(itemID, 1);
    					c.getItems().resetItems(3823);
    				}
    			} else {
    				c.sendMessage("You do not have enough Noob Tokens.");
    			}
    		}
    	}
    Can someone tell me why, please? Thank you.
    Reply With Quote  
     

  2. #2  
    need java lessons
    Eclipse's Avatar
    Join Date
    Aug 2012
    Posts
    4,436
    Thanks given
    686
    Thanks received
    898
    Rep Power
    490
    if (c.playerItemsN[Slot3] >= getSpecialItemValue(itemID)) {
    if (c.getItems().freeSlots() > 0) {
    //buyDelay = System.currentTimeMillis();
    c.getItems().deleteItem(14584, c.getItems().getItemSlot(14584), getSpecialItemValue(itemID));
    c.getItems().addItem(itemID, 1);
    Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
    Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
    if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
    Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
    }
    } else {
    c.sendMessage("You don't have enough space in your inventory.");
    break;
    }
    } else {
    c.sendMessage("You don't have enough donator gold.");
    break;
    }
    }


    You need to add a slot.

    under this
    int Slot = 0;
    int Slot1 = 0;//Tokkul

    Quote Originally Posted by jerryrocks317 View Post
    i am 14 and have my own laptop im on almost 24/7 currently creating rsps lol so please get off my thread lol
    Reply With Quote  
     

  3. #3  
    Donator


    Join Date
    Sep 2011
    Posts
    2,730
    Thanks given
    1,150
    Thanks received
    907
    Rep Power
    668
    Quote Originally Posted by Ninth Legion View Post
    if (c.playerItemsN[Slot3] >= getSpecialItemValue(itemID)) {
    if (c.getItems().freeSlots() > 0) {
    //buyDelay = System.currentTimeMillis();
    c.getItems().deleteItem(14584, c.getItems().getItemSlot(14584), getSpecialItemValue(itemID));
    c.getItems().addItem(itemID, 1);
    Server.shopHandler.ShopItemsN[c.myShopId][fromSlot] -= 1;
    Server.shopHandler.ShopItemsDelay[c.myShopId][fromSlot] = 0;
    if ((fromSlot + 1) > Server.shopHandler.ShopItemsStandard[c.myShopId]) {
    Server.shopHandler.ShopItems[c.myShopId][fromSlot] = 0;
    }
    } else {
    c.sendMessage("You don't have enough space in your inventory.");
    break;
    }
    } else {
    c.sendMessage("You don't have enough donator gold.");
    break;
    }
    }


    You need to add a slot.

    under this
    int Slot = 0;
    int Slot1 = 0;//Tokkul
    This isn't placed in the buyItem method. It's in it's own method, and in buyItem it is assigned to this void.

    The original Slot and Slot1 are not defined or needed in this method.
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Oct 2010
    Posts
    716
    Thanks given
    82
    Thanks received
    131
    Rep Power
    0
    Code:
    c.playerItemsN[Slot] == c.playerItemsN[Slot] - getSpecialNoobValue(itemID)
    Reply With Quote  
     

  5. #5  
    Donator


    Join Date
    Sep 2011
    Posts
    2,730
    Thanks given
    1,150
    Thanks received
    907
    Rep Power
    668
    Quote Originally Posted by Articron View Post
    Code:
    c.playerItemsN[Slot] == c.playerItemsN[Slot] - getSpecialNoobValue(itemID)
    Assuming I used that on line 4, it didn't work. Told me I do not have the amount of tokens needed, yet I had more than enough. Still bumping for assistance, please.
    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. shop price issue
    By Morphine in forum Help
    Replies: 5
    Last Post: 08-18-2012, 04:20 AM
  2. ~ Shop issue -.- ~
    By BLOTTER in forum Help
    Replies: 9
    Last Post: 08-11-2012, 03:27 AM
  3. Wierd Shop Issue
    By Inspired Dreams in forum Help
    Replies: 3
    Last Post: 04-17-2012, 05:46 PM
  4. shop not selling issue
    By qpanel in forum Help
    Replies: 0
    Last Post: 04-17-2012, 01:50 PM
  5. shop not selling issue
    By qpanel in forum Help
    Replies: 3
    Last Post: 04-16-2012, 04:58 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
  •