CLEO Help Close dialog automatic

CLEO related
Status
Not open for further replies.

pai1ne13

Active member
Joined
Jan 2, 2019
Messages
59
Reaction score
4
hi, i want this mode to close an automatic dialog when i open it with a command. For example: on the server the command "/ x" shows a dialog with 2 buttons, "NEXT" and "CLOSE", this mode must automatically press "CLOSE". HOW CAN I FIX IT?
Code:
 {$CLEO .cs}
0000:
repeat
wait 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
WAIT 0
if
0af9:  "/x"

then  
    if
    0@ == true
    then
        0@ = false
        wait 1000            
        08ED: remove_actor 1@ from_dialogue_mode

    end
ELSE
    0@ = TRUE
end
end
 

pai1ne13

Active member
Joined
Jan 2, 2019
Messages
59
Reaction score
4
@Zin like that ?
Code:
if
0af9:  "/x" 
 
 then   
    if
    0@ == true
    then
        0@ = false
        wait 1000             
        0B47: samp close_current_dialog_with_button "close"

 
    end
ELSE
    0@ = TRUE 
end
end
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,697
Reaction score
105
Yeah forgot to mention it's the button ID e.g. "0, 1 ,2" it's a dialog with 2 buttons so it will either be 1 or 2 depending on whether the ID starts at 0 or 1.
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,697
Reaction score
105
Yeah, if it doesn't work just change the ID as like I said I don't know the IDs of that dialog in particular.
 

_Safa

Well-known member
Joined
Sep 22, 2019
Messages
294
Reaction score
99
Location
UGBASE
Maybe because you are closing the login-dialog which causes to disconnect lol.

Make that feature on key so you can close the current dialog when you want and not all the time.
 

KamikazeSripterul

Well-known member
Joined
Jun 30, 2019
Messages
353
Reaction score
23
Maybe because you are closing the login-dialog which causes to disconnect lol.

Make that feature on key so you can close the current dialog when you want and not all the time.
Or get the title and text of the dialog and based onthat close the dialog which u need.
 

Zin

Expert
Joined
Aug 1, 2013
Messages
1,697
Reaction score
105
Actually no the problem was the activation so it was basically just spamming commands. Usually spamming "server-send" features will do this (even got banned on cheating allowed by accident for it) so check this out.
C++:
{$CLEO .cs}

0000:

0B34: samp register_client_command "/X" to_label @X // Doing /X will make the code run at label :X

REPEAT
    WAIT 0
UNTIL 0AFA:  SAMP_IS_READY

WHILE TRUE
    WAIT 0
    IF
        0@ == TRUE // Checks if script is TOGGLED from label X
    THEN
        0@ = FALSE // Toggles off to stops this from repeating endlessly and spamming.
        WAIT 1000           
        0B47: samp close_current_dialog_with_button 2 // Supposedly presses button "2" of the current dialog.
    END
END

:X
0AF9: samp say_msg "/X" // Sends actual command to server.
0@ = TRUE // Will toggle the script on in the main loop.
SAMP.CmdRet() // End of this label.
 
Status
Not open for further replies.
Top