Unsuitable Clothing & Clothing Hashes via a Script

Enabling or Disabling Unsuitable Clothing Check

You can enable or disable the unsuitable clothing check by setting the Config.EnableUnsuitableClothingCheck option in the config.lua file.

Config.EnableUnsuitableClothingCheck = true -- Set to false to disable the check

Defining Unsuitable Clothing

You can define unsuitable clothing for both extreme heat and extreme cold conditions. The clothing items should be specified by their drawable variation hashes or names.

Getting Clothing Hashes

Using Ped Component Variations

Each ped component (such as tops, pants, etc.) has an ID, drawable, and texture variation. You can retrieve the drawable variation for a specific component using the following method:

Step-by-Step Guide

  1. Change the player's clothing: Use a development tool such as the FiveM Native Trainer or a similar resource that allows you to view and change player clothing.

  2. Use the script: Run the following script to get the drawable variation for the desired component.

THE EASY METHOD

Use a clothing menu such as qb-clothing too view the component (eg t-shirt or jacket) and the number that is attached to it. This is the drawable

Example Script

You can add this script to your client-side code to print the drawable variations of different components:

Citizen.CreateThread(function()
    while true do
        Wait(5000) -- Check every 5 seconds
        
        local player = PlayerPedId()

        -- Component IDs
        local components = {
            {id = 1, name = "Mask"},
            {id = 3, name = "Upper Body"},
            {id = 4, name = "Lower Body"},
            {id = 5, name = "Bag"},
            {id = 6, name = "Shoes"},
            {id = 7, name = "Accessory"},
            {id = 8, name = "Undershirt"},
            {id = 9, name = "Body Armor"},
            {id = 10, name = "Decal"},
            {id = 11, name = "Top"}
        }

        for _, component in ipairs(components) do
            local drawable = GetPedDrawableVariation(player, component.id)
            local texture = GetPedTextureVariation(player, component.id)
            print(component.name .. " - Drawable: " .. drawable .. ", Texture: " .. texture)
        end
    end
end)

Output Example

When you run the above script, it will print the drawable and texture variations for each component:

Mask - Drawable: 0, Texture: 0
Upper Body - Drawable: 15, Texture: 0
Lower Body - Drawable: 21, Texture: 0
Bag - Drawable: 0, Texture: 0
Shoes - Drawable: 34, Texture: 0
Accessory - Drawable: 0, Texture: 0
Undershirt - Drawable: 59, Texture: 0
Body Armor - Drawable: 0, Texture: 0
Decal - Drawable: 0, Texture: 0
Top - Drawable: 11, Texture: 0

Customizing Unsuitable Clothing Definitions

You can define unsuitable clothing using the drawable variations retrieved from the script above. Here's how you can update the config.lua with these values:

Config.UnsuitableClothing = {
    EXTREME_HEAT = {
        {component = 11, drawable = 15}, -- Example: Top with drawable 15
        {component = 8, drawable = 59},  -- Example: Undershirt with drawable 59
        -- Add more as needed
    },
    EXTREME_COLD = {
        {component = 11, drawable = 11}, -- Example: Top with drawable 11
        {component = 4, drawable = 21},  -- Example: Lower body with drawable 21
        -- Add more as needed
    }
}

Last updated