HexscriptsVersion 3.0Confirm
Configurations
Here you will get all configurations & open source files that are included within this script.
Config Files
Config = {}
Config.Server = {
Name = 'Hexscripts',
Script = 'Confirm'
}
--[[
return: boolean - Whether the confirm menu was opened successfully
text: string - The text to display in the confirm menu
acceptText: string - The text to display on the accept button
denyText: string - The text to display on the deny button
accept: { -- optional
triggerType: 'C' | 'S' - Whether to trigger a client or server event on accept
trigger: string - The event to trigger on accept
args: any - The arguments to pass to the event on accept as table
}
deny: { -- optional
triggerType: 'C' | 'S' - Whether to trigger a client or server event on deny
trigger: string - The event to trigger on deny
args: any - The arguments to pass to the event on deny as table
},
colors: { -- optional must be valid css colors like in the html/css/style.css with linear-gardient etc
--bg-1: string - The CSS gradient for the first background layer
--bg-2: string - The CSS gradient for the second background layer
--bg-3: string - The CSS gradient for the third background layer
--header-lbg: string - The CSS gradient for the header background
--header-textshadow: string - The CSS color for the header text shadow
--accept-lbg: string - The CSS gradient for the accept button background
--accept-hover: string - The CSS color for the accept button hover background
--cancel-lbg: string - The CSS gradient for the cancel button background
--cancel-hover: string - The CSS color for the cancel button hover background
}
]]
RegisterCommand('openConfirmMenu', function(_, args)
local isSuccess = exports['hex_3_confirm']:OpenConfirmMenu({
text = 'Are you sure you want to proceed? <span>if you accept, an event will be triggered.</span>',
acceptText = 'Yes',
denyText = 'No',
accept = {
triggerType = 'C',
trigger = 'hex_final_hud:notify',
args = {
'Information',
'You have accepted the confirmation!',
'info',
5000
}
},
deny = {
triggerType = 'C',
trigger = 'hex_final_hud:notify',
args = {
'Information',
'You have declined the confirmation!',
'info',
5000
}
}
})
print('Confirm menu opened:', isSuccess)
end)
--[[
return: boolean - Whether the confirm menu was closed successfully
]]
RegisterCommand('closeConfirmMenu', function()
local isSuccess = exports['hex_3_confirm']:CloseConfirmMenu()
print('Confirm menu closed:', isSuccess)
end)