CLEO Help Damage Type

CLEO related
Status
Not open for further replies.

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Does any one know how to get damage type for single / multiplayer.
When Player Actor gets damage from collision return 1 or from weapon return 2 etc...
 

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
Does any one know how to get damage type for single / multiplayer.
When Player Actor gets damage from collision return 1 or from weapon return 2 etc...

According to this Documentary:
Code:
CPed +0x760 = [dword] Weapon you were damaged with
CPed +0x764 = [dword] Pointer to the ped that damaged you
Code:
{$CLEO}
0000: damage detector by AJOM

WHILE TRUE
    wait 0
    0A96: 0@ = actor $PLAYER_ACTOR struct
    0@ += 0x760 // Damaged By Weapon ID
    0A8D: 1@ = read_memory 0@ size 4 virtual_protect false
    0@ += 4 // Actor Struct of the Damage Dealer
    0A8D: 2@ = read_memory 0@ size 4 virtual_protect false
    if 1@ <> 255 // 255 = not Damaged
    then
        0AD1: show_formatted_text_highpriority "Damaged By~n~WeaponID: %d~n~Actor:%d" time 1000 1@ 2@
        0A8C: write_memory 0@ size 4 value 0 virtual_protect 0 // 0 = null actor pointer, AKA no actor damager
        0@ -= 4
        0A8C: write_memory 0@ size 4 value 255 virtual_protect 0 // 255 = not Damaged
    end
END
// Unique Weapon ID's:
// 37 - Any Fire Damage
// 49 - Vehicle Collision(when you get rammed by a vehicle)
// 50 - Helicopter Blades
// 51 - Vehicle Explosion
// 52 - Toxicated
// 53 - fall Collision, the damage dealer Actor is yourself($PLAYER_ACTOR)

That also works on other actors, incase you want to detect if a certain player/actor takes damage of a certain type.
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
According to this Documentary:
Code:
CPed +0x760 = [dword] Weapon you were damaged with
CPed +0x764 = [dword] Pointer to the ped that damaged you
Code:
{$CLEO}
0000: damage detector by AJOM

WHILE TRUE
    wait 0
    0A96: 0@ = actor $PLAYER_ACTOR struct
    0@ += 0x760 // Damaged By Weapon ID
    0A8D: 1@ = read_memory 0@ size 4 virtual_protect false
    0@ += 4 // Actor Struct of the Damage Dealer
    0A8D: 2@ = read_memory 0@ size 4 virtual_protect false
    if 1@ <> 255 // 255 = not Damaged
    then
        0AD1: show_formatted_text_highpriority "Damaged By~n~WeaponID: %d~n~Actor:%d" time 1000 1@ 2@
        0A8C: write_memory 0@ size 4 value 0 virtual_protect 0 // 0 = null actor pointer, AKA no actor damager
        0@ -= 4
        0A8C: write_memory 0@ size 4 value 255 virtual_protect 0 // 255 = not Damaged
    end
END
// Unique Weapon ID's:
// 37 - Any Fire Damage
// 49 - Vehicle Collision(when you get rammed by a vehicle)
// 50 - Helicopter Blades
// 51 - Vehicle Explosion
// 52 - Toxicated
// 53 - fall Collision, the damage dealer Actor is yourself($PLAYER_ACTOR)

That also works on other actors, incase you want to detect if a certain player/actor takes damage of a certain type.

Okay , so i tested and some id's are wrong..
Like:
fall Collision is = 54
Vehicle Explosion = 51 (was correct)
Burning damage = 37

if i understand right when you get weapon damage it return weapon id..

etc..
 
Last edited:
Status
Not open for further replies.
Top