# WEAPON::_GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION

- **Hash:** `0x9EEFD670F10656D7`
- **Namespace:** WEAPON
- **Runtime name (Lua/JS):** `GetWeaponFromDefaultPedWeaponCollection`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described with examples
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/WEAPON/_GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION

## Signature

```c
Hash _GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION(Hash weaponCollection, Hash weaponGroup);
```

## Parameters

- `weaponCollection` (`Hash`)
- `weaponGroup` (`Hash`)

## Returns

`Hash`

## Description

*Source: alloc8or RDR3 NativeDB*

Returns a random weaponHash from default ped weapon collection (see _GET_DEFAULT_PED_WEAPON_COLLECTION).

*Source: VORPCORE RDR3natives*

this native gets the weapon hash from the default ped weapon collection (see GetDefaultPedWeaponCollection for more info) will randomly return one of it's weapons

## Usage

### Lua

```lua
local retval = GetWeaponFromDefaultPedWeaponCollection(weaponCollection, weaponGroup)

-- always available, by hash
local retval = Citizen.InvokeNative(0x9EEFD670F10656D7, weaponCollection, weaponGroup, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetWeaponFromDefaultPedWeaponCollection(weaponCollection, weaponGroup);

// by hash
const retval = Citizen.invokeNative('0x9EEFD670F10656D7', weaponCollection, weaponGroup, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x9EEFD670F10656D7, weaponCollection, weaponGroup);
```

- 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` ``.
- The name is a community guess and may change. If the named call is missing in your client build, use `InvokeNative` with the hash — it always works.

## Examples

*Source: VORPCORE RDR3natives*

```lua
local pedWeaponCollectionHash = GetDefaultPedWeaponCollection(joaat("mp_u_m_m_interrogator_01"))
local hash = Citizen.InvokeNative(0x9EEFD670F10656D7, pedWeaponCollectionHash, joaat("GROUP_REVOLVER"))
if hash and IsWeaponValid(hash) then
local name = GetWeaponName(hash)
local label = GetLabelText_2(name)
print(name, label)
end
```

*Sources: alloc8or RDR3 NativeDB, VORPCORE RDR3natives.*
