- Documentation
- Server functions
- getPedTargetStart
Function
getPedTargetStart
Returns the point where a ped's line of fire starts, i.e. the approximate muzzle position (same as getPedWeaponMuzzlePosition). Together with getPedTargetEnd it defines the bullet path.
Syntax
float, float, float getPedTargetStart(ped ped)Arguments
pedped- A player or an NPC.
Returns
x, y, z, or false.
Example
local sx, sy, sz = getPedTargetStart(player)
See also
getPedTargetEndReturns the end point of a ped's line of fire: the target set withsetPedAimTarget, or when none, a point 100 m ahead of the ped in the direction it faces.getPedTargetCollisionTraces a ped's line of fire (fromgetPedTargetStarttogetPedTargetEnd) and returns the first point where it hits a building, vehicle, ped or object. Returnsfalsewhen nothing is in the way.