RedM Natives

GET_PED_SOURCE_OF_DAMAGE

Get the last entity that damaged the ped.

Hash0x535DB43F
Runtime nameGetPedSourceOfDamage
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

Entity GET_PED_SOURCE_OF_DAMAGE(Ped ped);

Parameters

NameTypeDescription
pedPed

The target ped

Returns Entity — The entity id. Returns 0 if the ped has not been damaged recently.

Description

Cfx.re native reference

Get the last entity that damaged the ped. This native is used server side when using OneSync.

Usage

Lua
local retval = GetPedSourceOfDamage(ped)

-- always works, by hash
local retval = Citizen.InvokeNative(0x535db43f, ped, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetPedSourceOfDamage(ped);

// by hash
const retval = Citizen.invokeNative('0x535db43f', ped, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
int retval = Function.Call<int>((Hash)0x535db43f, ped);

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.