SAMP Get Player ID Using Actor Handle

Code:
:SAMPGetPlayerIDByActorHandle
{
    0.3.7 R1
    IF 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 0@ _Returned: ID 31@
}
IF 0AA2: 31@ = loadlib "samp.dll" // GET_SAMP_BASE
THEN
    31@ += 0x21A0F8 // SAMP_INFO_OFFSET[0]
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_INFO
    IF 31@ > 0
    THEN
        31@ += 0x3CD // SAMP_POOLS_OFFSET[0]
        0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_POOLS_OFFSET
        IF 31@ > 0
        THEN
            31@ += 0x18 // PLAYER_POOLS_OFFSET[0]
            0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // PLAYER_POOLS
            IF 31@ > 0
            THEN
                IF 003B: 0@ == $PLAYER_ACTOR // COMPARE_HANDLE_WHICH_WAS_GIVEN
                THEN
                    0A8E: 30@ = 31@ + 0x4 // LOCAL_PLAYER_ID_OFFSET[0]
                    0A8D: 28@ = read_memory 30@ size 2 virtual_protect 0 // LOCAL_PLAYER_ID
                    0AB2: RET 1 28@
                ELSE
                    0A8E: 29@ = 31@ + 0x0 // MAX_PLAYER_ID_STREAMED_ONLY_OFFSET[0]
                    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0 // MAX_PLAYER_ID_STREAMED_ONLY
                    FOR 28@ = 0 TO 29@ // FROM "0" TO "MAX_PLAYER_ID_STREAMED_ONLY"
                        27@ = 0x4 // SAVE VARIABLE "27@" AS DIGIT "4"
                        006A: 27@ *= 28@ // 4 * ID
                        0A8E: 26@ = 31@ + 0x2E // SAVE TO NEW "26@" VARIABLE "PLAYER_POOLS" + "REMOTE_PLAYER_OFFSET[0]"
                        005A: 26@ += 27@ // REMOTE_PLAYER_OFFSET + 4 * ID
                        0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // REMOTE_PLAYER
                        IF 26@ > 0
                        THEN
                            26@ += 0x0 // PLAYER_DATA_OFFSET[0]
                            0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // PLAYER_DATA
                            IF 26@ > 0
                            THEN
                                26@ += 0x0 // SAMP_ACTOR_OFFSET[0]
                                0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // SAMP_ACTOR
                                IF 26@ > 0
                                THEN
                                    26@ += 0x44 // GTA_PED_HANDLE_OFFSET[0]
                                    0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // GTA_PED_HANDLE
                                    IF 26@ > 0
                                    THEN
                                        IF 003B: 0@ == 26@ // COMPARE_HANDLE_WHICH_WAS_GIVEN
                                        THEN
                                            0485: RETURN_TRUE
                                            0AB2: RET 1 28@
                                        END
                                    END
                                END
                            END
                        END
                    END
                END
            END
        END
    END
