Вопросы по CLEO-скриптингу

TheMonstercat

Известный
75
11
Hey how i can fix this bug... how i can fix that the car HP come up random in the screen.
Код:
{$CLEO .cs}
0000:
0662: NOP "#########################"
0662: NOP "___Made by Opcode.eXe___"
0662: NOP "Www.Youtube.Com/OpcodeXe"
0662: NOP "#########################"
0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'CRED445' 0@ //// Get gxt text address by gxt name
0AA5: call 0x718600 2 pop 2 0@ "Health: ~1~%"
 
 
1@ = 0
while true
wait 0
    if
    0ADC:  test_cheat "CARDL"
    then
        if
        1@ == 0
        then
            0ACD: show_text_highpriority "Car-HP On." time 1337
            018C: play_sound 1083 at 0.0 0.0 0.0
            1@ = 1
        else
            0ACD: show_text_highpriority "Car-HP Off." time 1337
            018C: play_sound 1084 at 0.0 0.0 0.0
            1@ = 0
            0A92: create_custom_thread "Car-HP Indicator.cs"
            End_Thread
        end
    end
    if
    1@ == 1
    then
        0A8D: 29@ = read_memory 0xB74494 size 4 virtual_protect 0
        29@ += 0x4
        0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
        for 30@ = 0 to 27904 step 0x100
            0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
            000A: 29@ += 0x1
            if and
                0029: 31@ >= 0x00
                001B: 0x80 > 31@
            then
                005A: 31@ += 30@
                0227: 5@ = car 31@ health
                5@ /= 10
                if
                80DF: not  actor $PLAYER_ACTOR driving
                then
                    0407: store_coords_to 2@ 3@ 4@ from_car 31@ with_offset 0.0 0.0 0.0
                    04C4: store_coords_to 22@ 23@ 24@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
                    050A: 20@ = distance_between_XYZ 2@ 3@ 4@ and_XYZ 22@ 23@ 24@
                    0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 2@ Y 3@ Z 4@ store_screen_X_to 6@ Y_to 7@
                    if
                        20@ < 20.0
                    then
                        03F0: enable_text_draw 1
                        0342: set_text_draw_centered 1
                        03E0: draw_text_behind_textures 0
                        033F: set_text_draw_letter_size width 0.17 height 0.77
                        081C: draw_text_outline 1 RGBA 0 0 0 255
                        0340: set_text_draw_RGBA 0 255 0 255
                        045A: draw_text_1number 6@ 7@ GXT 'CRED445' number 5@  //
                    end
                end                   
            end
        end
    end
end
 
 
:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@

samp06190wz7rhnve.png
 

SR_team

like pancake
BH Team
4,729
6,389
Hey how i can fix this bug... how i can fix that the car HP come up random in the screen.
Код:
{$CLEO .cs}
0000:
0662: NOP "#########################"
0662: NOP "___Made by Opcode.eXe___"
0662: NOP "Www.Youtube.Com/OpcodeXe"
0662: NOP "#########################"
0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'CRED445' 0@ //// Get gxt text address by gxt name
0AA5: call 0x718600 2 pop 2 0@ "Health: ~1~%"
 
 
1@ = 0
while true
wait 0
    if
    0ADC:  test_cheat "CARDL"
    then
        if
        1@ == 0
        then
            0ACD: show_text_highpriority "Car-HP On." time 1337
            018C: play_sound 1083 at 0.0 0.0 0.0
            1@ = 1
        else
            0ACD: show_text_highpriority "Car-HP Off." time 1337
            018C: play_sound 1084 at 0.0 0.0 0.0
            1@ = 0
            0A92: create_custom_thread "Car-HP Indicator.cs"
            End_Thread
        end
    end
    if
    1@ == 1
    then
        0A8D: 29@ = read_memory 0xB74494 size 4 virtual_protect 0
        29@ += 0x4
        0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
        for 30@ = 0 to 27904 step 0x100
            0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
            000A: 29@ += 0x1
            if and
                0029: 31@ >= 0x00
                001B: 0x80 > 31@
            then
                005A: 31@ += 30@
                0227: 5@ = car 31@ health
                5@ /= 10
                if
                80DF: not  actor $PLAYER_ACTOR driving
                then
                    0407: store_coords_to 2@ 3@ 4@ from_car 31@ with_offset 0.0 0.0 0.0
                    04C4: store_coords_to 22@ 23@ 24@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
                    050A: 20@ = distance_between_XYZ 2@ 3@ 4@ and_XYZ 22@ 23@ 24@
                    0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 2@ Y 3@ Z 4@ store_screen_X_to 6@ Y_to 7@
                    if
                        20@ < 20.0
                    then
                        03F0: enable_text_draw 1
                        0342: set_text_draw_centered 1
                        03E0: draw_text_behind_textures 0
                        033F: set_text_draw_letter_size width 0.17 height 0.77
                        081C: draw_text_outline 1 RGBA 0 0 0 255
                        0340: set_text_draw_RGBA 0 255 0 255
                        045A: draw_text_1number 6@ 7@ GXT 'CRED445' number 5@  //
                    end
                end                 
            end
        end
    end
