User ID | Whitelist
Installation

Installation

Make sure you have a MySQL/MariaDB database set up and oxmysql properly configured before proceeding.

1

Install resource dependencies

2

Download the resource

Download the latest release and place it in your server's resources folder, or purchase from your store.

3

Database setup

Import the SQL file included in the resource to create the whitelist table:

CREATE TABLE IF NOT EXISTS `user_whitelist` (
  `user_id` INT NOT NULL AUTO_INCREMENT,
  `steam` VARCHAR(255) NOT NULL,
  `discord` VARCHAR(255) DEFAULT NULL,
  `whitelisted` TINYINT(1) DEFAULT 0,
  `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `steam` (`steam`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

Import this using your preferred MySQL client (phpMyAdmin, HeidiSQL, etc.).

4

Resource start order

It's important for your resources to start in a logical order to prevent errors from missing dependencies.

ensure oxmysql
ensure cu_user_id
5

Configuration

Resource configuration is handled in config.lua.

Config = {}
 
-- Discord server link for whitelist requests
Config.DiscordLink = "https://discord.gg/yE8qBjGjD9"
 
-- Localization
Config.Locale = "en" -- Available: en, ru, de, fr, es
 
-- Message when player is not whitelisted
Config.NotWhitelisted = "⚪ You are not in the whitelist. ⚠️ Your user_id = %s. Send it to Discord."
 
-- Command to add user to whitelist (admin only)
Config.WhitelistCommand = "addwl"

Verification

To test the installation:

  1. Connect to your server without being whitelisted
  2. You should receive a message with your generated user_id
  3. Use /addwl [user_id] as an admin to whitelist a player
  4. The player can now connect normally
⚠️

This script fully complies with FiveM Releases rules. For support, join our Discord server (opens in a new tab).