RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Complete Messaging System

sadoul

Wanderer
Nevermind, I finally found it

hehe, turns out I just had to sift to the very middle of all the 7 pages of posts...sorry, thanks Fury!!!
 

Michael642

Wanderer
Fury,

As a script surfer myself, I know how hard it can be for newer people at times to have to deal with the whole playermobile business, I would usggest updating your messeging system to have the Default 1.0 Playermobile.cs. It makes it easier and more convenient for people, and i'm sure ALOT more people would be using it. Good job on it though!
 
L

Link_of_Hyrule

Guest
i got this error :

- Error: Scripts\custome\MsgClientGump.cs: CS0246: (line 88, column 20) The typ
e or namespace name 'm' could not be found (are you missing a using directive or
an assembly reference?)
- Error: Scripts\custome\MsgClientGump.cs: CS0103: (line 90, column 11) The nam
e 'Guildm' does not exist in the class or namespace 'Server.Gumps.MsgClientGump'

- Error: Scripts\custome\MsgClientGump.cs: CS0136: (line 97, column 26) A local
variable named 'guild' cannot be declared in this scope because it would give a
different meaning to 'guild', which is already used in a 'parent or current' sc
ope to denote something else
- Error: Scripts\custome\MsgClientGump.cs: CS0117: (line 99, column 19) 'Server
.Guilds.Guild' does not contain a definition for 'Mobile'
- Error: Scripts\custome\MsgClientGump.cs: CS0246: (line 101, column 27) The ty
pe or namespace name 'Guildm' could not be found (are you missing a using direct
ive or an assembly reference?)
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.


heres the script i'm using:

Code:
using System; 
using System.Net; 
using Server; 
using Server.Accounting; 
using Server.Network; 
using Server.Targets; 
using Server.Scripts.Gumps; 
using Server.Mobiles;
using Server.Guilds;

namespace Server.Gumps
{
	public class MsgClientGump : Gump
	{
		private NetState m_State;

		private void Resend( Mobile to, RelayInfo info )
		{
			TextRelay te = info.GetTextEntry( 0 );

			to.SendGump( new MsgClientGump( to, m_State, te == null ? "" : te.Text ) );
		}

		public override void OnResponse( NetState state, RelayInfo info )
		{
			if ( m_State == null )
				return;

			Mobile focus = m_State.Mobile;
			Mobile from = state.Mobile;

			if ( focus == null )
			{
				from.SendMessage( "That character is no longer online." );
				return;
			}
			else if ( focus.Deleted )
			{
				from.SendMessage( "That character no longer exists." );
				return;
			}

			switch ( info.ButtonID )
			{
				case 1: // Tell
				{
					TextRelay text = info.GetTextEntry( 0 );

					if ( text != null )
					{
						if ((((PlayerMobile)focus).IgnoreList.Contains ( from ) ) && ( from.AccessLevel == AccessLevel.Player ))
						{ 
							from.SendMessage( "The user is ignoring you!" ); 
						} 
						else
						{
							from.SendMessage( 0x482, "You told {0}:", focus.Name );
							from.SendMessage( 0x482, text.Text );
							focus.SendMessage( 0x482, "{0} tells you:", from.Name );
							focus.SendMessage( 0x482, text.Text );
							focus.CloseGump( typeof(MsgReplyGump) );
							focus.SendGump( new MsgReplyGump( from.NetState ) );
							
						}
					}

					from.SendGump( new MsgClientGump( from, m_State ) );

					break;
				}
				case 4: // Remove Ignore 
				{
					((PlayerMobile)from).IgnoreList.Remove ( focus );
					from.SendMessage ( "{0} will no longer be ignored", focus.Name );
					from.SendGump( new MsgClientGump( from, m_State ) );
					break;
				}
				case 5: // Add Ignore 
				{
					((PlayerMobile)from).IgnoreList.Add ( focus );
					from.SendMessage ( "{0} added to ignore list", focus.Name );
					from.SendGump( new MsgClientGump( from, m_State ) );
					break;
				}
				case 6: // GuildChat 
				{ 
					TextRelay text = info.GetTextEntry( 0 );
					Guild guild = m.Guild as Guild;

					if ( Guildm == null ) 
					{ 
						from.SendMessage( "You are not a member of any guild!" ); 
					} 

					else if ( text != null ) 
					{
						foreach ( NetState guild in NetState.Instances ) 
						{
							Mobile m = guild.Mobile;
							PlayerMobile pm = m as PlayerMobile; 
							if ( pm != null && GuildC.IsMember( pm ) && !(pm.IgnoreList.Contains ( from )) && !(pm.IgnoreList.Contains ( pm )) ) 
							{
								m.SendMessage( 75, "{0} tells the guild:", from.Name ); 
								m.SendMessage( 75, text.Text );  
							}
						} 
					}
					from.SendGump( new MsgClientGump( from, m_State ) );

					break;
				}
				case 7: // Enable Guild 
				{
					((PlayerMobile)from).IgnoreList.Remove ( focus );
					from.SendMessage ( "You will now recieve guild messages." );
					from.SendGump( new MsgClientGump( from, m_State ) );
					break;
				}
				case 8: // Block Guild 
				{
					((PlayerMobile)from).IgnoreList.Add ( focus );
					from.SendMessage ( "You will no longer recieve guild messages." );
					from.SendGump( new MsgClientGump( from, m_State ) );
					break;
				}
			} 
		}

