He estado probando tu código aquÍ:
local x,y,z = getElementPosition(getLocalPlayer())
for i,veh in ipairs(getElementsByType("vehicle")) do
local px,py,pz = getElementPosition (veh)
local vehID = getElementModel(veh)
local vehicle = getPedOccupiedVehicle(getLocalPlayer())
if veh ~= vehicle then
if vehID ~= 548 then
local pdistance = getDistanceBetweenPoints3D ( x,y,z,px,py,pz )
if pdistance <= 6 then
--Get screenposition
local sx,sy = getScreenFromWorldPosition ( px, py, pz+0.95, 0.06 )
if sx and sy then
--Draw Vehicle
vNames = {
["Sabre"] = "Cajaconruedas"
}
local w = dxGetTextWidth(getVehicleName(veh),1.02,"default-bold")
dxDrawText ( vNames[getVehicleNameFromModel(getElementModel(vehicle))], sx-(w/2), sy, sx-(w/2), sy, tocolor ( 100, 255, 100, 200 ), 1.02, "default-bold" ) <---- 1322
end
end
end
end
end
Y esto es lo que me muestra el debugscript3
He estado probando a cambiar el nombre por el modelo y a quitar la función de getVehicleNameFromModel pero tampoco hay solución.