CPMCommands

  • community
  • administration
  • by Mad
  • Takaro main
  • all
View export JSON

Provides a comprehensive collection of quality-of-life commands for 7 Days to Die servers utilizing CPM (CSMM Patrons Mod).

These commands enhance player convenience by simplifying common actions related to vehicles, teleportation, player status, and graphics settings.

Key Functionality

  • Vehicle Retrieval:

    • /bike: Teleports the player's min-bike to their location (if nearby).
    • /4x4: Teleports the player's 4x4 to their location (if nearby).
    • /gyro: Teleports the player's gyrocopter to their location (if nearby).
    • /motorcycle: Teleports the player's motorcycle to their location (if nearby).
    • /bicycle: Teleports the player's bicycle to their location (if nearby).
    • /drone: Teleports the player's drone to their location (if nearby).
  • Teleportation:

    • /home: Teleports the player to their set home location (bedroll).
    • /visit <playerTarget>: Allows a player to teleport to another player on the server, provided they are friends in-game and the target player is online.
  • Player Status:

    • /debuff: Removes common debuffs from the player (broken bones, sprains, etc.).
  • Graphics Settings:

    • /gfxon: Enables low graphics mode for improved performance.
    • /gfxoff: Disables low graphics mode, restoring normal graphics.
    • /gfx: Toggles gfx mode.
  • Account Linking

    • /link Shows the player how to link their account to the server.

How to Use

  1. Installation: Install the module on your Takaro instance.

  2. CPM Requirement: Ensure that the CSMM Patrons Mod (CPM) is installed and configured on your 7 Days to Die server. This module relies on CPM's functionality for vehicle retrieval.

  3. Permissions: Grant the appropriate permissions to the player groups or individuals who should have access to these commands:
    * inGameCommands: General permission for most of the module's commands.
    * HOME_PERMISSION: Permission to use the /home command.
    * VISIT_PERMISSION: Permission to use the /visit command.

  4. In-Game Usage: Players can use the commands as described in the "Key Functionality" section.

Important Considerations

  • CPM Dependency: This module is tightly integrated with CPM. It will not function correctly without CPM being present on the server.

  • Vehicle Proximity: The vehicle retrieval commands (/bike, /4x4, /gyro, etc.) typically require the player to be within a certain proximity of their vehicle for the command to work. The exact range is defined by CPM.

  • Home Location: The /home command requires players to have a valid bedroll set as their home location.

  • Friend System: The /visit command relies on 7 Days to Die's in-game friend system. Players must be friends with the target player to teleport to them.

  • Graphics Settings: The /gfxon and /gfxoff commands may not be effective in all game settings or configurations. Their functionality depends on how the game handles graphics settings.

  • Permission Management: Use the provided permissions to control access to the module's commands.

Configuration 0

Settings you fill in when installing the module on a server.

This module takes no configuration.

Raw config schema
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "additionalProperties": false,
  "properties": {}
}
Raw UI schema
{}

Commands 10

