Deepu Posted February 21, 2014 Share Posted February 21, 2014 how do I destroy blip? please tell function requestNewMarkers () local poopMarkers = { {1816.8000488281, -2517.1000976563, 12.60000038147}, {-1348.6999511719, -235, 13.199999809265}, {416.20001220703, 2503.8000488281, 15.5}, {1572.0999755859, 1472.1999511719, 10.800000190735}, } local x,y,z = unpack(poopMarkers[math.random(#poopMarkers)]) reach = createMarker(x,y,z) guiSetVisible(jobWindow, false) local blip = createBlipAttachedTo(reach, 51) end function LS (hitElement) if source == reach then if hitElement == thePlayer then triggerServerEvent("onChakka", thePlayer, "yokohama") destroyElement(reach) setTimer(requestNewMarkers, 5000, 1) destroyElement(blip) end end end addEventHandler("onClientMarkerHit", getRootElement(), LS) Link to comment
Anubhav Posted February 21, 2014 Share Posted February 21, 2014 function requestNewMarkers () local poopMarkers = { {1816.8000488281, -2517.1000976563, 12.60000038147}, {-1348.6999511719, -235, 13.199999809265}, {416.20001220703, 2503.8000488281, 15.5}, {1572.0999755859, 1472.1999511719, 10.800000190735}, } local x,y,z = unpack(poopMarkers[math.random(#poopMarkers)]) reach = createMarker(x,y,z) guiSetVisible(jobWindow, false) local blipD = createBlipAttachedTo(reach, 51) end function LS (hitElement) if source == reach then if hitElement == thePlayer then triggerServerEvent("onChakka", thePlayer, "yokohama") destroyElement(reach) setTimer(requestNewMarkers, 5000, 1) setBlipSize(blipD,0) end end end addEventHandler("onClientMarkerHit", getRootElement(), LS) Link to comment
Deepu Posted February 21, 2014 Author Share Posted February 21, 2014 bad argument at setblip size cuz 0 can't be possible Link to comment
manve1 Posted February 21, 2014 Share Posted February 21, 2014 function requestNewMarkers () local poopMarkers = { {1816.8000488281, -2517.1000976563, 12.60000038147}, {-1348.6999511719, -235, 13.199999809265}, {416.20001220703, 2503.8000488281, 15.5}, {1572.0999755859, 1472.1999511719, 10.800000190735}, } local x,y,z = unpack(poopMarkers[math.random(#poopMarkers)]) reach = createMarker(x,y,z) guiSetVisible(jobWindow, false) blipD = createBlipAttachedTo(reach, 51) end function LS (hitElement) if source == reach then if hitElement == thePlayer then triggerServerEvent("onChakka", thePlayer, "yokohama") destroyElement(reach) setTimer(requestNewMarkers, 5000, 1) if isElement(blipD) then destroyElement(blipD) end end end end addEventHandler("onClientMarkerHit", getRootElement(), LS) Link to comment
Karuzo Posted February 21, 2014 Share Posted February 21, 2014 Just put the local in front of blipD away and it should work. Link to comment
Deepu Posted February 21, 2014 Author Share Posted February 21, 2014 thanks manv It worked by the way, what did you do? is it the same "destroyElement(blipD)" ? Link to comment
Saml1er Posted February 21, 2014 Share Posted February 21, 2014 thanks manvIt worked by the way, what did you do? is it the same "destroyElement(blipD)" ? He just removed local because when you add local then the variable will exist inside that function only, you cannot use it outside the function nor in any other function so he removed it and now it exists outside the function as well, that's why you're able to destroy it. Link to comment
Deepu Posted February 21, 2014 Author Share Posted February 21, 2014 SO I CANT USE IT GLOBALLY? should I use as a local function? Link to comment
Karuzo Posted February 21, 2014 Share Posted February 21, 2014 No, he means you should use it global, otherwise you couldn't use it in your LS Func, 'cause the blip was created locally in the function and the LS function won't know that there is this blip. 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