but actualy the component is not moving:/
function turn()
local veh = getPedOccupiedVehicle(localPlayer)
local id = getElementModel ( veh )
if id == 602 then
outputChatBox( "works")
local vx,vy,vz = getElementRotation(veh)
local screenx, screeny = getCursorPosition()
local rx,ry,rz = getVehicleComponentRotation( veh, "misc_a" )
setVehicleComponentRotation(veh, "misc_a", rx,ry,0-vz-screenx)
local rx2,ry2,rz2 = getVehicleComponentRotation( veh, "misc_b" )
setVehicleComponentRotation(veh, "misc_b", 0-screeny,ry2,rz2)
end
end
addEventHandler( "onClientCursorMove", getRootElement, turn)
addEventHandler ( "onClientCursorMove", getRootElement ( ),
function ( cursorX, cursorY, absoluteX, absoluteY, x2, y2, z2 )
if not isChatBoxInputActive ( ) and not isMainMenuActive ( ) and not isConsoleActive ( ) and not isCursorShowing ( ) then
local x1, y1, z1 = getPedBonePosition ( player, 6 )
setCameraMatrix ( x1, y1, z1, x2, y2, z2 )
outputChatBox( "cursor moved")
end
end )