Jump to content

help


Apo

Recommended Posts

hi guys please help me for fix markerhit

 

 

client

marker = nil
blip = nil
function redpoint()

				marker = createMarker(  842.9404296875, -1859.5, 12.8671875, "cylinder", 2, 255, 0, 0, 255,getRootElement(localPlayer))
				blip= createBlipAttachedTo(marker, 0, 4, 255, 0, 0, 255)
				setElementVisibleTo(marker, getRootElement(localPlayer), false)
			setElementVisibleTo(marker, localPlayer, true)
			end
addCommandHandler("marker",redpoint)		



function markhit (element)
if element and getElementType ( element ) == 'player' then 
       if (source ==  marker) then
       destroyElement( marker)
       destroyElement( blip)
	   marker = nil
	   blip = nil
       end
	   end
    end
    addEventHandler("onMarkerHit", marker, markhit)			

 

Link to comment

Try this: (untested)

function redpoint(player)
    local marker = createMarker(  842.9404296875, -1859.5, 12.8671875, "cylinder", 2, 255, 0, 0, 255)
    local blip = createBlipAttachedTo(marker, 0, 4, 255, 0, 0, 255)
    setElementVisibleTo(marker, player, true)
    setElementVisibleTo(marker, root, false)
    addEventHandler("onMarkerHit", marker, markhit)		
end
addCommandHandler("marker",redpoint)		

function markhit (element)
	if element and getElementType ( element ) == "player" then 
        local blip = getElementAttachedTo (source)
        if (blip) then
            destroyElement(blip)
        end
        destroyElement(source)
    end
end

 

Edited by Walid
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...