Class ConsoleCommandDispatchContext
Provides context and message handler for a console command execution. Wraps the open.mp ConsoleCommandSenderData and provides a convenient interface for command handlers.
public class ConsoleCommandDispatchContext
- Inheritance
-
ConsoleCommandDispatchContext
- Inherited Members
Constructors
ConsoleCommandDispatchContext(Player?, Action<string>?)
Initializes a new instance from console sender data.
public ConsoleCommandDispatchContext(Player? player, Action<string>? messageHandler = null)
Parameters
playerPlayerThe player who sent the command (null if sent from server console).
messageHandlerAction<string>Optional handler to send response messages.
Properties
MessageHandler
Optional handler to send response messages back to the console/player.
public Action<string>? MessageHandler { get; }
Property Value
Player
The player who invoked this console command, or null if invoked from server console.
public Player? Player { get; }
Property Value
Methods
SendMessage(string)
Sends a message via the MessageHandler if available.
public void SendMessage(string message)
Parameters
messagestringThe message to send.