setPedDropsInventoryWeapon
SET_PED_DROPS_INVENTORY_WEAPON0x208A1888007FC0E6The 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.
setPedDropsInventoryWeapon(
ped: Ped,
weaponHash: Hash,
xOffset: number,
yOffset: number,
zOffset: number,
ammoCount: number
): voidsetPedDropsInventoryWeapon(
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
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
weaponHash | Hash | number | integer |
xOffset | float | number | number |
yOffset | float | number | number |
zOffset | float | number | number |
ammoCount | int | number | integer |
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.
Full list of weapons by DurtyFree: https://github.com/DurtyFree/gta-v-data-dumps/blob/master/weapons.json
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