# PED::IS_PED_IN_MELEE_COMBAT

- **Hash:** `0x4E209B2C1EAD5159`
- **Namespace:** PED
- **Runtime name (Lua/JS):** `IsPedInMeleeCombat`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/PED/IS_PED_IN_MELEE_COMBAT

## Signature

```c
BOOL IS_PED_IN_MELEE_COMBAT(Ped ped);
```

## Parameters

- `ped` (`Ped`)

## Returns

`BOOL`

## Description

Notes: The function only returns true while the ped is: 
A.) Swinging a random melee attack (including pistol-whipping)

B.) Reacting to being hit by a melee attack (including pistol-whipping)

C.) Is locked-on to an enemy (arms up, strafing/skipping in the default fighting-stance, ready to dodge+counter). 

You don't have to be holding the melee-targeting button to be in this stance; you stay in it by default for a few seconds after swinging at someone. If you do a sprinting punch, it returns true for the duration of the punch animation and then returns false again, even if you've punched and made-angry many peds

## Usage

### Lua

```lua
local retval = IsPedInMeleeCombat(ped)

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

### JavaScript

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

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

### C#

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

*Sources: alloc8or RDR3 NativeDB.*
