Usage & API
Madonne Notify exposes a simple API usable from any resource via exports (client-side or server-side).
π₯οΈ Client-side Export
Trigger a notification directly from a client-side script:
exports['MS_Madonne_Notify']:Notify(type, title, message, duration, sound)Parameters
type
string
Notification type (see types below)
title
string
Title displayed in bold. Pass "" to hide.
message
string
Subtitle message. Pass "" to hide.
duration
number
Display duration in milliseconds (e.g. 5000 for 5 seconds)
sound
boolean
true to play a UI sound when the notification appears
Example
exports['MS_Madonne_Notify']:Notify("success", "Seatbelt", "Seatbelt fastened!", 4000, true)
exports['MS_Madonne_Notify']:Notify("error", "Alert", "You are not allowed to do this.", 5000, false)
exports['MS_Madonne_Notify']:Notify("info", "", "Server restart in 10 minutes.", 6000, true)π Server-side Export
Trigger a notification from a server-side script, targeting a specific player by their server ID:
Parameters
target
number
Player server ID (-1 to broadcast to all players)
type
string
Notification type (see types below)
title
string
Title displayed in bold. Pass "" to hide.
message
string
Subtitle message. Pass "" to hide.
duration
number
Display duration in milliseconds
sound
boolean
true to play a UI sound
Example
π‘ NetEvent (Client-side)
Notifications can also be triggered via a NetEvent, useful for more dynamic or event-driven systems:
Or from the server:
π¨ Notification Types
Each type comes with a dedicated color and icon:
info
Purple
βΉοΈ Information
General information
announce
Purple
π’ Megaphone
Server announcements
progress
Purple
β³ Hourglass
Ongoing actions
success
Green
β Check
Successful actions
achievement
Green
π Trophy
Unlocked achievements
error
Dark Red
β οΈ Warning
Errors or blocked actions
warning
Orange
π Alert
Warnings
msg
White
π¬ Message
Chat or messages
radio
White
π» Broadcast
Radio communications
system
White
βοΈ Settings
System events
vehicle
White
π Car
Vehicle-related events
π‘ Tip: You can omit the title or message by passing an empty string
"". The notification will adapt its layout accordingly and only show the content you provide.
Last updated