CLEO Help Closest player car ?

CLEO related
Status
Not open for further replies.

Hysterics

Member
Joined
Dec 25, 2013
Messages
9
Reaction score
0
What is the best way to check with car is closest within a radius?
Currently i am using:
Code:
20@ = random_vehicle_near_point 10@ 11@ 12@ in_radius 50.0 find_next 0 pass_wrecked 1
This works but it does not select the closest car in that radius
Any help?
Regards
 

Hysterics

Member
Joined
Dec 25, 2013
Messages
9
Reaction score
0
Hi there
How should i check the distance between my car and the target?
Right now i can only see random cars within that radius
btw i think using
Code:
050A: get_distance_between_coords_3d $TEMPVAR_FLOAT_1 $TEMPVAR_FLOAT_2 $TEMPVAR_FLOAT_3 and 4@ 5@ 6@ store_to 17@
would be okay? and i belive using the last cords (in this case Z) to calculate the distance, im correct?
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
I'm not sure what is the main aim behind your question but according to the title the easiest way to get player's closest car is to use this opcode:
0AB5: store_actor $PLAYER_ACTOR closest_vehicle_to 0@ closest_ped_to 1@
 
Status
Not open for further replies.
Top