boro Posted October 6, 2014 Share Posted October 6, 2014 Hi all i have compiled script and this script have some bind keys. Is any way to cancel bindKey ? I try this but it dont work, panel is still showed.. function cancelbind ( player, key, keyState ) cancelEvent () end bindKey ( player, "f1", "down", cancelbind ) Link to comment
Mr_Moose Posted October 6, 2014 Share Posted October 6, 2014 That won't disable the keybind, only the function you just made. Use unbindKey, inside a new file that loads after your compiled file in your resource. Link to comment
boro Posted October 6, 2014 Author Share Posted October 6, 2014 Hm i try it but it still dont work function dontshowpanel( player ) unbindKey ( player, "F1", "down", dontshowpanel ) end function playerSpawn ( ) bindKey ( source, "F1", "down", dontshowpanel ) end addEventHandler ( "onPlayerSpawn", getRootElement(), playerSpawn ) Link to comment
Mr_Moose Posted October 6, 2014 Share Posted October 6, 2014 Of course it doesn't work, you need to unbind the function that was bound inside your compiled script. Try to remember it's name. Link to comment
boro Posted October 6, 2014 Author Share Posted October 6, 2014 i dont know name, it's not my script, i want only disable panel in f1, but if isn't any way for disable it so Nothing doing. Link to comment
lcd1232 Posted October 6, 2014 Share Posted October 6, 2014 https://wiki.multitheftauto.com/wiki/Ge ... BoundToKey Link to comment
Anubhav Posted October 6, 2014 Share Posted October 6, 2014 setTimer( function() for k,v in ipairs(getElementsByType("player")) do if getKeyBoundToFunction(v, "F1") then unbindKey(v, "F1") end end end , 1000, 0) Link to comment
FIY9AL Posted June 18, 2021 Share Posted June 18, 2021 addEventHandler("onClientKey", root, function(button) if (button == "F1") then cancelEvent() end end ) 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