Jump to content

Give something a name?


Recommended Posts

Hi,

So I was wondering how to give something a name, (thats the best way I can describe it!), e.g.

missesveh = createVehicle(blah) 

Then when that vehicle hits the marker (only that vehicle), the vehicle is destroyed e.g.

  
if missesveh then 
      destroyElement(missesveh) 
addEventHandler("onMarkerHit", completionmarker, etc) 

how would I do that?

Thanks Lloyd

Link to comment

You mean this?

tempVehicle = createVehicle ( args... ) 
tempMarker = createMarker ( args... ) 
  
addEventHandler ( "onMarkerHit", tempMarker, 
    function ( hitElement ) 
        if ( hitElement == tempVehicle ) then 
            destroyElement ( hitElement ) 
        end 
    end 
) 

Link to comment
You mean this?
tempVehicle = createVehicle ( args... ) 
tempMarker = createMarker ( args... ) 
  
addEventHandler ( "onMarkerHit", tempMarker, 
    function ( hitElement ) 
        if ( hitElement == tempVehicle ) then 
            destroyElement ( hitElement ) 
        end 
    end 
) 

That's exactly what i mean! Thank you.

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