END
059A: RETURN_FALSE
0AB2: RET 0
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@ _Returned: ID 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 0@ _Returned: ID 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
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
0.3.7 - R2
PHP:
:SAMPGetPlayerIDByActorHandle
{
    0.3.7 R2
    IF 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 0@ _Returned: ID 31@
}
IF 0AA2: 31@ = loadlib "samp.dll" // GET_SAMP_BASE
THEN
    31@ += 0x21A100 // SAMP_INFO_OFFSET[0]
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_INFO
    IF 31@ > 0
    THEN
        31@ += 0x3C5 // SAMP_POOLS_OFFSET[0]
        0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_POOLS_OFFSET
        IF 31@ > 0
        THEN
            31@ += 0x8 // PLAYER_POOLS_OFFSET[0]
            0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // PLAYER_POOLS
            IF 31@ > 0
            THEN
                IF 003B: 0@ == $PLAYER_ACTOR // COMPARE_HANDLE_WHICH_WAS_GIVEN
                THEN
                    0A8E: 30@ = 31@ + 0x0 // LOCAL_PLAYER_ID_OFFSET[0]
                    0A8D: 28@ = read_memory 30@ size 2 virtual_protect 0 // LOCAL_PLAYER_ID
                    0AB2: RET 1 28@
                ELSE
                    0A8E: 29@ = 31@ + 0x22 // MAX_PLAYER_ID_STREAMED_ONLY_OFFSET[0]
                    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0 // MAX_PLAYER_ID_STREAMED_ONLY
                    FOR 28@ = 0 TO 29@ // FROM "0" TO "MAX_PLAYER_ID_STREAMED_ONLY"
                        27@ = 0x4 // SAVE VARIABLE "27@" AS DIGIT "4"
                        006A: 27@ *= 28@ // 4 * ID
                        0A8E: 26@ = 31@ + 0x26 // SAVE TO NEW "26@" VARIABLE "PLAYER_POOLS" + "REMOTE_PLAYER_OFFSET[0]"
                        005A: 26@ += 27@ // REMOTE_PLAYER_OFFSET + 4 * ID
                        0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // REMOTE_PLAYER
                        IF 26@ > 0
                        THEN
                            26@ += 0xC // PLAYER_DATA_OFFSET[0]
                            0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // PLAYER_DATA
                            IF 26@ > 0
                            THEN
                                26@ += 0x1C // SAMP_ACTOR_OFFSET[0]
                                0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // SAMP_ACTOR
                                IF 26@ > 0
                                THEN
                                    26@ += 0x44 // GTA_PED_HANDLE_OFFSET[0]
                                    0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // GTA_PED_HANDLE
                                    IF 26@ > 0
                                    THEN
                                        IF 003B: 0@ == 26@ // COMPARE_HANDLE_WHICH_WAS_GIVEN
                                        THEN
                                            0485: RETURN_TRUE
                                            0AB2: RET 1 28@
                                        END
                                    END
                                END
                            END
                        END
                    END
                END
            END
        END
    END
END
059A: RETURN_FALSE
0AB2: RET 0
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
0.3.7 - R3
PHP:
:SAMPGetPlayerIDByActorHandle
{
    0.3.7 R3
    IF 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 0@ _Returned: ID 31@
}
IF 0AA2: 31@ = loadlib "samp.dll" // GET_SAMP_BASE
THEN
    31@ += 0x26E8DC // SAMP_INFO_OFFSET[0]
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_INFO
    IF 31@ > 0
    THEN
        31@ += 0x3DE // SAMP_POOLS_OFFSET[0]
        0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_POOLS_OFFSET
        IF 31@ > 0
        THEN
            31@ += 0x8 // PLAYER_POOLS_OFFSET[0]
            0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // PLAYER_POOLS
            IF 31@ > 0
            THEN
                IF 003B: 0@ == $PLAYER_ACTOR // COMPARE_HANDLE_WHICH_WAS_GIVEN
                THEN
                    0A8E: 30@ = 31@ + 0x2F1C // LOCAL_PLAYER_ID_OFFSET[0]
                    0A8D: 28@ = read_memory 30@ size 2 virtual_protect 0 // LOCAL_PLAYER_ID
                    0AB2: RET 1 28@
                ELSE
                    0A8E: 29@ = 31@ + 0x0 // MAX_PLAYER_ID_STREAMED_ONLY_OFFSET[0]
                    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0 // MAX_PLAYER_ID_STREAMED_ONLY
                    FOR 28@ = 0 TO 29@ // FROM "0" TO "MAX_PLAYER_ID_STREAMED_ONLY"
                        27@ = 0x4 // SAVE VARIABLE "27@" AS DIGIT "4"
                        006A: 27@ *= 28@ // 4 * ID
                        0A8E: 26@ = 31@ + 0x4 // SAVE TO NEW "26@" VARIABLE "PLAYER_POOLS" + "REMOTE_PLAYER_OFFSET[0]"
                        005A: 26@ += 27@ // REMOTE_PLAYER_OFFSET + 4 * ID
                        0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // REMOTE_PLAYER
                        IF 26@ > 0
                        THEN
                            26@ += 0x0 // PLAYER_DATA_OFFSET[0]
                            0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // PLAYER_DATA
                            IF 26@ > 0
                            THEN
                                26@ += 0x0 // SAMP_ACTOR_OFFSET[0]
                                0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // SAMP_ACTOR
                                IF 26@ > 0
                                THEN
                                    26@ += 0x44 // GTA_PED_HANDLE_OFFSET[0]
                                    0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // GTA_PED_HANDLE
                                    IF 26@ > 0
                                    THEN
                                        IF 003B: 0@ == 26@ // COMPARE_HANDLE_WHICH_WAS_GIVEN
                                        THEN
                                            0485: RETURN_TRUE
                                            0AB2: RET 1 28@
                                        END
                                    END
                                END
                            END
                        END
                    END
                END
            END
        END
    END
