Code:
:SAMPGetPlayerIDByActorHandle // 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 0@ _StorePlayerID 25@
25@ = -1
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@ += 0x18
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // stPlayerPool
if 31@ > 0
then
if 07D6: 0@ == $PLAYER_ACTOR
then
31@ += 0x4
0A8D: 25@ = read_memory 31@ size 2 virtual_protect 0 // sLocalPlayerID
else
0A96: 26@ = ped 0@ struct
0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // ulMaxPlayerIDStreamedOnly
31@ += 0x2E // pRemotePlayer[0]
0A8E: 29@ = 31@ + 0xFB0 // iIsListed[0]
for 28@ = 0 to 30@
0A8D: 27@ = read_memory 29@ size 4 virtual_protect 0 // iIsListed[n]
if 27@ == true
then
0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // pRemotePlayer
if 27@ > 0
then
0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0 // pPlayerData
if 27@ > 0
then
0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0 // pSAMP_Actor
if 27@ > 0
then
27@ += 0x40
0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0 // pGTA_Ped
if 003B: 26@ == 27@ // Same Ped
then
0085: 25@ = 28@ // save this Player ID
break
end
end
end
end
end
// next index
31@ += 0x4
29@ += 0x4
//
end
end
end
end
end
end
if 25@ >= 0
then 0485: return_true
else 059A: return_false
end
0AB2: cleo_return 1 25@
Code:
{$CLEO}
0000:
while true
wait 0
if 0AD2: 0@ = player $PLAYER_CHAR targeted_actor // IF and SET
then
if 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 0@ _StorePlayerID 31@
then 0AD1: show_formatted_text_highpriority "Targeted Actor's SAMP ID is %d" time 100 31@
else 0ACD: show_text_highpriority "Targeted Actor have no SAMP ID" time 100
end
else
if 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle $PLAYER_ACTOR _StorePlayerID 31@
then 0AD1: show_formatted_text_highpriority "Your SAMP ID is %d" time 100 31@
else 0ACD: show_text_highpriority "Your have no SAMP ID" time 100
end
end
end