RedM Natives

_SET_PLAYER_HAT_ACCESS

Sets the player's ability to wear hats based on the specified flag.

Hash0xA0C683284DF027C7
Runtime nameSetPlayerHatAccess
NamespacePLAYER
SideClient
NameCommunity guess
Docs
Since build1207

Signature

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

Parameters

NameTypeDescription
playerPlayer—
flagint—
enableBOOL—

Returns void

Description

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

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
SetPlayerHatAccess(player, flag, enable)

-- always works, by hash
Citizen.InvokeNative(0xA0C683284DF027C7, player, flag, enable)
JavaScript and C#
JavaScript
SetPlayerHatAccess(player, flag, enable);

// by hash
Citizen.invokeNative('0xA0C683284DF027C7', player, flag, enable);
C#
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

Something wrong or missing? Contribute a verified note — corrections ship through pull requests.