Go Back   RunUO - Ultima Online Emulation > RunUO > RunUO Post Archive

RunUO Post Archive The Archvie

Reply
 
Thread Tools Display Modes
Old 01-14-2005, 05:33 PM   #1 (permalink)
Forum Expert
 
Join Date: Dec 2002
Posts: 730
Default Multiple Command Prefixes

This will make your server recognize multiple prefixes as commands, apart from the one setted in the base scripts. I'm posting this because someone needed it and maybe more people want something like this but were afraid to ask.

With the code below the server will recognize both . and [ as commands.

Paste this in PlayerMobile.cs, before
Code:
public override bool MutateSpeech( ArrayList hears, ref string text, ref object context )
Code:
		public override void DoSpeech( string text, int[] keywords, MessageType type, int hue )
		{
			if ( text.StartsWith( "." ) )
			{
				text = Server.Commands.CommandPrefix + text.Substring( 1 );
				Commands.Handle( this, text );
				return;
			}

			base.DoSpeech( text, keywords, type, hue );
		}
Change the "." for your new prefix.
You can add as many prefixes you want, just adding else if's below the if but with other characters.
THIS ONLY WORKS WITH 1-CHARACTER PREFIXES
Atomic is offline   Reply With Quote
Old 12-20-2005, 12:21 AM   #2 (permalink)
Account Terminated
 
Join Date: Dec 2005
Location: Windsor, ON. Canada
Age: 20
Posts: 43
Send a message via ICQ to Kashio Send a message via MSN to Kashio
Thumbs up Your Awsome!

Wow, thanks so much! Have been looking for this for the past hour, and now, my shard uses both ! Thx so much! Any more little helpful hints for us nooby scripters? ( don't take offence to that anyone, but c'mon! u know if ur a noob or not!)
Kashio is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5