Server.Items.BaseInstrument.PickInstrument C# (CSharp) Method

PickInstrument() public static method

public static PickInstrument ( Mobile from, InstrumentPickedCallback callback ) : void
from Mobile
callback InstrumentPickedCallback
return void
		public static void PickInstrument( Mobile from, InstrumentPickedCallback callback )
		{
			BaseInstrument instrument = GetInstrument( from );

			if ( instrument != null )
			{
				if ( callback != null )
					callback( from, instrument );
			}
			else
			{
				from.SendLocalizedMessage( 500617 ); // What instrument shall you play?
				from.BeginTarget( 1, false, TargetFlags.None, new TargetStateCallback( OnPickedInstrument ), callback );
			}
		}

Usage Example

Exemplo n.º 1
0
 private static void BardTest_OnCommand(CommandEventArgs e)
 {
     try
     {
         BaseInstrument.PickInstrument(e.Mobile, new InstrumentPickedCallback(OnPickedInstrument));
     }
     catch (Exception ex)
     {
         Server.Commands.LogHelper.LogException(ex);
     }
 }