CITMartin Posted August 11, 2017 Share Posted August 11, 2017 function addBindServer (player, commandName, theKey, theNewCommandToAddBind) local arguments = "1 2 3 4" local theEK = bindKey (player, theKey, "down", theNewCommandToAddBind, arguments) if theEK == true then outputChatBox(tostring(theEK)) else outputChatBox(tostring(theEK)) end end addCommandHandler("addBind", addBindServer) function addBindServer (player, commandName, theKey) local theEK = unbindKey (player, theKey) if theEK == true then outputChatBox(tostring(theEK)) else outputChatBox(tostring(theEK)) end end addCommandHandler("removeBind", addBindServer) function testingFunction (player, commandName, arg1, arg2, arg3, arg4) outputChatBox(arg1) outputChatBox(arg2) outputChatBox(arg3) outputChatBox(arg4) end addCommandHandler("testing", testingFunction) When i use in chatBox for example: /addBind m testing I can add this bind with arguments, but, when i use unbindKey, the return value bool is nil. What is the problem? Also, this type of bind is erase when i stop this script. How can stand my binds? Link to comment
NeXuS™ Posted August 11, 2017 Share Posted August 11, 2017 function addBindServer (player, commandName, theKey, theNewCommandToAddBind) local arguments = {1, 2, 3, 4} local theEK = bindKey (player, theKey, "down", theNewCommandToAddBind, unpack(arguments)) if theEK == true then outputChatBox(tostring(theEK)) else outputChatBox(tostring(theEK)) end end addCommandHandler("addBind", addBindServer) Try it like this. Link to comment
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