ServersYour serverFor creatorsForumFAQDocumentationSecurity
Download the launcher
  1. Documentation
  2. Server functions
  3. setPedAimTarget

Function

setPedAimTarget

ServerPedsIdentical to MTA:SA

Stores the point a ped should aim at. The value is for scripts: getPedTargetEnd (and indirectly getPedTargetCollision) returns it, but the game itself does not turn the ped's weapon that way.

Syntax

bool setPedAimTarget(ped ped, float x, float y, float z)

Arguments

pedped
A player or an NPC.
xfloat
Target X coordinate (or a Vector3).
yfloat
Target Y coordinate.
zfloat
Target Z height.

Returns

true on success.

Example

setPedAimTarget(sniper, 2495, -1687, 14)

See also