[SNIPPET] For All Objects

Example
PHP:
{$CLEO .cs}

0000: NOP

wait 10000

13@ = Render.CreateFont("Verdana", 8, 12)

WHILE TRUE
    WAIT 0
   
if
0AB0: KEY_X 88
then
    0A8D: 29@ = read_memory 0xB7449C size 4 virtual_protect 0
    000A: 29@ += 0x4
    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    for 30@ = 0 to 89344 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@    
            if and
            03CA:   object 31@ exists
            02CC:   object 31@ bounding_sphere_visible
            then    
                01BB: store_object 31@ position_to 1@ 2@ 3@
                0B55: convert_3D_coords 1@ 2@ 3@ to_screen 5@ 6@
                0984: 10@ = object 31@ model
                alloc 11@ 260
                format 11@ "{e3dc0b}Model: {FFFFFF}%d" 10@
                0B6F: render font 13@ draw_text 11@ pos  5@ 6@ color 0xe3dc0bff
            end
        end
    end 
end

END

Snippet
PHP:
0AB1: @GetClosestObject 0 XYZ 0@ 1@ 2@ Model 3@
PHP:
:GetClosestObject
20@ = 9999.0
0A8D: 29@ = read_memory 0xB7449C size 4 virtual_protect 0
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
for 30@ = 0 to 89344 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@     
        if and
        03CA:   object 31@ exists
        02CC:   object 31@ bounding_sphere_visible
        then     
            0400: store_coords_to 4@ 5@ 6@ from_object 31@ with_offset 0.0 0.0 0.0
            if
            00DF:   actor $PLAYER_ACTOR driving
            then
                03C0: 1@ = actor $PLAYER_ACTOR car
                0407: store_coords_to 7@ 8@ 9@ from_car 1@ with_offset 0.0 0.0 0.0
            else
                04C4: store_coords_to 7@ 8@ 9@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
            end
            0509: 10@ = distance_between_XY 4@ 5@ and_XY 7@ 8@
            if
            0025:   20@ > 10@  // (float)
            then
                0087: 20@ = 10@ // (float)
                0984: 18@ = object 31@ model
                0400: store_coords_to 12@ 13@ 14@ from_object 31@ with_offset 0.0 0.0 0.0
                0087: 15@ = 12@ // (float)
                0087: 16@ = 13@ // (float)
                0087: 17@ = 14@ // (float)
                0085: 19@ = 18@ // (int)
            end
        end
    end 
end  
0AB2: ret 4 15@ 16@ 17@ 19@
 
Last edited:
Top