CLEO Help Auto button presed with command?

CLEO related
Status
Not open for further replies.

Skrillex

Member
Joined
Feb 12, 2017
Messages
19
Reaction score
0
Does anyone know how I can make a dialog automatically shut down with the * yes * button?

For example, on the server is the / me command that displays a dialog containing two buttons, yes and no, i want to automatically select yes when I use the command from the way / mr, can someone help me?
 

noob213

Active member
Joined
Sep 15, 2017
Messages
88
Reaction score
6
IF 
0B4C:  samp is_dialog_active -1 
THEN
           0B47: samp close_current_dialog_with_button 1

button 1 "Select" 0 to "Close"
 

Skrillex

Member
Joined
Feb 12, 2017
Messages
19
Reaction score
0
noob213 said:
IF 
0B4C:  samp is_dialog_active -1 
THEN
           0B47: samp close_current_dialog_with_button 1

button 1 "Select" 0 to "Close"

i try this but dont work:

:fr
SAMP.IsCommandTyped(20@)
0AF9: samp say_msg "/friends"
IF 
0B4C:  samp is_dialog_active -1 
THEN
0B47: samp close_current_dialog_with_button 0@
end  
SAMP.CmdRet()
 

veysileth

Active member
Joined
Mar 23, 2017
Messages
85
Reaction score
6
Can you use IF without JF and loops on cmd? D: sorry for interrupting

0B34: samp register_client_command "somethingsomething" to_label @fr

:fr
0AF9: samp say_msg "/friends"
0B47: samp close_current_dialog_with_button 1
0B43: samp cmd_ret

or

:fr
0AF9: samp say_msg "/friends"
IF
0B4C: samp is_dialog_active -1
THEN
0B47: samp close_current_dialog_with_button 1
0B43: samp cmd_ret

But i don't understand if it's even possible.

Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP  


:NONAME_1
00D6: if and
8256: not player $PLAYER_CHAR defined
8AFA: not is_samp_available 
004D: jump_if_false @NONAME_2
0001: wait 1000 ms 
0002: jump @NONAME_1

:NONAME_2
0B34: samp register_client_command "mr" to_label @mr
0BDE: pause_thread 0

:NONAME_3
0001: wait 0 ms
0002: jump @NONAME_3


:mr
0AF9: samp say_msg "/me"
0B47: samp close_current_dialog_with_button 1
0B43: samp cmd_ret
 

noob213

Active member
Joined
Sep 15, 2017
Messages
88
Reaction score
6
here you have to edit the commands to make it work
Code:
{$CLEO .cs}

0000: NOP
REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY
0B34: samp register_client_command "mr" to_label @Noname // command

WHILE TRUE
    WAIT 0
    IF AND
    056D:   actor $PLAYER_CHAR defined
    0@ == 1
    jf continue
        0AF9: samp say_msg "/me" // command to open the dialog
        REPEAT
        WAIT 0
        UNTIL 0B4C:  samp is_dialog_active -1
        0B47: samp close_current_dialog_with_button 1 // close current dialog with button 1 "select"    
        0@ = 0
    END
    

:Noname
0@ = 1
0B43: samp cmd_ret

opcode that probably you need
0B49: samp set_current_dialog_list_item 1 // Select the item identification in the dialog list.
 

Skrillex

Member
Joined
Feb 12, 2017
Messages
19
Reaction score
0
veysileth said:
Can you use IF without JF and loops on cmd? D: sorry for interrupting

0B34: samp register_client_command "somethingsomething" to_label @fr

:fr
0AF9: samp say_msg "/friends"
0B47: samp close_current_dialog_with_button 1
0B43: samp cmd_ret

or

:fr
0AF9: samp say_msg "/friends"
IF
0B4C:  samp is_dialog_active -1
THEN
0B47: samp close_current_dialog_with_button 1
0B43: samp cmd_ret

But i don't understand if it's even possible.

Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP  


:NONAME_1
00D6: if and
8256: not player $PLAYER_CHAR defined
8AFA: not is_samp_available 
004D: jump_if_false @NONAME_2
0001: wait 1000 ms 
0002: jump @NONAME_1

:NONAME_2
0B34: samp register_client_command "mr" to_label @mr
0BDE: pause_thread 0

:NONAME_3
0001: wait 0 ms
0002: jump @NONAME_3


:mr
0AF9: samp say_msg "/me"
0B47: samp close_current_dialog_with_button 1
0B43: samp cmd_ret
the dialog opens but does not close itself.


noob213 said:
here you have to edit the commands to make it work
Code:
{$CLEO .cs}

0000: NOP
REPEAT
WAIT 0
UNTIL 0AFA: SAMP_IS_READY
0B34: samp register_client_command "mr" to_label @Noname // command

WHILE TRUE
    WAIT 0
    IF AND
    056D:   actor $PLAYER_CHAR defined
    0@ == 1
    jf continue
        0AF9: samp say_msg "/me" // command to open the dialog
        REPEAT
        WAIT 0
        UNTIL 0B4C:  samp is_dialog_active -1
        0B47: samp close_current_dialog_with_button 1 // close current dialog with button 1 "select"    
        0@ = 0
    END
    

