WeaponClient

getCurrentPedWeaponEntityIndex

GET_CURRENT_PED_WEAPON_ENTITY_INDEX0x3B390A939AF0B5FC

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

SignatureJavaScript
getCurrentPedWeaponEntityIndex(ped: Ped, p1: any): Entity
SignatureLua
getCurrentPedWeaponEntityIndex(ped: Ped, p1: any): Entity

Usage

JavaScript
const entity = getCurrentPedWeaponEntityIndex(ped, p1);
Lua
local entity = getCurrentPedWeaponEntityIndex(ped, p1)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
p1Anyanyany

Returns

Entity JavaScript number, Lua integer

Game handle of an entity: a ped, a vehicle or an object. Not an LS:MP netId. Convert one with lsmp.getEntityFromNetId.

Notes

From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.

doDeadCheck does nothing in release builds.

Reference

Namespace
Weapon WEAPON
In the game
Entity GET_CURRENT_PED_WEAPON_ENTITY_INDEX(Ped ped, Any p1)
Hash
0x3B390A939AF0B5FC

Open in the interactive natives reference