CLEO Help How to fix duplicate textdraw

CLEO related

Angel9

Active member
Joined
May 6, 2021
Messages
65
Reaction score
2
Location
Belgrade, Serbia
Code:
{$CLEO .cs}



0000: NOP



wait 8500





while true

wait 0



if 0256:   player $PLAYER_CHAR defined

then

    0AB1: @Get_Local_Player_Name 0 _Returned: Name 0@

    0AC8: 1@ = allocate_memory_size 1024

    0AD3: 1@ = format "Big_Boy" // NICK TO COMPARE

    if 0AB1: @cmpString1andString2 2 String1 0@ String2 1@

    then

        if 0ADC:   test_cheat "ON" // if press keys O AND N

        then

            31@ = true // send enable bot

            0AD1: show_formatted_text_highpriority "~W~Bot: ~G~ON...." time 2000

        end

    else

        if 0ADC:   test_cheat "ON" // if press keys O AND N

        then

            0AD1: show_formatted_text_highpriority "~W~Bot: ~R~Nice try.. ~N~ ~B~Wrong nickname ~R~ access denied" time 2000

        end

    end

end



if 31@ == true

then // 1

    if

    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1303.3429 1272.8828 radius 1.0 1.0 on_foot // start position

    then // 2

        repeat

        wait 0

        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255

        0AB1: @CAMERA_AT_POS 3 XYZ: 1308.2167 1291.9474 10.8203

        until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot    /// repeat until reach position

        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0

        if

        00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot // if reached position

        then // 3

            repeat

            wait 0

            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255

            0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203

            until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position

            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0

            if

            00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position

            then // 4

                repeat

                wait 0

                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255

                0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203

                until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position

                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0

                if

                00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position

                then // 5

                    repeat

                    wait 0

                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255

                    0AB1: @CAMERA_AT_POS 3 XYZ: 1295.8840 1288.2472 10.8203

                    until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot    /// repeat until reach position

                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0

                    if

                    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot // if reached position

                    then // 6 , so we have 6 - then , that means  we need 6 end

                        19@ += 1 // counter

                        045A: text_draw_1number 80.0 280.0 'NUMBER' 19@
                        0C48: samp textdraw 155 create "Count:" pos 30.0 280.0
                      0AD1: show_formatted_text_highpriority "~W~You reached last position ~N~ ~R~Current running time: %d" time 2000 1@

                    end

                end

            end

        end

    end

end



if 1@ >= 10 // if runned 10 or more times then disable code

then

    31@ = false // send disable bot

    1@ = 0 // reset counter

end

   

end // also while true always must have - end



:Set_Virtual_Key

{

    255 = true

    0 = false

    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255

}

2@ = 0xB72CC8

0@ *= 2

005A: 2@ += 0@  // (int)

0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0

0AB2: ret 0



//0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@

:CAMERA_AT_POS

0087: 8@ = 3@

068D: get_camera_position_to 3@ 4@ 5@

0063: 0@ -= 3@

0063: 1@ -= 4@

0604: get_Z_angle_for_point 0@ 1@ store_to 6@

6@ -= 90.0

0017: 6@ /= 57.2957795  

005B: 6@ += 8@  // (float)                  

0A8D: 7@ = read_memory 0xB6F248 size 4 virtual_protect 0

0A25: set_camera_on_players_X_angle 7@ Z_angle 6@

0661: "by Opcode.eXe | UGBASE.EU"

0AB2: 0



:Get_Local_Player_Name

/// 0AB1: @Get_Local_Player_Name 0 _Returned: Name 1@

0AB1: @get_samp_version_id 0 _returned: ID 0@

IF 0AA2: 1@ = "samp.dll"

THEN

    IF 0@ == 1 // 0.3.7 R1

    THEN

        0A8E: 2@ = 1@ + 0x219A6F

    END



    IF 0@ == 2 // 0.3.7 R2

    THEN

        0A8E: 2@ = 1@ + 0x219A77

    END



    IF 0@ == 3 // 0.3.DL

    THEN

        0A8E: 2@ = 1@ + 0x2AC187

    END



    IF 0@ == 4 // 0.3.7 R3

    THEN

        0A8E: 2@ = 1@ + 0x26E03F

    END



    IF 0@ == 5 // 0.3.7 R4

    THEN

        0A8E: 2@ = 1@ + 0x26E16F

    END

END

0AB2: ret 1 2@



:get_samp_version_id

// 0AB1: @get_samp_version_id 0 _returned: ID 16@

30@ = 0

IF 0AA2: 31@ = load_library "samp.dll" // IF and SET

