Jump to content

Binds


marcineg

Recommended Posts

Quote

Note: unbindKey will only work on binds that were added by the same resource

local playerBinds = {}

function controlBinds(bool)
	if not bool then
		for key,value in pairs(alfabetLacinski) do
			local cmds = getCommandsBoundToKey(key,"down")
				for k,cmd in pairs(cmds) do
					local bind = getBoundKeys(k)
					for l,j in pairs(bind) do
					table.insert(playerBinds,{key=l, state=j,cmd=k})
					unbindKey(l)
					print("UNBIND: "..l)
					end
				end
			end
	else
-- BIND
	end
end

I used toggleControl and setControlState to unbind the key, but it only unbinded the default bind eg chatbox. Player binds such as admin panel still etc.

Link to comment
1 hour ago, marcineg said:

Player binds such as admin panel still etc.

22 hours ago, Tails said:

you may also want to cancel the onClientKey event.

Cancel this event

addEventHandler("onClientKey", root, function()	cancelEvent() end)

 

Edited by Tails
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...