[HELP] Vehicle addon parts problem

Hi, I’m writing because I have encountered a really inconsistent problem with a server I’m trying to setup and I have reached a dead end.

I am trying to make 2 separate addon cars out of the same vehicle – one would have grip handling, the other drift one. I’ve made all the changes to the drift one (all the model and texture names, fields in .meta files, parts names, modkit IDs, etc.). Server registers the addons fine, both cars can be spawned by client, but there is a problem with mod parts (spoilers, engine upgrades, etc.). Sometimes they spawn fine and sometimes all the mods for the car are non-existent.

I’ve been trying to figure out why is it happening and did some tests, this is how it behaves rn:

  • When restarting the client’s FiveM and joining the session for the first time (since app restart) the mods do not work
  • When rejoining the session without exiting/restarting FiveM – everything suddenly starts working – can spawn modded parts for both cars

The addon car I am using is 2017 Nissan GTR (https://www.gta5-mods.com/vehicles/2015-nissan-gtr-nismo-yca-y97y).

It would be amazing if someone could point me in the direction of what may cause such inconsistencies, I’ve been struggling to set it up for a while now.

So, after struggling with this problem for quite a while I think that I finally found a solution:

The order of declaring .meta files in your __resource.lua is crucial. I had some files declared in the wrong order and therefore my client did not read all of them (especially carcols.meta) upon the first connection to the server.
The correct order should be declared as follows:

resource_manifest_version '44febabe-d386-4d18-afbe-5e627f4af937'

files {
    'data/vehicles.meta',
    'data/carvariations.meta',
    'data/carcols.meta',
    'data/handling.meta',
    'data/vehiclelayouts.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'
data_file 'VEHICLE_LAYOUTS_FILE' 'data/vehiclelayouts.meta'


client_script {
    'vehicle_names.lua'
}

When you declare those files in this order all should be good.

4 Likes

Dude I would kiss you if I could!!! I’ve been struggling with this for a few days and eventually gave up… The only way I could get mods to work on my server was to create a resource to restart all the car resources when the server started, but if a player joined after the resource restart he would still have the problem. This solved it, you sir are a genius!! I don’t even need the resource restart :smiley:

1 Like

@Shrimp, where can we get the vehicle_names.lua file to put it in client_script?

This is not a necessary file to include, it just contains hashes and names of certain stuff (car make, model, parts names) so that it properly displays them ingame. If it is not provided with the addon car than you don’t have to include it, but you can make one yourself if have some problems with vehicle name text ingame.

where can I get a copy of it? Maybe I will try to add it.

This was mine for the R35 mentioned in the post:

Citizen.CreateThread(function()
	AddTextEntry("gtr", "Nissan R35")
	AddTextEntry("NISSAN", "NISSAN")
	AddTextEntry("0x0F5EED98", "Liberty Walk")
	AddTextEntry("0x1B02843C", "Liberty Walk")
	AddTextEntry("0x31A6DAD4", "RocketBunny")
	AddTextEntry("0x847AD6BF", "Nismo")
	AddTextEntry("0x9790D1BD", "2017 NISSAN GTR")
	AddTextEntry("0x23583E37", "Nismo")
	AddTextEntry("0x756930C0", "Liberty Walk")
	AddTextEntry("0xA2321340", "RocketBunny")
	AddTextEntry("0xB6B13B2B", "RocketBunny")
	AddTextEntry("0xB480B7DD", "Nismo")
	AddTextEntry("0xC3C1CD70", "RocketBunny")
	AddTextEntry("0xC6E70556", "Liberty Walk")
	AddTextEntry("0xD1D0698D", "Nismo")
	AddTextEntry("0xDC75E655", "Liberty Walk")
	AddTextEntry("0xF15C9022", "RocketBunny")
end)

What you need is a spawnname/make and then provide your own text entry. The later hash entries were provided by addon maker for names of mod parts.

You can read more about that file and how to set it up/how it works here:

1 Like

thank you so much! will try this one out!

@Shimp some of my cars works now without vehicles_name.lua file but why some of cars’ texture won’t work properly? the colors are blinking when I move the camera?

TBH I have no idea what could cause this, have not encountered anything like that. Maybe texture file is too big, corrupted, not streamed properly or some fields in vehicle meta are wrongly assigned.

1 Like

Okay thanks! will just add the working one. :slight_smile:

hey, I have a car that has another .meta file and I was wondering in what order should I put them.

the .meta file is contentunlocks.meta