|
||
|
|
#1 (permalink) |
|
Forum Expert
Join Date: Dec 2002
Posts: 730
|
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 );
}
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 |
|
|
|
|
|
#2 (permalink) |
|
Account Terminated
|
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!) |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|