CLEO Help Done

CLEO related
Status
Not open for further replies.

HenryTeylor

Active member
Joined
Sep 13, 2014
Messages
33
Reaction score
0
Re: I want to know...

Hidend link said:
I think is simple for people know this...

I only need to create a dialog of type DIALOG_STYLE_INPUT
Then all things i write in dialog, will go to a .ini or .txt file

{$CLEO .cs}
0000: NOP

thread "LessonDialog"

if not 0@ = SAMP.Base()
then 0A93: end_custom_thread
end
while not SAMP.Available()
wait 100
end

0B34: samp register_client_command "lesson" to_label @lesson

Dialog.Create(29@,"Test Dialog")
Dialog.AddEditBox(29@, 1, "Enter Text", 0, 0 150, 40)
Dialog.AddButton(29@,2,"Record", 0, 45, 150, 30 )
0B5A: get_screen_resolution 0@ 28@
28@ /= 2
0B84: samp dialog 29@ set_pos_XY 0 28@ size 200 300
0B86: samp dialog 29@ set_visible false

while true
wait 0
if 26@ == 1
then
Dialog.PopEvent(29@,30@, 31@)
0B5D: samp toggle_cursor true
    if and
    31@ == 2
    30@ == 257
    then
    0AC8: 3@ = allocate_memory_size 260
    0B89: samp dialog 29@ get_control 1 text_to 3@
    0AF5: write_string 3@ to_ini_file "cleo\text.ini" section "Lesson" key "Text"
    0af8: "Written in the ini file" -1
    0ac9: 3@
    end
end
end


:lesson
0B12: 26@ = 26@ XOR 1
if
26@ == 1
then
0B86: samp dialog 29@ set_visible true
0B5D: samp toggle_cursor true
else
0B86: samp dialog 29@ set_visible false
0B5D: samp toggle_cursor false
end
0B43: samp cmd_ret
 

Hidend

Expert
Joined
Mar 4, 2013
Messages
627
Reaction score
40
Re: I want to know...

omfgggggggggg thaaaaaaaaaaaaanks omg omg omg [member=26707]HenryTeylor[/member] i love u

i will add close button and done, ty!!!!!!!!!!!!!!!!!!!
 

HenryTeylor

Active member
Joined
Sep 13, 2014
Messages
33
Reaction score
0
Re: I want to know...

Hidend link said:
omfgggggggggg thaaaaaaaaaaaaanks omg omg omg [member=26707]HenryTeylor[/member] i love u

i will add close button and done, ty!!!!!!!!!!!!!!!!!!!

[member=444]Hidend[/member] Close button is not necessary. To open the dialog, enter / lesson and that would close the enter / lesson

1EbdvMy.png


Code:
{$CLEO .cs}
0000: NOP

thread "LessonDialog"

if not 0@ = SAMP.Base()
then 0A93: end_custom_thread
end
while not SAMP.Available()
wait 100
end

0B34: samp register_client_command "lesson" to_label @lesson

Dialog.Create(1@,"Test Dialog")
Dialog.AddEditBox(1@, 1, "Text...", 0, 0 300, 40)
Dialog.AddButton(1@,2,"Writing", 90, 55, 120, 33)
0B5A: get_screen_resolution 2@ 3@
3@ /= 2
0B84: samp dialog 1@ set_pos_XY 0 3@ size 300 124
0B86: samp dialog 1@ set_visible false

while true
wait 0
    if 11@ == 1
    then
    0B8D: samp set_cursor_mode 2
    0B86: samp dialog 1@ set_visible true
        if
        Dialog.PopEvent(1@, 4@, 5@)
        then
            if and
            5@ == 2
            4@ == 257
            10@ = File.Open("cleo/text.txt", "at")
            then
            0AC8: 6@ = allocate_memory_size 1024
            0B89: samp dialog 1@ get_control 1 text_to 6@
            0AD9: write_formatted_text "%s%c%c" in_file 10@ 6@ 0xD 0xA
            0af8: "Written if the txt file" 0xffffff
            end
        end
    end
end
                
:lesson
0B12: 11@ = 11@ XOR 1
if
11@ == 1
then
0B86: samp dialog 1@ set_visible true
0B5D: samp toggle_cursor true
else
0B86: samp dialog 1@ set_visible false
0B5D: samp toggle_cursor false
end
0B43: samp cmd_ret
 
Status
Not open for further replies.
Top