Bean666 Posted January 28, 2017 Share Posted January 28, 2017 (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 January 28, 2017 by Shaman123 Link to comment
iPrestege Posted January 28, 2017 Share Posted January 28, 2017 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 ) Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now