CLEO Help SAMPFUNCS - DIalog, check if button is pressed?

CLEO related
Status
Not open for further replies.

Spix

Well-known member
Joined
Sep 23, 2013
Messages
353
Reaction score
1
Hello, how can i check if a button is pressed, i did only found out how to check if a checkbox is checked, but didnt find for button.

Thanks for helping!

I did only find that, but its only for one button.

-
0B82: dialog 1@ add_button id 3 text "Authenticate" pos_XY 115 50 size 110 25

So you created a dialog with sampfuncs opcode, but dont know howto check if button is pressed?
//IF
//0AB1: @BUTTON_CLICKED 1 ON_DIALOG 1@ control_id 3
//THEN
//**
:BUTTON_CLICKED
0B81: dialog 0@ pop_event_to 2@ control_id_to 3@
IF AND
2@ == 0x101
003B:  3@ == 1@
THEN
    0485:  return_true
ELSE
    059A:  return_false
END
0AB2: 0 
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,492
Reaction score
236
Location
( ͡° ͜ʖ ͡°)
Code:
in your loop:
0B81: dialog 31@ pop_event_to 30@ control_id_to 29@
IF
30@ == 0x101 {CLICKED}
THEN
    IF
    29@ == 3 // Button ID
    THEN
        // auth pressed
    
    END
    IF
    29@ == 4 // Button ID
    THEN
        // bla another pressed
    
    END    
    
    
END
 

Spix

Well-known member
Joined
Sep 23, 2013
Messages
353
Reaction score
1
Opcode.eXe link said:
Code:
in your loop:
0B81: dialog 31@ pop_event_to 30@ control_id_to 29@
IF
30@ == 0x101 {CLICKED}
THEN
    IF
    29@ == 3 // Button ID
    THEN
        // auth pressed
    
    END
    IF
    29@ == 4 // Button ID
    THEN
        // bla another pressed
    
    END    
    
    
END


<3 <3
 
Status
Not open for further replies.
Top