giveDelayedWeaponToPed
GIVE_DELAYED_WEAPON_TO_PED0xB282DC6EBD803C75The GTA V native GIVE_DELAYED_WEAPON_TO_PED of the WEAPON namespace, as LS:MP client scripts call it: the global function giveDelayedWeaponToPed, in JavaScript and in Lua.
giveDelayedWeaponToPed(
ped: Ped,
weaponHash: Hash,
ammoCount: number,
bForceInHand: boolean
): voidgiveDelayedWeaponToPed(
ped: Ped,
weaponHash: Hash,
ammoCount: integer,
bForceInHand: boolean
)Usage
JavaScript
giveDelayedWeaponToPed(ped, weaponHash, ammoCount, bForceInHand);Lua
giveDelayedWeaponToPed(ped, weaponHash, ammoCount, bForceInHand)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
ped | Ped | number | integer |
weaponHash | Hash | number | integer |
ammoCount | int | number | integer |
bForceInHand | BOOL | boolean | boolean |
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.
Gives a weapon to PED with a delay, example:
giveDelayedWeaponToPed(playerPedId(), getHashKey("WEAPON_PISTOL"), 1000, false)
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 GIVE_DELAYED_WEAPON_TO_PED(Ped ped, Hash weaponHash, int ammoCount, BOOL bForceInHand)- Hash
0xB282DC6EBD803C75