Jump to content

Help sniper mta dayz ( me ajudem pfv)


Recommended Posts

Bom estou tendo o seguinte problema com as sniper da minha gm quando miro rapido a textura da arma fica na frente, me passaram esse codigo deu certo por enquanto mira rapido o bug volta 

 

local alpha = 255 bindKey ( "aim_weapon", "both", function ( _, state ) if getPedWeaponSlot ( localPlayer ) == 6 then if ( state == "down" ) then alpha = 0 elseif ( state == "up" ) then alpha = 255 end for _, v in ipairs ( getElementsByType ( "object", root, true ) ) do if isElementAttachedToBone ( v ) then local id = getElementModel ( v ) if ( id == 2584 ) setElementAlpha ( v, alpha ) end end en

 

 

https://imgur.com/a/aZvvU

Well I'm having the following problem with my gm's sniper when I aim quickly, the texture of the weapon is in front, they gave me this code it worked for now, quickly aim the bug back.

Link to comment
  • Other Languages Moderators

E aí, @Kelvenbrryan!

Corrigi o código pra você.

local alpha = 255
bindKey ( "aim_weapon", "both", function ( _, state )
    if getPedWeaponSlot ( localPlayer ) == 6 then
        if ( state == "down" ) then
            alpha = 0
        elseif ( state == "up" ) then
            alpha = 255
        end
        for _, v in ipairs ( getElementsByType ( "object", root, true ) ) do
            if isElementAttachedToBone ( v ) then
                local id = getElementModel ( v )
                if ( id == 2584 ) then
                    setElementAlpha ( v, alpha )
                    setElementDimension(v, alpha == 0 and 9999 or getElementDimension(localPlayer))
                end
            end
        end
    end
end

Peço que por favor, nas próximas vezes que postar algo, use a ferramenta Code (<>) e indente o seu código.

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