Key::bind

From RAGE Multiplayer Wiki
Revision as of 18:30, 4 November 2017 by Kostya nad (talk | contribs) (Kostya nad moved page Keys::bind to Key::bind)

This function binds the key .

Parameters

  • keycode - code of key (Int).
  • bool0 - toggle of what? (Bool)
  • handler - function-handler.

Example

This example calling server event.

Client-Side
// 0x12 is a Alt keycode
mp.keys.bind(0x12,true,function(){
    mp.events.callRemote('keypress:Alt'); // Calling server event "keypress:Alt"
});

See also

Checkpoint

Colshape

Entity

Player

Streaming

Vehicle

Waypoint