Jump to content

Blip Visibility


Modafinil

Recommended Posts

I'm trying to change the visibility of a blip, trying to make it visible to everyone except the player
pd_blip[player] = createBlipAttachedTo(player, 0, 3, 255, 0, 0, 255, 32767)
setElementVisibleTo(pd_blip[player], player, false)

the blip remains visible to the player and setElementVisibleTo returns false. Did i do something wrong?

Link to comment

u need to loop through all players and set the visibility for each player individually

pd_blip[player] = createBlipAttachedTo(player, 0, 3, 255, 0, 0, 255, 32767)

-- invisible to the player
setElementVisibleTo(pd_blip[player], player, false)

-- loop and make the blip visible to everyone except the playet
for _, otherPlayer in ipairs(getElementsByType("player")) do
    if otherPlayer ~= player then
        setElementVisibleTo(pd_blip[player], otherPlayer, true)
    end
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...