mirror of
https://github.com/jimathy/jim_bridge.git
synced 2026-08-17 22:16:03 +01:00
better documentation layout
- seperated the 2000+ lines in ReadMe.md into seperate files. - useful if things expand - better readability for users - more organised layout
This commit is contained in:
21
documentation/main_functions/notify.md
Normal file
21
documentation/main_functions/notify.md
Normal file
@@ -0,0 +1,21 @@
|
||||
### notify.lua
|
||||
|
||||
This module provides a unified interface to trigger styled notifications across supported frameworks.
|
||||
|
||||
- **triggerNotify(title, message, type, src)**
|
||||
|
||||
- Sends a notification to a player (or to the entire client if `src` is `nil`).
|
||||
- The notification style is determined by `type` (e.g., `success`, `error`, `info`).
|
||||
- **Parameters:**
|
||||
- `title` (`string`): The title or header of the notification.
|
||||
- `message` (`string`): The body or detail text.
|
||||
- `type` (`string`): Type of message (e.g., "success", "error", "info").
|
||||
- `src` (`number`, optional): Server ID of the player to notify (omit to notify locally).
|
||||
- **Example:**
|
||||
```lua
|
||||
-- Client-side usage without specifying a player (shows to the current player)
|
||||
triggerNotify("Success", "You have completed the task!", "success")
|
||||
|
||||
-- Server-side usage specifying a player by their server ID
|
||||
triggerNotify("Alert", "You have been warned for misconduct.", "error", source)
|
||||
```
|
||||
Reference in New Issue
Block a user