⚙️Usage
Detailed explanation of the config file to adapt the resource to your player needs.
TASK UI
If you want to use the task ui to hide after 3 seconds for example :
local Data = {
title = 'TITLE HERE',
txt = 'MESSAGE HERE\nANOTHER MESSAGE HERE'
}
exports['zat-ui']:ShowTBUi(Data, 3000)
If you want to use the task ui and hide it later:
local Data = {
title = 'TITLE HERE',
txt = 'MESSAGE HERE\nANOTHER MESSAGE HERE'
}
exports['zat-ui']:ShowTBUi(Data)
exports['zat-ui']:hideUI()
MENU
RegisterCommand('menutest', function()
exports['zat-ui']:openMenu({
{
header = 'Test Menu',
txt = 'Test Menu Header',
icon = 'fas fa-download',
isMenuHeader = true, -- Set to true to make a nonclickable title
},
{
header = 'First Button',
txt = 'Print a message!',
icon = 'fas fa-user',
params = {
event = 'zat-menu:client:testButton',
args = {
message = 'This was called by clicking a button'
}
}
},
{
header = 'Second Button',
txt = 'Open a secondary menu!',
icon = 'fas fa-code-pull-request',
-- disabled = false, -- optional, non-clickable and grey scale
-- hidden = true, -- optional, hides the button completely
params = {
-- isServer = false, -- optional, specify event type
event = 'zat-menu:client:subMenu',
args = {
number = 2,
}
}
},
})
end)
RegisterNetEvent('zat-menu:client:subMenu', function(data)
local number = data.number
exports['zat-ui']:openMenu({
{
header = 'Return to main menu',
txt = 'Return to main menu',
icon = 'fa-solid fa-backward',
params = {
event = 'zat-menu:client:mainMenu',
args = {}
}
},
{
header = 'Sub-menu button',
txt = 'Print a message!',
icon = 'fas fa-code-merge',
params = {
event = 'zat-menu:client:testButton',
args = {
message = 'This was called by clicking a button'
}
}
}
})
end)
RegisterNetEvent('zat-menu:client:mainMenu', function()
ExecuteCommand('menutest')
end)
RegisterNetEvent('zat-menu:client:testButton', function(data)
print(data.message)
end)
Last updated