THEN

    31@ += 0x128

    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5542F47A

    THEN // 0.3.7 R1

        30@ = 1

    END



    IF 29@ == 0x59C30C94

    THEN // 0.3.7 R2

        30@ = 2

    END



    IF 29@ == 0x5A6A3130

    THEN // 0.3.DL

        30@ = 3

    END



    31@ -= 8 // reading samp.dll + 0x120

    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1



    IF 29@ == 0x5C0B4243

    THEN // 0.3.7 R3

        30@ = 4

    END



    IF 29@ == 0x5DD606CD

    THEN // 0.3.7 R4

        30@ = 5

    END

END

0AB2: ret 1 30@



:lowercase

0AA5: call 0x718740 num_params 1 pop 1 0@

0AB2: 0



:cmpString1andString2

{

    Example: 0AB1: @cmpString1andString2 2 String1 1@ String2 2@

    In: 0@, 1@ - strings

    Out: result 0/1

}

for 7@ = 0 to 1024

    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0

    0A8D: 3@ = read_memory 1@ size 1 virtual_protect 0

    0@ += 1

    1@ += 1

    if 003B: 2@ == 3@

    jf break

    if and

    2@ == 0

    3@ == 0

    then

        0485: return_true

        ret 0

    end

end

059A: return_false

ret 0

Problem text_draw_1number duplicate on each repetition

Code:
 if

                    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot // if reached position

                    then // 6 , so we have 6 - then , that means  we need 6 end

                        19@ += 1 // counter

                        045A: text_draw_1number 80.0 280.0 'NUMBER' 19@
                        0C48: samp textdraw 155 create "Count:" pos 30.0 280.0
                      0AD1: show_formatted_text_highpriority "~W~You reached last position ~N~ ~R~Current running time: %d" time 2000 1@

                    end
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,142
Solutions
5
Reaction score
887
Location
Lithuania
Code:
{$CLEO .cs}



0000: NOP



wait 8500





while true

wait 0



if 0256:   player $PLAYER_CHAR defined

then

    0AB1: @Get_Local_Player_Name 0 _Returned: Name 0@

    0AC8: 1@ = allocate_memory_size 1024

    0AD3: 1@ = format "Big_Boy" // NICK TO COMPARE

    if 0AB1: @cmpString1andString2 2 String1 0@ String2 1@

    then

        if 0ADC:   test_cheat "ON" // if press keys O AND N

        then

            31@ = true // send enable bot

            0AD1: show_formatted_text_highpriority "~W~Bot: ~G~ON...." time 2000

        end

    else

        if 0ADC:   test_cheat "ON" // if press keys O AND N

        then

            0AD1: show_formatted_text_highpriority "~W~Bot: ~R~Nice try.. ~N~ ~B~Wrong nickname ~R~ access denied" time 2000

        end

    end

end



if 31@ == true

then // 1

    if

    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1303.3429 1272.8828 radius 1.0 1.0 on_foot // start position

    then // 2

        repeat

        wait 0

        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255

        0AB1: @CAMERA_AT_POS 3 XYZ: 1308.2167 1291.9474 10.8203

        until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot    /// repeat until reach position

        0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0

        if

        00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1308.2167 1291.9474 radius 1.0 1.0 on_foot // if reached position

        then // 3

            repeat

            wait 0

            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255

            0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203

            until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position

            0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0

            if

            00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position

            then // 4

                repeat

                wait 0

                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255

                0AB1: @CAMERA_AT_POS 3 XYZ: 1299.5552 1307.0544 10.8203

                until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot    /// repeat until reach position

                0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0

                if

                00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1299.5552 1307.0544 radius 1.0 1.0 on_foot // if reached position

                then // 5

                    repeat

                    wait 0

                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255

                    0AB1: @CAMERA_AT_POS 3 XYZ: 1295.8840 1288.2472 10.8203

                    until 00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot    /// repeat until reach position

                    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 0

                    if

                    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot // if reached position

                    then // 6 , so we have 6 - then , that means  we need 6 end

                        19@ += 1 // counter

                        045A: text_draw_1number 80.0 280.0 'NUMBER' 19@
                        0C48: samp textdraw 155 create "Count:" pos 30.0 280.0
                      0AD1: show_formatted_text_highpriority "~W~You reached last position ~N~ ~R~Current running time: %d" time 2000 1@

                    end

                end

            end

        end

    end

end



if 1@ >= 10 // if runned 10 or more times then disable code

then

    31@ = false // send disable bot

    1@ = 0 // reset counter

end

  

end // also while true always must have - end



:Set_Virtual_Key

{

    255 = true

    0 = false

    0AB1: @Set_Virtual_Key 2 KeyOffSet 0x57 state 255

}

