- Documentation
- Server functions
- getKeyBoundToCommand
Function
getKeyBoundToCommand
Returns the first key a player has bound to a command.
Syntax
string getKeyBoundToCommand(player thePlayer, string command)Arguments
thePlayerplayer- The player.Different type in MTA:SA: string command
commandstring- The command name.Not in MTA:SA
Differences from MTA:SA
- Arguments in a different colour differ from MTA:SA.
In MTA:SA
getKeyBoundToCommand(string command)Returns
The key or false.
Example
local key = getKeyBoundToCommand(player, "menu")
outputChatBox("Menu otworzysz klawiszem " .. (key or "(brak)"), player)
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.