xG00BERx

I don't know exactly what I am doing wrong as I have looked around and seen similar stuff all over but here is what I got.

Code:
            public override void OnClick(Mobile from)
            {
                //m_player.SendMessage("Put Some 'Buy' functions in.");
                from.Target = new SearchTarget(this);
            }
        }


        private class SearchTarget : Target
        {
            private Mobile m_Mobile;
            private ThreshLantern m_Lantern;

            public SearchTarget(ThreshLantern lantern)
                : base(ThreshLantern.Range, false, TargetFlags.Beneficial)
            {
                m_Lantern = lantern;
            }

            protected override void OnTarget(Mobile from, object targeted)
            {

            }
        }

I am getting a error with from.Target = new SearchTarget(this);

Help is much appreciated
 
Code:
Errors:
+ Custom/Thresh's Lantern.cs:
    CS0115: Line 62: 'Server.Items.ThreshLantern.SearchContext.OnClick(Server.Mo
bile)': no suitable method found to override
Scripts: One or more scripts failed to compile or no script files were found.
 

Attachments

  • Thresh's Lantern.cs
    3.5 KB · Views: 4
Try:

Code:
public class SearchContext : ContextMenuEntry
        {
            private ThreshLantern m_item;
            private Mobile m_player;

            public SearchContext(Mobile from, Item item)
                : base(6171, 2)//Search
            {
                m_item = (ThreshLantern) item;
                m_player = from;
                Enabled = true;
            }

            public override void OnClick()
            {
                //m_player.SendMessage("Put Some 'Buy' functions in.");
                m_player.Target = new SearchTarget(m_item);
            }
        }

No clue if it'll work (can't test it), but it should compile fine.
 
That got it so when I hit "Search" I get the target thing to come up but when I click myself It crashes the server xD I think its pretty much good from here. I think I can get the rest of it down!

Need to practice more with these targeting stuff :p Thanks!
 
Back