isPedOnlyDamagedByPlayer
Check whether a script-created NPC currently uses GTA's player-attributed-damage-only rule.
Syntax
bool isPedOnlyDamagedByPlayer(ped thePed)GTA task mapping
02A9 SCM equivalent: SET_CHAR_ONLY_DAMAGED_BY_PLAYER
This is a policy query, not a CTask or damage-proof query.
Arguments
thePedpedScript-created ped; players are rejected.
Returns
The persisted scalar value when present; otherwise the live native flag. false also covers a disabled flag, a streamed-out ped with no override, a player, or an invalid element.
Ownership and lifecycle
Low-level ped task calls require the client that simulates the living, streamed ped. Driving tasks also require control of the streamed vehicle. They do not create lifecycle handles; the optional native-task-runtime adds server-owned route epochs and reconstruction for drive_to routes. Gang-tag ownership is resource-exclusive, survives object streaming and recreation, and is released automatically when the owner stops.
- Use this before a temporary setPedOnlyDamagedByPlayer change when the previous behavior must be restored.
Where this comes from
Continue exploring
← Back to the SA:O Lua API · How Native ped tasks and gang tags works →