robhol Posted February 6, 2009 Posted February 6, 2009 Well, how would I do this? Anybody got an example for me? Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
50p Posted February 7, 2009 Posted February 7, 2009 Within a certain line? Do you mean "on" the line? If so, you'd have to calculate the angle of that line and calculate the angle of line "starting at one of the ends of the line and ending at the place of marker" if the angle is the same it means the marker is on the line. Also, remember to check if the length between marker and "one of the ends of the line" is shorter or equal to the length of the line. Here's what I mean: if ( lineA >= lineB ) and ( angleA == angleB ) then -- the marker is on the line else -- it's not on the line end - MTA Script Editor - Ask your scripting questions properly, please. - 50p's public resources - Meta.xml - what is it for? How is it possible LOL
Gamesnert Posted February 7, 2009 Posted February 7, 2009 I think he means between two lines. So for instance: Line 1 starts on 0,0, is 50 units long, and has an angle of 23 degrees. Line 2 starts on the same position, also 50 units long, and has an angle of 50 degrees. The marker is somewhere in between. Is there a way to see if the marker is in between those two lines? (just an example of what I think he means) Projects: Slothbot | Maximap
robhol Posted February 7, 2009 Author Posted February 7, 2009 I suppose a more accurate term is if a line in 3D intersects with a marker, but it doesn't matter, I found another way to do it. Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
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