# CFX::SET_PED_TO_RAGDOLL_WITH_FALL

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

## Signature

```c
void SET_PED_TO_RAGDOLL_WITH_FALL(Ped ped, int minTime, int maxTime, int nFallType, float dirX, float dirY, float dirZ, float fGroundHeight, float grab1X, float grab1Y, float grab1Z, float grab2X, float grab2Y, float grab2Z);
```

## Parameters

- `ped` (`Ped`) — The ped to ragdoll.
- `minTime` (`int`)
- `maxTime` (`int`)
- `nFallType` (`int`) — The type of fall.
- `dirX` (`float`) — The x direction of the fall.
- `dirY` (`float`) — The y direction of the fall.
- `dirZ` (`float`) — The z direction of the fall.
- `fGroundHeight` (`float`) — The ground height (z).
- `grab1X` (`float`) — unused
- `grab1Y` (`float`) — unused
- `grab1Z` (`float`) — unused
- `grab2X` (`float`) — unused
- `grab2Y` (`float`) — unused
- `grab2Z` (`float`) — unused

## Returns

`void`

## Description

*Source: Cfx.re native reference*

```cpp
enum eNMFallType {
TYPE_FROM_HIGH = 0,
TYPE_OVER_WALL = 1,
TYPE_DOWN_STAIRS = 2,
TYPE_DIE_TYPES = 3,
TYPE_DIE_FROM_HIGH = 4,
TYPE_DIE_OVER_WALL = 5,
TYPE_DIE_DOWN_STAIRS = 6
}
```

```
Return variable is never used in R*'s scripts.
Not sure what p2 does. It seems like it would be a time judging by it's usage in R*'s scripts, but didn't seem to affect anything in my testings.
x, y, and z are coordinates, most likely to where the ped will fall.
p7 is probably the force of the fall, but untested, so I left the variable name the same.
p8 to p13 are always 0f in R*'s scripts.
(Simplified) Example of the usage of the function from R*'s scripts:
ped::set_ped_to_ragdoll_with_fall(ped, 1500, 2000, 1, -entity::get_entity_forward_vector(ped), 1f, 0f, 0f, 0f, 0f, 0f, 0f);
```

**This is the server-side RPC native equivalent of the client native [SET_PED_TO_RAGDOLL_WITH_FALL](?\_0xD76632D99E4966C8).**

## Usage

### Lua

```lua
SetPedToRagdollWithFall(ped, minTime, maxTime, nFallType, dirX, dirY, dirZ, fGroundHeight, grab1X, grab1Y, grab1Z, grab2X, grab2Y, grab2Z)

-- always available, by hash
Citizen.InvokeNative(0xfa12e286, ped, minTime, maxTime, nFallType, dirX, dirY, dirZ, fGroundHeight, grab1X, grab1Y, grab1Z, grab2X, grab2Y, grab2Z)
```

### JavaScript

```js
SetPedToRagdollWithFall(ped, minTime, maxTime, nFallType, dirX, dirY, dirZ, fGroundHeight, grab1X, grab1Y, grab1Z, grab2X, grab2Y, grab2Z);

// by hash
Citizen.invokeNative('0xfa12e286', ped, minTime, maxTime, nFallType, dirX + 0.0000001, dirY + 0.0000001, dirZ + 0.0000001, fGroundHeight + 0.0000001, grab1X + 0.0000001, grab1Y + 0.0000001, grab1Z + 0.0000001, grab2X + 0.0000001, grab2Y + 0.0000001, grab2Z + 0.0000001);
```

### C#

```csharp
Function.Call((Hash)0xfa12e286, ped, minTime, maxTime, nFallType, dirX, dirY, dirZ, fGroundHeight, grab1X, grab1Y, grab1Z, grab2X, grab2Y, grab2Z);
```

- Float parameters: Lua integers (`10`, or whole numbers decoded from NUI/JSON) are sent as ints and read as garbage. Write `10.0` or `value + 0.0`. The generated JS wrappers add `0.0000001` to non-zero floats for the same reason.

*Sources: Cfx.re native reference.*
