Jump to content

[CLEO] [SNIPPET] Get other player vehicle health


Nic
 Share

Recommended Posts

Explicația:

Cu ajutorul acestui snippet puteti vedea hp-ul masinii altor jucatori din apropiere, acest snippet poate fi foarte bine implementat intr-un mod pentru mecanici, care ar urma sa dea /repair doar la cei cu HP-ul sub 950.

 

SAMP R1:

 

:GetVehicleHealthByID
{
    0.3.7 R1
    0AB1: @GetVehicleHealthByID 1 ID 995 _Returned: Health 0@
}
IF 0AA2: 31@ = loadLib "samp.dll" //samp base offset
THEN   
    31@ += 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 31@ = readmem 31@ sz 4 vp 0
    31@ += 0x3CD // SAMP_PPOOLS_OFFSET
    0A8D: 31@ = readmem 31@ sz 4 vp 0
    31@ += 0x1C // SAMP_PPOOL_VEHICLE_OFFSET
    0A8D: 31@ = readmem 31@ sz 4 vp 0
    31@ += 0x1134 // SAMP_VEHICLE_STRUCT_ELEMENT_OFFSET
    0@ *= 0x4
    005A: 31@ += 0@
    0A8D: 31@ readMem 31@ sz 4 vp 0
    IF 31@ > 0
    THEN
        31@ += 0x4C // SAMP_VEHICLE_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        31@ += 0x4C0 // SAMP_HEATLH_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        0AB2: ret 1 31@
    END
END
0AB2: ret 0

 

SAMP R2:
 

:GetVehicleHealthByID
{
    0.3.7 R2
    0AB1: @GetVehicleHealthByID 1 ID 995 _Returned: Health 0@
}
IF 0AA2: 31@ = loadLib "samp.dll" //samp base offset
THEN   
    31@ += 0x21A100 // SAMP_INFO_OFFSET
    0A8D: 31@ = readmem 31@ sz 4 vp 0
    31@ += 0x3C5 // SAMP_PPOOLS_OFFSET
    0A8D: 31@ = readmem 31@ sz 4 vp 0
    31@ += 0xC // SAMP_PPOOL_VEHICLE_OFFSET
    0A8D: 31@ = readmem 31@ sz 4 vp 0
    31@ += 0x1134 // SAMP_VEHICLE_STRUCT_ELEMENT_OFFSET
    0@ *= 0x4
    005A: 31@ += 0@
    0A8D: 31@ readMem 31@ sz 4 vp 0
    IF 31@ > 0
    THEN
        31@ += 0x4C // SAMP_VEHICLE_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        31@ += 0x4C0 // SAMP_HEATLH_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        0AB2: ret 1 31@
    END
END
0AB2: ret 0

 

Link to comment
Share on other sites

Desi exista 

0227: 4@ = car 22@ health

din experiente proprii stiu ca OPCODE-urile nu functioneaza chiar in toate situatiile si atunci trebuie sa abortezi metoda citirii din memorie pentru a determina anumite valori.

PS: Cred ca ai uitat sa lasi link ul sursa.

Link to comment
Share on other sites

Topic inactiv.

Mulțumim pentru SNIPPET !

 

:topic_closed:

Edited by Tupi
Link to comment
Share on other sites

  • Tupi 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.