Skip to content

BLN Notify โ€‹

bln notify script - redm
Image 1Image 2Image 3
Image 1Image 2

A standalone, flexible, and customizable notification system for RedM servers. BLN Notify provides a complete notification solution with support for animations, interactive key bindings, progress indicators, RTL languages, and extensive customization options.

๐Ÿ“บ Preview โ€‹

Video Preview

๐Ÿ”ฝ Get it Now โ€‹

Download

โœจ Features โ€‹

  • ๐ŸŒ RTL Support: Full right-to-left text direction support for Arabic, Hebrew, and other RTL languages
  • ๐Ÿ“š Predefined Templates: 7 built-in templates (INFO, SUCCESS, ERROR, REWARD_MONEY, TIP, TIP_CASH, TIP_XP, TIP_GOLD) for quick usage
  • ๐Ÿงญ 9 Placement Options: Support for all screen positions (top/middle/bottom ร— left/center/right)
  • ๐Ÿ“ฑ Responsive Design: Adapts to various screen sizes with automatic sizing
  • ๐ŸŽต Custom Sounds: Configurable notification sounds using RedM's native sound system
  • ๐ŸŽ›๏ธ Dual Modes: Support for both advanced notifications (with background) and simple tip notifications
  • ๐ŸŒˆ Dynamic Text Formatting: Inline color codes with named colors and hex values
  • ๐Ÿ–ผ๏ธ Inline Images: Embed icons/images directly in notification text using ~img:name~ syntax
  • โŒจ๏ธ Interactive Key Bindings: Visual key indicators with event-driven key press handling
  • ๐Ÿ“Š Progress Indicators: Two types - progress bar and circular countdown timer
  • ๐ŸŽญ Flexible Icons: Support for both local icon files and external URLs
  • โฑ๏ธ Custom Duration: Configurable auto-dismiss time for each notification
  • ๐Ÿ”€ Content Alignment: Adjustable text alignment (start, center, end)
  • ๐ŸŽฌ Smooth Animations: Custom jelly-effect animations for entrance and exit
  • ๐Ÿ–ฅ๏ธ Client & Server: Trigger notifications from both client-side and server-side scripts
  • ๐Ÿ› ๏ธ Easy Integration: Simple event-based API that works with any RedM resource
  • ๐ŸŽฎ RedM Optimized: Specifically designed for RedM servers (Standalone, no dependencies)

๐Ÿ“‹ Table of Contents โ€‹

๐Ÿš€ Installation โ€‹

Prerequisites โ€‹

  • None - Its standalone

Setup Instructions โ€‹

  1. Download the Resource

    bash
    # Clone the repository or download as ZIP
    git clone https://github.com/blnStudio/bln_notify.git
  2. Place in Server Directory

    server/resources/[BLN]/bln_notify/
  3. Add to server.cfg

    cfg
    ensure bln_notify

The resource is now ready to use!

โšก Quick Start โ€‹

Basic Client-Side Notification โ€‹

lua
TriggerEvent("bln_notify:send", {
    title = "Hello!",
    description = "This is a basic notification",
    icon = "warning",
    placement = "middle-right"
})

Basic Server-Side Notification โ€‹

lua
-- Send to specific player
TriggerClientEvent("bln_notify:send", source, {
    title = "Server Message",
    description = "Hello from server!",
    placement = "top-right"
})

-- Send to all players
TriggerClientEvent("bln_notify:send", -1, {
    title = "Server Announcement",
    description = "This goes to everyone!"
})

Using Templates โ€‹

lua
-- Client-side with template
TriggerEvent("bln_notify:send", {
    description = "Operation completed successfully!"
}, "SUCCESS")

-- Server-side with template
TriggerClientEvent("bln_notify:send", source, {
    description = "Something went wrong!"
}, "ERROR")

๐Ÿ“– Detailed Documentation โ€‹

Client-Side Usage โ€‹

Event Syntax โ€‹

lua
-- Basic notification
TriggerEvent("bln_notify:send", options)

-- Notification with template
TriggerEvent("bln_notify:send", options, templateName)

Parameters:

  • options (table, required): Notification configuration object
  • templateName (string, optional): Template name from Config.Templates

Basic Examples โ€‹

lua
-- Simple notification
TriggerEvent("bln_notify:send", {
    title = "Hello!",
    description = "This is a basic notification",
    icon = "generic_list",
    placement = "middle-right"
})

-- Notification with formatted text
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"
})

