Groot Development
Store
  • 👋Welcome
  • Coding Information
    • Register Key Mapping
  • ASSETS
    • 🕙g-duty
      • Why?
      • Installation
      • Config.lua
    • 📋g-scoreboard-V1
      • Installation
      • Config.lua
    • 📋g-scoreboardV2
      • Installation
      • Config.lua
      • Exports & Events
    • 🎁g-giftcard
      • Installation
      • Config.lua
      • Export
    • 🏡g-job-vehicle-shop
      • Installation
      • ⚙️Configuration
        • Exports
        • Create Vehicle Management Panel
        • Create Vehicle Shops
    • 💯g-redeem-code
      • 🗒️Features
      • Installation
      • ⛔Note
      • ⚙️Configuration
        • Create New item
    • 📖g-pausemenu
      • 🗒️Features
      • Installation
      • ⚙️Features Guide
        • Info Buttons
        • socials Buttons
        • Rules
        • Organization Avatar
    • 🛠️g-crafting
      • 🗒️Features
      • 📦Patch Details
      • Installation
      • ❔Why
      • ⚔️Exports
      • Configuration
        • How to Create New Station
        • How to Create crafting time for an item.
    • 🛒g-shopsV2
      • 🗒️Features
      • 📦Patch Details
      • Installation
      • ⚔️Exports
      • Configuration
        • How to Create New Shop
        • How to create new item
    • 🔧g-adv-modern-repairkit
      • 🗒️Features
      • 📦Patch Details
      • Installation
      • ⚙️Configuration
  • 📖g-pausemenu-simplified
    • 📦Patch Details
    • Installation
    • ❔Why
    • Configuration
      • Git Dev Patchs
  • FREE RELEASE
    • 🎁g-starterpack-gift
      • Installation
      • Config.lua
    • 👨‍🔬g-employee-chat-list
      • Installation
    • g-notifications
      • Installation
      • Notification
      • Framework Integration
      • Remove Notification By ID
Powered by GitBook
On this page
  1. FREE RELEASE
  2. g-notifications

Framework Integration

Before modifying any core files, it's recommended that you have at least beginner-level coding experience. Improper edits may cause unexpected issues in your framework.

File: es_extended/client/functions.lua Replace the default QBox notification with:

function ESX.ShowNotification(message, notifyType, length)
	local NotifyType = "info"

	if notifyType == 1 or notifyType == "success" then
		NotifyType = "success"
	elseif notifyType == 0 or notifyType == "error" then
		NotifyType = "error"
	end

	local duration = length or 3000

	if GetResourceState("g-notifications") ~= "missing" then
		return exports["g-notifications"]:Notify({
			title = "Groot Development",
			description = message,
			duration = duration,
			type = NotifyType,
			position = "top-right",
		})
	end
end

File: qb-core/client/functions.lua Replace the default QBox notification with:

function QBCore.Functions.Notify(text, texttype, length)
	local notifyType = texttype or "info"
	local notificationDuration = length or 3000
	local notificationPosition = "top-right"

	if notifyType == "primary" then
		notifyType = "info"
	elseif notifyType == "warning" then
		notifyType = "warn"
	end

	exports["g-notifications"]:Notify({
		title = "Groot Development",
		description = text,
		type = notifyType,
		duration = notificationDuration,
		position = notificationPosition,
	})
end

File: qbx_core/client/functions.lua Replace the default QBox notification with:

function Notify(text, notifyTypeo, duration, subTitle, notifyPosition, notifyStyle, notifyIcon, notifyIconColor)
	local title, description
	if type(text) == "table" then
		title = text.text or "Placeholder"
		description = text.caption or nil
	elseif subTitle then
		title = text
		description = subTitle
	else
		description = text
	end

	local notifyType = notifyTypeo or "info"
	local notificationDuration = duration or 3000
	local notificationPosition = "top-right"

	if notifyType == "primary" or notifyType == "inform" then
		notifyType = "info"
	elseif notifyType == "warning" then
		notifyType = "warn"
	end

	exports["g-notifications"]:Notify({
		id = title,
		title = title,
		description = description,
		type = notifyType,
		duration = notificationDuration,
		position = notificationPosition,
	})
end
PreviousNotificationNextRemove Notification By ID

Last updated 23 days ago