Jump to content

onClientCursorMove


diegofkda

Recommended Posts

Posted

Well, I want to trigger the event onClientCursorMove without the cursor showing, how should I do that?

"Everything exists, because otherwise nothing would", Bob Marley, 2015.

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

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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.

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