Chat commands players trigger in game.

  • 4x4

    Move your 4x4 to you if you're close enough to it.

    Command source
    import { takaro, data, TakaroUserError } from '@takaro/helpers';
    async function main() {
        const { pog } = data;
        const response = (await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, {
            command: `cpm-getjeep EOS_${pog.gameId}`,
        })).data.data.rawResult;
        if (response.includes('Could not be found')) {
            throw new TakaroUserError(`You're not close enough to your [FEF902]4x4.[-] Move closer and try again.`);
        }
    };
    await main();
    //# sourceMappingURL=visit.js.map
  • home

    No help text available

    Command source
    import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';
    async function main() {
        const { pog } = data;
        if (!checkPermission(pog, 'HOME_PERMISSION')) {
            throw new TakaroUserError('You do not have permission to use the home commmand.');
        }
        const response = (await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, {
            command: `teleh EOS_${pog.gameId}`,
        })).data.data.rawResult;
        if (response.includes('The player does not have a defined HOME bed')) {
            throw new TakaroUserError(`You need to place a [FEF902]Bedroll[-] to teleport home.`);
        }
    };
    await main();
    //# sourceMappingURL=visit.js.map
  • gfxon

    No help text available

    Command source
    import { takaro, data } from '@takaro/helpers';
    
    async function main() {
        const { player, gameServerId, pog } = data;
    
        // For 7D2D, we need to use the epicOnlineServicesId as the entity ID
        const entityId = player.epicOnlineServicesId || pog.gameId;
    
        try {
            // Execute the command with proper spacing and the correct ID
            await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, {
                command: `eoc ${entityId} "gfx pp enable 0"`
            });
    
            // Send confirmation to the player
            await player.pm(`[02FEDC]Low GFX mode activated.`);
        } catch (error) {
            // Only log if there's an actual error
            await player.pm(`Failed to activate low GFX mode. Please try again or contact an admin.`);
            throw error;
        }
    }
    
    await main();
  • bicycle

    No help text available

    Command source
    import { takaro, data, TakaroUserError } from '@takaro/helpers';
    async function main() {
        const { pog } = data;
        const response = (await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, {
            command: `cpm-getbicycle EOS_${pog.gameId}`,
        })).data.data.rawResult;
        if (response.includes('Bicycle Could not be found')) {
            throw new TakaroUserError(`You're not close enough to your [FEF902]Bicycle[-]. Move closer and try again.`);
        }
    };
    await main();
    //# sourceMappingURL=visit.js.map
  • visit

    No help text available

    ArgumentTypeDefaultHelp
    playerTarget string Person Teleporting to
    Command source
    import { takaro, data, checkPermission, TakaroUserError } from '@takaro/helpers';
    async function main() {
      const { player, gameServerId, pog } = data;
      const playerTarget = data.arguments.playerTarget;
      if (!checkPermission(pog, 'VISIT_PERMISSION')) {
        throw new TakaroUserError('You do not have permission to use the visit commmand.');
      }
      const response = (await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, {
        command: `mv "${player.name}" ${playerTarget} fo`,
      })).data.data.rawResult;
      if (response.includes('Targetplayer is offline')) {
        throw new TakaroUserError(`[02FEDC]${playerTarget}[-] is not online`);
      }
      if (response.includes('no in-game friend')) {
        throw new TakaroUserError(`Add [02FEDC]${playerTarget}[-] as a friend to visit them.`);
      }
    };
    await main()
    //# sourceMappingURL=visit.js.map
  • debuff

    No help text available

    Command source
    import { takaro, data } from '@takaro/helpers';
    
    async function main() {
        const { pog, player, gameServerId } = data;
    
        // Get the current player's entity ID, handling Epic Online Services ID
        const entityId = player.epicOnlineServicesId || pog.gameId;
    
        // Define the debuffs to apply
        const debuffs = [
            'buffNearDeathTrauma',
            'bufflegbroken',
            'buffarmbroken',
            'buffarmsprained',
            'bufflegsprained'
        ];
    
        // Execute each debuff command separately
        for (const debuff of debuffs) {
            const command = `debuffplayer ${entityId} ${debuff}`;
    
            try {
                const result = await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, {
                    command: command
                });
            } catch (error) {
                // Removed console.log here
            }
        }
    
        // Notify the player
        await data.player.pm("All debuffs have been removed for you");
    }
    
    await main();
  • drone

    No help text available

    Command source
    import { takaro, data, TakaroUserError } from '@takaro/helpers';
    async function main() {
        const { pog } = data;
        const response = (await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, {
            command: `cpm-getdrone EOS_${pog.gameId}`,
        })).data.data.rawResult;
        if (response.includes('Drone Could not be found')) {
            throw new TakaroUserError(`You're not close enough to your [FEF902]Drone[-]. They take 10 min to load after a restart. You may need to retrace your steps to find it. Drone locations are saved 5 minutes apart.`);
        }
    };
    await main();
    //# sourceMappingURL=visit.js.map
  • gyro

    No help text available

    Command source
    import { takaro, data, TakaroUserError } from '@takaro/helpers';
    async function main() {
        const { pog } = data;
        const response = (await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, {
            command: `cpm-getgyrocopter EOS_${pog.gameId}`,
        })).data.data.rawResult;
        if (response.includes('Gyrocopter Could not be found')) {
            throw new TakaroUserError(`You're not close enough to your [FEF902]Gyrocopter[-]. Move closer and try again.`);
        }
    };
    await main();
    //# sourceMappingURL=visit.js.map
  • minibike

    No help text available

    Command source
    import { takaro, data, TakaroUserError } from '@takaro/helpers';
    async function main() {
        const { gameServerId, player } = data;
        const response = (await takaro.gameserver.gameServerControllerExecuteCommand(data.gameServerId, {
            command: `cpm-getbike ${player.name}`,
        })).data.data.rawResult;
        if (response.includes('MiniBike Could not be found')) {
            throw new TakaroUserError(`You're not close enough to your [FEF902]Mini Bike[-]. Move closer and try again.`);
        }
    };
    await main();
    //# sourceMappingURL=visit.js.map
  • gfxoff

    No help text available

    Command source
    import { takaro, data } from '@takaro/helpers';
    
    async function main() {
        const { player, gameServerId, pog } = data;
    
        // For 7D2D, we need to use the epicOnlineServicesId as the entity ID
        const entityId = player.epicOnlineServicesId || pog.gameId;
    
        try {
            // Execute the command with proper spacing and the correct ID
            await takaro.gameserver.gameServerControllerExecuteCommand(gameServerId, {
                command: `eoc ${entityId} "gfx pp enable 1"`,
            });
    
            // Send confirmation to the player
            await player.pm(`[02FEDC]Low GFX mode disabled.`);
        } catch (error) {
            // Only log if there's an actual error
            console.error(`Error executing GFX command: ${error.message}`);
            await player.pm(`Failed to disable low GFX mode. Please try again or contact an admin.`);
            throw error; // Re-throw the error to stop execution
        }
    }
    
    await main();

Permissions 3

Roles you can grant to decide who may use what.

  • In Game Commands

    Commands in game

  • Home command Permission

    Gives players access to the home command

  • Visit Command Permission

    Gives players permission to use the visit commmand