How to add an add-on vehicle to a FiveM server
To add an add-on vehicle to a FiveM server, put the model files (.yft, _hi.yft, .ytd) in a resource's stream folder and the meta files in a data folder. List the metas in fxmanifest.lua with files and data_file lines, add ensure to server.cfg, restart, and spawn the vehicle by its model name.
What is an add-on vehicle in FiveM?
An add-on vehicle is a vehicle with its own model name that is loaded next to the stock GTA V vehicles instead of replacing one of them. On FiveM it lives in a server resource: the server sends the files to every player who joins, so nobody installs anything by hand.
| Add-on | Replace | |
|---|---|---|
| Model name | New (for example mycar) | An existing one (for example sultan) |
| Stock vehicle | Stays in the game | Is swapped out for every player |
| Meta files | Needs its own vehicles.meta entry | Can reuse the stock entry |
| Typical use | Server cars, shops, job vehicles | Visual swaps of traffic cars |
What are the steps, in short?
- Create a folder for the resource inside the server
resourcesfolder. - Put the
.yftand.ytdfiles in astreamsubfolder. - Put the
.metafiles in adatasubfolder. - Write an
fxmanifest.luathat lists each meta underfilesand in adata_fileline. - Add
ensure <folder name>toserver.cfgand restart the server. - Spawn the vehicle with its model name.
Each meta file also has its own guide, linked from the table in the next section.
What files does an add-on vehicle need?
An add-on vehicle is two groups of files: binary model files that go in stream/, and XML meta files that tell the game what the model is and how it behaves. The game only insists on the model, its textures and a vehicles.meta entry. The other metas add handling, colors, tuning and seats.
| File | Folder | What it does | Needed? |
|---|---|---|---|
mycar.yft, mycar_hi.yft | stream | The 3D model. See vehicle model files. | Yes |
mycar.ytd | stream | The texture dictionary. | Yes |
vehicles.meta | data | Registers the model: name, type, layout, flags. See vehicles.meta explained. | Yes |
handling.meta | data | Physics: mass, power, grip, suspension. See handling.meta explained. | Only if the vehicle has its own handlingId |
carvariations.meta | data | Color combinations, mod kit, light and siren settings. | Recommended |
carcols.meta | data | Custom tuning kits, sirens and light setups. See carvariations and carcols. | Only for custom tuning parts or sirens |
vehiclelayouts.meta | data | Custom seats, entry points and animations. See vehiclelayouts.meta explained. | Only for custom seating or animations |
Where do the files come from?
Vehicle packs made for FiveM already come as a resource with these folders. A vehicle downloaded as a single-player mod usually comes as a dlc.rpf archive. The same files are inside, but they have to be extracted and arranged into the layout below.
| Tool | Used for |
|---|---|
| CodeWalker | Browsing the game's archives, viewing models, and exporting stock .meta files to copy an entry from. |
| Blender with the Sollumz add-on | Importing, editing and exporting vehicle models (.yft) and texture dictionaries (.ytd). |
| Any text editor | Editing the .meta files and fxmanifest.lua, which are plain text. |
The fastest way to write metas for a new vehicle is to copy the entries of the stock vehicle most similar to it and change the names.
To make or change the model itself, see how to make a FiveM vehicle in Blender with Sollumz. Turning a single-player dlc.rpf into a resource is in converting a single-player car mod to a FiveM add-on, and the two tools are compared in CodeWalker vs Sollumz.
What is the folder structure of a vehicle resource?
A vehicle resource is one folder inside the server resources folder with an fxmanifest.lua, a stream folder and a folder for the metas. The folder name is the resource name. The meta folder can have any name, and most people call it data.
resources/
mycar/
fxmanifest.lua
data/
handling.meta
vehicles.meta
carcols.meta
carvariations.meta
stream/
mycar.yft
mycar_hi.yft
mycar.ytd
Files in stream/ are picked up by file name, so they are not listed in the manifest. Meta files get no such shortcut. Each one has to be declared in the manifest.
How do I write the fxmanifest.lua for a vehicle?
The manifest declares every meta file twice: once in files, so the server sends it to players, and once in a data_file line, so the game loads it as the right kind of data. Both are documented in the FiveM resource manifest reference.
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'
fx_version 'cerulean'andgame 'gta5'are required at the top of every FiveM manifest.- A meta that is in
data_filebut missing fromfilesnever reaches the player, so the vehicle will not exist for them. - The type string must match the file:
HANDLING_FILEfor handling.meta,VEHICLE_METADATA_FILEfor vehicles.meta, and so on. The full list is in the data_file reference for vehicles.
How do I start the vehicle resource?
Add one line with the resource folder name to server.cfg and restart the server. ensure starts the resource, or restarts it when it is already running.
ensure mycar
On a running server you can type refresh and then ensure mycar in the server console instead of a full restart. If a player who was already connected does not see the vehicle, have them reconnect.
How do I spawn the vehicle in game?
The spawn name is the modelName from vehicles.meta, which is also the name of the .yft file. Use it with any admin menu or vehicle spawn command. If the server has no spawn command yet, this client script adds /car mycar:
RegisterCommand('car', function(_, args)
local model = GetHashKey(args[1] or 'mycar')
if not IsModelInCdimage(model) then return print('model not found') end
RequestModel(model)
while not HasModelLoaded(model) do Wait(0) end
local ped = PlayerPedId()
local veh = CreateVehicle(model, GetEntityCoords(ped), GetEntityHeading(ped), true, false)
SetPedIntoVehicle(ped, veh, -1)
SetModelAsNoLongerNeeded(model)
end)
The name the game shows for the vehicle comes from gameName. It is a text label, so without a label the HUD shows the raw key. Register one from a client script:
-- client script: readable name for <gameName>MYCAR</gameName>
AddTextEntry('MYCAR', 'My Car GT')Which names have to match?
Most add-on vehicles that fail to load have a name that does not match between two files. Each pair on a line below must be identical:
stream/mycar.yft <modelName>mycar</modelName>
stream/mycar.ytd <txdName>mycar</txdName>
handling.meta <handlingName> <handlingId>MYCAR</handlingId>
carvariations.meta <modelName> <modelName>mycar</modelName>
vehiclelayouts.meta <Name> <layout>LAYOUT_STANDARD</layout>
carcols.meta <kitName> carvariations.meta <kits><Item>
If the vehicle spawns but something is off (no textures, wrong physics, no tuning parts), go through the vehicle troubleshooting guide.
Does the framework matter?
No. A vehicle resource has no script that depends on ESX, QBCore or QBox, so the steps above are the same on every framework. The framework only comes in when the vehicle should be sold in a dealership or stored in a garage, which is covered in adding a custom vehicle to ESX, QBCore or QBox.
The Coil S-Cooter is a working example of this layout: a stream folder with the model, textures and animation dictionaries, and a data folder with handling, vehicles, carvariations, vehiclelayouts and clip sets, all loaded through data_file lines with no script.
Frequently asked questions
- Where do I put add-on vehicle files in FiveM?
- Inside a resource folder in the server resources directory. The .yft and .ytd files go in a subfolder named stream. The .meta files go in any other subfolder (usually data) and are declared in fxmanifest.lua.
- Do players have to download or install the vehicle?
- No. The server streams the resource to every player when they connect. Nothing is installed in the player's GTA V folder.
- Can I put several vehicles in one resource?
- Yes. Put all the model files in the same stream folder and either merge the metas or keep one set per vehicle in subfolders and declare them with a glob pattern such as data/**/vehicles.meta, which the files and data_file entries both accept.
- Why does my add-on vehicle not spawn?
- The most common causes are a resource that is not started, a meta file missing from files in the manifest, or a modelName that does not match the .yft file name. The troubleshooting guide lists each case with its fix.
- What is the difference between __resource.lua and fxmanifest.lua?
- __resource.lua is the old manifest format. FiveM documents it as deprecated and recommends fxmanifest.lua with fx_version for every resource.
Sources
- FiveM docs: Resource manifest
- FiveM docs: Data files
- Sollumz, Blender add-on for GTA V assets
- CodeWalker
Products from this guide
- Coil S-Cooter: FiveM Electric Scooter
- Hoverboard Pack: 3 FiveM Hoverboards
- Complete Bundle: FiveM Scooter + Hoverboards
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?
- 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
- fxmanifest data_file reference for vehicles
- 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?
