sahisahi
Member
Title, im trying to make a wall show the current/maxhitpoints on singleclick, no sucess so far.
This is what i have;
Its so wrong, i know
i also tried to add somethng like
Errors:
Errors:
CS0103: Line 34: The name 'm_Hits' does not exist in the current context
CS1061: Line 36: 'int' does not contain a definition for 'm_Hits' and no ext
ension method 'm_Hits' accepting a first argument of type 'int' could be found (
are you missing a using directive or an assembly reference?)
CS0103: Line 38: The name 'm_Hits' does not exist in the current context
CS0103: Line 38: The name 'HitsMax' does not exist in the current context
Thanks servuo
This is what i have;
Code:
using System;
using Server;
using Server.Network;
using Server.Engines.XmlSpawner2;
namespace Server.Items
{
public class WallWLSUR : Item
{
private int m_DestroyedItemID = 0;
[Constructable]
public WallWLSUR(): base(148)
{
Weight = 30.0;
Name = "Weak wooden wall";
Movable = true;
XmlAttach.AttachTo(this, new XmlCitySiege(250,1,1,2,0,0));
}
public override void OnSingleClick( Mobile from )
{
XmlSiege siege = (XmlSiege)XmlAttach.FindAttachment(this, typeof(XmlSiege));
if (siege != null)
{
bool ascii = true;
int hue = 1156;
string rankTitle;
int siege = m_Hits(this);
if (siege.m_Hits >= 1)
rankTitle = string.Format("[{1}/{2}]", m_Hits, HitsMax);
PrivateOverheadMessage(MessageType.Label, hue, ascii, rankTitle, from.NetState);
}
base.OnSingleClick( from );
}
public WallWLSUR(Serial serial) : base(serial)
{
}
public override void Serialize( GenericWriter writer )
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
}
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
}
}
Its so wrong, i know
i also tried to add somethng like
Code:
private int m_Hits;
private int m_HitsMax;
Errors:
Errors:
CS0103: Line 34: The name 'm_Hits' does not exist in the current context
CS1061: Line 36: 'int' does not contain a definition for 'm_Hits' and no ext
ension method 'm_Hits' accepting a first argument of type 'int' could be found (
are you missing a using directive or an assembly reference?)
CS0103: Line 38: The name 'm_Hits' does not exist in the current context
CS0103: Line 38: The name 'HitsMax' does not exist in the current context
Thanks servuo