CLEO Help dialog response

CLEO related
Status
Not open for further replies.

HowEnCokkien

Well-known member
Joined
Jul 9, 2017
Messages
307
Reaction score
9
Code:
WHILE TRUE
:RANDOM_DIALOG
wait 0
0AC6: 1@ = label @DIALOG_TEXT offset
0B3B: samp show_dialog id 2 caption "{A3E900}RANDOM_DIALOG" text 1@ button_1 "OK" button_2 "CANCEL" style 2  
SAMP.CmdRet()

:DIALOG_TEXT
HEX
"RANDOM" A
"RANDOM2 0
END

:RANDOM1
wait 0
IF
0B3C:  samp is_dialog_responded id 2 button 1@ list_item 3@ input_text 0
THEN
CALL @RANDOM_ACTION1
END

:RANDOM2
wait 0
IF
0B3C:  samp is_dialog_responded id 2 button 2@ list_item 3@ input_text 0
THEN
CALL @RANDOM_ACTION2
END
so this is a part of my script but sadly i cant get why buttons not responding to actions .  help me pls. thanks in advance.
 

0B36

Expert
Joined
Jan 6, 2014
Messages
1,324
Reaction score
8
Never put labels inside a while true loop, remove them. Also stop using High level and Low level together inside a CLEO, it will mess things up like this.
 

HowEnCokkien

Well-known member
Joined
Jul 9, 2017
Messages
307
Reaction score
9
0B36 said:
Never put labels inside a while true loop, remove them. Also stop using High level and Low level together inside a CLEO, it will mess things up like this.

i didnt use low zynatx lol also ty.
 

HowEnCokkien

Well-known member
Joined
Jul 9, 2017
Messages
307
Reaction score
9
0B36 said:
Never put labels inside a while true loop, remove them. Also stop using High level and Low level together inside a CLEO, it will mess things up like this.

dialog still dont respond action. help pls
 

0x32789

Expert
Joined
May 26, 2014
Messages
849
Reaction score
51
Location
LongForgotten <-> 0x32789
1) You have added a command label but you have put it inside while true loop and never registered the command, If it isn't command label then why have you put "SAMP.CmdRet()" ? it is the function which returns the return value of the command processed by sampfuncs.

2) RANDOM1 and RANDOM2 labels are never called from what I can see in your code, you should try putting it inside the main loop/while true loop.. your code is so messy.. and remember, don't put labels inside loop.
 

HowEnCokkien

Well-known member
Joined
Jul 9, 2017
Messages
307
Reaction score
9
0x32789 said:
1) You have added a command label but you have put it inside while true loop and never registered the command, If it isn't command label then why have you put "SAMP.CmdRet()" ? it is the function which returns the return value of the command processed by sampfuncs.

2) RANDOM1 and RANDOM2 labels are never called from what I can see in your code, you should try putting it inside the main loop/while true loop.. your code is so messy.. and remember, don't put labels inside loop.
Its just part of code lol, I didnt put whole script. Idk wtf are you talking lol?
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,133
Solutions
5
Reaction score
885
Location
Lithuania
HowEnCokkien said:
Code:
WHILE TRUE
:RANDOM_DIALOG
wait 0
0AC6: 1@ = label @DIALOG_TEXT offset
0B3B: samp show_dialog id 2 caption "{A3E900}RANDOM_DIALOG" text 1@ button_1 "OK" button_2 "CANCEL" style 2  
SAMP.CmdRet()

:DIALOG_TEXT
HEX
"RANDOM" A
"RANDOM2 0
END

:RANDOM1
wait 0
IF
0B3C:  samp is_dialog_responded id 2 button 1@ list_item 3@ input_text 0
THEN
CALL @RANDOM_ACTION1
END

:RANDOM2
wait 0
IF
0B3C:  samp is_dialog_responded id 2 button 2@ list_item 3@ input_text 0
THEN
CALL @RANDOM_ACTION2
END
so this is a part of my script but sadly i cant get why buttons not responding to actions .  help me pls. thanks in advance.

So code just always repeat , try undestand it .

PHP:
{$CLEO .cs}
0000:
 
 
REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY 
 
0B34: "dialog" @toggle
 
WHILE TRUE
    WAIT 0     
IF
23@ == TRUE
THEN  
    0AC6: 16@ = label @Dialog_1 offset  
    0B3B: samp show_dialog id 999 caption "Dialog Title 1" text 16@ button_1 "OK" button_2 "CLOSE" style 2  
    23@ = FALSE
END
 
IF 
0B3C: samp is_dialog_responded id 999 button 17@ list_item 18@ input_text 0
THEN
 
 
IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 2
    THEN 
        0AF8: "TEST 1" -1
        24@ = TRUE
    END
END
 
IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 3
    THEN 
        0AF8: "TEST 2" -1
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 4
    THEN 
        0AF8: "TEST 3" -1
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 5
    THEN 
        0AF8: "TEST 4" -1
    END
END
////////////////////////////////////////////
IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 9
    THEN 
        0AF8: "TEST 5" -1
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 10
    THEN 
        0AF8: "TEST 6" -1
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 11
    THEN 
        0AF8: "TEST 7" -1
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 12
    THEN 
        0AF8: "TEST 8" -1
    END
END
////////////////////////////////////////
IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 16
    THEN 
        0AF8: "TEST 9" -1
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 17
    THEN 
        0AF8: "TEST 10" -1
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 18
    THEN 
        0AF8: "TEST 11" -1
    END
END

IF 
17@ == 1 // OK button
THEN
    IF 
    18@ == 19
    THEN 
        0AF8: "TEST 12" -1
    END
END
 
END /// END 0B3C: samp is_dialog_responded id 1000 button 17@ list_item 18@ input_text 0

IF
24@ == TRUE
THEN  
    0AC6: 25@ = label @Dialog_2 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 WHILE TRUE
 
 
:Dialog_1
hex
"{148730}---------------------- Test Dialog Line 1 ------------------------------" 0A
" " 0A
"{FFFFFF}TEST 1" 0A
"{00FF00}TEST 2" 0A
"{FF0000}TEST 3" 0A 
"{FFFF00}TEST 4" 0A
" " 0A
"{148730}---------------------- Test Dialog Line 2 ----------------------------" 0A
" " 0A
"{FFFFFF}TEST 5" 0A
"{00FF00}TEST 6" 0A
"{FF0000}TEST 7" 0A 
"{FFFF00}TEST 8" 0A
" " 0A  
"{148730}------------------ Test Dialog Line 3 ---------------------" 0A
" " 0A
"{FFFFFF}TEST 9" 0A
"{00FF00}TEST 10" 0A
"{FF0000}TEST 11" 0A 
"{FFFF00}TEST 12" 0A
" " 00
end 

:Dialog_2
hex
"{148730}---------------------- Test Dialog 2 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: 23@ = 23@ XOR 1

0B43:
 
Status
Not open for further replies.
Top