# PLAYER::SET_PLAYER_CONTROL

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

## Signature

```c
void SET_PLAYER_CONTROL(Player player, BOOL toggle, int flags, BOOL bPreventHeadingChange);
```

## Parameters

- `player` (`Player`)
- `toggle` (`BOOL`)
- `flags` (`int`)
- `bPreventHeadingChange` (`BOOL`)

## Returns

`void`

## Description

flags: https://github.com/Halen84/RDR3-Native-Flags-And-Enums/tree/main/eSetPlayerControlFlags

## Usage

### Lua

```lua
SetPlayerControl(player, toggle, flags, bPreventHeadingChange)

-- always available, by hash
Citizen.InvokeNative(0x4D51E59243281D80, player, toggle, flags, bPreventHeadingChange)
```

### JavaScript

```js
SetPlayerControl(player, toggle, flags, bPreventHeadingChange);

// by hash
Citizen.invokeNative('0x4D51E59243281D80', player, toggle, flags, bPreventHeadingChange);
```

### C#

```csharp
Function.Call((Hash)0x4D51E59243281D80, player, toggle, flags, bPreventHeadingChange);
```

## Related enums

- [eSetPlayerControlFlags](https://natives.borderlinerp.com/enums/eSetPlayerControlFlags.md) — 13 values

*Sources: alloc8or RDR3 NativeDB.*
