[SNIPPET] GET_TARGET_ACTOR

Opcode.eXe

Well-Known Member
Joined
Feb 18, 2013
Messages
1,279
Likes
27
Points
98
Location
( ͡° ͜ʖ ͡°)
Website
www.youtube.com
10
#1
This gets the closest player to your crosshair instandly, not like the old version.

example:
Code:
        IF
        0AB1: @GET_TARGET_ACTOR 0 [email protected]
        THEN
            04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.0         
                    
        END
Code:
:GET_TARGET_ACTOR 
[email protected] = 640.0   
0A8D: [email protected] = read_memory 0xB74490 size 4 virtual_protect 0
000A: [email protected] += 0x4
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
for [email protected] = 0 to 35584 step 0x100
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
    000A: [email protected] += 0x1
    if and
        0029:  [email protected] >= 0x00 
        001B:  0x80 > [email protected]
    then 
        005A: [email protected] += [email protected]
        if
        056D:   actor [email protected] defined
        then
            if
            803C:  $PLAYER_ACTOR == [email protected] // (int)
            then
                04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.0
                068D: get_camera_position_to [email protected] [email protected] [email protected]
                if and
                02CB:   actor [email protected] bounding_sphere_visible
                06BD:   no_obstacles_between [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] solid 1 car 0 actor 0 object 1 particle 0
                then
                    0AB1: @getScreenXYFrom3DCoords 3 3D_coords_X [email protected] Y [email protected] Z [email protected] store_screen_X_to [email protected] Y_to [email protected]    
                    0509: [email protected] = distance_between_XY 339.0 179.0 and_XY [email protected] [email protected] 
                    if
                    0035:   [email protected] >= [email protected] // (float) 
                    then
                        0087: [email protected] = [email protected] // (float)
                        0087: [email protected] = [email protected] // (float)
                    end
                
                
                end     
            end
        end
    end
end
if
056D:   actor [email protected] defined
then
    0485:  return_true
else
    059A:  return_false
end
0AB2: 1 [email protected]
//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X [email protected] Y [email protected] Z [email protected] store_screen_X_to [email protected] Y_to [email protected]
:getScreenXYFrom3DCoords
0AC7: [email protected] = var [email protected] offset
0AC7: [email protected] = var [email protected] offset
0AC7: [email protected] = var [email protected] offset
0AC7: [email protected] = var [email protected] offset
0AA5: call 0x70CE30 num_params 6 pop 6 {[email protected] [email protected]} 0 0 [email protected] [email protected] [email protected] [email protected]
0007: [email protected] = 640.0
0007: [email protected] = 448.0
0A8D: [email protected] = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: [email protected] = read_memory 0xC17048 size 4 virtual_protect 0
0093: [email protected] = integer [email protected] to_float
0093: [email protected] = integer [email protected] to_float
0073: [email protected] /= [email protected]
0073: [email protected] /= [email protected]
006B: [email protected] *= [email protected]
006B: [email protected] *= [email protected]
0AB2: ret 2 [email protected] [email protected]
 

iLost

Well-Known Member
Joined
Jun 5, 2014
Messages
217
Likes
0
Points
16
10
#2
Re: GET_TARGET_ACTOR

Nice Opcode! Not bad ..  :not_bad:
 

shanker

Well-Known Member
Joined
Sep 18, 2016
Messages
238
Likes
2
Points
33
Location
Romania
#6
RE: [SNIPPET] GET_TARGET_ACTOR

n1 :pPFFH: :pPFFH: :pPFFH:

@Opcode.eXe

i did a trigger bot on rifle with this ty  :pPFFH: :pPFFH: :pPFFH: :pPFFH:
 

shanker

Well-Known Member
Joined
Sep 18, 2016
Messages
238
Likes
2
Points
33
Location
Romania
#7
RE: [SNIPPET] GET_TARGET_ACTOR

Opcode.eXe said:
This gets the closest player to your crosshair instandly, not like the old version.

example:
Code:
        IF
        0AB1: @GET_TARGET_ACTOR 0 [email protected]
        THEN
            04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.0         
                    
        END
