FuriouZ Posted September 29, 2013 Share Posted September 29, 2013 Hey! I have a question, how to bind key like scoreboard ? I mean how to do that if i hold eg: x down,then it shows gui and if i release button then it hides a gui ? I hope that you understang, what i mean and thanks Link to comment
glowdemon1 Posted September 29, 2013 Share Posted September 29, 2013 https://wiki.multitheftauto.com/wiki/BindKey Couple of examples are inside. bindKey ( player, "F1", "down", showGUI ) bindKey ( player, "F1", "up", deleteGUI ) Something like this. Link to comment
~Gangsta~ Posted September 29, 2013 Share Posted September 29, 2013 bindKey ( "--button--", "both", --function name-- ) ? Link to comment
Khalil Posted September 29, 2013 Share Posted September 29, 2013 No. Use this to show the GUI bindKey ( "--button--", "down", showGUI ) Then this to hide it bindKey ( "--button--", "up", hideGUI ) Link to comment
Castillo Posted September 29, 2013 Share Posted September 29, 2013 What's the problem of using the "both" state? Link to comment
FuriouZ Posted September 29, 2013 Author Share Posted September 29, 2013 Thanks glowdemon1 ! But i have another question too, Is possible to unbind arrow up,down,left and right onPlayerJoin ? Link to comment
glowdemon1 Posted September 29, 2013 Share Posted September 29, 2013 https://wiki.multitheftauto.com/wiki/UnbindKey - read it carefuly tho. Link to comment
FuriouZ Posted September 29, 2013 Author Share Posted September 29, 2013 https://wiki.multitheftauto.com/wiki/UnbindKey - read it carefuly tho. I still don't get it what is Bad Argument .. Debug says "bad argument @ unbindkey Server: local root = getRootElement() function unBindKeys ( ) unbindKey ( thePlayer, "arrow_up", "both") unbindKey ( thePlayer, "arrow_down", "both") unbindKey ( thePlayer, "arrow_left", "both") unbindKey ( thePlayer, "arrow_right", "both") end addEventHandler ( "onPlayerSpawn", root, unBindKeys ) addEventHandler ( "onPlayerJoin", root, unBindKeys ) addEventHandler ( "onPlayerLogin", root, unBindKeys ) Link to comment
Castillo Posted September 29, 2013 Share Posted September 29, 2013 'thePlayer' is not defined anywhere, change it to 'source'. Link to comment
glowdemon1 Posted September 29, 2013 Share Posted September 29, 2013 "Note: unbindKey will only work on binds that were added by the same resource" - In other words,I'm afraid it's impossible, unless the resource itself bound the keys. Link to comment
FuriouZ Posted September 29, 2013 Author Share Posted September 29, 2013 "Note: unbindKey will only work on binds that were added by the same resource"- In other words,I'm afraid it's impossible, unless the resource itself bound the keys. So, i can't unbind MTA default binds ? Link to comment
denny199 Posted September 29, 2013 Share Posted September 29, 2013 Use https://wiki.multitheftauto.com/wiki/ToggleControl for that. Control names: https://wiki.multitheftauto.com/wiki/Control_names 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