Crosshair Posted June 28, 2012 Share Posted June 28, 2012 Hello guys. I tried to make a job and i run in some issues. function enter(thePlayer) marker = createMarker(2809, -2474, 13, "cylinder", 2, 248, 211, 6, 153, thePlayer) blip = createBlip(2809, -2474, 13, 0) addEventHandler("onMarkerHit", marker, marcar) end addEventHandler ( "onVehicleEnter", getRootElement(), enter ) function marcar(thePlayer) destroyElement(marker) destroyElement(blip) end I simplify the code to this. The problem is with destroyElement of course. Bad 'element' pointer @ 'destroyElement'(1) marker and blip is gone but i want to get rid of this warning. Link to comment
Guest Guest4401 Posted June 28, 2012 Share Posted June 28, 2012 function marcar(thePlayer) if isElement(marker) then destroyElement(marker) end if isElement(blip) then destroyElement(blip) end end Link to comment
TAPL Posted June 28, 2012 Share Posted June 28, 2012 function enter(thePlayer) marker = createMarker(2809, -2474, 13, "cylinder", 2, 248, 211, 6, 153, thePlayer) blip = createBlip(2809, -2474, 13, 0) addEventHandler("onMarkerHit", marker, marcar) end addEventHandler("onVehicleEnter", root, enter) function marcar(thePlayer) if isElement(marker) then removeEventHandler("onMarkerHit", marker, marcar) destroyElement(marker) end if isElement(blip) then destroyElement(blip) 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