Jump to content

[HELP]


Recommended Posts

The bottom line would be that if a player goes into the MArker, the given marker disappears, but the Destroyelement does not recognize the playerMarker element
 
 
 
-- Server Side
addEventHandler("onPlayerQuit", root,
	function()
		if isElement(vehicle[source]) then
			destroyElement(vehicle[source])
			vehicle[source] = nil
	end
end)

vehicle = {}

addEvent("car", true)
addEventHandler("car", root,
    function()
        if isElement(vehicle[source]) then destroyElement(vehicle[source]) end
        local x, y, z = getElementPosition(source)
        vehicle[source] = createVehicle(579, 341.7890625, -1373.0964355469, 14.366669654846, 0, 380, 470) --599 is the vehicle's hands. Put any vehicle you want
        warpPedIntoVehicle(source, vehicle[source])
        playerMarker = createMarker(313.41094970703, -1394.2287597656, 13.993467330933, "cylinder", 4, 255, 0, 0, 0)
        addEventHandler("onMarkerHit", playerMarker, handlePlayerMarker)
end)

function handlePlayerMarker(hitElement)
    local elementType = getElementType(hitElement)
    destroyElement(playerMarker)
end

 

Link to comment
1 hour ago, Firespider said:
The bottom line would be that if a player goes into the MArker, the given marker disappears, but the Destroyelement does not recognize the playerMarker element
 
 
 
-- Server Side
addEventHandler("onPlayerQuit", root,
	function()
		if isElement(vehicle[source]) then
			destroyElement(vehicle[source])
			vehicle[source] = nil
	end
end)

vehicle = {}

addEvent("car", true)
addEventHandler("car", root,
    function()
        if isElement(vehicle[source]) then destroyElement(vehicle[source]) end
        local x, y, z = getElementPosition(source)
        vehicle[source] = createVehicle(579, 341.7890625, -1373.0964355469, 14.366669654846, 0, 380, 470) --599 is the vehicle's hands. Put any vehicle you want
        warpPedIntoVehicle(source, vehicle[source])
        playerMarker = createMarker(313.41094970703, -1394.2287597656, 13.993467330933, "cylinder", 4, 255, 0, 0, 0)
        addEventHandler("onMarkerHit", playerMarker, handlePlayerMarker)
end)

function handlePlayerMarker(hitElement)
    local elementType = getElementType(hitElement)
    destroyElement(playerMarker)
end

 

addEventHandler("onPlayerMarkerHit", getRootElement(),
	function( mFirstMis, matchingDimension )
		if (matchingDimension) then
			destroyElement( mFirstMis )
			destroyElement( bFirstMis )
	end
end)

try this  
Replace what you have and try

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