Functions
Here you will find a list of all available functions to integrate into your own scripts.
Show Notification
These notifications are displayed in the right corner, they only show information and cannot be interacted with.
exports['ice_hud']:Notify(Text, 5000)
Params
- Notification Text (The text that will be displayed in the notification)
- Notification Time (The time the notification will be open expressed in milliseconds)
Example
Here we see the difference between an QBCore and an ICE notification, the most notable difference is the appearance of one more parameter in the function, which in this case is the duration so that you can modify it to your liking.
QBCore.Functions.Notify("My QBCore testing notification")
The notification time is expressed in milliseconds, so 5 seconds equals 5000 milliseconds. Otherwise the notification will not work.
Help Notification
These notifications are displayed at the top right, and give information to interact with certain things.
exports['ice_hud']:HelpNotify(Text)
Params
- Notification Text (The text that will be displayed in the notification)
Example
There is no difference between the QBCore and ICE function, the parameters are the same, you only need to change the name of the function.
QBCore.Functions.DrawText3D(154.54, -200.4, 35, "My QBCore help notification example")
Request Notification
This notification allows the user to receive a request in which he can accept or reject it.
local dialog = exports['ice_hud']:RequestNotify({
title = "My Title",
description = "My description",
btnAccept = "Accept",
btnCancel = "Decline"
})
-- dialog return a bool value
Params (values must be inside a JSON):
- title (The title of the request notify)
- description (The text that will be placed above the title that contain all info related to the notify)
- btnAccept (The text that will be inside the accept button)
- btnCancel (The text that will be inside the cancel button)
Return
- A bool value that is the option that the user has selected.
In this example a notification is shown when the player enters the command "reqnotify", in any case a notification will appear notifying the player of the action performed.
RegisterCommand("reqnotify", function()
local dialog = exports['ice_hud']:RequestNotify({
title = "Test Notify",
Description = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam eu semper felis, eget ornare nisi. ",
btnAccept = "test",
btnCancel = "cance"
})
if dialog == true then
exports['ice_hud']:Notify("ACCEPTED!", 5000)
else
exports['ice_hud']:Notify("REJECTED!", 5000)
end
end)