🕵️‍♂️Usage

Announcements

Commands (in-game)

/announcement <duration_ms> <message>
/announcementto <serverId> <duration_ms> <message>

Server Event (from client)

TriggerServerEvent('risk-notify:announcement', duration, message)

Targeted Announcement (single player)

TriggerServerEvent('risk-notify:announcementto', playerId, duration, message)

Export (from server)

exports['risk-notify']:SendAnnouncement(duration, message, name, title)

Parameters

  • duration → duration in milliseconds

  • message → text to display

  • name → optional sender name (fallback = Config.TxAdminName or "Server")

  • title → optional title (default = "Announcement")


Help Notifications

Export

exports['risk-notify']:HelpNotify(key, message)

Displays a short on-screen prompt bound to the specified key (e.g. "E").


Notifications

Export (Client & Server)

exports['risk-notify']:Notify({
  type     = 'success' | 'error' | 'info',
  title    = 'Title',
  message  = 'Your message here',
  duration = 8000
})

Client Event (optional)

TriggerEvent('risk-notify:notify', 'success', 'Your message here', 'Title', 5000)
TriggerEvent('risk-notify:notify', { type = 'info', title = 'System', message = 'Notification via client event', duration = 4000 })

Progress Bars

Start

exports['risk-notify']:startProgress(duration, label, {
  prop     = "prop_name",
  freeze   = true,
  anim     = { dict = "animDict", lib = "animClip" },
  onFinish = function() end,
  onCancel = function() end
})

Cancel

exports['risk-notify']:cancelProgress()
TriggerEvent('risk-notify:cancelProgress')

Cancel Controls

Press Backspace or X to cancel.


API & Exports

Export / Trigger
Arguments
Description

HelpNotify(key, message)

(string key, string message)

Displays a temporary help prompt

Notify(data)

(table {type, title, message, duration})

Displays a custom notification

startProgress(duration, label, opts)

number, string, table

Starts a progress bar with optional parameters

cancelProgress()

Cancels the active progress bar

SendAnnouncement(dur, msg, [name], [title])

number, string, string?, string?

Sends a server-wide announcement


Examples

-- Global server announcement
TriggerServerEvent('risk-notify:announcement', 5000, "Hello everyone!")
-- Targeted announcement to a specific player
TriggerServerEvent('risk-notify:announcementto', 23, 8000, "Hello player 23!")
-- Server export
exports['risk-notify']:SendAnnouncement(5000, "Hello everyone!", "Risk Scripts", "System")
-- Help prompt
exports['risk-notify']:HelpNotify("E", "Press E to interact")
-- Success notification
exports['risk-notify']:Notify({
  type     = 'success',
  title    = 'Completed',
  message  = 'You did it!',
  duration = 5000
})
-- Progress bar with animation
exports['risk-notify']:startProgress(10000, "Collecting...", {
  prop     = "prop_tool_shovel",
  freeze   = true,
  anim     = { dict = "amb@world_human_gardener_plant@male@base", lib = "base" },
  onFinish = function() print("Done!") end,
  onCancel = function() print("Cancelled!") end
})

txAdmin Integration

If you enable Config.UseTxAdminAnnouncements = true, make sure to disable the default txAdmin announcements in your server.cfg:

setr txAdmin-hideDefaultScheduledRestartWarning true
setr txAdmin-hideDefaultAnnouncement true

Last updated