GET_PED_SOURCE_OF_DAMAGE
Get the last entity that damaged the ped.
Signature
Entity GET_PED_SOURCE_OF_DAMAGE(Ped ped);Parameters
| Name | Type | Description |
|---|---|---|
ped | Ped | The target ped |
Returns Entity — The entity id. Returns 0 if the ped has not been damaged recently.
Description
Get the last entity that damaged the ped. This native is used server side when using OneSync.
Usage
local retval = GetPedSourceOfDamage(ped)
-- always works, by hash
local retval = Citizen.InvokeNative(0x535db43f, ped, Citizen.ResultAsInteger())JavaScript and C#
const retval = GetPedSourceOfDamage(ped);
// by hash
const retval = Citizen.invokeNative('0x535db43f', ped, Citizen.returnResultAnyway(), Citizen.resultAsInteger());int retval = Function.Call<int>((Hash)0x535db43f, ped);Sources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.