Jump to content

Recommended Posts

Is there a function similar to ToogleControl but with Binds?

I mean, there is such a function attached to BindKey (under the "k" key), and I would like to press the "k" function just like in ToggleControl, where we clicked eg left mouse button to shoot

 

 

Link to comment

I think you mean this 

--Server side 

 

 

function bindkeyonlogin()
  bindKey (source,"k","down",
    function(player,key,state)
      if getControlState ( player,"fire") then
         toggleControl ( player, "fire",false)
      else 
         toggleControl ( player, "fire",true)
      end
  )
end
addEventHandler ("onPlayerLogin",getRootElement(),bindkeyonlogin)

 

Link to comment

Maybe I will explain otherwise, I have equipment that I open with the "i" button

bindKey("i", "down", Inventory)

Well, when I click "i" this is all right, but I would like to click "i" with a script.

I would like to run it the same way as SetPedControlState() function

setPedControlState(localPlayer, "i", true)

But I know that this function doesn't have such a thing, that's why I'm asking if there is a similar function but with the properties I showed in the case of the SetPedControlState () function

Link to comment

I can't show the code because it has 7000 lines

 

What I mean the most is that I have equipment and when I use some things in it, I have to click "i" twice to reset and work normally, so I thought that there is a function that will make me click "bindKey"

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