PedClient

setPedCanCowerInCover

SET_PED_CAN_COWER_IN_COVER0xCB7553CDCEF4A735

The GTA V native SET_PED_CAN_COWER_IN_COVER of the PED namespace, as LS:MP client scripts call it: the global function setPedCanCowerInCover, in JavaScript and in Lua.

SignatureJavaScript
setPedCanCowerInCover(ped: Ped, toggle: boolean): void
SignatureLua
setPedCanCowerInCover(ped: Ped, toggle: boolean)

Usage

JavaScript
setPedCanCowerInCover(ped, toggle);
Lua
setPedCanCowerInCover(ped, toggle)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
toggleBOOLbooleanboolean

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

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

It simply makes the said ped to cower behind cover object(wall, desk, car)

Peds flee attributes must be set to not to flee, first. Else, most of the peds, will just flee from gunshot sounds or any other panic situations.

Reference

Namespace
Ped PED
In the game
void SET_PED_CAN_COWER_IN_COVER(Ped ped, BOOL toggle)
Hash
0xCB7553CDCEF4A735

Open in the interactive natives reference