CLEO Help Check for a car in a specific location

CLEO related
Status
Not open for further replies.

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Hi, how can I check if there's a car (or a specific car model) in specific location?
I tried something like this but the game crashes. Thanks

Code:
{$CLEO}

0000: NOP 
                            
:Check
wait 0
if and
0AB0:   key_pressed 50
01AD:   car 1@ sphere 1 near_point 2491.257 -1681.5 radius 6.0 6.0 
jf @Check
0AD0: show_formatted_text_lowpriority ":)" time 1000
jump @Check
 

pepeelpubero

Well-known member
Joined
Jan 21, 2014
Messages
433
Reaction score
1
Try with this it must work. If you want to know what are you doing with this code, compile this then decompile after the compile but don't use the original source code.

Code:
{$CLEO}

0000: NOP 
                            
while true
wait 0
if and 
0AB0: 50 
0AE2: 31@ = random_vehicle_near_point 2491.257 -1681.5 13.0 in_radius 6.0 6.0 find_next 1 pass_wrecked 1
then
0ACD: show_text_highpriority ":)" time 1000
end
end
 

blackHat

Expert
Joined
Jul 28, 2013
Messages
930
Reaction score
2
USE THIS TO GET ALL CARS AROUND YOU


Code:
:START
wait 0
if 
0AB0:   key_pressed 49 //1
jf @START
//this is forallcars snippet
0A8D: 29@ = read_memory 0xB74494 size 4 virtual_protect 0
29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
for 30@ = 0 to 27904 step 0x100
    0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
    000A: 29@ += 0x1
    if and
        0029: 31@ >= 0x00 
        001B: 0x80 > 31@
    then
        005A: 31@ += 30@
        // GOT THE CAR = 31@
      //now do something with it 
   if
0137:   car 31@ model == #BULLET
then
//do what you want here :)

  


end // car model check end 
    end //don't remove this , it is snippet end
end //don't remove this , it is snippet end
jump @START
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
272
Code:
WHILE TRUE
    wait 0
    if
        0AE2: 0@ = random_car_near_point  2491.257 -1681.5 13.0 in_radius 100.0 find_next 0 pass_wrecked 1
    then 
        repeat
            if 
                0137:   car 0@ model == 411 
            then
                00AA: store_car 0@ position_to 1@ 2@ 3@ 
                0AD1: "%0.2f %0.2f %0.2f" 1000 1@ 2@ 3@
            end
        until 8AE2:   not   0@ = random_car_near_point 2491.257 -1681.5 13.0 in_radius 100.0 find_next 1 pass_wrecked 1
    end
end
 
Status
Not open for further replies.
Top