Code:
:GET_TARGET_ACTOR 
[email protected] = 640.0   
0A8D: [email protected] = read_memory 0xB74490 size 4 virtual_protect 0
000A: [email protected] += 0x4
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
for [email protected] = 0 to 35584 step 0x100
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
    000A: [email protected] += 0x1
    if and
        0029:  [email protected] >= 0x00 
        001B:  0x80 > [email protected]
    then 
        005A: [email protected] += [email protected]
        if
        056D:   actor [email protected] defined
        then
            if
            803C:  $PLAYER_ACTOR == [email protected] // (int)
            then
                04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.0
                068D: get_camera_position_to [email protected] [email protected] [email protected]
                if and
                02CB:   actor [email protected] bounding_sphere_visible
                06BD:   no_obstacles_between [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] solid 1 car 0 actor 0 object 1 particle 0
                then
                    0AB1: @getScreenXYFrom3DCoords 3 3D_coords_X [email protected] Y [email protected] Z [email protected] store_screen_X_to [email protected] Y_to [email protected]    
                    0509: [email protected] = distance_between_XY 339.0 179.0 and_XY [email protected] [email protected] 
                    if
                    0035:   [email protected] >= [email protected] // (float) 
                    then
                        0087: [email protected] = [email protected] // (float)
                        0087: [email protected] = [email protected] // (float)
                    end
                
                
                end     
            end
        end
    end
end
if
056D:   actor [email protected] defined
then
    0485:  return_true
else
    059A:  return_false
end
0AB2: 1 [email protected]
//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X [email protected] Y [email protected] Z [email protected] store_screen_X_to [email protected] Y_to [email protected]
:getScreenXYFrom3DCoords
0AC7: [email protected] = var [email protected] offset
0AC7: [email protected] = var [email protected] offset
0AC7: [email protected] = var [email protected] offset
0AC7: [email protected] = var [email protected] offset
0AA5: call 0x70CE30 num_params 6 pop 6 {[email protected] [email protected]} 0 0 [email protected] [email protected] [email protected] [email protected]
0007: [email protected] = 640.0
0007: [email protected] = 448.0
0A8D: [email protected] = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: [email protected] = read_memory 0xC17048 size 4 virtual_protect 0
0093: [email protected] = integer [email protected] to_float
0093: [email protected] = integer [email protected] to_float
0073: [email protected] /= [email protected]
0073: [email protected] /= [email protected]
006B: [email protected] *= [email protected]
006B: [email protected] *= [email protected]
0AB2: ret 2 [email protected] [email protected]

it don't works really good on m4 / rifle, could you tell me how to fix it?  :iknowwhatyoudidthere:
 

shanker

Well-Known Member
Joined
Sep 18, 2016
Messages
238
Likes
2
Points
33
Location
Romania
#9
RE: [SNIPPET] GET_TARGET_ACTOR

Opcode.eXe said:
339.0 179.0 is the 2D position of the crosshair.
maybe try to change that to the m4 crosshair cordinates?
330.0 190.0 for rifle

it only works with his get3d cords snippet
 

shanker

Well-Known Member
Joined
Sep 18, 2016
Messages
238
Likes
2
Points
33
Location
Romania
#10
RE: [SNIPPET] GET_TARGET_ACTOR

Opcode.eXe said:
This gets the closest player to your crosshair instandly, not like the old version.

example:
Code:
        IF
        0AB1: @GET_TARGET_ACTOR 0 [email protected]
        THEN
            04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.0         
                    
        END
Code:
:GET_TARGET_ACTOR 
[email protected] = 640.0   
0A8D: [email protected] = read_memory 0xB74490 size 4 virtual_protect 0
000A: [email protected] += 0x4
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
for [email protected] = 0 to 35584 step 0x100
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
    000A: [email protected] += 0x1
    if and
        0029:  [email protected] >= 0x00 
        001B:  0x80 > [email protected]
    then 
        005A: [email protected] += [email protected]
        if
        056D:   actor [email protected] defined
        then
            if
            803C:  $PLAYER_ACTOR == [email protected] // (int)
            then
                04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.0
                068D: get_camera_position_to [email protected] [email protected] [email protected]
                if and
                02CB:   actor [email protected] bounding_sphere_visible
                06BD:   no_obstacles_between [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] solid 1 car 0 actor 0 object 1 particle 0
                then
                    0AB1: @getScreenXYFrom3DCoords 3 3D_coords_X [email protected] Y [email protected] Z [email protected] store_screen_X_to [email protected] Y_to [email protected]    
                    0509: [email protected] = distance_between_XY 339.0 179.0 and_XY [email protected] [email protected] 
                    if
                    0035:   [email protected] >= [email protected] // (float) 
                    then
                        0087: [email protected] = [email protected] // (float)
                        0087: [email protected] = [email protected] // (float)
                    end
                
                
                end     
            end
        end
    end
end
if
056D:   actor [email protected] defined
then
    0485:  return_true
else
    059A:  return_false
