Provides data for CommandManager.CommandCalling event. Cancelable.
Inheritance: CommandCalledEventArgs, ICancelableEvent
Example #1
0
 internal static bool RaiseCommandCallingEvent([NotNull] CommandReader cmd, [NotNull] Player player) {
     var h = CommandCalling;
     if (h == null) return false;
     var e = new CommandCallingEventArgs(cmd, player);
     h(null, e);
     return e.Cancel;
 }
Example #2
0
 internal static bool RaiseCommandCallingEvent( Command cmd, CommandDescriptor descriptor, Player player )
 {
     var h = CommandCalling;
     if ( h == null ) return false;
     var e = new CommandCallingEventArgs( cmd, descriptor, player );
     h( null, e );
     return e.Cancel;
 }
Example #3
0
 private static void CommandCalling( object sender, CommandCallingEventArgs e )
 {
     if ( e.Player.World == null )
         return;
     Command cmd = e.Command;
     if ( cmd == null )
         return;
     if ( Cache.ForbiddenCommands.Contains( cmd.Name.ToLower() ) ) {
         e.Player.Message( "Use of this command is forbidden when running Au70 Guilds" );
         e.Cancel = true;
     }
 }