ControlsClientNot in this build

isControlHeldDown

_IS_CONTROL_HELD_DOWN0xE9CB8C56E90D5079

The GTA V native _IS_CONTROL_HELD_DOWN of the PAD namespace, as LS:MP client scripts call it: the global function isControlHeldDown, in JavaScript and in Lua.

SignatureJavaScript
isControlHeldDown(control: number, action: number, duration: number): boolean
SignatureLua
isControlHeldDown(
  control: integer,
  action: integer,
  duration: integer
): boolean
⚠
Not in this game build

The global exists, but the native is not part of the game build LS:MP runs: calling it does nothing and returns undefined in JavaScript, nil in Lua. It never throws. See Coverage.

Usage

JavaScript
const result = isControlHeldDown(control, action, duration);
Lua
local result = isControlHeldDown(control, action, duration)

Parameters

ParameterTypeJavaScriptLua
controlintnumberinteger
actionintnumberinteger
durationintnumberinteger

Returns

BOOL JavaScript boolean, Lua boolean

Reference

Namespace
Controls PAD
In the game
BOOL _IS_CONTROL_HELD_DOWN(int control, int action, int duration)
Hash
0xE9CB8C56E90D5079
Introduced
Game build 3407 legacy numbering

Open in the interactive natives reference