Key::bind

From RAGE Multiplayer Wiki
Revision as of 16:39, 4 November 2017 by Kostya nad (talk | contribs) (Created page with "This function binds the key . ==Parameters== * '''keycode''' - code of key (Int). * '''bool0''' - toggle of what? (Bool) * '''handler''' - function-handler. ==Example== This...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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