Vehicle name

Good afternoon, gentlemen developers!

Interested in the question, how to get the full name of the vehicle? Example on the screen…

The “Albany” part (vehicle make) is not possible through GTA natives. however you can get the “Emperor” part using this:

local vehicleModel = "emperor2" -- (Vehicle model name or hash)
local vehicleName = GetDisplayNameFromVehicleModel(vehicleModel) -->>> = "EMPEROR"
local localizedName = GetLabelText(vehicleName) -->>> = "Emperor"

Unfortunately, I needed to get the manufacturer :frowning:

A receipt of the name has already been written for a long time)

Well, unless you use a file containing every manufacturer for each vehicle, this is not possible.

I have already started filling out the database. Tell me where these data can be found in a more or less ready-made form?
Снимок

I believe @zr0iq made a file containing vehicle info. Not 100% sure.

1 Like

Yes, I found this file, thanks :slight_smile:
https://github.com/GHMatti/FiveM-VehicleInfo/blob/master/data/mvehicledata.json

Not going to lie, it blew my mind that the gta devs hardcoded all the values for things like this?
Why bother with the brand name in the xml then?

Well, the vehicle.meta file includes a list of all vehicle’s manufacturer. Maybe they have a way of accessing that file which is still unknown. Not sure though.

1 Like

I was porting the mp car stats scaleform one day and gave up, it’s a mess…
They even hardcode all the specs for each vehicle.

because it performs faster maybe, or some weird shit, they hardcoded a lot of stuff, that might have been unnecessary; or “we will only need it once anyways” or old XBOX memory limitations. Pick one.

The thousand line switch statements are the best :sweat_smile: