fxmanifest data_file reference for vehicles
A data_file line in fxmanifest.lua tells FiveM to load a file from the resource into the game as a specific type of game data. Vehicles use HANDLING_FILE for handling.meta, VEHICLE_METADATA_FILE for vehicles.meta, CARCOLS_FILE for carcols.meta, VEHICLE_VARIATION_FILE for carvariations.meta and VEHICLE_LAYOUTS_FILE for vehiclelayouts.meta. Every file must also be listed in files.
What does data_file do?
The FiveM documentation describes data_file as adding "a data file of a specified type to the game extra content system". In practice it is the same mechanism the game uses for its own DLC packs: each type is handled by a loader that knows how to read that kind of file.
The line has two strings: the type and the path inside the resource.
fx_version 'cerulean'
game 'gta5'
files {
'data/handling.meta',
'data/vehicles.meta',
'data/carcols.meta',
'data/carvariations.meta',
}
data_file 'HANDLING_FILE' 'data/handling.meta'
data_file 'VEHICLE_METADATA_FILE' 'data/vehicles.meta'
data_file 'CARCOLS_FILE' 'data/carcols.meta'
data_file 'VEHICLE_VARIATION_FILE' 'data/carvariations.meta'
The file also has to appear in files. files makes the server send the file to players, and data_file makes the game read it. One without the other does nothing.
Which data_file type goes with which vehicle file?
These are the types that matter for vehicles, taken from the FiveM data files reference.
| data_file type | File | Root element | Purpose |
|---|---|---|---|
HANDLING_FILE | handling.meta | CHandlingDataMgr | Physics profiles. Guide |
VEHICLE_METADATA_FILE | vehicles.meta | CVehicleModelInfo__InitDataList | Registers vehicle models. Guide |
CARCOLS_FILE | carcols.meta | CVehicleModelInfoVarGlobal | Mod kits, sirens, lights. Guide |
VEHICLE_VARIATION_FILE | carvariations.meta | CVehicleModelInfoVariation | Colors, kits and light settings per model. |
VEHICLE_LAYOUTS_FILE | vehiclelayouts.meta | CVehicleMetadataMgr | Seats, entry points, animations. Guide |
CLIP_SETS_FILE | clip_sets.xml | fwClipSetManager | Clip sets for custom animations. |
EXPLOSION_INFO_FILE | explosion.meta | CExplosionInfoManager | Custom explosion setups. |
VFXVEHICLEINFO_FILE | vfxvehicleinfo.meta | Vehicle visual effects sets. | |
PTFXASSETINFO_FILE | ptfxassetinfo.meta | Particle effect asset info. | |
AUDIO_GAMEDATA, AUDIO_SOUNDDATA, AUDIO_WAVEPACK | .dat151.rel, .dat54.rel, folder of .awc files | Custom engine sounds. | |
VEHICLE_SHOP_DLC_FILE | shop_vehicle.meta | Vehicle shop data of DLC packs. | |
CONTENT_UNLOCKING_META_FILE | Listed in the reference with no description. Not needed for an add-on vehicle. |
The type must be spelled exactly and in capitals.
Does the order of data_file lines matter?
Partly. FiveM always loads HANDLING_FILE and VEHICLE_LAYOUTS_FILE entries before every other type, whatever order you wrote them in. All other types keep the order of the manifest. This comes from the FiveM client code, which sorts the list that way before loading.
The reason is on the game side: when vehicles.meta is read, the game looks up the vehicle's handling entry and its layout by name right then. If they are not loaded yet, the vehicle is registered without them.
For the remaining types, write them in dependency order, with the thing being referenced first:
fx_version 'cerulean'
game 'gta5'
files {
'data/handling.meta',
'data/vehiclelayouts.meta',
'data/clip_sets.xml',
'data/vehicles.meta',
'data/carcols.meta',
'data/carvariations.meta',
}
-- 1. things vehicles.meta points at
data_file 'HANDLING_FILE' 'data/handling.meta'
data_file 'CLIP_SETS_FILE' 'data/clip_sets.xml'
data_file 'VEHICLE_LAYOUTS_FILE' 'data/vehiclelayouts.meta'
-- 2. the vehicle itself
data_file 'VEHICLE_METADATA_FILE' 'data/vehicles.meta'
-- 3. kits, then the variations that reference them
data_file 'CARCOLS_FILE' 'data/carcols.meta'
data_file 'VEHICLE_VARIATION_FILE' 'data/carvariations.meta'
CLIP_SETS_FILEnear the top, since layouts refer to clip sets by name.VEHICLE_METADATA_FILEnext.CARCOLS_FILEbeforeVEHICLE_VARIATION_FILE, because carvariations.meta refers to kits that carcols.meta defines.
Can I load many vehicles with one line?
Yes. Both files and data_file accept glob patterns in the path. * matches within one folder and ** matches any depth. A vehicle pack with one subfolder per vehicle can be declared once:
files {
'data/**/handling.meta',
'data/**/vehicles.meta',
'data/**/carcols.meta',
'data/**/carvariations.meta',
}
data_file 'HANDLING_FILE' 'data/**/handling.meta'
data_file 'VEHICLE_METADATA_FILE' 'data/**/vehicles.meta'
data_file 'CARCOLS_FILE' 'data/**/carcols.meta'
data_file 'VEHICLE_VARIATION_FILE' 'data/**/carvariations.meta'
New vehicles dropped into data/ are then picked up without editing the manifest.
Why are .yft and .ytd files not in the manifest?
Files in a folder named stream are registered automatically by file name and extension, so models, textures and animation dictionaries need no manifest entry. Subfolders inside stream are fine. Two things FiveM refuses there: files without an extension, and .rpf archives, which have to be extracted first.
Unpacking a single-player dlc.rpf and sorting its files into a resource is in converting a single-player car mod to a FiveM add-on.
Can metas be edited in an escrowed resource?
Paid resources delivered through Cfx.re Asset Escrow have their scripts and model files protected, and the manifest entry escrow_ignore lists files that the escrow system leaves untouched. Which files stay open is the author's choice, so check the product page. The metas a server owner most often wants to edit are:
- handling.meta, to change speed, grip and braking.
- carvariations.meta, to change the color combinations.
- vehicles.meta, to change flags, class or the display name key.
On Nilo3D vehicles such as the Coil S-Cooter the handling and vehicle metas stay open. How escrowed resources are installed is in installing a FiveM resource from Cfx.re Escrow.
If an escrowed resource refuses to start with "You lack the required entitlement", see how to fix the entitlement error.
What are the common manifest mistakes?
| Mistake | Result | Fix |
|---|---|---|
Meta in data_file but not in files | The file never reaches the player. | Add the same path to files. |
| Wrong path or folder name | Nothing is loaded. | Paths are relative to the resource folder and use forward slashes. |
| Wrong type for the file | The file is handed to the wrong loader and its data is not applied. | Use the type from the table above. |
Metas placed in stream/ | They are not loaded as data files. | Keep metas outside stream and declare them. |
Missing fx_version or game | The resource does not load correctly. | Start the manifest with fx_version 'cerulean' and game 'gta5'. |
The whole process, from folders to spawning, is in how to add an add-on vehicle to FiveM.
Frequently asked questions
- What is the data_file for handling.meta?
- data_file 'HANDLING_FILE' followed by the path to handling.meta, with the same path listed under files.
- What is the data_file for carcols.meta and carvariations.meta?
- carcols.meta uses CARCOLS_FILE and carvariations.meta uses VEHICLE_VARIATION_FILE.
- Do I have to list meta files in files as well as data_file?
- Yes. files makes the server send the file to players and data_file makes the game load it. A meta that is missing from files is never downloaded.
- Does data_file support wildcards?
- Yes. The FiveM manifest reference states that data_file supports globbing in the file name, for example data/**/handling.meta.
- In what order does FiveM load vehicle data files?
- HANDLING_FILE and VEHICLE_LAYOUTS_FILE entries are loaded first. Every other type is loaded in the order it appears in the manifest.
Sources
- FiveM docs: Resource manifest
- FiveM docs: Data files
- FiveM client source: data file load order (LoadStreamingFile.cpp)
Products from this guide
All guides
- How to install a FiveM resource from Cfx.re Escrow (Granted Assets)
- How to add a custom vehicle to an ESX, QBCore or QBox server
- What are LODs in FiveM vehicles?
- How to add an add-on vehicle to a FiveM server
- vehicles.meta explained, field by field
- handling.meta explained: fields, units and flags
- carvariations.meta and carcols.meta explained
- vehiclelayouts.meta explained: seats, entry points and animations
- Vehicle model files (yft, _hi.yft, ytd) and the oversized asset warning
- FiveM add-on vehicle troubleshooting: causes and fixes
- How to fix "You lack the required entitlement" on a FiveM server
- How to convert a single-player GTA 5 car mod to a FiveM add-on
- How a FiveM hoverboard works without a script
- How to make a FiveM vehicle in Blender with Sollumz 2.9
- How to optimise a FiveM vehicle: polygons, LODs and texture budget
- How to set up vehicle collision in Sollumz
- Buying FiveM vehicles: what to check before you pay
- FiveM car packs vs single vehicles
- Real-brand cars on FiveM: allowed or not?
- CodeWalker vs Sollumz: which tool for FiveM vehicles?
