TasksClient

controlMountedWeapon

CONTROL_MOUNTED_WEAPON0xDCFE42068FE0135A

The GTA V native CONTROL_MOUNTED_WEAPON of the TASK namespace, as LS:MP client scripts call it: the global function controlMountedWeapon, in JavaScript and in Lua.

SignatureJavaScript
controlMountedWeapon(ped: Ped): boolean
SignatureLua
controlMountedWeapon(ped: Ped): boolean

Usage

JavaScript
const result = controlMountedWeapon(ped);
Lua
local result = controlMountedWeapon(ped)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger

Returns

BOOL JavaScript boolean, Lua boolean

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Forces the ped to use the mounted weapon.
Returns false if task is not possible.

Reference

Namespace
Tasks TASK
In the game
BOOL CONTROL_MOUNTED_WEAPON(Ped ped)
Hash
0xDCFE42068FE0135A

Open in the interactive natives reference