Scripting/Squirrel/Client Events/KeyBind::OnDown: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(→Syntax) |
|||
Line 8: | Line 8: | ||
== Parameters == | == Parameters == | ||
* '''key''' - The key player presses. | * '''key''' - The key player presses. | ||
== Example == | == Example == |
Revision as of 04:29, 17 August 2016
This function allows the server to inform the player, that he pressed the key and and the key works like a command.
Syntax
function KeyBind::OnDown()
Parameters
- key - The key player presses.
Example
In this function i have chosen key "ENTER". When a player will press the key/button 'enter' it will inform the server that the player pressed the key. And the server will perform the work like a Command.
function Script::ScriptLoad()()
{
enter <- BindKey( true, 0x0D, 0, 0 ); // The Key Code of enter is 0x0D . we will use bindkey function to set the key. And it is required.
}
function KeyBind::OnDown()
{
if ( key == enter )
{
print("you Successfully pressed the Key Enter.");
}
}