A standalone, flexible, and customizable notification system for RedM servers.
- ๐ RTL (Right-to-Left) support for multilingual notifications
- ๐ Predefined templates for easily reusable notifications
- ๐งญ Support for all directions (9 placement options)
- ๐ฑ Responsive design for various screen sizes
- ๐ต Customizable notification sounds
- ๐๏ธ Support for both advanced and simple notifications
- ๐ Dynamic text coloring with inline color codes
- ๐ผ๏ธ Inline images in text using
~img:name~
syntax - โจ๏ธ Interactive key bindings with visual indicators
- ๐ Progress indicators (bar and circle types)
- ๐ญ Flexible icon support (URL or local img name)
- โฑ๏ธ Customizable duration for each notification
- ๐ Adjustable content alignment (start, center, end)
- ๐ฌ Animated entrance and exit effects
- ๐ฅ๏ธ Both client-side and server-side triggering options
- ๐ ๏ธ Easy to integrate with existing resources
- ๐ฎ Designed specifically for RedM servers (Standalone)
To send a notification from the client-side:
TriggerEvent("bln_notify:send", options)
-- OR with template
TriggerEvent("bln_notify:send", options, template)
TriggerEvent("bln_notify:send", {
title = "~#ffcc00~Hello!~e~",
description = "This is a ~red~basic~e~ notification with ~img:info~ icon.",
icon = "generic_list",
placement = "middle-right"
})
-- With Template
TriggerEvent("bln_notify:send", {
description = "This is a success template notification.",
placement = "middle-right"
}, "SUCCESS")
TriggerEvent("bln_notify:send", {
title = "~#ffcc00~Advanced Example~e~",
description = "Press ~key:E~ to accept or ~key:F6~ to decline",
icon = "warning",
placement = "middle-left",
duration = 10000,
progress = {
enabled = true,
type = 'circle', -- or 'bar'
color = '#ffcc00'
},
keyActions = {
['E'] = "accept", -- action name used when listen
['F6'] = "decline"
}
})
To send a notification from the server-side:
-- Send to specific player
TriggerClientEvent("bln_notify:send", source, options)
-- OR with template
TriggerClientEvent("bln_notify:send", source, options, template)
-- Send to all players
TriggerClientEvent("bln_notify:send", -1, options)
-- OR with template
TriggerClientEvent("bln_notify:send", -1, options, template)
The notification options are exactly the same as in client-side examples. The only difference is that on the server-side you need to:
- Use
TriggerClientEvent
instead ofTriggerEvent
to target a client. - Provide the
source
(player id) as the second parameter - Use
-1
as the source to send to all players
-- Server-side
TriggerClientEvent("bln_notify:send", source, {
title = "Hello!",
description = "This is a notification",
placement = "middle-right"
})
-- To all players
TriggerClientEvent("bln_notify:send", -1, {
title = "Server Announcement",
description = "This goes to everyone",
placement = "top-right"
}, "INFO")
Option | Description | Default | Required/Optional |
---|---|---|---|
placement | Position of the notification | "top-right" | Optional |
title | Title of the notification | "Notification" | Required |
description | Description text for the notification | null | Optional |
duration | Time in milliseconds before auto-removal | 5000 | Optional |
icon | Icon name or URL | null | Optional |
useBackground | Whether to use background image | true | Optional |
contentAlignment | Content alignment | "start" | Optional |
isRTL | Right-to-left text direction | false | Optional |
progress | Progress indicator options | null | Optional |
keyActions | Key binding actions | null | Optional |
customSound | Custom notification sound | Default sounds | Optional |
Key actions allow you to add interactive key bindings to your notifications. When a specified key is pressed, it triggers an event that you can listen to in your scripts.
-- Send notification with key actions
TriggerEvent("bln_notify:send", {
title = "Interaction Available",
description = "Press ~key:E~ to interact or ~key:F6~ to cancel",
duration = 10000,
keyActions = {
-- ['key_name'] = 'action_name'
['E'] = "accept", -- 'accept' is the action name that will be triggered
['F6'] = "decline" -- 'decline' is the action name
}
})
-- Listen for key press events in your script
RegisterNetEvent("bln_notify:keyPressed")
AddEventHandler("bln_notify:keyPressed", function(action)
if action == "accept" then
print("accept key was pressed!")
-- Do your accept logic here
elseif action == "decline" then
print("decline key was pressed!")
-- Do your decline logic here
end
end)
key_name
: The key names are specific to RedM's key mapping system. Make sure to use the correct key names in yourkeyActions
configuration, list of allowed keys can be found atclient/keys.lua
.action_name
- Key icons: to show key icon in a notification description, use as
~key:name~
. Thename
can be anything likeE
,ENTER
,<-
..etc. Its only a text in view, so it does not affect the key actions above if we put anything.
progress = {
enabled = true, -- Enable/disable progress indicator
type = 'bar', -- 'bar' or 'circle with countdown'
color = '#ffcc00' -- Custom color for progress
}
Can add color anywhere in your text (title or description).
- Named colors:
~red~colored text~e~
- Hex colors:
~#ffcc00~colored text~e~
You can add inline images/icons to notification's description as follows:
- Icon name or URL, e.g.
~img:icon_name~
or~img:full_url~
,
Predefined templates available in Config.Templates
:
INFO
: Information notifications with blue stylingSUCCESS
: Success messages with green stylingERROR
: Error messages with red stylingREWARD_MONEY
: Reward notifications with gold stylingTIP
: Simple tip notificationsTIP_XP
,TIP_GOLD
,TIP_CASH
: Specialized tip notifications
Test commands available in game:
/bln_notify_allAdvanced [RTL]
: Show all placement demos/bln_notify_allTips [RTL] [icon]
: Show all tip types/bln_notify_progress [type]
: Show progress notification/bln_notify_key
: Show key binding notification/bln_notify_template [template] [title] [desc]
: Test templates/bln_notify [RTL] [title] [desc] [icon] [placement]
: Custom notification
For help and support, join our Discord or create an issue on GitHub.
Contributions are welcome! Feel free to submit pull requests or create issues for bugs and features.