VehicleClient

getDisplayNameFromVehicleModel

GET_DISPLAY_NAME_FROM_VEHICLE_MODEL0xB215AAC32D25D019

The 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.

SignatureJavaScript
getDisplayNameFromVehicleModel(modelHash: Hash): string
SignatureLua
getDisplayNameFromVehicleModel(modelHash: Hash): string

Usage

JavaScript
const text = getDisplayNameFromVehicleModel(modelHash);
Lua
local text = getDisplayNameFromVehicleModel(modelHash)

Parameters

ParameterTypeJavaScriptLua
modelHashHashnumberinteger

Returns

string JavaScript string, Lua string

Notes

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

Open in the interactive natives reference