Jump to content

is it possible...


Timiimit

Recommended Posts

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

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
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 :!:

Doesn't this detect only if you are ON element :?:

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...