Installation
1
Add the resource to your server
Place the
sh-notify folder inside your server’s resources directory.2
Start sh-notify before dependent scripts
Open
server.cfg and ensure sh-notify is listed before any resource that calls its export. FiveM resolves exports at runtime, but starting it first avoids race conditions on server boot.server.cfg
Many SH Development scripts use sh-notify as their default notification handler. Set
Config.Notify = 'sh' inside those scripts’ config files to route their alerts through sh-notify automatically.Export Reference
Trigger a notification from any client-side Lua script using theshnotif export:
Parameters
string
required
A Font Awesome 5 class string that determines the icon displayed on the left side of the notification. Use the full class string as it appears in Font Awesome’s documentation.Example:
'fas fa-check-circle'string
required
The bold heading displayed above the horizontal divider inside the notification card.Example:
'Vehicle Spawned'string
required
The body text displayed below the divider. Use this to provide detail or context for the notification.Example:
'Your vehicle has been delivered to the garage.'string
required
Controls the color theme of the notification card. Must be one of the three values below.
number
required
How long the notification stays on screen, in milliseconds. After this duration the card fades out and is removed from the stack automatically.Example:
5000 (5 seconds)Usage Examples
The following examples demonstrate all three notification types. Copy the relevant line into your client-side script and adjust the text to suit your use case.- Success
- Primary (Info)
- Error
Use
success to confirm that an action completed without errors.