Jump to content

help a bit.


Bean666

Recommended Posts

Posted (edited)

why when i step on the marker with a vehicle it still destroys the marker? all i want is if i'm in a vehicle it will not destroy the marker.

this is the function.

function crtmarker ( ) 
    marker = createMarker ( x, y, z, "cylinder", 1.5, 255, 255, 255, 255 ) 
addEventHandler ( "onMarkerHit", marker, MarkerHit ) 
end 


function MarkerHit (hitPlayer, matchingDimension) 
local player = getPedOccupiedVehicle(hitPlayer)
if (player) then
return end
destroyElement(marker) 
end

 

Edited by Shaman123
Posted
marker = createMarker ( x,y,z,'cylinder',1.5,255,255,255,255 ) 

addEventHandler ( 'onMarkerHit',marker,
	function ( element )
		if element and getElementType ( element ) == 'player' then
			if not isPedInVehicle ( element ) then
				destroyElement ( source )
			end
		end
	end
)

 

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