Skip to content
Алексей . edited this page Oct 22, 2026 · 4 revisions

The core UI consists of SA-MP chat/dialogs, read-only textdraw/menu state and sampled keyboard queries. ImGui/D3D9 belongs to the optional SFUI library.

Dialogs

Samp.Dialog exposes ShowMessage, ShowInput and ShowList. Call them on the game thread. Results are SFDialogButton, SFDialogInputResult and SFDialogListResult, not Runtime tuples. Validate the button and selected index before indexing items.

The current runtime replaces a previous pending local dialog rather than queuing independent windows. Host-owned responses are consumed instead of being sent as unsolicited server DialogResponse RPCs. Other dialogs can replace the displayed window. The public Show methods have no cancellation-token parameter; cancelling an owned command does not invent one. Avoid overlapping flows and account for closure/replacement.

Pools and input

Pools.TextDraws offers existence, ID enumeration and copied snapshots, not public SetText/Draw wrappers. Menus exposes current state, existence and IDs. Observe textdraw selection through Actions.TextDraws; 65535 is no target/cancel.

Keyboard.IsKeyDown(byte) reports held state; IsKeyPressed reports a sampled transition. Escape is Win32 VK 0x1B. Reads are thread-safe, but queries are not exclusive input capture and do not cancel GTA's own handling. Use SFUI's input ownership when interacting with its windows.

Sources: ISFDialog, implementation, keyboard, textdraws.

Clone this wiki locally