[SNIPPET] ForAllCars

You want to make a CarCheat but cant get Cars? Use this snippet:

Code:
// FOR ALL CARS
// ALL CARS WILL EXPLODE BY PRESSING X
:X
wait 0
if
0AB0: X
jf [member=32140]x[/member]
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.
      020B: explode_car 31@ 
    end
end
// FOR ALLCARS END
jump [member=32140]x[/member]
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Re: ForAllCars

[member=23473]Grubitsh[/member]
I think it would be easier to assess what went wrong if you posted the code
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,161
Solutions
5
Reaction score
894
Location
Lithuania
Example:
PHP:
if
00DF:   actor $PLAYER_ACTOR driving
then
    if
    0AB1: @GetClosestVehicle 0 31@
    then
        00AA: store_car 31@ position_to 26@ 27@ 28@
        06D5: 29@ = create_racing_checkpoint_at 26@ 27@ 28@ point_to 26@ 27@ 28@ type 2 radius 1.0
        wait 5000
        06D6: disable_racing_checkpoint 29@
    end
end

Snippet:
PHP:
:GetClosestVehicle
20@ = 9999.0
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@
        if
        00DF:   actor $PLAYER_ACTOR driving
        then
            03C0: 1@ = actor $PLAYER_ACTOR car
        else
            1@ = -1
        end
        if and
        056E:   car 31@ defined
        803B:   31@ == 1@ // not my car
        then
            if
            00DF:   actor $PLAYER_ACTOR driving
            then
                0407: store_coords_to 4@ 5@ 6@ from_car 1@ with_offset 0.0 0.0 0.0
            else
                04C4: store_coords_to 4@ 5@ 6@ from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0
            end
            0407: store_coords_to 7@ 8@ 9@ from_car 31@ with_offset 0.0 0.0 0.0
            0509: 10@ = distance_between_XY 4@ 5@ and_XY 7@ 8@
            if
            0025:   20@ > 10@  // (float)
            then
                0087: 20@ = 10@ // (float)
                8085: 2@ = 31@ // (int)
            end
        end
    end
end
if
056E:   car 2@ defined
then
    0485:  return_true
else
    059A:  return_false
end
0AB2: ret 1 2@
 
Last edited:
Top