Missing GTX Label
#Intro
You can ignore these warnings. Our resources still work, we are just creating a warning that the labels may look botched in the menus because they are missing, and we are forced to use a fallback.
#Vehicle Labels
Every vehicle has a display name (e.g. SULTAN2) and a GXT label (e.g. Sultán RS). We use the GXT label to show a clean, human-readable name throughout our resources.
#Why this warning appears
[WARNING] Invalid label for model 1234567890 using display name "MYADDON", using fallback "Myaddon"
Your addon vehicle has a display name in its vehicles.meta, but no GXT label has been registered for it. We fall back to title-casing the raw display name, which usually doesn't look great.
#How to fix it
Register a GXT label using AddTextEntry in a client-side script in your addon vehicle resource. The first argument must match the <gameName> from your vehicles.meta:
luaAddTextEntry("MYADDON", "My Addon Car")
Once registered, the label will be picked up automatically and the warning will disappear.
If you install vehicles, check whether it ships with a labels.lua or textentries.lua file. Many well-made packs already include these GTX labels.
#Creating a label file
If your addon vehicle doesn't already have labels set up, you can create one yourself. Here's a typical addon vehicle resource structure:
my_addon_car/ ├── fxmanifest.lua ├── data/ │ └── vehicles.meta ├── stream/ │ └── my_addon_car.yft └── labels.lua <-- Add this file
#1. Create labels.lua
Create a new file called labels.lua in the root of your vehicle resource. Add an AddTextEntry call for each vehicle, where the first argument matches the <gameName> in your vehicles.meta:
lua-- labels.lua
AddTextEntry("MYADDON", "My Addon Car")
AddTextEntry("MYADDON2", "My Addon Car MK2")
#2. Register it in fxmanifest.lua
Make sure the file is included as a client script:
lua-- fxmanifest.lua
fx_version 'cerulean'
game 'gta5'
client_script 'labels.lua'
files {
'data/vehicles.meta',
}
data_file 'VEHICLE_METADATA_FILE' 'data/vehicles.meta'
#3. Find the display name
If you're not sure what display name to use, check the <gameName> field in your vehicles.meta:
xml<Item> <modelName>myaddon</modelName> <gameName>MYADDON</gameName> <!-- Use this value --> </Item>
The <gameName> value is what you pass as the first argument to AddTextEntry.
