RedM Natives

_GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION

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

Hash0x9EEFD670F10656D7
Runtime nameGetWeaponFromDefaultPedWeaponCollection
NamespaceWEAPON
SideClient
NameCommunity guess
Docs
Since build1207

Signature

Hash _GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION(Hash weaponCollection, Hash weaponGroup);

Parameters

NameTypeDescription
weaponCollectionHash—
weaponGroupHash—

Returns Hash

Description

alloc8or RDR3 NativeDB

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

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
local retval = GetWeaponFromDefaultPedWeaponCollection(weaponCollection, weaponGroup)

-- always works, by hash
local retval = Citizen.InvokeNative(0x9EEFD670F10656D7, weaponCollection, weaponGroup, Citizen.ResultAsInteger())
JavaScript and C#
JavaScript
const retval = GetWeaponFromDefaultPedWeaponCollection(weaponCollection, weaponGroup);

// by hash
const retval = Citizen.invokeNative('0x9EEFD670F10656D7', weaponCollection, weaponGroup, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
C#
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

LUA · VORPCORE RDR3natives
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

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