Lena80
Member
For some reason it dont let me access the CompletedBy property inside the OnThink method
Errors
CS1061: Line 1290: 'Server.Item' does not contain a definition for 'Complete
dBy' and no extension method 'CompletedBy' accepting a first argument of type 'S
erver.Item' could be found (are you missing a using directive or an assembly ref
erence?)
CS1061: Line 1292: 'Server.Item' does not contain a definition for 'Complete
dBy' and no extension method 'CompletedBy' accepting a first argument of type 'S
erver.Item' could be found (are you missing a using directive or an assembly ref
inside that npc script, onbeforedeath i got the next method and it let me access completedby property,why?
C#:
private Mobile m_Player;
// public Mobile m_CompletedBy;
public override void OnThink()
{
base.OnThink();
Map mapa = this.Map;
if (mapa != null)
{
m_Player = this;
Point3D location = this.Location;
List<Item> itemsFound = new List<Item>();
foreach (Item item in m_Player.Map.GetItemsInRange(location, 0))
{
if (item is TreasureMap )
{
itemsFound.Add(item);
if (item != null && item is TreasureMap && item.m_CompletedBy != null) //line 1290
{
Console.WriteLine("item is completedby {0}",item.m_CompletedBy); //line 1292
}
}
}
}
}
Errors
CS1061: Line 1290: 'Server.Item' does not contain a definition for 'Complete
dBy' and no extension method 'CompletedBy' accepting a first argument of type 'S
erver.Item' could be found (are you missing a using directive or an assembly ref
erence?)
CS1061: Line 1292: 'Server.Item' does not contain a definition for 'Complete
dBy' and no extension method 'CompletedBy' accepting a first argument of type 'S
erver.Item' could be found (are you missing a using directive or an assembly ref
inside that npc script, onbeforedeath i got the next method and it let me access completedby property,why?
C#:
objetotreasure ps = new objetotreasure();
objetotreasure.CompletedBy = m; Console.WriteLine(".CompletedBy {0} - ",m.Name);
ps.MoveToWorld(this.Location, this.Map);