- Documentation
- Server functions
- getPedTargetEnd
Function
getPedTargetEnd
Returns the end point of a ped's line of fire: the target set with setPedAimTarget, or when none, a point 100 m ahead of the ped in the direction it faces.
Syntax
float, float, float getPedTargetEnd(ped ped)Arguments
pedped- A player or an NPC.
Returns
x, y, z, or false.
Example
local ex, ey, ez = getPedTargetEnd(player)
See also
getPedTargetStartReturns the point where a ped's line of fire starts, i.e. the approximate muzzle position (same asgetPedWeaponMuzzlePosition). Together withgetPedTargetEndit defines the bullet path.setPedAimTargetStores the point a ped should aim at. The value is for scripts:getPedTargetEnd(and indirectlygetPedTargetCollision) returns it, but the game itself does not turn the ped's weapon that way.