- Documentation
- Server functions
- getPedWeaponMuzzlePosition
Function
getPedWeaponMuzzlePosition
Returns the approximate muzzle position of a ped's weapon: a point about 45 cm in front of the ped at shoulder height, in the direction it faces. The server does not know the exact arm pose, so this approximation is good enough for effects and simple line-of-fire checks.
Syntax
float, float, float getPedWeaponMuzzlePosition(ped ped)Arguments
pedped- A player or an NPC.
Returns
x, y, z, or false.
Example
local mx, my, mz = getPedWeaponMuzzlePosition(player)