# Configuration

***

### 1. Configure `cl_config.lua`

In this section, you will configure the client-side configuration file `cl_config.lua`. Follow the instructions below to set it up according to your framework (ESX or QBcore).

{% tabs %}
{% tab title="cl_config.lua" %}
```lua
Config = {}

Config.Header = {
    title = "RESMONSTUDIO",        -- The title displayed in the header
    name = "Car Wash"               -- The name of the system in the header
}

Config.Options = {
    Language = 'en',                          -- Default language for the system (e.g., 'en', 'de', 'fr', etc.)
    UseOldEsx = false,                        -- Use the old ESX export method or the new one
    SharedObject = {
        ["client"] = "esx:getSharedObject",   -- Client-side shared object for ESX
        ["server"] = "esx:getSharedObject",   -- Server-side shared object for ESX
    },

    Packages = {
        [1] = { 
            Name = "Basic",                   -- Name of the package
            Price = 1500,                     -- Price for the Basic car wash package
            WashDuration = 5                  -- Duration (in seconds) for the Basic wash
        },
        [2] = { 
            Name = "Standard",                -- Name of the package
            Price = 3000,                     -- Price for the Standard car wash package
            WashDuration = 10                 -- Duration (in seconds) for the Standard wash
        },
        [3] = { 
            Name = "Premium",                 -- Name of the package
            Price = 5000,                     -- Price for the Premium car wash package
            WashDuration = 20                 -- Duration (in seconds) for the Premium wash
        },
    },

    Positions = {
        vector3(24.81, -1391.95, 28.32),      -- Location 1: Carwash position coordinates
        vector3(-699.87, -933.48, 18.01),     -- Location 2: Carwash position coordinates
    },
}

Config.Blip = {
    enabled = true,    -- Enable or disable the blip on the map
    sprite = 100,      -- Blip sprite ID for the car wash icon
    display = 4,       -- Display type (whether the blip is visible on the minimap, main map, etc.)
    scale = 0.8,       -- Scale of the blip icon
    color = 1,         -- Blip color ID (defines the color of the icon)
    shortrange = true, -- Should the blip only show when close by?
    text = "Carwash",  -- Blip name displayed on the map
}

Config.Marker = {
    Type = 1,                         -- Marker type (game-defined)
    Size = vector3(5.0, 5.0, 0.2),    -- Size of the marker (width, depth, height)
    Color = { r = 255, g = 255, b = 255, a = 155 }, -- Color of the marker (RGBA values) [White]
    BobUpAndDown = false,             -- Should the marker bob up and down?
    FaceCamera = false,               -- Should the marker face the player's camera?
    Rotate = 2,                       -- Marker rotation type (game-defined)
    TextureDict = false,              -- Texture dictionary for custom textures (nil for default)
    TextureName = false,              -- Texture name to apply to the marker (nil for default)
    DrawOnEntities = false            -- Should the marker be drawn on entities?
}

Config.Progressbar = {
    Enabled = false,                  -- Enable or disable the progress bar

    func = function(message, duration)
        if Config.Progressbar.Enabled then
            exports["rs_hud"]:Progressbar(true, message, duration * 1000)
        end
    end
}

-- Function to send a notification to the player
function SendNotification(message)
    TriggerEvent('esx:showNotification', message)
    -- TriggerEvent('rs_notify', 'Carwash', message , 'info', 5000)
end

-- Function to show a help notification
function ShowHelpNotify(msg, E)
    ESX.ShowHelpNotification(msg, E)
    -- exports["rs_hud"]:HelpNotify(msg, E)
end
```
{% endtab %}
{% endtabs %}

***

### 2. Configure `sv_config.lua`

In this section, you will configure the server-side configuration file `sv_config.lua`. Follow the instructions below to set it up according to your framework (ESX or QBcore)

{% tabs %}
{% tab title="sv_config.lua" %}
```lua
CFG = {}

CFG.Webhooks = {
    Color = "16777215",
    Author = "ResmonStudio",
    AuthorURL = "https://i.ibb.co/PZDN7K4/logo.png",
    ThumbURL = "https://i.ibb.co/PZDN7K4/logo.png",
    Username = "RS | Logs",
    Webhooks = {
        pay = {'PUT_YOUR_WEBHOOK'},
    }
}
```
{% endtab %}
{% endtabs %}

***

### 3. Select Languages in `sh_languages.lua`

In the `sh_languages.lua` file, you can manage all available language options. To set your preferred language and its corresponding translations, navigate to `cl_config.lua` and specify your desired locale. This allows you to customize the different languages.

