Client

Client Events

fivemdeals_notify:sendNotification

Description

This event sends a notification to the player's NUI (User Interface). The event can be triggered from any client-side script to display a message on the player's screen.

Usage

TriggerEvent('fivemdeals_notify:sendNotification', {
    title = 'Success!',  -- The title of the notification
    message = 'Your action was successful.',  -- The message of the notification
    progress = true,  -- Optional, shows a progress bar if set to true
    duration = 5000,  -- Display duration in milliseconds
    notifyType = 'success'  -- Notification type: 'inform', 'success', 'warning', 'error'
})

Parameters

  • title: The title of the notification. Defaults to "Title" if not specified.

  • message: The main text of the notification. Defaults to "Description" if not specified.

  • progress: Determines whether a progress bar is shown. This is optional and defaults to false.

  • duration: How long the notification remains visible (in milliseconds). Defaults to 5000 ms.

  • notifyType: Determines the type of notification. Options are:

    • inform – General information (default).

    • success – Success messages.

    • warning – Warnings.

    • error – Error messages.

Example

TriggerEvent('fivemdeals_notify:sendNotification', {
    title = 'Error!',
    message = 'Something went wrong!',
    progress = false,
    duration = 3000,
    notifyType = 'error'
})

Commands

There are also some built-in test commands you can use to test notifications:

  • /testnotify: Triggers a success notification with a progress bar and a duration of 10 seconds.

  • /testnotifyshort: Triggers a short error notification with a progress bar and a duration of 5 seconds.

Last updated