-- Using template
TriggerEvent("bln_notify:send", {
    description = "Operation completed successfully!",
    placement = "middle-right"
}, "SUCCESS")

Advanced Example โ€‹

lua
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',
        color = '#ffcc00'
    },
    keyActions = {
        ['E'] = "accept",
        ['F6'] = "decline"
    }
})

Server-Side Usage โ€‹

Event Syntax โ€‹

lua
-- Send to specific player
TriggerClientEvent("bln_notify:send", source, options)
TriggerClientEvent("bln_notify:send", source, options, templateName)

-- Send to all players
TriggerClientEvent("bln_notify:send", -1, options)
TriggerClientEvent("bln_notify:send", -1, options, templateName)

Parameters:

  • source (number, required): Player server ID (use -1 for all players)
  • options (table, required): Notification configuration object
  • templateName (string, optional): Template name from Config.Templates

Examples โ€‹

lua
-- Send to specific player
TriggerClientEvent("bln_notify:send", source, {
    title = "Welcome!",
    description = "Welcome to the server!",
    placement = "middle-right"
})

-- Send to all players with template
TriggerClientEvent("bln_notify:send", -1, {
    title = "Server Maintenance",
    description = "Server will restart in 5 minutes"
}, "INFO")

-- Server-side example with reward
TriggerClientEvent("bln_notify:send", source, {
    description = "You received $500!"
}, "REWARD_MONEY")

Notification Options โ€‹

Complete reference of all available notification options:

OptionTypeDefaultRequiredDescription
titlestring"Notification"RequiredNotification title text (supports formatting)
descriptionstringnilOptionalNotification description text (supports formatting)
placementstring"top-right"OptionalScreen position (see Placement Options)
durationnumber5000OptionalAuto-dismiss time in milliseconds
iconstringnilOptionalIcon name or URL (see Icons)
useBackgroundbooleantrueOptionalShow notification background image
contentAlignmentstring"start"OptionalText alignment: "start", "center", or "end"
isRTLbooleanfalseOptionalEnable right-to-left text direction
progresstablenilOptionalProgress indicator configuration (see Progress Indicators)
keyActionstablenilOptionalKey binding configuration (see Key Actions)
customSoundtablenilOptionalCustom sound configuration (see Custom Sounds)

Detailed Option Explanations โ€‹

title (string, required)

  • The main heading of the notification
  • Supports text formatting: ~#ffcc00~Colored Text~e~ or ~red~Colored Text~e~
  • Can include inline images: ~img:icon_name~
  • Can include key indicators: ~key:E~

description (string, optional)

  • Secondary text content below the title
  • Same formatting support as title
  • When omitted, notification displays title-only mode

placement (string, optional)

  • Controls where notification appears on screen
  • Valid values:
    • "top-left", "top-center", "top-right"
    • "middle-left", "middle-center", "middle-right"
    • "bottom-left", "bottom-center", "bottom-right"
  • Default: "top-right"

duration (number, optional)

  • Time in milliseconds before notification auto-dismisses
  • Minimum: 1000ms (1 second)
  • Default: 5000ms (5 seconds)
  • When progress indicator is enabled, this controls the progress animation duration

icon (string, optional)

  • Main notification icon displayed on the left (LTR) or right (RTL)
  • Can be:
    • Local icon name (e.g., "warning", "tick", "cross")
    • Full URL (e.g., "https://example.com/icon.png")
  • Local icons are loaded from ui/assets/imgs/icons/
  • Default: nil (no icon)

useBackground (boolean, optional)

  • When true: Shows styled background image (toast-style notification)
  • When false: Shows minimal tip-style notification (no background)
  • Default: true

contentAlignment (string, optional)

  • Controls text alignment within notification
  • Valid values: "start", "center", "end"
  • Default: "start"

isRTL (boolean, optional)

  • Enables right-to-left text direction
  • Automatically adjusts layout, background, and icon positioning
  • Default: false

Placement Options โ€‹

BLN Notify supports 9 different screen positions for flexible notification placement:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  top-left       top-center        top-right   โ”‚
โ”‚                                               โ”‚
โ”‚                                               โ”‚
โ”‚  middle-left   middle-center   middle-right   โ”‚
โ”‚                                               โ”‚
โ”‚                                               โ”‚
โ”‚  bottom-left   bottom-center   bottom-right   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Position Values:

  • Top Row: "top-left", "top-center", "top-right"
  • Middle Row: "middle-left", "middle-center", "middle-right"
  • Bottom Row: "bottom-left", "bottom-center", "bottom-right"

