Jump to content

question.


Sparrow

Recommended Posts

You can check an element's alpha by

getElementAlpha 

And use

function destroyBlipAttachedTo ( player ) 
    local attached = getAttachedElements ( player ) 
    if not attached then 
        return 
    end 
    for index , attachedElement in pairs ( attached ) do 
        if getElementType ( attachedElement ) == "blip" then 
            destroyElement ( attachedElement ) 
        end 
    end 
end 

Link to comment

And use

function destroyBlipAttachedTo ( player ) 
    local attached = getAttachedElements ( player ) 
    if not attached then 
        return 
    end 
    for index , attachedElement in pairs ( attached ) do 
        if getElementType ( attachedElement ) == "blip" then 
            destroyElement ( attachedElement ) 
        end 
    end 
end 

this didn't work, the blip didn't hided :(

Link to comment

my script:

function invisible(source) 
    if ( hasObjectPermissionTo ( source , "function.kickPlayer", true ) ) then 
        setPlayerNametagShowing(source, false) 
        setElementAlpha(source, 0) 
    end 
end 
addCommandHandler ( "invis", invisible ) 
  
  
function visible(source) 
    if ( hasObjectPermissionTo ( source , "function.kickPlayer", true ) ) then 
        setPlayerNametagShowing(source, true) 
        setElementAlpha(source, 255) 
    end 
end 
addCommandHandler ( "vis", visible ) 

Link to comment
function invisible(source) 
    if ( hasObjectPermissionTo ( source , "function.kickPlayer", true ) ) then 
        setPlayerNametagShowing(source, false) 
        setElementAlpha(source, 0) 
        destroyBlipAttachedTo ( source ) 
    end 
end 
addCommandHandler ( "invis", invisible ) 
  
  
function visible(source) 
    if ( hasObjectPermissionTo ( source , "function.kickPlayer", true ) ) then 
        setPlayerNametagShowing(source, true) 
        setElementAlpha(source, 255) 
       destroyBlipAttachedTo ( source ) 
    end 
end 
addCommandHandler ( "vis", visible ) 
  
  
  
  
  
  
  
function destroyBlipAttachedTo ( player ) 
    local attached = getAttachedElements ( player ) 
    if not attached then 
        return 
    end 
    for index , attachedElement in pairs ( attached ) do 
        if getElementType ( attachedElement ) == "blip" then 
             if  getElementAlpha(attachedElement)==255 then  
 setElementAlpha(attachedElement,0) 
else 
 setElementAlpha(attachedElement,255) 
end 
  
        end 
    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...