CPMStaffCommands
- community
- administration
- by Mad
- Takaro v0.0.21
- all
Provides a set of moderator commands for enhanced server management, especially useful alongside the CPM (CSMM Patrons Mod). These commands offer tools for player moderation, world manipulation, and server administration.
Key Functionality
- Player Management:
/kill <playerTarget>: Instantly kills the specified player (requires confirmation)./mute <player> <reason>: Mutes a player in chat with a specified reason./unmute <player>: Unmutes a player./arrest <player> <reason>: Places a player in a designated jail area with a reason./release <player>: Releases a player from jail./pull <player>: Teleports the specified player to the moderator's location./rpd <player>: Resets the specified player's data (use with extreme caution)./wi <player> <tool>: Wipes a player's inventory (belt,bag,equipment, orall).
- Player Buffs/Debuffs:
/buff <player>: Temporarily grants god-like powers to a player./debuff <player>: Removes specified debuffs from a player.
- World Manipulation:
/pr: Resets the current Point of Interest (POI)./reset1: Sets the first corner for chunk reset./reset2: Resets chunks between the first and second corners./killall: Kills all zombies on the server./visitmap: Opens the server map (requires CPM functionality).
- Server Control:
/shutdownba <minutes>: Shuts down the server after a specified delay.
How to Use
Installation: Install the module on your Takaro instance.
CPM Requirement: This module is designed to enhance 7 Days to Die servers using the CSMM Patrons Mod (CPM). While some commands may function without it, full functionality is not guaranteed.
Discord Integration (Optional):
- Configure the
userDiscordChannelsetting to enable Discord notifications for certain moderation actions (e.g., bans, kicks, mutes).
- Configure the
Permissions: Grant the
STAFF_COMMANDSpermission to the player groups or individuals who should have access to these moderator commands. Individual commands may have their own permissions as well.In-Game Usage: Moderators can use the commands as described in the "Key Functionality" section. Pay close attention to the specific syntax and arguments required for each command (e.g., using quotes around player names with spaces).
Important Considerations
- CPM Compatibility: The module's functionality may depend on the specific version and configuration of the CSMM Patrons Mod. Ensure compatibility to avoid issues.
- Permission Management: Use the provided permissions to restrict access to these powerful moderator commands. Incorrect usage can disrupt the game experience.
- Confirmation: Some commands (e.g.,
/kill,/rpd) require confirmation to prevent accidental execution due to their potentially destructive nature. - Discord Setup: If using Discord notifications, ensure that your Takaro instance is properly configured to communicate with your Discord server.
Configuration 1
Settings you fill in when installing the module on a server.
| Setting | Type | Default | Description |
|---|---|---|---|
discordChannel discordChannel | string | — | Sends to discord |
Raw config schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"required": [],
"additionalProperties": false,
"properties": {
"discordChannel": {
"title": "discordChannel",
"description": "Sends to discord",
"type": "string"
}
}
} Raw UI schema
{} Commands 9
Chat commands players trigger in game.
-
kill
kill (players name), use quotes for names with spaces
Argument Type Default Help playerTargetstring The player you want to kill Command source
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers'; async function main() { const { player, gameServerId, pog, module: mod, arguments: args } = data; const playerTarget = args.playerTarget; // Check permissions first if (!checkPermission(pog, 'STAFF_COMMANDS')) { throw new TakaroUserError('You do not have permission to use [02FEDC]Moderator[-] commands.'); } // Check if there's an existing confirmation variable const confirmationKey = `kill_confirmation_${playerTarget}`; const existingConfirmation = await takaro.variable.variableControllerSearch({ filters: { key: [confirmationKey], gameServerId: [gameServerId], playerId: [pog.playerId], moduleId: [mod.moduleId] } }); // If confirmation variable exists, proceed with kill if (existingConfirmation.data.data.length > 0) { // Delete the confirmation variable first await takaro.variable.variableControllerDelete(existingConfirmation.data.data[0].id); // Execute the kill command const response = (await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, { command: `kill "${playerTarget}"`, })).data.data.rawResult; if (response.includes('Targetplayer is offline')) { throw new TakaroUserError(`[02FEDC]${playerTarget}[-] is not online`); } await player.pm(`You have killed [02FEDC]${playerTarget}[-].`); } else { // Create confirmation variable with 30 second expiry const now = new Date(); const expiry = new Date(now.getTime() + 30 * 1000); // 30 seconds from now await takaro.variable.variableControllerCreate({ key: confirmationKey, value: JSON.stringify({ expiry: expiry.toISOString() }), gameServerId, moduleId: mod.moduleId, playerId: pog.playerId }); // Send confirmation message await player.pm(`Are you sure you want to kill [02FEDC]${playerTarget}[-]? Run the command again within 30 seconds to confirm.`); } } await main(); -
release
No help text available
Command source
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers'; async function main() { const { gameServerId, player } = data; const { arguments: args } = data; //Check Permissions if (!checkPermission(pog, 'STAFF_COMMANDS')) { throw new TakaroUserError('You do not have permission to use [02FEDC]Moderator[-] commmands.'); } //Execute Command arrest await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, { command: `release "${args.playerTarget}"`, }); if (response.includes('is not a valid entity id, player name or user id')) { throw new TakaroUserError(`[02FEDC]${args.playerTarget}[-]'s name wasn't spelled correctly! Use quotes if their name has spaces!`) }; //Send global message in game to shame the offender await takaro.gameserver.gameServerControllerSendMessage(data.gameServerId, { message: `${args.playerTarget} has been released. Please follow the rules!`, }); }; await main(); //# sourceMappingURL=visit.js.map -
avisit
Teleport to a friend
Argument Type Default Help playerTargetstring Player teleporting to Command source
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers'; async function main() { const { player, gameServerId, pog, arguments: args } = data; const playerTarget = args.playerTarget; if (!checkPermission(pog, 'STAFF_COMMANDS')) { throw new TakaroUserError('You do not have permission to use [02FEDC]Moderator[-] commmands.'); } const response = (await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, { command: `teleportplayer "${player.name}" "${playerTarget}"`, })).data.data.rawResult; if (response.includes('Targetplayer is offline')) { throw new TakaroUserError(`[02FEDC]${playerTarget}[-] is not online`); } // Send success message to the player await player.pm(`Successfully teleported to [02FEDC]${playerTarget}[-]`); } await main(); -
arrest
No help text available
Argument Type Default Help playerTargetstring Other player's name Command source
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers'; async function main() { const { gameServerId, player } = data; const { arguments: args } = data; //Check Permissions if (!checkPermission(pog, 'STAFF_COMMANDS')) { throw new TakaroUserError('You do not have permission to use [02FEDC]Moderator[-] commmands.'); } //Execute Command arrest await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, { command: `arrest "${args.playerTarget}"`, }); if (response.includes('is not a valid entity id, player name or user id')) { throw new TakaroUserError(`[02FEDC]${args.playerTarget}[-]'s name wasn't spelled correctly!`); } //Send global message in game to shame the offender await takaro.gameserver.gameServerControllerSendMessage(data.gameServerId, { message: `${args.playerTarget} was arrested for ${args.reasoning}`, }); }; await main(); //# sourceMappingURL=visit.js.map -
ban
ban (name, use quotes if there's a space) (reason in quotes)
Argument Type Default Help reasoningstring No reason given Reason they are banned personstring Person being banned Command source
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers'; async function main() { const { player, gameServerId, pog, arguments: args } = data; const { person, reasoning } = args; const discordChannel = data.module.userConfig.discordChannel; if (!checkPermission(pog, 'STAFF_COMMANDS')) { throw new TakaroUserError('You do not have permission to use [02FEDC]Moderator[-] commmands.'); } const response = (await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, { command: `ban add "${person}" 1 year "${reasoning}" "${person}"`, })).data.data.rawResult; if (response.includes('is not a valid entity id, player name or user id')) { throw new TakaroUserError(`[02FEDC]${person}[-]'s name wasn't spelled correctly!`); } //Confirmation await player.pm(`[02FEDC]${person}[-] was banned.`); await takaro.discord.discordControllerSendMessage(discordChannel, { message: `🔨 ${player.name} banned ${person} for ${reasoning}.`, }); } await main(); -
unmute
unmute (players name, use quotes for names with spaces)
Argument Type Default Help personstring player to be unmuted Command source
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers'; async function main() { const { player, gameServerId, pog, arguments: args } = data; const { person, reasoning } = args; const discordChannel = data.module.userConfig.discordChannel; if (!checkPermission(pog, 'STAFF_COMMANDS')) { throw new TakaroUserError('You do not have permission to use [02FEDC]Moderator[-] commmands.'); } const response = (await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, { command: `mcp "${person}" false`, })).data.data.rawResult; if (response.includes('is not a valid entity id, player name or user id')) { throw new TakaroUserError(`[02FEDC]${person}[-]'s name wasn't spelled correctly!`); } //Confirmation await player.pm(`[02FEDC]${person}[-] was unmuted.`); await takaro.discord.discordControllerSendMessage(discordChannel, { message: `🤐 ${player.name} unmuted ${person}.`, }); } await main(); -
mute
Mute (players name, use quotes when there's aspace) (reason in quotes)
Argument Type Default Help reasoningstring No reason given Reason they were muted personstring Person to be muted Command source
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers'; async function main() { const { player, gameServerId, pog, arguments: args } = data; const { person, reasoning } = args; const discordChannel = data.module.userConfig.discordChannel; if (!checkPermission(pog, 'STAFF_COMMANDS')) { throw new TakaroUserError('You do not have permission to use [02FEDC]Moderator[-] commmands.'); } const response = (await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, { command: `mcp "${person}" true`, })).data.data.rawResult; if (response.includes('is not a valid entity id, player name or user id')) { throw new TakaroUserError(`[02FEDC]${person}[-]'s name wasn't spelled correctly!`); } //Confirmation await player.pm(`[02FEDC]${person}[-] was muted.`); await takaro.discord.discordControllerSendMessage(discordChannel, { message: `🤐 ${player.name} muted ${person} for ${reasoning}.`, }); } await main(); -
rdd
No help text available
Argument Type Default Help playerTargetstring Person drone data is being reset for Command source
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers'; async function main() { const { player, gameServerId, pog, arguments: args } = data; const playerTarget = args.playerTarget; if (!checkPermission(pog, 'STAFF_COMMANDS')) { throw new TakaroUserError('You do not have permission to use [02FEDC]Moderator[-] commmands.'); } const response = (await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, { command: `rdd "${playerTarget}"`, })).data.data.rawResult; if (response.includes('Targetplayer is offline')) { throw new TakaroUserError(`[02FEDC]${playerTarget}[-] is not online`); } } await main(); -
kick
type kick (name, in quotes is they have a space) (reason in quotes). Example kick "El Linón" "Too cool"
Argument Type Default Help reasoningstring Contact a moderator for a kick reason Reason for being kicked personstring Player getting kicked Command source
import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers'; async function main() { const { player, gameServerId, pog, arguments: args } = data; const { person, reasoning } = args; const discordChannel = data.module.userConfig.discordChannel; if (!checkPermission(pog, 'STAFF_COMMANDS')) { throw new TakaroUserError('You do not have permission to use [02FEDC]Moderator[-] commmands.'); } const response = (await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, { command: `kick "${person}" "${reasoning}"`, })).data.data.rawResult; if (response.includes('is not a valid entity id, player name or user id')) { throw new TakaroUserError(`[02FEDC]${person}[-]'s name wasn't spelled correctly!`); } //Confirmation await player.pm(`[02FEDC]${person}[-] was kicked.`); await takaro.discord.discordControllerSendMessage(discordChannel, { message: `🥾 ${player.name} kicked ${person} for ${reasoning}`, }); } await main();
Permissions 1
Roles you can grant to decide who may use what.
-
Staff Commands
Commands for staff to use without using Currency