Apo Posted October 3, 2016 Share Posted October 3, 2016 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
Walid Posted October 3, 2016 Share Posted October 3, 2016 (edited) 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 October 3, 2016 by Walid Link to comment
Chris!i! Posted October 5, 2016 Share Posted October 5, 2016 (edited) addEventHandler("onClientMarkerHit", marker, markhit) onMarkertHit is for server side only. Edited October 5, 2016 by Chris!i! Failed on code Link to comment
iPrestege Posted October 5, 2016 Share Posted October 5, 2016 Then make it server side code. :~ 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