How to add Add on Vehicle parts to your server
Adding cars itself isn’t difficult, and even putting them in a pack is quite easy if you use
a merger tool of some sorts.
However when i tried to modify my add-on cars in Los Santos Customs, All those sweet parts weren’t showing up.
I missed a step. Being lazy, i couldn’t find a guide to follow when i tried adding add-on cars and their custom parts to our server (Unity)
Essentially, you have to get the hexes for all the parts you are adding to the game.
For this i used the following Tools:
- OpenIV
- Notepad++ (yes… i know)
In the example i am about to show you i have used a car that has a few parts,
but i am treating it as one that has many.
Step 1.
Navigate to the in .dlc folder where the parts are located
Right click without having a file selected and select copy file list.
Step 2.
Make your life easy, and remove .yft extensions
Step 3.
In OpenIV click on Tools and select “Hash Generator”
Step 4
Copy paste the filenames (without extensions) into the input field.
Add the filename of the vehicle itself.
On the bottom select Hex and Case Sensitivity.
When you hit generate, the output field will give you the hex values.
Step 5.
Create a file “vehicle_names.lua” and place it in your resource
In here type:
function AddTextEntry(key, value)
Citizen.InvokeNative(GetHashKey(“ADD_TEXT_ENTRY”), key, value)
end
Citizen.CreateThread(function()
AddTextEntry(‘0xFAA9DCEC’, ‘Ferrari 599 GTO’)
AddTextEntry('HEX CODE ', ‘PART NAME’)
AddTextEntry('HEX CODE ', ‘PART NAME’)
AddTextEntry('HEX CODE ', ‘PART NAME’)
AddTextEntry('HEX CODE ', ‘PART NAME’)
AddTextEntry('HEX CODE ', ‘PART NAME’)
AddTextEntry('HEX CODE ', ‘PART NAME’)
end)
The part names can be whatever you want them to be. I usually use generic names like Bonnet 1 or Skirt A
Step 6.
In your __resource.lua
add:
client_script {
‘data/vehicle_names.lua’
}
(Point it to the location that you have placed the file)
Step 7.
Start the resource, spawn your vehicle and mod your car at the garage.
Obviously when there aren’t as many resources in the dlc file, you would do it
by hand. But some have a ton of parts, and manually copying all the filenames gets
boring, and personally i’m prone to typing errors.
I hope this helps those that came across the same problem as me. There is probably
a much better Tutorial out there. But like i said, i couldn’t find one in the first minute
so i gave up.