:CheckCarsInFront
03C0: 0@ = actor $PLAYER_ACTOR car
0407: store_coords_to 1@ 2@ 3@ from_car 0@ with_offset 0.0 0.0 0.0
0174: 4@ = car 0@ Z_angle
06BE: 5@ = car 0@ y_angle
0AB1: @get3DXYZInFrontOf 6 XYZ 1@ 2@ 3@ Z_Angle 4@ Y_Angle 5@ Distance 9.5 Return_XYZ_To 6@ 7@ 8@
if
86BD: is_obstacles_between 1@ 2@ 3@ and 6@ 7@ 8@ solid 1 car 1 actor 1 object 1 particle 0
then
06D5: 29@ = create_racing_checkpoint_at 6@ 7@ 8@ point_to 6@ 7@ 8@ type 2 radius 1.0
wait 500
06D6: disable_racing_checkpoint 29@
end
0AB2: ret 0
:get3DXYZInFrontOf
{
Return:
PosX-InFrontOf
PosY-InFrontOf
PosZ-InFrontOf
Example: 0AB1: @get3DXYZInFrontOf 6 XYZ 1@ 2@ 3@ Z_Angle 4@ Y_Angle 5@ Distance 9.5 Return_XYZ_To 6@ 7@ 8@
}
3@ *= -1.0
02F6: 6@ = sine 3@
006B: 6@ *= 5@
005B: 0@ += 6@
02F7: 6@ = cosine 3@
006B: 6@ *= 5@
005B: 1@ += 6@
02F7: 6@ = cosine 4@
0073: 5@ /= 6@
02F6: 6@ = sine 4@
006B: 5@ *= 6@
005B: 2@ += 5@
0AB2: ret 3 0@ 1@ 2@