end
0AB2: 1 [email protected]
//0AB1: call_scm_func @getScreenXYFrom3DCoords 3 3D_coords_X [email protected] Y [email protected] Z [email protected] store_screen_X_to [email protected] Y_to [email protected]
:getScreenXYFrom3DCoords
0AC7: [email protected] = var [email protected] offset
0AC7: [email protected] = var [email protected] offset
0AC7: [email protected] = var [email protected] offset
0AC7: [email protected] = var [email protected] offset
0AA5: call 0x70CE30 num_params 6 pop 6 {[email protected] [email protected]} 0 0 [email protected] [email protected] [email protected] [email protected]
0007: [email protected] = 640.0
0007: [email protected] = 448.0
0A8D: [email protected] = read_memory 0xC17044 size 4 virtual_protect 0
0A8D: [email protected] = read_memory 0xC17048 size 4 virtual_protect 0
0093: [email protected] = integer [email protected] to_float
0093: [email protected] = integer [email protected] to_float
0073: [email protected] /= [email protected]
0073: [email protected] /= [email protected]
006B: [email protected] *= [email protected]
006B: [email protected] *= [email protected]
0AB2: ret 2 [email protected] [email protected]
HEEEEEEEEEEEEEY

i m so fcking pissed of and finally i know what's the problem with your snippet

i fkin told u its a problem with your snippet u didn't believed meeee :/

if the cond is false then script won't read this line

[shcode=cpp]0087: [email protected] = [email protected] // (float)[/shcode]

and as can you see at the finel lines you have cond, if actor 15 is defined then .. fuk, but if no one is bounding or another cond is false, script wont know what is that fkin [email protected] var and it will give me craaash, at least i fkin fixed it
 

shanker

Well-Known Member
Joined
Sep 18, 2016
Messages
238
Likes
2
Points
33
Location
Romania
#12
RE: [SNIPPET] GET_TARGET_ACTOR

Opcode.eXe said:
There is no bug... what are you talking about??
There is even a security check to prevent false returings:
PHP:
if
056D:   actor [email protected] defined
then
    0485:  return_true
else
    059A:  return_false
end
0AB2: 1 [email protected]

// Show me your fix?
u dont understand, i dont either xd but on the server where i play this snippet dont works i will show you tomorow a vid and i l give u the edited source :D
i just put a cond 

if [email protected] == 1337 then if actor [email protected] defined ...

and [email protected] == 1337 when [email protected] == [email protected] (actor handle)
 

shanker

Well-Known Member
Joined
Sep 18, 2016
Messages
238
Likes
2
Points
33
Location
Romania
#13
RE: [SNIPPET] GET_TARGET_ACTOR

Opcode.eXe said:
There is no bug... what are you talking about??
There is even a security check to prevent false returings:
PHP:
if
056D:   actor [email protected] defined
then
    0485:  return_true
else
    059A:  return_false
end
0AB2: 1 [email protected]

// Show me your fix?
[shcode=cpp]
:GET_TARGET_ACTOR 
[email protected] = 640.0   
0A8D: [email protected] = read_memory 0xB74490 size 4 virtual_protect 0
000A: [email protected] += 0x4
0A8D: [email protected] = read_memory [email protected] size 4 virtual_protect 0
for [email protected] = 0 to 35584 step 0x100
    0A8D: [email protected] = read_memory [email protected] size 1 virtual_protect 0
    000A: [email protected] += 0x1
    if and
        0029:  [email protected] >= 0x00 
        001B:  0x80 > [email protected]
    then 
        005A: [email protected] += [email protected]
        if
        056D:   actor [email protected] defined
        then
            if
            803C:  $PLAYER_ACTOR == [email protected] // (int)
            then
                04C4: store_coords_to [email protected] [email protected] [email protected] from_actor [email protected] with_offset 0.0 0.0 0.0
                068D: get_camera_position_to [email protected] [email protected] [email protected]
                if and
                02CB:   actor [email protected] bounding_sphere_visible
                06BD:   no_obstacles_between [email protected] [email protected] [email protected] and [email protected] [email protected] [email protected] solid 1 car 0 actor 0 object 1 particle 0
                then
                    0AB1: @getScreenXYFrom3DCoords 3 3D_coords_X [email protected] Y [email protected] Z [email protected] store_screen_X_to [email protected] Y_to [email protected]    
                    if 02D8:   actor $PLAYER_ACTOR current_weapon == 33
                    then
                        0509: [email protected] = distance_between_XY 330.0 190.0 and_XY [email protected] [email protected] 
                    else
                        0509: [email protected] = distance_between_XY 339.0 179.0 and_XY [email protected] [email protected] 
                    end
                    if
                    0035:   [email protected] >= [email protected] // (float) 
                    then
                        0087: [email protected] = [email protected] // (float)
                        0087: [email protected] = [email protected] // (float)
                        [email protected] = 1337
                    end                
                end     
            end
        end
    end
end
if [email protected] == 1337
then
    [email protected] = 0
    if 056D:   actor [email protected] defined
    then
        0485:  return_true
    else
        059A:  return_false
    end
end
0AB2: 1 [email protected]
[/shcode]
on a script with 5k lines if i dont use this cond, i get crash
 
Top