sahisahi
Member
Im trying to make universalstoragekeys
it doesnt work, the storageykey has to be either in the backpack or locked down inside a house, if its inside a house only Owner have acess to it
Code:
public bool CheckAccessibility( Item item, Mobile from )
{
SecureAccessResult res = CheckSecureAccess( from, item );
switch ( res )
{
case SecureAccessResult.Insecure: break;
case SecureAccessResult.Accessible: return true;
case SecureAccessResult.Inaccessible: return false;
}
if ( item is ReagentKey )
return IsFriend( from );
if ( !IsLockedDown( item ) )
return true;
if ( from.AccessLevel >= AccessLevel.GameMaster )
return true;
if ( item is Runebook )
return true;
it doesnt work, the storageykey has to be either in the backpack or locked down inside a house, if its inside a house only Owner have acess to it
Code:
//checks if the person trying to access the storekeys can do it
public bool CanUse( Mobile from )
{
if( IsChildOf( from.Backpack ) )
{
if( CanUseFromPack )
{
return true;
}
else
{
from.SendMessage( "That cannot be used from your backpack" );
return false;
}
}
else if( !Movable )
{
if( !from.InRange( this, 2 ) )
{
from.SendMessage( "You are out of range" );
return false;
}
if( CanUseFromHouse )
{
BaseHouse house = BaseHouse.FindHouseAt( this );
if( house == null || !house.HasSecureAccess( from, Level ) )
{
return false;
}
return true;
}
else
{
from.SendMessage( "That cannot be used while locked down" );
return false;
}
}
if( CanUseFromPack )
{
from.SendMessage( "This must be in your backpack to be used." );
}
else if( CanUseFromHouse )
{
from.SendMessage( "This must be locked down in your house to be used." );
}
return false;
}