I’ve read quite a few tutorials that mention vehicle_names.lua, the hashes within and their importance for mod shops that use hashes but I’ve got a quick question about what actually needs to get hashed.
What needs to get hashed?
I’ve packaged a couple hundred resources and I’ve seen car make, car make and car model, modifications, website names and urls, shoutouts… Pretty much, if it fits in the file, someone has likely hashed it.
So what needs to be in there for it to serve it’s purpose? Just the car make and model? Does anything having to do with the mods need to be listed?
So I can put anything there in the right for spawn name and just generate the hash for it?
AddTextEntryByHash(0x62153B72, 'Schwims car')
which leads me to a follow-up question. When I’m packaging multiple vehicles into a single resource, how would the server know which line belongs to which car? Do I have to place that hash somewhere in one of the metas?
if that hash matches the joaat hash of your vehicle model, then yes.
no, the easiest way to do all this is go into the vehicles.meta file, and for each vehicle make sure the “gameName” is set to the model name, not to some custom name.
Then in a client script (vehicle_names.lua or call it whatever you want), do this:
Citizen.CreateThread(function()
AddTextEntry("vehicle spawn/model name", "display name you want")
end)
that way you don’t even need to worry about hashes. As long as the "vehicle spawn/model name" you put in the function, is the same as the gameName entry in vehicles.meta, it will work.
Hi there Vespura, I’ve got a related question and it concerns your vMenu. Since it’s not a bug but rather a mistake I’m making, I didn’t want to put it in your thread.
I went through every car resource and created vehicle_names.lua (called as a client resource by resource.lua) and the entirety of that file looks like this:
But if I spawn this vehicle then save it in vMenu. When I look at saved vehicles, it shows my saved name on the left and (NULL) on the right for modelName.
What am I doing wrong that vMenu doesn’t register the modelName?
Ok, so to clarify, in each addon car resource, I should make vehicle_names entry, modelName and gameName represent what the car is spawned by (in this case, jp12)?
well, the gameName should be whatever you put in the modelName or txdName fields i think. I’m not exactly sure what the ‘requirements’ are, but i always just keep them the same (like they usually already are from the vehicle.meta you got from the download). and that always seems to work for me.
only thing you should probably ever change is the gameName though, so just make sure that matches the other fields.
Sounds like you’re putting the same value for <gameName> and <vehicleMakeName>.
<vehicleMakeName> should be the make/brand of the vehicle, or just simply <vehicleMakeName /> if you don’t want to have the brand show up. You’ll want to add a text entry for this as well if you do give it a value.