GetKeyBoundToFunction

From Multi Theft Auto: Wiki
Revision as of 14:00, 30 August 2013 by XFawkes (talk | contribs) (→‎Syntax)
Jump to navigation Jump to search

getKeyBoundToFunction allows retrieval of the first key bound to a function.

Syntax

Click to collapse [-]
Server
string getKeyBoundToFunction( player thePlayer, function theFunction )

Required Arguments

  • thePlayer: The player you are checking the function bound to a key
  • theFunction: The function in which you would like to check the bound key

Returns

Returns a string of the first key the function was bound to.

Click to collapse [-]
Client
string getKeyBoundToFunction( function theFunction )

Required Arguments

  • theFunction: The function in which you would like to check the bound key

Returns

Returns a string of the first key the function was bound to.

Example

Click to collapse [-]
Client

/key command gives bounded key to our chat function

function chat ()
outputChatBox("Test")
end
bindKey("F2","down",chat)

function key()
keyy = getKeyBoundToFunction(chat)
outputChatBox(keyy)
end
addCommandHandler("key",key)

This example written by Samurai

See Also