CLEO Help Aim Prediction

CLEO related

xAmUser

Active member
Joined
Feb 23, 2018
Messages
55
Reaction score
2
hello, please tell me how to make an aimbot prediction so that the sight at high speed does not come off the head as in this video

 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
Why you don't have choise??
PHP:
0AB1: @MOVEMOUSE_ALLDIRECTION 0 // I actually hate this function because it dazzle the screen a bit, but I have no choice I have to use it :(


@ajom seems like he using your func..
 

xAmUser

Active member
Joined
Feb 23, 2018
Messages
55
Reaction score
2
Why you don't have choise??
PHP:
0AB1: @MOVEMOUSE_ALLDIRECTION 0 // I actually hate this function because it dazzle the screen a bit, but I have no choice I have to use it :(


@ajom seems like he using your func..
I threw off the opening from the public my code in Chita and starts from the line
068d: get_camera_position_to 31@ 30@ 29@
don't look at him, just throw off the aim prediction code
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
  1. 3DVelocity_Difference = 3DVelocity_Target - 3DVelocity_Me
  2. Get Average_50fps_Ratio by reading 0xB7CB5C
  3. 3DVelocity_Difference_PerFrame = 3DVelocity_Difference / (50.0fps x Average_50fps_Ratio)
  4. Next_Frame_Predicted_3DPosition = 3FPosition_Target + 3DVelocity_Difference_PerFrame
  5. Then feed Next_Frame_Predicted_3DPosition to your AimAtPos Snippet.

Actually if you tried searching around ugbase threads, the idea is a bit the same here.
 

xAmUser

Active member
Joined
Feb 23, 2018
Messages
55
Reaction score
2
  1. 3DVelocity_Difference = 3DVelocity_Target - 3DVelocity_Me
  2. Get Average_50fps_Ratio by reading 0xB7CB5C
  3. 3DVelocity_Difference_PerFrame = 3DVelocity_Difference / (50.0fps x Average_50fps_Ratio)
  4. Next_Frame_Predicted_3DPosition = 3FPosition_Target + 3DVelocity_Difference_PerFrame
  5. Then feed Next_Frame_Predicted_3DPosition to your AimAtPos Snippet.

Actually if you tried searching around ugbase threads, the idea is a bit the same here.
Please give me the code
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
  1. 3DVelocity_Difference = 3DVelocity_Target - 3DVelocity_Me
  2. Get Average_50fps_Ratio by reading 0xB7CB5C
  3. 3DVelocity_Difference_PerFrame = 3DVelocity_Difference / (50.0fps x Average_50fps_Ratio)
  4. Next_Frame_Predicted_3DPosition = 3FPosition_Target + 3DVelocity_Difference_PerFrame
  5. Then feed Next_Frame_Predicted_3DPosition to your AimAtPos Snippet.

Actually if you tried searching around ugbase threads, the idea is a bit the same here.
Something is wrong with calculation i guess, i puts on right hand side of player..
PHP:
{$CLEO .cs}

0000:

REPEAT
IF 8AA2: $NOT_USED = "samp.dll"
THEN 0A93: end_custom_thread
END
WAIT 1500
UNTIL 0AA2: $NOT_USED = "samp.dll"

WHILE TRUE
WAIT 0

IF 0256:   player $PLAYER_CHAR defined
THEN
    IF 0AD2: 31@ = player $PLAYER_CHAR targeted_actor //IF and SET
    THEN
        0AB1: @GENERATE_AIM_POSITION 1 ActorHandle 31@ _Returned: XYZ 0@ 1@ 2@
        0AB1: @CamAtPos 5 _XYZ 0@ 1@ 2@ _withCamOffsetAngleX 0.0 _andCamOffsetAngleZ 0.0
    END
END

END

