PedClient

getPedSourceOfDeath

GET_PED_SOURCE_OF_DEATH0x93C8B64DEB84728C

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

SignatureJavaScript
getPedSourceOfDeath(ped: Ped): Entity
SignatureLua
getPedSourceOfDeath(ped: Ped): Entity

Usage

JavaScript
const entity = getPedSourceOfDeath(ped);
Lua
local entity = getPedSourceOfDeath(ped)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger

Returns

Entity JavaScript number, Lua integer

Game handle of an entity: a ped, a vehicle or an object. Not an LS:MP netId. Convert one with lsmp.getEntityFromNetId.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

Returns the Entity (Ped, Vehicle, or ?Object?) that killed the 'ped'

Is best to check if the Ped is dead before asking for its killer.

Reference

Namespace
Ped PED
In the game
Entity GET_PED_SOURCE_OF_DEATH(Ped ped)
Hash
0x93C8B64DEB84728C
Formerly
_GET_PED_KILLER

Open in the interactive natives reference