Notify

{:links-list}

INSTALLATION

  1. Open the downloaded ZIP product file and drop the folder in it somewhere in your resources folder.
  2. Add your product key (get it here) to the settings.ini file
  3. Add start BigDaddy-Notify to your server.cfg.

DO NOT RENAME THE FOLDER.

If you change the name of the folder it will not function correctly so leave the name as it is.

{:is-danger}

CONFIGURATION

Edit BigDaddy-Notify/settings.ini, then restart BigDaddy-Notify for changes to take effect.

SETTING DEFAULT DESCRIPTION
[licensing]
key1 productkeyhere Replace with your product key.
[settings]
defaultPosition top-right Default notification position when positionClass is omitted. See the supported positions below.
accentColor #ff5a00 Accent for notification borders, highlights, and the circular task indicator. Accepts a three- or six-digit hex color, such as #f80 or #00aaff. Invalid values fall back to #ff5a00 (Big Daddy orange).

Supported positions: top-right, bottom-right, bottom-left, top-left, top-full-width, bottom-full-width, top-center, and bottom-center.

The accent color does not change notification countdown bar colors: error is red, success is green, warning is yellow, and info is blue. Countdown bars appear when progressBar = true.

For example, to change the default position and accent, edit these values in the existing [settings] section:

defaultPosition=bottom-center
accentColor=#00aaff

EXPORTS

These are client-side exports. Start BigDaddy-Notify before resources that call them. Export names are case-sensitive; use bdNotify and bdProgress exactly as shown. Both return void.

Notifications: bdNotify

exports['BigDaddy-Notify']:bdNotify(options) displays a notification.

OPTION VALID VALUES / DESCRIPTION DEFAULT
type String: success, error, warning, info. success
positionClass String: any supported position listed above. Overrides defaultPosition for this notification. defaultPosition from settings.ini (top-right by default)
message String: notification text. Empty Notification
timeOut Integer: display time in milliseconds. 5000
progressBar Boolean: true to show a countdown bar, false to hide it. false
showEasing String: swing, linear. swing
hideEasing String: swing, linear. swing
showMethod String: jQuery show method, such as fadeIn, slideDown, or show. fadeIn
hideMethod String: jQuery hide method, such as fadeOut, slideUp, or hide. fadeOut

Task progress: bdProgress

exports['BigDaddy-Notify']:bdProgress(options) shows, updates, or hides the circular task indicator.

OPTION VALID VALUES / DESCRIPTION DEFAULT
isVisible Boolean: true to show or update the indicator, false to hide it. false
text String: task label. Include it with each update to keep the label visible. Empty string
percent Integer: use 0 through 100 for task completion. 0

Your script controls progress by calling bdProgress with updated values. The indicator does not advance automatically or hide at 100%; hide it with isVisible = false when finished. It appears near the top-right of the screen and is not moved by defaultPosition. Its color follows accentColor.

EXAMPLES

Lua notification

exports['BigDaddy-Notify']:bdNotify({
    message = "Vehicle repaired!",
    type = "success",
    timeOut = 5000,
    progressBar = true
})

C# notification

Exports["BigDaddy-Notify"].bdNotify(new
{
    message = "Vehicle repaired!",
    type = "success",
    timeOut = 5000,
    progressBar = true
});

Lua task progress

This example simulates a task. Replace the loop with updates from your own task logic.

CreateThread(function()
    for percent = 0, 100, 10 do
        exports['BigDaddy-Notify']:bdProgress({
            isVisible = true,
            text = "Repairing vehicle...",
            percent = percent
        })
        Wait(500)
    end

    exports['BigDaddy-Notify']:bdProgress({ isVisible = false })
end)

C# task progress

Exports["BigDaddy-Notify"].bdProgress(new
{
    isVisible = true,
    text = "Repairing vehicle...",
    percent = 50
});

// Call when the task finishes or is cancelled.
Exports["BigDaddy-Notify"].bdProgress(new { isVisible = false });

EVENTS

The same options can also be sent through the client events BigDaddy-Notify:bdNotify and BigDaddy-Notify:bdProgress.

TriggerEvent('BigDaddy-Notify:bdNotify', {
    message = "Task complete!",
    type = "success"
})

TriggerEvent('BigDaddy-Notify:bdProgress', {
    isVisible = true,
    text = "Working...",
    percent = 50
})