pen-fieldAndrew's Username Sync

Overview

Andrew’s Username Sync is a FiveM server-side script designed to ensure that player identities are consistent across Discord and the server. By validating a player’s in-game name against their Discord nickname, the script enhances role-play immersion, improves moderation accuracy, and increases accountability.

The script provides the following core features:

1. Discord–In-Game Name Enforcement

Players attempting to join the server will be blocked if their in-game name does not exactly match their Discord nickname.

2. Customizable Kick Message

A dynamic kick message informs players why they were removed and how to fix their name. The message supports two %s placeholders:

  • %s → the player’s current in-game name

  • %s → the player’s Discord nickname

3. ACE Permission Exemptions

Server administrators can create ACE permissions that exempt specific users or groups from the name-matching requirement. This is useful for staff, bots, special characters, or legacy player names.

Configuration File Documentation

Below is your script’s configuration file rewritten with full documentation, including explanations of each setting.

How the Script Works

1. Player Connection Attempt

When a player attempts to connect:

  1. The script retrieves:

    • Their in-game name

    • Their Discord identifier (via Discord ACE integration)

  2. The script fetches the user’s Discord nickname from the specified guild using the bot token.

  3. It compares:

2. Name Mismatch Handling

If the names do not match and the player does not have an ACE exemption:

  • The player is immediately kicked

  • The kick message is generated using:

3. ACE Permissions

Your script supports creating ACE rules like:

Administrators can use these permissions to:

  • Allow staff to retain custom names

  • Exempt bots or special users

  • Bypass strict formatting rules

Any player with the sync.bypass permission will not be checked.

Last updated