{% tabs %}
{% tab title="sh_languages.lua" %}
```lua
Config.Languages = {
    ['en'] = {  -- English
        ["WashStarted"] = "Started Carwash Program: %s for $%s",
        ["WashSuccess"] = "Your vehicle has been washed. Always drive safe!",
        ["NotEnoughMoney"] = "You do not have enough cash!",
        ["AlreadyProcess"] = "Another car wash is already in progress.",
        ["HelpNotify"] = "Press ~INPUT_CONTEXT~ to wash your car",
        ["WashingNow"] = "Your car is being washed ...",
    },
    ['de'] = {  -- German
        ["WashStarted"] = "Autowaschanlage gestartet: %s für $%s",
        ["WashSuccess"] = "Ihr Fahrzeug wurde gewaschen. Fahren Sie sicher!",
        ["NotEnoughMoney"] = "Du hast nicht genug Geld!",
        ["AlreadyProcess"] = "Es läuft bereits eine andere Autowäsche.",
        ["HelpNotify"] = "Drücke ~INPUT_CONTEXT~, um dein Auto zu waschen",
        ["WashingNow"] = "Ihr Auto wird gewaschen ...",
    },
    ['es'] = {  -- Spanish
        ["WashStarted"] = "Programa de lavado iniciado: %s por $%s",
        ["WashSuccess"] = "Tu vehículo ha sido lavado. ¡Conduce con cuidado!",
        ["NotEnoughMoney"] = "¡No tienes suficiente dinero!",
        ["AlreadyProcess"] = "Ya hay otro lavado de autos en progreso.",
        ["HelpNotify"] = "Presiona ~INPUT_CONTEXT~ para lavar tu auto",
        ["WashingNow"] = "Tu auto está siendo lavado ...",
    },
    ['fr'] = {  -- French
        ["WashStarted"] = "Programme de lavage lancé : %s pour $%s",
        ["WashSuccess"] = "Votre véhicule a été lavé. Conduisez prudemment !",
        ["NotEnoughMoney"] = "Vous n'avez pas assez d'argent !",
        ["AlreadyProcess"] = "Un autre lavage est déjà en cours.",
        ["HelpNotify"] = "Appuyez sur ~INPUT_CONTEXT~ pour laver votre voiture",
        ["WashingNow"] = "Votre voiture est en train d'être lavée ...",
    },
    ['it'] = {  -- Italian
        ["WashStarted"] = "Programma di lavaggio avviato: %s per $%s",
        ["WashSuccess"] = "Il tuo veicolo è stato lavato. Guida con prudenza!",
        ["NotEnoughMoney"] = "Non hai abbastanza soldi!",
        ["AlreadyProcess"] = "Un altro lavaggio auto è già in corso.",
        ["HelpNotify"] = "Premi ~INPUT_CONTEXT~ per lavare il tuo veicolo",
        ["WashingNow"] = "Il tuo veicolo è in fase di lavaggio ...",
    },
    ['nl'] = {  -- Dutch
        ["WashStarted"] = "Autowasprogramma gestart: %s voor $%s",
        ["WashSuccess"] = "Uw voertuig is gewassen. Rijd veilig!",
        ["NotEnoughMoney"] = "Je hebt niet genoeg geld!",
        ["AlreadyProcess"] = "Er wordt al een andere autowas uitgevoerd.",
        ["HelpNotify"] = "Druk op ~INPUT_CONTEXT~ om uw auto te wassen",
        ["WashingNow"] = "Uw auto wordt gewassen ...",
    },
    ['pt'] = {  -- Portuguese
        ["WashStarted"] = "Programa de lavagem iniciado: %s por $%s",
        ["WashSuccess"] = "Seu veículo foi lavado. Dirija com segurança!",
        ["NotEnoughMoney"] = "Você não tem dinheiro suficiente!",
        ["AlreadyProcess"] = "Outro lava-rápido já está em andamento.",
        ["HelpNotify"] = "Pressione ~INPUT_CONTEXT~ para lavar seu veículo",
        ["WashingNow"] = "Seu veículo está sendo lavado ...",
    },
    ['ru'] = {  -- Russian
        ["WashStarted"] = "Программа мойки начата: %s за $%s",
        ["WashSuccess"] = "Ваш автомобиль был помыт. Всегда водите аккуратно!",
        ["NotEnoughMoney"] = "У вас недостаточно денег!",
        ["AlreadyProcess"] = "Мойка автомобиля уже выполняется.",
        ["HelpNotify"] = "Нажмите ~INPUT_CONTEXT~, чтобы помыть машину",
        ["WashingNow"] = "Ваша машина моется ...",
    },
}
```
{% endtab %}
{% endtabs %}
