> ## Documentation Index
> Fetch the complete documentation index at: https://docs.shdevelopment.org/llms.txt
> Use this file to discover all available pages before exploring further.

# In-Game Notification Systems in SH Development Scripts

> SH Development supports sh-notify, okokNotify, and custom notification systems. Configure your preferred option with a single setting in config.lua.

SH Development scripts send players in-game alerts for everything from successful actions to error states. Rather than hard-coding a single notification library, every script exposes a `Config.Notify` option that lets you choose the system already running on your server. Most scripts also include a separate `notify.lua` file that you can edit freely to wire in any custom solution.

## Choosing a Notification System

Set `Config.Notify` in `config.lua` to the identifier that matches your preferred system:

```lua config.lua theme={null}
Config.Notify = 'sh'   -- 'sh', 'okok', 'custom', or 'standalone'
```

| Value        | System                                                                          |
| ------------ | ------------------------------------------------------------------------------- |
| `sh`         | sh-notify — SH Development's own notification resource (default)                |
| `okok`       | okokNotify                                                                      |
| `custom`     | Edit `notify.lua` to wire any system you choose                                 |
| `standalone` | Basic built-in fallback used by some scripts with no external notify dependency |

<Note>
  Some scripts use a different key name for their notification setting — for example `Config.NotifySystem` instead of `Config.Notify`. Always check the inline comments in the script's own `config.lua` for the exact key name and accepted values.
</Note>

## sh-notify: The Recommended Option

**sh-notify** is SH Development's own lightweight notification resource and the default across the entire catalogue. It is free to use, requires no additional dependencies, and integrates seamlessly with every other SH Development script.

### Calling sh-notify from Your Own Scripts

You can use sh-notify in your own resources by calling its export directly on the client side:

```lua theme={null}
exports['sh-notify']:shnotif(icon, title, text, type, length)
```

### Examples

```lua theme={null}
-- Success notification
exports['sh-notify']:shnotif('fas fa-check-circle', 'Success', 'Action completed', 'success', 5000)

-- Informational notification
exports['sh-notify']:shnotif('fas fa-info-circle', 'Info', 'Heads up', 'primary', 5000)

-- Error notification
exports['sh-notify']:shnotif('fas fa-exclamation-circle', 'Error', 'Something failed', 'error', 5000)
```

### Parameter Reference

| Parameter | Type   | Description                                                          |
| --------- | ------ | -------------------------------------------------------------------- |
| `icon`    | string | Font Awesome 5 icon class (e.g. `fas fa-check-circle`)               |
| `title`   | string | Bold heading text displayed at the top of the notification           |
| `text`    | string | Body message shown below the title                                   |
| `type`    | string | Visual style — `success` (green), `primary` (blue), or `error` (red) |
| `length`  | number | How long the notification stays on screen, in milliseconds           |

## Using a Custom Notification System

If your server already uses a notification resource not listed above — such as GTA-style scaleform notifications, a custom NUI panel, or a proprietary system — set `Config.Notify = 'custom'` and then edit the `notify.lua` file found in the resource folder.

`notify.lua` is **escrow-ignored**, meaning it is always fully editable regardless of the script's protection level. Replace the body of the `Notify` function with a call to your own system:

```lua notify.lua theme={null}
-- This file is escrow-ignored. Edit freely.
function Notify(icon, title, text, type, length)
    -- Example: forward to a custom export
    exports['my-custom-notify']:send({
        title   = title,
        message = text,
        style   = type,
        duration = length,
    })
end
```

<Tip>
  Back up your edited `notify.lua` before updating a script. While the file itself will not be overwritten by escrow, a manual file replacement during an update could restore the default version. Keeping a copy ensures you can restore your customisation in seconds.
</Tip>

## Notification System Comparison

<CardGroup cols={3}>
  <Card title="sh-notify" icon="bell">
    Best choice for most servers. Zero extra dependencies, consistent styling, and built-in support across all SH Development scripts.
  </Card>

  <Card title="okokNotify" icon="circle-check">
    A popular community notification library. Set `Config.Notify = 'okok'` and ensure okokNotify is running — no further changes needed.
  </Card>

  <Card title="Custom" icon="code">
    Full control. Edit `notify.lua` to call any export, trigger any event, or display any UI element your server supports.
  </Card>
</CardGroup>
