CLEO Help Dialog Active Panel Selection?!

CLEO related
Status
Not open for further replies.

Husnain

Well-known member
Joined
May 20, 2016
Messages
228
Reaction score
9
Location
Mars
Hi,

I know that how to make a Dialog box but did not know that How to make it active and select those things. For example:

I add a "Dialog button" now how i can make it active that if i click on it then this will happen.

Hope, you know what i'm saying.
 

bladero

Active member
Joined
Jan 3, 2017
Messages
73
Reaction score
0
0B3C: samp is_dialog_responded id 1000 button 1@ list_item 2@ input_text 0 Then check if 1@ == 1 (If its pressed) THEN do something
 

Kenshiro

Active member
Joined
Aug 20, 2017
Messages
43
Reaction score
0
Location
Oblivion
Code:
:extp                                            //for create dialog///
0AC6: 1@ = label @extext //edit this with your text hex// offset
0B3B: samp show_dialog id 1000 //you can edit this id like 900,100 etc etc// caption "EXAMPLE"//you can edit this// text 1@ button_1 "OK" //you can edit this// button_2 "CANCEL" //you can edit this// s.tyle 2  //wrote it without ., you can edit this too. if you write 1 to this it will create a dialog option with enterable value  and 2 for normal dialog etc etc//
0B43: samp cmd_ret

:extext
HEX
"extext1" A ///you can put infinite text here//
"extext2" 0
END


while true
wait 0
IF        //this will do action if you click ok with selected item//
0B3C: samp is_dialog_responded id 1000 //it must be same as show_dialog// button 2@ ///this is our ok button// list_item 3@ ///this will check our selected item/// input_text 0
THEN
IF AND
2@ == 1 //check for if we clicked ok button//
3@ == 0 //check for selected item id 0 is extext1//
THEN
// DO YOUR ACTION HERE
END

IF AND
2@ == 1 //as i say this is check for ok button//
3@ == 1 //check for selected item id 1 is extext2
//DO YOUR ACTION HERE
END 

END //CLOSE RESPONSE

END //CLOSE WHILE TRUE
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
[shcode=cpp]
{$CLEO .cs}
0000:


REPEAT
   WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

0B34: "dialog" @toggle

WHILE TRUE
   WAIT 0    

IF
24@ == TRUE
THEN  
   0AC6: 25@ = label @SHOW_DIALOG offset  
   0B3B: samp show_dialog id 998 caption "Dialog Title 2" text 25@ button_1 "OK" button_2 "CLOSE" style 2  
   24@ = FALSE
END

IF
0B3C: samp is_dialog_responded id 998 button 26@ list_item 27@ input_text 0
THEN


IF
26@ == 1 // OK button
THEN
   IF
   27@ == 2
   THEN
       0AF8: "Dialog 2 - TEST 1" -1
   END
END

IF
26@ == 1 // OK button
THEN
   IF
   27@ == 3
   THEN
       0AF8: "Dialog 2 - TEST 2" -1
   END
END

IF
26@ == 1 // OK button
THEN
   IF
   27@ == 4
   THEN
       0AF8: "Dialog 2 - TEST 3" -1
   END
END

IF
26@ == 1 // OK button
THEN
   IF
   27@ == 5
   THEN
       0AF8: "Dialog 2 - TEST 4" -1
   END
END

END //// END 0B3C: samp is_dialog_responded id 998 button 26@ list_item 27@ input_text 0
   
END /// END WHILE TRUE


:SHOW_DIALOG
hex
"{148730}---------------------- Test Dialog Line 1 ------------------------------" 0A
" " 0A
"{FFFFFF}Dialog 2 - TEST 1" 0A
"{00FF00}Dialog 2 - TEST 2" 0A
"{FF0000}Dialog 2 - TEST 3" 0A
"{FFFF00}Dialog 2 - TEST 4" 0A  
" " 00
end

:toggle
0B12: 24@ = 24@ XOR 1

0B43:
[/shcode]
 
Status
Not open for further replies.
Top