:Noname
0@ = 1
0B43: samp cmd_ret

opcode that probably you need
0B49: samp set_current_dialog_list_item 1 // Select the item identification in the dialog list.

it does not work with / mr
 

veysileth

Active member
Joined
Mar 23, 2017
Messages
85
Reaction score
6
Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP  
0006: 0@ = 0

:NONAME_1
00D6: if and
8256: not player $PLAYER_CHAR defined
8AFA: not is_samp_available 
004D: jump_if_false @NONAME_2
0001: wait 1000 ms 
0002: jump @NONAME_1

:NONAME_2
0B34: samp register_client_command "mr" to_label @mr


:NONAME_3
0001: wait 0 ms
00D6: if and
0256:  player $PLAYER_CHAR defined
0B4C:  samp is_dialog_active -1
0039:   0@ == 1
004D: jump_if_false @NONAME_3
0B47: samp close_current_dialog_with_button 1 // ?
0006: 0@ = 0
0002: jump @NONAME_3


:mr
0AF9: samp say_msg "/me"
0006: 0@ = 1
0B43: samp cmd_ret

or

Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP  
0006: 0@ = 0

:NONAME_1
00D6: if and
8256: not player $PLAYER_CHAR defined
8AFA: not is_samp_available 
004D: jump_if_false @NONAME_2
0001: wait 1000 ms 
0002: jump @NONAME_1

:NONAME_2
0B34: samp register_client_command "mr" to_label @mr


:NONAME_3
0001: wait 0 ms
00D6: if and
0256:  player $PLAYER_CHAR defined
0039:  0@ == 1
004D: jump_if_false @NONAME_3
0AF9: samp say_msg "/me"
0001: wait 100 ms // Delay. With too low value script will click button before dialog shows. I think that depends on a server and a gamemode. Some are faster etc.
0B47: samp close_current_dialog_with_button 1    
0006: 0@ = 0
0002: jump @NONAME_3


:mr
0006: 0@ = 1
0B43: samp cmd_ret

Should work.
And try with different button ids. On server i tested 1 was for first from the left button. 0 is not a visible button i think. 1-2-3 etc.
 

Skrillex

Member
Joined
Feb 12, 2017
Messages
19
Reaction score
0
veysileth said:
Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP  
0006: 0@ = 0

:NONAME_1
00D6: if and
8256: not player $PLAYER_CHAR defined
8AFA: not is_samp_available 
004D: jump_if_false @NONAME_2
0001: wait 1000 ms 
0002: jump @NONAME_1

:NONAME_2
0B34: samp register_client_command "mr" to_label @mr


:NONAME_3
0001: wait 0 ms
00D6: if and
0256:  player $PLAYER_CHAR defined
0B4C:  samp is_dialog_active -1
0039:   0@ == 1
004D: jump_if_false @NONAME_3
0B47: samp close_current_dialog_with_button 1 // ?
0006: 0@ = 0
0002: jump @NONAME_3


:mr
0AF9: samp say_msg "/me"
0006: 0@ = 1
0B43: samp cmd_ret

or

Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP  
0006: 0@ = 0

:NONAME_1
00D6: if and
8256: not player $PLAYER_CHAR defined
8AFA: not is_samp_available 
004D: jump_if_false @NONAME_2
0001: wait 1000 ms 
0002: jump @NONAME_1

:NONAME_2
0B34: samp register_client_command "mr" to_label @mr


:NONAME_3
0001: wait 0 ms
00D6: if and
0256:  player $PLAYER_CHAR defined
0039:  0@ == 1
004D: jump_if_false @NONAME_3
0AF9: samp say_msg "/me"
0001: wait 100 ms // Delay. With too low value script will click button before dialog shows. I think that depends on a server and a gamemode. Some are faster etc.
0B47: samp close_current_dialog_with_button 1    
0006: 0@ = 0
0002: jump @NONAME_3


:mr
0006: 0@ = 1
0B43: samp cmd_ret

Should work.
And try with different button ids. On server i tested 1 was for first from the left button. 0 is not a visible button i think. 1-2-3 etc.
 This work, one more question I would have, I need this mode for two commands, gen / me1 and / me2 to start with one command mode, give / mr, dialog appears, close, second appears and close and that one
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP  
0006: 0@ = 0

:NONAME_1
00D6: if and
8256: not player $PLAYER_CHAR defined
8AFA: not is_samp_available 
004D: jump_if_false @NONAME_2
0001: wait 1000 ms 
0002: jump @NONAME_1

:NONAME_2
0B34: samp register_client_command "mr" to_label @mr


:NONAME_3
0001: wait 0 ms
00D6: if and
0256:  player $PLAYER_CHAR defined
0039:  0@ == 1
004D: jump_if_false @NONAME_3
0AF9: samp say_msg "/me"
0001: wait 100 ms // Delay. With too low script will click button before dialog shows. I think that depends on a server and a gamemode. Some are faster etc.
0B47: samp close_current_dialog_with_button 1    
0006: 0@ = 0
0002: jump @NONAME_3


