Table of Contents

Namespace SampSharp.Entities.SAMP.Commands

Classes

AliasAttribute

Marks a command method as having one or more aliases (shorthand names). Aliases can be used instead of the full command path. For example, [Alias("pm")] on a "message send" command allows "/pm" instead of "/message send".

BooleanParser

Parses a single bool word.

CommandDefinition

Represents a single overload of a command (one specific method implementation). Multiple overloads can exist for the same command with different parameter types.

CommandGroupAttribute

Marks a class or method as part of one or more command groups. Can be applied multiple times to stack groups. For example, [CommandGroup("admin"), CommandGroup("money")] stacks to "admin money".

CommandParameterInfo

Represents information about a command parameter that will be parsed from user input.

CommandServiceOptions

Options for configuring the command service, shared by both player and console command services.

CommandTagAttribute

Attaches custom metadata to a command via key-value pairs. This attribute can be applied multiple times to add multiple tags. Users can define custom tags for their own purposes.

ConsoleCommandAttribute

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).

ConsoleCommandDispatchContext

Provides context and message handler for a console command execution. Wraps the open.mp ConsoleCommandSenderData and provides a convenient interface for command handlers.

ConsoleCommandServiceOptions

Options for configuring the console command service.

DefaultCommandHelpProvider

Default implementation of ICommandHelpProvider.

DefaultCommandParameterParserFactory

Default implementation that creates parsers for standard types.

DefaultCommandTextFormatter

Default implementation of ICommandTextFormatter. Generates standard formatted command usage text.

DefaultPermissionChecker

Default permission checker that grants all permissions. In a real application, override this with custom permission logic.

DefaultPlayerCommandMessageService

Default implementation of IPlayerCommandMessageService. Sends formatted messages to players via SendClientMessage.

DispatchResult

Result of a command dispatch operation.

DoubleParser

Parses a single double word (invariant culture).

EcsBuilderCommandsExtensions

Extension methods for configuring the command system middleware in the ECS builder.

EcsHostBuilderCommandsExtensions

Extension methods for configuring the command system in the ECS host builder.

EnumParser

Parses an enum by integer value or by (case-insensitive) substring of name.

FloatParser

Parses a single float word (invariant culture).

IntParser

Parses a single int word.

PlayerCommandAttribute

Marks an instance method on an ISystem as a player command. The method is invoked when a connected player sends matching chat input (a slash followed by the command name and optional arguments).

PlayerCommandServiceOptions

Options for configuring the player command service.

PlayerParser

Parses a Player reference. Accepts either:

  • integer playerid (e.g. /kick 5)
  • full player name (case-insensitive)
  • name prefix — picks the player with the lowest playerid among matches

Returns the matched EntityId so the command pipeline can convert it to a Player component.

RequiresPermissionAttribute

Adds a permission tag to the command. See also CommandTagAttribute.

ServiceCollectionCommandsExtensions

Extension methods for configuring the command system in the dependency injection container.

StringParser

Consumes ALL remaining input text (used for the last string parameter, e.g. chat messages).

WordParser

Consumes the next whitespace-delimited word.

Structs

CommandAlias

Represents an alias for a command. An alias allows a command to be invoked using a different name (shorthand), ignoring command groups. For example, "/pm" as an alias for "/message send".

CommandGroup

Represents a hierarchical command group (e.g., ["admin", "money", "give"]). Command groups provide a namespace for commands.

CommandTag

Represents a key-value metadata tag attached to a command. Used to store custom command metadata like permissions, categories, etc.

StringSpan

Represents a span of characters within a string.

Interfaces

ICommandAttribute

Base interface for command attributes. Implemented by [PlayerCommand] and [ConsoleCommand].

ICommandHelpProvider

Provides help information about commands for use in help commands.

ICommandParameterParser

Parses one command parameter from chat input.

ICommandParameterParserFactory

Factory for creating command parameter parsers. Can be extended to support custom parameter types.

ICommandRegistry

Represents a registry for managing and retrieving command definitions by name, alias, or group.

ICommandTextFormatter

Formats command usage text. Generates strings like "/cmd <arg1> <arg2>" for display. Can be customized for localization.

IConsoleCommandMessageService

Sends formatted command messages to the console.

IConsoleCommandService

Dispatches console input to a method marked with ConsoleCommandAttribute.

IPermissionChecker

Checks whether a player has permission to invoke a specific command. Used only for player commands; console commands do not require permission checks.

IPlayerCommandMessageService

Sends formatted command messages to players.

IPlayerCommandService

Dispatches chat input from a player to a method marked with PlayerCommandAttribute.

Enums

DispatchResponse

Response codes for command dispatch.

Delegates

CommandComponentMatcher

Delegate type for validating whether command arguments can be resolved to the required component types.

CommandInvoker

Delegate type for the compiled method invoker of a command overload.