Skip to content

getPedWeaponAccuracy

Client-side

Reads GTA's persistent 0-255 weapon-accuracy byte used for shot spread.

Syntax

int getPedWeaponAccuracy(ped thePed)

GTA task mapping

NATIVE GTA BEHAVIOR
No CTask is created

This does not create a CTask. It reads the same persistent accuracy byte that native weapon tasks use when calculating spread.

Arguments

thePedped

Streamed ped.

Returns

The current accuracy from 0 through 255, or -1 when the ped is not streamed in or has no native instance.

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
  • This is the read counterpart to setPedWeaponAccuracy.
  • -1 means unknown, not zero accuracy.

OOP aliases

  • ped:getWeaponAccuracy()

Where this comes from

RELATED SA:O APIS

Continue exploring

Read the system guide →