GetKeyBoundToCommand
Jump to navigation
Jump to search
This function allow you get first key binded to command.
Syntax
string getKeyBoundToCommand( string command )
Required Arguments
- command: command what you need check.
Returns
Returns a string of first key binded to current command.
Example
Click to collapse [-]
Clientfunction yourFunction() --your function here end addCommandHandler("bindedcommand",yourFunction) function bindHandler() local bindedKey = getKeyBoundToCommand("bindedcommand") --get binded key if not bindedKey then bindedKey = "z" bindKey(bindedKey,"down","bindedcommand") --if key is not exist then bind it by syntax 2 end outputChatBox("Press '"..bindedKey.."' for do yourFunction",255,255,0,true) --after all done output it in chatbox end addEventHandler("onClientResourceStart", bindHandler)
See Also
- addCommandHandler
- bindKey
- executeCommandHandler
- getCommandHandlers
- getFunctionsBoundToKey
- getKeyBoundToFunction
- isControlEnabled
- removeCommandHandler
- toggleAllControls
- toggleControl
- unbindKey