-- Example 1
exports["is_dialogv2"]:showDialog({
title = "Example Title",
message = "Example Message",
buttons = {
{text = "Example Button 1", onSelect = function(buttonIndex)
exports["is_dialogv2"]:hideDialog()
print(("Button: %s"):format(buttonIndex))
end},
{type = "button", text = "Example Button 2", onSelect = function(buttonIndex)
exports["is_dialogv2"]:hideDialog()
print(("Button: %s"):format(buttonIndex))
end},
{type = "number", text = "Your number...", onSelect = function(buttonIndex, value)
exports["is_dialogv2"]:hideDialog()
print(("Input: %s"):format(value))
end},
{type = "text", text = "Your text...", onSelect = function(buttonIndex, value)
exports["is_dialogv2"]:hideDialog()
print(("Input: %s"):format(value))
end},
},
})
-- Example 2
exports["is_dialogv2"]:showDialog({
typeEffect = true,
typeEffectSpeed = 15,
allowSkip = false,
title = "Example Title",
message = "Example Message",
tags = {
{text = "TAG1", color = "#009BFF"},
{text = "TAG2", color = "#FF425D", icon = "fa-solid fa-house"},
},
buttons = {
{text = "Example Button 1", onSelect = function(buttonIndex)
exports["is_dialogv2"]:hideDialog()
print(("Button: %s"):format(buttonIndex))
end, canInteract = function()
return true
end},
{type = "button", text = "Example Button 2", onSelect = function(buttonIndex)
exports["is_dialogv2"]:hideDialog()
print(("Button: %s"):format(buttonIndex))
end, canInteract = function()
return false
end},
{type = "number", text = "Your number...", onSelect = function(buttonIndex, value)
exports["is_dialogv2"]:hideDialog()
print(("Input: %s"):format(value))
end},
{type = "text", text = "Your text...", onSelect = function(buttonIndex, value)
exports["is_dialogv2"]:hideDialog()
print(("Input: %s"):format(value))
end},
{type = "item", text = "Choosed Item", onSelect = function(buttonIndex, item)
exports["is_dialogv2"]:hideDialog()
print(("Name: %s, Path: %s, Count: %s, Label: %s"):format(item.name, item.path, item.count, item.label))
end},
},
items = {
{name = "meth", path = "nui://qb-inventory/html/images/meth_baggy.png"},
{name = "weed_whitewidow", path = "https://as2.ftcdn.net/v2/jpg/02/16/71/15/1000_F_216711557_4b4flusrgydnwFabeeQMLlZo2Lr85Jw0.jpg"},
{name = "weed_skunk", path = "images/weed_baggy.png"},
},
})
-- Example 3
exports["is_dialogv2"]:showDialog({
typeEffect = true,
typeEffectSpeed = 15,
allowSkip = false,
title = "Example Title",
message = "Example Message",
chat = {
range = 5.0,
message = true,
answer = true,
},
audio = {
path = "audio/2pac.mp3",
volume = 75,
},
tags = {
{text = "TAG1", color = "#009BFF"},
{text = "TAG2", color = "#FF425D", icon = "fa-solid fa-house"},
},
buttons = {
{text = "Example Button 1", onSelect = function(buttonIndex)
exports["is_dialogv2"]:hideDialog()
print(("Button: %s"):format(buttonIndex))
end, canInteract = function()
return true
end},
{type = "button", text = "Example Button 2", onSelect = function(buttonIndex)
exports["is_dialogv2"]:hideDialog()
print(("Button: %s"):format(buttonIndex))
end, canInteract = function()
return false
end},
{type = "number", text = "Your number...", onSelect = function(buttonIndex, value)
exports["is_dialogv2"]:hideDialog()
print(("Input: %s"):format(value))
end},
{type = "text", text = "Your text...", onSelect = function(buttonIndex, value)
exports["is_dialogv2"]:hideDialog()
print(("Input: %s"):format(value))
end},
{type = "item", text = "Choosed Item", onSelect = function(buttonIndex, item)
exports["is_dialogv2"]:hideDialog()
print(("Name: %s, Path: %s, Count: %s, Label: %s"):format(item.name, item.path, item.count, item.label))
end},
},
items = {
{name = "meth", path = "nui://qb-inventory/html/images/meth_baggy.png"},
{name = "weed_whitewidow", path = "https://as2.ftcdn.net/v2/jpg/02/16/71/15/1000_F_216711557_4b4flusrgydnwFabeeQMLlZo2Lr85Jw0.jpg"},
{name = "weed_skunk", path = "images/weed_baggy.png"},
},
})