Jump to content

Key Binding/Unbinding


.:HyPeX:.

Recommended Posts

Posted

Well the key wasnt unbided.. i can always press it..

                   if dist <= 5 then 
                    if not getKeyBoundToFunction(ShowJoin) then 
                    bindKey("F", "down", ShowJoin) 
                    end 
                    local scx2, scy2 = getScreenFromWorldPosition ( PedX, PedY, PedZ + 1, -50, true ) 
                    local alpha2 = 255 
                    dxDrawText ( "#66ffaaPress #ffffffF #66ffaaTo join", scx2, scy2, scx2, scy2, tocolor ( r, g, b, alpha2 ), MyScale, font, "center", "center",false,false,false,true ) 
                    else 
                    if getKeyBoundToFunction(ShowJoin) == "F" then 
                    unbindKey("F","down",ShowJoin) 
                    end 
                    end     
  

Posted
You bind it then unbind it on each render??

Not really, it will only unbind it IF it is bound, and it will only bind it IF it is unbound (Note that dist is distance to a ped)

Fixed it by removing the "F" Thingy on the getKeyBound..

Thanks Anyways

HyPeX

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