A question about getting an object from inventory

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
Lobillo
Posts: 10
Joined: Fri Jun 19, 2009 3:33 pm

A question about getting an object from inventory

Post 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
User avatar
JIV
L2j Veteran
L2j Veteran
Posts: 1882
Joined: Sun Jan 06, 2008 8:17 pm
Location: Slovakia
Contact:

Re: A question about getting an object from inventory

Post by JIV »

Code: Select all

if (player.getInventory().getItemByItemId(3870) != null)
Lobillo
Posts: 10
Joined: Fri Jun 19, 2009 3:33 pm

Re: A question about getting an object from inventory

Post by Lobillo »

Thank you JIV, very much
User avatar
DrHouse
L2j Inner Circle
L2j Inner Circle
Posts: 912
Joined: Mon Jan 22, 2007 12:14 am
Location: Spain

Re: A question about getting an object from inventory

Post by DrHouse »

Topic moved to prevent your head from being smashed by ThePhoenixBird :mrgreen:
Image

Leadership and management are not talk and talk, but talk and do

Proud of being a part of this project
gio
Posts: 186
Joined: Fri Apr 13, 2007 1:40 am
Contact:

Re: A question about getting an object from inventory

Post by gio »

DrHouse wrote:Topic moved to prevent your head from being smashed by ThePhoenixBird :mrgreen:
lol :mrgreen:
---
L2J = Convert.ToL2J(L2off);
---
Post Reply