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
Download and Install Dependencies
Download the
redm-admin-panel-monitorrepository from GitHub.Navigate to the downloaded folder, open a terminal (or command prompt), and run:
npm installThis installs the necessary Node.js dependencies for the performance monitor.
Edit Configuration
Open the
config/main.luafile 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/apiif running on your local machine.If running on a live server, replace
localhostwith your server’s IPv4 address (e.g.,http://192.168.1.100:3010/api). To find your IPv4 address:On Windows: Run
ipconfigin Command Prompt and look for "IPv4 Address."On Linux/macOS: Run
ifconfigorip addrin a terminal and locate your network’s IPv4 address.
Debug Mode: Set
Config.DebugMode = falseif running on a live server. Keep ittruefor testing or if restarting the script while the server is running.
Configure Server
Open your RedM server’s
server.cfgfile.Add the following lines to start the required scripts in this order:
ensure RDR2CollectorsMap ensure redm-admin-panel-monitor ensure cas-admin-panelSave the file.
Set Up Admins
Open your database and locate the
admin_datatable.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 toadminor another role as needed.assigned_by(optional): Name or ID of the person who assigned the admin role.
Save the changes.
Start the Server
Start your RedM server.
In-game, use the
/adminpanelcommand 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 = falseon a live server to avoid issues.Testing: If testing locally, ensure
Config.ExpressApiuseshttp://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