# SCRIPT::COUNT_PLAYER_BITS

- **Hash:** `0x462C687BEA254BD9`
- **Namespace:** SCRIPT
- **Runtime name (Lua/JS):** `CountPlayerBits`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** named only
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/SCRIPT/COUNT_PLAYER_BITS

## Signature

```c
int COUNT_PLAYER_BITS(Any* value);
```

## Parameters

- `value` (`Any*`)

## Returns

`int`

## Usage

### Lua

```lua
local retval, value = CountPlayerBits(value)

-- always available, by hash
local retval, value = Citizen.InvokeNative(0x462C687BEA254BD9, Citizen.PointerValueIntInitialized(value), Citizen.ResultAsInteger())
```

### JavaScript

```js
const [retval, value] = CountPlayerBits(value);

// by hash
const [retval, value] = Citizen.invokeNative('0x462C687BEA254BD9', Citizen.pointerValueIntInitialized(value), Citizen.returnResultAnyway(), Citizen.resultAsInteger());
```

### C#

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

- The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
- `Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below.

*Sources: alloc8or RDR3 NativeDB.*
