# DPS HUD

<details>

<summary>Config</summary>

```lua
Config = {

    HudUpdateFrequency = 500, -- In milliseconds

    OpenMenu = {
        event = {
            enable = false,
            name = "ifscripts:openSettingsMenu"
        },
        export = {
            enable = false,
            name = "openSettingsMenu"
        },
        command = {
            enable = true,
            name = "openHudSettings",
            
            keybind = {
                enable = true,
                key = "F7"
            }
        },
    },

    Seatbelt = {
        enable = true,
        command = "belt",

        keybind = {
            enable = true,
            key = "B"
        }
    },

    DefaultSettings = {
        hudType = "1", -- 1/2/3
        speed = "2", -- 1 = hide / 2 = show
        job = "2", -- 1 = hide / 2 = show
        colors = {
            gps = "#ff9d00",
            job = "#00d0ff",
            cash = "#04ff00",
            bank = "#027800",
            armour = "#1e00ff",
            thirst = "#00fbff",
            health = "#d30000",
            hunger = "#bd6800",
            oxygen = "#FFFFFF",
            stress = "#ff00ff",
        },
        mapType = "1", -- 1 = squared / 2 = circle
    },

    MapOnFoot = false,

    SpeedUnit = "km", -- km = kilometres - mi = miles

    UseStress = false,

    Nitro = {
        UseNitro = true,
        Key = 21,
        MaxSpeed = 430.0, -- In km/h
        Boost = 14.0,
        RemovePerc = 0.03,
        CustomNitroSet = false,

        --[[
            if CustomNitroSet = true,

            u have to use:

                exports.ifscripts_hud:setNitro(VALUE, PLATE)

                VALUE: from 0 to 100
        ]]

        CustomNitroSystem = false, -- Nitro is only HUD
    },

    CruiseControl = {
        command = "cruise",
        keybind = "J",
    },

    CustomStatusSystem = false,
    --[[
        if CustomStatusSystem = true,

        u have to use:

            exports.ifscripts_hud:set(TYPE, VALUE)

            TYPE:
                - hunger
                - thirst
                - stress

            VALUE: from 0 to 100
    ]]

    Lang = {

        ServerName = "ServerName",
        Subtitle = "ROLEPLAY",
        Cash = "Cash",
        Bank = "Bank",
        Current = "$",
        Id = "ID",

        -- Settings
        Setting = "Setting",
        SettingsTitle = "SETTING THE",
        SettingsSubtitle = "HUD DISPLAY",
        HudType = "HUD TYPE",
        HudTypeDescription = "Description....",
        SpeedType = "SPEED TYPE",
        SpeedTypeDescription = "Description....",
        CinematicMode = "CINEMATIC MODE",
        CinematicModeDescription = "Description....",
        ShowJob = "SHOW JOB",
        ShowJobDescription = "Description....",
        HudColors = "HUD COLORS",
        HudColorsDescription = "Description....",
        MapType = "MAP TYPE",
        MapTypeDescription = "Description....",
        Squared = "SQUARED",
        Circle = "CIRCLE",
        Hide = "Hide",
        Show = "Show",
        DefaultSettings = "Default Settings",
        SaveSettings = "SAVE SETTINGS",

        keybindLabel_Menu = "Open Settings Menu",
        keybindLabel_Belt = "Seatbelt",
        keybindLabel_CruiseControl = "Cruise Control",
        UnknownStreet = "Unknown Street",
        Online = "Online",

        Talking = "You're talking",
        DontTalking = "You don't talking",

        -- Notifications
        Seatbelt = "You toggle the seatbelt",
        CruiseControl = "You toggle the cruise control",
        ResetSetting = "You have reset the settings",
        SaveSetting = "You have saved the settings",
        NoChangeSetting = "No changes have been applied",
    }


}
```

</details>

<details>

<summary>Stress</summary>

1. Use this:

```lua
exports.ifscripts_hud:set("stress", VALUE)
 --VALUE: from 0 to 100
```

</details>

<details>

<summary>Status System</summary>

1. If you use ESX/QBCore Base status system set CustomStatusSystem = false,\
   otherwise set CustomStatusSystem = true,\
   \
   and use this:

```lua
exports.ifscripts_hud:set(TYPE, VALUE)

--[[

  TYPE:
    - hunger
    - thirst
    - stress

  VALUE: from 0 to 100

]]

```

</details>

<details>

<summary>Progress Bar</summary>

## Event

```lua
TriggerEvent("ifscripts_hud:progressbar", message-string, time-number-(in milliseconds), cb-function-(called on progressbar end))


1. TriggerEvent("ifscripts_hud:progressbar", "Loading...", 10000, function()
        print("ProgressBar is end")
    end)

```

## Exports

```lua
exports.ifscripts_hud:progressbar(message-string, time-number-(in milliseconds))


1. exports.ifscripts_hud:progressbar("Loading...", 10000) -- is like Wait(10000) but with progressbar

2. exports.ifscripts_hud:progressbar("Loading...", 10000, function()
        print("ProgressBar is end")
    end)

```

</details>

<details>

<summary>Notification</summary>

## Event

```lua
TriggerEvent("ifscripts_hud:notify", message-string, type-string-(error/success/info/input), title-string, time-number-(in milliseconds), cb-function-(ONLY INPUT TYPE)-(return true or false or null(timeout)))

1. TriggerEvent("ifscripts_hud:notify", "Hello", "success", 1000, "Bank")

2. TriggerEvent("ifscripts_hud:notify", "Are you sure?", "input", 10000, "Question", function(result)
        print(result) -- <== true or false or null
    end)

```

## Exports

```lua
local result = exports.ifscripts_hud:notify(message-string, type-string-(error/success/info/input), title-string, time-number-(in milliseconds))
ONLY INPUT (return true or false or null(timeout))


1. exports.ifscripts_hud:notify("Hello", "success", 1000, "Bank")

2. local result = exports.ifscripts_hud:notify("Are you sure?", "input", 10000, "Question")
    print(result) -- <== true or false or null

3. exports.ifscripts_hud:notify("Are you sure?", "input", 10000, "Question", function(result)
        print(result) -- <== true or false or null
    end)

```

</details>


---

# 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://if-developments.gitbook.io/docs/resources/dps-hud.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.
