3B00DG4MER Posted March 23, 2014 Share Posted March 23, 2014 Hello,Today i want to Change Model of Marker if There is ID of Marker Need Help !! Link to comment
Castillo Posted March 23, 2014 Share Posted March 23, 2014 There are few type of markers: "cylinder", "corona", "checkpoint". Link to comment
3B00DG4MER Posted March 23, 2014 Author Share Posted March 23, 2014 There are few type of markers: "cylinder", "corona", "checkpoint". No,i want to Replace the Model Link to comment
3B00DG4MER Posted March 23, 2014 Author Share Posted March 23, 2014 There are few type of markers: "cylinder", "corona", "checkpoint". So,no one Know i want to Say Like this Link to comment
WhoAmI Posted March 23, 2014 Share Posted March 23, 2014 That marker is made by dxDrawLine functions. Link to comment
3B00DG4MER Posted March 23, 2014 Author Share 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 Link to comment
WhoAmI Posted March 23, 2014 Share Posted March 23, 2014 That is mainly math and trigonometric functions. Link to comment
WASSIm. Posted March 23, 2014 Share Posted March 23, 2014 use DxDrawCircle and make it line 3D Link to comment
3B00DG4MER Posted March 23, 2014 Author Share Posted March 23, 2014 use DxDrawCircle and make it line 3D But,How do i replace the Marker with dx ? Link to comment
WhoAmI Posted March 23, 2014 Share Posted March 23, 2014 That's too hard for you. You shall start from easier things. Start from beginning. Link to comment
xXMADEXx Posted March 23, 2014 Share 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. Link to comment
50p Posted March 23, 2014 Share 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. Link to comment
kevenvz Posted March 23, 2014 Share 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.) Link to comment
3B00DG4MER Posted March 23, 2014 Author Share 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 ? Link to comment
WhoAmI Posted March 23, 2014 Share 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. Link to comment
50p Posted March 23, 2014 Share Posted March 23, 2014 Or create a marker and set it's alpha to 0. Link to comment
3B00DG4MER Posted March 23, 2014 Author Share 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 Link to comment
50p Posted March 23, 2014 Share 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. Link to comment
3B00DG4MER Posted March 23, 2014 Author Share 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 ? Link to comment
Spajk Posted March 24, 2014 Share 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 ) Link to comment
3B00DG4MER Posted March 24, 2014 Author Share 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 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