Skip to content

Notification Server

A library to display notification on the player screen server side

JO Functions

jo.notif.left()

Notification on the left with title, icon, color and sound

Syntax

lua
jo.notif.left(source, title, text, dict, icon, color, duration, soundset_ref, soundset_name)

Parameters

source : integer

The source ID of the player

title : string

The title of the notification

text : string

The text of the notification

dict : string

The dictionnary of the icon

icon : string

The name of the icon

color : string Optional

The color of the text
default : "COLOR_WHITE"

duration : integer Optional

The duration of the notification in ms
default: 3000

soundset_ref : string Optional

The dictionnary of the soundset
default : "Transaction_Feed_Sounds"

soundset_name : string Optional

The name of the soundset
default : "Transaction_Positive"

Example

lua
local source = 1
local title = "Title"
local text = "The text"
local dict = "hud_textures"
local icon = "check"
local color = "COLOR_GREEN"
local duration = 5000
jo.notif.left(source, title, text, dict, icon, color, duration)
Preview

jo.notif.print()

A function to print in the client console from the server side

Syntax

lua
jo.notif.print(source, ...)

Parameters

source : integer

The source ID of the player

... : any

The data you want to print

Example

lua
local source = 1
local data = {
    foo = "bar",
    bar = "foo"
}
jo.notif.print(source, json.encode(data))

jo.notif.right()

Notification on the right with icon, color and sound

Syntax

lua
jo.notif.right(source, text, dict, icon, color, duration, soundset_ref, soundset_name)

Parameters

source : integer

(The source ID of the player)

text : string

The text of the notification

dict : string

The dictionnary of the icon

icon : string

The name of the icon

color : string Optional

The color of the text
default : "COLOR_WHITE"

duration : integer Optional

The duration of the notification in ms
default: 3000

soundset_ref : string Optional

The dictionnary of the soundset
default : "Transaction_Feed_Sounds"

soundset_name : string Optional

The name of the soundset
default : "Transaction_Positive"

Example

lua
local source = 1
local text = "Success notification"
local dict = "hud_textures"
local icon = "check"
local color = "COLOR_GREEN"
local duration = 5000
jo.notif.right(source, text, dict, icon, color, duration)
Preview

jo.notif.rightError()

A function to display an error notification

Syntax

lua
jo.notif.rightError(source, text)

Parameters

source : integer

The source ID of the player

text : string

The text of the notification

Return Value

Type : boolean

Always return false

Example

lua
local source = 1
jo.notif.rightError(source, "Error !")
Preview

jo.notif.rightSuccess()

A function to display a successful notification

Syntax

lua
jo.notif.rightSuccess(source, text)

Parameters

source : integer

The source ID of the player

text : string

The text of the notification

Return Value

Type : boolean

Always return true

Example

lua
local source = 1
jo.notif.rightSuccess(source, "Success notification")
Preview

jo.notif.simpleTop()

Notification on the top with big title and subtitle (native mission start/end)

Syntax

lua
jo.notif.simpleTop(source, title, subtitle, duration)

Parameters

source : integer

The source ID of the player

title : string

The title of the notification

subtitle : string

The text of the notification

duration : integer Optional

The duration of the notification in ms
default : 3000

Example

lua
local title = "Mission Started"
local subtitle = "You just start a great mission !"
local duration = 5000
local source = 1
jo.notif.simpleTop(source, title, subtitle, duration)
Preview

Last updated: