setCanAttackFriendly
SET_CAN_ATTACK_FRIENDLY0xB3B1CB349FF9C75DThe GTA V native SET_CAN_ATTACK_FRIENDLY of the PED namespace, as LS:MP client scripts call it: the global function setCanAttackFriendly, in JavaScript and in Lua.
setCanAttackFriendly(ped: Ped, toggle: boolean, p2: boolean): voidsetCanAttackFriendly(ped: Ped, toggle: boolean, p2: boolean)Usage
JavaScript
setCanAttackFriendly(ped, toggle, p2);Lua
setCanAttackFriendly(ped, toggle, p2)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
toggle | BOOL | boolean | boolean |
p2 | BOOL | boolean | boolean |
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.
Setting ped to true allows the ped to shoot "friendlies".
p2 set to true when toggle is also true seams to make peds permanently unable to aim at, even if you set p2 back to false.
p1 = false & p2 = false for unable to aim at.
p1 = true & p2 = false for able to aim at.
Reference
- Namespace
- Ped PED
- In the game
void SET_CAN_ATTACK_FRIENDLY(Ped ped, BOOL toggle, BOOL p2)- Hash
0xB3B1CB349FF9C75D