{"hash":"0x9EEFD670F10656D7","ns":"WEAPON","name":"_GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION","slug":"_GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION","official":false,"named":true,"luaName":"GetWeaponFromDefaultPedWeaponCollection","game":"rdr3","apiset":"client","returnType":"Hash","params":[{"name":"weaponCollection","type":"Hash"},{"name":"weaponGroup","type":"Hash"}],"summary":"Returns a random weaponHash from default ped weapon collection (see _GET_DEFAULT_PED_WEAPON_COLLECTION).","descriptions":[{"source":"alloc8or","format":"text","body":"Returns a random weaponHash from default ped weapon collection (see _GET_DEFAULT_PED_WEAPON_COLLECTION)."},{"source":"vorp","format":"text","body":"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"}],"examples":[{"lang":"lua","code":"local pedWeaponCollectionHash = GetDefaultPedWeaponCollection(joaat(\"mp_u_m_m_interrogator_01\"))\nlocal hash = Citizen.InvokeNative(0x9EEFD670F10656D7, pedWeaponCollectionHash, joaat(\"GROUP_REVOLVER\"))\nif hash and IsWeaponValid(hash) then\nlocal name = GetWeaponName(hash)\nlocal label = GetLabelText_2(name)\nprint(name, label)\nend","source":"vorp"}],"aliases":[],"enums":[],"related":[],"build":"1207","sources":["alloc8or","vorp"],"doc":3,"url":"https://natives.borderlinerp.com/natives/WEAPON/_GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION","markdownUrl":"https://natives.borderlinerp.com/natives/WEAPON/_GET_WEAPON_FROM_DEFAULT_PED_WEAPON_COLLECTION.md","snippets":{"lua":"local retval = GetWeaponFromDefaultPedWeaponCollection(weaponCollection, weaponGroup)","luaInvoke":"local retval = Citizen.InvokeNative(0x9EEFD670F10656D7, weaponCollection, weaponGroup, Citizen.ResultAsInteger())","js":"const retval = GetWeaponFromDefaultPedWeaponCollection(weaponCollection, weaponGroup);","jsInvoke":"const retval = Citizen.invokeNative('0x9EEFD670F10656D7', weaponCollection, weaponGroup, Citizen.returnResultAnyway(), Citizen.resultAsInteger());","csharp":"int retval = Function.Call<int>((Hash)0x9EEFD670F10656D7, weaponCollection, weaponGroup);","notes":["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."]}}