Try this:
font = dxCreateFont("fuente.ttf", 13)
function infoauto ( )
local sWidth,sHeight = guiGetScreenSize()
dxDrawRectangle((890/1024)*sWidth, (580/768)*sHeight, (190/1024)*sWidth, (250/768)*sHeight,tocolor(0,0,0,150),false)
vehicle = getPedOccupiedVehicle(getLocalPlayer())
if ( vehicle ) then
speedx, speedy, speedz = getElementVelocity ( vehicle )
actualspeed = (speedx^2 + speedy^2 + speedz^2)^(0.5)
kmh = math.floor(actualspeed*180)
mph = math.floor(actualspeed * 111.847)
mps = math.floor (actualspeed)
vehiclehealth = math.floor(getElementHealth ( vehicle ))
dxDrawText(tostring (kmh), (920/1024)*sWidth, (640/768)*sHeight, (280/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), 1, font)
dxDrawText("Velocidad", (896/1024)*sWidth, (620/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), 0.9, font)
dxDrawText(getVehicleNameFromModel ( getElementModel ( vehicle ) ), (900/1024)*sWidth, (680/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor ( 255, 255, 255, 255), 0.6, font)
dxDrawText("Auto Info", (914/1024)*sWidth, (580/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 255, 255, 255), 0.65, font)
dxDrawText(tostring (vehiclehealth).."%", (899/1024)*sWidth, (710/768)*sHeight, (300/1024)*sWidth, (259/768)*sHeight, tocolor (250, 0, 0, 255), 1, font)
else
dxDrawText("No", (905/1024)*sWidth, (610/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (200, 200, 200, 255), 1, font)
dxDrawText("Auto Info", (905/1024)*sWidth, (635/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (200, 200, 200, 255), 0.9, font)
dxDrawText("-OFFLINE-", (910/1024)*sWidth, (680/768)*sHeight, (289/1024)*sWidth, (250/768)*sHeight, tocolor (255, 0, 0, 255), 0.9, font)
end
end
addEventHandler ("onClientRender", root, infoauto )