RedM Natives

GIVE_WEAPON_TO_PED

GIVE_WEAPON_TO_PED This is the server-side RPC native equivalent of the client native GIVE_WEAPON_TO_PED.

Hash0xC4D88A85
Runtime nameGiveWeaponToPed
NamespaceCFX
SideServer
NameOfficial
Docs

Signature

void GIVE_WEAPON_TO_PED(Ped ped, Hash weaponHash, int ammoCount, BOOL isHidden, BOOL bForceInHand);

Parameters

NameTypeDescription
pedPed—
weaponHashHash—
ammoCountint—
isHiddenBOOL—
bForceInHandBOOL—

Returns void

Description

Cfx.re native reference

GIVE_WEAPON_TO_PED

This is the server-side RPC native equivalent of the client native GIVE_WEAPON_TO_PED.

Usage

Lua
GiveWeaponToPed(ped, weaponHash, ammoCount, isHidden, bForceInHand)

-- always works, by hash
Citizen.InvokeNative(0xc4d88a85, ped, weaponHash, ammoCount, isHidden, bForceInHand)
JavaScript and C#
JavaScript
GiveWeaponToPed(ped, weaponHash, ammoCount, isHidden, bForceInHand);

// by hash
Citizen.invokeNative('0xc4d88a85', ped, weaponHash, ammoCount, isHidden, bForceInHand);
C#
Function.Call((Hash)0xc4d88a85, ped, weaponHash, ammoCount, isHidden, bForceInHand);
  • Hash parameters: the named function also accepts a string and hashes it for you; Citizen.InvokeNative needs the number — pass joaat("name") or a backtick literal like `name`.

Sources

Cfx.re native reference

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.