Thread: Picking up items.

Results 1 to 7 of 7
  1. #1 Picking up items. 
    Stanyer
    Guest
    Alright i have this atm.
    Code:
    	public void pickupitem() {
    		try {
    			if(c == null)
    				return;
    			int x = c.instream.readsignedwordbigendiana();
    			int index = c.instream.readunsignedword(); 
    			int y = c.instream.readsignedworda();
    			int amount = 1;
    			if(gameengine.distance(x, y, c.absx, c.absy) < 2 && gameengine.distance(x, y, c.absx, c.absy) > -1) {
    				if(gameengine.debug)
    					System.out.println("Player ID "+c.playerindex+" picked up item ("+index+", "+amount+", "+x+", "+y+").");
    				c.playeritems.additem(index, amount);
    				deletegrounditem(index, x, y);
    			}
    		} catch(Exception _ex) {
    			_ex.printStackTrace();
    		}
    	}
    As you can see, i don't know how to read the item amount correctly, i took a look in some other servers and noticed they don't have it either, i looked in the client but couldn't find the item amount being sent either lol.

    Halp. (H)
    Reply With Quote  
     

  2. #2  
    Legend Rene
    Guest
    readUnsignedWord(); = reading item id, frame for deleting items is 55.
    Reply With Quote  
     

  3. #3  
    Stanyer
    Guest
    I'm asking how to read the item amount when you pick up items.
    Reply With Quote  
     

  4. #4  
    HcoFlame
    Guest
    Quote Originally Posted by Stanyer View Post
    I'm asking how to read the item amount when you pick up items.
    Its all kept track of server sided.
    Reply With Quote  
     

  5. #5  
    Stanyer
    Guest
    Ah yes, i'm a right muppet (H).
    I get it now, lol.
    Reply With Quote  
     

  6. #6  
    Legend Rene
    Guest
    Ah right, read it wrong lol, sorry.
    Reply With Quote  
     

  7. #7  
    Stanyer
    Guest
    Quote Originally Posted by Legend Rene View Post
    Ah right, read it wrong lol, sorry.
    Np's .
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •