- Documentation
- Shared functions
- getFunctionsBoundToKey
Function
getFunctionsBoundToKey
Returns the functions (and command names) bound to a key.
Syntax
Server
table getFunctionsBoundToKey(player thePlayer, string key)Client
table getFunctionsBoundToKey(string key)Arguments
thePlayerplayer- The player (server only).
keystring- The key.
Differences from MTA:SA
- These MTA:SA arguments are not here:
string keyState
In MTA:SA
getFunctionsBoundToKey(player thePlayer, string key, string keyState)Returns
A table of functions.
Example
outputChatBox("Pod F2: " .. #getFunctionsBoundToKey("F2") .. " funkcji")
See also
bindKeyBinds a function or a command to a player's key. The function gets (on the server also the player) the key name, the state and the extra arguments frombindKey. Instead of a function you can pass a command name: the key runs it like/command. On the server the player's game watches the key and reports presses to the server.getKeyBoundToFunctionReturns the first key a function is bound to.