How to convert a single-player GTA 5 car mod to a FiveM add-on

By Nilo3D · Updated:

To convert a single-player GTA 5 car mod to FiveM, extract the dlc.rpf archive, put the .yft and .ytd files in a stream folder and the .meta files in a data folder, and write an fxmanifest.lua with one data_file line per meta. If the mod replaces a stock car, rename its files to a new model name and add a vehicles.meta entry so it becomes an add-on.

What are the steps, in short?

  1. Open the mod's dlc.rpf in an archive tool and extract everything.
  2. Create a resource folder with stream and data subfolders.
  3. Move the model and texture files (.yft, .ytd) to stream.
  4. Move the .meta files to data.
  5. Write fxmanifest.lua: each meta under files and in a data_file line.
  6. If it is a replace mod, rename the files and write a vehicles.meta entry for the new name.
  7. Add ensure to server.cfg, restart, spawn the car and read the server console.

What is inside a single-player car mod?

An add-on car for single player comes as a dlc.rpf archive that the player adds to the game's dlcpacks folder. Inside it are the same files a FiveM resource needs, wrapped in the single-player DLC structure:

dlc.rpf
  content.xml                     list of every file and its type
  setup2.xml                      name and load order of the pack
  data/                           (or common/data/)
    handling.meta
    vehicles.meta
    carcols.meta
    carvariations.meta
  x64/vehicles.rpf                (or x64/levels/gta5/vehicles/...rpf)
    mycar.yft
    mycar_hi.yft
    mycar.ytd

Folder names vary between authors. The file that tells you what is what is content.xml: it lists every data file with a fileType, and those type names are the same ones FiveM uses in data_file lines.

<Item>
  <filename>dlc_mycar:/data/vehicles.meta</filename>
  <fileType>VEHICLE_METADATA_FILE</fileType>
</Item>
<Item>
  <filename>dlc_mycar:/data/carvariations.meta</filename>
  <fileType>VEHICLE_VARIATION_FILE</fileType>
</Item>
<Item>
  <filename>dlc_mycar:/%PLATFORM%/vehicles.rpf</filename>
  <fileType>RPF_FILE</fileType>
</Item>
In the dlc.rpfIn the FiveM resource
.yft, .ytd inside vehicles.rpfstream/
Tuning part models, in their own archive when the car has themstream/
.meta filesdata/, each with a data_file line of the type given in content.xml
content.xml, setup2.xmlNot used. fxmanifest.lua does their job.
Text labels (.gxt2)Not used. Add the name with a script line, see below.

How do I extract the dlc.rpf?

FiveM does not load .rpf archives from a resource, so the files have to come out. Any archive tool for GTA V works. In CodeWalker, start the RPF Explorer, use File > Open Folder... on the folder that holds the dlc.rpf, open the archive and the archives inside it, select the files and extract them with Extract Raw... or Extract All.... OpenIV does the same job.

Archives are nested: dlc.rpf contains vehicles.rpf, which contains the models. Keep going until you reach loose .yft, .ytd and .meta files. The two tools are compared in CodeWalker vs Sollumz.

How do I build the FiveM resource?

Arrange the extracted files like any vehicle resource:

resources/
  mycar/
    fxmanifest.lua
    data/
      handling.meta
      vehicles.meta
      carcols.meta
      carvariations.meta
    stream/
      mycar.yft
      mycar_hi.yft
      mycar.ytd

Then write the manifest. Every meta is listed twice: once under files so the server sends it to players, and once in a data_file line so the game loads it as the right type.

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'
fileType in content.xmlFile
HANDLING_FILEhandling.meta
VEHICLE_METADATA_FILEvehicles.meta
CARCOLS_FILEcarcols.meta
VEHICLE_VARIATION_FILEcarvariations.meta
VEHICLE_LAYOUTS_FILEvehiclelayouts.meta

The full list of types and the order they load in is in fxmanifest.lua and data_file for vehicles. Starting and spawning the resource is in how to add an add-on vehicle to a FiveM server.

How do I turn a replace mod into an add-on?

A replace mod has no metas and no new name. Its files are named after a stock car, for example sultan.yft, and the game draws them instead of the original. Streamed from a FiveM resource they work the same way: every Sultan on the server changes. To keep the stock car and add yours next to it, give the model its own name.

  1. Rename the files. The file names are the model name.
    sultan.yft      ->  mycar.yft
    sultan_hi.yft   ->  mycar_hi.yft
    sultan.ytd      ->  mycar.ytd
    The textures inside the .ytd keep their names. The dictionary is found by its file name, not by what is inside.
  2. Write a vehicles.meta entry. Copy the entry of the replaced car from the game's own vehicles.meta and change modelName and txdName to the new name, plus gameName for the display name. Leave handlingId, layout and audioNameHash as they are and the car drives, seats and sounds like the original. Every field is explained in vehicles.meta explained.
  3. Add a carvariations.meta entry with the new modelName if you want your own colour combinations. See carvariations and carcols.
  4. Give it its own handling only if you want to tune it. Then copy the handling entry too, with a new handlingName, and point handlingId at it.

The display name comes from a text label. In FiveM one client script line adds it:

-- client script: readable name for <gameName>MYCAR</gameName>
AddTextEntry('MYCAR', 'My Car GT')

What usually goes wrong after converting?

SymptomCauseWhere to look
Console warns about oversized assetsSingle-player mods often ship 4096 textures and one heavy meshOptimising a FiveM vehicle
Tuning parts from another car appearTwo carcols.meta files use the same kit IDcarvariations and carcols
Car does not spawnA meta is missing from files or data_file, or a name does not matchVehicle troubleshooting
Some textures are missingThe mod relied on a shared texture dictionary that was in another archiveAdd that .ytd to stream and keep the parent link in txdRelationships.

One more check before you put somebody else's mod on a public server: read the author's terms. Some single-player mods do not allow redistribution or use on servers.

What if the model is not a GTA 5 mod yet?

A car from another game or a plain 3D file has no skeleton, no GTA shaders and no collision, so there is nothing to extract and rearrange. It has to be rebuilt as a GTA vehicle in a 3D tool first. That workflow is in how to make a FiveM vehicle in Blender with Sollumz.

Frequently asked questions

Can I use a single-player GTA 5 car mod in FiveM?
Yes, if the author allows it. The model and meta files are the same. They have to be extracted from the dlc.rpf and arranged as a resource with a stream folder, a data folder and an fxmanifest.lua.
Can I put a dlc.rpf in the stream folder?
No. FiveM does not load .rpf archives from a resource. Extract the files first.
How do I convert a replace car to an add-on?
Rename the .yft, _hi.yft and .ytd files to a new model name, then add a vehicles.meta entry copied from the replaced car with modelName and txdName changed to that name.
Do I need content.xml and setup2.xml in FiveM?
No. They belong to the single-player DLC system. In FiveM the fxmanifest.lua lists the files and their types.
Which data_file type does each meta need?
The same type name that content.xml gives it: HANDLING_FILE for handling.meta, VEHICLE_METADATA_FILE for vehicles.meta, CARCOLS_FILE for carcols.meta and VEHICLE_VARIATION_FILE for carvariations.meta.

Sources

Products from this guide

All guides