Jump to content

Remote players head movement detection


Recommended Posts

Is it possible to detect remote players head detection prescisely client side only? Local player is piece of cake tho.

Something i tried but works only partially.

addEventHandler ( "onClientRender", root, function() 
    for i, player in ipairs ( getElementsByType ( "player", root,true ) ) do 
            local x,y,z 
            if getPedTask(player,'primary',5) == 'TASK_SIMPLE_USE_GUN' then 
                x,y,z = getPedTargetEnd(player) 
                x,y,z = getElementPosition(player) 
                local rot = getPedCameraRotation ( player ) 
                x = x + math.sin ( math.rad ( rot ) ) * 3 
                y = y + math.cos ( math.rad ( rot ) ) * 3 
            setPedLookAt ( player, x, y, z ) 
end ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...