# Ez-DivingMask

**Ce script est très simple a installer sur votre serveur, mais pour ça suivez attentivement cette documentation !**

##

## Configuration :

{% tabs %}
{% tab title="👨‍💻 Config.lua" %}
**Configurez le nom correct de votre group admin via ESX :**

```lua
GroupForAdminCommand = "admin",
```

\
\
\
**Configurez la fonction de reprise de tenue du joueur :**

```lua
BasicOutfit = function()
    ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
        TriggerEvent('skinchanger:loadSkin', skin)
    end)
end,
```

\
\
\
**Configurez la tenue de plongée :**

```lua
DivingMask = function()
        local model = GetEntityModel(PlayerPedId())
        TriggerEvent('skinchanger:getSkin', function(skin)
            if model == GetHashKey("mp_m_freemode_01") then -- skin male
                clothesSkin = {
                    ['tshirt_1'] = 151,	['tshirt_2'] = 0,
                }
            else -- skin female
                clothesSkin = {
                    ['tshirt_1'] = 153, ['tshirt_2'] = 0,
                }
            end
            TriggerEvent('skinchanger:loadClothes', skin, clothesSkin)
        end)
end,


-- si vous ne voulez pas de tenue physique :
--    DivingMask = false,
```

\
\
\
**Configurez la liste des items que vous voulez voi apparaitre sur votre serveur** : \
\&#xNAN;*- Veuillez créer les items au préalables, ils sont utilisables via ESX.RegisterUsableItem !*

```lua
ListOfDivingMask = {
--           nom de l'item     temps en minutes 
    {ItemName = "plongee1",     DivingTime = 1},
    {ItemName = "plongee2",     DivingTime = 0.5},
},
```

\
\
\
\
**Configurez votre système de notifications :**

```lua
Cl_CustomNotify = function(text, type)
    exports["okokNotify"]:Alert("EzDiving", text, 5000, type, true)

    lib.notify({
        title = 'EzDiving',
        description = text,
        type = type
    })
end,
```

\
\
\
**Configurez votre système de TextUI :**

```lua
EnableTextUI = true,
CustomTextUI = function(text)
    -- okokTextUI
    exports['okokTextUI']:Open(text, 'lightblue', 'right', true)
    -- ox_lib text ui
    lib.showTextUI(text, {
        position = "top-center",
        icon = 'theater-masks',
        style = {
            borderRadius = 0,
            backgroundColor = '#00FF93',
            color = 'black'
        }
    })
    -- codesign textui
    -- TriggerEvent('cd_drawtextui:ShowUI', 'show', text)
end,
```

\
\
\
**Ajoutez la fonction de suppression du TextUI :**

```lua
CustomHideUI = function()
    -- okokTextUI
    exports['okokTextUI']:Close()
    -- ox_lib text ui
    lib.hideTextUI()
    -- codesign textui
    -- TriggerEvent('cd_drawtextui:HideUI')
end,
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ezdeveloppement.gitbook.io/ezdev-script/script-ez-cosmetics/ez-divingmask.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
