AMARANT Posted April 20, 2012 Share Posted April 20, 2012 Is there any way to check if an object hits a marker? Because the code below doesn't work. myMarker = createMarker(2228.75,-2240.57,14.29,"cylinder",2.0,255,0,0,125) addEventHandler( "onMarkerHit",myMarker, function( hitElement,matchingDimension ) if getElementType( hitElement ) == "object" then outputChatBox( "Object hit marker" ) end end ) Link to comment
AMARANT Posted April 20, 2012 Author Share Posted April 20, 2012 Unfortunately, the same thing Link to comment
Castillo Posted April 20, 2012 Share Posted April 20, 2012 I've tested your code with a object moving by moveObject and it didn't output anything, maybe is bugged? Link to comment
Kenix Posted April 20, 2012 Share Posted April 20, 2012 AMARANT, Report in bug tracker. Link to comment
AMARANT Posted April 20, 2012 Author Share Posted April 20, 2012 So as of today there is no way I can check it, can I? Link to comment
Michael# Posted April 20, 2012 Share Posted April 20, 2012 I have done this and this works! You can trigger the "onMarkerHit" or "onCopShapeHit" event by attach an vehicle (like the tiny RC-Cam(594) to the object and sit a invisible PED into it, then the PED does trigger the event Link to comment
Puma Posted April 21, 2012 Share Posted April 21, 2012 An object doesn't move like a vehicle does, it only changes position (first it is at position A and then on position B, while a vehicle moves from A to B). That's why it doesn't work and never will work. The only way to make it work is using a colshape OR adding a colshape and checking all elements in the colshape repeatedly at a high rate, using a timer or (clientside) using render, so you can't miss it if an element suddenly entered the marker. https://wiki.multitheftauto.com/wiki/Get ... inColShape 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