Scripting/Squirrel/Functions/UnbindKey

From Vice City Multiplayer
Revision as of 18:06, 30 January 2017 by Thijn (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Caution icon
This wiki is using an old backup from 2020
Some information may be old/missing

UnbindKey remove a binded server key.

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

Related Functions