END
059A: RETURN_FALSE
0AB2: RET 0
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
0.3.DL
PHP:
:SAMPGetPlayerIDByActorHandle
{
    0.3.DL
    IF 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 0@ _Returned: ID 31@
}
IF 0AA2: 31@ = loadlib "samp.dll" // GET_SAMP_BASE
THEN
    31@ += 0x2ACA24 // SAMP_INFO_OFFSET[0]
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_INFO
    IF 31@ > 0
    THEN
        31@ += 0x3DE // SAMP_POOLS_OFFSET[0]
        0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_POOLS_OFFSET
        IF 31@ > 0
        THEN
            31@ += 0x8 // PLAYER_POOLS_OFFSET[0]
            0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // PLAYER_POOLS
            IF 31@ > 0
            THEN
                IF 003B: 0@ == $PLAYER_ACTOR // COMPARE_HANDLE_WHICH_WAS_GIVEN
                THEN
                    0A8E: 30@ = 31@ + 0x0 // LOCAL_PLAYER_ID_OFFSET[0]
                    0A8D: 28@ = read_memory 30@ size 2 virtual_protect 0 // LOCAL_PLAYER_ID
                    0AB2: RET 1 28@
                ELSE
                    0A8E: 29@ = 31@ + 0x22 // MAX_PLAYER_ID_STREAMED_ONLY_OFFSET[0]
                    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0 // MAX_PLAYER_ID_STREAMED_ONLY
                    FOR 28@ = 0 TO 29@ // FROM "0" TO "MAX_PLAYER_ID_STREAMED_ONLY"
                        27@ = 0x4 // SAVE VARIABLE "27@" AS DIGIT "4"
                        006A: 27@ *= 28@ // 4 * ID
                        0A8E: 26@ = 31@ + 0x26 // SAVE TO NEW "26@" VARIABLE "PLAYER_POOLS" + "REMOTE_PLAYER_OFFSET[0]"
                        005A: 26@ += 27@ // REMOTE_PLAYER_OFFSET + 4 * ID
                        0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // REMOTE_PLAYER
                        IF 26@ > 0
                        THEN
                            26@ += 0x8 // PLAYER_DATA_OFFSET[0]
                            0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // PLAYER_DATA
                            IF 26@ > 0
                            THEN
                                26@ += 0x4 // SAMP_ACTOR_OFFSET[0]
                                0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // SAMP_ACTOR
                                IF 26@ > 0
                                THEN
                                    26@ += 0x44 // GTA_PED_HANDLE_OFFSET[0]
                                    0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // GTA_PED_HANDLE
                                    IF 26@ > 0
                                    THEN
                                        IF 003B: 0@ == 26@ // COMPARE_HANDLE_WHICH_WAS_GIVEN
                                        THEN
                                            0485: RETURN_TRUE
                                            0AB2: RET 1 28@
                                        END
                                    END
                                END
                            END
                        END
                    END
                END
            END
        END
    END
