Jump to content

help :(


Recommended Posts

as I can

make the visión

Night is not removed

when the player aims

with a gun

function nightvision() 
    lTeam = getPlayerTeam(localPlayer) 
    if (lTeam and getTeamName(lTeam) == "Team") then 
        if (getCameraGoggleEffect() == "normal") then 
            setCameraGoggleEffect("nightvision") 
        elseif (getCameraGoggleEffect() == "nightvision") then 
            setCameraGoggleEffect("normal") 
        end 
    end 
end 
addEventHandler("onClientResourceStart", resourceRoot, nightvision ) 

Link to comment
as I can

make the visión

Night is not removed

when the player aims

with a gun

function nightvision() 
    lTeam = getPlayerTeam(localPlayer) 
    if (lTeam and getTeamName(lTeam) == "Team") then 
        if (getCameraGoggleEffect() == "normal") then 
            setCameraGoggleEffect("nightvision") 
        elseif (getCameraGoggleEffect() == "nightvision") then 
            setCameraGoggleEffect("normal") 
        end 
    end 
end 
addEventHandler("onClientResourceStart", resourceRoot, nightvision ) 

function nightvision ( target ) 
    if getElementType ( target ) == "player" then 
        lTeam = getPlayerTeam(localPlayer) 
    if (lTeam and getTeamName(lTeam) == "Team") then 
        if (getCameraGoggleEffect() == "normal") then 
            setCameraGoggleEffect("nightvision") 
        elseif (getCameraGoggleEffect() == "nightvision") then 
            setCameraGoggleEffect("normal") 
        end 
    end 
end 
         end 
addEventHandler ( "onClientPlayerTarget", getRootElement(), nightvision) 

You mean this??

Link to comment
I mean

when the player

press right click

Night visión is removed

as I can avoid removing

Night Visión

function nightvision ( target ) 
    if getElementType ( target ) == "player" then 
        lTeam = getPlayerTeam(localPlayer) 
    if (lTeam and getTeamName(lTeam) == "Team") then 
        if (getCameraGoggleEffect() == "normal") then 
            setCameraGoggleEffect("nightvision") 
        elseif (getCameraGoggleEffect() == "nightvision") then 
            setCameraGoggleEffect("normal") 
        end 
    end 
end 
         end 
addEventHandler ( "onClientPlayerTarget", getRootElement(), nightvision) 

Then this should work. Test it.

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