[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
PHP:
:DeleteColorCodesFromText
{
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @DeleteColorCodesFromText 2 text 0@ memory_to_store_characters_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
            0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
            1@ += 1 // move to next address
        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
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Create and control SAMP textdraw

PHP:
:CreateTextdraw
{
    0.3.7 - R1
    0AB1: @CreateTextdraw 4 ID 1000 Text 0@ XY 320.0 224.0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AC8: 30@ = allocate_memory_size 66
    0A8C: write_memory 30@ size 2 value 18 virtual_protect 1
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0.25 virtual_protect 1 // fLetterWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 1.0 virtual_protect 1 // fLetterHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFFFFFFFF virtual_protect 1 // letterColor
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // boxColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // nShadow
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // bOutline
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // m_backgroundColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 1 virtual_protect 1 // m_nStyle
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // unknown
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 2@ virtual_protect 1 // m_fX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 3@ virtual_protect 1 // m_fY
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0 virtual_protect 1 // m_nModel
    30@ += 0x2
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationY
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationZ
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_fZoom
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[0]
    30@ += 0x2
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[1]
    30@ -= 61 // go back to the original pointer.

    0A8E: 29@ = 31@ + 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x3CD // SAMP_PPOOLS_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0

    0A8E: 28@ = 31@ + 0x1AE20 //SAMP_CREATE_TEXTDRAW_OFFSET
    0AA6: call_method 28@ struct 29@ num_params 3 pop 0 Text 1@ pTransmit 30@ ID 0@  _retVal 6@
END
0AB2: 0

PHP:
:SetTextdrawLetter
{
    0.3.7 - R1
    0AB1: @SetTextdrawLetter 4 ID 1000 Size 0.25 1.0 color 0xFF00FF00
}
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@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x963 // SAMP_TEXTDRAW_LETTER_WIDTH_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x967 // SAMP_TEXTDRAW_LETTER_HEIGHT_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x96B // SAMP_TEXTDRAW_LETTER_COLOR_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
        END
    END
END
0AB2: 0

PHP:
:SetTextdrawStyle
{
    0.3.7 - R1
    0AB1: @SetTextdrawStyle 2 ID 1000 Style 1
    Styles:
    1---4 - txd fonts (client)
    5 - model
    Other types may crash or not display.
}
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@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x987 // SAMP_TEXTDRAW_STYLE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0

PHP:
:SetTextdrawPosition
{
    0.3.7 - R1
    0AB1: @SetTextdrawPosition 3 ID 1000 XY 320.0 224.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@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x98B // SAMP_TEXTDRAW_POSITION_X_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x98F // SAMP_TEXTDRAW_POSITION_Y_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0

PHP:
:SetTextdrawProportional
{
    0.3.7 - R1
    0AB1: @SetTextdrawProportional 2 ID 1000 Proportional 1
}
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@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x97E // SAMP_TEXTDRAW_PROPORTIONAL_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0

PHP:
:SetTextdrawShadow
{
    0.3.7 - R1
    0AB1: @SetTextdrawShadow 3 ID 1000 Shadow 1 Color 0xFF00FF00
}
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@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x983 // SAMP_TEXTDRAW_SHADOW_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_SHADOW_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0

PHP:
:SetTextdrawModel
{
    0.3.7 - R1
    0AB1: @SetTextdrawModel 8 ID 1000 Model 1247 rotation 350.0 0.0 50.0 zoom 1.5 veh_color 0xF0 0xF0
}
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@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x9A8 // SAMP_TEXTDRAW_MODEL_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x9AA // SAMP_TEXTDRAW_ROTATION_X_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x9AE // SAMP_TEXTDRAW_ROTATION_Y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 26@ = 31@ + 0x9B2 // SAMP_TEXTDRAW_ROTATION_Z_OFFSET
            0A8C: writeMem 26@ sz 4 vl 4@ vp 0
            0A8E: 25@ = 31@ + 0x9B6 // SAMP_TEXTDRAW_ZOOM_OFFSET
            0A8C: writeMem 25@ sz 4 vl 5@ vp 0
            0A8E: 24@ = 31@ + 0x9BA // SAMP_TEXTDRAW_VEH_COLOR_X_OFFSET
            0A8C: writeMem 24@ sz 4 vl 6@ vp 0
            0A8E: 23@ = 31@ + 0x9BC // SAMP_TEXTDRAW_VEH_COLOR_Y_OFFSET
            0A8C: writeMem 23@ sz 4 vl 7@ vp 0
        END
    END
END
0AB2: 0

PHP:
:SetTextdrawBox
{
    0.3.7 - R1
    0AB1: @SetTextdrawBox 5 ID 1000 Box 1 Color 0xFF00FF00 Size 10.0 5.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@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x971 // SAMP_TEXTDRAW_BOX_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97A // SAMP_TEXTDRAW_BOX_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x972 // SAMP_TEXTDRAW_BOX_SIZE_X_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 27@ = 31@ + 0x976 // SAMP_TEXTDRAW_BOX_SIZE_y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 4@ vp 0
        END
    END
END
0AB2: 0

PHP:
:SetTextdrawAlign
{
    0.3.7 - R1
    0AB1: @SetTextdrawAlign 2 ID 1000 Align 1
    Types:
    1 - left
    2 - center
    3 - right
}
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@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            IF 1@ == 1
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 1 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 2
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 1 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 3
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 1 vp 0
            END
        END
    END
END
0AB2: 0

PHP:
:SetTextdrawText
{
    0.3.7 - R1
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Magic is Real!"
    0AB1: @SetTextdrawText 2 ID 1000 Text 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@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN 0AA7: call_function 0x718660 num_params 2 pop 2 source 1@ destination 31@ _Returned: value 30@ // Gta Strcpy 
        END
    END
END
0AB2: 0

PHP:
:SetTextdrawOutline
{
    0.3.7 - R1
    0AB1: @SetTextdrawOutline 3 ID 1000 Outline 2 Color 0xFF00FF00
}
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@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x984 // SAMP_TEXTDRAW_OUTLINE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_OUTLINE_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0

PHP:
:SetTextdrawState
{
    0.3.7 - R1
    0AB1: @SetTextdrawState 2 ID 1000 State 1
    States:
    1 - Visible
    0 - Hidden
}
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@ += 0x10 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
    0A8D: 30@ readMem 30@ sz 1 vp 0 // READ FIRST BYTE - SECURITY_CHECK
    IF 30@ > 0
    THEN 0A8C: writeMem 31@ sz 1 vl 1@ vp 0
    END
END
0AB2: 0


Soon will be more...
 
Last edited:

dev.tntd2k2

Member
Joined
Oct 5, 2020
Messages
19
Reaction score
20
Location
Vietnam
OPCODE:
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:
: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
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3CD
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0xC
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x1D // // 3D_TEXT_ID * 29
    0@ += 0x0 // SAMP_3D_TEXT__TEXT__OFFSET
    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
        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
END
0AB2: ret 9 22@ 21@ 20@ 19@ 18@ 17@ 16@ 15@ 14@

0.3.7 - R2
PHP:
:SAMPGet3dTextInfoByID
{
    0.3.7 - R2
    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@ += 0x21A100
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3C5
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x1C
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x1D // // 3D_TEXT_ID * 29
    0@ += 0x0 // SAMP_3D_TEXT__TEXT__OFFSET
    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
        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
END
0AB2: ret 9 22@ 21@ 20@ 19@ 18@ 17@ 16@ 15@ 14@

0.3.7 - R3
PHP:
:SAMPGet3dTextInfoByID
{
    0.3.7 - R3
    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@ += 0x26E8DC
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x1C
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x1D // // 3D_TEXT_ID * 29
    0@ += 0x0 // SAMP_3D_TEXT__TEXT__OFFSET
    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
        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
END
0AB2: ret 9 22@ 21@ 20@ 19@ 18@ 17@ 16@ 15@ 14@

0.3.DL
PHP:
:SAMPGet3dTextInfoByID
{
    0.3.DL
    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@ += 0x2ACA24
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x1C
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x1D // // 3D_TEXT_ID * 29
    0@ += 0x0 // SAMP_3D_TEXT__TEXT__OFFSET
    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
        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
END
0AB2: ret 9 22@ 21@ 20@ 19@ 18@ 17@ 16@ 15@ 14@

0.3.7 - R4
PHP:
:SAMPGet3dTextInfoByID
{
    0.3.7 - R4
    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@ += 0x26EA0C
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3DE
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x1C
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x1D // // 3D_TEXT_ID * 29
    0@ += 0x0 // SAMP_3D_TEXT__TEXT__OFFSET
    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
        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
END
0AB2: ret 9 22@ 21@ 20@ 19@ 18@ 17@ 16@ 15@ 14@
sizeof(stTextLabel) = 29 so i have fixed and update for some version.
Credit: @Parazitas for the pointer
 
Last edited:

dev.tntd2k2

Member
Joined
Oct 5, 2020
Messages
19
Reaction score
20
Location
Vietnam
OPCODE:
0B28: samp disconnect_with_reason
Without SAMPFUNCS

PHP:
DISCONNECT_QUIT = 500
DISCONNECT_TIMEOUT = 0

PHP:
:SAMPDisconnectWithReason
{
    0.3.7 - R1
    0AB1: @SAMPDisconnectWithReason 1 500
    or
    0AB1: @SAMPDisconnectWithReason 1 0
}
if 0AA2: 31@ = "samp.dll"
then
    31@ += 0x21A0F8
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3C9    
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0A8E: 30@ = 31@ + 0x0      
    0A8D: 30@ readMem 30@ sz 4 vp 0
    30@ += 0x8                 
    0A8D: 30@ readMem 30@ sz 4 vp 0
    0AA6: call 30@ struct 31@ num_params 2 pop 0 params 0 0@
end
0AB2: 0

PHP:
:SAMPDisconnectWithReason
{
    0.3.7 - R2
    0AB1: @SAMPDisconnectWithReason 1 500
    or
    0AB1: @SAMPDisconnectWithReason 1 0
}
if 0AA2: 31@ = "samp.dll"
then
    31@ += 0x21A100
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x18               
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0A8E: 30@ = 31@ + 0x0      
    0A8D: 30@ readMem 30@ sz 4 vp 0
    30@ += 0x8                 
    0A8D: 30@ readMem 30@ sz 4 vp 0
    0AA6: call 30@ struct 31@ num_params 2 pop 0 params 0 0@
end
0AB2: 0

PHP:
:SAMPDisconnectWithReason
{
    0.3.7 - R3
    0AB1: @SAMPDisconnectWithReason 1 500
    or
    0AB1: @SAMPDisconnectWithReason 1 0
}
if 0AA2: 31@ = "samp.dll"
then
    31@ += 0x26E8DC
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x2C
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0A8E: 30@ = 31@ + 0x0      
    0A8D: 30@ readMem 30@ sz 4 vp 0
    30@ += 0x8                 
    0A8D: 30@ readMem 30@ sz 4 vp 0
    0AA6: call 30@ struct 31@ num_params 2 pop 0 params 0 0@
end
0AB2: 0

PHP:
:SAMPDisconnectWithReason
{
    0.3.7 - R4 - v1
    0AB1: @SAMPDisconnectWithReason 1 500
    or
    0AB1: @SAMPDisconnectWithReason 1 0
}
if 0AA2: 31@ = "samp.dll"
then
    31@ += 0x26EA0C
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x2C                  
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0A8E: 30@ = 31@ + 0x0      
    0A8D: 30@ readMem 30@ sz 4 vp 0
    30@ += 0x8                 
    0A8D: 30@ readMem 30@ sz 4 vp 0
    0AA6: call 30@ struct 31@ num_params 2 pop 0 params 0 0@
end
0AB2: 0


PHP:
:SAMPDisconnectWithReason
{
    0.3.7 - R4 - v2
    0AB1: @SAMPDisconnectWithReason 1 500
    or
    0AB1: @SAMPDisconnectWithReason 1 0
}
if 0AA2: 31@ = "samp.dll"
then
    31@ += 0x26EA0C
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x0                  
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0A8E: 30@ = 31@ + 0x0      
    0A8D: 30@ readMem 30@ sz 4 vp 0
    30@ += 0x8                 
    0A8D: 30@ readMem 30@ sz 4 vp 0
    0AA6: call 30@ struct 31@ num_params 2 pop 0 params 0 0@
end
0AB2: 0

PHP:
:SAMPDisconnectWithReason
{
    0.3.DL
    0AB1: @SAMPDisconnectWithReason 1 500
    or
    0AB1: @SAMPDisconnectWithReason 1 0
}
if 0AA2: 31@ = "samp.dll"
then
    31@ += 0x2ACA24
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x2C                  
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0A8E: 30@ = 31@ + 0x0      
    0A8D: 30@ readMem 30@ sz 4 vp 0
    30@ += 0x8                 
    0A8D: 30@ readMem 30@ sz 4 vp 0
    0AA6: call 30@ struct 31@ num_params 2 pop 0 params 0 0@
end
0AB2: 0
 
Last edited:

0x73616D

Active member
Joined
Apr 18, 2021
Messages
135
Solutions
1
Reaction score
68
Location
0x73616D
Get Local Player Ping
Without SAMPFUNCS
0.3.7 - R1

(it's my first snippet, I tried it and didn't find any errors, if anyone notices something, let me know)
PHP:
:GetLocalPlayerPing
{
0.3.7 - R1
0AB1: call_scm_func @GetLocalPlayerPing 0 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x21A0F8
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3CD
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ +=0x18
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x26
    0A8D: 31@ readMem 31@ sz 4 vp 0
END
0AB2: ret 1 31@
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Simple method to create or delete
Radar Marker

MAP ICON STYLE​
IDCONSTANTHAS CHECKPOINT MARKERRADAR MAP RANGE
0MAPICON_LOCALNOClose proximity only
1MAPICON_GLOBALNOShow on radar edge as long as in range
2MAPICON_LOCAL_CHECKPOINTYESClose proximity only
3MAPICON_GLOBAL_CHECKPOINTYESShow on radar edge as long as in range


Radar Icon ID's


PHP:
:CreateMarker
{
    0.3.7 - R1
    0AB1: @CreateMarker 7 ID 2 XYZ 1@ 2@ 3@ Icon 23 Color 0xFF0000FF Style 1
}
IF 0AA2: 31@ = "samp.dll"
THEN                  
    0A8E: 30@ = 31@ + 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0    
 
    0A8E: 29@ = 31@ + 0x9E20 // SAMP_CREATE_MARKER_OFFSET
    0AA8: call_function_method 29@ struct 30@ num_params 7 pop 0 Type 6@ Color 5@ Icon 4@ ZYX 3@ 2@ 1@ Index 0@ _retVal 28@
END
0AB2: 0

:DeleteMarker
{
    0.3.7 - R1
    0AB1: @DeleteMarker 1 ID 2
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
 
    0A8E: 29@ = 31@ + 0x8AB0 // SAMP_DELETE_MARKER_OFFSET
    0AA8: call_function_method 29@ struct 30@ num_params 1 pop 0 Index 0@ _retVal 28@
END
0AB2: 0
 

0x73616D

Active member
Joined
Apr 18, 2021
Messages
135
Solutions
1
Reaction score
68
Location
0x73616D
Get Local Player Score
Without SAMPFUNCS
0.3.7 - R1


PHP:
:GetLocalPlayerScore
{
0.3.7 - R1
0AB1: call_scm_func @GetLocalPlayerScore 0 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x21A0F8
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3CD
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ +=0x18
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x2A
    0A8D: 31@ readMem 31@ sz 4 vp 1
END   
0AB2: ret 1 31@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Windows Libaries snippets
PHP:
:read_string_from_ini_file
{
    0AC8: 0@ = allocate_memory_size 144
    0AD3: 0@ = format "cleo\Autologin.ini"
    0AC8: 1@ = allocate_memory_size 144
    0AD3: 1@ = format "Server1"
    0AC8: 2@ = allocate_memory_size 144
    0AD3: 2@ = format "NickName"
    0AB1: @read_string_from_ini_file 4 File 0@ section 1@ key 2@ AllocatingStringSize 1024 _Returned: String 3@ Length 4@
 
    // Do something...
 
    0AA3: free_dynamic_library 0@
    0AA3: free_dynamic_library 1@
    0AA3: free_dynamic_library 2@
}
IF 0AA2: 31@ = load_dynamic_library "Kernel32.dll"
THEN
    IF 0AA4: 30@ = get_dynamic_library_procedure "GetPrivateProfileStringA" library 31@
    THEN
        0AC8: 29@ = allocate_memory_size 3@
        0AA7: call_function 30@ num_params 6 pop 0 File 0@ Size 3@ ReturnedString 29@ Default 0 Key 2@ Section 1@ _Returned: CopiedNumOfChars 28@
        IF 28@ > 0
        THEN 0AB2: cleo_return 2 29@ 28@
        ELSE 0AB2: cleo_return 0
        END
        0AC9: free_allocated_memory 29@
    END
    0AA3: free_dynamic_library 31@
END
0AB2: cleo_return 0
PHP:
:get_int_from_ini_file
{
    0AC8: 0@ = allocate_memory_size 144
    0AD3: 0@ = format "cleo\Autologin.ini"
    0AC8: 1@ = allocate_memory_size 144
    0AD3: 1@ = format "Server1"
    0AC8: 2@ = allocate_memory_size 144
    0AD3: 2@ = format "Health"
    0AB1: @get_int_from_ini_file 3 File 0@ section 1@ key 2@ _Returned: NumOfChars 3@ Int 4@
  
    // Do something...
  
    0AA3: free_dynamic_library 0@
    0AA3: free_dynamic_library 1@
    0AA3: free_dynamic_library 2@
}
IF 0AA2: 31@ = load_dynamic_library "Kernel32.dll"
THEN
    IF 0AA4: 30@ = get_dynamic_library_procedure "GetPrivateProfileStringA" library 31@
    THEN     
        0AC8: 29@ = allocate_memory_size 144
        0AA7: call_function 30@ num_params 6 pop 0 File 0@ Size 144 ReturnedString 29@ Default 0 Key 2@ Section 1@ _Returned: CopiedNumOfChars 28@
        IF 28@ > 0
        THEN
            IF 0AD4: $NOT_USED = scan_string 29@ format "%d" 29@
            THEN 0AB2: cleo_return 2 28@ 29@
            END
        ELSE
            0AB2: cleo_return 2 28@ 0
        END
        0AC9: free_allocated_memory 29@
    END
    0AA3: free_dynamic_library 31@
END
0AB2: cleo_return 0
PHP:
:get_float_from_ini_file
{
    0AC8: 0@ = allocate_memory_size 144
    0AD3: 0@ = format "cleo\Autologin.ini"
    0AC8: 1@ = allocate_memory_size 144
    0AD3: 1@ = format "Server1"
    0AC8: 2@ = allocate_memory_size 144
    0AD3: 2@ = format "Health"
    0AB1: @get_float_from_ini_file 3 File 0@ section 1@ key 2@_Returned: NumOfChars 3@ Float 4@
   
    // Do something...
   
    0AA3: free_dynamic_library 0@
    0AA3: free_dynamic_library 1@
    0AA3: free_dynamic_library 2@
}
IF 0AA2: 31@ = load_dynamic_library "Kernel32.dll"
THEN
    IF 0AA4: 30@ = get_dynamic_library_procedure "GetPrivateProfileStringA" library 31@
    THEN      
        0AC8: 29@ = allocate_memory_size 144
        0AA7: call_function 30@ num_params 6 pop 0 File 0@ Size 144 ReturnedString 29@ Default 0 Key 2@ Section 1@ _Returned: CopiedNumOfChars 28@
        IF 28@ > 0
        THEN
            IF 0AD4: $NOT_USED = scan_string 29@ format "%f" 29@
            THEN 0AB2: cleo_return 2 28@ 29@
            END
        ELSE 0AB2: cleo_return 2 28@ 0.0
        END
        0AC9: free_allocated_memory 29@
    END
    0AA3: free_dynamic_library 31@
END
0AB2: cleo_return 0
PHP:
:write_string_to_ini_file
{
    0AC8: 0@ = allocate_memory_size 144
    0AD3: 0@ = format "cleo\Autologin.ini"
    0AC8: 1@ = allocate_memory_size 144
    0AD3: 1@ = format "Server1"
    0AC8: 2@ = allocate_memory_size 144
    0AD3: 2@ = format "Health"
    0AC8: 3@ = allocate_memory_size 144
    0AD3: 3@ = format "My String"
    0AB1: @write_String_to_ini_file 5 String 3@ File 0@ Section 1@ Key 2@ AllocatingStringSize 144
    0AA3: free_dynamic_library 0@
    0AA3: free_dynamic_library 1@
    0AA3: free_dynamic_library 2@
    0AA3: free_dynamic_library 3@
}
IF 0AA2: 31@ = load_dynamic_library "Kernel32.dll"
THEN
    IF 0AA4: 30@ = get_dynamic_library_procedure "WritePrivateProfileStringA" library 31@
    THEN
        0AC8: 29@ = allocate_memory_size 4@
        0AD3: 29@ = format "%s" 0@
        0AA7: call_function 30@ num_params 4 pop 0 File 1@ Int 29@ Key 3@ Section 2@ _Returned: CopiedNumOfChars 28@
        0AA3: free_dynamic_library 29@
    END
    0AA3: free_dynamic_library 31@
END
0AB2: cleo_return 0
PHP:
:write_int_to_ini_file
{
    0AC8: 0@ = allocate_memory_size 144
    0AD3: 0@ = format "cleo\Autologin.ini"
    0AC8: 1@ = allocate_memory_size 144
    0AD3: 1@ = format "Server1"
    0AC8: 2@ = allocate_memory_size 144
    0AD3: 2@ = format "Health"
    0AB1: @write_int_to_ini_file 4 Int 50.0 File 30@ Section 29@ Key 28@
    0AA3: free_dynamic_library 0@
    0AA3: free_dynamic_library 1@
    0AA3: free_dynamic_library 2@
}
IF 0AA2: 31@ = load_dynamic_library "Kernel32.dll"
THEN
    IF 0AA4: 30@ = get_dynamic_library_procedure "WritePrivateProfileStringA" library 31@
    THEN
        0AC8: 29@ = allocate_memory_size 144
        0AD3: 29@ = format "%d" 0@
        0AA7: call_function 30@ num_params 4 pop 0 File 1@ Int 29@ Key 3@ Section 2@ _Returned: CopiedNumOfChars 28@
        0AA3: free_dynamic_library 29@
    END
    0AA3: free_dynamic_library 31@
END
0AB2: cleo_return 0
PHP:
:write_float_to_ini_file
{
    0AC8: 0@ = allocate_memory_size 144
    0AD3: 0@ = format "cleo\Autologin.ini"
    0AC8: 1@ = allocate_memory_size 144
    0AD3: 1@ = format "Server1"
    0AC8: 2@ = allocate_memory_size 144
    0AD3: 2@ = format "Health"
    0AB1: @write_float_to_ini_file 4 Float 50.0 File 0@ Section 1@ Key 2@

    0AA3: free_dynamic_library 0@
    0AA3: free_dynamic_library 1@
    0AA3: free_dynamic_library 2@
}
IF 0AA2: 31@ = load_dynamic_library "Kernel32.dll"
THEN
    IF 0AA4: 30@ = get_dynamic_library_procedure "WritePrivateProfileStringA" library 31@
    THEN
        0AC8: 29@ = allocate_memory_size 144
        0AD3: 29@ = format "%f" 0@
        0AA7: call_function 30@ num_params 4 pop 0 File 1@ Float 29@ Key 3@ Section 2@ _Returned: CopiedNumOfChars 28@
        0AA3: free_dynamic_library 29@
    END
    0AA3: free_dynamic_library 31@
END
0AB2: cleo_return 0
PHP:
:remove_section_from_an_ini_file
{
    0AC8: 0@ = allocate_memory_size 144
    0AD3: 0@ = format "cleo\TextdrawSettings.ini"
    0AC8: 1@ = allocate_memory_size 144
    0AD3: 1@ = format "ID:4-CheckBox"
    0AB1: @remove_section_from_an_ini_file 2 File 0@ Section 1@
    0AA3: free_dynamic_library 0@
    0AA3: free_dynamic_library 1@
}
IF 0AA2: 31@ = load_dynamic_library "Kernel32.dll"
THEN
    IF 0AA4: 30@ = get_dynamic_library_procedure "WritePrivateProfileStringA" library 31@
    THEN    
        0AA7: call_function 30@ num_params 4 pop 0 File 0@ Int 0 Key 0 Section 1@ _Returned: CopiedNumOfChars 28@
    END
    0AA3: free_dynamic_library 31@
END
0AB2: cleo_return 0
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
While i was helping for one of server player.., i realize there's not method to get other player vehicle health..
So enjoy..

PHP:
:GetVehicleHealthByID
{
    0.3.7 R1
    0AB1: @GetVehicleHealthByID 1 ID 995 _Returned: Health 0@
}
IF 0AA2: 31@ = loadLib "samp.dll" //samp base offset
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@ += 0x1C // SAMP_PPOOL_VEHICLE_OFFSET
    0A8D: 31@ = readmem 31@ sz 4 vp 0
    31@ += 0x1134 // SAMP_VEHICLE_STRUCT_ELEMENT_OFFSET
    0@ *= 0x4
    005A: 31@ += 0@
    0A8D: 31@ readMem 31@ sz 4 vp 0
    IF 31@ > 0
    THEN
        31@ += 0x4C // SAMP_VEHICLE_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        31@ += 0x4C0 // SAMP_HEATLH_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        0AB2: ret 1 31@
    END
END
0AB2: ret 0
PHP:
:GetVehicleHealthByID
{
    0.3.7 R2
    0AB1: @GetVehicleHealthByID 1 ID 995 _Returned: Health 0@
}
IF 0AA2: 31@ = loadLib "samp.dll" //samp base offset
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@ += 0xC // SAMP_PPOOL_VEHICLE_OFFSET
    0A8D: 31@ = readmem 31@ sz 4 vp 0
    31@ += 0x1134 // SAMP_VEHICLE_STRUCT_ELEMENT_OFFSET
    0@ *= 0x4
    005A: 31@ += 0@
    0A8D: 31@ readMem 31@ sz 4 vp 0
    IF 31@ > 0
    THEN
        31@ += 0x4C // SAMP_VEHICLE_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        31@ += 0x4C0 // SAMP_HEATLH_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        0AB2: ret 1 31@
    END
END
0AB2: ret 0
PHP:
:GetVehicleHealthByID
{
    0.3.7 R3
    0AB1: @GetVehicleHealthByID 1 ID 995 _Returned: Health 0@
}
IF 0AA2: 31@ = loadLib "samp.dll" //samp base offset
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@ += 0xC // SAMP_PPOOL_VEHICLE_OFFSET
    0A8D: 31@ = readmem 31@ sz 4 vp 0
    31@ += 0x1134 // SAMP_VEHICLE_STRUCT_ELEMENT_OFFSET
    0@ *= 0x4
    005A: 31@ += 0@
    0A8D: 31@ readMem 31@ sz 4 vp 0
    IF 31@ > 0
    THEN
        31@ += 0x4C // SAMP_VEHICLE_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        31@ += 0x4C0 // SAMP_HEATLH_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        0AB2: ret 1 31@
    END
END
0AB2: ret 0

PHP:
:GetVehicleHealthByID
{
    0.3.7 R4 v2
    0AB1: @GetVehicleHealthByID 1 ID 995 _Returned: Health 0@
}
IF 0AA2: 31@ = loadLib "samp.dll" //samp base offset
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@ += 0x0 // SAMP_PPOOL_VEHICLE_OFFSET
    0A8D: 31@ = readmem 31@ sz 4 vp 0
    31@ += 0x1134 // SAMP_VEHICLE_STRUCT_ELEMENT_OFFSET
    0@ *= 0x4
    005A: 31@ += 0@
    0A8D: 31@ readMem 31@ sz 4 vp 0
    IF 31@ > 0
    THEN
        31@ += 0x4C // SAMP_VEHICLE_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        31@ += 0x4C0 // SAMP_HEATLH_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        0AB2: ret 1 31@
    END
END
0AB2: ret 0

PHP:
:GetVehicleHealthByID
{
    0.3.DL
    0AB1: @GetVehicleHealthByID 1 ID 995 _Returned: Health 0@
}
IF 0AA2: 31@ = loadLib "samp.dll" //samp base offset
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@ += 0xC // SAMP_PPOOL_VEHICLE_OFFSET
    0A8D: 31@ = readmem 31@ sz 4 vp 0
    31@ += 0x1134 // SAMP_VEHICLE_STRUCT_ELEMENT_OFFSET
    0@ *= 0x4
    005A: 31@ += 0@
    0A8D: 31@ readMem 31@ sz 4 vp 0
    IF 31@ > 0
    THEN
        31@ += 0x4C // SAMP_VEHICLE_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        31@ += 0x4C0 // SAMP_HEATLH_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        0AB2: ret 1 31@
    END
END
0AB2: ret 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Create and control SAMP textdraw
PHP:
:CreateTextdraw
{
    0.3.7 R4 - v2
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Textdraw.." 
    0AB1: @CreateTextdraw 4 ID 1000 Text 0@ XY 320.0 224.0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AC8: 30@ = allocate_memory_size 66
    0A8C: write_memory 30@ size 2 value 18 virtual_protect 1
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0.25 virtual_protect 1 // fLetterWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 1.0 virtual_protect 1 // fLetterHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFFFFFFFF virtual_protect 1 // letterColor
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // boxColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // nShadow
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // bOutline
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // m_backgroundColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 1 virtual_protect 1 // m_nStyle
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // unknown
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 2@ virtual_protect 1 // m_fX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 3@ virtual_protect 1 // m_fY
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0 virtual_protect 1 // m_nModel
    30@ += 0x2
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationY
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationZ
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_fZoom
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[0]
    30@ += 0x2
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[1]
    30@ -= 61 // go back to the original pointer.

    0A8E: 29@ = 31@ + 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x1C // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0

    0A8E: 28@ = 31@ + 0x1E910 //SAMP_CREATE_TEXTDRAW_OFFSET
    0AA6: call_method 28@ struct 29@ num_params 3 pop 0 Text 1@ pTransmit 30@ ID 0@  _retVal 6@
END
0AB2: 0
PHP:
:SetTextdrawLetter
{
    0.3.7 R4 - v2
    0AB1: @SetTextdrawLetter 4 ID 1000 Size 0.25 1.0 color 0xFF00FF00
}
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_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x963 // SAMP_TEXTDRAW_LETTER_WIDTH_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x967 // SAMP_TEXTDRAW_LETTER_HEIGHT_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x96B // SAMP_TEXTDRAW_LETTER_COLOR_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawStyle
{
    0.3.7 R4 - v2
    0AB1: @SetTextdrawStyle 2 ID 1000 Style 1
    Styles:
    1---4 - txd fonts (client)
    5 - model
    Other types may crash or not display.
}
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_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x987 // SAMP_TEXTDRAW_STYLE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawPosition
{
    0.3.7 R4 - v2
    0AB1: @SetTextdrawPosition 3 ID 1000 XY 320.0 224.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@ += 0x1C // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x98B // SAMP_TEXTDRAW_POSITION_X_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x98F // SAMP_TEXTDRAW_POSITION_Y_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawProportional
{
    0.3.7 R4 - v2
    0AB1: @SetTextdrawProportional 2 ID 1000 Proportional 1
}
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_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x97E // SAMP_TEXTDRAW_PROPORTIONAL_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawShadow
{
    0.3.7 R4 - v2
    0AB1: @SetTextdrawShadow 3 ID 1000 Shadow 1 Color 0xFF00FF00
}
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_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x983 // SAMP_TEXTDRAW_SHADOW_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_SHADOW_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawModel
{
    0.3.7 R4 v2
    0AB1: @SetTextdrawModel 8 ID 1000 Model 1247 rotation 350.0 0.0 50.0 zoom 1.5 veh_color 0xF0 0xF0
}
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_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x9A8 // SAMP_TEXTDRAW_MODEL_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x9AA // SAMP_TEXTDRAW_ROTATION_X_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x9AE // SAMP_TEXTDRAW_ROTATION_Y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 26@ = 31@ + 0x9B2 // SAMP_TEXTDRAW_ROTATION_Z_OFFSET
            0A8C: writeMem 26@ sz 4 vl 4@ vp 0
            0A8E: 25@ = 31@ + 0x9B6 // SAMP_TEXTDRAW_ZOOM_OFFSET
            0A8C: writeMem 25@ sz 4 vl 5@ vp 0
            0A8E: 24@ = 31@ + 0x9BA // SAMP_TEXTDRAW_VEH_COLOR_X_OFFSET
            0A8C: writeMem 24@ sz 4 vl 6@ vp 0
            0A8E: 23@ = 31@ + 0x9BC // SAMP_TEXTDRAW_VEH_COLOR_Y_OFFSET
            0A8C: writeMem 23@ sz 4 vl 7@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawBox
{
    0.3.7 R4 - v2
    0AB1: @SetTextdrawBox 5 ID 1000 Box 1 Color 0xFF00FF00 Size 10.0 5.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@ += 0x1C // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x971 // SAMP_TEXTDRAW_BOX_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97A // SAMP_TEXTDRAW_BOX_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x972 // SAMP_TEXTDRAW_BOX_SIZE_X_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 27@ = 31@ + 0x976 // SAMP_TEXTDRAW_BOX_SIZE_y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 4@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawAlign
{
    0.3.7 R4 - v2
    0AB1: @SetTextdrawAlign 2 ID 1000 Align 1
    Types:
    1 - left
    2 - center
    3 - right
}
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_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            IF 1@ == 1
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 1 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 2
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 1 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 3
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 1 vp 0
            END
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawText
{
    0.3.7 R4 - v2
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Magic is Real!"
    0AB1: @SetTextdrawText 2 ID 1000 Text 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@ += 0x1C // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN 0AA7: call_function 0x718660 num_params 2 pop 2 source 1@ destination 31@ _Returned: value 30@ // Gta Strcpy
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawOutline
{
    0.3.7 R4 - v2
    0AB1: @SetTextdrawOutline 3 ID 1000 Outline 2 Color 0xFF00FF00
}
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_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x984 // SAMP_TEXTDRAW_OUTLINE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_OUTLINE_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawState
{
    0.3.7 R4 - v2
    0AB1: @SetTextdrawState 2 ID 1000 State 1
    States:
    1 - Visible
    0 - Hidden
}
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_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
    0A8D: 30@ readMem 30@ sz 1 vp 0 // READ FIRST BYTE - SECURITY_CHECK
    IF 30@ > 0
    THEN 0A8C: writeMem 31@ sz 1 vl 1@ vp 0
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Create and control SAMP textdraw
PHP:
:CreateTextdraw
{
    0.3.7 R4 - v1
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Textdraw.." 
    0AB1: @CreateTextdraw 4 ID 1000 Text 0@ XY 320.0 224.0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AC8: 30@ = allocate_memory_size 66
    0A8C: write_memory 30@ size 2 value 18 virtual_protect 1
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0.25 virtual_protect 1 // fLetterWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 1.0 virtual_protect 1 // fLetterHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFFFFFFFF virtual_protect 1 // letterColor
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // boxColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // nShadow
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // bOutline
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // m_backgroundColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 1 virtual_protect 1 // m_nStyle
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // unknown
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 2@ virtual_protect 1 // m_fX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 3@ virtual_protect 1 // m_fY
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0 virtual_protect 1 // m_nModel
    30@ += 0x2
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationY
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationZ
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_fZoom
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[0]
    30@ += 0x2
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[1]
    30@ -= 61 // go back to the original pointer.

    0A8E: 29@ = 31@ + 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0

    0A8E: 28@ = 31@ + 0x1E8C0 //SAMP_CREATE_TEXTDRAW_OFFSET
    0AA6: call_method 28@ struct 29@ num_params 3 pop 0 Text 1@ pTransmit 30@ ID 0@  _retVal 6@
END
PHP:
:SetTextdrawLetter
{
    0.3.7 R4 - v1
    0AB1: @SetTextdrawLetter 4 ID 1000 Size 0.25 1.0 color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x963 // SAMP_TEXTDRAW_LETTER_WIDTH_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x967 // SAMP_TEXTDRAW_LETTER_HEIGHT_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x96B // SAMP_TEXTDRAW_LETTER_COLOR_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawStyle
{
    0.3.7 R4 - v1
    0AB1: @SetTextdrawStyle 2 ID 1000 Style 1
    Styles:
    1---4 - txd fonts (client)
    5 - model
    Other types may crash or not display.
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x987 // SAMP_TEXTDRAW_STYLE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawPosition
{
    0.3.7 R4 - v1
    0AB1: @SetTextdrawPosition 3 ID 1000 XY 320.0 224.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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x98B // SAMP_TEXTDRAW_POSITION_X_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x98F // SAMP_TEXTDRAW_POSITION_Y_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawProportional
{
    0.3.7 R4 - v1
    0AB1: @SetTextdrawProportional 2 ID 1000 Proportional 1
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x97E // SAMP_TEXTDRAW_PROPORTIONAL_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawShadow
{
    0.3.7 R4 - v1
    0AB1: @SetTextdrawShadow 3 ID 1000 Shadow 1 Color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x983 // SAMP_TEXTDRAW_SHADOW_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_SHADOW_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawModel
{
    0.3.7 R4 v1
    0AB1: @SetTextdrawModel 8 ID 1000 Model 1247 rotation 350.0 0.0 50.0 zoom 1.5 veh_color 0xF0 0xF0
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x9A8 // SAMP_TEXTDRAW_MODEL_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x9AA // SAMP_TEXTDRAW_ROTATION_X_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x9AE // SAMP_TEXTDRAW_ROTATION_Y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 26@ = 31@ + 0x9B2 // SAMP_TEXTDRAW_ROTATION_Z_OFFSET
            0A8C: writeMem 26@ sz 4 vl 4@ vp 0
            0A8E: 25@ = 31@ + 0x9B6 // SAMP_TEXTDRAW_ZOOM_OFFSET
            0A8C: writeMem 25@ sz 4 vl 5@ vp 0
            0A8E: 24@ = 31@ + 0x9BA // SAMP_TEXTDRAW_VEH_COLOR_X_OFFSET
            0A8C: writeMem 24@ sz 4 vl 6@ vp 0
            0A8E: 23@ = 31@ + 0x9BC // SAMP_TEXTDRAW_VEH_COLOR_Y_OFFSET
            0A8C: writeMem 23@ sz 4 vl 7@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawBox
{
    0.3.7 R4 - v1
    0AB1: @SetTextdrawBox 5 ID 1000 Box 1 Color 0xFF00FF00 Size 10.0 5.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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x971 // SAMP_TEXTDRAW_BOX_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97A // SAMP_TEXTDRAW_BOX_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x972 // SAMP_TEXTDRAW_BOX_SIZE_X_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 27@ = 31@ + 0x976 // SAMP_TEXTDRAW_BOX_SIZE_y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 4@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawAlign
{
    0.3.7 R4 - v1
    0AB1: @SetTextdrawAlign 2 ID 1000 Align 1
    Types:
    1 - left
    2 - center
    3 - right
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            IF 1@ == 1
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 1 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 2
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 1 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 3
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 1 vp 0
            END
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawText
{
    0.3.7 R4 - v1
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Magic is Real!"
    0AB1: @SetTextdrawText 2 ID 1000 Text 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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN 0AA7: call_function 0x718660 num_params 2 pop 2 source 1@ destination 31@ _Returned: value 30@ // Gta Strcpy
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawOutline
{
    0.3.7 R4 - v1
    0AB1: @SetTextdrawOutline 3 ID 1000 Outline 2 Color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x984 // SAMP_TEXTDRAW_OUTLINE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_OUTLINE_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawState
{
    0.3.7 R4 - v1
    0AB1: @SetTextdrawState 2 ID 1000 State 1
    States:
    1 - Visible
    0 - Hidden
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
    0A8D: 30@ readMem 30@ sz 1 vp 0 // READ FIRST BYTE - SECURITY_CHECK
    IF 30@ > 0
    THEN 0A8C: writeMem 31@ sz 1 vl 1@ vp 0
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Create and control SAMP textdraw
PHP:
:CreateTextdraw
{
    0.3.DL
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Textdraw.." 
    0AB1: @CreateTextdraw 4 ID 1000 Text 0@ XY 320.0 224.0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AC8: 30@ = allocate_memory_size 66
    0A8C: write_memory 30@ size 2 value 18 virtual_protect 1
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0.25 virtual_protect 1 // fLetterWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 1.0 virtual_protect 1 // fLetterHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFFFFFFFF virtual_protect 1 // letterColor
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // boxColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // nShadow
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // bOutline
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // m_backgroundColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 1 virtual_protect 1 // m_nStyle
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // unknown
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 2@ virtual_protect 1 // m_fX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 3@ virtual_protect 1 // m_fY
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0 virtual_protect 1 // m_nModel
    30@ += 0x2
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationY
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationZ
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_fZoom
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[0]
    30@ += 0x2
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[1]
    30@ -= 61 // go back to the original pointer.

    0A8E: 29@ = 31@ + 0x2ACA24 // SAMP_INFO_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0

    0A8E: 28@ = 31@ + 0x1E3D0 //SAMP_CREATE_TEXTDRAW_OFFSET
    0AA6: call_method 28@ struct 29@ num_params 3 pop 0 Text 1@ pTransmit 30@ ID 0@  _retVal 6@
END
0AB2: 0
PHP:
:SetTextdrawLetter
{
    0.3.DL
    0AB1: @SetTextdrawLetter 4 ID 1000 Size 0.25 1.0 color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x963 // SAMP_TEXTDRAW_LETTER_WIDTH_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x967 // SAMP_TEXTDRAW_LETTER_HEIGHT_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x96B // SAMP_TEXTDRAW_LETTER_COLOR_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawStyle
{
    0.3.DL
    0AB1: @SetTextdrawStyle 2 ID 1000 Style 1
    Styles:
    1---4 - txd fonts (client)
    5 - model
    Other types may crash or not display.
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x987 // SAMP_TEXTDRAW_STYLE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawPosition
{
    0.3.DL
    0AB1: @SetTextdrawPosition 3 ID 1000 XY 320.0 224.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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x98B // SAMP_TEXTDRAW_POSITION_X_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x98F // SAMP_TEXTDRAW_POSITION_Y_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0

PHP:
:SetTextdrawProportional
{
    0.3.DL
    0AB1: @SetTextdrawProportional 2 ID 1000 Proportional 1
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x97E // SAMP_TEXTDRAW_PROPORTIONAL_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawShadow
{
    0.3.DL
    0AB1: @SetTextdrawShadow 3 ID 1000 Shadow 1 Color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x983 // SAMP_TEXTDRAW_SHADOW_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_SHADOW_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawModel
{
    0.3.DL
    0AB1: @SetTextdrawModel 8 ID 1000 Model 1247 rotation 350.0 0.0 50.0 zoom 1.5 veh_color 0xF0 0xF0
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x9A8 // SAMP_TEXTDRAW_MODEL_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x9AA // SAMP_TEXTDRAW_ROTATION_X_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x9AE // SAMP_TEXTDRAW_ROTATION_Y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 26@ = 31@ + 0x9B2 // SAMP_TEXTDRAW_ROTATION_Z_OFFSET
            0A8C: writeMem 26@ sz 4 vl 4@ vp 0
            0A8E: 25@ = 31@ + 0x9B6 // SAMP_TEXTDRAW_ZOOM_OFFSET
            0A8C: writeMem 25@ sz 4 vl 5@ vp 0
            0A8E: 24@ = 31@ + 0x9BA // SAMP_TEXTDRAW_VEH_COLOR_X_OFFSET
            0A8C: writeMem 24@ sz 4 vl 6@ vp 0
            0A8E: 23@ = 31@ + 0x9BC // SAMP_TEXTDRAW_VEH_COLOR_Y_OFFSET
            0A8C: writeMem 23@ sz 4 vl 7@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawBox
{
    0.3.DL
    0AB1: @SetTextdrawBox 5 ID 1000 Box 1 Color 0xFF00FF00 Size 10.0 5.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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x971 // SAMP_TEXTDRAW_BOX_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97A // SAMP_TEXTDRAW_BOX_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x972 // SAMP_TEXTDRAW_BOX_SIZE_X_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 27@ = 31@ + 0x976 // SAMP_TEXTDRAW_BOX_SIZE_y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 4@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawAlign
{
    0.3.DL
    0AB1: @SetTextdrawAlign 2 ID 1000 Align 1
    Types:
    1 - left
    2 - center
    3 - right
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            IF 1@ == 1
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 1 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 2
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 1 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 3
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 1 vp 0
            END
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawText
{
    0.3.DL
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Magic is Real!"
    0AB1: @SetTextdrawText 2 ID 1000 Text 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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN 0AA7: call_function 0x718660 num_params 2 pop 2 source 1@ destination 31@ _Returned: value 30@ // Gta Strcpy
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawOutline
{
    0.3.DL
    0AB1: @SetTextdrawOutline 3 ID 1000 Outline 2 Color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x984 // SAMP_TEXTDRAW_OUTLINE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_OUTLINE_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawState
{
    0.3.DL
    0AB1: @SetTextdrawState 2 ID 1000 State 1
    States:
    1 - Visible
    0 - Hidden
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
    0A8D: 30@ readMem 30@ sz 1 vp 0 // READ FIRST BYTE - SECURITY_CHECK
    IF 30@ > 0
    THEN 0A8C: writeMem 31@ sz 1 vl 1@ vp 0
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Create and control SAMP textdraw
PHP:
:CreateTextdraw
{
    0.3.7 R2
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Textdraw.." 
    0AB1: @CreateTextdraw 4 ID 1000 Text 0@ XY 320.0 224.0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AC8: 30@ = allocate_memory_size 66
    0A8C: write_memory 30@ size 2 value 18 virtual_protect 1
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0.25 virtual_protect 1 // fLetterWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 1.0 virtual_protect 1 // fLetterHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFFFFFFFF virtual_protect 1 // letterColor
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // boxColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // nShadow
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // bOutline
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // m_backgroundColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 1 virtual_protect 1 // m_nStyle
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // unknown
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 2@ virtual_protect 1 // m_fX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 3@ virtual_protect 1 // m_fY
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0 virtual_protect 1 // m_nModel
    30@ += 0x2
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationY
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationZ
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_fZoom
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[0]
    30@ += 0x2
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[1]
    30@ -= 61 // go back to the original pointer.

    0A8E: 29@ = 31@ + 0x21A100 // SAMP_INFO_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x3C5 // SAMP_PPOOLS_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0

    0A8E: 28@ = 31@ + 0x1AF00 //SAMP_CREATE_TEXTDRAW_OFFSET
    0AA6: call_method 28@ struct 29@ num_params 3 pop 0 Text 1@ pTransmit 30@ ID 0@  _retVal 6@
END
0AB2: 0

PHP:
:SetTextdrawLetter
{
    0.3.7 R2
    0AB1: @SetTextdrawLetter 4 ID 1000 Size 0.25 1.0 color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x963 // SAMP_TEXTDRAW_LETTER_WIDTH_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x967 // SAMP_TEXTDRAW_LETTER_HEIGHT_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x96B // SAMP_TEXTDRAW_LETTER_COLOR_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawStyle
{
    0.3.7 R2
    0AB1: @SetTextdrawStyle 2 ID 1000 Style 1
    Styles:
    1---4 - txd fonts (client)
    5 - model
    Other types may crash or not display.
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x987 // SAMP_TEXTDRAW_STYLE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawPosition
{
    0.3.7 R2
    0AB1: @SetTextdrawPosition 3 ID 1000 XY 320.0 224.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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x98B // SAMP_TEXTDRAW_POSITION_X_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x98F // SAMP_TEXTDRAW_POSITION_Y_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawProportional
{
    0.3.7 R2
    0AB1: @SetTextdrawProportional 2 ID 1000 Proportional 1
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x97E // SAMP_TEXTDRAW_PROPORTIONAL_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawShadow
{
    0.3.7 R2
    0AB1: @SetTextdrawShadow 3 ID 1000 Shadow 1 Color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x983 // SAMP_TEXTDRAW_SHADOW_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_SHADOW_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawModel
{
    0.3.7 R2
    0AB1: @SetTextdrawModel 8 ID 1000 Model 1247 rotation 350.0 0.0 50.0 zoom 1.5 veh_color 0xF0 0xF0
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x9A8 // SAMP_TEXTDRAW_MODEL_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x9AA // SAMP_TEXTDRAW_ROTATION_X_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x9AE // SAMP_TEXTDRAW_ROTATION_Y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 26@ = 31@ + 0x9B2 // SAMP_TEXTDRAW_ROTATION_Z_OFFSET
            0A8C: writeMem 26@ sz 4 vl 4@ vp 0
            0A8E: 25@ = 31@ + 0x9B6 // SAMP_TEXTDRAW_ZOOM_OFFSET
            0A8C: writeMem 25@ sz 4 vl 5@ vp 0
            0A8E: 24@ = 31@ + 0x9BA // SAMP_TEXTDRAW_VEH_COLOR_X_OFFSET
            0A8C: writeMem 24@ sz 4 vl 6@ vp 0
            0A8E: 23@ = 31@ + 0x9BC // SAMP_TEXTDRAW_VEH_COLOR_Y_OFFSET
            0A8C: writeMem 23@ sz 4 vl 7@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawBox
{
    0.3.7 R2
    0AB1: @SetTextdrawBox 5 ID 1000 Box 1 Color 0xFF00FF00 Size 10.0 5.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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x971 // SAMP_TEXTDRAW_BOX_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97A // SAMP_TEXTDRAW_BOX_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x972 // SAMP_TEXTDRAW_BOX_SIZE_X_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 27@ = 31@ + 0x976 // SAMP_TEXTDRAW_BOX_SIZE_y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 4@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawAlign
{
    0.3.7 R2
    0AB1: @SetTextdrawAlign 2 ID 1000 Align 1
    Types:
    1 - left
    2 - center
    3 - right
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            IF 1@ == 1
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 1 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 2
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 1 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 3
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 1 vp 0
            END
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawText
{
    0.3.7 R2
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Magic is Real!"
    0AB1: @SetTextdrawText 2 ID 1000 Text 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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN 0AA7: call_function 0x718660 num_params 2 pop 2 source 1@ destination 31@ _Returned: value 30@ // Gta Strcpy
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawOutline
{
    0.3.7 R2
    0AB1: @SetTextdrawOutline 3 ID 1000 Outline 2 Color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x984 // SAMP_TEXTDRAW_OUTLINE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_OUTLINE_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawState
{
    0.3.7 R2
    0AB1: @SetTextdrawState 2 ID 1000 State 1
    States:
    1 - Visible
    0 - Hidden
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
    0A8D: 30@ readMem 30@ sz 1 vp 0 // READ FIRST BYTE - SECURITY_CHECK
    IF 30@ > 0
    THEN 0A8C: writeMem 31@ sz 1 vl 1@ vp 0
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Create and control SAMP textdraw
PHP:
:CreateTextdraw
{
    0.3.7 R3
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Textdraw.." 
    0AB1: @CreateTextdraw 4 ID 1000 Text 0@ XY 320.0 224.0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AC8: 30@ = allocate_memory_size 66
    0A8C: write_memory 30@ size 2 value 18 virtual_protect 1
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0.25 virtual_protect 1 // fLetterWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 1.0 virtual_protect 1 // fLetterHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFFFFFFFF virtual_protect 1 // letterColor
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxWidth
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // fBoxHeight
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // boxColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // nShadow
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // bOutline
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 0xFF000000 virtual_protect 1 // m_backgroundColor
    30@ += 0x4
    0A8C: write_memory 30@ size 1 value 1 virtual_protect 1 // m_nStyle
    30@ += 0x1
    0A8C: write_memory 30@ size 1 value 0 virtual_protect 1 // unknown
    30@ += 0x1
    0A8C: write_memory 30@ size 4 value 2@ virtual_protect 1 // m_fX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 3@ virtual_protect 1 // m_fY
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0 virtual_protect 1 // m_nModel
    30@ += 0x2
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationX
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationY
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_rotationZ
    30@ += 0x4
    0A8C: write_memory 30@ size 4 value 0.0 virtual_protect 1 // m_fZoom
    30@ += 0x4
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[0]
    30@ += 0x2
    0A8C: write_memory 30@ size 2 value 0xFF virtual_protect 1 // m_aColor[1]
    30@ -= 61 // go back to the original pointer.

    0A8E: 29@ = 31@ + 0x26E8DC // SAMP_INFO_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x3DE // SAMP_PPOOLS_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0
    29@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 29@ readMem 29@ sz 4 vp 0

    0A8E: 28@ = 31@ + 0x1E1C0 //SAMP_CREATE_TEXTDRAW_OFFSET
    0AA6: call_method 28@ struct 29@ num_params 3 pop 0 Text 1@ pTransmit 30@ ID 0@  _retVal 6@
END
0AB2: 0

PHP:
:SetTextdrawLetter
{
    0.3.7 R3
    0AB1: @SetTextdrawLetter 4 ID 1000 Size 0.25 1.0 color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x963 // SAMP_TEXTDRAW_LETTER_WIDTH_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x967 // SAMP_TEXTDRAW_LETTER_HEIGHT_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x96B // SAMP_TEXTDRAW_LETTER_COLOR_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawStyle
{
    0.3.7 R3
    0AB1: @SetTextdrawStyle 2 ID 1000 Style 1
    Styles:
    1---4 - txd fonts (client)
    5 - model
    Other types may crash or not display.
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x987 // SAMP_TEXTDRAW_STYLE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawPosition
{
    0.3.7 R3
    0AB1: @SetTextdrawPosition 3 ID 1000 XY 320.0 224.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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x98B // SAMP_TEXTDRAW_POSITION_X_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x98F // SAMP_TEXTDRAW_POSITION_Y_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawProportional
{
    0.3.7 R3
    0AB1: @SetTextdrawProportional 2 ID 1000 Proportional 1
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x97E // SAMP_TEXTDRAW_PROPORTIONAL_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawShadow
{
    0.3.7 R3
    0AB1: @SetTextdrawShadow 3 ID 1000 Shadow 1 Color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x983 // SAMP_TEXTDRAW_SHADOW_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_SHADOW_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawModel
{
    0.3.7 R3
    0AB1: @SetTextdrawModel 8 ID 1000 Model 1247 rotation 350.0 0.0 50.0 zoom 1.5 veh_color 0xF0 0xF0
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x9A8 // SAMP_TEXTDRAW_MODEL_OFFSET
            0A8C: writeMem 29@ sz 4 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x9AA // SAMP_TEXTDRAW_ROTATION_X_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x9AE // SAMP_TEXTDRAW_ROTATION_Y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 26@ = 31@ + 0x9B2 // SAMP_TEXTDRAW_ROTATION_Z_OFFSET
            0A8C: writeMem 26@ sz 4 vl 4@ vp 0
            0A8E: 25@ = 31@ + 0x9B6 // SAMP_TEXTDRAW_ZOOM_OFFSET
            0A8C: writeMem 25@ sz 4 vl 5@ vp 0
            0A8E: 24@ = 31@ + 0x9BA // SAMP_TEXTDRAW_VEH_COLOR_X_OFFSET
            0A8C: writeMem 24@ sz 4 vl 6@ vp 0
            0A8E: 23@ = 31@ + 0x9BC // SAMP_TEXTDRAW_VEH_COLOR_Y_OFFSET
            0A8C: writeMem 23@ sz 4 vl 7@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawBox
{
    0.3.7 R3
    0AB1: @SetTextdrawBox 5 ID 1000 Box 1 Color 0xFF00FF00 Size 10.0 5.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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x971 // SAMP_TEXTDRAW_BOX_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97A // SAMP_TEXTDRAW_BOX_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
            0A8E: 27@ = 31@ + 0x972 // SAMP_TEXTDRAW_BOX_SIZE_X_OFFSET
            0A8C: writeMem 27@ sz 4 vl 3@ vp 0
            0A8E: 27@ = 31@ + 0x976 // SAMP_TEXTDRAW_BOX_SIZE_y_OFFSET
            0A8C: writeMem 27@ sz 4 vl 4@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawAlign
{
    0.3.7 R3
    0AB1: @SetTextdrawAlign 2 ID 1000 Align 1
    Types:
    1 - left
    2 - center
    3 - right
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            IF 1@ == 1
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 1 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 2
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 1 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 0 vp 0
            END
            IF 1@ == 3
            THEN
                0A8E: 29@ = 31@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
                0A8C: writeMem 29@ sz 1 vl 0 vp 0
                0A8E: 28@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
                0A8C: writeMem 28@ sz 1 vl 0 vp 0
                0A8E: 27@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
                0A8C: writeMem 27@ sz 1 vl 1 vp 0
            END
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawText
{
    0.3.7 R3
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Magic is Real!"
    0AB1: @SetTextdrawText 2 ID 1000 Text 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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN 0AA7: call_function 0x718660 num_params 2 pop 2 source 1@ destination 31@ _Returned: value 30@ // Gta Strcpy
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawOutline
{
    0.3.7 R3
    0AB1: @SetTextdrawOutline 3 ID 1000 Outline 2 Color 0xFF00FF00
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8D: 30@ readMem 31@ sz 4 vp 0
    IF 30@ == TRUE
    THEN
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        IF 31@ > 0
        THEN
            0A8E: 29@ = 31@ + 0x984 // SAMP_TEXTDRAW_OUTLINE_OFFSET
            0A8C: writeMem 29@ sz 1 vl 1@ vp 0
            0A8E: 28@ = 31@ + 0x97F // SAMP_TEXTDRAW_OUTLINE_COLOR_OFFSET
            0A8C: writeMem 28@ sz 4 vl 2@ vp 0
        END
    END
END
0AB2: 0
PHP:
:SetTextdrawState
{
    0.3.7 R3
    0AB1: @SetTextdrawState 2 ID 1000 State 1
    States:
    1 - Visible
    0 - Hidden
}
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@ += 0x20 // SAMP_PPOOL_TEXTDRAW_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    0@ *= 0x4 // TEXTDRAW_ID * 4
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
    0A8D: 30@ readMem 30@ sz 1 vp 0 // READ FIRST BYTE - SECURITY_CHECK
    IF 30@ > 0
    THEN 0A8C: writeMem 31@ sz 1 vl 1@ vp 0
    END
END
0AB2: 0
 
  • Wow
Reactions: Krc

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
0AB1: @DisableCrosshair 1 State True // True = disable crosshair , False = enable crosshair
PHP:
:DisableCrosshair
// 0AB1: @DisableCrosshair 1 State True // True = disable crosshair , False = enable crosshair
IF 0@ == FALSE // ENABLE
THEN
    // Enable sniper crosshair including box on sides..
    0A8C: write_memory 0x53E31B size 4 value 0x7422FE83 virtual_protect 1
    0A8C: write_memory 0x53E31F size 1 value 0x09 virtual_protect 1
    0A8C: write_memory 0x58E703 size 4 value 0xF22FA83 virtual_protect 1
    0A8C: write_memory 0x58E707 size 4 value 0x00009484 virtual_protect 1
    0A8C: write_memory 0x58E70B size 1 value 0x00 virtual_protect 1
    // Enable any other weapon crosshair
    0A8C: write_memory 0x58E020 size 1 value 0x83 virtual_protect 1
ELSE
    // Disable sniper crosshair including box on sides..
    0A8C: write_memory 0x53E31B size 4 value 0x90909090 virtual_protect 1
    0A8C: write_memory 0x53E31F size 1 value 0x90 virtual_protect 1
    0A8C: write_memory 0x58E703 size 4 value 0x90909090 virtual_protect 1
    0A8C: write_memory 0x58E707 size 4 value 0x90909090 virtual_protect 1
    0A8C: write_memory 0x58E70B size 1 value 0x90 virtual_protect 1
    // Disable any other weapon crosshair
    0A8C: write_memory 0x58E020 size 1 value 0xC3 virtual_protect 1
END
0AB2: ret 0
 
Last edited:
  • Like
Reactions: Krc

xAmUser

Active member
Joined
Feb 23, 2018
Messages
55
Reaction score
3
PHP:
0AB1: @DisableCorosshair 1 State True // True = disable crosshair , False = enable crosshair
PHP:
:DisableCorosshair
// 0AB1: @DisableCorosshair 1 State True // True = disable crosshair , False = enable crosshair
IF 0@ == FALSE // ENABLE
THEN
    // Enable sniper crosshair including box on sides..
    0A8C: write_memory 0x53E31B size 4 value 0x7422FE83 virtual_protect 1
    0A8C: write_memory 0x53E31F size 1 value 0x09 virtual_protect 1
    0A8C: write_memory 0x58E703 size 4 value 0xF22FA83 virtual_protect 1
    0A8C: write_memory 0x58E707 size 4 value 0x00009484 virtual_protect 1
    0A8C: write_memory 0x58E70B size 1 value 0x00 virtual_protect 1
    // Enable any other weapon crosshair
    0A8C: write_memory 0x58E020 size 1 value 0x83 virtual_protect 1
ELSE
    // Disable sniper crosshair including box on sides..
    0A8C: write_memory 0x53E31B size 4 value 0x90909090 virtual_protect 1
    0A8C: write_memory 0x53E31F size 1 value 0x90 virtual_protect 1
    0A8C: write_memory 0x58E703 size 4 value 0x90909090 virtual_protect 1
    0A8C: write_memory 0x58E707 size 4 value 0x90909090 virtual_protect 1
    0A8C: write_memory 0x58E70B size 1 value 0x90 virtual_protect 1
    // Disable any other weapon crosshair
    0A8C: write_memory 0x58E020 size 1 value 0xC3 virtual_protect 1
END
0AB2: ret 0
And how to make the sight be always visible?
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Windows Libaries snippets for string comparing
PHP:
:CompareString
{
    0AB1: @CompareString 2 String1 0@ String2 1@
}
IF 0AA2: 31@ = load_dynamic_library "Shlwapi.dll"
THEN
    IF 0AA4: 30@ = get_dynamic_library_procedure "StrCmpIW" library 31@
    THEN       
        0AA5: call 0x718740 num_params 1 pop 1 0@ // lowercase string1
        0AA5: call 0x718740 num_params 1 pop 1 1@ // lowercase string2
        0AA7: call_function 30@ num_params 2 pop 0 String2 1@ String1 0@ _Returned: 29@
        IF 29@ == 0 // same
        THEN 0485:  return_true
        ELSE 059A:  return_false    
        END
    END
    0AA3: free_dynamic_library 31@
END
0AB2: cleo_return 0
PHP:
:IfTextContains
{
    0AB1: @IfTextContains 2 String1 0@ String2 1@ _Returned: Text 2@
}
IF 0AA2: 31@ = load_dynamic_library "Shlwapi.dll"
THEN
    IF 0AA4: 30@ = get_dynamic_library_procedure "StrStrIA" library 31@
    THEN       
        0AA5: call 0x718740 num_params 1 pop 1 0@ // lowercase
        0AA5: call 0x718740 num_params 1 pop 1 1@ // lowercase
        0AA7: call_function 30@ num_params 2 pop 0 String2 1@ String1 0@ _Returned: Text 29@
        IF 29@ > 0
        THEN 
            0485:  return_true
            0AB2: cleo_return 1 29@
        ELSE 059A:  return_false    
        END
    END
    0AA3: free_dynamic_library 31@
END
0AB2: cleo_return 0
 

Fr0z3n

Well-known member
Joined
Nov 20, 2019
Messages
301
Reaction score
36
Location
Srbija
I am pretty sure that you can do like this
IF 29@ != 0 then ret 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:SetCurrentDialogListItem
{
    0.3.7 - R1
    0AB1: @SetCurrentDialogListItem 1 Item 1
}
if 0AA2: 2@ = "samp.dll"
then
    0A8E: 3@ = 2@ + 0x21A0B8       
    0A8D: 3@ = readMem 3@ sz 4 vp 0   
    0A8E: 4@ = 3@ + 0x20              
    0A8D: 4@ = readMem 4@ sz 4 vp 0   
 
    0A8E: 5@ = 2@ + 0x863C0
 
    0AA8: call_function_method 5@ struct 4@ num_params 1 pop 0 0@ _Return: 31@
end
0AB2: 0
 
Status
Not open for further replies.
Top