'LinKin Posted December 19, 2013 Posted December 19, 2013 Hello, In MTA there are some controls called 'binds' which u can modify. I was wondering, is it possible to make a script that gets the player's binds? Is it possible to change a client's binds? In summary, is it possible to "play" with a client's binds?
Dealman Posted December 19, 2013 Posted December 19, 2013 Yes, it's possible. I did it for a small project I was working on. See this code for an example; local areHornsMuted = false local clientHornKeys = {"Empty"} local clientHorn = nil function fetchBoundHornKeys() local boundKeys = getBoundKeys("horn") if(boundKeys ~= false) then table.remove(clientHornKeys, 1) for key, state in pairs(boundKeys) do table.insert(clientHornKeys, key) end else outputChatBox("Horn not bound.") end end addEventHandler("onClientResourceStart", resourceRoot, fetchBoundHornKeys) function disableDefaultHorn() if(areHornsMuted == false) then toggleControl("horn", false) end end addEventHandler("onClientResourceStart", resourceRoot, disableDefaultHorn)
xXMADEXx Posted December 19, 2013 Posted December 19, 2013 It's possible to get binds of course, but not set them to the client's settings. You can only set them for inside your server with bindKey.
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