Turtles

…no

2 Likes

This is because they are Addon Vehicles. You will need to add their vehicle name via hash.

Example:

Citizen.CreateThread(function()
  AddTextEntry("0xF5ACE7AB", "Z06")
  AddTextEntryByHash("-216150906", "2016 Dodge Challenger")
end)

Create that as a client script and then what you have will work :slight_smile:

2 Likes

I have provided 2 methods to create the names there you can either use the hash or use the spawn name. If you want to use a spawn name you will need to use this code:

Citizen.CreateThread(function()
  AddTextEntry(GetHashKey("SUPRA2"), "Toyota Supra")
end)
3 Likes

SO all is good now? BTW You can also get the hash by using the native GetHashKey(‘HASHHERE’) then use the Native AddTextEntryByHash

You can also see the hash of something missing the text entry as in the console (F8) it says something like couldn’t get vehicle name for hash: -00000000

1 Like

As it says please visit the ESX github and post an issue there or ask on the esx discord, Im not an esx person sorry

Hi,

I have similar problem, just 2 cars don’t work with any method stated here (below shown only one as an example). I don’t really know why.

I have tried for those buggy ones:

a) AddTextEntry

b) AddTextEntryByHash

Everything is correct, I’ve done this for another 70 cars so far and without any problems! :confused:

hash

chall

Yea i have a few that are like that still. I dont know which hash to use. I got the ones from the actual file itself too.

where do i add this in ? in the Advancedgarage/client/main.lua on the bottom or ? none of the things above work, so im starting to wonder if my placement is right…

just a testcar

Citizen.CreateThread(function()
  AddTextEntry("0xDDED445C", "Honda S2000")
end)

That code that you have there can be run in any client side script E.g. client.lua if it does not work still then chances are your address might be wrong in which case you can also acheive this by doing:

Citizen.CreateThread(function()
  AddTextEntryByHash(GetHashKey("SPAWN_NAME_HERE"), "Honda S2000")
end)
1 Like

Would you do this entry separate for each vehicle or can you simply add multiple lines like the following?

Citizen.CreateThread(function()
  AddTextEntryByHash(GetHashKey("SPAWN_NAME_HERE"), "Honda S2000")
  AddTextEntryByHash(GetHashKey("SPAWN_NAME_HERE"), "LSPD Mustang")
end)

I am having the same issue on my server with custom cars showing up as null. I’m confused by the statement “Can be run in any client side script E.g. client.lua” I am using vehicle_names.lua so do I just need to place the file in a client folder to be called or do I need to add a call in the client.lua file? I have been struggling with where to place the vehicle_names.lua file to get it to work with my addon cars. Any help would be greatly appreciated, thanks in advance!

@Hypnotic_92 yes you are correct there.

@NullynVoyd what you would need to do is put that file in a resource with your __resource.lua be it inside a folder where that is located if you want or just your file and the __resource.lua file either is fine. Then in the __resource.lua file specify your file vehicle_names.lua as a client script.

Unfortunately it doesn’t seem to work with some add-on vehicles.

That is strange they might have been setup differently. Did they come with some hashes?

Can someone explain where these need to go
i have a file named vehicle_names.lua with this inside do i edit this?

Citizen.InvokeNative(GetHashKey("ADD_TEXT_ENTRY"), key, value)

end

Citizen.CreateThread(function()
– POLICE2 2015 Dodge Charger PPV
AddTextEntry(‘0x9F05F101’, ‘Police2’)
– POLICE10 2013 Ford Police Interceptor Utility
AddTextEntry(‘0x71FA16EA’, ‘Police10’)
– POLICE4 Ford Police Interceptor Sedan
AddTextEntry(‘0x8A63C7B9’, ‘Police4’)
– POLICE5 Ford Police Interceptor Utility
AddTextEntry(‘0x9C32EB57’, ‘Police5’)
– POLICE6 Chevrolet Tahoe PPV K-9 Unit (slicktop)
AddTextEntry(‘0xB2FF98F0’, ‘Police6’)
– POLICE7 Ford Crown Victoria Police Interceptor
AddTextEntry(‘0xC4B53C5B’, ‘Police7’)
– POLICE9
AddTextEntry(‘0xD0AF544F’, ‘Police9’)

Help I need value S100rr

did you get it to work? i’m having problem with that car too

Need help too i tried all ways but i can’t get this

1 Like

you will need to convert the modelName from the vehicles.meta to a hash key using OpenIV once converted you will need to take the hash key and put in your vehicle_names.lua using something like this

Citizen.CreateThread(function()
AddTextEntry(‘0x6B2414B9’, ‘name of car’)
end)

I did that look : ( my vehicle_names.lua )

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

Citizen.CreateThread(function()
AddTextEntry(‘0x0C603EAD’, ‘Mota EPRI’)
end)

I use the hask key openIV still not working