Installation Guide

Follow these steps to install and configure the admin menu for your RedM server. This guide is written clearly and concisely to ensure easy setup.

Prerequisites

  • Node.js: Ensure Node.js is installed on your server machine. Download it from nodejs.org if needed.

  • Discord Bot: You need a Discord bot token and your Discord server ID (guild ID). All players must be in your Discord server, as the admin menu relies on Discord for user data.

Step-by-Step Installation

  1. Download and Install Dependencies

    • Download the redm-admin-panel-monitor repository from GitHub.

    • Navigate to the downloaded folder, open a terminal (or command prompt), and run:

      npm install

      This installs the necessary Node.js dependencies for the performance monitor.

  2. Edit Configuration

    • Open the config/main.lua file in the admin menu script folder.

    • Update the following settings:

      • Discord Bot Token: In Config.Discord.botToken, replace the default token (e.g., NzIyNDQ1NTQyMzE5MTk0MTQy.Gl2WHM...) with your Discord bot token. Create a bot in the Discord Developer Portal if you don’t have one.

      • Guild ID: In Config.Discord.guildId, enter your Discord server ID. Find this by enabling Developer Mode in Discord, right-clicking your server, and selecting "Copy Server ID."

      • Express API URL: In Config.ExpressApi, set the server IP:

        • Use http://localhost:3010/api if running on your local machine.

        • If running on a live server, replace localhost with your server’s IPv4 address (e.g., http://192.168.1.100:3010/api). To find your IPv4 address:

          • On Windows: Run ipconfig in Command Prompt and look for "IPv4 Address."

          • On Linux/macOS: Run ifconfig or ip addr in a terminal and locate your network’s IPv4 address.

      • Debug Mode: Set Config.DebugMode = false if running on a live server. Keep it true for testing or if restarting the script while the server is running.

  3. Configure Server

    • Open your RedM server’s server.cfg file.

    • Add the following lines to start the required scripts in this order:

      ensure RDR2CollectorsMap
      ensure redm-admin-panel-monitor
      ensure cas-admin-panel
    • Save the file.

  4. Set Up Admins

    • Open your database and locate the admin_data table.

    • Add admin entries with the following fields:

      • identifier: Player’s unique identifier (e.g., Steam ID or license).

      • username: Player’s in-game username.

      • discord_id: Player’s Discord ID (right-click user in Discord with Developer Mode enabled and select "Copy User ID").

      • group: Set to admin or another role as needed.

      • assigned_by (optional): Name or ID of the person who assigned the admin role.

    • Save the changes.

  5. Start the Server

    • Start your RedM server.

    • In-game, use the /adminpanel command to access the admin menu.

Important Notes

  • Discord Requirement: All players must be in your Discord server, as the admin menu fetches user data via Discord’s API. The menu will not work for players not in the server.

  • Debug Mode: Always set Config.DebugMode = false on a live server to avoid issues.

  • Testing: If testing locally, ensure Config.ExpressApi uses http://localhost:3010/api.

Once these steps are completed, the admin menu should work correctly. If you encounter issues, double-check your Discord bot token, guild ID, and server IP configuration.

Last updated