WeaponClient

setPedDropsInventoryWeapon

SET_PED_DROPS_INVENTORY_WEAPON0x208A1888007FC0E6

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

SignatureJavaScript
setPedDropsInventoryWeapon(
  ped: Ped,
  weaponHash: Hash,
  xOffset: number,
  yOffset: number,
  zOffset: number,
  ammoCount: number
): void
SignatureLua
setPedDropsInventoryWeapon(
  ped: Ped,
  weaponHash: Hash,
  xOffset: number,
  yOffset: number,
  zOffset: number,
  ammoCount: integer
)

Usage

JavaScript
setPedDropsInventoryWeapon(ped, weaponHash, xOffset, yOffset, zOffset, ammoCount);
Lua
setPedDropsInventoryWeapon(ped, weaponHash, xOffset, yOffset, zOffset, ammoCount)

Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.

JavaScript · with vectors
setPedDropsInventoryWeapon(ped, weaponHash, offset, ammoCount);
Lua · with vectors
setPedDropsInventoryWeapon(ped, weaponHash, offset, ammoCount)

Parameters

ParameterTypeJavaScriptLua
pedPednumberinteger
weaponHashHashnumberinteger
xOffsetfloatnumbernumber
yOffsetfloatnumbernumber
zOffsetfloatnumbernumber
ammoCountintnumberinteger

Returns

Nothing. In JavaScript the call evaluates to undefined.

Notes

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

Reference

Namespace
Weapon WEAPON
In the game
void SET_PED_DROPS_INVENTORY_WEAPON(Ped ped, Hash weaponHash, float xOffset, float yOffset, float zOffset, int ammoCount)
Hash
0x208A1888007FC0E6

Open in the interactive natives reference