SAMP Get Car Handle using Vehicle ID

Code:
:SAMPGetCarHandlebyVehicleID // if 0AB1: @SAMPGetCarHandlebyVehicleID 1 _OfVehicleID 0@ _StoreCarHandle 31@
if 0AA2: 31@ = load_dynamic_library "samp.dll" // pSAMPBase // no need to Free Memory
then
    31@ += 0x21A0F8
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // stSAMPInfo
    if 31@ > 0
    then
        31@ += 0x3CD
        0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // stSAMPPools
        if 31@ > 0
        then
            31@ += 0x1C
            0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // stVehiclePool
            if 31@ > 0
            then
                31@ += 0x1134 // pSAMP_Vehicle[0]
                0A90: 30@ = 0@ * 4
                005A: 31@ += 30@ // pSAMP_Vehicle[0@]
                0A8E: 30@ = 31@ + 8000 // iIsListed[0@]
                0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0 // iIsListed
                if 30@ == true
                then
                    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // pSAMP_Vehicle
                    if 31@ > 0
                    then
                        31@ += 0x44
                        0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // pGTA_VehicleHandle
                        if 056E: car 31@ defined
                        then
                            0485: return_true
                            ret 1 31@ // I now Got the Vehicle Handle
                        end
                    end
                end
            end
        end
    end
end
059A: return_false
ret 1 -1
Type the word BLINK, and you will teleport on Streamed Vehicle ID 1799
Code:
{$CLEO}
0000:

while true
    wait 0
    if 0ADC: test_cheat "BLINK"
    then
        if 0AB1: @SAMPGetCarHandlebyVehicleID 1 _OfVehicleID 1799 _StoreCarHandle 1@ // get car handle of streamed vehicle ID 1799
        then
            00AA: store_car 1@ position_to 0@ 1@ 2@
            00A1: put_actor $PLAYER_ACTOR at 0@ 1@ 2@
            0ACD: show_text_highpriority "~g~TP Successful!" time 1000
        else 0ACD: show_text_highpriority "~r~Car not Streamed!" time 1000
        end
    end
end
 
Last edited:
Top