Jump to content

Marker Help


mint3d

Recommended Posts

Ok I have this and I want to know how to destroy it with the command /deletemarker

function CreateFinishingMarker ( thePlayer, commandName ) 
   if ( thePlayer ) then 
      local x, y, z = getElementPosition ( thePlayer )  
       
      local theMarker = createMarker ( x + 2, y + 2, z, "cylinder", 1.5, 255, 255, 0, 170 ) 
      if ( theMarker ) then  
         outputConsole ( "Marker created successfully", thePlayer ) 
      else 
         outputConsole ( "Failed to create marker", thePlayer ) 
      end 
   end 
end 
addCommandHandler ( "createmarker", CreateMarker ) 

Link to comment
function CreateFinishingMarker( thePlayer, commandName ) 
    if thePlayer then 
        local x, y, z = getElementPosition( thePlayer ) 
        theMarker = createMarker( x + 2, y + 2, z, "cylinder", 1.5, 255, 255, 0, 170 ) 
        if theMarker then 
            addCommandHandler( "destroymarker", destroy ) 
            outputConsole( "Marker created successfully", thePlayer ) 
        else 
            outputConsole( "Failed to create marker", thePlayer ) 
        end 
    end 
end 
addCommandHandler ( "createmarker", CreateFinishingMarker ) 
  
function destroy( ) 
    destroyElement( theMarker ) 
    removeCommandHandler( "destroymarker", destroy ) 
end 

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