Key::bind: Difference between revisions

From RAGE Multiplayer Wiki
(Created page with "This function binds the key . ==Parameters== * '''keycode''' - code of key (Int). * '''bool0''' - toggle of what? (Bool) * '''handler''' - function-handler. ==Example== This...")
 
m (Kostya nad moved page Keys::bind to Key::bind)

Revision as of 18:30, 4 November 2017

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