_SET_PLAYER_HAT_ACCESS
Sets the player's ability to wear hats based on the specified flag.
0xA0C683284DF027C7SetPlayerHatAccessSignature
void _SET_PLAYER_HAT_ACCESS(Player player, int flag, BOOL enable);Parameters
| Name | Type | Description |
|---|---|---|
player | Player | — |
flag | int | — |
enable | BOOL | — |
Returns void
Description
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
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
SetPlayerHatAccess(player, flag, enable)
-- always works, by hash
Citizen.InvokeNative(0xA0C683284DF027C7, player, flag, enable)JavaScript and C#
SetPlayerHatAccess(player, flag, enable);
// by hash
Citizen.invokeNative('0xA0C683284DF027C7', player, flag, enable);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
InvokeNativewith the hash — it always works.
Sources
alloc8or RDR3 NativeDB · VORPCORE RDR3natives
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.