[CLEO] Some snippets

Status
Not open for further replies.

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
OPCODE:
0B50: samp 2@ = object_handle_by_id 1@
Without SAMPFUNCS

~ Samp Object ~


0.3.7 - R1
PHP:
:SAMPGetObjectHandleByID
{
    0.3.7 - R1
    SAMP_MAX_OBJECTS = 1000
    0AB1: @SAMPGetObjectHandleByID 1 ObjectID 1249 _Returned: Handle 0@
}
IF 0AA2: 31@ = "samp.dll"
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@ += 0x4 // SAMP_PPOOL_OBJECT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // OBJECT_ID * 0x4
    0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
    005A: 31@ += 0@
    0A8D: 30@ = readMem 31@ sz 4 vp 0
    IF 30@ > 0
    THEN
        30@ += 0x44 // SAMP_OBJECT_HANDLE_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0
        IF 30@ > 0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: ret 1 30@

0.3.7 - R2
PHP:
:SAMPGetObjectHandleByID
{
    0.3.7 - R2
    SAMP_MAX_OBJECTS = 1000
    0AB1: @SAMPGetObjectHandleByID 1 ObjectID 1249 _Returned: Handle 0@
}
IF 0AA2: 31@ = "samp.dll"
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@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // OBJECT_ID * 0x4
    0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
    005A: 31@ += 0@
    0A8D: 30@ = readMem 31@ sz 4 vp 0
    IF 30@ > 0
    THEN
        30@ += 0x44 // SAMP_OBJECT_HANDLE_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0
        IF 30@ > 0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: ret 1 30@

