Timiimit Posted February 5, 2012 Share Posted February 5, 2012 Hi! is it possible to detect object in marker? Link to comment
Kenix Posted February 5, 2012 Share 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 ) Link to comment
Timiimit Posted February 5, 2012 Author Share 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!?? Link to comment
Xeno Posted February 5, 2012 Share Posted February 5, 2012 I don't think you can attach markers. Use a col shape. Link to comment
Timiimit Posted February 5, 2012 Author Share 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)!! Link to comment
Timiimit Posted February 5, 2012 Author Share Posted February 5, 2012 i have but how to detect if its any object in marker!!!!!!! post eg. plzz. Link to comment
Kenix Posted February 5, 2012 Share 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. Link to comment
Timiimit Posted February 5, 2012 Author Share Posted February 5, 2012 it's not working!?? Link to comment
Kenix Posted February 5, 2012 Share Posted February 5, 2012 Remember is detected only mta elements( object ).If you enter the building ( not mta element ) it not detected. Use processLineOfSight. Link to comment
Timiimit Posted February 5, 2012 Author Share Posted February 5, 2012 It touched fence at begining of la airport. Link to comment
Timiimit Posted February 6, 2012 Author Share Posted February 6, 2012 well, no one knows??? Link to comment
Timiimit Posted February 6, 2012 Author Share Posted February 6, 2012 but marker hit the fence! is that mta element? Link to comment
Kenix Posted February 6, 2012 Share 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 Link to comment
myonlake Posted February 6, 2012 Share Posted February 6, 2012 GTA object: original map object. MTA object: created via a script/map editor. Link to comment
Timiimit Posted February 6, 2012 Author Share 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) Link to comment
Al3grab Posted February 6, 2012 Share Posted February 6, 2012 getDistanceBetweenPoints3D Link to comment
Timiimit Posted February 6, 2012 Author Share 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!! Link to comment
Castillo Posted February 7, 2012 Share Posted February 7, 2012 This could help maybe? https://wiki.multitheftauto.com/wiki/OnPlayerContact Link to comment
Kenix Posted February 7, 2012 Share 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. Link to comment
Timiimit Posted February 7, 2012 Author Share 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 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