		public MsgClientGump( Mobile from, NetState state ) : this( from, state, "" )
		{
		}

		private const int LabelColor32 = 0xFFFFFF;

		public string Center( string text )
		{
			return String.Format( "<CENTER>{0}</CENTER>", text );
		}

		public string Color( string text, int color )
		{
			return String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text );
		}

		public MsgClientGump( Mobile from, NetState state, string initialText ) : base( 30, 20 )
		{
			if ( from == null )
				return;
			if ( state == null )
				return;

			m_State = state;

			AddPage( 0 );

			AddBackground( 0, 0, 400, 204, 5054 );

			AddImageTiled( 10, 10, 380, 19, 0xA40 );
			AddAlphaRegion( 10, 10, 380, 19 );

			AddImageTiled( 10, 32, 380, 162, 0xA40 );
			AddAlphaRegion( 10, 32, 380, 162 );

			AddHtml( 10, 10, 380, 20, Color( Center( "Dragoness" ), LabelColor32 ), false, false );

			int line = 0;

			Account a = state.Account as Account;
			Mobile m = state.Mobile;

			if ( m == from  && from.Guild != null )
			{
				Guild guild = m.Guild as Guild;

				AddHtml( 14, 36 + (line * 20), 160, 20, Color( "Guild:", LabelColor32 ), false, false );
				AddHtml( 50, 36 + (line++ * 20), 160, 20, Color( String.Format( "{0}", guild.Name ), LabelColor32 ), false, false );
				
				AddHtml( 14, 36 + (line * 20), 160, 20, Color( "Type:", LabelColor32 ), false, false );
				AddHtml( 50, 36 + (line++ * 20), 160, 20, Color( String.Format( "{0}", guild.Type ), LabelColor32 ), false, false );

				AddButton( 13, 165, 0xFAB, 0xFAD, 6, GumpButtonType.Reply, 0 );
				AddHtml( 48, 166, 200, 20, Color( "Send Guild Message", LabelColor32 ), false, false );

				AddImageTiled( 12, 82, 376, 80, 0xA40 );
				AddImageTiled( 13, 83, 374, 78, 0xBBC );
				AddTextEntry( 15, 83, 372, 78, 0x480, 0, "" );

				AddImageTiled( 205, 45, 182, 24, 5058 );

				AddImageTiled( 206, 46, 180, 22, 0xA40 );
				AddAlphaRegion( 206, 46, 180, 22 );

				line = 0;

				if ( ((PlayerMobile)from).IgnoreList.Contains ( m ) )
				{ 
					AddButton( 206, 46 + (line * 20), 0xFA5, 0xFA7, 7, GumpButtonType.Reply, 0 );
					AddHtml( 240, 48 + (line++ * 20), 140, 20, Color( "Enable Guild Messages", LabelColor32 ), false, false );
				}
				else
				{
					AddButton( 206, 46 + (line * 20), 0xFA5, 0xFA7, 8, GumpButtonType.Reply, 0 );
					AddHtml( 240, 48 + (line++ * 20), 140, 20, Color( "Disable Guild Messages", LabelColor32 ), false, false );
				}

			}

			if ( m != null && m != from )
			{
				Guild guild = m.Guild as Guild;

				AddHtml( 14, 36 + (line * 20), 160, 20, Color( "Name:", LabelColor32 ), false, false );
				AddHtml( 70, 36 + (line++ * 20), 160, 20, Color( String.Format( "{0}", m.Name ), LabelColor32 ), false, false );

				AddHtml( 14, 36 + (line * 20), 160, 20, Color( "Guild:", LabelColor32 ), false, false );
				
				if( guild == null )
					AddHtml( 70, 36 + (line++ * 20), 160, 20, Color( "None", LabelColor32 ), false, false );
				else
					AddHtml( 70, 36 + (line++ * 20), 160, 20, Color( String.Format( "{0}", guild.Name ), LabelColor32 ), false, false );
				
				AddButton( 13, 165, 0xFAB, 0xFAD, 1, GumpButtonType.Reply, 0 );
				AddHtml( 48, 166, 200, 20, Color( "Send Message", LabelColor32 ), false, false );

				AddImageTiled( 12, 82, 376, 80, 0xA40 );
				AddImageTiled( 13, 83, 374, 78, 0xBBC );
				AddTextEntry( 15, 83, 372, 78, 0x480, 0, "" );

				AddImageTiled( 205, 45, 182, 24, 5058 );

				AddImageTiled( 206, 46, 180, 22, 0xA40 );
				AddAlphaRegion( 206, 46, 180, 22 );

				line = 0;
				
				if ( ((PlayerMobile)from).IgnoreList.Contains ( m ) )
				{ 
					AddButton( 206, 46 + (line * 20), 0xFA5, 0xFA7, 4, GumpButtonType.Reply, 0 );
					AddHtml( 240, 48 + (line++ * 20), 140, 20, Color( "Remove From Ignore List", LabelColor32 ), false, false );
				}
				else
				{
					AddButton( 206, 46 + (line * 20), 0xFA5, 0xFA7, 5, GumpButtonType.Reply, 0 );
					AddHtml( 240, 48 + (line++ * 20), 140, 20, Color( "Add To Ignore List", LabelColor32 ), false, false );
				}
			}
		}
	}
}
 

