F5 StudioF5 Studio
Skip to main content

API

Client export

exports.gta6_notify:Notify(...) accepts three call shapes. The first argument decides which one is used.

Client-side
-- 1. Table (full control)
exports.gta6_notify:Notify({
message = '+$8,500',
title = 'BANK',
type = 'money',
duration = 6000,
position = 'bottom-right',
})

-- 2. message, type, duration (qb-core order)
exports.gta6_notify:Notify('Vehicle stored', 'car')
exports.gta6_notify:Notify('Not enough money', 'error', 4000)

-- 3. type, length, message (esx_notify order)
exports.gta6_notify:Notify('success', 5000, 'Done')

Shape 3 is recognised when the second argument is a number and the third is a string. Everything else falls into shape 2.

Table fields

FieldTypeRequiredNotes
messagestringyesAlso accepted as text or msg. An empty string or a non-string aborts the call
typestringnoA type from Config.Types or an alias. Case-insensitive. Unknown → info
titlestringnoAlso accepted as caption. Default Config.Title
durationnumber (ms)noAlso accepted as length. Default Config.Duration; the NUI enforces at least 1500 ms
positionstringnoOne of the nine positions. Unknown → Config.Position
colorstringnoHex colour overriding the type's accent
iconstringnoFile name from html/icons ('car.png') or a full URL / path containing / or :
soundstring or falsenoFile name from html/sounds or a URL. false mutes this card. Omitted → the type's sound or Config.Sound.file

A duration given as a string is converted with tonumber.

Client event

Client-side
TriggerEvent('gta6_notify:client:notify', { type = 'error', message = 'No permission' })

The event takes the same table (or a plain string as the message) and is a net event, so the server can trigger it directly:

Server-side
TriggerClientEvent('gta6_notify:client:notify', source, { type = 'error', message = 'No permission' })

Server export

Server-side
exports.gta6_notify:Notify(source, { type = 'success', message = 'Done' })
exports.gta6_notify:Notify(source, 'Done', 'success', 5000)

Signature: Notify(target, data, type, duration). When data is not a table, it is wrapped as { message = data, type = type, duration = duration }. target is passed straight to TriggerClientEvent, so -1 reaches everyone.

Framework hooks

When enabled in the config, the resource listens to:

EventEnabled byMapping
QBCore:Notify(text, type, length)Config.HookQBCoretext may be a string or a table with text and caption
esx:showNotification(msg, type, length)Config.HookESXDirect mapping
esx:showAdvancedNotification(title, subject, msg)Config.HookESXtitle and msg; the subject and icon are ignored

Both hooks are off by default because the recommended install patches the framework function instead (see Installation).

Command

CommandEffect
/gta6notify [type] [position]Shows a test card. Unknown or missing type → info, unknown or missing position → Config.Position. The message text is Polish ("Test powiadomienia typu …")