boro Posted October 6, 2014 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 )
Mr_Moose Posted October 6, 2014 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.
boro Posted October 6, 2014 Author 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 )
Mr_Moose Posted October 6, 2014 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.
boro Posted October 6, 2014 Author 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.
lcd1232 Posted October 6, 2014 Posted October 6, 2014 https://wiki.multitheftauto.com/wiki/Ge ... BoundToKey
Anubhav Posted October 6, 2014 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)
FIY9AL Posted June 18, 2021 Posted June 18, 2021 addEventHandler("onClientKey", root, function(button) if (button == "F1") then cancelEvent() end end )
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