daeth

Wanderer
heres my problem...
- Error: Scripts\Mobiles\PlayerMobile.cs: CS0115: (line 1674, column 24) 'Serve
r.Mobiles.PlayerMobile.OnGuildChange(Server.Guilds.Guild)': no suitable method f
ound to override
 

darksky

Sorceror
I dunno whats wrong, im newbie, get this error trying change the PlayerMobile.cs

Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: Scripts\Mobiles\PlayerMobile.cs: CS1518: (line 20, column 19) Expected
class, delegate, enum, interface, or struct
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.
:(
 

darksky

Sorceror
I get this error ! :(

Error: Scripts\Mobiles\PlayerMobile.cs: CS1518: (line 20, column 19) Expected
class, delegate, enum, interface, or struct

All how instructions.
If anyone can help me very thanks ;)
 

Almassey

Sorceror
Fury said:
Find the OnLogin method in playermobile and set OnShow = true when player logs in.

To do the above, would you change this:
Code:
private static void OnLogin( LoginEventArgs e )
		{
			Mobile from = e.Mobile;
			
			PlayerMobile pm = from as PlayerMobile;
			
				if ( pm.m_IgnoreList == null ) 
				pm.m_IgnoreList = new ArrayList();

to this:
Code:
private static void OnLogin( LoginEventArgs e )
		{
			Mobile from = e.Mobile;

			OnShow = true 

			PlayerMobile pm = from as PlayerMobile;
			
				if ( pm.m_IgnoreList == null ) 
				pm.m_IgnoreList = new ArrayList();
 

darksky

Sorceror
Scripts: Compiling C# scripts...failed (1 errors, 0 warnings)
- Error: Scripts\Mobiles\PlayerMobile.cs: CS0116: (line 35, column 1) A namespa
ce does not directly contain members such as fields or methods
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.

now i get this error
didnt work :(

thanks
 
S

Savaal

Guest
I used the Playermobile that came with FuryMessageSystem and i boot up my shard this is the only error i get how can i fix it...

Code:
Scripts: Compiling C# scripts...failed (1 errors, 3 warnings)
 - Warning: : CS0108: (line 0, column 0) The keyword new is required on 'Server.
Regions.ProtectedGuardRegion.Load' because it hides inherited member 'Server.Reg
ion.Load()'
 - Warning: : CS0108: (line 0, column 0) The keyword new is required on 'Server.
Items.TownDonationChest.Amount' because it hides inherited member 'Server.Item.A
mount'
 - Warning: : CS0114: (line 0, column 0) 'Server.TownWar.triple.ToString()' hide
s inherited member 'object.ToString()'. To make the current member override that
 implementation, add the override keyword. Otherwise add the new keyword.
 - Error: Scripts\Mobiles\PlayerMobile.cs: CS0115: (line 1674, column 24) 'Serve
r.Mobiles.PlayerMobile.OnGuildChange(Server.Guilds.Guild)': no suitable method f
ound to override
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.


Any help would be great thanks :)
 

SquireOCX

Wanderer
Hello Fury, if you are still here..

I need help with this script.

I implemented it fine, it booted up fine.

When I put it on the live server it was good, then when i rebooted a few days later, its been trying to delete my PlayerMobile.

I even tried removing the script completely, there is no way i can delete the playermobile, simple. But I need a fix somehow. Any suggestions? Its pretty urgent.
 
Top