Errors & Warnings

What does "invalid model" mean in FiveM?

An invalid model error means a script asked the game for a model name, or model hash, that the game does not have registered. It usually appears when spawning a vehicle: a spawn command prints a message such as "invalid model" or "model not found", or a script waits forever for a model that never loads. The request itself is rarely the problem. The vehicle resource is not started, its name does not match its files, or its vehicles.meta was never loaded.

What the game checks

Before a model can be used it has to be known to the game and then loaded into memory. Scripts normally do both steps explicitly:

lua
local model = GetHashKey('mycar')

if not IsModelInCdimage(model) then
    print('Model is not registered: mycar')
    return
end

RequestModel(model)
while not HasModelLoaded(model) do
    Wait(0)
end
The two stages: is the model registered, and has it loaded

IsModelInCdimage answers whether any loaded data defines that name. For an add-on vehicle that means its vehicles.meta entry. If the answer is no, a well-written script reports an invalid model. A script that skips the check and goes straight to the loop will hang instead.

If the model is registered but its files are broken or missing, the first check passes and the loading stage fails or produces an invisible vehicle. That is a different problem, covered in the invisible car guide.

Seeing this in your console? Paste the log into the Error Analyzer for the likely cause. Open the Error Analyzer

Causes, from most to least common

  1. The name is wrong. The spawn name is the <modelName> in vehicles.meta, not the resource folder name or the mod's title.
  2. The resource is not started. It is in the resources folder but has no ensure line in server.cfg, or the server has not been refreshed since it was added.
  3. vehicles.meta is not loaded. The file is missing from files, has no VEHICLE_METADATA_FILE data_file line, or the path in the manifest is wrong.
  4. The manifest has an error. A syntax error in fxmanifest.lua stops the whole resource from loading, so none of its metas are read.
  5. The mod was never converted. A single-player dlc.rpf dropped into a resource does nothing. The addon to FiveM converter turns a gta5-mods.com add-on into a resource.
  6. The vehicle needs a newer game build. A recent stock DLC vehicle does not exist on a server that enforces an older game build.
  7. vehicles.meta is malformed. Invalid XML, often from a manual edit, makes the game skip the file.

How to diagnose it

  1. Open the car's vehicles.meta and copy the <modelName> value. Spawn with exactly that.
  2. In the server console, run ensure followed by the resource name and read the output. Errors about the manifest or missing files appear here.
  3. Open fxmanifest.lua and confirm that vehicles.meta appears under files and in a data_file 'VEHICLE_METADATA_FILE' line, with the same path as on disk.
  4. Confirm that the stream folder contains a .yft whose name equals the model name.
  5. Reconnect to the server so the client downloads the current files, then try again.

The Resource Inspector runs these checks on a zipped resource in one pass: it compares model names in the metas with the files in stream and verifies the manifest entries.

Preventing it in scripts

  • Always test IsModelInCdimage before RequestModel, and print the name that failed.
  • Add a timeout to loading loops so a broken model cannot freeze a script forever.
  • Keep vehicle lists for garages, shops and jobs in one configuration file, so that a renamed or removed car has to be updated in one place only.
  • When removing a car resource, search your scripts and database for its spawn name first. Stored vehicles that refer to a deleted model are a common source of this error long after the change.

For names of base game vehicles, check the Vehicle Spawn Codes list. If an error message is unclear, the Error Analyzer explains the common ones, and the invalid model guide has a longer walkthrough.

Frequently asked questions

Why does FiveM say invalid model when I spawn my car?

The game has no vehicle registered under that name. Either the spawn name is wrong, the resource is not started, or its vehicles.meta is not being loaded through fxmanifest.lua.

How do I find the correct spawn name?

Open the vehicle's vehicles.meta and use the value of the modelName tag. It also matches the main .yft file name in the stream folder.

The car is registered but invisible. Is that the same error?

No. An invisible car means the name is known but the model or its textures failed to load, usually because of a file name mismatch or an oversized file.

More in Errors & Warnings: Texture Loss (Texture Budget), Pool Size Error (Game Memory Error)

Still need the car as a FiveM resource?

Paste a gta5-mods.com vehicle link and get a FiveM-ready resource with the manifest and metas in place. 3 free conversions, no signup.

  • 3 conversions free, no account needed
  • 2 more free if you leave an email
  • After that: $15 once for unlimited conversions and the Pro tools. No subscription, 14-day refund policy