# CFX::GET_SELECTED_PED_WEAPON

- **Hash:** `0xD240123E`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetSelectedPedWeapon`
- **Side:** server (Cfx runtime native)
- **Name status:** official
- **Documentation:** described
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_SELECTED_PED_WEAPON

## Signature

```c
Hash GET_SELECTED_PED_WEAPON(Ped ped);
```

## Parameters

- `ped` (`Ped`) — The target ped.

## Returns

`Hash` — The weapon hash.

## Description

*Source: Cfx.re native reference*

An alias of [GET_CURRENT_PED_WEAPON](#\_0xB0237302).

Note, the client-side [GET_SELECTED_PED_WEAPON](#\_0x0A6DB4965674D243) native returns the weapon selected via the HUD (weapon wheel). This data is not available to FXServer.

## Usage

### Lua

```lua
local retval = GetSelectedPedWeapon(ped)

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

### JavaScript

```js
const retval = GetSelectedPedWeapon(ped);

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

### C#

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

*Sources: Cfx.re native reference.*
