View Single Post
Old 06-19-2005, 08:18 PM   #13 (permalink)
Serp
The noob formerly known as Jakob
 
Serp's Avatar
 
Join Date: Jan 2005
Posts: 316
Default

Quote:
Originally Posted by Zippy
Here is a code snippet like the one above that does not require you to modify the core:

Scripts
PlayerMobile.cs

Add the lines in red to the PlayerMobile class:
Code:
public class PlayerMobile : Mobile
{
	public override void DoSpeech( string text, int[] keywords, MessageType type, int hue )
	{
		if ( (int)type == 0x0F ) // If the message is of type GM
			text = String.Format( "{0}{1}", Commands.CommandPrefix, text ); // then add the prefix to it
		base.DoSpeech( text, keywords, type, hue ); // Process the same way as always
	}
That's the one I posted first but I removed it as there is code in the core preventing it from working:
Code:
if ( !Enum.IsDefined( typeof( MessageType ), type ) )
	type = MessageType.Regular;
Serp is offline   Reply With Quote