Jump to content

[HELP] create an bindKey


Recommended Posts

  • Moderators

yes,

Read Client/server syntax 2 carefully.

(wiki mta)

Client - Syntax 2

This alternative syntax allows you to bind a key with a command. This will also allow users to customize the control in their Settings menu. Use in conjunction with addCommandHandler to add handler functions to the keybind.

bindKey ( string key, string keyState, string commandName, [ string arguments ] )

Required Arguments

  • key: The key or control you wish to bind to the command. See key names for a list of possible keys.
    keyState: A string that has one of the following values:
    "up": If the bound key should trigger the function when the key is released
    "down": If the bound key should trigger the function when the key is pressed
    "both": If the bound key should trigger the function when the key is pressed or released
    commandName: The name of the command that the key should be binded to.
    arguments Space delimited arguments that are entered as if one was typing the command.

server

Server - Syntax 2

This alternative syntax allows you to bind a key with a command. This will also allow users to customize the control in their Settings menu. Use in conjunction with addCommandHandler to add handler functions to the keybind.

bindKey ( player thePlayer, string key, string keyState, string commandName, [ string arguments ] )

Required Arguments

thePlayer: The player you wish to bind the key of.

key: The key or control you wish to bind to the command. See key names for a list of possible keys.

keyState: A string that has one of the following values:

"up": If the bound key should trigger the function when the key is released

"down": If the bound key should trigger the function when the key is pressed

"both": If the bound key should trigger the function when the key is pressed or released

commandName: The name of the command that the key should be binded to.

Optional Arguments

arguments Space delimited arguments that are entered as if one was typing the command.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...