Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- localPlayer=getLocalPlayer()
- local color = tocolor(255,0,255,255)
- function getPositionInFrontOfElement(element,x,y,z)
- -- Get the matrix
- local matrix = getElementMatrix ( element )
- -- Get the transformation of a point 5 units in front of the element
- local offX = x * matrix[1][1] + y * matrix[2][1] + z * matrix[3][1] + matrix[4][1]
- local offY = x * matrix[1][2] + y * matrix[2][2] + z * matrix[3][2] + matrix[4][2]
- local offZ = x * matrix[1][3] + y * matrix[2][3] + z * matrix[3][3] + matrix[4][3]
- --Return the transformed point
- return offX, offY, offZ
- end
- addEventHandler("onClientPreRender",getRootElement(),function(timeslice)
- local x1,y1,z1 = getPositionInFrontOfElement(localPlayer,6,-6,0)
- local x2,y2,z2 = getPositionInFrontOfElement(localPlayer,6,6,0)
- local x3,y3,z3 = getPositionInFrontOfElement(localPlayer,-6,-6,0)
- local x4,y4,z4 = getPositionInFrontOfElement(localPlayer,-6,6,0)
- local xx,yy,zz = getElementPosition(localPlayer)
- z1 = getGroundPosition(x1,y1,z1)+1
- z2 = getGroundPosition(x2,y2,z2)+1
- z3 = getGroundPosition(x3,y3,z3)+1
- z4 = getGroundPosition(x4,y4,z4)+1
- dxDrawLine3D(x1,y1,z1,x2,y2,z2,color,10,1,1,1)
- dxDrawLine3D(x2,y2,z2,x4,y4,z4,color,10,1,1,1)
- dxDrawLine3D(x3,y3,z3,x1,y1,z1,color,10,1,1,1)
- dxDrawLine3D(x4,y4,z4,x3,y3,z3,color,10,1,1,1)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement