Jump to content

bindKey and unbindKey is bad argument


#RooTs

Recommended Posts

Posted

I've tried everything and could not :(:(:(:(

function Enter ( ) 
    if getPedOccupiedVehicle(localPlayer) == 0 then 
        bindKey ( localPlayer, "f5", "down", abrir ) 
        outputChatBox ( "#ff0000painel f5.", root, 124, 252, 0, true ) 
    end 
end 
  
addEventHandler ( "onClientVehicleEnter", getRootElement(), Enter ) 
  
function Exit ( ) 
        unbindKey ( Player, "f5", "down", abrir ) 
end 
addEventHandler ( "onClientVehicleExit", getRootElement(), Exit ) 

 DUyJ810.gif

Posted

If you're using localPlayer variable I assume the code is client side. bindKey clientside does not take first argument as the player who's key to bind.

Just remove "localPlayer" argument from first argument.

Previously known as MrTasty.

Posted
function aBind (   ) 
        if ( eventName == 'onClientVehicleEnter' ) then 
            bindKey ( 'F5','down',abrir ) 
            outputChatBox ( '#ff0000painel f5.', 124, 252, 0, true ) 
        else 
            unbindKey ( 'F5','down',abrir ) 
    end 
end  
addEventHandler ( 'onClientVehicleEnter',root,aBind ) 
addEventHandler ( 'onClientVehicleExit',root,aBind ) 

Easier for you and fixed some fucked things :D!

  

Posted
function aBind (   ) 
        if ( eventName == 'onClientVehicleEnter' ) then 
            bindKey ( 'F5','down',abrir ) 
            outputChatBox ( '#ff0000painel f5.', 124, 252, 0, true ) 
        else 
            unbindKey ( 'F5','down',abrir ) 
    end 
end  
addEventHandler ( 'onClientVehicleEnter',root,aBind ) 
addEventHandler ( 'onClientVehicleExit',root,aBind ) 

Easier for you and fixed some :o things :D!

solved, thanks Mr.Pres[T]ege and MrTasty

 DUyJ810.gif

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