πŸ•΅οΈβ€β™‚οΈUsage

Announcements

  • Command:

    /announcement <duration_ms> <message>

    Example: /announcement 10000 Server will restart soon!

  • Server Event:

    TriggerServerEvent('risk-notify:announcement', duration, message)
  • Client Event: Fires on all clients:

    RegisterNetEvent('risk-notify:announcement', function(name, duration, message) end)

Help Notifications

  • Exported Function:

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

    Displays a temporary on-screen prompt with message, bound to key (e.g. "E").

Notifications

  • Exported Function:

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

Progress Bars

  • Exported Function:

    exports['risk-notify']:startProgress(duration, label, {
      prop     = "prop_name",        -- optional prop to attach
      freeze   = true|false,         -- freeze player during progress
      anim     = { dict="animDict", lib="animClip" },  -- optional animation
      onFinish = function() end,     -- callback on completion
      onCancel = function() end,     -- callback on cancellation (ESC/X)
    })
  • Cancel Controls: Press Backspace or X to cancel.

Export
Arguments
Description

HelpNotify(key, msg)

(string key, string message)

Show temporary help prompt.

Notify(data)

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

Show custom notification.

startProgress(...)

See Progress Bars section above.

Display a progress bar with callbacks.

SendAnnouncement(dur,msg,name)

(number,dur,string msg,string name)

Server can invoke announcements.

Examples

-- Trigger a 5s announcement:
TriggerServerEvent('risk-notify:announcement', 5000, "Hello everyone!")

-- Show a help prompt:
exports['risk-notify']:HelpNotify("E", "Press E to interact")

-- Show a success notification:
exports['risk-notify']:Notify({
  type     = 'success',
  title    = 'Completed',
  message  = 'You did it!',
  duration = 5000
})

-- Start a 10s 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
})

Last updated