Jump to content

[SA] CLEO. Is there a way to find a certain object near player ? [Solved]


vladvo

Recommended Posts

Like, for example, find a trashcan within 20.0 radius and get its handle. Something like when you search for nearby peds and cars.

Update. Solved.
 

:get_magnet
wait 0
00A0: store_actor $PLAYER_ACTOR position_to 4@ 5@ 6@
0AE3: 10@ = random_object_near_point 4@ 5@ 6@ in_radius 15.0 find_next 1 //IF and SET
if 03CA:   object 10@ exists
then 
    0984: 11@ = object 10@ model
        if 11@ == 3053
        then
        jump @next_action
        else
        jump @get_magnet
        end
end
jump @get_magnet

Even better with 09CC:   object 10@ model_is %%%

:get_magnet
wait 0
00A0: store_actor $PLAYER_ACTOR position_to 4@ 5@ 6@
0AE3: 10@ = random_object_near_point 4@ 5@ 6@ in_radius 15.0 find_next 1 //IF and SET
if 03CA:   object 10@ exists
jf @get_magnet
if 09CC:   object 10@ model_is 3053
jf @get_magnet
jump @next_action

 

Edited by vladvo
Link to comment
Share on other sites

4 hours ago, vladvo said:

Something like when you search for nearby peds and cars

I've came across with this mod once on the internet and it was showing me all nearby parked and traffic vehicles..

 

// This file was decompiled using SASCM.ini published on 2021-07-05
{$CLEO .cs}

0000: NOP 

:NONAME_2
wait 0 
Actor.StorePos($PLAYER_ACTOR, 1@, 2@, 3@)
03F0: enable_text_draw 1 
if 
get_random_car_in_sphere_no_save_recursive 0@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 5000.0 find_next 0 pass_wrecked 0 
jf @NONAME_245 
10@ = 0 

:NONAME_65
if 
get_random_car_in_sphere_no_save_recursive 0@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 5000.0 find_next 1 pass_wrecked 0 
jf @NONAME_224 
if 
02CA:   car 0@ bounding_sphere_visible 
jf @NONAME_224 
Car.StorePos(0@, 1@, 2@, 3@)
6@ = Car.Model(0@)
get_name_of_vehicle_model 6@s = vehicle_model 6@ 
cleo_call @NONAME_252 3 1@ 2@ 3@ 4@ 5@ 
0342: set_text_draw_centered 1 
081C: draw_text_outline 1 RGBA 0 0 0 175 
0340: set_text_draw_RGBA 255 255 255 175 
033F: set_text_draw_letter_size 0.3 1.1 
033E: set_draw_text_position 4@ 5@ GXT 6@s 

:NONAME_224
10@ += 1 
  10@ > 80 
jf @NONAME_65 

:NONAME_245
jump @NONAME_2 

:NONAME_252
call_function_return 7392816 num_params 6 pop 6 1 1 7@s 6@s 2@s 0@s 29@ 
0073: 2@ /= 6@ // (float) 
0073: 2@ /= 4@ // (float) 
0073: 3@ /= 7@ // (float) 
0073: 3@ /= 4@ // (float) 
2@ *= 640.0 
3@ *= 448.0 
cleo_return 2 2@ 3@ 

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.