Export
Quality of life scripts for your FiveM server. Performance optimized resources that install in minutes, with free updates and support that actually answers.
The cad-notepad resource provides utility exports to manage the notepad UI, including toggling visibility and checking its open state.
IsOpen
Checks whether the notepad is currently open.
exports['cad-notepad']:IsOpen()
Returns:
booleanβtrueif the notepad is open,falseotherwise.
Usage:
if exports['cad-notepad']:IsOpen() then
print("Notepad is currently open")
endToggleNotepad
Toggles the notepad UI for the player. Optionally forces it open.
exports['cad-notepad']:ToggleNotepad(data, force)Parameters:
data(table, optional) β Pass any relevant information for the notepad (e.g., prefilled content)
Key |
Type |
Description |
|---|---|---|
|
|
Slot index of the notepad |
|
|
Text content to display |
|
|
JSON string of canvas drawing data |
|
|
Name or signature of the user |
|
|
(Optional) Position where note was created |
|
|
If true, sets the notepad to read-only mode |
|
|
(Optional) Force open, even if already open |
force(boolean, optional) β Iftrue, forces the notepad to open regardless of current state.
Example:
exports['cad-notepad']:ToggleNotepad({
slot = 0,
paragraph = "Initial field notes for investigation.",
signature = "Officer R. Singh",
coords = vector3(-334.9, -1040.5, 76.88),
drawing = "{\"lines\":[{\"points\":[{\"x\":83.70,\"y\":296.85},{\"x\":85.29,\"y\":295.26},{\"x\":91.46,\"y\":285.40}...],\"brushColor\":\"#161616\",\"brushRadius\":1}],\"width\":400,\"height\":400}",
disabled = true
}, true)Server β Client: cad-notepad:toggle
Triggers the notepad from the server side.
TriggerClientEvent('cad-notepad:toggle', source, data, force)Parameters:
source(number) β Player's server ID.data(table, optional) β Same asToggleNotepad.force(boolean, optional) β Force toggle on the client.
Example:
TriggerClientEvent('cad-notepad:toggle', src, { text = "Server-pushed note" }, true)