RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Find a item in Backpack

Tom Bombadil

Wanderer
Find a item in Backpack

I want to know if an item is in my backpack i try to do this (this is not a scripts is only some piece of code)
[code:1]

private Container back_from; // i declare a container

back_from=from.Backpack; // now back_from is my backpack

strumento=back_from.FindItemByType(Dagger.GetType(),true); // how can i set the type ?? this is not work !!!
[/code:1]

C YA :p
 

krrios

Administrator
[code:1]Container pack = from.Backpack;
Item dagger = pack.FindItemByType( typeof( Dagger ) );

if ( dagger != null )
{
// do something with the dagger
}
else
{
// no dagger
}[/code:1]
 
Top