Server.Multis.BaseHouse.Ban C# (CSharp) Méthode

Ban() public méthode

public Ban ( Server.Mobile from, Server.Mobile targ ) : void
from Server.Mobile
targ Server.Mobile
Résultat void
		public void Ban( Mobile from, Mobile targ )
		{
			if ( !IsFriend( from ) || m_Bans == null )
				return;

			if ( targ.AccessLevel > AccessLevel.Player && from.AccessLevel <= targ.AccessLevel )
			{
				from.SendLocalizedMessage( 501354 ); // Uh oh...a bigger boot may be required.
			}
			else if ( IsFriend( targ ) )
			{
				from.SendLocalizedMessage( 501348 ); // You cannot eject a friend of the house!
			}
			else if ( targ is PlayerVendor )
			{
				from.SendLocalizedMessage( 501351 ); // You cannot eject a vendor.
			}
			else if ( m_Bans.Count >= MaxBans )
			{
				from.SendLocalizedMessage( 501355 ); // The ban limit for this house has been reached!
			}
			else if ( IsBanned( targ ) )
			{
				from.SendLocalizedMessage( 501356 ); // This person is already banned!
			}
			else if ( !IsInside( targ ) )
			{
				from.SendLocalizedMessage( 501352 ); // You may not eject someone who is not in your house!
			}
			else if ( targ is BaseCreature && ((BaseCreature)targ).NoHouseRestrictions )
			{
				from.SendLocalizedMessage( 1062040 ); // You cannot ban that.
			}
			else
			{
				m_Bans.Add( targ );

				from.SendLocalizedMessage( 1042839, targ.Name ); // ~1_PLAYER_NAME~ has been banned from this house.
				targ.SendLocalizedMessage( 501340 ); // You have been banned from this house.

				targ.MoveToWorld( BanLocation, Map );
			}
		}