# SCRIPT::_SET_PLAYER_BIT_AT_INDEX

- **Hash:** `0x31010318BA9897AC`
- **Namespace:** SCRIPT
- **Runtime name (Lua/JS):** `SetPlayerBitAtIndex`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** named only
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/SCRIPT/_SET_PLAYER_BIT_AT_INDEX

## Signature

```c
void _SET_PLAYER_BIT_AT_INDEX(Any* value, int bitIndex);
```

## Parameters

- `value` (`Any*`)
- `bitIndex` (`int`)

## Returns

`void`

## Usage

### Lua

```lua
local value = SetPlayerBitAtIndex(bitIndex)

-- always available, by hash
local value = Citizen.InvokeNative(0x31010318BA9897AC, Citizen.PointerValueInt(), bitIndex)
```

### JavaScript

```js
const value = SetPlayerBitAtIndex(bitIndex);

// by hash
const value = Citizen.invokeNative('0x31010318BA9897AC', Citizen.pointerValueInt(), bitIndex);
```

### C#

```csharp
var value = new OutputArgument();
Function.Call((Hash)0x31010318BA9897AC, value, bitIndex);
// value.GetResult<int>()
```

- Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.
- `Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below.
- 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.

## See also

- [SCRIPT::_CLEAR_PLAYER_BIT_AT_INDEX](https://natives.borderlinerp.com/natives/SCRIPT/_CLEAR_PLAYER_BIT_AT_INDEX.md)

*Sources: alloc8or RDR3 NativeDB.*
