- Documentation
- Server functions
- getBoundKeys
Function
getBoundKeys
Returns the keys a player has bound to commands (bindKey with a command name) as a key -> command table.
Syntax
table getBoundKeys(player thePlayer)Arguments
thePlayerplayer- The player.Different type in MTA:SA: string command/control
Differences from MTA:SA
- Arguments in a different colour differ from MTA:SA.
In MTA:SA
getBoundKeys(string command/control)Returns
A { [key] = command } table or false.
Example
for key, command in pairs(getBoundKeys(player)) do
outputServerLog(key .. " -> /" .. command)
end
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.getCommandsBoundToKeyReturns the commands bound to a player's key.