Animation Behavior:

  • Left positions: Slide in from left, slide out to left
  • Right positions: Slide in from right, slide out to right
  • Center positions: Scale/fade animations
  • Top/Bottom: Additional vertical animations

Example:

lua
-- Top center for announcements
TriggerEvent("bln_notify:send", {
    title = "Announcement",
    description = "Server maintenance in 5 minutes",
    placement = "top-center"
})

-- Middle right for interactions
TriggerEvent("bln_notify:send", {
    title = "Interaction",
    description = "Press E to interact",
    placement = "middle-right"
})

Templates โ€‹

Templates provide predefined notification styles for common use cases. Templates merge with your options, allowing you to override specific properties.

Template Demo

Available Templates โ€‹

INFO - Information notifications

lua
{
    title = "~#3c9ce6~Information~e~",
    icon = "warning",
    duration = 5000,
    placement = 'middle-left',
    customSound = {
        sound = "INFO",
        soundSet = "HUD_SHOP_SOUNDSET"
    }
}

SUCCESS - Success messages

lua
{
    title = "~#73f75c~Success!~e~",
    icon = "tick",
    duration = 5000,
    placement = 'middle-left',
    customSound = {
        sound = "CHECKPOINT_PERFECT",
        soundSet = "HUD_MINI_GAME_SOUNDSET"
    }
}

ERROR - Error messages

lua
{
    title = "~#f73434~Failed!~e~",
    icon = "cross",
    duration = 7000,
    placement = 'middle-left',
    customSound = {
        sound = "FAIL",
        soundSet = "Objective_Sounds"
    }
}

REWARD_MONEY - Money rewards

lua
{
    title = "~#ffcc00~Here's your reward!~e~",
    icon = 'toast_mp_daily_objective_small',
    duration = 7000,
    placement = 'middle-left',
    customSound = {
        sound = "REWARD_NEW_GUN",
        soundSet = "HUD_REWARD_SOUNDSET"
    }
}

TIP - Simple tip notifications

lua
{
    useBackground = false,
    duration = 5000,
    placement = 'middle-right',
    customSound = {
        sound = "INFO_SHOW",
        soundSet = "Ledger_Sounds"
    }
}

TIP_CASH, TIP_XP, TIP_GOLD - Specialized tips with icons

lua
-- TIP_CASH includes: icon = 'leaderboard_cash'
-- TIP_XP includes: icon = 'leaderboard_xp'
-- TIP_GOLD includes: icon = 'leaderboard_gold'

Using Templates โ€‹

lua
-- Basic template usage (description only)
TriggerEvent("bln_notify:send", {
    description = "Task completed!"
}, "SUCCESS")

-- Override template properties
TriggerEvent("bln_notify:send", {
    description = "Custom error message",
    placement = "top-center",  -- Override template's placement
    duration = 10000            -- Override template's duration
}, "ERROR")

-- Server-side template usage
TriggerClientEvent("bln_notify:send", source, {
    description = "You earned 500 XP!"
}, "TIP_XP")

Creating Custom Templates โ€‹

Edit config.lua to add your own templates:

lua
Config.Templates = {
    MY_CUSTOM_TEMPLATE = {
        title = "~#ff00ff~Custom Template~e~",
        icon = "warning",
        duration = 3000,
        placement = 'top-right',
        customSound = {
            sound = "CUSTOM_SOUND",
            soundSet = "CUSTOM_SOUNDSET"
        }
    }
}

Text Formatting โ€‹

BLN Notify supports rich text formatting with inline color codes, images, and key indicators.

Text Formatting Demo

Color Formatting โ€‹

Named Colors:

lua
-- Using color names
description = "This is ~red~red text~e~ and ~blue~blue text~e~"

Available Named Colors:

  • red, blue, green, yellow, orange, purple, pink, white, black, gray

Hex Colors:

lua
-- Using hex color codes
title = "~#ffcc00~Gold Text~e~"
description = "Custom ~#ff0000~red~e~ and ~#00ff00~green~e~ colors"

Format:

  • Start color: ~color_name~ or ~#hexcode~
  • End color: ~e~ (resets to default white)

Examples:

lua
TriggerEvent("bln_notify:send", {
    title = "~#ffcc00~Welcome~e~ to the Server",
    description = "You have ~green~100~e~ health and ~red~50~e~ stamina"
})

Image Formatting โ€‹

Embed icons/images directly in notification text:

Format: ~img:name~ or ~img:url~

Local Icons:

