AMARANT Posted April 20, 2012 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 )
Kenix Posted April 20, 2012 Posted April 20, 2012 Try use colshape. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
Castillo Posted April 20, 2012 Posted April 20, 2012 I've tested your code with a object moving by moveObject and it didn't output anything, maybe is bugged? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Kenix Posted April 20, 2012 Posted April 20, 2012 AMARANT, Report in bug tracker. http://vk.com/the_kenix Вопросы задавайте на форуме, не пишите мне в личку. Please don't pm me.
AMARANT Posted April 20, 2012 Author Posted April 20, 2012 So as of today there is no way I can check it, can I?
Michael# Posted April 20, 2012 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
Puma Posted April 21, 2012 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 "The total IQ of the world is a constant. The more people, the more idiots." - Anonymous.
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