Jump to content

onClientCursorMove


diegofkda

Recommended Posts

addEventHandler("onClientCursorMove", root, 
    function( _, _, _, _, wx, wy, wz ) 
        local cx, cy, cz = getCameraMatrix() 
        x1 = ( wx - cx ) / 300 
        y1 = ( wy - cy ) / 300 
        z1 = ( wz - cz ) / 300 
    end 
) 

That's from cod2mod.

Link to comment

This is from an unreleased version of Garry's Mod Map Editing that uses forced FPS (ofc won't work perfect because it needs 1 more event handler and defined "player" variable).

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 ) 
    end 
end ) 

It works perfect when using full code ;)

So I can tell: YES onClientCursorMove WORKS WITHOUT CURSOR SHOWING.

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...