Page cover image

ℹ️Notification

This is how to integrate our notification.

Server.cfg

start mfp_notify

Config.lua

Config = {}
Config.defaultLocation = 'top-left' 
-- can be 'top-right', 'top-left' or 'bottom-left'

Exports (clientside)

Integration of our notification script in your client.lua

-- DEFAULT
exports['mfp_notify']:ShowNotification(
  "Maps",
  "~y~Yellow Text~w~ and ~g~Green Text~w~ work!",
  "icons/maps-icon.png"
)
-- use default icons from icons folder or use direct link.

-- ADVANCED
exports['mfp_notify']:ShowNotification(
  "Mission Update", -- Title (App Name)
  "~r~This is a test notification~w~ in the top left.", -- Description (with colorcode and multiline support)
  "https://mfpscripts.com/icon.png", -- can be icons/*.* or link
  "top-left" -- can be top-left, top-right or bottom-left
)
-- use top-left, top-right or bottom-left (In the Config.lua you can choose default, so you dont nead a value here.

Exports (serverside)

Integration of our notification script in your server.lua

-- DEFAULT
exports['mfp_notify']:ShowNotification(
  source, -- can be playersource to show the right client
  "Maps",
  "~y~Yellow Text~w~ and ~g~Green Text~w~ work!",
  "icons/maps-icon.png"
)
-- use default icons from icons folder or use direct link.

-- ADVANCED
exports['mfp_notify']:ShowNotification(
  source,
  "Mission Update", -- Title (App Name)
  "~r~This is a test notification~w~ in the top left.", -- Description (with colorcode and multiline support)
  "https://mfpscripts.com/icon.png", -- can be icons/*.* or link
  "top-left" -- can be top-left, top-right or bottom-left
)
-- use top-left, top-right or bottom-left (In the Config.lua you can choose default

exports['mfp_notify']:ShowNotificationToAll(
  "Maps",
  "~y~Yellow Text~w~ and ~g~Green Text~w~ work!",
  "icons/maps-icon.png",
  "bottom-left"
)

Last updated