{$CLEO}   //   4
wait 0
while true
    wait 0
    if
        player.Defined($player_char)
    then
        if and
            $ONMISSION == 0
            actor.DrivingVehicleType($player_actor 525)
        then
            03C0: 0@ = actor $PLAYER_ACTOR car
            0A97: 5@ = car 0@ struct
            5@ += 0x4C8
            0A8D: 5@ = read_memory 5@ size 4 virtual_protect 0
            if
                5@ <= 0
            then
                if
                    0AB0: key_pressed 109 // "- num" -  
                then
                    car.StorePos(0@ 1@ 2@ 3@)
                    if
                        gosub @CHECK_CAR
                    then
                        0893: put_trailer 4@ on_cab 0@
                        0A30: repair_car 0@ 
                        0A30: repair_car 4@ 
                    end
                end
            end 
            if and
                0AB0: key_pressed 107 // "+ num" -  
                056E: car 4@ defined
            then
                if
                    07AB:   trailer 4@ attached_to_cab 0@ 
                then
                    07AC: detach_trailer 4@ from_cab 0@ 
                end                        
            end        
        end
    end
end

:CHECK_CAR
if
    0AE2: 4@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 15.0 find_next 0 pass_wrecked 1 //IF and SET
then
    repeat        
        if
            09CB:   vehicle 4@ colliding_with_vehicle 0@ 
        then
            0441: 7@ = car 4@ model
            0AA7: call_function 0x4c5aa0 num_params 1 pop 1 7@ 8@ // isModelCar
            0AA7: call_function 0x4c5c50 num_params 1 pop 1 7@ 9@ // isModelTrailer 
            if or
                8@ == true
                9@ == 8766721 // True     
            then
                0485: return_true                    
                return
            end
        end
    until 8AE2: not 4@ = random_vehicle_near_point 1@ 2@ 3@ in_radius 15.0 find_next 1 pass_wrecked 1 //IF and SET
end
8485: return_false
return