Scripting/Squirrel/Functions/Misc/UnbindKey

From VC-MP Wiki

Jump to: navigation, search

This will unbind a previously bound key.

Syntax

bool UnbindKey( int key )

Arguments

  • key This is the ID of the key which will be unbound

Example

This example will unbind the fire key, which was bound in an earlier example, when the server owner types 'unbindfire' to the console.

function onConsoleInput( command, text )
{
     if ( command == "unbindfire" )
     {
          local unbind = UnbindKey( KEY_ONFOOT_FIRE );
 
          if ( unbind ) print( "Fire-key successfully unbound." );
          else print( "Fire-key has not been bound earlier!" );
     }
}

Notes

The call onConsoleInput was used in in this example. More info about it in its page.

Related Functions

Personal tools
squirrel scripting