[C++] Memory addresses of cleo functions

Daslee

Member
Joined
Jun 3, 2013
Messages
9
Reaction score
1
Hello,
Maybe someone knows san andreas memory addresses of these functions, that cleo is using:
Code:
09EF: set_behind_camera_autoposition_mode_for_car_model 1@ distance 1.0 altitude_multiplier 1.0 angle_X 0.08
0A25: set_camera_on_players_X_angle 1@ Z_angle 2@

I couldn't find them neither in DK22Pac SDK nor in MTA:SA source code.. Maybe these are custom cleo functions and not a san andreas functions?
 

Daslee

Member
Joined
Jun 3, 2013
Messages
9
Reaction score
1
Aim angles I have already. So set_camera_on_players_X_angle only changes these two angles and does nothing else? Because when I try this:
Code:
*(float*)0xB6F248 = -0.10f;
It works for X angle when vehicle is on perfectly flat surface (x angle == 0.0), but as soon as I drive uphill or downhill, camera starts to wiggle up and down.. Or maybe this function is not for directly changing x angle or...?

EDIT: Found this snippet:
This Snippet will instantly make your Camera Look on a specific 3D location. This Snippet actually has many uses like:
  • Make our Camera Follow/Lock-on a certain Actor by feeding this snippet with its Position.
  • Can be Used as an Aimbot, just feed this with a specified Camera XZ-Offsets for the Crosshair positions.
  • Can be used for Debugging purposes like "Offset Visualizer" Tool?

Code:
// 0AB1: @camatpos 5 _XYZ 0@ 1@ 2@ _withCamOffsetAngleX 3@ _andCamOffsetAngleZ 4@
:camatpos
    // ~~~~~~~~~~anti auto-vehicle cam movement
if and
    TIMERA>=400
    Actor.Driving($PLAYER_ACTOR)
then
    0A8C: write_memory 0xB70118 size 4 value 50.0 virtual_protect 0 // reset camera stabalizer timer, credit to Parazitas
    TIMERA = 0
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.1415926535897981710616733832795 // 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@
ret 0

Snippet Application Examples:

>>CamLock<<
Code:
00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
0AE1: 0@ = random_actor_near_point 0@ 1@ 2@ in_radius 1000.0 find_next 1 pass_deads 1
00A0: store_actor 0@ position_to 1@ 2@ 3@
0AB1: @camatpos 5 _XYZ 1@ 2@ 3@ _withCamOffsetAngleX 0.0 _andCamOffsetAngleZ 0.0

Code:
00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
0AE1: 0@ = random_actor_near_point 0@ 1@ 2@ in_radius 1000.0 find_next 1 pass_deads 1
0889: store_actor 0@ center_of_body_position_to 1@ 2@ 3@
   // configuration
30@ = 0.3
31@ = 0.3
   //
0AB1: @camatpos 5 _XYZ 1@ 2@ 3@ _withCamOffsetAngleX 30@ _andCamOffsetAngleZ 31@

Code:
00A0: store_actor $PLAYER_ACTOR position_to 0@ 1@ 2@
0AE1: 0@ = random_actor_near_point 0@ 1@ 2@ in_radius 1000.0 find_next 1 pass_deads 1
0889: store_actor 0@ center_of_body_position_to 1@ 2@ 3@

   // configuration
0470: 29@ = actor $PLAYER_ACTOR current_weapon
if and
         29@ >= 22
         29@ <= 38
         29@ <> 34 // not sniper
         29@ <> 35 // not RPG
         29@ <> 36 // not Heatseeker
then // for weapons with crosshair offset angles like handguns,shotguns,sub-machinceguns,machineguns,cowboy rifle
          30@ = -4.5 // X-Angle offset of Non-Sniper Crosshair degrees
          30@ /= 57.295779817106167876798171061675 // to radians
    
          31@ = 2.5 // Z-Angle offset of Non-Sniper Crosshair degrees
          31@ /= 57.295779817106167876798171061675 // to radians
else // for no  offset weapons like grenade ,fist , sniper, RPG, Heatseeker, etc... weapons
          30@ = 0.0
          31@ = 0.0
end
   //

0AB1: @camatpos 5 _XYZ 1@ 2@ 3@ _withCamOffsetAngleX 30@ _andCamOffsetAngleZ 31@

And this line, seems to fix the wiggling:
Code:
0A8C: write_memory 0xB70118 size 4 value 50.0 virtual_protect 0 // reset camera stabalizer timer, credit to Parazitas
 
Last edited:
Top