megaman54 Posted February 9, 2015 Posted February 9, 2015 How can i draw a bounding box around all objects that are currently streamed in? I tried with this code but it doesnt draw anything and i dont know why function render() for i,v in ipairs(getElementsByType("object", root, true))do local x,y,z = getElementPosition(v) local mix,miy,miz,max,may,maz = getElementBoundingBox(v) local x1,y1 = getScreenFromWorldPosition(mix+x,miy+y,miz+z) local x2,y2 = getScreenFromWorldPosition(max+x,may+y,maz+z) dxDrawLine(x1,y1,x2,y2,tocolor(255,0,0,255)) end end addEventHandler("onClientRender", root, render)
Gallardo9944 Posted February 9, 2015 Posted February 9, 2015 You can use dxDrawLine3D without getScreenFromWorldPosition. Code Debugger - Minimalistic MTA debug line replacement
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