> For the complete documentation index, see [llms.txt](https://shift-studios.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://shift-studios.gitbook.io/docs/new/editor-16.md). Agents can also search and read this documentation through its [MCP server](https://shift-studios.gitbook.io/docs/~gitbook/mcp).

# Nametags

Transform Your Server With Shift Studios — Powerful, Optimized, And Reliable Resources Built To Improve Every Experience.

<figure><img src="https://4062160621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fgqh3gjuJzDAWNXTD9sEE%2Fuploads%2FgpBsqHKsCjPK7PuHVfU0%2Ff5727670-46bc-4acd-870b-21bde03e823a.png?alt=media&amp;token=161c63cf-41fa-4f9d-ab97-a4b79daf52eb" alt=""><figcaption></figcaption></figure>

### Installation

{% stepper %}
{% step %}

### Nametags

Read Everything Below To Install
{% endstep %}

{% step %}

### Drag & Drop

Drag & Drop The Resource Into Your FiveM Server
{% endstep %}

{% step %}

### Ensure The Resource

Make Sure To Ensure shift-nametags In Your Server CFG.
{% endstep %}

{% step %}

### Install The SQL Table

{% code expandable="true" %}

```sql
-- Optional MySQL persistence; tables are also created automatically when oxmysql is active.
CREATE TABLE IF NOT EXISTS `shift_nametags_profiles` (
  `player_key` varchar(160) NOT NULL,
  `nickname` varchar(64) DEFAULT NULL,
  `affiliate_color` char(7) NOT NULL DEFAULT '#DB2424',
  `own_tag` tinyint(1) NOT NULL DEFAULT 1,
  `theme` varchar(8) NOT NULL DEFAULT 'dark',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`player_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS `shift_nametags_relations` (
  `owner_key` varchar(160) NOT NULL,
  `target_key` varchar(160) NOT NULL,
  `relation_type` varchar(12) NOT NULL,
  `target_label` varchar(96) NOT NULL DEFAULT 'Player',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`owner_key`, `target_key`, `relation_type`),
  KEY `idx_target` (`target_key`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

```

{% endcode %}
{% endstep %}

{% step %}

### Configure Resource

Make Sure To Configure The Resource To Your Liking

You Can Configure Your Discord Logs In server/config.discord.lua

{% code expandable="true" %}

```lua
-- ⚫ ███████╗██╗  ██╗██╗███████╗████████╗    ███████╗████████╗██╗   ██╗██████╗ ██╗ ██████╗ ███████╗ ⚫
-- ⬛ ██╔════╝██║  ██║██║██╔════╝╚══██╔══╝    ██╔════╝╚══██╔══╝██║   ██║██╔══██╗██║██╔═══██╗██╔════╝ ⬛
-- ⚫ ███████╗███████║██║█████╗     ██║       ███████╗   ██║   ██║   ██║██║  ██║██║██║   ██║███████╗ ⚫
-- ⬛ ╚════██║██╔══██║██║██╔══╝     ██║       ╚════██║   ██║   ██║   ██║██║  ██║██║██║   ██║╚════██║ ⬛
-- ⚫ ███████║██║  ██║██║██║        ██║       ███████║   ██║   ╚██████╔╝██████╔╝██║╚██████╔╝███████║ ⚫
-- ⬛ ╚══════╝╚═╝  ╚═╝╚═╝╚═╝        ╚═╝       ╚══════╝   ╚═╝    ╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚══════╝ ⬛

Config = {}

-- Detects ESX / QBCore / Qbox; set a specific framework to override detection.
Config.Framework = 'auto' -- 'auto' | 'esx' | 'qbcore' | 'qbox' | 'standalone'

-- 'auto': oxmysql if started, otherwise JSON. SQL is recommended on large servers.
Config.Storage = 'auto' -- 'auto' | 'mysql' | 'json'
Config.Command = 'nametags'
Config.ToggleCommand = 'tognames' -- local overhead Name Tags toggle (no permissions)
Config.Keybind = 'F7' -- set to false to disable the optional FiveM key binding
Config.Theme = 'dark' -- 'dark' or 'light'

-- Character names take priority (ESX/QBCore/Qbox). Standalone servers use the
-- connected FiveM in-game name only when explicitly configured as 'fivem'.
-- When character data is missing, display an unavailable status rather than the wrong FiveM name.
-- For custom character resources, edit server/identity_bridge.lua or use the
-- trusted server export SetCharacterMetadata on character-loaded events.
-- Players can run /tagnamecheck to diagnose their active name provider.
Config.NameSource = 'character' -- 'character' = RP character identity; 'fivem' = FiveM player-list name

-- ESX compatibility: fallback to indexed users DB lookups when the ESX
-- resource exports no working server player API. Handles both char1:hash
-- and char1:license:hash formats. For multiple characters the current
-- character identifier is requested from the ESX client and verified on the
-- server against the player's connected license + DB record. Client hints
-- are not authoritative proof of the ACTIVE slot; strict servers should
-- integrate a trusted server-side character export in identity_bridge.lua.
Config.ESX = {
    AllowExactLicenseLookup = true,
    CharacterPrefix = 'char',  -- adjust if your multicharacter uses a different slot prefix
    MaxCharacterSlots = 16     -- indexed SQL candidates for slots 0 through 16
}

-- Visibility is entirely controlled here, never exposed as a player setting.
Config.Visibility = {
    Enabled = true,
    DefaultVisibleForPlayer = true, -- initial /tognames state, saved locally after first toggle
    Distance = 22.0,              -- max distance to render name tags (meters)
    FadeStart = 16.0,             -- start fading out this far away (meters)
    RefreshMs = 250,              -- nearby-player visibility/LOS checks
    PositionUpdateMs = 16,        -- approx. 60 FPS screen projection into Pretendard NUI; higher = lower load
    MaxTags = 24,                 -- nearest players only; limits screen-coordinate traffic
    RequireLineOfSight = true,
    RequireOnScreen = true,
    HideDuringPause = true,
    HideInVehicles = false,
    ShowLocalTag = true,
    AnchorMode = 'stable-head',   -- stable WORLD-space anchor projected to screen
    HeadOffset = 0.32,           -- stable WORLD-space vertical gap above head in meters
    ShowServerId = true,
    MarkedColor = '#E6E7EB'
}

-- Only currently nearby players may be added. Server validates distance & routing bucket.
Config.InteractionDistance = 22.0
Config.MaxRelationsPerType = 75
Config.RequestCooldownMs = 350

Config.Display = {
    ShowAge = true,
    AgeAsRange = true,
    AgeRangeOffset = 2, -- Example: a 31-year-old displays as 29–33
    ShowHeight = true,
    HeightUnits = 'imperial', -- 'imperial' or 'metric'
    DefaultHeightCm = nil -- nil = omit height when framework/provider has no value
}

Config.Nickname = {
    Enabled = true,
    MinLength = 2,
    MaxLength = 20,
    AllowSpaces = true,
    -- A nickname can only be set once per character unless staff reset it.
    LockAfterFirstSet = true
}

Config.Administration = {
    ResetCommand = 'resetnametag',
    AcePermission = 'shift-nametags.admin',
    -- Optional ESX groups allowed to reset nicknames. ACE also works on every framework.
    ESXGroups = { admin = true, superadmin = true },
    -- Optional QBCore permission names. ACE is recommended for Qbox/Standalone.
    QBPermissions = { 'admin', 'god' }
}

-- External notifications only (no custom Name Tags popups/status text).
-- ox_lib is the default and uses center-left. 'auto' prefers ox_lib, then an
-- available framework/notify resource. Other options: 'qbox', 'qbcore', 'esx',
-- 'okok', 'mythic', 'wasabi', 'brutal', 'codem', 'chat', 'none'.
-- If your selected provider is not running, the resource tries other installed
-- providers rather than silently losing the notification.
Config.Notifications = 'ox_lib'
Config.NotificationOptions = {
    Title = 'Name Tags',
    Position = 'center-left', -- ox_lib and Qbox position
    Duration = 4000,
    PlaySound = false
}

-- Optional custom server-side metadata hook:
-- exports['shift-nametags']:SetCharacterMetadata(source, { first = '...', last = '...', birthdate = '2001-01-01', heightCm = 175 })
-- The hook is not persisted by this resource; invoke it when your character system loads.

-- Standalone characters are keyed by license. For multiple characters, implement a
-- framework identity provider in server/main.lua so persistence is per character.
Config.Debug = false

```

{% endcode %}
{% endstep %}

{% step %}

### Restart / Start Your Server

Ensure Everything Is Working Well & Enjoy !!
{% endstep %}
{% endstepper %}
