A DUI session lets you host aDocumentation Index
Fetch the complete documentation index at: https://docs.cc-scripts.com/llms.txt
Use this file to discover all available pages before exploring further.
cc_minigames minigame inside a DUI render target you create yourself — typically so the game UI can be projected onto a wall-mounted CRT, monitor, or other prop via AddReplaceTexture.
The caller still owns the DUI lifecycle. cc_minigames only hands you a correctly-shaped start payload, a cancel payload, and a result callback channel.
When to use this
| Use case | Use this |
|---|---|
| Player presses a key, a minigame opens fullscreen, blocks until done. | The plain export. Not this. |
| Minigame UI must appear on an in-world prop’s texture. | This. |
| The minigame is just one panel inside another resource’s NUI dashboard (iframe-like). | The plain export with embed = true, not this. The embed option does the same focus-ownership handover without DUI plumbing. |
API
Lifecycle
Create your DUI surface
Standard CitizenFX DUI flow: create the DUI pointing at
https://cc_minigames/web/index.html, attach its render target to the in-world prop with AddReplaceTexture.Open a session
Call
CreateDuiSession with the minigame, variant, opts, and onResult callback.The controller you get back exposes the start message that needs to be pushed into the DUI once it’s loaded.Send the start message into the DUI
start action it sees on a normal session and renders the requested minigame inline (because the controller forces opts.embed = true so the page doesn’t try to grab focus).Receive the result
When the player finishes (or cancels),
onResult(success) fires once. You’re responsible for tearing down the DUI on your side.How result routing works
The DUI’s NUI page reaches the resource via the sameRegisterNUICallback channel as the fullscreen NUI does — but the data.id it sends back is the DUI session id you got from CreateDuiSession, not the player’s active-session id. cc_minigames checks the id against its registry of DUI sessions first. If it matches, your onResult fires and the player’s regular activeSession is left alone. If it doesn’t match, the call falls through to the normal path.
This is why two DUI minigames and one fullscreen minigame can theoretically coexist on a single client — they each have their own id namespace.
Frequency forwarding
For the multiplayer Frequency game, the server pushesstate and finish events to specific player sources, keyed on the sessionToken. If your DUI is showing the viewer half (the most common DUI scenario — a CRT prop on the heist wall), pass sendMessage to CreateDuiSession and cc_minigames will forward those server events into your DUI as well, so the viewer’s waveform stays live without any extra wiring.
Notes
- The controller’s
dispose()is idempotent — calling it twice is fine. - You can have multiple DUI sessions live at once. Each gets its own id.
- A normal fullscreen session opened via
:Pattern{},:Crack{}, etc. is separate from DUI sessions and is unaffected by them.