API Reference
Public exports and events for NZ Dialog v1 integration
Client Exports
Client-side functions for dialog display and interactions.
| Export | Parameters | Returns | Description |
|---|---|---|---|
showDialog(data, cb) | data: table, cb: function | void | Shows a dialog to the player with callback |
closeDialog() | none | void | Closes the currently open dialog |
isDialogOpen() | none | boolean | Returns true if a dialog is currently open |
Server Exports
Server-side functions for managing player dialogs.
| Export | Parameters | Returns | Description |
|---|---|---|---|
showDialogToPlayer(playerId, data, cb) | playerId: number, data: table, cb: function | void | Shows a dialog to a specific player |
closeDialogForPlayer(playerId) | playerId: number | void | Closes dialog for a specific player |
showDialogToAll(data, cb) | data: table, cb: function | void | Shows a dialog to all players |
System Overview
NZ Dialog provides a flexible dialog system for player interactions.
- Client: Handles dialog display, user input, and local interactions
- Server: Manages server-initiated dialogs and processes responses
- Types: Supports confirmation, input, and selection dialogs
Dialog Types
confirm: Yes/No confirmation dialogsinput: Text input dialogs with validationselect: Multiple choice selection dialogs
For detailed integration examples, see the Client Integration and Server Integration pages.
Example Usage
-- Show a dialog to a player
exports['nz_dialog']:showDialog({
title = 'Confirm Action',
message = 'Are you sure you want to proceed?',
buttons = {
{ label = 'Yes', value = true },
{ label = 'No', value = false }
}
}, function(response)
if response then
print('Player confirmed!')
else
print('Player cancelled.')
end
end)
-- Listen for dialog response
RegisterNetEvent('nz_dialog:client:dialogResponse', function(response)
print('Dialog response:', response)
end)For advanced use cases, contact the development team for guidance on safe integration.
NZ Dialog
NZ Dialog is a modular, closed-source dialog and interaction framework for FiveM. It provides public APIs and event hooks for creating interactive dialogs, menus, and prompts, while keeping internal logic secure.
Client Integration
This page covers client-side functionality for NZ Dialog v1. These functions handle dialog display and user interactions.