Jump to content

Marker problem


Hero192

Recommended Posts

Just simply check if the source of your onMarkerHit event is (one of the) the marker(s) you created.

Example:

transportMarker = createMarker(0,0,5,"cylinder",5) 
  
function onHitEvent(hitElement,matchingDimension) 
    if matchingDimension then 
        if source == transportMarker then 
            -- Your code. 
        end 
    end 
end 
addEventHandler("onMarkerHit",root,onHitEvent) 

You can also do it like this i guess. (I'm not sure about this one though, I always use the upper one.)

transportMarker = createMarker(0,0,5,"cylinder",5) 
  
function onHitEvent(hitElement,matchingDimension) 
    if matchingDimension then 
               -- Your code 
    end 
end 
addEventHandler("onMarkerHit",transportMarker,onHitEvent) 

Link to post

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...