Jump to content

help pls .


Recommended Posts

as I can get the name tag also unseen

:(

local groups = { "Admin" } --Groups are allowed to use the invisibility 
     
     
blip = { } 
  
function toggleInvis ( source ) 
    local nameTag = getPlayerNametagText ( source ) 
    if ( source and getElementType ( source ) == "player" and hasPlayerAccessToInvisible (source) == true ) then 
        if ( getElementAlpha ( source ) > 200 ) then 
            setPlayerNametagShowing ( source, false ) 
            setElementAlpha ( source, 0 ) 
            local attachedElements = getAttachedElements ( source ) 
            for ElementKey, ElementValue in ipairs ( attachedElements ) do 
                if ( getElementType ( ElementValue ) == "blip" ) then 
                    destroyElement ( ElementValue ) 
                end 
            end 
            outputChatBox ( "#00ffff|Mod| #00FF00Invisible Activado", source, 0, 255, 0, true ) 
        else 
            setPlayerNametagShowing ( source, true ) 
            setElementAlpha ( source, 255 ) 
            local nameTag = getPlayerName ( source ) 
            local r, g, b = getPlayerNametagColor ( source ) 
            blip [ source ] = createBlipAttachedTo ( source, 0, 2, r, g, b, 255 ) 
            outputChatBox ( "#00ffff|Mod| #00FF00Invisible Desactivado", source, 0, 255, 0, true ) 
        end 
    else 
        outputDebugString ( "Player: ".. nameTag .." try to use invisible, but he hasn't access to it!" ) 
    end 
end 
addCommandHandler ( "invisible", toggleInvis ) 
  
  
function hasPlayerAccessToInvisible (thePlayer) 
local allowed = false 
    if ( thePlayer ) then 
        for id, team_cur in ipairs(teams) do 
            if ( getPlayerTeam ( thePlayer ) and getTeamName ( getPlayerTeam ( thePlayer ) ) == team_cur ) then 
                allowed = true 
                break 
            end          
        end 
         
            if not(allowed == true) then 
                for id, group_cur in ipairs(groups) do 
                    if ( isObjectInACLGroup ( "user.".. getAccountName ( getPlayerAccount ( thePlayer ) ), aclGetGroup ( group_cur ) ) ) then 
                        allowed = true 
                        break 
                    end 
                end 
            end  
             
        return allowed 
    end 
end 
  
  
  
addEventHandler ( "onPlayerQuit", root, 
    function ( ) 
        if isElement ( blip [ source ] ) then  
            destroyElement ( blip [ source ] )  
        end 
    end 
) 
  
addEventHandler ( "onPlayerLogout", root, 
    function ( ) 
        if isElement ( blip [ source ] ) then  
            destroyElement ( blip [ source ] )  
        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...