function msgCarro ()
local theVehicle = getElementType( source ) == "vehicle"
local hoodX, hoodY, hoodZ = getVehicleComponentPosition (theVehicle, "bonnet_dummy", "world")
local x, y, z = getElementPosition ( source )
local distance = getDistanceBetweenPoints3D( hoodX, hoodY, hoodZ, x, y, z )
if distance < 4 then
outputChatBox("TESTE_1")
else
outputChatBox("TESTE_2")
end
end
addEventHandler( "onResourceStart", resourceRoot,
function()
for _,v in pairs(getElementsByType("player")) do
bindKey(v, "b" , "down", msgCarro)
end
end
)