:mr
0006: 0@ = 1
0B43: samp cmd_ret
 

veysileth

Active member
Joined
Mar 23, 2017
Messages
85
Reaction score
6
You mean one command and series of dialog?

/mr
-> Script opened dialog /me
-> Script closed dialog with *yes*
-> Script opened dialog /me1
-> Script closed dialog with *one of the buttons*
-> Script opened dialog /me2
-> Script closed dialog with *one of the buttons*

?
 

Skrillex

Member
Joined
Feb 12, 2017
Messages
19
Reaction score
0
veysileth said:
You mean one command and series of dialog?

/mr
-> Script opened dialog /me
-> Script closed dialog with *yes*
-> Script opened dialog /me1
-> Script closed dialog with *one of the buttons*
-> Script opened dialog /me2
-> Script closed dialog with *one of the buttons*

?

Yes, but only two commands
/mr
-> Script opened dialog /me
-> Script closed dialog with *yes*
-> Script opened dialog /me1
-> Script closed dialog with *one of the buttons*
 

veysileth

Active member
Joined
Mar 23, 2017
Messages
85
Reaction score
6
Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP  
0006: 0@ = 0

:NONAME_1
00D6: if and
8256: not player $PLAYER_CHAR defined
8AFA: not is_samp_available 
004D: jump_if_false @NONAME_2
0001: wait 1000 ms 
0002: jump @NONAME_1

:NONAME_2
0B34: samp register_client_command "mr" to_label @mr


:NONAME_3
0001: wait 0 ms
00D6: if and
0256:  player $PLAYER_CHAR defined
0039:  0@ == 1
004D: jump_if_false @NONAME_3
0AF9: samp say_msg "/me"
0001: wait 100 ms // Delay. With too low value script will click button before dialog shows. I think that depends on a server and a gamemode. Some are faster etc.
0B47: samp close_current_dialog_with_button 1
0001: wait 100 ms // I can't feel this without testing it on your server. But should work.
0AF9: samp say_msg "/me1"
0001: wait 100 ms // Delay. With too low value script will click button before dialog shows. I think that depends on a server and a gamemode. Some are faster etc. 
0B47: samp close_current_dialog_with_button 1        
0006: 0@ = 0
0002: jump @NONAME_3


:mr
0006: 0@ = 1
0B43: samp cmd_ret
 

Skrillex

Member
Joined
Feb 12, 2017
Messages
19
Reaction score
0
veysileth said:
Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP  
0006: 0@ = 0

:NONAME_1
00D6: if and
8256: not player $PLAYER_CHAR defined
8AFA: not is_samp_available 
004D: jump_if_false @NONAME_2
0001: wait 1000 ms 
0002: jump @NONAME_1

:NONAME_2
0B34: samp register_client_command "mr" to_label @mr


:NONAME_3
0001: wait 0 ms
00D6: if and
0256:  player $PLAYER_CHAR defined
0039:  0@ == 1
004D: jump_if_false @NONAME_3
0AF9: samp say_msg "/me"
0001: wait 100 ms // Delay. With too low value script will click button before dialog shows. I think that depends on a server and a gamemode. Some are faster etc.
0B47: samp close_current_dialog_with_button 1
0001: wait 100 ms // I can't feel this without testing it on your server. But should work.
0AF9: samp say_msg "/me1"
0001: wait 100 ms // Delay. With too low value script will click button before dialog shows. I think that depends on a server and a gamemode. Some are faster etc. 
0B47: samp close_current_dialog_with_button 1        
0006: 0@ = 0
0002: jump @NONAME_3


:mr
0006: 0@ = 1
0B43: samp cmd_ret
Thanks a lot, can you give me a pm to talk some details please?


veysileth said:
Code:
{$CLEO .cs}

//-------------MAIN---------------
0000: NOP  
0006: 0@ = 0

:NONAME_1
00D6: if and
8256: not player $PLAYER_CHAR defined
8AFA: not is_samp_available 
004D: jump_if_false @NONAME_2
0001: wait 1000 ms 
0002: jump @NONAME_1

:NONAME_2
0B34: samp register_client_command "mr" to_label @mr


:NONAME_3
0001: wait 0 ms
00D6: if and
0256:  player $PLAYER_CHAR defined
0039:  0@ == 1
004D: jump_if_false @NONAME_3
0AF9: samp say_msg "/me"
0001: wait 100 ms // Delay. With too low value script will click button before dialog shows. I think that depends on a server and a gamemode. Some are faster etc.
0B47: samp close_current_dialog_with_button 1
0001: wait 100 ms // I can't feel this without testing it on your server. But should work.
0AF9: samp say_msg "/me1"
0001: wait 100 ms // Delay. With too low value script will click button before dialog shows. I think that depends on a server and a gamemode. Some are faster etc. 
0B47: samp close_current_dialog_with_button 1        
0006: 0@ = 0
0002: jump @NONAME_3


:mr
0006: 0@ = 1
0B43: samp cmd_ret
Please correct the following errors before continuing:
  • veysileth has private messaging disabled. You cannot send private messages to this user. 
    :)) i cant send you pm
 
Status
Not open for further replies.
Top