Timiimit Posted February 5, 2012 Posted February 5, 2012 Hi! is it possible to detect object in marker?
Kenix Posted February 5, 2012 Posted February 5, 2012 yes local marker = createMarker( 0,0,0 ) local obj = createObject( 1337,0,0,0 ) addCommandHandler( 'detect', function( ) if isElementWithinMarker( obj,marker ) then outputChatBox ( 'object in marker' ) end end )
Timiimit Posted February 5, 2012 Author Posted February 5, 2012 no. I attached marker to ped that it follows the ped. now i must detect if anyobject is in marker not only one specified. can i make this with "for" function? if yes how!??
Xeno Posted February 5, 2012 Posted February 5, 2012 I don't think you can attach markers. Use a col shape.
Timiimit Posted February 5, 2012 Author Posted February 5, 2012 but i have attach them and it worked!!! i just want to know how to detect if is any object in marker(not only one specified)!!
Timiimit Posted February 5, 2012 Author Posted February 5, 2012 i have but how to detect if its any object in marker!!!!!!! post eg. plzz.
Kenix Posted February 5, 2012 Posted February 5, 2012 Server addEventHandler( 'onMarkerHit',marker, -- marker variable function( element,dim ) if getElementType( element ) == 'object' then outputChatBox( 'object detected' ) end end ) Remember is detected only mta elements( object ). If you enter the building ( not mta element ) it not detected. Use processLineOfSight.
Kenix Posted February 5, 2012 Posted February 5, 2012 Remember is detected only mta elements( object ).If you enter the building ( not mta element ) it not detected. Use processLineOfSight.
Timiimit Posted February 5, 2012 Author Posted February 5, 2012 It touched fence at begining of la airport.
Timiimit Posted February 6, 2012 Author Posted February 6, 2012 but marker hit the fence! is that mta element?
Kenix Posted February 6, 2012 Posted February 6, 2012 (edited) but marker hit the fence! is that mta element? If this 'fence' is mta element then it detected or otherwise not detected. If not detected you need use https://wiki.multitheftauto.com/wiki/ProcessLineOfSight and scan radius in onClientRender event. Edited February 7, 2012 by Guest
myonlake Posted February 6, 2012 Posted February 6, 2012 GTA object: original map object. MTA object: created via a script/map editor.
Timiimit Posted February 6, 2012 Author Posted February 6, 2012 then what can i use to detect GTA and MTA objects? mabye onPedContactElement ( i have ped and what to detect when he comes close to object or any other element)
Timiimit Posted February 6, 2012 Author Posted February 6, 2012 and how i I supposed to do this???????? i want to detect not only betwen two points!!!! I want to detect if ped hit anything(mta and gta objects) or if is close to anything!!
Castillo Posted February 7, 2012 Posted February 7, 2012 This could help maybe? https://wiki.multitheftauto.com/wiki/OnPlayerContact
Kenix Posted February 7, 2012 Posted February 7, 2012 but marker hit the fence! is that mta element? If this 'fence' is mta element then it detected or otherwise not detected. If not detected you need use https://wiki.multitheftauto.com/wiki/ProcessLineOfSight and scan radius in onClientRender event.
Timiimit Posted February 7, 2012 Author Posted February 7, 2012 but marker hit the fence! is that mta element? If this 'fence' is mta element then it detected or otherwise not detected. If not detected you need use https://wiki.multitheftauto.com/wiki/ProcessLineOfSight and scan radius in onClientRender event. I don't know how to use This could help maybe?https://wiki.multitheftauto.com/wiki/OnPlayerContact Doesn't this detect only if you are ON element
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