getDisplayNameFromVehicleModel
GET_DISPLAY_NAME_FROM_VEHICLE_MODEL0xB215AAC32D25D019The GTA V native GET_DISPLAY_NAME_FROM_VEHICLE_MODEL of the VEHICLE namespace, as LS:MP client scripts call it: the global function getDisplayNameFromVehicleModel, in JavaScript and in Lua.
getDisplayNameFromVehicleModel(modelHash: Hash): stringgetDisplayNameFromVehicleModel(modelHash: Hash): stringUsage
const text = getDisplayNameFromVehicleModel(modelHash);local text = getDisplayNameFromVehicleModel(modelHash)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
modelHash | Hash | number | integer |
Returns
string JavaScript string, Lua stringNotes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
Returns model name of vehicle in all caps. Needs to be displayed through localizing text natives to get proper display name.
While often the case, this does not simply return the model name of the vehicle (which could be hashed to return the model hash). Variations of the same vehicle may also use the same display name.
Returns "CARNOTFOUND" if the hash doesn't match a vehicle hash.
Using getFilenameForAudioConversation, you can get the localized name.
Full list of vehicles by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/vehicles.json
Reference
- Namespace
- Vehicle VEHICLE
- In the game
const char* GET_DISPLAY_NAME_FROM_VEHICLE_MODEL(Hash modelHash)- Hash
0xB215AAC32D25D019