WeaponClient

getLockonDistanceOfCurrentPedWeapon

GET_LOCKON_DISTANCE_OF_CURRENT_PED_WEAPON0x840F03E9041E2C9C

The GTA V native GET_LOCKON_DISTANCE_OF_CURRENT_PED_WEAPON of the WEAPON namespace, as LS:MP client scripts call it: the global function getLockonDistanceOfCurrentPedWeapon, in JavaScript and in Lua.

SignatureJavaScript
getLockonDistanceOfCurrentPedWeapon(ped: Ped): number
SignatureLua
getLockonDistanceOfCurrentPedWeapon(ped: Ped): number

Usage

JavaScript
const value = getLockonDistanceOfCurrentPedWeapon(ped);
Lua
local value = getLockonDistanceOfCurrentPedWeapon(ped)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger

Returns

float JavaScript number, Lua number

Reference

Namespace
Weapon WEAPON
In the game
float GET_LOCKON_DISTANCE_OF_CURRENT_PED_WEAPON(Ped ped)
Hash
0x840F03E9041E2C9C
Formerly
_GET_LOCKON_RANGE_OF_CURRENT_PED_WEAPON

Open in the interactive natives reference