πŸ“•User guide

User guide on how to use the Dynasty Notify

1. Using the notification

You can use the notification as showed in the example bellow:

exports['dynasty_notify']:Notify({
	icon = "fas fa-check",
	iconColor = "#09E85E",
	title = "SUCCESS",
	message = "Default success message for notification.",
	progressBarColor = "#09E85E",
	sound = "info.mp3",
})

2. Default notifications

In case you use a notification and don't fill any of the parameters, it will be filled with the value stated in the Config.file. For example if the parameter boxColor is not used, it will be filled with the value 2B2D42 in this case.

Config.DefaultNotify = {
    boxColor = "#2B2D42",
    icon = "fas fa-info-circle",
    iconColor = "#2f83ff",
    iconSize = "20px",
    iconShake = false,
    title = "ALERT",
    titleColor = "#F8E5EE",
    titleFontSize = "15px",
    message = "Example notification message",
    messageColor = "#C4C6E7",
    messageFontSize = "13px",
    image = false,
    progressBarColor = "#2f83ff",
    progressBarHeight = "4px",
    sound = "success.mp3",
    soundVolume = 0.4,
    counterColor = "#dc3545",
    counterFontSize = "10px",
    time = 5000
}

3. Notification configuration

3.1 Box color

In this case the color of the box is #2B2D42

Example of where you can get colors

3.2 Icon

In this case the icon used is fas fa-info-circle. You can find more icons in:

3.3 Icon color

In this case the color of the box is #2f83ff"

3.4 Icon size

In this case the size of the icon is 20px

3.5 Icon shake effect

Adds a shaking effect to the icon. True/False value

In this case the shaking effect is used

3.6 Title of the notification

In this case the title of the notification is ALERT

3.7 Title color

In this case the color of the title is #F8E5EE

3.8 Title font size

In this case the size of the title is 15px

3.9 Message of the notification

In this case the message of the notification is Example notification message

3.10 Color of the message

In this case the color of the message is #C4C6E7

3.11 Message font size

In this case the size of the message is 13px

3.12 Image or GIF

Link of an image or a GIF that appears in the notification. If you don't want to use this feature use the value false.

In this case the GIF used in the notification is the following:

3.13 Progress bar color

In this case the color of the progress bar is #2f83ff

3.14 Progress bar height

In this case the height of the progress bar is 4px

3.15 Notification sound

In this case the sound used is the file success.mp3

3.16 Sound volume

The volume must be between the values 0.0 and 1.0.

In this case the volume of the sound is 0.4

3.17 Counter color

In this case the color used is #dc3545

3.18 Counter font size

In this case the font size is 10px

3.19 Time of the notification

The time of the notification has to be in ms (miliseconds)

In this case the time is 5000 (5 seconds)

3.20 Adding transparency to the notification

  • FF - 0% Transparent

  • CC - 20% Transparent

  • 80 - 50% Transparent

  • 33 - 80% Transparent

  • 00 - 100% Transparent

Adding those values at the end of the hex color adds different levels of transparency. For example 80% transparency would be #2B2D4233

Example of a notification with those parameters:

4.Send notification server side

To send a notification through server side you have to trigger the client event 'dynasty_notify:Notify' with its parameters

You will need to use source in case you want to send the notification only to the client which sent the event or -1 to trigger the event for all the players.

5.Replace QBCore notifications for Dynasty Notifications

To replace QBCore notifications you need to go to qb-core/client/functions.lua and replace the notify function as the example showed below

Replace the function for this one:

Here is an example of a success notification, you should do the same for the other types

6.Replace ESX notifications for Dynasty Notifications

To replace ESX notifications you need to go to esx_notify/Notify.lua and replace the notify function as the example showed below

Replace the function for this one:

Here is an example of a success notification, you should do the same for the other types

7.Additional notification examples

Last updated