GIVE_WEAPON_TO_PED
Gives the ped the weapon weaponHash with ammoCount rounds, with options to force it in hand or holster and set its attach point and degradation. Returns a weapon hash.
Signature
Hash GIVE_WEAPON_TO_PED(Ped ped, Hash weaponHash, int ammoCount, BOOL bForceInHand, BOOL bForceInHolster, int attachPoint, BOOL bAllowMultipleCopies, float p7, float p8, Hash addReason, BOOL bIgnoreUnlocks, float permanentDegradation, BOOL p12); // 0x5E3BDDBCB83F3D84 b1207Parameters
| # | Name | Type |
|---|---|---|
| 1 | ped | Ped |
| 2 | weaponHash | Hash |
| 3 | ammoCount | int |
| 4 | bForceInHand | BOOL |
| 5 | bForceInHolster | BOOL |
| 6 | attachPoint | int |
| 7 | bAllowMultipleCopies | BOOL |
| 8 | p7 | float |
| 9 | p8 | float |
| 10 | addReason | Hash |
| 11 | bIgnoreUnlocks | BOOL |
| 12 | permanentDegradation | float |
| 13 | p12 | BOOL |
Facts
| Name | GIVE_WEAPON_TO_PED |
|---|---|
| Hash | 0x5E3BDDBCB83F3D84 |
| Namespace | |
| Returns | Hash |
| Game build | 1207 |
Examples
Calls by hash work in every RedM runtime. Replace the placeholder arguments with your own values.
local hash = Citizen.InvokeNative(0x5E3BDDBCB83F3D84, -- GIVE_WEAPON_TO_PED
PlayerPedId(), -- Ped ped
GetHashKey("weapon_revolver_cattleman"), -- Hash weaponHash
0, -- int ammoCount
false, -- BOOL bForceInHand
false, -- BOOL bForceInHolster
0, -- int attachPoint
false, -- BOOL bAllowMultipleCopies
0.0, -- float p7
0.0, -- float p8
GetHashKey("name"), -- Hash addReason
false, -- BOOL bIgnoreUnlocks
0.0, -- float permanentDegradation
false, -- BOOL p12
Citizen.ResultAsInteger()
)
print(hash)// Whole JS numbers are sent as integers: pass floats like 1.5 (or n + 0.0000001), never 1.
const hash = Citizen.invokeNative("0x5E3BDDBCB83F3D84", // GIVE_WEAPON_TO_PED
PlayerPedId(), // Ped ped
GetHashKey("weapon_revolver_cattleman"), // Hash weaponHash
0, // int ammoCount
false, // BOOL bForceInHand
false, // BOOL bForceInHolster
0, // int attachPoint
false, // BOOL bAllowMultipleCopies
0.0, // float p7
0.0, // float p8
GetHashKey("name"), // Hash addReason
false, // BOOL bIgnoreUnlocks
0.0, // float permanentDegradation
false, // BOOL p12
Citizen.resultAsInteger()
);
console.log(hash)int hash = Function.Call<int>((Hash)0x5E3BDDBCB83F3D84, // GIVE_WEAPON_TO_PED
API.PlayerPedId(), // Ped ped
(uint)API.GetHashKey("weapon_revolver_cattleman"), // Hash weaponHash
0, // int ammoCount
false, // BOOL bForceInHand
false, // BOOL bForceInHolster
0, // int attachPoint
false, // BOOL bAllowMultipleCopies
0.0f, // float p7
0.0f, // float p8
(uint)API.GetHashKey("name"), // Hash addReason
false, // BOOL bIgnoreUnlocks
0.0f, // float permanentDegradation
false // BOOL p12
);Related WEAPON natives
- GIVE_WEAPON_TO_PED_WITH_OPTIONS
- GIVE_DELAYED_WEAPON_TO_PED
- _GIVE_WEAPON_COLLECTION_TO_PED
- _GIVE_WEAPON_COMPONENT_TO_WEAPON_OBJECT
- _GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION
- _GIVE_WEAPON_COMPONENT_TO_ENTITY
- IS_PED_WEAPON_READY_TO_SHOOT
- GET_AMMO_IN_PED_WEAPON
- GET_BEST_PED_WEAPON
- GET_CURRENT_PED_VEHICLE_WEAPON
- GET_CURRENT_PED_WEAPON
- GET_CURRENT_PED_WEAPON_ENTITY_INDEX
Facts compiled from community research (alloc8or/rdr3-nativedb-data, femga/rdr3_discoveries); descriptions and examples by The Lab.