OrbTanT Posted July 25, 2014 Share Posted July 25, 2014 I am putting a script to show the blips, both on the map of the f11 as well as in radar, to only show the blips that are 250 away from the player, the more is not working, can someone help. client- addEventHandler("onClientResourceStart", resourceRoot, function() setTimer(function() local localX, localY = getElementPosition(localPlayer) for _, blip in pairs(getElementsByType("blip")) do local blipX, blipY = getElementPosition(blip) if(getDistanceBetweenPoints2D(localX, localY, blipX, blipY) > 250) then setElementAlpha(blip, 0) else setElementAlpha(blip, 255) end end end, 500, 0) end) Has no error in debugscript 3. Link to comment
Ab-47 Posted July 25, 2014 Share Posted July 25, 2014 Dude -.- wouldn't it save you a heck lot of time if you used; setBlipVisibleDistance ?? Link to comment
OrbTanT Posted July 26, 2014 Author Share Posted July 26, 2014 Yes more I can't think of a way to use setBlipVisibleDistance, to work on a map of f11 and for all the blips Link to comment
OrbTanT Posted July 26, 2014 Author Share Posted July 26, 2014 How can I set to destroy the blips that are outside of the 250 in getDistanceBetweenPoints2D and recreate the blips again when re-enters the range of 250, I tried to and not work, at least does not work with the map of f11 ta full of blips addEventHandler("onClientResourceStart", resourceRoot, function() setTimer(function() local localX, localY = getElementPosition(localPlayer) for _, blip in pairs(getElementsByType("blip")) do local blipX, blipY = getElementPosition(blip) if(getDistanceBetweenPoints2D(localX, localY, blipX, blipY) > 250) then setBlipVisibleDistance(blip, 500) destroyElement ( blip ) end end end, 500, 0) 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