Jump to content

[CLEO] [SNIPPET] GetCarHandeFromSAMPVehicleID


Tupi
 Share

Recommended Posts

Snippet:

:SAMPGetCarHandlebyVehicleID
if 0AA2: 31@ = load_samp_library "samp.dll" // pSAMPBase
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

 

Exemplu: 

{$CLEO}

0000:
repeat
wait 50
until 0AFA:

0B34: "command" @command

WHILE TRUE
WAIT 0
END

:command
if 0AB1: @SAMPGetCarHandlebyVehicleID 1 _OfSAMPVehicleID 1000 _StoreCarHandleTo 0@
then
       00DB:   actor $PLAYER_ACTOR in_car 0@
       0ACD: show_text_highpriority "~g~TELEPORTED" time 1000
else 0ACD: show_text_highpriority "~r~Car not in your stream!" time 1000
end
SAMP.CmdRet

 

Explicația:

Snippet-ul cauta car handle-ul masinii pentru vehiculul cu ID-ul introdus de catre voi in toate vehiculele din raza voastra pe 350 unitati.

Acest snippet poate fi folosit intr-o multitudine de situații, când avem nevoie sa ne teleportam la pozitia ei, sa ne teleporteze in masina respectiva, sa ii aflam culorile, sa ii schimbam culorile, etc.

 

Sursa

Edited by Tupi
Link to comment
Share on other sites

  • Nic locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.