:GENERATE_AIM_POSITION
{
    0AB1: @GENERATE_AIM_POSITION 1 ActorHandle 31@ _Returned: XYZ 0@ 1@ 2@
}
// 3DVelocity_Difference = 3DVelocity_Target - 3DVelocity_Me
083D: get_actor $PLAYER_ACTOR velocity_in_direction_XYZ 31@ 30@ 29@
083D: get_actor 0@ velocity_in_direction_XYZ 28@ 27@ 26@
0063: 28@ -= 31@  // (float)
0063: 27@ -= 30@  // (float)
0063: 26@ -= 29@  // (float)
// Get Average_50fps_Ratio by reading 0xB7CB5C
0A8D: 25@ = read_memory 0xB7CB5C size 4 virtual_protect 0  // gta frame time, use in order to be consistent with FPS
// 3DVelocity_Difference_PerFrame = 3DVelocity_Difference / (50.0fps x Average_50fps_Ratio)
24@ = 50.0 // 50.0fps 
006B: 24@ *= 25@  // (float)

0073: 28@ /= 24@ // (float)
0073: 27@ /= 24@ // (float)
0073: 26@ /= 24@ // (float)
// Next_Frame_Predicted_3DPosition = 3FPosition_Target + 3DVelocity_Difference_PerFrame
00A0: store_actor 0@ position_to 23@ 22@ 21@
005B: 23@ += 28@  // (float)
005B: 22@ += 27@  // (float)
005B: 21@ += 26@  // (float)
0AB2: ret 3 23@ 22@ 21@

:CamAtPos // thx to ajom >> ugbase.eu 
// 0AB1: @CamAtPos 5 _XYZ 0@ 1@ 2@ _withCamOffsetAngleX 3@ _andCamOffsetAngleZ 4@
    // ~~~~~~~~~~anti auto-vehicle cam movement
0A8D: 16@ = read_memory 0xB70118 size 4 virtual_protect 0
IF AND 
16@ < 50.0
00DF:   actor $PLAYER_ACTOR in_car
THEN 0A8C: write_memory 0xB70118 size 4 value 50.0 virtual_protect 0 // reset vehicle camera stabalizer timer, credit to Parazitas
END
    // ~~~~~~~~~~

068D: get_camera_position_to 31@ 30@ 29@

    // ~~~~~~~~~~Camera Z-Angle from our camera towards the target
0087: 28@ = 1@  // y2
0063: 28@ -= 30@  // y1
0087: 27@ = 0@  // x2
0063: 27@ -= 31@  // x1
0AA5: atan2 | 0x4207C0 2 2 | _X 27@ _Y 28@
0AE9: pop_float 28@ // store result from above operation
28@ += 3.1415926535897987671013733832795 // Camera Angle Leads 180 degrees respect to Z world coordinats
005B: 28@ += 4@  // use the defined camz offset to move the camera leftwards or rightwards
    // ~~~~~~~~~~

    // ~~~~~~~~~~Camera X-Angle from our camera towards the target
0087: 27@ = 2@ // z2
0063: 27@ -= 29@  // z1
0509: 26@ = distance_between_XY 31@ 30@ and_XY 0@ 1@ // adjacent side
0AA5: atan2 | 0x4207C0 2 2 | _X 26@ _Y 27@
0AE9: pop_float 27@ // store result from above operation
005B: 27@ += 3@  // use the defined camx offset to move the camera downwards or upwards
    // ~~~~~~~~~~

0A25: set_camera_on_players_X_angle 27@ Z_angle 28@
0AB2: ret 0
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
  1. 3DVelocity_Difference = 3DVelocity_Target - 3DVelocity_Me
  2. Get Average_50fps_Ratio by reading 0xB7CB5C
  3. 3DVelocity_Difference_PerFrame = 3DVelocity_Difference / (50.0fps x Average_50fps_Ratio)
  4. Next_Frame_Predicted_3DPosition = 3FPosition_Target + 3DVelocity_Difference_PerFrame
  5. Then feed Next_Frame_Predicted_3DPosition to your AimAtPos Snippet.

Actually if you tried searching around ugbase threads, the idea is a bit the same here.
What you mean by this?
" 3FPosition_Target "
is it player position ?
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Something is wrong with calculation i guess, i puts on right hand side of player..

