Jump to content

invisible command


Bean666

Recommended Posts

is there anyway that this command will only work in a skin ID Which is 179? help please and is there also a way if the player shoots he loses his invisibility , thanks

function toggleInvis ( thePlayer )   
        if getElementAlpha( thePlayer ) == 255 then  
        setElementAlpha ( thePlayer, 0 )     
    else             
        setElementAlpha ( thePlayer, 255 )   
    end 
end 
addCommandHandler ( "invis", toggleInvis ) 

Edited by Guest
Link to comment
function invisible() 
    if getElementModel(localPlayer) == 179 then 
    setElementAlpha(localPlayer, 0) 
    end 
end 
addCommandHandler ( "invisible", invisible ) 

is there anyway that if i do the /invisible command again ill go back to the alpha 255? and btw Whoami it worked ty.
Link to comment
function invisible() 
    if getElementModel(localPlayer) == 179 then 
    setElementAlpha(localPlayer, 0) 
    end 
end 
addCommandHandler ( "invisible", invisible ) 

is there anyway that if i do the /invisible command again ill go back to the alpha 255? and btw Whoami it worked ty.

use

getElementAlpha () 

Example

function invisible() 
    if getElementModel(localPlayer) == 179 then 
      if getElementAlpha (localPlayer) == 255 then  
    setElementAlpha(localPlayer, 0) 
else 
setElementAlpha(localPlayer, 255) 
end  
    end 
end 
addCommandHandler ( "invisible", invisible ) 

Edited by Guest
Link to comment
function invisible() 
    if getElementModel(localPlayer) == 179 then 
        if getElementAlpha ~= 255 then 
        setElementAlpha(localPlayer, 255) 
        else 
        setElementAlpha(localPlayer, 0) 
        end 
    end 
end 
addCommandHandler ( "invisible", invisible ) 

Link to comment
function invisible ( player ) 
    if ( getElementModel ( player ) == 179 ) then 
        local n = ( getElementAlpha ( player ) > 0 ) and 0 or 255; 
        setElementAlpha ( player, n ); 
    end 
end 
addCommandHandler ( "invisible", invisible ) 

Link to comment
function invisible ( ) 
    if ( getElementModel ( localPlayer ) == 179 ) then 
        local n = ( getElementAlpha ( localPlayer ) > 0 ) and 0 or 255; 
        setElementAlpha ( localPlayer, n ); 
    end 
end 
addCommandHandler ( "invisible", invisible ) 

Use it client

Link to comment

Server

function toggleInvis(thePlayer) 
    local id = getElementModel(thePlayer) 
    if id == 179 then 
        local alpha = getElementAlpha(thePlayer) 
        if alpha == 255 then  
            setElementAlpha(thePlayer, 0)    
        else            
            setElementAlpha(thePlayer, 255) 
        end 
    else  
        setElementAlpha(thePlayer, 255) 
    end 
end 
addCommandHandler("invis", toggleInvis) 

Client

function showOnShoot() 
    setElementAlpha(source, 255) 
end 
addEventHandler("onClientPlayerWeaponFire", getLocalPlayer(), showOnShoot) 

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...