CLEO Help Help with Dialog

CLEO related
Status
Not open for further replies.

MalikeiraOPoder

Active member
Joined
Mar 16, 2019
Messages
100
Reaction score
2
someone help with dialog...
im learning how i can use dialog etc...
and i wanna know how can i do "while true" for each dialog...
exemple: i got 2 dialog or more.. and these dialog need a "While true" how can i do ? here my code..

PHP:
{$CLEO}
{$INCLUDE SF}

0000: NOP

repeat
    wait 0
until SAMP.Available()

Dialog.Create(0@, "MultiCheats ")
Dialog.SetRECT(0@, 491, 462, 250, 250)
Dialog.AddCheckBox(0@, 1, "Equip Guns", 5, 5, 180, 25)
Dialog.AddCheckBox(0@, 2, "Wall Hack Menu", 5, 30, 180, 25)
Dialog.AddCheckBox(0@, 3, "Teleport Menu", 5, 55, 180, 25)
Dialog.AddCheckBox(0@, 4, "Player Menu", 5, 80, 180, 25)
Dialog.AddCheckBox(0@, 5, "Others", 5, 105, 180, 25)
Dialog.AddCheckBox(0@, 6, "Panic Mod", 5, 170, 180, 25)
Dialog.AddButton(0@, 7, "Exit", 115, 200, 55, 25)
Dialog.AddButton(0@, 8, "Help", 175, 5, 60, 30)
Dialog.AddButton(0@, 9, "Cmd", 175, 45, 55, 30)
Dialog.SetVisible(0@,0)

Dialog.Create(1@, "Equip Guns")
Dialog.SetRECT(1@, 490, 262, 250, 200)
Dialog.AddCheckBox(1@, 1, "coming", 5, 0, 280, 25)
Dialog.AddCheckBox(1@, 2, "coming", 5, 25, 280, 25)
Dialog.AddCheckBox(1@, 3, "coming", 5, 50, 280, 25)
Dialog.AddCheckBox(1@, 4, "coming", 5, 75, 180, 25)
Dialog.AddCheckBox(1@, 5, "coming", 5, 100, 180, 25)
Dialog.AddCheckBox(1@, 6, "coming", 5, 125, 180, 25)
Dialog.AddCheckBox(1@, 7, "coming", 5, 150, 180, 25)
Dialog.SetVisible(1@,0)

0B34: samp register_client_command ".menu" to_label @ShowDialog

WHILE TRUE
WAIT 0       

IF 
    Dialog.IsVisible(0@)
    THEN
        SAMP.ToggleCursor(1)
        IF
        Dialog.PopEvent(0@, 2@, 3@)
        THEN
            IF AND
            3@ == 7 // ID
            2@ == 257 // pressed
            THEN
                Dialog.SetVisible(0@,0)
                SAMP.ToggleCursor(0)
            END
        END
    END // END Dialog.IsVisible(0@)  
    
    IF     
    Dialog.CheckBoxIsChecked(0@,1)
    THEN
         Dialog.SetVisible(1@,1)
         else
         dialog.SetVisible(1@,0)
    END
            
     
      
END


:ShowDialog
Dialog.SetVisible(0@, 1)
0B43: samp cmd_ret

look... the dialog 0@ it has a "while true"
for dialog 1@, how can i add a "while true" to edit this dialog ?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
937
Location
Lithuania
Also added dialog moving part...

PHP:
{$CLEO .cs}

0000: NOP

REPEAT
   WAIT 0
UNTIL 0AFA:

// First dialog default postion
1@ = 1
2@ = 195

if 0AAB: file_exists "CLEO\Settings.ini"
then
   0AF0: 1@ getint "Cleo\Settings.ini" section "Dialog1Position" key "Positionxy"
   0AF0: 2@ getint "Cleo\Settings.ini" section "Dialog1Position" key "Positionz"
end
                             
Dialog.Create(0@, "{FFA500}")
Dialog.SetRECT(0@, 1@, 2@, 250, 220)
/// Dialog Background color
Dialog.SetBackgroundColor(0@, 0xFF000000)
/// Dialog check Box
Dialog.AddCheckBox(0@, 1, "{FF0000} ", 228, 2, 20, 20)
0B91: dialog 0@ add_static id 2 text "{FFA500}MultiCheats Beta" pos_XY 60 5 size {Length}300 {Width}15
0B91: dialog 0@ add_static id 3 text "{FFFFFF}-----------------------------------------------" pos_XY 7 22 size {Length}300 {Width}15
Dialog.AddCheckBox(0@, 4, "Weapons Menu", 5, 40, 220, 20)
Dialog.AddCheckBox(0@, 5, "Wall Hack Menu", 5, 60, 220, 20)
Dialog.AddCheckBox(0@, 6, "Teleport Menu", 5, 80, 220, 20)
Dialog.AddCheckBox(0@, 7, "Player Menu", 5, 100, 220, 20)
Dialog.AddCheckBox(0@, 8, "Panic Mod", 5, 120, 220, 20)
Dialog.AddCheckBox(0@, 9, "Others", 5, 140, 220, 20)
Dialog.AddButton(0@, 300, "Close", 90, 170, 70, 20)
/// Dialog minimize off
Dialog.SetMinimized(0@, 0)
/// Dialog set not visibile
Dialog.SetVisible(0@,0)

//##########################

// Second dialog default position
8@ = 253
9@ = 195

