tieuthienthan
Active member
Hello there, I'm trying to make a hitmarker on my own. To do so, I need to find out when an actor is hit by $player_actor but now I'm in a mess because the opcode 051A is not working as expected.
What I've tried:
Using ForAllPeds by Opcodex:
I tried to use the provided memory in https://gtamods.com/wiki/Memory_Addresses_(SA)
Please help me to solve this. Every help is appreciated
SAMP version: 0.3DL
Test server:
HostName: [0.3.DL] ~ Koky's Deathmatch ~ kokysdm.net
Address: 185.198.188.101:7777
What I've tried:
Using ForAllPeds by Opcodex:
Code:
{$CLEO .cs}
wait 10000
while true
wait 0
ForAllPeds()
end
:ForAllPeds
0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 0
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
for 30@ = 0 to 35584 step 0x100
0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
000A: 29@ += 0x1
if and
0029: 31@ >= 0x00
001B: 0x80 > 31@
then
005A: 31@ += 30@ // got the ped
if or
856D: actor 31@ defined // actor not defined
003B: 31@ == $PLAYER_ACTOR // my ped
then
continue // skip
end
if
051A: actor 31@ damaged_by_actor $PLAYER_ACTOR
then
0AD1: "You're attacking someone" 1337
054E: clear_actor 31@ damage
end
end
end
return
I tried to use the provided memory in https://gtamods.com/wiki/Memory_Addresses_(SA)
- CPed +0x764 = [dword] Pointer to the ped that damaged you
Code:
{$CLEO .cs}
wait 10000
while true
wait 0
ForAllPeds()
end
:ForAllPeds
0A8D: 29@ = read_memory 0xB74490 size 4 virtual_protect 0
000A: 29@ += 0x4
0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
for 30@ = 0 to 35584 step 0x100
0A8D: 31@ = read_memory 29@ size 1 virtual_protect 0
000A: 29@ += 0x1
if and
0029: 31@ >= 0x00
001B: 0x80 > 31@
then
005A: 31@ += 30@ // got the ped
if or
856D: actor 31@ defined // actor not defined
003B: 31@ == $PLAYER_ACTOR // my ped
then
continue // skip
end
0A96: 24@ = actor 31@ struct
24@ += 0x764 // last damaged player
0A8D: 23@ = read_memory 24@ size 4 virtual_protect 0
if
003B: 23@ == $PLAYER_ACTOR
then
0AD1: "You're attacking someone" 1337
054E: clear_actor 31@ damage
end
end
end
return
Please help me to solve this. Every help is appreciated
SAMP version: 0.3DL
Test server:
HostName: [0.3.DL] ~ Koky's Deathmatch ~ kokysdm.net
Address: 185.198.188.101:7777
Last edited: