Jump to content

Pressing keys on the keyboard

Guest TcCc

Recommended Posts

bindKey does this for you.

Wiki: http://development.mtasa.com/index.php?title=bindKey

Code example which says "Hello" to them when they press F5

function playerF5Down ( playerElement, key, state ) 
  outputChatBox ( "Hello", playerElement ) 
function onPlayerJoin() 
  bindKey ( source, "F5", "down", playerF5Down ) 
addEventHandler ( "onPlayerJoin", getRootElement(), onPlayerJoin ) 

(This code is untested and might not work, if it does not work then get back to me)

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...