Skip to main content

Console commands

Namespace: DeadworksManaged.Api

A console command is a command that starts with dw_ and runs from the server console or a game console. A plugin creates console commands with the [Command] attribute.

If you name the command heal, Deadworks registers:

  • /heal in chat
  • !heal in chat
  • dw_heal in the console

To register only the console version, without the chat commands, set ConsoleOnly = true:

[Command("heal", ConsoleOnly = true)]
public void CmdHeal(Caller caller)
{
caller.Reply("Healing command ran.");
}
ConsoleOnly doesn't mean "server console only"

Players can still type dw_heal in their own game console. Without a Permission, anyone can run it. To keep a command to the server console and RCON, set ServerOnly = true.

To limit who can run a command, give it a permission:

[Command("heal", ConsoleOnly = true, Permission = "myplugin.heal")]

The server console (and RCON) can run every console command, whatever its permission.

Built-in commands​

CommandWho can run itDescription
dw_helpAnyoneLists the commands you're allowed to run.
dw_plugin <list|enable|disable|commands> [name]Server console or deadworks.plugins.manageLists, enables, disables or shows the commands of installed plugins. Keeps enabled and disabled plugins across restarts. name must be an installed plugin (from plugins/ or builtin/), otherwise There's no plugin called '<name>'. Run dw_plugin list to see them.
dw_reloadconfig [name]Server console or deadworks.config.reloadReloads the config of every plugin, or of the named one.
dw_penalties_reloadServer console or deadworks.penalties.reloadRe-reads bans, gags and mutes after you edit penalties.jsonc by hand.
dw_perm_*, dw_role_*See How permissions workManages roles and permissions.

The built-in commands are ordinary commands, so server owners can change who can run them in overrides.jsonc, like any plugin's.

See also​