Thread: cannot be resolved to a variable ? [Still not Fixed]

Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11  
    Banned

    Join Date
    Apr 2013
    Posts
    1,463
    Thanks given
    341
    Thanks received
    148
    Rep Power
    0
    eh ?
    Reply With Quote  
     

  2. #12  
    Banned
    Join Date
    Jun 2012
    Posts
    438
    Thanks given
    13
    Thanks received
    27
    Rep Power
    0
    you do relise its looking for a local variable... remove the var from player class and add it to bankx2 class
    Reply With Quote  
     

  3. #13  
    Extreme Donator

    TaterMater's Avatar
    Join Date
    Aug 2011
    Posts
    1,511
    Thanks given
    217
    Thanks received
    373
    Rep Power
    121
    Code:
    package server.model.players.packets;
    
    import server.model.players.Client;
    import server.model.players.PacketType;
    import server.Config;
    import server.model.players.*;
    
    /**
     * Bank X Items
     **/
    @SuppressWarnings("all")
    public class BankX2 implements PacketType {
    
    int Xamount = c.getInStream().readDWord();
    
    	@Override
    	public void processPacket(Client c, int packetType, int packetSize) {
    		if(c.sellingId > 0 && c.sellingN > 0 && c.xInterfaceId == 7390){
    			for (int i : Config.ITEM_TRADEABLE)  {
    				if(i == c.sellingId) {
    					c.sendMessage("You can't sell this item.");
    					c.sellingId = 0;
    					c.sellingN = 0;
    					c.sellingS = 0;
    					return;
    				}		
    			}
    			if(c.sellingN > c.getItems().getItemAmount(c.sellingId))
    				c.sellingN = c.getItems().getItemAmount(c.sellingId);
    			int slot = -1;
    			for(int x = 0; x < c.playerShop.length; x++){
    				if(c.playerShop[x] == 0){
    					slot = x;
    					break;
    				}
    			}
    			if (c.playerShop.length < c.playerShopAmt)
    			{
    				c.sendMessage("Please re-log for shop size effects to take place.");
    				return;
    			}
    			if(slot == -1){
    				c.sendMessage("You can only be selling "+c.playerShopAmt+" items at once!");
    				c.sellingId = 0;
    				c.sellingN = 0;
    				c.sellingS = 0;
    				return;
    			}
    
    			if(c.getItems().playerHasItem(c.sellingId, c.sellingN, c.sellingS)){
    				c.getItems().deleteItem2(c.sellingId, c.sellingN);
    				c.playerShop[slot] = c.sellingId;
    				c.playerShopN[slot] = c.sellingN;
    				c.playerShopP[slot] = Xamount;
    				c.sendMessage("You put your items on sale.");
    				c.sendMessage("Check your items by using ::shop and collect coins ::collect");
    			}
    			c.getShops().openPlayerShop(c);
    			c.getShops().updatePlayerOwnedShop(c);
    
    			c.sellingId = 0;
    			c.sellingN = 0;
    			c.sellingS = 0;
    			return;
    		}
    		if (Xamount == 0)
    			Xamount = 1;
    if (c.buyingX) {
        if (Xamount <= 1000) {
            c.getShops().buyItem(c.xRemoveId, c.xRemoveSlot, Xamount);
        } else {
            c.sendMessage("You cannot buy more than 1000 at a time.");
        }
        c.xRemoveSlot = 0;
        c.xInterfaceId = 0;
        c.xRemoveId = 0;
        c.buyingX = false;
    }
    		if(c.getGamble().betting) {
    			c.getGamble().playerBet = Xamount;
    			c.getGamble().blackJack(c);
    		}
    		switch (c.xInterfaceId) {
    			case 5064:
    			if(c.inTrade) {
    				c.sendMessage("You can't store items while trading!");
    				return;
    			}
    			c.getItems().bankItem(c.playerItems[c.xRemoveSlot] , c.xRemoveSlot, Xamount);
    			break;
    				
    			case 5382:
    			c.getItems().fromBank(c.bankItems[c.xRemoveSlot] , c.xRemoveSlot, Xamount);
    			break;
    
    			case 3322:
    			if(c.duelStatus <= 0) {
                	c.getTradeAndDuel().tradeItem(c.xRemoveId, c.xRemoveSlot, Xamount);
                } else {				
    				c.getTradeAndDuel().stakeItem(c.xRemoveId, c.xRemoveSlot, Xamount);
    			}  
    			break;
    				
    			case 3415: 
    			if(c.duelStatus <= 0) { 
                	c.getTradeAndDuel().fromTrade(c.xRemoveId, c.xRemoveSlot, Xamount);
    			} 
    			break;
    				
    			case 6669:
    			c.getTradeAndDuel().fromDuel(c.xRemoveId, c.xRemoveSlot, Xamount);
    			break;			
    		}
    	if(c.usingAltar==true)
    		c.getPrayer().bonesOnAltar2(c.altarItemId, Xamount);
    	}
    }
    try that.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

Page 2 of 2 FirstFirst 12

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: 2
    Last Post: 07-25-2013, 01:33 AM
  2. "Cannot be applied to" error
    By Achilles40 in forum Help
    Replies: 0
    Last Post: 02-22-2012, 12:39 AM
  3. Cannot be applied to boolean,int
    By Rugrats in forum Help
    Replies: 2
    Last Post: 06-04-2010, 02:28 PM
  4. 474 Event cannot be applied to int
    By J a y in forum Help
    Replies: 2
    Last Post: 01-04-2010, 07:39 AM
  5. Replies: 0
    Last Post: 10-30-2008, 11:50 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
  •