Gallagher Posted June 10, 2014 Posted June 10, 2014 how to detect when the player to aim in a cuboid?
Gallagher Posted June 10, 2014 Author Posted June 10, 2014 u mean when Player enter or approaching ? Aim, shoot the cube
Gallagher Posted June 10, 2014 Author Posted June 10, 2014 u mean when Player enter or approaching ? Aim, shoot the cube...
Price. Posted June 10, 2014 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)
xXMADEXx Posted June 10, 2014 Posted June 10, 2014 You could just use onClientPlayerTarget, get the distance and check if the player is facing toward the col shape.
cheez3d Posted June 11, 2014 Posted June 11, 2014 https://wiki.multitheftauto.com/wiki/Ge ... tCollision
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