Notification

TEBEX


Notification System

System Overview: JJ-Notify is a modern notification system for FiveM that allows you to display various types of notifications to players. Notifications can be styled differently based on the type (success, error, info, warning, neutral) and can also include sound effects for added emphasis.


How It Works:

  1. Use the Export Function – Call the Alert export function to trigger a notification.
  2. Notification Types – Choose between different notification types (success, error, info, warning, neutral) for visual distinction.
  3. Duration – Set how long the notification should be displayed in milliseconds (e.g., 2500ms = 2.5 seconds).
  4. Sound – Optionally, enable sound effects when displaying the notification.
  5. Customization – Modify the configuration to add custom notification types or adjust visual settings.

📋 Notification Types

The following types are predefined in the system:

  • Success: Green color, often used to confirm a positive action.
  • Error: Red color, indicates something went wrong or failed.
  • Warning: Yellow color, used to notify about potential issues.
  • Info: Blue color, generally used for informational messages.
  • Neutral: Grey color, used for generic notifications.

💡 How to Display a Notification

Client Side

To display a notification on the client side, you can use the Alert export function like so:

exports['JJ-Notify']:Alert('Title', 'Message', Time, 'type', playSound)

Title: The title of the notification. Message: The message displayed in the notification. Time: Duration of the notification in milliseconds. For example, 1000 = 1 second. Type: The type of notification (success, error, warning, info, neutral, etc.). playSound: A boolean value (true/false) to play a sound with the notification.

Server Side

To trigger a notification from the server side, use the TriggerClientEvent function like this:

TriggerClientEvent('JJ-Notify:Alert', source, 'Title', 'Message', Time, 'type', playSound)

source: The player ID or source to send the notification to.


📺 Preview