2@ = 0xB72CC8

0@ *= 2

005A: 2@ += 0@  // (int)

0A8C: write_memory 2@ size 1 value 1@ virtual_protect 0

0AB2: ret 0



//0AB1: @AIM_AT_POS 3 XYZ: 1@ 2@ 3@

:CAMERA_AT_POS

0087: 8@ = 3@

068D: get_camera_position_to 3@ 4@ 5@

0063: 0@ -= 3@

0063: 1@ -= 4@

0604: get_Z_angle_for_point 0@ 1@ store_to 6@

6@ -= 90.0

0017: 6@ /= 57.2957795 

005B: 6@ += 8@  // (float)                 

0A8D: 7@ = read_memory 0xB6F248 size 4 virtual_protect 0

0A25: set_camera_on_players_X_angle 7@ Z_angle 6@

0661: "by Opcode.eXe | UGBASE.EU"

0AB2: 0



:Get_Local_Player_Name

/// 0AB1: @Get_Local_Player_Name 0 _Returned: Name 1@

0AB1: @get_samp_version_id 0 _returned: ID 0@

IF 0AA2: 1@ = "samp.dll"

THEN

    IF 0@ == 1 // 0.3.7 R1

    THEN

        0A8E: 2@ = 1@ + 0x219A6F

    END



    IF 0@ == 2 // 0.3.7 R2

    THEN

        0A8E: 2@ = 1@ + 0x219A77

    END



    IF 0@ == 3 // 0.3.DL

    THEN

        0A8E: 2@ = 1@ + 0x2AC187

    END



    IF 0@ == 4 // 0.3.7 R3

    THEN

        0A8E: 2@ = 1@ + 0x26E03F

    END



    IF 0@ == 5 // 0.3.7 R4

    THEN

        0A8E: 2@ = 1@ + 0x26E16F

    END

END

0AB2: ret 1 2@



:get_samp_version_id

// 0AB1: @get_samp_version_id 0 _returned: ID 16@

30@ = 0

IF 0AA2: 31@ = load_library "samp.dll" // IF and SET

THEN

    31@ += 0x128

    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1

    IF 29@ == 0x5542F47A

    THEN // 0.3.7 R1

        30@ = 1

    END



    IF 29@ == 0x59C30C94

    THEN // 0.3.7 R2

        30@ = 2

    END



    IF 29@ == 0x5A6A3130

    THEN // 0.3.DL

        30@ = 3

    END



    31@ -= 8 // reading samp.dll + 0x120

    0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1



    IF 29@ == 0x5C0B4243

    THEN // 0.3.7 R3

        30@ = 4

    END



    IF 29@ == 0x5DD606CD

    THEN // 0.3.7 R4

        30@ = 5

    END

END

0AB2: ret 1 30@



:lowercase

0AA5: call 0x718740 num_params 1 pop 1 0@

0AB2: 0



:cmpString1andString2

{

    Example: 0AB1: @cmpString1andString2 2 String1 1@ String2 2@

    In: 0@, 1@ - strings

    Out: result 0/1

}

for 7@ = 0 to 1024

    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0

    0A8D: 3@ = read_memory 1@ size 1 virtual_protect 0

    0@ += 1

    1@ += 1

    if 003B: 2@ == 3@

    jf break

    if and

    2@ == 0

    3@ == 0

    then

        0485: return_true

        ret 0

    end

end

059A: return_false

ret 0

Problem text_draw_1number duplicate on each repetition

Code:
 if

                    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot // if reached position

                    then // 6 , so we have 6 - then , that means  we need 6 end

                        19@ += 1 // counter

                        045A: text_draw_1number 80.0 280.0 'NUMBER' 19@
                        0C48: samp textdraw 155 create "Count:" pos 30.0 280.0
                      0AD1: show_formatted_text_highpriority "~W~You reached last position ~N~ ~R~Current running time: %d" time 2000 1@

                    end
Because you made it in small loop, so every time he makes new one..
 

Angel9

Active member
Joined
May 6, 2021
Messages
65
Reaction score
2
Location
Belgrade, Serbia
not work

Code:
if



                    00ED:   actor $PLAYER_ACTOR sphere 0 near_point 1295.8840 1288.2472 radius 1.0 1.0 on_foot // if reached position



                    then // 6 , so we have 6 - then , that means  we need 6 end

        0AD1: show_formatted_text_highpriority "~W~You reached last position ~N~ ~R~Current running time: %d" time 2000 1@



                    end

 19@ += 1 // counter



                        045A: text_draw_1number 80.0 280.0 'NUMBER' 19@

                        0C48: samp textdraw 155 create "Count:" pos 30.0 280.0
 
Top