Xeno Posted August 14, 2012 Share Posted August 14, 2012 How do I get the position clicked with onClientClick? Like if I use the mouse to click on the ground somewhere, how do I get them coods? Link to comment
Castillo Posted August 14, 2012 Share Posted August 14, 2012 button: This refers the button used to click on the mouse, can be left, right, or middle'state: This can be used to tell if the user released or pressed the mouse button, where up is passed if the button is released, and down is passed if the button is pushed absoluteX: This refers to the 2D x coordinate the user clicked on his screen, and is an absolute position in pixels. absoluteY: This refers to the 2D y coordinate the user clicked on his screen, and is an absolute position in pixels. worldX: This represents the 3D x coordinate the player clicked on the screen, and is relative to the GTA world. worldY: This represents the 3D y coordinate the player clicked on the screen, and is relative to the GTA world. worldZ: This represents the 3D z coordinate the player clicked on the screen, and is relative to the GTA world. clickedWorld: This represents any physical entity elements that were clicked. If the player clicked on no MTA element, it's set to false These are the event arguments, pretty obviously . Link to comment
Xeno Posted August 14, 2012 Author Share Posted August 14, 2012 Yes, I understand this. So, I need worldX, worldY, worldZ, function onClick ( button, state, absoluteX, absoluteY, worldX, worldY, worldZ, clickedElement ) createMarker(worldX,etc) end addEventHandler("onClientClick", getRootElement(),onClick) Something like this? I don't even know how to use the stuff inside the brackets () because I've never been taught how. Link to comment
Xeno Posted August 14, 2012 Author Share Posted August 14, 2012 That was easier than I thought. Thank you very much. I may need some help later with this so I'll just reply to this topic. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now