Jump to content

blip visible map


OrbTanT

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...