END
059A: RETURN_FALSE
0AB2: RET 0
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
0.3.7 R4 - v1
PHP:
:SAMPGetPlayerIDByActorHandle
{
    0.3.7 R4 - v1
    IF 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 0@ _Returned: ID 31@
}
IF 0AA2: 31@ = loadlib "samp.dll" // GET_SAMP_BASE
THEN
    31@ += 0x26EA0C // SAMP_INFO_OFFSET[0]
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_INFO
    IF 31@ > 0
    THEN
        31@ += 0x3DE // SAMP_POOLS_OFFSET[0]
        0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_POOLS_OFFSET
        IF 31@ > 0
        THEN
            31@ += 0x8 // PLAYER_POOLS_OFFSET[0]
            0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // PLAYER_POOLS
            IF 31@ > 0
            THEN
                IF 003B: 0@ == $PLAYER_ACTOR // COMPARE_HANDLE_WHICH_WAS_GIVEN
                THEN
                    0A8E: 30@ = 31@ + 0xC // LOCAL_PLAYER_ID_OFFSET[0]
                    0A8D: 28@ = read_memory 30@ size 2 virtual_protect 0 // LOCAL_PLAYER_ID
                    0AB2: RET 1 28@
                ELSE
                    0A8E: 29@ = 31@ + 0x0 // MAX_PLAYER_ID_STREAMED_ONLY_OFFSET[0]
                    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0 // MAX_PLAYER_ID_STREAMED_ONLY
                    FOR 28@ = 0 TO 29@ // FROM "0" TO "MAX_PLAYER_ID_STREAMED_ONLY"
                        27@ = 0x4 // SAVE VARIABLE "27@" AS DIGIT "4"
                        006A: 27@ *= 28@ // 4 * ID
                        0A8E: 26@ = 31@ + 0x2E // SAVE TO NEW "26@" VARIABLE "PLAYER_POOLS" + "REMOTE_PLAYER_OFFSET[0]"
                        005A: 26@ += 27@ // REMOTE_PLAYER_OFFSET + 4 * ID
                        0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // REMOTE_PLAYER
                        IF 26@ > 0
                        THEN
                            26@ += 0x10 // PLAYER_DATA_OFFSET[0]
                            0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // PLAYER_DATA
                            IF 26@ > 0
                            THEN
                                26@ += 0x1DD // SAMP_ACTOR_OFFSET[0]
                                0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // SAMP_ACTOR
                                IF 26@ > 0
                                THEN
                                    26@ += 0x44 // GTA_PED_HANDLE_OFFSET[0]
                                    0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // GTA_PED_HANDLE
                                    IF 26@ > 0
                                    THEN
                                        IF 003B: 0@ == 26@ // COMPARE_HANDLE_WHICH_WAS_GIVEN
                                        THEN
                                            0485: RETURN_TRUE
                                            0AB2: RET 1 28@
                                        END
                                    END
                                END
                            END
                        END
                    END
                END
            END
        END
    END
END
059A: RETURN_FALSE
0AB2: RET 0
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:SAMPGetPlayerIDByActorHandle
{
    0.3.7 R4 - v2
    IF 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 0@ _Returned: ID 31@
}
IF 0AA2: 31@ = loadlib "samp.dll" // GET_SAMP_BASE
THEN
    31@ += 0x26EA0C // SAMP_INFO_OFFSET[0]
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_INFO
    IF 31@ > 0
    THEN
        31@ += 0x3DE // SAMP_POOLS_OFFSET[0]
        0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_POOLS_OFFSET
        IF 31@ > 0
        THEN
            31@ += 0x4 // PLAYER_POOLS_OFFSET[0]
            0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // PLAYER_POOLS
            IF 31@ > 0
            THEN
                IF 003B: 0@ == $PLAYER_ACTOR // COMPARE_HANDLE_WHICH_WAS_GIVEN
                THEN
                    0A8E: 30@ = 31@ + 0x4 // LOCAL_PLAYER_ID_OFFSET[0]
                    0A8D: 28@ = read_memory 30@ size 2 virtual_protect 0 // LOCAL_PLAYER_ID
                    0AB2: RET 1 28@
                ELSE
                    0A8E: 29@ = 31@ + 0x2F3A // MAX_PLAYER_ID_STREAMED_ONLY_OFFSET[0]
                    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0 // MAX_PLAYER_ID_STREAMED_ONLY
                    FOR 28@ = 0 TO 29@ // FROM "0" TO "MAX_PLAYER_ID_STREAMED_ONLY"
                        27@ = 0x4 // SAVE VARIABLE "27@" AS DIGIT "4"
                        006A: 27@ *= 28@ // 4 * ID
                        0A8E: 26@ = 31@ + 0x1F8A // SAVE TO NEW "26@" VARIABLE "PLAYER_POOLS" + "REMOTE_PLAYER_OFFSET[0]"
                        005A: 26@ += 27@ // REMOTE_PLAYER_OFFSET + 4 * ID
                        0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // REMOTE_PLAYER
                        IF 26@ > 0
                        THEN
                            26@ += 0x10 // PLAYER_DATA_OFFSET[0]
                            0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // PLAYER_DATA
                            IF 26@ > 0
                            THEN
                                26@ += 0x1DD // SAMP_ACTOR_OFFSET[0]
                                0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // SAMP_ACTOR
                                IF 26@ > 0
                                THEN
                                    26@ += 0x44 // GTA_PED_HANDLE_OFFSET[0]
                                    0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // GTA_PED_HANDLE
                                    IF 26@ > 0
                                    THEN
                                        IF 003B: 0@ == 26@ // COMPARE_HANDLE_WHICH_WAS_GIVEN
                                        THEN
                                            0485: RETURN_TRUE
                                            0AB2: RET 1 28@
                                        END
                                    END
                                END
                            END
                        END
                    END
                END
            END
        END
    END
