Skip to content

Custom Commands

Andrzej edited this page Jul 26, 2024 · 10 revisions

Custom Command allow you to create special commands in config, which can have different behaviours. You can only use either cooldown or player_cooldown. If you set cooldown to 1 or 0, you must set the other one to -1 to disable it. The reverse is also true.

When a command is executed, a player variable called {SENDER} is created. This variable represents the player that ran the command.

The plugin's config must follow this structure.

commands:
- name: 'test'
  enabled: true
  description: 'This is an test command'
  permission: ''
  type: PlayerConsole
  default_response: false
  cooldown: -1
  player_cooldown: 5
  run:
  - 'setrole'
- name: 'test2'
  enabled: true
  description: 'This is an example how to create second command'
  permission: ''
  type: RemoteAdmin
  default_response: false
  cooldown: -1
  player_cooldown: -1
  run:
  - 'sex'

The parameters are outlined below:

  • name - Specifies the name of the command.
  • enabled - Determines whether the command is active on the server; if set to False, the command won't register.
  • description - Provides a description of the command to be displayed in base-game help messages.
  • permission - Indicates the required permission to use the command, formatted as script.command.<your input here>. Leave blank for no permission.
  • type - Specifies the type of command, which must be one of the following: PlayerConsole, RemoteAdmin, or ServerConsole.
  • default_response - This is the default response displayed in the console after executing a script. If you prefer no response, set the value to False.
  • cooldown - Sets a cooldown for the command that applies to everyone.
  • player_cooldown - Sets a cooldown specifically for the player who initiated the command.
  • run - Contains a list of scripts to execute when the command is triggered.

Actions

Clone this wiki locally