CLEO Help Change Car X-Angle Rotation

CLEO related
Status
Not open for further replies.

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
OK, this opcodes can set the Y and Z angle rotation of a Car
Code:
0175: set_car 22@ Z_angle_to 315.0
0731: set_car 34@ y_angle_to 73@

But I cannot find any opcode that "changes" the X-Angle of the Car. Does anyone know how?





I have searched in GTA SA Memory Addresses at byte offset +20 or the car structure are the list of car rotations:
Each vehicle object is 2584 (0xA18) bytes. It starts at 0xC502AA0.

For each vehicle in the pool:

  • +20 = [byte] Contains a pointer to the rotation/position matrix (84 bytes):
    • +0 = [float] X-axis Rotation (Grad)
    • +4 = [float] Y-axis Rotation (Grad)
    • +8 = [float] Z-axis Rotation (Grad)
    • +16 = [float] X-axis Rotation (Looking)
    • +20 = [float] Y-axis Rotation (Looking)
    • +24 = [float] Z-axis Rotation (Looking)
    • +48 = [float] X-axis Position
    • +52 = [float] Y-axis Position
    • +56 = [float] Z-axis Position

But why does this code not match???
Code:
077D: 18@ = car 8@ x_angle


0A97: 17@ = car 8@ struct
18@ += 20 // point at rotation matrix

// get the X axist ground rotation
0085: 16@ = 17@ // (int)
16@ += 0
0A8D: 16@ = read_memory 16@ size 4 virtual_protect 0

// get the X axis Facing Rotation
0085: 15@ = 17@ // (int)
15@ += 16
0A8D: 15@ = read_memory 15@ size 4 virtual_protect 0

0AD1: show_formatted_text_highpriority "%f~n~%f~n~%f" time 2000 18@ 16@ 15@
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
268
Location
Pluto
I Solved my own problem by using this Snippet:
Code:
call @SetCarAngles 4 {CarHandle} 1@ {angleX} 27@ {angleY} -1 {angleZ} -1 // set car 1@ x angle to 27@ while maintaining both y and z angles
 
Status
Not open for further replies.
Top