Gallagher Posted June 10, 2014 Share Posted June 10, 2014 how to detect when the player to aim in a cuboid? Link to comment
#DRAGON!FIRE Posted June 10, 2014 Share Posted June 10, 2014 u mean when Player enter or approaching ? Link to comment
Gallagher Posted June 10, 2014 Author Share Posted June 10, 2014 u mean when Player enter or approaching ? Aim, shoot the cube Link to comment
Gallagher Posted June 10, 2014 Author Share Posted June 10, 2014 u mean when Player enter or approaching ? Aim, shoot the cube... Link to comment
mint3d Posted June 10, 2014 Share Posted June 10, 2014 (edited) . Edited June 11, 2014 by Guest Link to comment
Price. Posted June 10, 2014 Share Posted June 10, 2014 try using this function Cube(button, state, absX, absY, wx, wy, wz, element) if getElementData(getLocalPlayer(), "exclusiveGUI") then return end if element and getElementType( element ) == "object" and button == "right" and state == "down" and getElementModel(element) == "ELEMENTID" then local x, y, z = getElementPosition(localPlayer) if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz) <= 3 then if (wRightClick) then hideregister() end showCursor(true) ax = absX ay = absY register = element showregister() end end end addEventHandler("onClientClick", getRootElement(), Cube, true) Link to comment
xXMADEXx Posted June 10, 2014 Share Posted June 10, 2014 You could just use onClientPlayerTarget, get the distance and check if the player is facing toward the col shape. Link to comment
cheez3d Posted June 11, 2014 Share Posted June 11, 2014 https://wiki.multitheftauto.com/wiki/Ge ... tCollision 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