3B00DG4MER Posted March 23, 2014 Posted March 23, 2014 Hello,Today i want to Change Model of Marker if There is ID of Marker Need Help !!
Castillo Posted March 23, 2014 Posted March 23, 2014 There are few type of markers: "cylinder", "corona", "checkpoint".
3B00DG4MER Posted March 23, 2014 Author Posted March 23, 2014 There are few type of markers: "cylinder", "corona", "checkpoint". No,i want to Replace the Model
3B00DG4MER Posted March 23, 2014 Author Posted March 23, 2014 There are few type of markers: "cylinder", "corona", "checkpoint". So,no one Know i want to Say Like this
3B00DG4MER Posted March 23, 2014 Author Posted March 23, 2014 And a colshape for sure. Can you help me,what i use to made it,it's look like too herd
3B00DG4MER Posted March 23, 2014 Author Posted March 23, 2014 use DxDrawCircle and make it line 3D But,How do i replace the Marker with dx ?
WhoAmI Posted March 23, 2014 Posted March 23, 2014 That's too hard for you. You shall start from easier things. Start from beginning.
xXMADEXx Posted March 23, 2014 Posted March 23, 2014 Unless you know the basics of Lua and you're a math genius, you're probably not going to figure it out.
50p Posted March 23, 2014 Posted March 23, 2014 Here is a function for you. Drawing circles in 3D world. function dxDrawCircle3D( x, y, z, radius, segments, color, width ) segments = segments or 16; -- circle is divided into segments -> higher number = smoother circle = more calculations color = color or tocolor( 255, 255, 0 ); width = width or 1; local segAngle = 360 / segments; local fX, fY, tX, tY; -- drawing line: from - to for i = 1, segments do fX = x + math.cos( math.rad( segAngle * i ) ) * radius; fY = y + math.sin( math.rad( segAngle * i ) ) * radius; tX = x + math.cos( math.rad( segAngle * (i+1) ) ) * radius; tY = y + math.sin( math.rad( segAngle * (i+1) ) ) * radius; dxDrawLine3D( fX, fY, z, tX, tY, z, color, width ); end end You can modify it to draw what you're showing on the picture easily. Haven't tested but I can't see any errors so it should work.
kevenvz Posted March 23, 2014 Posted March 23, 2014 What you also could do is a custom TXD file of an object and use onElementHit(I thought this was the event, not sure tho.)
3B00DG4MER Posted March 23, 2014 Author Posted March 23, 2014 Here is a function for you. Drawing circles in 3D world. function dxDrawCircle3D( x, y, z, radius, segments, color, width ) segments = segments or 16; -- circle is divided into segments -> higher number = smoother circle = more calculations color = color or tocolor( 255, 255, 0 ); width = width or 1; local segAngle = 360 / segments; local fX, fY, tX, tY; -- drawing line: from - to for i = 1, segments do fX = x + math.cos( math.rad( segAngle * i ) ) * radius; fY = y + math.sin( math.rad( segAngle * i ) ) * radius; tX = x + math.cos( math.rad( segAngle * (i+1) ) ) * radius; tY = y + math.sin( math.rad( segAngle * (i+1) ) ) * radius; dxDrawLine3D( fX, fY, z, tX, tY, z, color, width ); end end You can modify it to draw what you're showing on the picture easily. Haven't tested but I can't see any errors so it should work. i have understood only dxDrawCircle and color and dxDrawLine3D Does it replace the Marker ?
WhoAmI Posted March 23, 2014 Posted March 23, 2014 It doesn't. It just shows the circle on the ground. If you want to create marker, draw circle, put colshape on it and check if someone got into circle by using onColShapeHit.
3B00DG4MER Posted March 23, 2014 Author Posted March 23, 2014 Here is a function for you. Drawing circles in 3D world. function dxDrawCircle3D( x, y, z, radius, segments, color, width ) segments = segments or 16; -- circle is divided into segments -> higher number = smoother circle = more calculations color = color or tocolor( 255, 255, 0 ); width = width or 1; local segAngle = 360 / segments; local fX, fY, tX, tY; -- drawing line: from - to for i = 1, segments do fX = x + math.cos( math.rad( segAngle * i ) ) * radius; fY = y + math.sin( math.rad( segAngle * i ) ) * radius; tX = x + math.cos( math.rad( segAngle * (i+1) ) ) * radius; tY = y + math.sin( math.rad( segAngle * (i+1) ) ) * radius; dxDrawLine3D( fX, fY, z, tX, tY, z, color, width ); end end You can modify it to draw what you're showing on the picture easily. Haven't tested but I can't see any errors so it should work. There is error,Which is radius is a nil value and You haven't define it
50p Posted March 23, 2014 Posted March 23, 2014 radius is a parameter. You have to pass it when you call the function to determine how big the circle should be. Segments, color and width params are optional.
3B00DG4MER Posted March 23, 2014 Author Posted March 23, 2014 radius is a parameter. You have to pass it when you call the function to determine how big the circle should be. Segments, color and width params are optional. but it's won't work function dxDrawCircle3D( x,y,z, radius, segments, color, width ) segments = segments or 16; -- circle is divided into segments -> higher number = smoother circle = more calculations color = color or tocolor( 255, 255, 0 ); width = width or 1; local segAngle = 360 / segments; local fX, fY, tX, tY; -- drawing line: from - to for i = 1, segments do fX = 1603 + math.cos( math.rad( segAngle * i ) ) * radius; fY = -1696.3896484375 + math.sin( math.rad( segAngle * i ) ) * radius; tX = 1603 + math.cos( math.rad( segAngle * (i+1) ) ) * radius; tY = -1696.3896484375 + math.sin( math.rad( segAngle * (i+1) ) ) * radius; dxDrawLine3D( fX, fY, 5, tX, tY, 5, color, width ); end end addEventHandler("onClientResourceStart",getRootElement(),dxDrawCircle3D) i have Edit X and y and Z,Should i edit them ?
Spajk Posted March 24, 2014 Posted March 24, 2014 Try it: function dxDrawCircle3D( x, y, z, radius, segments, color, width ) segments = segments or 16; -- circle is divided into segments -> higher number = smoother circle = more calculations color = color or tocolor( 255, 255, 0 ); width = width or 1; local segAngle = 360 / segments; local fX, fY, tX, tY; -- drawing line: from - to for i = 1, segments do fX = x + math.cos( math.rad( segAngle * i ) ) * radius; fY = y + math.sin( math.rad( segAngle * i ) ) * radius; tX = x + math.cos( math.rad( segAngle * (i+1) ) ) * radius; tY = y + math.sin( math.rad( segAngle * (i+1) ) ) * radius; dxDrawLine3D( fX, fY, z, tX, tY, z, color, width ); end end addEventHandler("onClientRender", root, function() dxDrawCircle3D( 1603, -1696.4, 5, 3) end )
3B00DG4MER Posted March 24, 2014 Author Posted March 24, 2014 Try it: function dxDrawCircle3D( x, y, z, radius, segments, color, width ) segments = segments or 16; -- circle is divided into segments -> higher number = smoother circle = more calculations color = color or tocolor( 255, 255, 0 ); width = width or 1; local segAngle = 360 / segments; local fX, fY, tX, tY; -- drawing line: from - to for i = 1, segments do fX = x + math.cos( math.rad( segAngle * i ) ) * radius; fY = y + math.sin( math.rad( segAngle * i ) ) * radius; tX = x + math.cos( math.rad( segAngle * (i+1) ) ) * radius; tY = y + math.sin( math.rad( segAngle * (i+1) ) ) * radius; dxDrawLine3D( fX, fY, z, tX, tY, z, color, width ); end end addEventHandler("onClientRender", root, function() dxDrawCircle3D( 1603, -1696.4, 5, 3) end ) Thanks it's work's and thanks to #50p
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