Get DisplayName From Vehicle Add-On


I’m trying to get the hashkey/displayname from the car im setting in:

local Veh = GetVehiclePedIsIn(GetPlayerPed(-1), true)
local VehType = GetLabelText(GetDisplayNameFromVehicleModel(GetEntityModel(Veh)))

This works perfectly when I’m in a stock car but when I’m in one of my add-ons it say’s null.

Any suggestions?


1 Like

Do you set up GXT names for your add-ons vehicles?

1 Like

GXT names? What is that?

I was hoping that I could get hold on one of the .meta values:
gameName>BMW I8

1 Like

Im aware of the GTX names now, but how should the be set? Don’t each add-on come with a predefined hex?

1 Like

This fixed it:

function AddTextEntry(key, value)
Citizen.InvokeNative(GetHashKey(“ADD_TEXT_ENTRY”), key, value)

AddTextEntry(‘m2’, ‘m2’)
AddTextEntry(‘m4’, ‘m4’)

1 Like

And ofcause Im still getting null values in 1/20 add-ons. Could this be due to some flaw in the add-on itself?

1 Like

Awesome having a conversation with my self here. :frowning:

1 Like

Thanks @MarkViolla. I got my first like from this :wink:

1 Like

There’s a bug with GXT keys and one function not being patched, this will be fixed in the future.

So a new bug of today or? Because I havent been able to get it to work at all after update.