# WEAPON::_GET_WEAPON_REPLACED_HASH

- **Hash:** `0x9F0E1892C7F228A8`
- **Namespace:** WEAPON
- **Runtime name (Lua/JS):** `GetWeaponReplacedHash`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **Other names:** `_GET_WEAPON_LAST_GIVEN`
- **URL:** https://natives.borderlinerp.com/natives/WEAPON/_GET_WEAPON_REPLACED_HASH

## Signature

```c
Hash _GET_WEAPON_REPLACED_HASH(BOOL clear);
```

## Parameters

- `clear` (`BOOL`)

## Returns

`Hash`

## Description

*Source: alloc8or RDR3 NativeDB*

Returns the last weapon hash that was replaced due to a slot/holster swap when giving/equipping a weapon (set internally during weapon give/equip when another weapon gets displaced).
If clear==true, the stored value is reset to 0 after reading (consume semantics); if clear==false, it is not cleared.
Returns 0 if no replacement is pending.

*Source: VORPCORE RDR3natives*

gets the last weapon given to ped , if you give a weapon_lasso to ped and then give another it returns the weapon_lasso other wise 0,p0 usually is 1 is unknown, it does not work for all weapons.

## Usage

### Lua

```lua
local retval = GetWeaponReplacedHash(clear)

-- always available, by hash
local retval = Citizen.InvokeNative(0x9F0E1892C7F228A8, clear, Citizen.ResultAsInteger())
```

### JavaScript

```js
const retval = GetWeaponReplacedHash(clear);

// by hash
const retval = Citizen.invokeNative('0x9F0E1892C7F228A8', clear, Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

```csharp
int retval = Function.Call<int>((Hash)0x9F0E1892C7F228A8, clear);
```

- 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.

*Sources: alloc8or RDR3 NativeDB, VORPCORE RDR3natives.*
