|
||
|
|||||||
| Server Support on Windows Get (and give) support on general questions related to the RunUO server itself. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#3 (permalink) | |
|
Join Date: May 2003
Location: Springfield, MO
Posts: 417
|
Quote:
using System; using Server; using Server.Misc; using Server.Accounting; namespace Server.Scripts.Commands { public class NewPasswordCommand { public static void Initialize() { Server.Commands.Register( "NewPassword", AccessLevel.Player, new CommandEventHandler( ChangePassword_OnCommand ) ); Server.Commands.Register( "NewPass", AccessLevel.Player, new CommandEventHandler( ChangePassword_OnCommand ) ); Server.Commands.Register( "Password", AccessLevel.Player, new CommandEventHandler( ChangePassword_OnCommand ) ); Server.Commands.Register( "PW", AccessLevel.Player, new CommandEventHandler( ChangePassword_OnCommand ) ); } [Usage( "NewPassword <password>" )] [Description( "Changes the current account's password." )] [Aliases( "NewPass, Password, PW" )] public static void ChangePassword_OnCommand( CommandEventArgs e ) { if ( e.Length == 0 ) { e.Mobile.SendMessage( "Format: <new password>" ); e.Mobile.SendMessage( 0x35, "Password must contain only letters of the alphabet. No spaces, quotes or numbers allowed." ); } if ( e.Length == 1 ) { Account acct = e.Mobile.Account as Account; if ( NameVerification.Validate( e.ArgString, 2, 16, true, false, true, 1, NameVerification.SpaceDashPeriodQuote ) ) { Console.WriteLine( "{0} is changing password to '{1}'", e.Mobile, e.ArgString ); acct.Password = e.ArgString; e.Mobile.SendMessage( 0x35, "Your password has been changed." ); e.Mobile.SendMessage( "New password: {0}", e.ArgString ); } else { e.Mobile.SendMessage( 0x25, "Password \"{0}\" failed verification. Try again with a different password.", e.ArgString ); } } } } } [/code:1] like this? |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|