END
059A: RETURN_FALSE
0AB2: RET 0
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:SAMPGetPlayerIDByActorHandle
{
    0.3.7 R5
    IF 0AB1: @SAMPGetPlayerIDByActorHandle 1 _ActorHandle 0@ _Returned: ID 31@
}
IF 0AA2: 31@ = loadlib "samp.dll" // GET_SAMP_BASE
THEN
    31@ += 0x26EB94 // SAMP_INFO_OFFSET[0]
    0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_INFO
    IF 31@ > 0
    THEN
        31@ += 0x3DE // SAMP_POOLS_OFFSET[0]
        0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // SAMP_POOLS_OFFSET
        IF 31@ > 0
        THEN
            31@ += 0x4 // PLAYER_POOLS_OFFSET[0]
            0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0 // PLAYER_POOLS
            IF 31@ > 0
            THEN
                IF 003B: 0@ == $PLAYER_ACTOR // COMPARE_HANDLE_WHICH_WAS_GIVEN
                THEN
                    0A8E: 30@ = 31@ + 0x4 // LOCAL_PLAYER_ID_OFFSET[0]
                    0A8D: 28@ = read_memory 30@ size 2 virtual_protect 0 // LOCAL_PLAYER_ID
                    0AB2: RET 1 28@
                ELSE
                    0A8E: 29@ = 31@ + 0x2F3A // MAX_PLAYER_ID_STREAMED_ONLY_OFFSET[0]
                    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0 // MAX_PLAYER_ID_STREAMED_ONLY
                    FOR 28@ = 0 TO 29@ // FROM "0" TO "MAX_PLAYER_ID_STREAMED_ONLY"
                        27@ = 0x4 // SAVE VARIABLE "27@" AS DIGIT "4"
                        006A: 27@ *= 28@ // 4 * ID
                        0A8E: 26@ = 31@ + 0x1F8A // SAVE TO NEW "26@" VARIABLE "PLAYER_POOLS" + "REMOTE_PLAYER_OFFSET[0]"
                        005A: 26@ += 27@ // REMOTE_PLAYER_OFFSET + 4 * ID
                        0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // REMOTE_PLAYER
                        IF 26@ > 0
                        THEN
                            26@ += 0x10 // PLAYER_DATA_OFFSET[0]
                            0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // PLAYER_DATA
                            IF 26@ > 0
                            THEN
                                26@ += 0x1DD // SAMP_ACTOR_OFFSET[0]
                                0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // SAMP_ACTOR
                                IF 26@ > 0
                                THEN
                                    26@ += 0x44 // GTA_PED_HANDLE_OFFSET[0]
                                    0A8D: 26@ = read_memory 26@ size 4 virtual_protect 0 // GTA_PED_HANDLE
                                    IF 26@ > 0
                                    THEN
                                        IF 003B: 0@ == 26@ // COMPARE_HANDLE_WHICH_WAS_GIVEN
                                        THEN
                                            0485: RETURN_TRUE
                                            0AB2: RET 1 28@
                                        END
                                    END
                                END
                            END
                        END
                    END
                END
            END
        END
    END
END
059A: RETURN_FALSE
0AB2: RET 0
 

SamThapa

Active member
Joined
Jan 22, 2018
Messages
78
Reaction score
1
is there any way to get automatic server version ID like r1, r2, r3, r4 no need to use different script for different version ?

and in 1 script get player handle from ID and get player id from player handle it will be useful script really and thanks :)
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
is there any way to get automatic server version ID like r1, r2, r3, r4 no need to use different script for different version ?

and in 1 script get player handle from ID and get player id from player handle it will be useful script really and thanks :)
 
Top