how do I send a message to a player as they walk by. I want it to say "You have entered the cavern of dragons. Adventurer beware." And changing the hue would be nice.

I do not want to use the proximity message feature of xml if I can help it.
 
I am trying to make this so its simple and easy. Using the Speaking Sign script, I am trying to set the name, so name is not the message, and set it up so it can easily send a message in a colored hue.
I have modified it and got some of it working, but now getting errors that I am not sure about.
This is what I have for the script so far:

Code:
using System;
using System.Collections;
using Server;
using Server.Mobiles;
using Server.Network;


namespace Server.Items
{
    public class DungeonMaster : Item
    {
        private DateTime LastUse;
        public virtual TimeSpan Delay{ get{ return TimeSpan.FromMinutes( 1.0 ); } }
   
    [Constructable]
        public DungeonMaster() : base(0x0495);
        {
            Movable = false;
            Name = Description;
            Hue = 1154;
            Visible = false;
        }
       
        public virtual void HeedWarning()
        {
            //PublicOverheadMessage( type, hue, number, "" );
            PublicOverheadMessage( MessageType.Regular, 0x3B2, false, String.Format( "{0}" );
        }

        public override bool HandlesOnMovement { get { return true; } }

        public override void OnMovement( Mobile m, Point3D oldLocation )
        {
                if ( m.AccessLevel > AccessLevel.Player && m.Hidden )
                return;
               
                    if ( m is PlayerMobile && m.InRange( this, 10 ) )
                    {
                        if ( LastUse + Delay > DateTime.Now  )
                        {   
                            return;
                        }
                        else
                        {   
                            HeedWarning();
                            LastUse = DateTime.Now;
                        }
                    }
               
        }

        public DungeonMaster( Serial serial ) : base( serial )
        {
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );
            writer.Write( (int) 0 );
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();
        }
    }
}
 
Add this to your constructor and to the Deserialize method also:

Code:
LastUse = DateTime.Now;

Can you post the error you are getting?
 
CS1519: Line 23: Unexpected symbol `{' in class, struct, or interface member declaration
CS1519: Line 24: Unexpected symbol `=' in class, struct, or interface member declaration
CS1519: Line 25: Unexpected symbol `=' in class, struct, or interface member declaration
CS1519: Line 25: Unexpected symbol `;' in class, struct, or interface member declaration
CS1519: Line 26: Unexpected symbol `=' in class, struct, or interface member declaration
CS1519: Line 27: Unexpected symbol `=' in class, struct, or interface member declaration
CS1525: Line 30: Unexpected symbol `void', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
CS1525: Line 33: Unexpected symbol `PublicOverheadMessage', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
CS1525: Line 33: Unexpected symbol `,', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
CS1525: Line 33: Unexpected symbol `(', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
CS1514: Line 34: Unexpected symbol `}', expecting `.' or `{'
CS1525: Line 36: Unexpected symbol `bool', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
 
ok, did that, now this --

Code:
    CS1519: Line 17: Unexpected symbol `LastUse' in class, struct, or interface member declaration                                           
    CS1519: Line 17: Unexpected symbol `=' in class, struct, or interface member declaration                                                 
    CS1519: Line 18: Unexpected symbol `{' in class, struct, or interface member declaration                                                 
    CS1519: Line 19: Unexpected symbol `=' in class, struct, or interface member declaration                                                 
    CS1519: Line 20: Unexpected symbol `=' in class, struct, or interface member declaration                                                 
    CS1519: Line 21: Unexpected symbol `=' in class, struct, or interface member declaration                                                 
    CS1519: Line 22: Unexpected symbol `=' in class, struct, or interface member declaration                                                 
    CS1525: Line 25: Unexpected symbol `void', expecting `class', `delegate', `enum', `interface', `partial', or `struct'                    
    CS1525: Line 28: Unexpected symbol `PublicOverheadMessage', expecting `class', `delegate', `enum', `interface', `partial', or `struct'   
    CS1525: Line 28: Unexpected symbol `,', expecting `class', `delegate', `enum', `interface', `partial', or `struct'                       
    CS1525: Line 28: Unexpected symbol `(', expecting `class', `delegate', `enum', `interface', `partial', or `struct'                       
    CS1514: Line 29: Unexpected symbol `}', expecting `.' or `{'                                                                             
    CS1525: Line 31: Unexpected symbol `bool', expecting `class', `delegate', `enum', `interface', `partial', or `struct'
 
I messed with some of the code and messed up. So I used the old code that I posted here and it works. I just need to make more than one so people will step on it at a dungeon entrance. It gives me the ability to add 2 lines of text, which is not much until you see it on the journal, then it looks like alot. Going to stick with this, as it seems to work better than using XML Message or Dialog.

Thanks Lokai.

P.S.
Just out of curiousity, how do I make the text come out different colors. Any way to add that option to the gump where it says:
MsgSender
Active
Message
<put hue option here>
 
I got what I wanted working with XMLSpawner's XMLDialog. It works great. I like it. Even my OCD likes the way it works. Going to stick with it.

My on regret ,or wish, is that XMLSpawner needs a FULLY DETAILED MANUAL so we know what the heck that system can do.
 
Back