BieHDC Posted June 3, 2013 Share Posted June 3, 2013 I have a easy question. I wanna use a combined key shortcut (rshift + #) to open a panel, but i cant find how to make this. Here is the Code for bind: if isPlayerAdmin ( player ) then bindKey ( player, "rshift + #", "down", isPlayerAdmins ) end AND the same for unbind: unbindKey ( source, "rshift + #", "down", isPlayerAdmins ) Link to comment
PaiN^ Posted June 3, 2013 Share Posted June 3, 2013 Maybe like this : addEventHandler( 'onClientRender', getRootElement( ), function( ) if getKeyState( 'lshift' ) then bindKey( '#', 'down', YourFunction ); else unbindKey( '#', 'down', YourFunction ); end end ); Link to comment
BieHDC Posted June 3, 2013 Author Share Posted June 3, 2013 You missunderstood me I want a key combination for showing up a GUI and the same for toggle off. This combination should be set onJoin and on RecourceStart and if the player quit the bind should be deleted. Mkay? Link to comment
PaiN^ Posted June 3, 2013 Share Posted June 3, 2013 i showed you the way to bind tow keys together ( not sure if it was the best way ), You should make the function that toggles the GUI By Your self, or use this one SetBindKeyWindowShow ! + You don't need to remove the bind with onPlayerQuit ( makes no sens, it will be removed automatically ) Link to comment
Castillo Posted June 3, 2013 Share Posted June 3, 2013 The function: "isPlayerAdmins" triggers a client event, right? if so, then you can use the same method you currently using and getKeyState on the client side, to make sure the second key is also pressed. 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