RedM Natives

GET_PED_SOURCE_OF_DEATH

Get the entity that killed the ped.

Hash0x84ADF9EB
Runtime nameGetPedSourceOfDeath
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

Entity GET_PED_SOURCE_OF_DEATH(Ped ped);

Parameters

NameTypeDescription
pedPed

The target ped

Returns Entity — The entity id. Returns 0 if the ped has no killer.

Description

Cfx.re native reference

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

Usage

Lua
local retval = GetPedSourceOfDeath(ped)

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

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

Sources

Cfx.re native reference

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