Table of Contents

Class ConsoleCommandAttribute

Namespace
SampSharp.Entities.SAMP.Commands
Assembly
SampSharp.OpenMp.Entities.Commands.dll

Marks an instance method on an ISystem as a console command. The method is invoked when a command is sent via the console (from a player or server).

[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)]
public class ConsoleCommandAttribute : Attribute, ICommandAttribute
Inheritance
ConsoleCommandAttribute
Implements
Inherited Members

Remarks

The signature can be:

Constructors

ConsoleCommandAttribute()

Initializes a new instance with the command name inferred from the method name (lowercased, trailing "Command" stripped).

public ConsoleCommandAttribute()

ConsoleCommandAttribute(string)

Initializes a new instance with the explicit command name.

public ConsoleCommandAttribute(string name)

Parameters

name string

Properties

Name

The command name (optional; derives from method name if not specified).

public string? Name { get; set; }

Property Value

string