end
 
 
:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@

samp06190wz7rhnve.png

0B44: samp 0@ = create_3d_text "dafuq" color 0xFFFF00FF position 1@ 2@ 3@ view_distance 50.0 show_behind_walls true attached_to_player -1 attached_to_vehicle -1
 

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,463
Hey how i can fix this bug... how i can fix that the car HP come up random in the screen.

Two versions:
Код:
{$CLEO}
 
wait 0
 
0662: NOP "#########################"
0662: NOP "___Made by Opcode.eXe___"
0662: NOP "Www.Youtube.Com/OpcodeXe"
0662: NOP "#########################"
0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'CRED445' 0@ //// Get gxt text address by gxt name
0AA5: call 0x718600 2 pop 2 0@ "Health: ~1~%"
 
1@ = 0
 
while true
    wait 0
    if 0ADC:  test_cheat "CARDL"
    then
        if 1@ == 0
        then
            0ACD: show_text_highpriority "Car-HP On." time 1337
            018C: play_sound 1083 at 0.0 0.0 0.0
            1@ = 1
        else
            0ACD: show_text_highpriority "Car-HP Off." time 1337
            018C: play_sound 1084 at 0.0 0.0 0.0
            1@ = 0
 
            // WTF!? Hmm...
            0A92: create_custom_thread "Car-HP Indicator.cs"
            0A93: end_custom_thread
        end
    end
 
    if 1@ == 1
    then
        00A0: store_actor $PLAYER_ACTOR position_to 22@ 23@ 24@
        if 0AE2: 31@ = random_vehicle_near_point 22@ 23@ 24@ in_radius 19.99 find_next false pass_wrecked 0 // Thx MISTER_GONWIK <3
        then
            gosub @draw_text
            while 0AE2: 31@ = random_vehicle_near_point 22@ 23@ 24@ in_radius 19.99 find_next true pass_wrecked 0
                gosub @draw_text
            end
        end
    end
end
 
:draw_text
// Car - 31@
if 80DB:  not actor $PLAYER_ACTOR in_car 31@
then
    00AA: store_car 31@ position_to 2@ 3@ 4@
 
    0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 2@ Y 3@ Z 4@ store_screen_X_to 6@ Y_to 7@
    if and
        00C2: sphere_onscreen 2@ 3@ 4@ radius 0.0
        6@ >= 0.0
        6@ <= 640.0
        7@ >= 0.0
        7@ <= 448.0
    then
        0227: 5@ = car 31@ health
        5@ /= 10
 
        03F0: enable_text_draw 1
        0342: set_text_draw_centered 1
        03E0: draw_text_behind_textures 0
        033F: set_text_draw_letter_size width 0.17 height 0.77
        081C: draw_text_outline 1 RGBA 0 0 0 255
        0340: set_text_draw_RGBA 0 255 0 255
        045A: draw_text_1number 6@ 7@ GXT 'CRED445' number 5@  //
    end
end
return
 
:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@
Код:
{$CLEO}
 
0000:
 
0662: NOP "#########################"
0662: NOP "___Made by Opcode.eXe___"
0662: NOP "Www.Youtube.Com/OpcodeXe"
0662: NOP "#########################"
0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'CRED445' 0@ //// Get gxt text address by gxt name
0AA5: call 0x718600 2 pop 2 0@ "Health: ~1~%"
 
 
1@ = 0
 
