_GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION
Returns a random weaponHash from default ped weapon collection (see _GET_DEFAULT_PED_WEAPON_COLLECTION).
Hash
0x9EEFD670F10656D7Runtime name
GetWeaponFromDefaultPedWeaponCollectionNamespaceWEAPON
SideClient
NameCommunity guess
Docs
Since build1207
Signature
Hash _GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION(Hash weaponCollection, Hash weaponGroup);Parameters
| Name | Type | Description |
|---|---|---|
weaponCollection | Hash | — |
weaponGroup | Hash | — |
Returns Hash
Description
Returns a random weaponHash from default ped weapon collection (see _GET_DEFAULT_PED_WEAPON_COLLECTION).
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
local retval = GetWeaponFromDefaultPedWeaponCollection(weaponCollection, weaponGroup)
-- always works, by hash
local retval = Citizen.InvokeNative(0x9EEFD670F10656D7, weaponCollection, weaponGroup, Citizen.ResultAsInteger())JavaScript and C#
const retval = GetWeaponFromDefaultPedWeaponCollection(weaponCollection, weaponGroup);
// by hash
const retval = Citizen.invokeNative('0x9EEFD670F10656D7', weaponCollection, weaponGroup, Citizen.returnResultAnyway(), Citizen.resultAsInteger());int retval = Function.Call<int>((Hash)0x9EEFD670F10656D7, weaponCollection, weaponGroup);- Hash parameters: the named function also accepts a string and hashes it for you;
Citizen.InvokeNativeneeds the number — passjoaat("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
InvokeNativewith the hash — it always works.
Examples
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)
endSources
alloc8or RDR3 NativeDB · VORPCORE RDR3natives
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.