Exports

This document describes all available exports provided by the nm1_notification resource, including client-side and server-side usage, parameters, defaults, and examples.

The system is framework-agnostic and works with ESX, QBCore, QBox, or standalone setups.


Client Exports

exports['nm1_notification']:Notify(data)

Displays a notification on the local client.

This is the primary and recommended client export for showing notifications.


Parameters

data (table)

Field
Type
Required
Default
Description

title

string

No

"Notification"

Notification title

message

string

No

""

Notification body text

type

string

No

"info"

Notification type

duration

number

No

5000

Duration in milliseconds

position

string

No

Saved / top-right

Screen position

theme

string

No

"dark"

UI theme


Supported Types

  • success

  • error

  • info

  • warning


Supported Positions

  • top

  • top-right

  • top-left

  • bottom

  • bottom-right

  • bottom-left

  • center-right

  • center-left


Example (Client)


Example (With Custom Position & Theme)


Server Exports

Server exports allow you to trigger notifications from server-side code to one or all players.


exports['nm1_notification']:NotifyPlayer(src, data)

Sends a notification to a specific player.


Parameters

Field
Type
Required
Description

src

number

Yes

Player server ID

data

table

Yes

Notification data (same as client)


Example (Server)


exports['nm1_notification']:NotifyAll(data)

Broadcasts a notification to all connected players.


Parameters

Field
Type
Required
Description

data

table

Yes

Notification data


Example (Server)


Notes & Behavior

  • All server exports internally trigger the client event nm1_notification:client:show

  • Saved notification position is persisted using Resource KVP

  • Position is automatically applied:

    • On resource start

    • On player spawn

  • If position is passed in data, it overrides the saved position for that notification only

  • Theme defaults to "dark" if not provided


Scenario
Recommended Export

Client-only UI feedback

Notify

Server β†’ single player

NotifyPlayer

Server β†’ all players

NotifyAll


Last updated