if 0AAB: file_exists "CLEO\Settings.ini"
then
   0AF0: 8@ getint "Cleo\Settings.ini" section "Dialog2Position" key "Positionxy"
   0AF0: 9@ getint "Cleo\Settings.ini" section "Dialog2Position" key "Positionz"
end

Dialog.Create(7@, "{FFA500}")
Dialog.SetRECT(7@, 8@, 9@, 250, 220)
/// Dialog Background color
Dialog.SetBackgroundColor(7@, 0xFF000000)
/// Dialog check Box
Dialog.AddCheckBox(7@, 10, "{FF0000} ", 228, 2, 20, 20)
0B91: dialog 7@ add_static id 2 text "{FFA500}Choose Weapon" pos_XY 60 5 size {Length}300 {Width}15
0B91: dialog 7@ add_static id 3 text "{FFFFFF}-----------------------------------------------" pos_XY 7 22 size {Length}300 {Width}15
Dialog.AddCheckBox(7@, 11, "Sniper | MP5 | DESERT", 5, 40, 220, 20)
Dialog.AddCheckBox(7@, 12, "M4A1 | MP5 | DESERT", 5, 60, 220, 20)
Dialog.AddCheckBox(7@, 13, "AK47 | MP5 | DESERT", 5, 80, 220, 20)
Dialog.AddCheckBox(7@, 14, "Coming Soon", 5, 100, 220, 20)
Dialog.AddCheckBox(7@, 15, "Coming Soon", 5, 120, 220, 20)
Dialog.AddCheckBox(7@, 16, "Coming Soon", 5, 140, 220, 20)
/// Dialog minimize off
Dialog.SetMinimized(7@, 0)
/// Dialog set not visibile
Dialog.SetVisible(7@,0)

0B34: ".menu" @ShowDialog

while true
   wait 0
 
if Dialog.IsVisible(0@)
then
    SAMP.ToggleCursor(1)
    if Dialog.PopEvent(0@, 2@, 3@)
    then
        if
        Dialog.CheckBoxIsChecked(0@,1)
        then
           //move dialog
           Dialog.GetRECT(0@, 3@, 4@, 5@, 6@)
           0B5E: get_cursor_pos 1@ 2@
           000C: 3@ -= 1@
           000C: 4@ -= 2@
           while 8B81: dialog 0@ pop_event_to $NOT_USED control_id_to $NOT_USED
               wait 0
               0B5E: get_cursor_pos 1@ 2@
               000A: 1@ += 3@
               000A: 2@ += 4@
               Dialog.SetRECT(0@, 1@, 2@, 5@, 6@)
           end
           //save position, will auto create file if doesn't exist
           Dialog.GetRECT(0@, 3@, 4@, 5@, 6@)
           0AF1: write_int 3@ to_ini_file "Cleo\Settings.ini" section "Dialog1Position" key "Positionxy"
           0AF1: write_int 4@ to_ini_file "Cleo\Settings.ini" section "Dialog1Position" key "Positionz"
        end
         
        if and
        3@ == 300 // ID
        2@ == 257 // Button Pressed
        then
            Dialog.SetVisible(0@,0)
            SAMP.ToggleCursor(0)
        end
      
    end
end

if and
Dialog.IsVisible(0@)
Dialog.CheckBoxIsChecked(0@,4)
then
    Dialog.SetVisible(7@,1)
else
    Dialog.SetVisible(7@,0)
end

if Dialog.IsVisible(7@)
then
    if Dialog.PopEvent(7@, 2@, 3@)
    then
        if Dialog.CheckBoxIsChecked(7@,10)
        then
           //move dialog
           Dialog.GetRECT(7@, 3@, 4@, 5@, 6@)
           0B5E: get_cursor_pos 1@ 2@
           000C: 3@ -= 1@
           000C: 4@ -= 2@
           while 8B81: dialog 7@ pop_event_to $NOT_USED control_id_to $NOT_USED
               wait 0
               0B5E: get_cursor_pos 1@ 2@
               000A: 1@ += 3@
               000A: 2@ += 4@
               Dialog.SetRECT(7@, 1@, 2@, 5@, 6@)
           end
           //save position, will auto create file if doesn't exist
           Dialog.GetRECT(7@, 3@, 4@, 5@, 6@)
           0AF1: write_int 3@ to_ini_file "Cleo\Settings.ini" section "Dialog2Position" key "Positionxy"
           0AF1: write_int 4@ to_ini_file "Cleo\Settings.ini" section "Dialog2Position" key "Positionz"
        end
    end
end

if and
Dialog.IsVisible(7@)
Dialog.CheckBoxIsChecked(7@,11)
then
    0AB1: @PACK_SNIPER 0
    wait 50
    Dialog.SetCheckBoxChecked(7@, id 11, status 0) // set not checked
end

end

:ShowDialog
Dialog.SetVisible(0@, 1)
SAMP.ToggleCursor(1)
0B43:

:PACK_SNIPER
Model.Load(#KNIFECUR)
Model.Load(#DESERT_EAGLE)
Model.Load(#SNIPER)
Model.Load(#MP5LNG)
038B: load_requested_models
048F: actor $PLAYER_ACTOR remove_weapons
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, Knife, 1)
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, DesertEagle, 120)
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, SniperRifle, 70)
Actor.GiveWeaponAndAmmo($PLAYER_ACTOR, MP5, 370)
0AB2: ret 0
 
Status
Not open for further replies.
Top