WHILE TRUE
WAIT 0
if 0C89: key_just_pressed 0x1B
then
Dialog.SetVisible(0@, False)
SAMP.SetCursorMode(0)
end
if Dialog.IsVisible(0@)
then
SAMP.SetCursorMode(2)
Dialog.ListBoxGetSelectedAndCount(0@, 1, 5@, -1)
if Dialog.PopEvent(0@, 3@, 4@)
then
if 4@ == 1 //Select
then
if 5@ == 1 //RowID
then
chatmsg "You selected Row 1 and pressed button 1" -1
wait 1000 //Anti spam
end
if 5@ == 2 //RowID
then
chatmsg "You selected Row 2 and pressed button 2" -1
wait 1000 //Anti spam
end
if 5@ == 3 //RowID
then
chatmsg "You selected Row 3 and pressed button 3" -1
wait 1000 //Anti spam
end
end
if 4@ == 2 //Exit
then
Dialog.SetVisible(0@, False)
SAMP.SetCursorMode(0)
end
end
end
END
Seems I have mistake here, Now... When:
I select "Row 1" Doesn't work.
I select "Row 2" This gonna work -> chatmsg "You selected Row 1 and pressed button 1" -1
I select "Row 3" This gonna work -> chatmsg "You selected Row 2 and pressed button 2" -1
:CreateDialog
Dialog.Create(0@, "DialogTitle")
SAMP.GetScreenResolution(1@, 2@)
1@ /= 2
2@ /= 2
1@ -= 100
2@ -= 100
Dialog.SetRECT(0@, 1@, 2@, 469, 410)
Dialog.AddListBox(0@, 1, 3, 3, 460, 340)
Dialog.AddButton(0@, 1, "Select", 30, 350, 150, 35)
Dialog.AddButton(0@, 2, "Exit", 250, 350, 150, 35)
Dialog.ListBoxInsertElement(0@, 1, "Row 1", 1, -1)
Dialog.ListBoxInsertElement(0@, 1, "Row 2", 2, -1)
Dialog.ListBoxInsertElement(0@, 1, "Row 3", 3, -1)
What is your solution?