getWeaponObjectFromPed
GET_WEAPON_OBJECT_FROM_PED0xCAE1DC9A0E22A16DThe GTA V native GET_WEAPON_OBJECT_FROM_PED of the WEAPON namespace, as LS:MP client scripts call it: the global function getWeaponObjectFromPed, in JavaScript and in Lua.
getWeaponObjectFromPed(ped: Ped, p1: boolean): ObjectgetWeaponObjectFromPed(ped: Ped, p1: boolean): ObjectUsage
JavaScript
const object = getWeaponObjectFromPed(ped, p1);Lua
local object = getWeaponObjectFromPed(ped, p1)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
p1 | BOOL | boolean | boolean |
Returns
Object JavaScript number, Lua integerGame handle of an object (prop). 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.
Drops the current weapon and returns the object
Unknown behavior when unarmed.
Reference
- Namespace
- Weapon WEAPON
- In the game
Object GET_WEAPON_OBJECT_FROM_PED(Ped ped, BOOL p1)- Hash
0xCAE1DC9A0E22A16D