Noir
  • πŸšΆβ€β™‚οΈIntro
  • πŸ“Tutorials
    • πŸŽ“Starting Noir
    • πŸ“–Libraries
    • πŸ–₯️Services
    • ❔Libraries VS Services
    • πŸ’¬Callbacks
    • πŸ’₯Classes
    • πŸ”ŽDebugging
  • πŸ“šExamples
  • β˜„οΈAPI Reference
    • Bootstrapper
    • Built-Ins
      • Classes
        • AITarget
        • Body
        • Command
        • Connection
        • Event
        • HTTPRequest
        • HTTPResponse
        • Library
        • Message
        • Object
        • Player
        • Service
        • Task
        • TickIterationProcess
        • Tracker
        • Vehicle
        • Widgets
          • MapLabelWidget
          • MapLineWidget
          • MapObjectWidget
          • PopupWidget
          • ScreenPopupWidget
          • Widget
      • Libraries
        • Base64
        • Dataclasses
        • Deprecation
        • Events
        • HTTP
        • JSON
        • Logging
        • Matrix
        • Number
        • String
        • Table
      • Services
        • CommandService
        • GameSettingsService
        • HTTPService
        • MessageService
        • NotificationService
        • ObjectService
        • PlayerService
        • TaskService
        • TPSService
        • UIService
        • VehicleService
    • Callbacks
    • Class
    • Classes
    • Debugging
    • Definition
    • Libraries
    • Noir
    • Services
    • TypeChecking
Powered by GitBook
On this page
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
  • Parameters
  • Returns
Edit on GitHub
  1. API Reference
  2. Built-Ins
  3. Services

CommandService

Noir.Services.CommandService: NoirService

A service for easily creating commands with support for command aliases, permissions, etc.


Noir.Services.CommandService:FindCommand(query)

Get a command by the name or alias.

Parameters

  • query: string

Returns

  • NoirCommand|nil


Noir.Services.CommandService:CreateCommand(name, aliases, requiredPermissions, requiresAuth, requiresAdmin, capsSensitive, description, callback)

Create a new command.

Parameters

  • name: string - The name of the command (eg: if you provided "help", the player would need to type "?help" in chat)

  • aliases: table<integer, string> - The aliases of the command

  • requiredPermissions: table<integer, string>|nil - The required permissions for this command

  • requiresAuth: boolean|nil - Whether or not this command requires auth

  • requiresAdmin: boolean|nil - Whether or not this command requires admin

  • capsSensitive: boolean|nil - Whether or not this command is case-sensitive

  • description: string|nil - The description of this command

  • callback: fun(player: - NoirPlayer, message: string, args: table<integer, string>, hasPermission: boolean)

Returns

  • NoirCommand


Noir.Services.CommandService:GetCommand(name)

Get a command by the name.

Parameters

  • name: string

Returns

  • NoirCommand|nil


Noir.Services.CommandService:RemoveCommand(name)

Remove a command.

Parameters

  • name: string


Noir.Services.CommandService:GetCommands()

Returns all commands.

Returns

  • table<string, NoirCommand>

PreviousServicesNextGameSettingsService

Last updated 10 months ago

β˜„οΈ