The Complete GTA 5 & FiveM Developer Guide Vehicle_Names.Lua

The Complete GTA 5 & FiveM Developer Guide Vehicle_Names.LuaThe Complete GTA 5 & FiveM Developer Guide Vehicle_Names.LuaThe Complete GTA 5 & FiveM Developer Guide Vehicle_Names.LuaThe Complete GTA 5 & FiveM Developer Guide Vehicle_Names.Lua

Why FiveM shows NULL instead of your vehicle name, and how vehicle_names.lua fixes it: AddTextEntry, GXT2 lookup order, modShopLabel and slot names.

Mastering vehicle_names.lua: FiveM Custom Vehicle Labels & GXT2 Runtime Architecture

You add a car, it spawns, it drives — and the notification in the corner says NULL. Or a raw spawn code. Or a hash.

Nothing is broken. The engine looked for a display string, did not find one, and printed the fallback. vehicle_names.lua is the client script that registers those strings at runtime, so the lookup succeeds.

This guide covers the full resolution pipeline from gameName to GXT2 to AddTextEntry, how to label tuning parts and mod slots as well as vehicles, and the three mistakes that cause labels to disappear after a restart.

1. The Core Architecture of Vehicle Naming in RAGE & FiveM

When adding custom add-on vehicles to Grand Theft Auto V and FiveM, developers often encounter unlocalized string identifiers such as NULL, raw spawn codes, or hash values displaying in the bottom-right vehicle entry notification, mechanic tuning menus, and garage user interfaces.

In the base game engine, all user interface strings are compiled into binary localized lookup tables (.gxt2 files). Because compiling custom GXT2 files for every individual add-on pack is inefficient and hard to maintain across multiple resources, FiveM exposes client-side runtime text registration natives. The file vehicle_names.lua serves as the client-side localization script that binds internal RAGE text labels and model hashes to human-readable strings at runtime.


2. How the String Resolution Pipeline Works

When a player enters a vehicle or selects an aftermarket modification in a mod shop, the RAGE UI engine processes the text identifier through a specific resolution hierarchy:


3. Implementing vehicle_names.lua: Code Structure

The runtime registration script executes entirely on the client side using the AddTextEntry native function (or hash-based variants) wrapped inside a thread execution container:

-- vehicle_names.lua (Client Script) Citizen.CreateThread(function() -- Main Vehicle Display Names (gameName in vehicles.meta) AddTextEntry('TT_PURSUIT_GT', 'TTModz Pursuit GT V8') AddTextEntry('TT_HYPER_SPEC', 'TTModz Hyperion Track Spec') AddTextEntry('TT_ENFORCER', 'LAPD Tactical Enforcer SUV') -- Custom ModKit Component Labels (modShopLabel in carcols.meta) AddTextEntry('TT_SPOILER_01', 'Carbon GT Wing Type 1') AddTextEntry('TT_SPOILER_02', 'Active Aero Track Spoiler') AddTextEntry('TT_BUMPER_F01', 'Aggressive Track Splitter w/ Canards') AddTextEntry('TT_EXHAUST_01', 'Titanium Dual Exit Cat-Back') AddTextEntry('TT_LIVERY_01', 'TTModz Performance Racing Livery') end)

Key Function Signatures


4. Metadata Dependency & Mapping Matrix

For labels to display accurately across all menus and UI overlays, the string parameters must align precisely across the XML metadata files:

Metadata File Source XML Tag Example Value vehicle_names.lua Binding vehicles.meta <gameName> TT_PURSUIT_GT AddTextEntry('TT_PURSUIT_GT', 'TTModz Pursuit GT') carcols.meta <modShopLabel> TT_SPOILER_01 AddTextEntry('TT_SPOILER_01', 'Carbon Race Spoiler') carcols.meta <slotName> WID_SLOT_SPOILER AddTextEntry('WID_SLOT_SPOILER', 'Custom Spoilers')

5. Resource Manifest Configuration (fxmanifest.lua)

Because vehicle_names.lua is a client-side execution script rather than a raw data file, it must be mounted under the client_script or client_scripts directive:

fx_version 'cerulean' game 'gta5' -- Metadata Data Providers files { 'carcols.meta', 'carvariations.meta', 'handling.meta', 'vehicles.meta' } data_file 'CARCOLS_FILE' 'carcols.meta' data_file 'VEHICLE_VARIATION_FILE' 'carvariations.meta' data_file 'HANDLING_FILE' 'handling.meta' data_file 'VEHICLE_METADATA_FILE' 'vehicles.meta' -- Client Execution Scripts client_script 'vehicle_names.lua'

6. Developer Troubleshooting & Common Pitfalls


SUPPORT & COMMUNITY CONTACT


Find more custom FiveM cars, peds, clothing packs, and maps at TTModz.

Add taxis and medical response with the FiveM city fleet pack, or browse all lore-friendly FiveM cars.


Discord DMCA.com Protection Status
DMCA.com Protection Status