Jump to content

help marker


Apo

Recommended Posts

hi guys please help me if player goto marker , marker is clean

and marker only show for player

function findvehs(thePlayer, commandName, id) 
        if not (id) then 
            outputChatBox("SYNTAX: /" .. commandName .. " [id]", thePlayer, 255, 194, 14) 
        else 
            local theVehicle = getElement("vehicle", tonumber(id)) 
            if theVehicle then 
                local rx, ry, rz = getVehicleRotation (theVehicle) 
                local x, y, z = getElementPosition(theVehicle) 
             
     
  
  
  
        marker = createMarker( x, y, z, "corona", 4, 255, 0, 255, 150, getRootElement(thePlayer )) 
        createBlip( x, y, z, 0, 2, 255, 0, 255, 255) 
  
            end 
        end 
    end 
end 
  
addCommandHandler("findveh", findvehs, false, false) 

Link to comment
function marker(player) 
                local x, y, z = getElementPosition(player) 
    marker = createMarker( x, y, z, "cylinder", 2, 255, 0, 0, 150, getRootElement(thePlayer )) 
        blip= createBlip( x, y, z, 0, 2, 255, 0, 255, 255) 
                 
  
end 
addCommandHandler("marker", marker) 
  
  

i need 2 help

1. I can just see marker

2. if i am near or goto marker , marker deleted

Link to comment

Hey, try this

function marker(player) 
    local x, y, z = getElementPosition(player) 
    markero = createMarker( x+5, y, z, "cylinder", 2, 255, 0, 0, 150, getRootElement()) 
    setElementVisibleTo(markero, getRootElement(), false) 
    setElementVisibleTo(markero, player, true) 
    blip= createBlipAttachedTo(markero, 0, 2, 255, 0, 255, 255) 
end 
addCommandHandler("marker", marker) 
  
function markhit (element) 
   if (source == markero) then 
   destroyElement(markero) 
   destroyElement(blip) 
   end 
end 
addEventHandler("onMarkerHit", root, markhit) 

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