lua
description = "Check ~img:warning~ this icon and ~img:info~ another one"

External URLs:

lua
description = "Custom image: ~img:https://example.com/icon.png~"

Examples:

lua
TriggerEvent("bln_notify:send", {
    title = "Rewards",
    description = "You received ~img:leaderboard_cash~ $500 and ~img:leaderboard_xp~ 100 XP"
})

Note: All local icons must be in PNG format and located in ui/assets/imgs/icons/ directory.

Key Indicator Formatting โ€‹

Display visual key indicators in notification text:

Format: ~key:name~

lua
description = "Press ~key:E~ to interact or ~key:F6~ to cancel"

Key names can be any text (display only):

  • ~key:E~ - Shows "E"
  • ~key:ENTER~ - Shows "ENTER"
  • ~key:SPACE~ - Shows "SPACE"
  • ~key:F1~ - Shows "F1"

Note: Key indicators are visual only. For functional key bindings, use the keyActions option (see Key Actions & Events).

Combined Formatting โ€‹

You can combine all formatting types:

lua
TriggerEvent("bln_notify:send", {
    title = "~#ffcc00~Mission Complete~e~",
    description = "You earned ~img:leaderboard_cash~ ~#00ff00~$1000~e~! Press ~key:ENTER~ to continue."
})

Progress Indicators โ€‹

Progress indicators provide visual feedback for time-based actions or processes.

Progress Indicators Demo

Progress Configuration โ€‹

lua
progress = {
    enabled = true,        -- Enable/disable progress indicator
    type = 'bar',          -- 'bar' or 'circle'
    color = '#ffcc00'      -- Progress indicator color (hex)
}

Progress Types โ€‹

Bar Progress (type = 'bar'):

  • Horizontal progress bar at bottom of notification
  • Fills from left to right (RTL: right to left)
  • Smooth linear animation

Circle Progress (type = 'circle'):

  • Circular progress indicator in top-right corner (LTR) or top-left (RTL)
  • Displays countdown timer in seconds
  • Circular stroke animation
  • Shows remaining time

Examples โ€‹

lua
-- Bar progress
TriggerEvent("bln_notify:send", {
    title = "Processing...",
    description = "Please wait",
    duration = 10000,
    progress = {
        enabled = true,
        type = 'bar',
        color = '#4CAF50'
    }
})

-- Circle progress with countdown
TriggerEvent("bln_notify:send", {
    title = "Timer",
    description = "Action will complete in:",
    duration = 5000,
    progress = {
        enabled = true,
        type = 'circle',
        color = '#ffcc00'
    }
})

Important Notes:

  • Progress duration matches the notification duration
  • When progress completes, notification automatically dismisses
  • Progress indicators work with both advanced and tip-style notifications

Key Actions โ€‹

Key actions enable interactive notifications that respond to player key presses.

Key Actions Demo

Key Actions Configuration โ€‹

lua
keyActions = {
    ['KEY_NAME'] = "action_name",
    ['KEY_NAME_2'] = "action_name_2"
}

Format:

  • Key name: Must match RedM's key mapping (see Valid Keys)
  • Action name: String identifier that will be sent via event

Valid Keys โ€‹

Keys are defined in client/keys.lua. Valid key names include:

Letters: A, B, C, D, E, F, G, H, I, J, L, M, N, O, P, Q, R, S, U, V, W, X, Z

Symbols/Controls:

  • RIGHTBRACKET, LEFTBRACKET
  • MOUSE1, MOUSE2, MOUSE3, MWUP
  • CTRL, TAB, SHIFT, SPACEBAR, ENTER, BACKSPACE, LALT, DEL
  • PGUP, PGDN
  • F1, F4, F6
  • 1, 2, 3, 4, 5, 6, 7, 8
  • DOWN, UP, LEFT, RIGHT

Basic Usage โ€‹

lua
-- Send notification with key actions
TriggerEvent("bln_notify:send", {
    title = "Interaction Available",
    description = "Press ~key:E~ to accept or ~key:F6~ to decline",
    duration = 10000,
    keyActions = {
        ['E'] = "accept",
        ['F6'] = "decline"
    }
})

-- Listen for key press events
RegisterNetEvent("bln_notify:keyPressed")
AddEventHandler("bln_notify:keyPressed", function(action)
    if action == "accept" then
        print("Player accepted!")
        -- Handle accept logic
    elseif action == "decline" then
        print("Player declined!")
        -- Handle decline logic
    end
end)

Advanced Example โ€‹

