CLEO Help [HELP] Script doesn't work!

CLEO related
Status
Not open for further replies.

GoodMan

Active member
Joined
Jun 4, 2014
Messages
141
Reaction score
0
Hello, i would like to have your help here, i'm quite advanced scripter but i can't find the mistake here. My opinion is that 0B4C: crashes the whole script. If i change 0B4C: for any other condition it's ok, the script works, but only for 0B4C: crashes.
What i wanna do is to type /sayhi and then i select a dialog from scoreboard and when it opens, it should enter ''sup bro'' as message in that dialog, then closes the dialog with left buttom.

Code:
{$CLEO .cs}

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

REPEAT
    WAIT 5000
UNTIL 0AFA:
0AF8: "Intructor.cs leaded! use /comand for help" 0xFF0080 {chatmsg}

0B34: "instructor" @ONOFF
0B34: "wave" @WAVE
0B34: "comand" @COMAND

WHILE TRUE
WAIT 0
END

:COMAND { THIS ONE WORKS PROPERLY, I HAVE NO PROBLEM WITH THIS LABEL}
WAIT 0
0AF8: "{FF0000}/comand: {FF0080}see list of commands." -1
Samp.CmdRet()

:WAVE { THIS IS THE LABEL WHERE I CRASH WHEN I TYPE THE COMMAND IN CHAT..}
WAIT 0
IF 12@ == 1
THEN
0AF8: "*It's ON" -1
REPEAT
WAIT 0
PRINTF "WAITING FOR THE DIALOG TO BE OPENED." 1000

UNTIL 0B4C:  samp is_dialog_active 14
////////////////////////////////////CLEO CRASHES WHEN ARRIVES TO: UNTIL 0B4C:  samp is_dialog_active 14 ///////////////////////////////////////////////////////

0B4B: samp set_current_dialog_editbox_text "sup bro" {text message inside dialog}
0B47: samp close_current_dialog_with_button 1 {send buttom}
END
Samp.CmdRet()

:ONOFF
0B12: 12@ = 12@ XOR 1
IF 12@ == 1
THEN
PRINTF "CLEONAME ~G~[ON]" 500
END
IF 12@ == 0
THEN
PRINTF "CLEONAME ~R~[OFF]" 500
END
Samp.CmdRet()

i tried to change the code to this, however still crash.
Code:
:WAVE
WAIT 0
IF
0B4C:  samp is_dialog_active 14 {I TRIED: -1 AND 1@ AND STILL CRASH}
JF @WAVE
PRINTF "ENTER YOUR TEXT MESSAGE NOW" 1000
0B4B: samp set_current_dialog_editbox_text "sup bro" {text message inside dialog}
0B47: samp close_current_dialog_with_button 1 {send buttom}
Samp.CmdRet()

I personaly don't wish to place the code inside ''WHILE TRUE'' loop because i want to add more commands like keybinds, and diferent stuff...

What might be the problem....
 

Krc

Active member
Joined
Mar 30, 2018
Messages
193
Reaction score
25
Location
Lithuania
Code:
{$CLEO .cs}
0000: NOP
REPEAT
wait 0
Until 0AFA: is_samp_structures_available
0B34: "dialog" @Dialog
0@ = FALSE
1@ = 205

While True
Wait 0
If
0@ == TRUE
Then
If
0B4C: samp is_dialog_active 14
Then
wait 1@
0B4B: samp set_current_dialog_editbox_text "sup bro"
wait 1@
0B47: samp close_current_dialog_with_button 1
end
end
END

:Dialog
0B12: 0@ = 0@ XOR TRUE
If
0@ == TRUE
Then
0ACD: show_text_highpriority "~W~Dialog: ~G~ON~W~" time 1000
else
0ACD: show_text_highpriority "~W~Dialog: ~R~OFF~W~" time 1000
end
CmdRet
 
Status
Not open for further replies.
Top