Scripting/Squirrel/Functions/UnbindKey: Difference between revisions
Jump to navigation
Jump to search
This wiki is using an old backup from 2020
Some information may be old/missing
(Created page with "'''UnbindKey''' remove a binded key. (Keys cannot be removed for one Player, only for everyone) == Syntax == <pre>UnindKey(key)</pre> == Arguments == *''int'' '''key''' -...") |
No edit summary |
||
Line 3: | Line 3: | ||
== Syntax == | == Syntax == | ||
<pre> | <pre>UnbindKey(key)</pre> | ||
== Arguments == | == Arguments == |
Revision as of 21:07, 22 April 2016
UnbindKey remove a binded key. (Keys cannot be removed for one Player, only for everyone)
Syntax
UnbindKey(key)
Arguments
- int key - The key you want to unbind
Example
The following example will unbind a key for a player
function onScriptLoad()
{
lshift <- BindKey(true, 0xA0, 0, 0);
}
function onKeyDown( player, key )
{
if( key == lshift )
{
MessagePlayer( ">> You pressed the left shift key", player );
}
}
function OnPlayerCommand( player,cmd , text )
{
if(cmd == "unbind")
{
UnbindKey(lshift);
}
}
Notes
- Callbacks onScriptLoad, onKeyDown and onPlayerCommand were used in this example. More info about them in the corresponding pages.