redditing Posted May 26, 2020 Posted May 26, 2020 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
Sisqo0 Posted May 27, 2020 Posted May 27, 2020 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)
redditing Posted May 27, 2020 Author Posted May 27, 2020 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
Sisqo0 Posted May 27, 2020 Posted May 27, 2020 What is the aim of using it like that..show your code and say what do you want to do.
redditing Posted May 27, 2020 Author Posted May 27, 2020 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"
Chris!i! Posted May 28, 2020 Posted May 28, 2020 you can add a command for it so people can bind the command with whatever key they are comfortable with in game using /bind key commandName addCommandHandler("inventory", inventory) 1
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now