PedClient

applyDamageToPed

APPLY_DAMAGE_TO_PED0x697157CED63F18D4

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

SignatureJavaScript
applyDamageToPed(
  ped: Ped,
  damageAmount: number,
  p2: boolean,
  p3: any,
  weaponType: Hash
): void
SignatureLua
applyDamageToPed(
  ped: Ped,
  damageAmount: integer,
  p2: boolean,
  p3: any,
  weaponType: Hash
)

Usage

JavaScript
applyDamageToPed(ped, damageAmount, p2, p3, weaponType);
Lua
applyDamageToPed(ped, damageAmount, p2, p3, weaponType)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
damageAmountintnumberinteger
p2BOOLbooleanboolean
p3Anyanyany
weaponTypeHashnumberinteger

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.

damages a ped with the given amount

Reference

Namespace
Ped PED
In the game
void APPLY_DAMAGE_TO_PED(Ped ped, int damageAmount, BOOL p2, Any p3, Hash weaponType)
Hash
0x697157CED63F18D4

Open in the interactive natives reference