TasksClient

taskCombatPed

TASK_COMBAT_PED0xF166E48407BAC484

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

SignatureJavaScript
taskCombatPed(
  ped: Ped,
  targetPed: Ped,
  combatFlags: number,
  threatResponseFlags: number
): void
SignatureLua
taskCombatPed(
  ped: Ped,
  targetPed: Ped,
  combatFlags: integer,
  threatResponseFlags: integer
)

Usage

JavaScript
taskCombatPed(ped, targetPed, combatFlags, threatResponseFlags);
Lua
taskCombatPed(ped, targetPed, combatFlags, threatResponseFlags)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
targetPedPednumberinteger
combatFlagsintnumberinteger
threatResponseFlagsintnumberinteger

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.

Makes the specified ped attack the target ped.
p2 should be 0
p3 should be 16

Reference

Namespace
Tasks TASK
In the game
void TASK_COMBAT_PED(Ped ped, Ped targetPed, int combatFlags, int threatResponseFlags)
Hash
0xF166E48407BAC484

Open in the interactive natives reference