# Notifications

## Ressource

Here you will find the link that leads to the shop in order to be able to buy this resource.

{% embed url="<https://mrz.tebex.io/package/5793317>" %}

## Dependencies

This script does not use any dependencies, so you can use it with any framework and on any type of server.

## Configuration file

Here you will find the configuration of the Notifications script.

* Activate or not a command to display an example of notifications
* Customization of the command (if enabled)
* Customize the image displayed when an image is invalid/not found

{% code overflow="wrap" %}

```lua
Config = {}

Config.EnableTestCommand = true
Config.TestCommandName = "testnotifs"

Config.errorImage = "https://i.imgur.com/QpCRsqC.png"

```

{% endcode %}

## How to use

### **Simple notification**

<div><figure><img src="https://2175961849-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLKvgVIDCPre558mCqsDV%2Fuploads%2FRJJbShUZokjsWSPLztlz%2Fsimple.png?alt=media&#x26;token=e9f6fda5-84a9-43ea-87c8-624a24cbcb74" alt=""><figcaption><p>Exemple a simple notification (Default)</p></figcaption></figure> <figure><img src="https://2175961849-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLKvgVIDCPre558mCqsDV%2Fuploads%2F9ZM1SqsqB4neBaW5pQoV%2FSuccess.png?alt=media&#x26;token=05f248cc-63e3-4919-b59b-142940686a54" alt=""><figcaption><p>Exemple a simple notification (success)</p></figcaption></figure></div>

<div><figure><img src="https://2175961849-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLKvgVIDCPre558mCqsDV%2Fuploads%2FMB1siwLCDVPp46SxH2Il%2FInfo.png?alt=media&#x26;token=92af2213-d42e-4406-ab2e-01a03c4a0afd" alt=""><figcaption><p>Exemple a simple notification (info)</p></figcaption></figure> <figure><img src="https://2175961849-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLKvgVIDCPre558mCqsDV%2Fuploads%2F4VGuRgRIHkBdlQGwRZiX%2FError.png?alt=media&#x26;token=aa51145f-bbe6-4e24-8c1d-3c1abf066408" alt=""><figcaption><p>Exemple a simple notification (error)</p></figcaption></figure></div>

{% hint style="info" %}
Client Side:

&#x20;

Arguments:

1. message => content of your message
2. type => Change notification type \[ "default", "success", "info", "error" ] (optional, set "default" by default)
3. duration => notification display time in seconds (optional, set 5 by default)
4. enableProgress => enable a progressbar (optional, set true by default)
   {% endhint %}

```lua
exports.mrz_notifications:SendNotification(message, type, duration, enableProgress)
```

{% hint style="info" %}
Server Side:

&#x20;

Arguments:

1. target => player source
2. message => content of your message
3. type => Change notification type \[ "default", "success", "info", "error" ] (optional, set "default" by default)
4. duration => notification display time in seconds (optional, set 5 by default)
5. enableProgress => enable a progressbar (optional, set true by default)
   {% endhint %}

```lua
exports.mrz_notifications:SendNotification(target, message, type, duration, enableProgress)
```

### **Advanced notification**

<figure><img src="https://2175961849-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLKvgVIDCPre558mCqsDV%2Fuploads%2FUtSLXghqUzPztZqRv3mk%2Fadvanced.png?alt=media&#x26;token=a96edd09-a7c5-4bef-a756-c323bc069b88" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Client Side:

&#x20;

Arguments:

1. title => notification title
2. subtitle => notification subtitle
3. message => content of your message
4. image => image url
5. duration => notification display time in seconds (optional, set 5 by default)
6. enableProgress => enable a progressbar (optional, set true by default)
   {% endhint %}

```lua
exports.mrz_notifications:SendAdvancedNotification(title, subtitle, message, image, duration, enableProgress)
```

{% hint style="info" %}
Server Side:

&#x20;

Arguments:

1. target => player source
2. title => notification title
3. subtitle => notification subtitle
4. message => content of your message
5. image => image url
6. duration => notification display time in seconds (optional, set 5 by default)
7. enableProgress => enable a progressbar (optional, set true by default)
   {% endhint %}

```lua
exports.mrz_notifications:SendAdvancedNotification(target, title, subtitle, message, image, duration, enableProgress)
```

### **Icon notification**

<figure><img src="https://2175961849-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FLKvgVIDCPre558mCqsDV%2Fuploads%2FWEyuQtTZ9Cntwu4Fin9N%2Ficon.png?alt=media&#x26;token=26993c1d-7d9e-43df-af1b-554922962c9e" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Client Side:

&#x20;

Arguments:

1. title => notification title
2. subtitle => content of your message
3. image => icon url
4. duration => notification display time in seconds (optional, set 5 by default)
5. enableProgress => enable a progressbar (optional, set true by default)
   {% endhint %}

```lua
exports.mrz_notifications:SendIconNotification(title, subtitle, image, duration, enableProgress)
```

{% hint style="info" %}
Server Side:

&#x20;

Arguments:

1. target => player source
2. title => notification title
3. subtitle => content of your message
4. image => icon url
5. duration => notification display time in seconds (optional, set 5 by default)
6. enableProgress => enable a progressbar (optional, set true by default)
   {% endhint %}

```lua
exports.mrz_notifications:SendIconNotification(target, title, subtitle, image, duration, enableProgress)
```


---

# 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://docs.mrzscripts.fr/standalone/notifications.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.
