# PLAYER::_SET_PLAYER_HAT_ACCESS

- **Hash:** `0xA0C683284DF027C7`
- **Namespace:** PLAYER
- **Runtime name (Lua/JS):** `SetPlayerHatAccess`
- **Side:** client (game native)
- **Name status:** community guess (may change)
- **Documentation:** described
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/PLAYER/_SET_PLAYER_HAT_ACCESS

## Signature

```c
void _SET_PLAYER_HAT_ACCESS(Player player, int flag, BOOL enable);
```

## Parameters

- `player` (`Player`)
- `flag` (`int`)
- `enable` (`BOOL`)

## Returns

`void`

## Description

*Source: alloc8or RDR3 NativeDB*

Sets the player's ability to wear hats based on the specified flag. The flag value determines whether the player can wear all hats or only the ones they own.

If the flag is set to 15 and `allow` is true, the player can wear all available hats. To restrict the player to wearing only owned hats (flag 1), you must first disable flag 15 by setting it to false, then set flag 1 to true.

Example usage:

Allow the player to wear all hats
PLAYER::_SET_PLAYER_HAT_ACCESS(PLAYER::PLAYER_ID(), 15, true);

Restrict the player to only wearing owned hats
PLAYER::_SET_PLAYER_HAT_ACCESS(PLAYER::PLAYER_ID(), 15, false);
PLAYER::_SET_PLAYER_HAT_ACCESS(PLAYER::PLAYER_ID(), 1, true);

Video: https://imgur.com/gallery/0xa0c683284df027c7-dhV5NAL

*Source: VORPCORE RDR3natives*

Sets the player's ability to wear hats based on the specified flag. The flag value determines whether the player can wear all hats or only the ones they own.
If the flag is set to 15 and `allow` is true, the player can wear all available hats. However, if you want to restrict the player to wearing only their owned hats (flag 1), you **must first** disable flag 15 by setting it to false, and then set flag 1 to true.

## Usage

### Lua

```lua
SetPlayerHatAccess(player, flag, enable)

-- always available, by hash
Citizen.InvokeNative(0xA0C683284DF027C7, player, flag, enable)
```

### JavaScript

```js
SetPlayerHatAccess(player, flag, enable);

// by hash
Citizen.invokeNative('0xA0C683284DF027C7', player, flag, enable);
```

### C#

```csharp
Function.Call((Hash)0xA0C683284DF027C7, player, flag, enable);
```

- 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.

*Sources: alloc8or RDR3 NativeDB, VORPCORE RDR3natives.*
