I am making a vehicle turret. So far I've made a function that rotates the turret horizontaly:
function rotateTurret()
local rotation = getPedCameraRotation(getLocalPlayer())
local veh = getPedOccupiedVehicle(getLocalPlayer())
local _, _, vehRotation = getElementRotation(veh)
setElementAttachedOffsets(vWeapon, 0, 0, 2, 0, 0, 0-vehRotation-rotation+90)
if vWeapon then setTimer(rotateTurret, 100, 1) end
end
And I couldn't find function returning elevation of player's camera.