The values remain stored in memory even after closing the dialog, but are replaced when another dialog is opened, because SAMP does not support multiple dialogs.
So, you don't need to get the id in client-side, but if you still want to, SAMPFUNCS provides some opcodes for that:
0B4E: samp 1@ = get_current_dialog_id
0BD8: samp get_dialog_caption 0@
GetCurrentDialogListboxItemText works for any dialog list, you don't need to provide the style, but if you really want to, you can easily add one 'if' inside the snippet...
About the dialog opened checker: you just need to remove (or comment) it
PHP:
:GetCurrentDialogListboxItemText
{
0.3.7 - R1
0AB1: @GetCurrentDialogListboxItemText 1 ListItem 9 _Returned: FirstColumnText 6@ SecondColumnText 7@ ThirdColumnText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
0A8E: 30@ = 31@ + 0x21A0B8 // DIALOG_POINTER_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
//0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
//0A8D: 29@ = readMem 29@ sz 4 vp 0
//IF 29@ == TRUE // DIALOG OPEN
//THEN
0A8E: 27@ = 30@ + 0x20 // SAMP_DIALOG_PTR2_OFFSET
0A8D: 27@ = readMem 27@ sz 4 vp 0
0A8E: 22@ = 27@ + 0x150 // SAMP_DIALOG_LINECOUNT_OFFSET
0A8D: 22@ = readMem 22@ sz 4 vp 0
22@ -= 1 // LAST ITEM IS ACTUALLY THEN NULL TERMINATOR
IF 001D: 0@ > 22@ // (int)
THEN 0085: 0@ = 22@ // (int)
END
IF AND
NOT 0@ < 0
801D: 0@ > 22@ // (int)
THEN
0A8E: 26@ = 27@ + 0x14C // SAMP_DIALOG_LINES_OFFSET
0A8D: 26@ = readMem 26@ sz 4 vp 0
0@ *= 4
005A: 26@ += 0@ // (int)
0A8D: 26@ = readMem 26@ sz 4 vp 0
0A8E: 28@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
0A8D: 28@ = readMem 28@ sz 4 vp 0 //<-------- 28@ stores the style id
IF 28@ == 2 // DIALOG_STYLE_LIST
THEN
0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
0A8D: 21@ = readMem 25@ sz 1 vp 0
IF NOT 21@ > 0
THEN 25@ = 0
END
0AB2: 1 25@
END
IF 28@ == 4 // DIALOG_STYLE_TABLIST
THEN
0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
0A8D: 21@ = readMem 25@ sz 1 vp 0
IF NOT 21@ > 0
THEN 25@ = 0
END
0A8D: 20@ = readMem 24@ sz 1 vp 0
IF NOT 20@ > 0
THEN 24@ = 0
END
0AB2: 2 25@ 24@
END
IF 28@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
THEN
0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
0A8E: 23@ = 26@ + 0x182 // SAMP_DIALOG_THIRD_COLUMN_TEXT_OFFSET
0A8D: 21@ = readMem 25@ sz 1 vp 0
IF NOT 21@ > 0
THEN 25@ = 0
END
0A8D: 20@ = readMem 24@ sz 1 vp 0
IF NOT 20@ > 0
THEN 24@ = 0
END
0A8D: 19@ = readMem 23@ sz 1 vp 0
IF NOT 19@ > 0
THEN 23@ = 0
END
0AB2: 3 25@ 24@ 23@
END
END
//END
END
0AB2: 3 0 0 0
If u want to get the caption w/o SAMPFUNCS:
PHP:
:GetDialogCaption
{
0.3.7 - R1
0AB1: @GetDialogCaption 0 caption_text 0@
}
0AA2: 1@ = "samp.dll"
1@ += 0x21A0B8
0A8D: 1@ = readMem 1@ sz 4 vp 0
0A8E: 3@ = 1@ + 0x40 //DialogCaptionOffset
0AB2: ret 1 3@