kuwalda Posted August 12, 2014 Share Posted August 12, 2014 Hello! I have very tricky problem that I can`t manage to fix, maybe someone can help me out? I will make this as basic as possible. I have 2 markers: * markerX with size of 10 * markerY with size of 50 Both markerX and markerY is attached to one object. Lets say player is in both of them - he is inside markerX and markerY. When checking isElementWithinMarker(player, markerX) and isElementWithinMarker(player, markerY) it returs that it is only inside markerY and does not recognize it is also inside of markerX. My guess it is due marker overlapping, but am I right? Any help or advices would be appriciated. Link to comment
Et-win Posted August 12, 2014 Share Posted August 12, 2014 We will need to see the script for that. Link to comment
kuwalda Posted August 12, 2014 Author Share Posted August 12, 2014 (edited) removed looks terrible in this website box, but when you copy it in notepad, it comes up real fine! Edited August 13, 2014 by Guest Link to comment
Et-win Posted August 12, 2014 Share Posted August 12, 2014 So what is the problem again? And any /debugscript 3 errors? Link to comment
xXMADEXx Posted August 12, 2014 Share Posted August 12, 2014 The problem is probably as you said due to overlapping the markers. However, there could be a method to do as you wish. You could do some type of a code like this: local m1 = createMarker ( 0, 0, 0, "cylinder", 5, 255, 255, 255, 120 ) local m2 = createMarker ( 0, 0, 0, "cylinder", 10, 255, 0, 0, 120 ) local data = { m1 = { }, m2 = { } } addEventHandler ( "onMarkerHit", root, function ( e ) if ( source == m1 ) then data.m1 [ e ] = true elseif ( source == m2 ) then data.m2 [ e ] = true end end ) addEventHandler ( "onMarkerLeave", root, function ( e ) if ( source == m1 ) then data.m1 [ e ] = nil elseif ( source == m2 ) then data.m2 [ e ] = nil end end ) function isElementWithinMarkers ( p ) return ( data.m1[p] and data.m2[p] ) == true end 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