My bad, the FPS ratio is inverted. So FPS Smoothening should be inversely proportional to the FPS Ratio(fps_smoothener = Average_50fps_Ratio/50.0fps). Here is the right idea:
  1. 3DVelocity_Difference = 3DVelocity_Target - 3DVelocity_Me
  2.  Get Average_50fps_Ratio by reading 0xB7CB5C
  3. 3DVelocity_Difference_PerFrame = 3DVelocity_Difference * ( Average_50fps_Ratio / 50.0fps )
  4. Next_Frame_Predicted_3DPosition = 3DPosition_Target + 3DVelocity_Difference_PerFrame
  5. Then feed Next_Frame_Predicted_3DPosition to your AimAtPos Snippet.

What you mean by this?
" 3FPosition_Target "
is it player position ?
The 3D coordinates/position of the aimed target actor. Can't edit the post anymore.
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Just change this:
// Get Average_50fps_Ratio by reading 0xB7CB5C
0A8D: 25@ = read_memory 0xB7CB5C size 4 virtual_protect 0 // gta frame time, use in order to be consistent with FPS
// 3DVelocity_Difference_PerFrame = 3DVelocity_Difference / (50.0fps x Average_50fps_Ratio)
24@ = 50.0 // 50.0fps
006B: 24@ *= 25@ // (float)

Into:
PHP:
// Get Average_50fps_Ratio by reading 0xB7CB5C
0A8D: 25@ = read_memory 0xB7CB5C size 4 virtual_protect 0  // gta frame time, use in order to be consistent with FPS
// 3DVelocity_Difference_PerFrame = 3DVelocity_Difference / (50.0fps x Average_50fps_Ratio)
24@ = 50.0 // 50.0fps
0073: 24@ /= 25@  // (float)
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,104
Solutions
5
Reaction score
882
Location
Lithuania
Just change this:


Into:
PHP:
// Get Average_50fps_Ratio by reading 0xB7CB5C
0A8D: 25@ = read_memory 0xB7CB5C size 4 virtual_protect 0  // gta frame time, use in order to be consistent with FPS
// 3DVelocity_Difference_PerFrame = 3DVelocity_Difference / (50.0fps x Average_50fps_Ratio)
24@ = 50.0 // 50.0fps
0073: 24@ /= 25@  // (float)
Well something is still wrong, code below:
PHP:
:GENERATE_AIM_POSITION
{
    0AB1: @GENERATE_AIM_POSITION 1 ActorHandle 31@ _Returned: XYZ 0@ 1@ 2@
}
// 3DVelocity_Difference = 3DVelocity_Target - 3DVelocity_Me
083D: get_actor $PLAYER_ACTOR velocity_in_direction_XYZ 31@ 30@ 29@
083D: get_actor 0@ velocity_in_direction_XYZ 28@ 27@ 26@
0063: 28@ -= 31@  // (float)
0063: 27@ -= 30@  // (float)
0063: 26@ -= 29@  // (float)  

// Get Average_50fps_Ratio by reading 0xB7CB5C
0A8D: 25@ = read_memory 0xB7CB5C size 4 virtual_protect 0  // gta frame time, use in order to be consistent with FPS
// 3DVelocity_Difference_PerFrame = 3DVelocity_Difference / (50.0fps x Average_50fps_Ratio)
24@ = 50.0 // 50.0fps
0073: 24@ /= 25@  // (float)

0073: 28@ /= 24@ // (float)
0073: 27@ /= 24@ // (float)
0073: 26@ /= 24@ // (float)
// Next_Frame_Predicted_3DPosition = 3FPosition_Target + 3DVelocity_Difference_PerFrame
00A0: store_actor 0@ position_to 23@ 22@ 21@
005B: 23@ += 28@  // (float)
005B: 22@ += 27@  // (float)
005B: 21@ += 26@  // (float)
0AB2: ret 3 23@ 22@ 21@
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
Top