Skip to content

isPedOnlyDamagedByPlayer

Client-side

Check whether a script-created NPC currently uses GTA's player-attributed-damage-only rule.

Syntax

bool isPedOnlyDamagedByPlayer(ped thePed)

GTA task mapping

NATIVE GTA BEHAVIOR 02A9
No CTask is created

SCM equivalent: SET_CHAR_ONLY_DAMAGED_BY_PLAYER

This is a policy query, not a CTask or damage-proof query.

Arguments

thePedped

Script-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.

Important behavior
  • Use this before a temporary setPedOnlyDamagedByPlayer change when the previous behavior must be restored.

Where this comes from

RELATED SA:O APIS

Continue exploring

Read the system guide →