Page 1 of 1

A question about getting an object from inventory

Posted: Thu Oct 29, 2009 7:17 pm
by Lobillo
What is the method for getting a object from inventory the pj?
I'm intented very very times and i not obtened results...

I create and method and... i post followings:

Code: Select all

if (player.getInventory().getItemByItemId(3870)){    	code...			}

and the eclipse I get this error, says:

Type mismatch: cannot convert from L2ItemInstance to boolean

And the eclipse i have the option for change to boolean...
They can help me pls... thank you for all

Re: A question about getting an object from inventory

Posted: Thu Oct 29, 2009 7:26 pm
by JIV

Code: Select all

if (player.getInventory().getItemByItemId(3870) != null)

Re: A question about getting an object from inventory

Posted: Thu Oct 29, 2009 7:55 pm
by Lobillo
Thank you JIV, very much

Re: A question about getting an object from inventory

Posted: Thu Oct 29, 2009 9:24 pm
by DrHouse
Topic moved to prevent your head from being smashed by ThePhoenixBird :mrgreen:

Re: A question about getting an object from inventory

Posted: Mon Nov 02, 2009 4:14 pm
by gio
DrHouse wrote:Topic moved to prevent your head from being smashed by ThePhoenixBird :mrgreen:
lol :mrgreen: