Ohh, just in the air?
For the server side. Later on, you can use the customNames table to set their custom name back after respawn.
customNames = {}
addCommandHandler("customname", function(thePlayer, cmdName, customName)
local cVeh = getPedOccupiedVehicle(thePlayer)
setElementData(cVeh, "customName", customName)
customNames[cVeh] = customName
end)
For the client side.
addEventHandler("onClientRender", getRootElement(), function()
local pX, pY, pZ = getElementPosition(localPlayer)
for i, k in ipairs(getElementsByType("vehicle")) do
if getElementData(k, "customName") then
local cX, cY, cZ = getElementPosition(k)
if getDistanceBetweenPoints3D(cX, cY, cZ, pX, pY, pZ) <= 20 then
if isLineOfSightClear(cX, cY, cZ+1, pX, pY, pZ+1) then
local cX, cY = getScreenFromWorldPosition(cX, cY, cZ+1)
if cX and cY then
dxDrawText(getElementData(k, "customName"), cX, cY)
end
end
end
end
end)
This one should work just fine. Not tested tho. Give me a feedback of it. Still working on the texture one.