getLiveryName
GET_LIVERY_NAME0xB4C7A93837C91A1FThe GTA V native GET_LIVERY_NAME of the VEHICLE namespace, as LS:MP client scripts call it: the global function getLiveryName, in JavaScript and in Lua.
getLiveryName(vehicle: Vehicle, liveryIndex: number): stringgetLiveryName(vehicle: Vehicle, liveryIndex: integer): stringUsage
JavaScript
const text = getLiveryName(vehicle, liveryIndex);Lua
local text = getLiveryName(vehicle, liveryIndex)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
vehicle | Vehicle | number | integer |
liveryIndex | int | 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 the text label of the vehicle's liveryIndex, as specified by the liveryNames section of the vehicle's modkit data in the carcols file.
example
int count = getVehicleLiveryCount(veh);
for (int i = 0; i < count; i++)
{
const char* LiveryName = getLiveryName(veh, i);
}this example will work fine to fetch all names
for example for Sanchez we get
SANC_LV1
SANC_LV2
SANC_LV3
SANC_LV4
SANC_LV5
Use getFilenameForAudioConversation, to get the localized livery name.
Full list of vehicle mod kits and mods by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/vehicleModKits.json
Reference
- Namespace
- Vehicle VEHICLE
- In the game
const char* GET_LIVERY_NAME(Vehicle vehicle, int liveryIndex)- Hash
0xB4C7A93837C91A1F