while true
    wait 0
    if 0ADC:  test_cheat "CARDL"
    then
        if 1@ == 0
        then
            0ACD: show_text_highpriority "Car-HP On." time 1337
            018C: play_sound 1083 at 0.0 0.0 0.0
            1@ = 1
        else
            0ACD: show_text_highpriority "Car-HP Off." time 1337
            018C: play_sound 1084 at 0.0 0.0 0.0
            1@ = 0
 
            // WTF!? Hmm...
            0A92: create_custom_thread "Car-HP Indicator.cs"
            0A93: end_custom_thread
        end
    end
 
    if 1@ == 1
    then
        0A8D: 29@ = read_memory 0xB74494 size 4 virtual_protect 0
        29@ += 0x4
        0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
        for 30@ = 0 to 27904 step 0x100
            0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
            000A: 29@ += 0x1
            if and
                0029: 31@ >= 0x00
                001B: 0x80 > 31@
            then
                005A: 31@ += 30@
 
                0227: 5@ = car 31@ health
                5@ /= 10
                if 80DF: not actor $PLAYER_ACTOR driving
                then
                    0407: store_coords_to 2@ 3@ 4@ from_car 31@ with_offset 0.0 0.0 0.0
           
                    0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X 2@ Y 3@ Z 4@ store_screen_X_to 6@ Y_to 7@
                    if and
                        00C2: sphere_onscreen 2@ 3@ 4@ radius 0.0
                        6@ >= 0.0 // Min Size screen X
                        6@ <= 640.0 // Max Size screen X
                        7@ >= 0.0 // Min Size screen Y
                        7@ <= 448.0 // Max Size screen Y
                    then
                        04C4: store_coords_to 22@ 23@ 24@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
                        050A: 20@ = distance_between_XYZ 2@ 3@ 4@ and_XYZ 22@ 23@ 24@
                        if 20@ < 20.0
                        then
                            03F0: enable_text_draw 1
                            0342: set_text_draw_centered 1
                            03E0: draw_text_behind_textures 0
                            033F: set_text_draw_letter_size width 0.17 height 0.77
                            081C: draw_text_outline 1 RGBA 0 0 0 255
                            0340: set_text_draw_RGBA 0 255 0 255
                            045A: draw_text_1number 6@ 7@ GXT 'CRED445' number 5@  //
                        end
                    end
                end         
            end
        end
    end
end
 
:getScreenXYFrom3DCoords
0AC7: 14@ = var 0@ offset
0AC7: 15@ = var 3@ offset
0AC7: 16@ = var 6@ offset
0AC7: 17@ = var 9@ offset
0AA5: call 0x70CE30 num_params 6 pop 6 {18@ 18@} 0 0 17@ 16@ 15@ 14@
0007: 12@ = 640.0
0007: 13@ = 448.0
0A8D: 14@ = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: 15@ = read_memory 0xC17048 size 4 virtual_protect 0
0093: 14@ = integer 14@ to_float
0093: 15@ = integer 15@ to_float
0073: 12@ /= 14@
0073: 13@ /= 15@
006B: 3@ *= 12@
006B: 4@ *= 13@
0AB2: ret 2 3@ 4@
 

TheMonstercat

Известный
75
11
@legend

Thanks a lot man :)

0A92: create_custom_thread "Car-HP Indicator.cs"
End_Thread
so i can reload the .cs ingame

@gcode

Hahaha xD
 

nera2x2

Новичок
8
0
Как сделать чтобы этот ГМ выкл автоматически при остановке,тоесть когда стоишь чтобы он был выкл?????помогите плиз
 

Вложения

  • gm-strelba-skvoz-skin.rar
    6.2 KB · Просмотры: 9

itsLegend

Фонд борьбы за жуков 🐞
Администратор
2,696
1,463
Как сделать чтобы этот ГМ выкл автоматически при остановке,тоесть когда стоишь чтобы он был выкл?????помогите плиз

06AC: 0@ = actor $PLAYER_ACTOR movement_speed
Если не двигаешься - 0.0
Если двигаешься, естественно, больше 0.0.

Удачи ;)
 

san0

Известный
Друг
411
267
Привет всем. Вот начал учить cleo помальца,скажем так.
Есть небольшые вопросики:
1) Как сделать проверку на то,что команда введена. (( т.е 0B34: samp register_client_command "lalaka" to_label @lalka, а как потом в метке сделать условие ввода команды? ))
2) Дайте описания всем функциям Dialog. функции ( к примеру, Create, AddButton и т.д ))
3) Как сделать как в pawno , чтобы при нажатии на клавишу 1 не нумпад ( 49 desc) каждый раз выполнялась последовательная функция:
0B5D: samp toggle_cursor false
Т.Е один раз нажал false , второй true.
Спасибо кто поможет. Буду очень благодарен.