Installation
Add the resource to your server
Place the
sh-notify folder inside your server’s resources directory.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
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'The bold heading displayed above the horizontal divider inside the notification card.Example:
'Vehicle Spawned'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.'Controls the color theme of the notification card. Must be one of the three values below.
| Value | Appearance |
|---|---|
success | Semi-transparent green background |
primary | Semi-transparent blue background |
error | Semi-transparent red background |
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.