0.3.7 - R3
PHP:
:SAMPGetObjectHandleByID
{
    0.3.7 - R3
    SAMP_MAX_OBJECTS = 1000
    0AB1: @SAMPGetObjectHandleByID 1 ObjectID 1249 _Returned: Handle 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26E8DC // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // OBJECT_ID * 0x4
    0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
    005A: 31@ += 0@
    0A8D: 30@ = readMem 31@ sz 4 vp 0
    IF 30@ > 0
    THEN
        30@ += 0x44 // SAMP_OBJECT_HANDLE_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0
        IF 30@ > 0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: ret 1 30@

0.3.DL
PHP:
:SAMPGetObjectHandleByID
{
    0.3.DL
    SAMP_MAX_OBJECTS = 2100
    0AB1: @SAMPGetObjectHandleByID 1 ObjectID 1249 _Returned: Handle 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x2ACA24 // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // OBJECT_ID * 0x4
    0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
    005A: 31@ += 0@
    0A8D: 30@ = readMem 31@ sz 4 vp 0
    IF 30@ > 0
    THEN
        30@ += 0x44 // SAMP_OBJECT_HANDLE_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0
        IF 30@ > 0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: ret 1 30@

0.3.7 - R4
PHP:
:SAMPGetObjectHandleByID
{
    0.3.7 - R4  
    SAMP_MAX_OBJECTS = 1000
    0AB1: @SAMPGetObjectHandleByID 1 ObjectID 1249 _Returned: Handle 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // OBJECT_ID * 0x4
    0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
    005A: 31@ += 0@
    0A8D: 30@ = readMem 31@ sz 4 vp 0
    IF 30@ > 0
    THEN
        30@ += 0x44 // SAMP_OBJECT_HANDLE_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0
        IF 30@ > 0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: ret 1 30@
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
OPCODE:
0B46: samp 3d_text 1@ defined
0C46: samp get_3d_text_info_by_id 0@ string_ptr 1@ color 2@ position 3@ 4@ 5@ view_distance 6@ show_behind_walls 7@ attached_to_player 8@ attached_to_vehicle 9@
Without SAMPFUNCS

~ Samp 3D Text ~


0.3.7 - R1
PHP:
:SAMPIs3dTextDefined
{
    0.3.7 - R1
    0AB1: @SAMPIs3dTextDefined 1 3dTextID 1249
}
IF 0AA2: 31@ = "samp.dll"
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@ += 0xC // SAMP_PPOOL_3D_TEXT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // 3D_TEXT_ID * 0x4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0xE800 // SAMP_3D_TEXT_DEFINED_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    IF 30@ > 0
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: ret 0

0.3.7 - R2
PHP:
:SAMPIs3dTextDefined
{
    0.3.7 - R2
    0AB1: @SAMPIs3dTextDefined 1 3dTextID 1249
}
IF 0AA2: 31@ = "samp.dll"
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@ += 0x1C // SAMP_PPOOL_3D_TEXT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // 3D_TEXT_ID * 0x4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0xE800 // SAMP_3D_TEXT_DEFINED_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    IF 30@ > 0
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: ret 0

0.3.7 - R3
PHP:
:SAMPIs3dTextDefined
{
    0.3.7 - R3
    0AB1: @SAMPIs3dTextDefined 1 3dTextID 1249
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26E8DC // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x1C // SAMP_PPOOL_3D_TEXT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // 3D_TEXT_ID * 0x4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0xE800 // SAMP_3D_TEXT_DEFINED_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    IF 30@ > 0
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: ret 0

0.3.DL
PHP:
:SAMPIs3dTextDefined
{
    0.3.DL
    0AB1: @SAMPIs3dTextDefined 1 3dTextID 1249
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x2ACA24 // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x1C // SAMP_PPOOL_3D_TEXT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // 3D_TEXT_ID * 0x4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0xE800 // SAMP_3D_TEXT_DEFINED_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    IF 30@ > 0
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: ret 0

0.3.7 - R4
PHP:
:SAMPIs3dTextDefined
{
    0.3.7 - R4
    0AB1: @SAMPIs3dTextDefined 1 3dTextID 1249
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x1C // SAMP_PPOOL_3D_TEXT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // 3D_TEXT_ID * 0x4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0xE800 // SAMP_3D_TEXT_DEFINED_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    IF 30@ > 0
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: ret 0



0.3.7 - R1
PHP:
:SAMPGet3dTextInfoByID
{
    0.3.7 - R1
    0AB1: @SAMPGet3dTextInfoByID 1 3dTextID 1249 _Returned: string 1@ color 2@ position 3@ 4@ 5@ view_distance 6@ show_behind_walls 7@ attached_to_player 8@ attached_to_vehicle 9@
}
IF 0AA2: 31@ = "samp.dll"
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@ += 0xC // SAMP_PPOOL_3D_TEXT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // 3D_TEXT_ID * 0x4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x4 // SAMP_3D_TEXT_COLOR_OFFSET
    0A8E: 29@ = 31@ + 0x8 // SAMP_3D_TEXT_POSITION_X_OFFSET
    0A8E: 28@ = 31@ + 0xC // SAMP_3D_TEXT_POSITION_Y_OFFSET
    0A8E: 27@ = 31@ + 0x10 // SAMP_3D_TEXT_POSITION_Z_OFFSET
    0A8E: 26@ = 31@ + 0x14 // SAMP_3D_TEXT_VIEW_DISTANCE_OFFSET
    0A8E: 25@ = 31@ + 0x18 // SAMP_3D_TEXT_THROUGH_WALLS_OFFSET
    0A8E: 24@ = 31@ + 0x19 // SAMM8ECLaq9zC4xgck6QUJACuAxDkZyouDAnk8i
    0A8E: 23@ = 31@ + 0x1B // SAMM8ECLaq9zC4xgck6QUJACuAxDkZyouDAnk8iFFSET
    0A8D: 22@ = readMem 31@ sz 4 vp 0
    IF 22@ > 0
    THEN
        22@ += 0x0 // SAMP_3D_TEXT__TEXT__OFFSET
        0A8D: 22@ = readMem 22@ sz 4 vp 0
        IF 22@ > 0
        THEN
            0A8D: 21@ = readMem 30@ sz 4 vp 0
            0A8D: 20@ = readMem 29@ sz 4 vp 0
            0A8D: 19@ = readMem 28@ sz 4 vp 0
            0A8D: 18@ = readMem 27@ sz 4 vp 0
            0A8D: 17@ = readMem 26@ sz 4 vp 0
            0A8D: 16@ = readMem 25@ sz 1 vp 0
            0A8D: 15@ = readMem 24@ sz 2 vp 0
            0A8D: 14@ = readMem 23@ sz 2 vp 0
            0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: ret 9 22@ 21@ 20@ 19@ 18@ 17@ 16@ 15@ 14@

0.3.7 - R2
PHP:
Soon..

0.3.7 - R3
PHP:
Soon..

0.3.DL
PHP:
Soon..

0.3.7 - R4
PHP:
Soon..
 
Last edited:

peklovely

Member
Joined
Nov 15, 2020
Messages
8
Reaction score
1
Location
UK
OPCODE:
0B50: samp 2@ = object_handle_by_id 1@
Without SAMPFUNCS

~ Samp Object ~


0.3.7 - R1
PHP:
:SAMPGetObjectHandleByID
{
    0.3.7 - R1
    SAMP_MAX_OBJECTS = 1000
    0AB1: @SAMPGetObjectHandleByID 1 ObjectID 1249 _Returned: Handle 0@
}
IF 0AA2: 31@ = "samp.dll"
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@ += 0x4 // SAMP_PPOOL_OBJECT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // OBJECT_ID * 0x4
    0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
    005A: 31@ += 0@
    0A8D: 30@ = readMem 31@ sz 4 vp 0
    IF 30@ > 0
    THEN
        30@ += 0x44 // SAMP_OBJECT_HANDLE_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0
        IF 30@ > 0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: ret 1 30@

0.3.7 - R2
PHP:
:SAMPGetObjectHandleByID
{
    0.3.7 - R2
    SAMP_MAX_OBJECTS = 1000
    0AB1: @SAMPGetObjectHandleByID 1 ObjectID 1249 _Returned: Handle 0@
}
IF 0AA2: 31@ = "samp.dll"
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@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // OBJECT_ID * 0x4
    0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
    005A: 31@ += 0@
    0A8D: 30@ = readMem 31@ sz 4 vp 0
    IF 30@ > 0
    THEN
        30@ += 0x44 // SAMP_OBJECT_HANDLE_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0
        IF 30@ > 0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: ret 1 30@

0.3.7 - R3
PHP:
:SAMPGetObjectHandleByID
{
    0.3.7 - R3
    SAMP_MAX_OBJECTS = 1000
    0AB1: @SAMPGetObjectHandleByID 1 ObjectID 1249 _Returned: Handle 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26E8DC // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // OBJECT_ID * 0x4
    0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
    005A: 31@ += 0@
    0A8D: 30@ = readMem 31@ sz 4 vp 0
    IF 30@ > 0
    THEN
        30@ += 0x44 // SAMP_OBJECT_HANDLE_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0
        IF 30@ > 0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: ret 1 30@

0.3.DL
PHP:
:SAMPGetObjectHandleByID
{
    0.3.DL
    SAMP_MAX_OBJECTS = 2100
    0AB1: @SAMPGetObjectHandleByID 1 ObjectID 1249 _Returned: Handle 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x2ACA24 // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // OBJECT_ID * 0x4
    0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
    005A: 31@ += 0@
    0A8D: 30@ = readMem 31@ sz 4 vp 0
    IF 30@ > 0
    THEN
        30@ += 0x44 // SAMP_OBJECT_HANDLE_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0
        IF 30@ > 0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: ret 1 30@

0.3.7 - R4
PHP:
:SAMPGetObjectHandleByID
{
    0.3.7 - R4 
    SAMP_MAX_OBJECTS = 1000
    0AB1: @SAMPGetObjectHandleByID 1 ObjectID 1249 _Returned: Handle 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // OBJECT_ID * 0x4
    0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
    005A: 31@ += 0@
    0A8D: 30@ = readMem 31@ sz 4 vp 0
    IF 30@ > 0
    THEN
        30@ += 0x44 // SAMP_OBJECT_HANDLE_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0
        IF 30@ > 0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: ret 1 30@
Hey bro , can you help me create a Cleo Find Object ID 3930 samp 0.3 , I will be very grateful
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
OPCODE:
0B25: samp 2@ = get_player_health 1@
0B26: samp 2@ = get_player_armor 1@
Without SAMPFUNCS

~ Samp Player ~


0.3.7 - R1
PHP:
:SAMPGetActorHealthByID
{
    0.3.7 - R1
    0AB1: @SAMPGetActorHealthByID 1 PlayerID 995 _Returned: Health 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3CD // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x18 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x2E // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x0 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1BC // SAMP_REMOTEPLAYERDATA_HEALTH_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@


:SAMPGetActorArmorByID
{
    0.3.7 - R1
    0AB1: @SAMPGetActorArmorByID 1 PlayerID 995 _Returned: Armor 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3CD // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x18 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x2E // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x0 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1B8 // SAMP_REMOTEPLAYERDATA_ARMOR_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@

0.3.7 - R2
PHP:
:SAMPGetActorHealthByID
{
    0.3.7 - R2
    0AB1: @SAMPGetActorHealthByID 1 PlayerID 995 _Returned: Health 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A100 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3C5 // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x26 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0xC // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1BC // SAMP_REMOTEPLAYERDATA_HEALTH_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@


:SAMPGetActorArmorByID
{
    0.3.7 - R2
    0AB1: @SAMPGetActorArmorByID 1 PlayerID 995 _Returned: Armor 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A100 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3C5 // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x26 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0xC // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1AC // SAMP_REMOTEPLAYERDATA_ARMOR_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@

0.3.7 - R3
PHP:
:SAMPGetActorHealthByID
{
    0.3.7 - R3
    0AB1: @SAMPGetActorHealthByID 1 PlayerID 995 _Returned: Health 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26E8DC // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x4 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x0 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1B0 // SAMP_REMOTEPLAYERDATA_HEALTH_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@


:SAMPGetActorArmorByID
{
    0.3.7 - R3
    0AB1: @SAMPGetActorArmorByID 1 PlayerID 995 _Returned: Armor 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26E8DC // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x4 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x0 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1AC // SAMP_REMOTEPLAYERDATA_ARMOR_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@

0.3.DL
PHP:
:SAMPGetActorHealthByID
{
    0.3.DL
    0AB1: @SAMPGetActorHealthByID 1 PlayerID 995 _Returned: Health 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x2ACA24 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x26 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x8 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1B0 // SAMP_REMOTEPLAYERDATA_HEALTH_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@


:SAMPGetActorArmorByID
{
    0.3.DL
    0AB1: @SAMPGetActorArmorByID 1 PlayerID 995 _Returned: Armor 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x2ACA24 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x26 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x8 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1AC // SAMP_REMOTEPLAYERDATA_ARMOR_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@

0.3.7 R4 - v1
PHP:
:SAMPGetActorHealthByID
{
    0.3.7 - R4 - v1
    0AB1: @SAMPGetActorHealthByID 1 PlayerID 995 _Returned: Heatlh 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x2E // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x10 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1B0 // SAMP_REMOTEPLAYERDATA_HEATLH_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@


:SAMPGetActorArmorByID
{
    0.3.7 - R4 - v1
    0AB1: @SAMPGetActorArmorByID 1 PlayerID 995 _Returned: Armor 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x2E // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x10 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1AC // SAMP_REMOTEPLAYERDATA_ARMOR_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@

0.3.7 R4 - v2
PHP:
:SAMPGetActorHealthByID
{
    0.3.7 R4 - v2
    0AB1: @SAMPGetActorHealthByID 1 PlayerID 995 _Returned: Heatlh 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x4 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x1F8A // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x10 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1B0 // SAMP_REMOTEPLAYERDATA_HEATLH_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@


:SAMPGetActorArmorByID
{
    0.3.7 R4 - v2
    0AB1: @SAMPGetActorArmorByID 1 PlayerID 995 _Returned: Armor 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x4 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x1F8A // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x10 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1AC // SAMP_REMOTEPLAYERDATA_ARMOR_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@
 
Last edited:

SobFoX

Expert
Joined
Jul 14, 2015
Messages
1,463
Solutions
5
Reaction score
916
Location
Israel
OPCODE:
0B25: samp 2@ = get_player_health 1@
0B26: samp 2@ = get_player_armor 1@
Without SAMPFUNCS

~ Samp Player ~


0.3.7 - R1
PHP:
:SAMPGetActorHealthByID
{
    0.3.7 - R1
    0AB1: @SAMPGetActorHealthByID 1 PlayerID 995 _Returned: Health 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3CD // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x18 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x2E // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x0 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1BC // SAMP_REMOTEPLAYERDATA_HEALTH_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@


:SAMPGetActorArmorByID
{
    0.3.7 - R1
    0AB1: @SAMPGetActorArmorByID 1 PlayerID 995 _Returned: Armor 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3CD // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x18 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x2E // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x0 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1B8 // SAMP_REMOTEPLAYERDATA_ARMOR_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@

0.3.7 - R2
PHP:
:SAMPGetActorHealthByID
{
    0.3.7 - R2
    0AB1: @SAMPGetActorHealthByID 1 PlayerID 995 _Returned: Health 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A100 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3C5 // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x26 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0xC // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1BC // SAMP_REMOTEPLAYERDATA_HEALTH_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@


:SAMPGetActorArmorByID
{
    0.3.7 - R2
    0AB1: @SAMPGetActorArmorByID 1 PlayerID 995 _Returned: Armor 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A100 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3C5 // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x26 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0xC // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1AC // SAMP_REMOTEPLAYERDATA_ARMOR_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@

0.3.7 - R3
PHP:
:SAMPGetActorHealthByID
{
    0.3.7 - R3
    0AB1: @SAMPGetActorHealthByID 1 PlayerID 995 _Returned: Health 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26E8DC // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x4 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x0 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1B0 // SAMP_REMOTEPLAYERDATA_HEALTH_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@


:SAMPGetActorArmorByID
{
    0.3.7 - R3
    0AB1: @SAMPGetActorArmorByID 1 PlayerID 995 _Returned: Armor 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26E8DC // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x4 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x0 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1AC // SAMP_REMOTEPLAYERDATA_ARMOR_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@

0.3.DL
PHP:
:SAMPGetActorHealthByID
{
    0.3.DL
    0AB1: @SAMPGetActorHealthByID 1 PlayerID 995 _Returned: Health 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x2ACA24 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x26 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x8 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1B0 // SAMP_REMOTEPLAYERDATA_HEALTH_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@


:SAMPGetActorArmorByID
{
    0.3.DL
    0AB1: @SAMPGetActorArmorByID 1 PlayerID 995 _Returned: Armor 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x2ACA24 // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x26 // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x8 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1AC // SAMP_REMOTEPLAYERDATA_ARMOR_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@

0.3.7 - R4
PHP:
:SAMPGetActorHealthByID
{
    0.3.7 - R4
    0AB1: @SAMPGetActorHealthByID 1 PlayerID 995 _Returned: Heatlh 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x2E // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x10 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1B0 // SAMP_REMOTEPLAYERDATA_HEATLH_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@


:SAMPGetActorArmorByID
{
    0.3.7 - R4
    0AB1: @SAMPGetActorArmorByID 1 PlayerID 995 _Returned: Armor 1@
}
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0@ *= 0x4 // PLAYER_ID * 4
    0@ += 0x2E // SAMP_REMOTEPLAYER_OFFSET
    005A: 1@ += 0@
    0A8D: 1@ readMem 1@ sz 4 vp 0
    IF 1@ > 0
    THEN
        1@ += 0x10 // SAMP_REMOTEPLAYERDATA_OFFSET
        0A8D: 1@ readMem 1@ sz 4 vp 0
        IF 1@ > 0
        THEN
            1@ += 0x1AC // SAMP_REMOTEPLAYERDATA_ARMOR_OFFSET
            0A8D: 1@ readMem 1@ sz 4 vp 0
            IF NOT 1@ < 0
            THEN 0485:  return_true
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    ELSE 059A:  return_false
    END
END
0AB2: 1 1@
R4-2 came out a little over a month ago
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
~ Samp Chat ~

Snippets:
1.
Chat Update
2. Chat Delete

0.3.7 R1
PHP:
:ChatUpadate
{
    0.3.7 R1
    0AB1: @ChatUpadate 0
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x21A0E4 // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    0A8C: writeMem 1@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0

:ChatDelete
{
    0.3.7 R1
    0AB1: @ChatDelete 1 ChatID 99
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x21A0E4 // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0A8E: 5@ = 1@ + 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    1@ += 0x132 // SAMP_CHAT_ENTRY_OFFSET
    0@ *= 0xFC // ID * SAMP_CHAT_SIZE_OFFSET
    005A: 1@ += 0@
    0A8E: 2@ = 1@ + 0xF0 // SAMP_CHAT_TYPE_OFFSET
    0A8E: 3@ = 1@ + 0x4 // SAMP_CHAT_PREFIX_TEXT_OFFSET
    0A8E: 4@ = 1@ + 0x20 // SAMP_CHAT_TEXT_OFFSET
    0A8C: writeMem 2@ sz 1 vl 2 vp 0
    0A8C: writeMem 3@ sz 1 vl 0 vp 0
    0A8C: writeMem 4@ sz 1 vl 0 vp 0
    0A8C: writeMem 5@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0

0.3.7 R2
PHP:
:ChatUpadate
{
    0.3.7 R2
    0AB1: @ChatUpadate 0
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    0A8C: writeMem 1@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0

:ChatDelete
{
    0.3.7 R2
    0AB1: @ChatDelete 1 ChatID 99
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x21A0EC // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0A8E: 5@ = 1@ + 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    1@ += 0x132 // SAMP_CHAT_ENTRY_OFFSET
    0@ *= 0xFC // ID * SAMP_CHAT_SIZE_OFFSET
    005A: 1@ += 0@
    0A8E: 2@ = 1@ + 0xF0 // SAMP_CHAT_TYPE_OFFSET
    0A8E: 3@ = 1@ + 0x4 // SAMP_CHAT_PREFIX_TEXT_OFFSET
    0A8E: 4@ = 1@ + 0x20 // SAMP_CHAT_TEXT_OFFSET
    0A8C: writeMem 2@ sz 1 vl 2 vp 0
    0A8C: writeMem 3@ sz 1 vl 0 vp 0
    0A8C: writeMem 4@ sz 1 vl 0 vp 0
    0A8C: writeMem 5@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0

0.3.7 R3
PHP:
:ChatUpadate
{
    0.3.7 R3
    0AB1: @ChatUpadate 0
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    0A8C: writeMem 1@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0

:ChatDelete
{
    0.3.7 R3
    0AB1: @ChatDelete 1 ChatID 99
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0A8E: 5@ = 1@ + 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    1@ += 0x132 // SAMP_CHAT_ENTRY_OFFSET
    0@ *= 0xFC // ID * SAMP_CHAT_SIZE_OFFSET
    005A: 1@ += 0@
    0A8E: 2@ = 1@ + 0xF0 // SAMP_CHAT_TYPE_OFFSET
    0A8E: 3@ = 1@ + 0x4 // SAMP_CHAT_PREFIX_TEXT_OFFSET
    0A8E: 4@ = 1@ + 0x20 // SAMP_CHAT_TEXT_OFFSET
    0A8C: writeMem 2@ sz 1 vl 2 vp 0
    0A8C: writeMem 3@ sz 1 vl 0 vp 0
    0A8C: writeMem 4@ sz 1 vl 0 vp 0
    0A8C: writeMem 5@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0

0.3.DL
PHP:
:ChatUpadate
{
    0.3.DL
    0AB1: @ChatUpadate 0
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    0A8C: writeMem 1@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0

:ChatDelete
{
    0.3.DL
    0AB1: @ChatDelete 1 ChatID 99
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x2ACA10 // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0A8E: 5@ = 1@ + 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    1@ += 0x132 // SAMP_CHAT_ENTRY_OFFSET
    0@ *= 0xFC // ID * SAMP_CHAT_SIZE_OFFSET
    005A: 1@ += 0@
    0A8E: 2@ = 1@ + 0xF0 // SAMP_CHAT_TYPE_OFFSET
    0A8E: 3@ = 1@ + 0x4 // SAMP_CHAT_PREFIX_TEXT_OFFSET
    0A8E: 4@ = 1@ + 0x20 // SAMP_CHAT_TEXT_OFFSET
    0A8C: writeMem 2@ sz 1 vl 2 vp 0
    0A8C: writeMem 3@ sz 1 vl 0 vp 0
    0A8C: writeMem 4@ sz 1 vl 0 vp 0
    0A8C: writeMem 5@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0

0.3.7 R4
PHP:
:ChatUpadate
{
    0.3.7 R4
    0AB1: @ChatUpadate 0
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    0A8C: writeMem 1@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0

:ChatDelete
{
    0.3.7 R4
    0AB1: @ChatDelete 1 ChatID 99
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0A8E: 5@ = 1@ + 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    1@ += 0x132 // SAMP_CHAT_ENTRY_OFFSET
    0@ *= 0xFC // ID * SAMP_CHAT_SIZE_OFFSET
    005A: 1@ += 0@
    0A8E: 2@ = 1@ + 0xF0 // SAMP_CHAT_TYPE_OFFSET
    0A8E: 3@ = 1@ + 0x4 // SAMP_CHAT_PREFIX_TEXT_OFFSET
    0A8E: 4@ = 1@ + 0x20 // SAMP_CHAT_TEXT_OFFSET
    0A8C: writeMem 2@ sz 1 vl 2 vp 0
    0A8C: writeMem 3@ sz 1 vl 0 vp 0
    0A8C: writeMem 4@ sz 1 vl 0 vp 0
    0A8C: writeMem 5@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0

0.3.7 R4 - v2
PHP:
:ChatUpadate
{
    0.3.7 R4
    0AB1: @ChatUpadate 0
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    0A8C: writeMem 1@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0

:ChatDelete
{
    0.3.7 R4
    0AB1: @ChatDelete 1 ChatID 99
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x26E9F8 // SAMP_CHAT_INFO_OFFSET
    0A8D: 1@ readMem 1@ sz 4 vp 0
    0A8E: 5@ = 1@ + 0x63DA // SAMP_CHAT_UPDATE_OFFSET
    1@ += 0x132 // SAMP_CHAT_ENTRY_OFFSET
    0@ *= 0xFC // ID * SAMP_CHAT_SIZE_OFFSET
    005A: 1@ += 0@
    0A8E: 2@ = 1@ + 0xF0 // SAMP_CHAT_TYPE_OFFSET
    0A8E: 3@ = 1@ + 0x4 // SAMP_CHAT_PREFIX_TEXT_OFFSET
    0A8E: 4@ = 1@ + 0x20 // SAMP_CHAT_TEXT_OFFSET
    0A8C: writeMem 2@ sz 1 vl 2 vp 0
    0A8C: writeMem 3@ sz 1 vl 0 vp 0
    0A8C: writeMem 4@ sz 1 vl 0 vp 0
    0A8C: writeMem 5@ sz 4 vl 1 vp 0
    0AA3: 1@
END
0AB2: ret 0
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Snippet does:
1. Deleting any existing color codes from text
2. Collecting all digits from text


PHP:
:get_digits_to_print
{
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @get_digits_to_print 2 text 0@ memory_to_store_digits_as_text 1@
}
5@ = FALSE // inbracket
0AA7: call_function 0x718690 num_params 1 pop 1 string 0@ _Returned: length 31@ // Gta Strlen
    FOR 30@ = 0 TO 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset (as the loop progresses it becomes pointers to first-last character)
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        IF 28@ == 123
        THEN 5@ = TRUE // inbracket
        END
        
        IF 5@ == FALSE
        THEN
            IF AND
            28@ >= 0x30 // '0'
            28@ <= 0x39 // '9'
            THEN
                0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
                1@ += 1 // move to next address
            END
        END
        
        IF 28@ == 125
        THEN 5@ = FALSE // inbracket
        END
    END
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0
 
Last edited:

ajom

Well-known member
Joined
Apr 14, 2020
Messages
389
Solutions
2
Reaction score
270
Location
Pluto
Snippet does:
1. Deleting any existing color codes from text
2. Collecting all digits from text


PHP:
:get_digits_to_print
{
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @get_digits_to_print 2 text 0@ memory_to_store_digits_as_text 1@
}
5@ = FALSE // inbracket
0C17: 31@ = strlen 0@
    FOR 30@ = 0 TO 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset (as the loop progresses it becomes pointers to first-last character)
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        IF 28@ == 123
        THEN 5@ = TRUE // inbracket
        END
     
        IF 5@ == FALSE
        THEN
            IF AND
            28@ >= 0x30 // '0'
            28@ <= 0x39 // '9'
            THEN
                0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
                1@ += 1 // move to next address
            END
        END
     
        IF 28@ == 125
        THEN 5@ = FALSE // inbracket
        END
    END
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0
There is a SAMPFUNCS opcode
Code:
...
0C17: 31@ = strlen 0@
...

You can replace it with this instead:
Code:
:strlen // 0AB1: @strlen 1 _String 0@ _ReturnLength 31@
    31@ = 0
    while true
        0A8D: 30@ = read_memory 0@ size 1 virtual_protect 0
        if 30@ == 0 // was null character
        then break
        else
            31@++
            0@++
        end
    end
0AB2: ret 1 _Length 31@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Opcode:
0B79: samp set_chat_input_enabled 1@
Without SAMPFUNCS


~ Multi Samp Snippet ~

PHP:
:SET_CHAT_INPUT_ENABLED
{
    0AB1: @SET_CHAT_INPUT_ENABLED 2 SampVersionID 0@ State 1
}
IF 0AA2: 31@ = "samp.dll"
THEN    
    IF NOT 0@ < 1
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0E8 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            IF 1@ == TRUE
            THEN 0A8E: 29@ = 31@ + 0x657E0 //SAMP_CHAT_INPUT_OPEN
            ELSE 0A8E: 29@ = 31@ + 0x658E0 //SAMP_CHAT_INPUT_CLOSE
            END 
        END
    
        IF 0@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0F0 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            IF 1@ == TRUE
            THEN 0A8E: 29@ = 31@ + 0x658B0 //SAMP_CHAT_INPUT_OPEN
            ELSE 0A8E: 29@ = 31@ + 0x659B0 //SAMP_CHAT_INPUT_CLOSE
            END
        END
        
        IF 0@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA14 // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            IF 1@ == TRUE
            THEN 0A8E: 29@ = 31@ + 0x68EC0 //SAMP_CHAT_INPUT_OPEN
            ELSE 0A8E: 29@ = 31@ + 0x68FC0 //SAMP_CHAT_INPUT_CLOSE
            END
        END
        
        IF 0@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8CC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            IF 1@ == TRUE
            THEN 0A8E: 29@ = 31@ + 0x68D10 //SAMP_CHAT_INPUT_OPEN
            ELSE 0A8E: 29@ = 31@ + 0x68E10 //SAMP_CHAT_INPUT_CLOSE
            END
        END
        
        IF 0@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            IF 1@ == TRUE
            THEN 0A8E: 29@ = 31@ + 0x69440 //SAMP_CHAT_INPUT_OPEN
            ELSE 0A8E: 29@ = 31@ + 0x69540 //SAMP_CHAT_INPUT_CLOSE
            END
        END
        
        IF 0@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            IF 1@ == TRUE
            THEN 0A8E: 29@ = 31@ + 0x69480 //SAMP_CHAT_INPUT_OPEN
            ELSE 0A8E: 29@ = 31@ + 0x69580 //SAMP_CHAT_INPUT_CLOSE
            END
        END
        0AA8: call_function_method 29@ struct 30@ num_params 0 pop 0 _retVal 6@
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:getStringBetweenTwoCharacters
{
    0AC8: 3@ = allocate_memory_size 1024
    0AB1: @getStringBetweenTwoCharacters 4 text 0@ FirstChar 123 SecondChar 125 memory_to_store_text 3@
}
5@ = FALSE // inbracket
0AB1: @strlen 1 string 0@ _Returned: length 31@
    FOR 30@ = 0 TO 31@ 
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset (as the loop progresses it becomes pointers to first-last character)
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
       
        0085: 27@ = 0@ // copy pointer
        005A: 27@ += 30@  // add offset (as the loop progresses it becomes pointers to first-last character)
        0A8D: 26@ = read_memory 27@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
       
        IF 003B:   28@ == 1@  // (int)
        THEN 5@ = TRUE
        END
       
        IF 5@ == TRUE
        THEN
            0A8C: write_memory 3@ size 1 value 26@ virtual_protect 1
            3@ += 1 // move to next address
        END
       
        IF 003B:   28@ == 2@  // (int)
        THEN 5@ = FALSE // inbracket
        END
           
    END
0A8C: write_memory 3@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:strlen
// 0AB1: @strlen 1 string 1@ _return: size 3@
FOR 1@ = 0 TO 1024
    0A8D: 2@ = readMem 0@ sz 1 vp 0
    IF NOT 2@ == 0
    JF break
    0@ += 1
END
0AB2: ret 1 1@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
OPCODE:
0B36: samp 2@ = get_player_nickname 1@
Without SAMPFUNCS

~ Samp Player ~


0.3.7 - R1
PHP:
:GetPlayerNameByID
{
    0.3.7 R1
    IF 0AB1: @GetPlayerNameByID 1 ID 0@ _Returned: Name 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0F8 // SAMP_INFO_OFFSET  
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x3CD // SAMP_PPOOLS_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x18 // SAMP_PPOOL_PLAYER_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0

    0A8E: 29@ = 31@ + 0x13CE0 // SAMP_GET_PLAYER_NAME_OFFSET

    0AA8: call_function_method 29@ struct 30@ num_params 1 pop 0 0@ _Returned: Name 28@
    IF 28@ > 0
    THEN 0485:  RETURN_TRUE
    ELSE 059A:  RETURN_FALSE
    END
END
0AB2: 1 28@

0.3.7 - R2
PHP:
:GetPlayerNameByID
{
    0.3.7 R2
    IF 0AB1: @GetPlayerNameByID 1 ID 0@ _Returned: Name 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A100 // SAMP_INFO_OFFSET    
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x3C5 // SAMP_PPOOLS_OFFSET           
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET           
    0A8D: 30@ = readMem 30@ sz 4 vp 0
 
    0A8E: 29@ = 31@ + 0x13DA0 // SAMP_GET_PLAYER_NAME_OFFSET

    0AA8: call_function_method 29@ struct 30@ num_params 1 pop 0 0@ _Returned: Name 28@
    IF 28@ > 0
    THEN 0485:  RETURN_TRUE
    ELSE 059A:  RETURN_FALSE
    END
END
0AB2: 1 28@

0.3.7 - R3
PHP:
:GetPlayerNameByID
{
    0.3.7 R3
    IF 0AB1: @GetPlayerNameByID 1 ID 0@ _Returned: Name 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E8DC // SAMP_INFO_OFFSET     
    0A8D: 30@ = readMem 30@ sz 4 vp 0 
    30@ += 0x3DE // SAMP_PPOOLS_OFFSET            
    0A8D: 30@ = readMem 30@ sz 4 vp 0 
    30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET            
    0A8D: 30@ = readMem 30@ sz 4 vp 0
  
    0A8E: 29@ = 31@ + 0x16F00 // SAMP_GET_PLAYER_NAME_OFFSET

    0AA8: call_function_method 29@ struct 30@ num_params 1 pop 0 0@ _Returned: Name 28@
    IF 28@ > 0
    THEN 0485:  RETURN_TRUE
    ELSE 059A:  RETURN_FALSE
    END
END
0AB2: 1 28@

0.3.DL
PHP:
:GetPlayerNameByID
{
    0.3.DL
    IF 0AB1: @GetPlayerNameByID 1 ID 0@ _Returned: Name 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x2ACA24 // SAMP_INFO_OFFSET  
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x3DE // SAMP_PPOOLS_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0

    0A8E: 29@ = 31@ + 0x170D0 // SAMP_GET_PLAYER_NAME_OFFSET

    0AA8: call_function_method 29@ struct 30@ num_params 1 pop 0 0@ _Returned: Name 28@
    IF 28@ > 0
    THEN 0485:  RETURN_TRUE
    ELSE 059A:  RETURN_FALSE
    END
END
0AB2: 1 28@

0.3.7 R4 - v2
PHP:
:GetPlayerNameByID
{
    0.3.7 R4 - v2
    IF 0AB1: @GetPlayerNameByID 1 ID 0@ _Returned: Name 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26EA0C // SAMP_INFO_OFFSET   
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x3DE // SAMP_PPOOLS_OFFSET          
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x4 // SAMP_PPOOL_PLAYER_OFFSET          
    0A8D: 30@ = readMem 30@ sz 4 vp 0

    0A8E: 29@ = 31@ + 0x175C0 // SAMP_GET_PLAYER_NAME_OFFSET

    0AA8: call_function_method 29@ struct 30@ num_params 1 pop 0 0@ _Returned: Name 28@
    IF 28@ > 0
    THEN 0485:  RETURN_TRUE
    ELSE 059A:  RETURN_FALSE
    END
END
0AB2: 1 28@
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Snippet to check when weapon is currently in reloading state.
PHP:
:isWeaponReloading
// IF 0AB1: @isWeaponReloading 0
0A96: 31@ = actor $PLAYER_ACTOR struct
31@ += 0x718 // Current weapon slot (1 byte)
0A8D: 30@ = read_memory 31@ size 1 virtual_protect 0
0A96: 31@ = actor $PLAYER_ACTOR struct
31@ += 0x5A0 // Start of CWeapon[13] struct
30@ *= 0x1C // size
005A: 31@ += 30@ // (int)
31@ += 0x4 // offset to reloading state
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
IF 31@ > 0
THEN 0485:  return_true
ELSE 059A:  return_false
END
0AB2: RET 0
PHP:
:weaponState
0A96: 0@ = actor $PLAYER_ACTOR struct
0@ += 0x718 // weapon slot
0A8D: 1@ = read_memory 0@ size 1 virtual_protect 0
1@ *= 28
0A96: 0@ = actor $PLAYER_ACTOR struct
0@ += 0x5A0 // weapon data
0@ += 1@
0@ += 4 // + 4 (weapon state)
0A8D: 2@ = read_memory 0@ size 4 virtual_protect 1 // weapon state (0 - idle, 1 - firing, 2 - reloading)
ret 1 2@
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
To Enable you need to return old values, so before you doing write memory , make sure you did read memory for default values...

Memory to write or read Camera Zoom:
0xB6F250 (Float)


PHP:
:DisableCameraZoomReset
// snipper
0A8C: write_memory 0x509BD0 size 2 value 0x9090 virtual_protect 1
// other weapons
0A8C: write_memory 0x52169D size 4 value 0x90909090 virtual_protect 1
0A8C: write_memory 0x5216A1 size 2 value 0x9090 virtual_protect 1
// no weapons
0A8C: write_memory 0x522F47 size 4 value 0x90909090 virtual_protect 1
0A8C: write_memory 0x522F4B size 2 value 0x9090 virtual_protect 1
// other
0A8C: write_memory 0x5109AC size 1 value 0xEB virtual_protect 1
0A8C: write_memory 0x5109C5 size 1 value 0xEB virtual_protect 1
0A8C: write_memory 0x5231A6 size 1 value 0xEB virtual_protect 1
0A8C: write_memory 0x52322D size 1 value 0xEB virtual_protect 1
0A8C: write_memory 0x5233BA size 1 value 0xEB virtual_protect 1

0AB2: ret 0
 
Last edited:

Davidthapa

Active member
Joined
Mar 20, 2017
Messages
32
Reaction score
1
Location
Shillong, Meghalaya, India
hey
Parazitas
I like all your snippets but that rainbow chat its stay green always and you don't think that when loading library you have to free it ? just curious and please if you have script for making default camera to left side player that will be great help for me thanks in advance
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
~~ Snippet to check when file name is correct ~~

Snippet return true if file name was entered like:
Car.cs

Snippet return false when file name was entered like:
.cs

So basically snippet not allow you enter just .cs without file name , it have to be Name.cs
PHP:
:isCleoFileNameCorrect
{
    IF 0AB1: @isCleoFileNameCorrect 1 FileName 0@
}
0AB1: @strlen 1 String 0@ Lenght 2@
if 2@ > 3
then
    0485:  return_true
    0085: 3@ = 0@ // copy string
    0A8D: 3@ = readMem 3@ sz 1 vp 1
    if 3@ > 32 // 32 = space , check to avoid emty file name
    then
        0485:  return_true
        000E: 2@ -= 3
        005A: 0@ += 2@
        0085: 4@ = 0@ // copy string
        0A8D: 5@ = readMem 4@ sz 1 vp 1
        if 5@ == 46 // 46 = .
        then
            0485:  return_true
            4@ += 1 // move to next character
            0A8D: 6@ = readMem 4@ sz 1 vp 1
            if or
            6@ == 67 // 67 = c
            6@ == 99 // 99 = C
            then
                0485:  return_true
                4@ += 1 // move to next character
                0A8D: 7@ = readMem 4@ sz 1 vp 1
                if or
                7@ == 83 // 83 = s
                7@ == 115 // 115 = S
                then 0485:  return_true
                else 059A:  return_false
                end
            else 059A:  return_false
            end
        else 059A:  return_false
        end
    else 059A:  return_false
    end
else 059A:  return_false
end   
0AB2: ret 0  

:strlen
{
    Example: 0AB1: @strlen 1 string 1@ rtn 3@
    In: 0@ - text;
    Out: 1@ - size;
}
for 1@ = 0 to 1024
    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
    if not 2@ == 0
    jf break
    0@ += 1
end
0AB2: ret 1 1@
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:isPlayerNPC
{
    0.3.7 R1
    IF 0AB1: @isPlayerNPC 1 ID 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0F8 // SAMP_INFO_OFFSET  
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x3CD // SAMP_PPOOLS_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x18 // SAMP_PPOOL_PLAYER_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0

    0A8E: 29@ = 31@ + 0xB680 // SAMP_IS_PLAYER_NPC_OFFSET

    0AA8: call_function_method 29@ struct 30@ num_params 1 pop 0 0@ _Returned: Name 28@
    IF 28@ > 0
    THEN 0485:  RETURN_TRUE
    ELSE 059A:  RETURN_FALSE
    END
END
0AB2: 0

PHP:
:isPlayerNPC
{
    0.3.DL
    IF 0AB1: @isPlayerNPC 1 ID 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x2ACA24 // SAMP_INFO_OFFSET  
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x3DE // SAMP_PPOOLS_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0

    0A8E: 29@ = 31@ + 0xE300 // SAMP_IS_PLAYER_NPC_OFFSET

    0AA8: call_function_method 29@ struct 30@ num_params 1 pop 0 0@ _Returned: Name 28@
    IF 28@ > 0
    THEN 0485:  RETURN_TRUE
    ELSE 059A:  RETURN_FALSE
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:SendSpawn
{
    0.3.7 - R1
    0AB1: @SendSpawn 0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 30@ = readmem 30@ sz 4 vp 0
    30@ += 0x3CD // SAMP_POOLS_OFFSET
    0A8D: 30@ = readmem 30@ sz 4 vp 0
    30@ += 0x18 // SAMP_POOL_PLAYER_OFFSET
    0A8D: 30@ = readmem 30@ sz 4 vp 0
    30@ += 0x22 // SAMP_LOCAL_PLAYER_OFFSET
    0A8D: 30@ readMem 30@ sz 4 vp 0
    
    0A8E: 29@ = 31@ + 0x3EC0 // SAMP_REQUEST_SPAWN_OFFSET
    0A8E: 28@ = 31@ + 0x3AD0 // SAMP_SEND_SPAWN_OFFSET
    
    0AA6: call_method 29@ struct 30@ num_params 0 pop 0 _retVal 6@
    0AA6: call_method 28@ struct 30@ num_params 0 pop 0 _retVal 8@
END
0AB2: 0
 
Status
Not open for further replies.
Top