lua
-- Complex interaction with multiple keys
TriggerEvent("bln_notify:send", {
    title = "~#ffcc00~Confirm Action~e~",
    description = "Press ~key:E~ to confirm, ~key:F6~ to cancel, or ~key:ENTER~ to view details",
    icon = "warning",
    duration = 15000,
    progress = {
        enabled = true,
        type = 'circle',
        color = '#ffcc00'
    },
    keyActions = {
        ['E'] = "confirm",
        ['F6'] = "cancel",
        ['ENTER'] = "details"
    }
})

-- Handle all actions
RegisterNetEvent("bln_notify:keyPressed")
AddEventHandler("bln_notify:keyPressed", function(action)
    if action == "confirm" then
        -- Process confirmation
        TriggerEvent("myresource:confirmAction")
    elseif action == "cancel" then
        -- Handle cancellation
        TriggerEvent("myresource:cancelAction")
    elseif action == "details" then
        -- Show details
        TriggerEvent("myresource:showDetails")
    end
end)

Important Notes:

  • Key actions are automatically cleaned up when notification dismisses
  • Notification is removed when any key action is pressed
  • Key names are case-insensitive (automatically converted to uppercase)
  • Invalid key names will show a warning in console but won't break the notification

RTL Support โ€‹

BLN Notify has full support for right-to-left (RTL) languages like Arabic and Hebrew.

RTL Support Demo

Enabling RTL โ€‹

lua
TriggerEvent("bln_notify:send", {
    title = "ู…ุฑุญุจุง",
    description = "ู‡ุฐุง ุฅุดุนุงุฑ ุจุงู„ู„ุบุฉ ุงู„ุนุฑุจูŠุฉ",
    isRTL = true,
    placement = "middle-right"
})

RTL Features โ€‹

When isRTL = true, the notification automatically:

  • Reverses text direction
  • Adjusts icon positioning (right side instead of left)
  • Uses RTL-specific background image
  • Flips progress indicator position
  • Adjusts content alignment
  • Animations adapt to RTL layout

RTL Example โ€‹

lua
-- Arabic notification
TriggerEvent("bln_notify:send", {
    title = "~#ffcc00~ุฅุดุนุงุฑ~e~",
    description = "ุชู… ~green~ุฅูƒู…ุงู„~e~ ุงู„ู…ู‡ู…ุฉ ุจู†ุฌุงุญ! ~img:info~",
    icon = "tick",
    isRTL = true,
    placement = "middle-right",
    duration = 5000
}, "SUCCESS")

Custom Sounds โ€‹

Configure custom notification sounds using RedM's native sound system.

Sound Configuration โ€‹

lua
customSound = {
    sound = "SOUND_NAME",
    soundSet = "SOUNDSET_NAME"
}

Parameters:

  • sound (string): Sound name from RedM's sound library
  • soundSet (string): Sound set name that contains the sound

Built-in Sound Examples โ€‹

lua
-- Success sound
customSound = {
    sound = "CHECKPOINT_PERFECT",
    soundSet = "HUD_MINI_GAME_SOUNDSET"
}

-- Error sound
customSound = {
    sound = "FAIL",
    soundSet = "Objective_Sounds"
}

-- Info sound
customSound = {
    sound = "INFO",
    soundSet = "HUD_SHOP_SOUNDSET"
}

-- Reward sound
customSound = {
    sound = "REWARD_NEW_GUN",
    soundSet = "HUD_REWARD_SOUNDSET"
}

Usage Examples โ€‹

lua
-- Custom sound for notification
TriggerEvent("bln_notify:send", {
    title = "Achievement Unlocked!",
    description = "You completed a challenge",
    icon = "awards_set_a_009",
    customSound = {
        sound = "REWARD_NEW_GUN",
        soundSet = "HUD_REWARD_SOUNDSET"
    }
})

-- Override template sound
TriggerEvent("bln_notify:send", {
    description = "Custom success with different sound",
    customSound = {
        sound = "CHECKPOINT_NORMAL",
        soundSet = "HUD_MINI_GAME_SOUNDSET"
    }
}, "SUCCESS")

Default Behavior:

  • If customSound is not provided, templates use their predefined sounds
  • If template doesn't specify sound, default sound is played
  • Sound plays when notification appears
  • Additional sound plays when notification dismisses (if configured)

๐Ÿ’ฌ Support โ€‹

Getting Help โ€‹

๐Ÿ™ Credits โ€‹

  • BLN Studio - Development, Maintenance, and support.