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

Function

getPedWeaponMuzzlePosition

ServerPedsIdentical to MTA:SA

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)

See also