[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:
:isDialogResponded
{
    0.3.7 R1
    IF 0AB1: @isDialogResponded 0 id 0@ button 1@ list_item 2@ input_text 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0
    
    0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    
    0A8E: 28@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET
    0A8D: 28@ = read_memory 28@ size 4 virtual_protect 0
       
    0A8E: 27@ = 30@ + 0x30 // SAMP_DIALOG_ID_OFFSET
    0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
    // Hook_RPC_DIALOGRESPONSE
    CONST
    VAR1 = $2AFD
    VAR2 = $2BEC
    VAR3 = $2CDE
    VAR4 = $2DCB
    END
    0AC8: VAR1 = allocate_memory_size 17
    0A8C: write_memory VAR1 size 4 value 0x08458B50 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xA3 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 2 value 0x6458 virtual_protect 1
    VAR1 += 2
    0A8C: write_memory VAR1 size 1 value 0xA1 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xC3 virtual_protect 1
    VAR1 -= 16
    
    0A8E: VAR2 = 31@ + 0x6C04D // SAMP_DIALOG_RESPONSE_OFFSET + 0xD
    
    VAR1 += 0x5

    0AC7: VAR4 = var VAR3 offset
    0A8C: write_memory VAR1 size 4 value VAR4 virtual_protect 1
    
    VAR1 -= 0x5
    // asm_call_hook
    0A8C: write_memory VAR2 size 1 value 0xE8 virtual_protect 1
    0062: VAR1 -= VAR2 // (int)
    000E: VAR1 -= 5
    VAR2 += 1
    0A8C: write_memory VAR2 size 4 value VAR1 virtual_protect 1
    //
    VAR2 += 0x4
    0A8C: write_memory VAR2 size 1 value 0x90 virtual_protect 1 // NOP
    // END
    
    0A8E: 26@ = 31@ + 0x84850 // SAMP_GET_DIALOG_LIST_ITEM_OFFSET
    0AA8: call_function_method 26@ struct 29@ num_params 1 pop 0 -1 _Return: 25@
    
    0A8E: 24@ = 31@ + 0x81030 // SAMP_GET_DIALOG_EDIT_BOX_TEXT_OFFSET
    0AA8: call_function_method 24@ struct 28@ num_params 0 pop 0 _Returned: Input Text 23@
    IF OR
    27@ > -1
    VAR3 > -1
    25@ > -1
    23@ > 0
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: ret 4 27@ VAR3 25@ 23@
PHP:
:isDialogResponded
{
    0.3.7 R2
    IF 0AB1: @isDialogResponded 0 id 0@ button 1@ list_item 2@ input_text 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0
    
    0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    
    0A8E: 28@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET
    0A8D: 28@ = read_memory 28@ size 4 virtual_protect 0
       
    0A8E: 27@ = 30@ + 0x30 // SAMP_DIALOG_ID_OFFSET
    0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
    // Hook_RPC_DIALOGRESPONSE
    CONST
    VAR1 = $2AFD
    VAR2 = $2BEC
    VAR3 = $2CDE
    VAR4 = $2DCB
    END
    0AC8: VAR1 = allocate_memory_size 17
    0A8C: write_memory VAR1 size 4 value 0x08458B50 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xA3 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 2 value 0x6458 virtual_protect 1
    VAR1 += 2
    0A8C: write_memory VAR1 size 1 value 0xA1 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xC3 virtual_protect 1
    VAR1 -= 16
    
    0A8E: VAR2 = 31@ + 0x6C0FD // SAMP_DIALOG_RESPONSE_OFFSET + 0xD
    
    VAR1 += 0x5

    0AC7: VAR4 = var VAR3 offset
    0A8C: write_memory VAR1 size 4 value VAR4 virtual_protect 1
    
    VAR1 -= 0x5
    // asm_call_hook
    0A8C: write_memory VAR2 size 1 value 0xE8 virtual_protect 1
    0062: VAR1 -= VAR2 // (int)
    000E: VAR1 -= 5
    VAR2 += 1
    0A8C: write_memory VAR2 size 4 value VAR1 virtual_protect 1
    //
    VAR2 += 0x4
    0A8C: write_memory VAR2 size 1 value 0x90 virtual_protect 1 // NOP
    // END
    
    0A8E: 26@ = 31@ + 0x848F0 // SAMP_GET_DIALOG_LIST_ITEM_OFFSET
    0AA8: call_function_method 26@ struct 29@ num_params 1 pop 0 -1 _Return: 25@
    
    0A8E: 24@ = 31@ + 0x810D0  // SAMP_GET_DIALOG_EDIT_BOX_TEXT_OFFSET
    0AA8: call_function_method 24@ struct 28@ num_params 0 pop 0 _Returned: Input Text 23@
    IF OR
    27@ > -1
    VAR3 > -1
    25@ > -1
    23@ > 0
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: ret 4 27@ VAR3 25@ 23@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:isDialogResponded
{
    0.3.DL
    IF 0AB1: @isDialogResponded 0 id 0@ button 1@ list_item 2@ input_text 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0
    
    0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    
    0A8E: 28@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET
    0A8D: 28@ = read_memory 28@ size 4 virtual_protect 0
       
    0A8E: 27@ = 30@ + 0x30 // SAMP_DIALOG_ID_OFFSET
    0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
    // Hook_RPC_DIALOGRESPONSE
    CONST
    VAR1 = $2AFD
    VAR2 = $2BEC
    VAR3 = $2CDE
    VAR4 = $2DCB
    END
    0AC8: VAR1 = allocate_memory_size 17
    0A8C: write_memory VAR1 size 4 value 0x08458B50 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xA3 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 2 value 0x6458 virtual_protect 1
    VAR1 += 2
    0A8C: write_memory VAR1 size 1 value 0xA1 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xC3 virtual_protect 1
    VAR1 -= 16
    
    0A8E: VAR2 = 31@ + 0x700DD // SAMP_DIALOG_RESPONSE_OFFSET + 0xD
    
    VAR1 += 0x5

    0AC7: VAR4 = var VAR3 offset
    0A8C: write_memory VAR1 size 4 value VAR4 virtual_protect 1
    
    VAR1 -= 0x5
    // asm_call_hook
    0A8C: write_memory VAR2 size 1 value 0xE8 virtual_protect 1
    0062: VAR1 -= VAR2 // (int)
    000E: VAR1 -= 5
    VAR2 += 1
    0A8C: write_memory VAR2 size 4 value VAR1 virtual_protect 1
    //
    VAR2 += 0x4
    0A8C: write_memory VAR2 size 1 value 0x90 virtual_protect 1 // NOP
    // END
    
    0A8E: 26@ = 31@ + 0x888F0 // SAMP_GET_DIALOG_LIST_ITEM_OFFSET
    0AA8: call_function_method 26@ struct 29@ num_params 1 pop 0 -1 _Return: 25@
    
    0A8E: 24@ = 31@ + 0x850D0  // SAMP_GET_DIALOG_EDIT_BOX_TEXT_OFFSET
    0AA8: call_function_method 24@ struct 28@ num_params 0 pop 0 _Returned: Input Text 23@
    IF OR
    27@ > -1
    VAR3 > -1
    25@ > -1
    23@ > 0
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: ret 4 27@ VAR3 25@ 23@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:isDialogResponded
{
    0.3.7 R3
    IF 0AB1: @isDialogResponded 0 id 0@ button 1@ list_item 2@ input_text 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0
    
    0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    
    0A8E: 28@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET
    0A8D: 28@ = read_memory 28@ size 4 virtual_protect 0
       
    0A8E: 27@ = 30@ + 0x30 // SAMP_DIALOG_ID_OFFSET
    0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
    // Hook_RPC_DIALOGRESPONSE
    CONST
    VAR1 = $2AFD
    VAR2 = $2BEC
    VAR3 = $2CDE
    VAR4 = $2DCB
    END
    0AC8: VAR1 = allocate_memory_size 17
    0A8C: write_memory VAR1 size 4 value 0x08458B50 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xA3 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 2 value 0x6458 virtual_protect 1
    VAR1 += 2
    0A8C: write_memory VAR1 size 1 value 0xA1 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xC3 virtual_protect 1
    VAR1 -= 16
    
    0A8E: VAR2 = 31@ + 0x6FF4D // SAMP_DIALOG_RESPONSE_OFFSET + 0xD
    
    VAR1 += 0x5

    0AC7: VAR4 = var VAR3 offset
    0A8C: write_memory VAR1 size 4 value VAR4 virtual_protect 1
    
    VAR1 -= 0x5
    // asm_call_hook
    0A8C: write_memory VAR2 size 1 value 0xE8 virtual_protect 1
    0062: VAR1 -= VAR2 // (int)
    000E: VAR1 -= 5
    VAR2 += 1
    0A8C: write_memory VAR2 size 4 value VAR1 virtual_protect 1
    //
    VAR2 += 0x4
    0A8C: write_memory VAR2 size 1 value 0x90 virtual_protect 1 // NOP
    // END
    
    0A8E: 26@ = 31@ + 0x88760 // SAMP_GET_DIALOG_LIST_ITEM_OFFSET
    0AA8: call_function_method 26@ struct 29@ num_params 1 pop 0 -1 _Return: 25@
    
    0A8E: 24@ = 31@ + 0x84F40  // SAMM8ECLaq9zC4xgck6QUJACuAxDkZyouDAn
    0AA8: call_function_method 24@ struct 28@ num_params 0 pop 0 _Returned: Input Text 23@
    IF OR
    27@ > -1
    VAR3 > -1
    25@ > -1
    23@ > 0
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: ret 4 27@ VAR3 25@ 23@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:isDialogResponded
{
    0.3.7 R4 v1
    IF 0AB1: @isDialogResponded 0 id 0@ button 1@ list_item 2@ input_text 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0
    
    0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    
    0A8E: 28@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET
    0A8D: 28@ = read_memory 28@ size 4 virtual_protect 0
       
    0A8E: 27@ = 30@ + 0x30 // SAMP_DIALOG_ID_OFFSET
    0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
    // Hook_RPC_DIALOGRESPONSE
    CONST
    VAR1 = $2AFD
    VAR2 = $2BEC
    VAR3 = $2CDE
    VAR4 = $2DCB
    END
    0AC8: VAR1 = allocate_memory_size 17
    0A8C: write_memory VAR1 size 4 value 0x08458B50 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xA3 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 2 value 0x6458 virtual_protect 1
    VAR1 += 2
    0A8C: write_memory VAR1 size 1 value 0xA1 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xC3 virtual_protect 1
    VAR1 -= 16
    
    0A8E: VAR2 = 31@ + 0x7066D // SAMP_DIALOG_RESPONSE_OFFSET + 0xD
    
    VAR1 += 0x5

    0AC7: VAR4 = var VAR3 offset
    0A8C: write_memory VAR1 size 4 value VAR4 virtual_protect 1
    
    VAR1 -= 0x5
    // asm_call_hook
    0A8C: write_memory VAR2 size 1 value 0xE8 virtual_protect 1
    0062: VAR1 -= VAR2 // (int)
    000E: VAR1 -= 5
    VAR2 += 1
    0A8C: write_memory VAR2 size 4 value VAR1 virtual_protect 1
    //
    VAR2 += 0x4
    0A8C: write_memory VAR2 size 1 value 0x90 virtual_protect 1 // NOP
    // END
    
    0A8E: 26@ = 31@ + 0x88EA0 // SAMP_GET_DIALOG_LIST_ITEM_OFFSET
    0AA8: call_function_method 26@ struct 29@ num_params 1 pop 0 -1 _Return: 25@
                      
    0A8E: 24@ = 31@ + 0x85680  // SAMM8ECLaq9zC4xgck6QUJACuAxDkZyouDAn    --------
    0AA8: call_function_method 24@ struct 28@ num_params 0 pop 0 _Returned: Input Text 23@
    IF OR
    27@ > -1
    VAR3 > -1
    25@ > -1
    23@ > 0
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: ret 4 27@ VAR3 25@ 23@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:isDialogResponded
{
    0.3.7 R4 v2
    IF 0AB1: @isDialogResponded 0 id 0@ button 1@ list_item 2@ input_text 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0
    
    0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET
    0A8D: 29@ = read_memory 29@ size 4 virtual_protect 0
    
    0A8E: 28@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET
    0A8D: 28@ = read_memory 28@ size 4 virtual_protect 0
       
    0A8E: 27@ = 30@ + 0x30 // SAMP_DIALOG_ID_OFFSET
    0A8D: 27@ = read_memory 27@ size 4 virtual_protect 0
    // Hook_RPC_DIALOGRESPONSE
    CONST
    VAR1 = $2AFD
    VAR2 = $2BEC
    VAR3 = $2CDE
    VAR4 = $2DCB
    END
    0AC8: VAR1 = allocate_memory_size 17
    0A8C: write_memory VAR1 size 4 value 0x08458B50 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xA3 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 2 value 0x6458 virtual_protect 1
    VAR1 += 2
    0A8C: write_memory VAR1 size 1 value 0xA1 virtual_protect 1
    VAR1 += 1
    0A8C: write_memory VAR1 size 4 value 0x00000000 virtual_protect 1
    VAR1 += 4
    0A8C: write_memory VAR1 size 1 value 0xC3 virtual_protect 1
    VAR1 -= 16
    
    0A8E: VAR2 = 31@ + 0x7069D // SAMP_DIALOG_RESPONSE_OFFSET + 0xD
    
    VAR1 += 0x5

    0AC7: VAR4 = var VAR3 offset
    0A8C: write_memory VAR1 size 4 value VAR4 virtual_protect 1
    
    VAR1 -= 0x5
    // asm_call_hook
    0A8C: write_memory VAR2 size 1 value 0xE8 virtual_protect 1
    0062: VAR1 -= VAR2 // (int)
    000E: VAR1 -= 5
    VAR2 += 1
    0A8C: write_memory VAR2 size 4 value VAR1 virtual_protect 1
    //
    VAR2 += 0x4
    0A8C: write_memory VAR2 size 1 value 0x90 virtual_protect 1 // NOP
    // END
    
    0A8E: 26@ = 31@ + 0x88ED0 // SAMP_GET_DIALOG_LIST_ITEM_OFFSET
    0AA8: call_function_method 26@ struct 29@ num_params 1 pop 0 -1 _Return: 25@
                      
    0A8E: 24@ = 31@ + 0x856B0  // SAMP_GET_DIALOG_EDIT_BOX_TEXT_OFFSET
    0AA8: call_function_method 24@ struct 28@ num_params 0 pop 0 _Returned: Input Text 23@
    IF OR
    27@ > -1
    VAR3 > -1
    25@ > -1
    23@ > 0
    THEN 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: ret 4 27@ VAR3 25@ 23@
 

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 // SAMP_DIALOG_INFO_OFFSET        
    0A8D: 3@ = readMem 3@ sz 4 vp 0   
    0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
    0A8D: 4@ = readMem 4@ sz 4 vp 0   
 
    0A8E: 5@ = 2@ + 0x863C0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
 
    0AA8: call_function_method 5@ struct 4@ num_params 1 pop 0 0@ _Return: 31@
end
0AB2: 0
PHP:
:SetCurrentDialogListItem
{
    0.3.7 - R2
    0AB1: @SetCurrentDialogListItem 1 Item 1
}
if 0AA2: 2@ = "samp.dll"
then
    0A8E: 3@ = 2@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET       
    0A8D: 3@ = readMem 3@ sz 4 vp 0   
    0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
    0A8D: 4@ = readMem 4@ sz 4 vp 0   
 
    0A8E: 5@ = 2@ + 0x86460 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
 
    0AA8: call_function_method 5@ struct 4@ num_params 1 pop 0 0@ _Return: 31@
end
0AB2: 0
PHP:
:SetCurrentDialogListItem
{
    0.3.7 - R3
    0AB1: @SetCurrentDialogListItem 1 Item 1
}
if 0AA2: 2@ = "samp.dll"
then
    0A8E: 3@ = 2@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET       
    0A8D: 3@ = readMem 3@ sz 4 vp 0   
    0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
    0A8D: 4@ = readMem 4@ sz 4 vp 0   
 
    0A8E: 5@ = 2@ + 0x8A2E0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
 
    0AA8: call_function_method 5@ struct 4@ num_params 1 pop 0 0@ _Return: 31@
end
0AB2: 0
PHP:
:SetCurrentDialogListItem
{
    0.3.7 - R4 v1
    0AB1: @SetCurrentDialogListItem 1 Item 1
}
if 0AA2: 2@ = "samp.dll"
then
    0A8E: 3@ = 2@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET       
    0A8D: 3@ = readMem 3@ sz 4 vp 0   
    0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
    0A8D: 4@ = readMem 4@ sz 4 vp 0   
 
    0A8E: 5@ = 2@ + 0x8AA20 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
 
    0AA8: call_function_method 5@ struct 4@ num_params 1 pop 0 0@ _Return: 31@
end
0AB2: 0
PHP:
:SetCurrentDialogListItem
{
    0.3.7 - R4 v2
    0AB1: @SetCurrentDialogListItem 1 Item 1
}
if 0AA2: 2@ = "samp.dll"
then
    0A8E: 3@ = 2@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET       
    0A8D: 3@ = readMem 3@ sz 4 vp 0   
    0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
    0A8D: 4@ = readMem 4@ sz 4 vp 0   
 
    0A8E: 5@ = 2@ + 0x8AA50 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
 
    0AA8: call_function_method 5@ struct 4@ num_params 1 pop 0 0@ _Return: 31@
end
0AB2: 0
PHP:
:SetCurrentDialogListItem
{
    0.3.DL
    0AB1: @SetCurrentDialogListItem 1 Item 1
}
if 0AA2: 2@ = "samp.dll"
then
    0A8E: 3@ = 2@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET       
    0A8D: 3@ = readMem 3@ sz 4 vp 0   
    0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
    0A8D: 4@ = readMem 4@ sz 4 vp 0   
 
    0A8E: 5@ = 2@ + 0x8A470 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
 
    0AA8: call_function_method 5@ struct 4@ num_params 1 pop 0 0@ _Return: 31@
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 R5
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "Now you see this 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@ + 0x26EB94 // 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 R5
    0AB1: @SetTextdrawLetter 4 ID 1000 Size 0.25 1.0 color 0xFF00FF00
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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 R5
    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@ += 0x26EB94 // 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 R5
    0AB1: @SetTextdrawPosition 3 ID 1000 XY 320.0 224.0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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 R5
    0AB1: @SetTextdrawProportional 2 ID 1000 Proportional 1
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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 R5
    0AB1: @SetTextdrawShadow 3 ID 1000 Shadow 1 Color 0xFF00FF00
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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 R5
    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@ += 0x26EB94 // 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 R5
    0AB1: @SetTextdrawBox 5 ID 1000 Box 1 Color 0xFF00FF00 Size 10.0 5.0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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 R5
    0AB1: @SetTextdrawAlign 2 ID 1000 Align 1
    Types:
    1 - left
    2 - center
    3 - right
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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 R5
    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@ += 0x26EB94 // 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 R5
    0AB1: @SetTextdrawOutline 3 ID 1000 Outline 2 Color 0xFF00FF00
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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 R5
    0AB1: @SetTextdrawState 2 ID 1000 State 1
    States:
    1 - Visible
    0 - Hidden
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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
Get SAMP textdraw info
PHP:
:IsSampTextDrawExist
{
    0.3.7 R5
    0AB1: @IsSampTextDrawExist 1 TextDrawID 1000
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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 0485:  return_true
    ELSE 059A:  return_false
    END
END
0AB2: 0
PHP:
:GetTextdrawLetter
{
    0.3.7 R5
    0AB1: @GetTextdrawLetter 1 ID 1000 _Returned: Size 0@ 1@ color 2@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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
            0A8D: 28@ readMem 29@ sz 4 vp 0
            0A8E: 27@ = 31@ + 0x967 // SAMP_TEXTDRAW_LETTER_HEIGHT_OFFSET
            0A8D: 26@ readMem 27@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x96B // SAMP_TEXTDRAW_LETTER_COLOR_OFFSET
            0A8D: 24@ readMem 25@ sz 4 vp 0
        END
    END
END
0AB2: 3 28@ 26@ 24@
PHP:
:GetTextdrawStyle
{
    0.3.7 R5
    0AB1: @GetTextdrawStyle 1 ID 1000 _Returned: Style 0@
    Styles:
    1---4 - txd fonts (client)
    5 - model
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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
            0A8D: 28@ readMem 29@ sz 1 vp 0
        END
    END
END
0AB2: 1 28@
PHP:
:GetTextdrawPosition
{
    0.3.7 R5
    0AB1: @GetTextdrawPosition 1 ID 1000 _Returned: XY 0@ 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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
            0A8D: 28@ readMem 29@ sz 4 vp 0
            0A8E: 27@ = 31@ + 0x98F // SAMP_TEXTDRAW_POSITION_Y_OFFSET
            0A8D: 26@ readMem 27@ sz 4 vp 0
        END
    END
END
0AB2: 2 28@ 26@
PHP:
:GetTextdrawProportional
{
    0.3.7 R5
    0AB1: @GetTextdrawProportional 1 ID 1000 _Returned: Proportional 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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
            0A8D: 28@ readMem 31@ sz 1 vp 0
        END
    END
END
0AB2: 1 28@
PHP:
:GetTextdrawShadow
{
    0.3.7 R5
    0AB1: @GetTextdrawShadow 1 ID 1000 _Returned: Shadow 0@ Color 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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
            0A8D: 28@ readMem 29@ sz 1 vp 0
            0A8E: 27@ = 31@ + 0x97F // SAMP_TEXTDRAW_SHADOW_COLOR_OFFSET
            0A8D: 26@ readMem 27@ sz 4 vp 0
        END
    END
END
0AB2: 2 28@ 26@
PHP:
:GetTextdrawModel
{
    0.3.7 R5
    0AB1: @GetTextdrawModel 1 ID 1000 _Returned: Model 0@ rotation 1@ 2@ 3@ zoom 4@ veh_color 5@ 6@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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
            0A8D: 28@ readMem 29@ sz 4 vp 0
            0A8E: 27@ = 31@ + 0x9AA // SAMP_TEXTDRAW_ROTATION_X_OFFSET
            0A8D: 26@ readMem 27@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x9AE // SAMP_TEXTDRAW_ROTATION_Y_OFFSET
            0A8D: 24@ readMem 25@ sz 4 vp 0
            0A8E: 23@ = 31@ + 0x9B2 // SAMP_TEXTDRAW_ROTATION_Z_OFFSET
            0A8D: 22@ readMem 23@ sz 4 vp 0
            0A8E: 21@ = 31@ + 0x9B6 // SAMP_TEXTDRAW_ZOOM_OFFSET
            0A8D: 20@ readMem 21@ sz 4 vp 0
            0A8E: 19@ = 31@ + 0x9BA // SAMP_TEXTDRAW_VEH_COLOR_X_OFFSET
            0A8D: 18@ readMem 19@ sz 4 vp 0
            0A8E: 17@ = 31@ + 0x9BC // SAMP_TEXTDRAW_VEH_COLOR_Y_OFFSET
            0A8D: 16@ readMem 17@ sz 4 vp 0
        END
    END
END
0AB2: 7 28@ 26@ 24@ 22@ 20@ 18@ 16@
PHP:
:GetTextdrawBox
{
    0.3.7 R5
    0AB1: @GetTextdrawBox 1 ID 1000 _Returned: Box 0@ Color 1@ Size 2@ 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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
            0A8D: 28@ readMem 29@ sz 1 vp 0
            0A8E: 27@ = 31@ + 0x97A // SAMP_TEXTDRAW_BOX_COLOR_OFFSET
            0A8D: 26@ readMem 27@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x972 // SAMP_TEXTDRAW_BOX_SIZE_X_OFFSET
            0A8D: 24@ readMem 25@ sz 4 vp 0
            0A8E: 23@ = 31@ + 0x976 // SAMP_TEXTDRAW_BOX_SIZE_y_OFFSET
            0A8D: 22@ readMem 23@ sz 4 vp 0
        END
    END
END
0AB2: 4 28@ 26@ 24@ 22@
PHP:
:GetTextdrawAlign
{
    0.3.7 R5
    0AB1: @GetTextdrawAlign 1 ID 1000 _Returned: Align 0@
    Types:
    1 - left
    2 - center
    3 - right
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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@ + 0x985 // SAMP_TEXTDRAW_ALIGN_1_OFFSET
            0A8D: 28@ readMem 29@ sz 1 vp 0
            0A8E: 27@ = 31@ + 0x970 // SAMP_TEXTDRAW_ALIGN_2_OFFSET
            0A8D: 26@ readMem 27@ sz 1 vp 0
            0A8E: 25@ = 31@ + 0x986 // SAMP_TEXTDRAW_ALIGN_3_OFFSET
            0A8D: 24@ readMem 25@ sz 1 vp 0
            IF AND
            28@ == 1
            26@ == 0
            24@ == 0
            THEN 23@ = 1
            END
            IF AND
            28@ == 0
            26@ == 1
            24@ == 0
            THEN 23@ = 2
            END
            IF AND
            28@ == 0
            26@ == 0
            24@ == 1
            THEN 23@ = 3
            END
        END
    END
END
0AB2: 1 23@
PHP:
:GetTextDrawText
{
    0.3.7 R5
    0AB1: @GetTextDrawText 1 TextDrawID 1000 _Returned: Text 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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
        0485:  return_true
        31@ += 0x2400  // SAMP_TEXTDRAW_STRUCT_OFFSET
        0A8D: 31@ readMem 31@ sz 4 vp 0
        31@ += 0x0 // SAMP_TEXTDRAW_TEXT_OFFSET
        0AB2: 1 31@
    ELSE 059A:  return_false
    END
END
0AB2: 0
PHP:
:GetTextdrawOutline
{
    0.3.7 R5
    0AB1: @GetTextdrawOutline 1 ID 1000 _Returned: Outline 0@ Color 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // 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
            0A8D: 28@ readMem 29@ sz 1 vp 0
            0A8E: 27@ = 31@ + 0x97F // SAMP_TEXTDRAW_OUTLINE_COLOR_OFFSET
            0A8D: 26@ readMem 27@ sz 4 vp 0
        END
    END
END
0AB2: 2 28@ 26@
 

Tuzas

Active member
Joined
Nov 1, 2019
Messages
145
Reaction score
80
Location
null
Get R5 SAMP dialog status
PHP:
:IsDialogOpen
{
if
0AB1:  @IsDialogOpen 0
then
}
0AA2: 2@ = "samp.dll"
2@ += 0x26EB50
0A8D: 2@ = readMem 2@ sz 4 vp 0
0A8E: 3@ = 2@ + 0x28
0A8D: 3@ = readMem 3@ sz 4 vp 0
if 3@ == 0
then
059A: return_false
else
0485: return_true
end
0AB2: ret 0
 

Tuzas

Active member
Joined
Nov 1, 2019
Messages
145
Reaction score
80
Location
null
Get R5 SAMP chat status
PHP:
:IsChatOpen
{
if
0AB1:  @IsChatOpen 0
then
}
0AA2: 1@ = "samp.dll"
1@ += 0x26EB84
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x14E0
0A8D: 1@ = readMem 1@ sz 4 vp 0
if 1@ == 0
then
    059A: return_false
else
    0485: return_true
end
0AB2: ret 0
 

Tuzas

Active member
Joined
Nov 1, 2019
Messages
145
Reaction score
80
Location
null
Send R5 SAMP command to server
PHP:
:SendCommand
{
 0AC8: 2@ = allocate_memory_size 260
 0AD3: 2@ = format "/hello ugbase"
 0AB1: @SendCommand 1 text 5@
}
0AA2: 1@ = "samp.dll"
1@ += 0x69900
0AA5: call 1@ num_param 1 pop 0 0@
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Add or Send messages or commands to samp chat..
PHP:
:SAY
/*
     0.3.7 R5
     0AC8: 0@ = allocate_memory_size 1024
     0AD3: 0@ = format "Hey!"
     0AB1: @SAY 1 text 0@
*/
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x5A10
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0
PHP:
:SEND_CMD
/*
     0.3.7 R5
     0AC8: 0@ = allocate_memory_size 1024
     0AD3: 0@ = format "/help"
     0AB1: @SEND_CMD 1 text 0@
*/
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x69900
    0AA5: call 1@ num_param 1 pop 0 0@
END
0AB2: 0
PHP:
:PROCESS_CHAT_INPUT
/*
    0.3.7 R5
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "text or /command"
    0AB1: @PROCESS_CHAT_INPUT 1 InputText 0@
*/
IF 0AA2: 20@ = "samp.dll"
THEN
    0A8E: 21@ = 20@ + 0x26EB84            // SAMP_CHAT_INPUT_INFO_OFFSET
    0A8D: 22@ = readMem 21@ sz 4 vp 0     // pChatInput;
    0A8E: 26@ = 22@ + 0x8                // pChatInput->pEditBox;
    0A8D: 27@ = readMem 26@ sz 4 vp 0     // pEditBox;
  
    0A8E: 24@ = 20@ + 0x85580 // CDXUTEditBox::SetText
 
    0AA8: call_function_method 24@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@
  
    0A8E: 25@ = 20@ + 0x699D0 // PROCESS_INPUT
    0AA8: call_function_method 25@ struct 22@ num_params 0 pop 0 _retVal 7@
END
0AB2: 0
PHP:
:Chatmsg
/*
     0.3.7 R5
     0AC8: 4@ = allocate_memory_size 1024
     0AD3: 4@ = format "{FFFFFF}Auto Accept: {00FF00}ON"
     0AB1: @Chatmsg 2 text 4@ color 0xFF00FF00
*/
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26EB80            // SAMP_CHAT_INFO_OFFSET (R1)
    0A8D: 30@ = readMem 30@ sz 4 vp 0     // pChat;
    0A8E: 29@ = 31@ + 0x67BE0             // FUNC_ADDTOCHATWND (R1)
    IF OR
    1@ == -1
    1@ <= 0
    THEN 1@ = 0xFFFFFFFF
    END
    0AA6: call 29@ struct 30@ num_params 5 pop 0 params 0 1@ 0 0@ 8
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:DisableTakingScreenShotWithF8
{
    0.3.7 R5
    0AB1: @DisableTakingScreenShotWithF8 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0x613D1
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 1 virtual_protect 1
    END
END
0AB2: 0
PHP:
:TakeScreenShot
{
    0.3.7 R5
    0AB1: @TakeScreenShot 0
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x12DE64
    0A8C: write_memory 31@ size 4 value 1 virtual_protect 0
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:UpdateScoreBoard
{
    0.3.7 R5
    0AB1: @UpdateScoreBoard 0
    UpdateScoreBoard - snippet used to update player score and ping from ScoreBoard every 2.5sec when using snippets: GetPlayerScoreByID, GetPlayerPingByID
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26EB94 // SAMP_INFO_OFFSET  
    0A8D: 30@ = readMem 30@ sz 4 vp 0

    0A8E: 29@ = 31@ + 0x8F10 // SAMP_UPDATE_SCOREBOARD_OFFSET

    0AA8: call_function_method 29@ struct 30@ num_params 0 pop 0 _Returned: Name 28@
END
0AB2: 0
PHP:
:GetPlayerScoreByID
{
    0.3.7 R5
    IF 0AB1: @GetPlayerScoreByID 1 ID 0@ _Returned: Score 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26EB94 // SAMP_INFO_OFFSET  
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x3DE // SAMP_PPOOLS_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x4 // SAMP_PPOOL_PLAYER_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0

    0A8E: 29@ = 31@ + 0x6E850 // SAMP_GET_PLAYER_PING_OFFSET

    0AA8: call_function_method 29@ struct 30@ num_params 1 pop 0 0@ _Returned: Name 28@
    IF 28@ >= 0
    THEN 0485:  RETURN_TRUE
    ELSE 059A:  RETURN_FALSE
    END
END
0AB2: 1 28@
PHP:
:GetPlayerPingByID
{
    0.3.7 R5
    IF 0AB1: @GetPlayerPingByID 1 ID 0@ _Returned: Ping 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26EB94 // SAMP_INFO_OFFSET  
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x3DE // SAMP_PPOOLS_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    30@ += 0x4 // SAMP_PPOOL_PLAYER_OFFSET         
    0A8D: 30@ = readMem 30@ sz 4 vp 0

    0A8E: 29@ = 31@ + 0x6E880 // SAMP_GET_PLAYER_PING_OFFSET

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

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
1. Check When chat was updated
2. Get Chat string


PHP:
:IsChatUpdated
{
    IF 0AB1: @IsChatUpdated 0
}
IF 0AA2: 31@ = "samp.dll" // IF and SET
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            0A8E: 30@ = 31@ + 0x21A0E4 // SAMP_CHAT_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 1
            0A8E: 29@ = 30@ + 0x63D3 // SAMP_CHAT_INFO_OFFSET       
            0A8D: 28@ = readMem 29@ sz 1 vp 1
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0EC // SAMP_CHAT_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 1
            0A8E: 29@ = 30@ + 0x63D3 // SAMP_CHAT_INFO_OFFSET       
            0A8D: 28@ = readMem 29@ sz 1 vp 1
        END
       
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA10 // SAMP_CHAT_INFO_OFFSET 
            0A8D: 30@ = readMem 30@ sz 4 vp 1
            0A8E: 29@ = 30@ + 0x63D3 // SAMP_CHAT_INFO_OFFSET       
            0A8D: 28@ = readMem 29@ sz 1 vp 1
        END
       
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8C8 // SAMP_CHAT_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 1
            0A8E: 29@ = 30@ + 0x63D3 // SAMP_CHAT_INFO_OFFSET       
            0A8D: 28@ = readMem 29@ sz 1 vp 1
        END
       
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8 // SAMP_CHAT_INFO_OFFSET 
            0A8D: 30@ = readMem 30@ sz 4 vp 1
            0A8E: 29@ = 30@ + 0x63D3 // SAMP_CHAT_INFO_OFFSET       
            0A8D: 28@ = readMem 29@ sz 1 vp 1
        END
       
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9F8 // SAMP_CHAT_INFO_OFFSET 
            0A8D: 30@ = readMem 30@ sz 4 vp 1
            0A8E: 29@ = 30@ + 0x63D3 // SAMP_CHAT_INFO_OFFSET       
            0A8D: 28@ = readMem 29@ sz 1 vp 1
        END
       
        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB80 // SAMP_CHAT_INFO_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 1
            0A8E: 29@ = 30@ + 0x63D3 // SAMP_CHAT_INFO_OFFSET       
            0A8D: 28@ = readMem 29@ sz 1 vp 1
        END
        IF 28@ > 0
        THEN
            0485:  return_true
            0A8C: writeMem 29@ sz 1 vl 0 vp 1
        ELSE 059A:  return_false
        END                                                                               
    END
    0AA3: 31@
END
0AB2: ret 0

PHP:
:getChatString
{
    0.3.7 R5
    0AC8: 0@ = allocate_memory_size 1024
    0AC8: 1@ = allocate_memory_size 1024
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB80 // SAMP_CHAT_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x132
    0@ *= 0xFC
    005A: 31@ += 0@
    0A8E: 30@ = 31@ + 0x20 // CHAT_TEXT_OFFSET
    0A8E: 29@ = 31@ + 0x4 // CHAT_PREFIX_TEXT_OFFSET
    0A8E: 28@ = 31@ + 0xF4 // CHAT_COLOR_OFFSET
    0A8D: 27@ readMem 28@ sz 4 vp 0 // HEX Color
    0A8E: 26@ = 31@ + 0xF8 // CHAT_PREFIX_COLOR_OFFSET
    0A8D: 25@ readMem 26@ sz 1 vp 0
    IF NOT 25@ > 0
    THEN 24@ = 0
    ELSE 0A8D: 24@ readMem 26@ sz 4 vp 0
    END
    0AA3: 31@
END
0AB2: ret 4 30@ 29@ 27@ 24@

[php]
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Get R5 SAMP chat status
PHP:
:IsChatOpen
{
if
0AB1:  @IsChatOpen 0
then
}
0AA2: 1@ = "samp.dll"
1@ += 0x26EB84
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x14E0
0A8D: 1@ = readMem 1@ sz 4 vp 0
if 1@ == 0
then
    059A: return_false
else
    0485: return_true
end
0AB2: ret 0
Get R5 SAMP chat status
PHP:
:IsChatOpen
{
if
0AB1:  @IsChatOpen 0
then
}
0AA2: 1@ = "samp.dll"
1@ += 0x26EB84
0A8D: 1@ = readMem 1@ sz 4 vp 0
1@ += 0x14E0
0A8D: 1@ = readMem 1@ sz 4 vp 0
if 1@ == 0
then
    059A: return_false
else
    0485: return_true
end
0AB2: ret 0
Thank you for your work.
I have improved these snippets to avoid unnecessary else jumps which saves time a lot if you have long code to write..

PHP:
:is_chat_opened
{
    0.3.7 R5
    Set TRUE if you wanna check when chat is opened
    Set FALSE if you wanna check when chat is closed
    Usage:
    IF 0AB1: @is_chat_opened 1 CheckingState FALSE // State: TRUE = opened ; FALSE = closed
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26EB84 // SAMP_CHAT_INPUT_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x14E0 // SAMP_CHAT_OPENED_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    IF 0@ == TRUE
    THEN
        IF 29@ == TRUE
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE
        IF 29@ == FALSE
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    END
END
0AB2: ret 0
PHP:
:is_dialog_active
{
    0.3.7 R5
    Set TRUE if you wanna check when dialog is active
    Set FALSE if you wanna check when dialog is closed
    Usage:
    IF 0AB1: @is_dialog_active 1 CheckingState FALSE // State: TRUE = active ; FALSE = closed
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // SAMP_DIALOG_ACTIVE_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    IF 0@ == TRUE
    THEN
        IF 29@ == TRUE
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE
        IF 29@ == FALSE
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    END
END
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
1. Snippet allows you to check when you are in car and in driver seat.., which means you driving car.
2. Snippet allows you to check when you are in car but not in driver seat.., which means you not driving car.
All you need is just set CheckigState
PHP:
:is_actor_in_driver_seat
{
    Set TRUE if you wanna check when actor is in driver seat
    Set FALSE if you wanna check when actor not in driver seat
    USE WITH >> IF STATEMENT <<
    Usage:
    IF 0AB1: @is_actor_in_driver_seat 1 CheckingState TRUE // State: TRUE = is in driver seat ; FALSE = not in driver seat
}
IF 00DF:   actor $PLAYER_ACTOR in_car
THEN
    03C0: 31@ = actor $PLAYER_ACTOR car
    046C: 30@ = car 31@ driver
    IF 0@ == TRUE
    THEN
        IF 003B: 30@ == $PLAYER_ACTOR
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    ELSE
        IF 803B: 30@ == $PLAYER_ACTOR
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    END
END
0AB2: 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 R5
    0AB1: @SetCurrentDialogListItem 1 Item 1
}
if 0AA2: 2@ = "samp.dll"
then
    0A8E: 3@ = 2@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET       
    0A8D: 3@ = readMem 3@ sz 4 vp 0   
    0A8E: 4@ = 3@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
    0A8D: 4@ = readMem 4@ sz 4 vp 0   
 
    0A8E: 5@ = 2@ + 0x8A9F0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
 
    0AA8: call_function_method 5@ struct 4@ num_params 1 pop 0 0@ _Return: 31@
end
0AB2: 0
 

Parazitas

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

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

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

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
SAMP SET GAME STATE
PHP:
:SetGameState
{
    0.3.7 R1
    0AB1: @SetGameState 1 GameState 9
    GAMESTATE_WAIT_CONNECT = 9,
    GAMESTATE_CONNECTING = 15,
    GAMESTATE_AWAIT_JOIN = 13,
    GAMESTATE_CONNECTED = 14
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x21A0F8 // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3BD // SAMP_GAME_STATE_OFFSET
    0A8C: writeMem 31@ sz 1 vl 0@ vp 0
END
0AB2: 0
PHP:
:SetGameState
{
    0.3.7 R2
    0AB1: @SetGameState 1 GameState 9
    GAMESTATE_WAIT_CONNECT = 9,
    GAMESTATE_CONNECTING = 15,
    GAMESTATE_AWAIT_JOIN = 13,
    GAMESTATE_CONNECTED = 14
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x21A100 // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3B9 // SAMP_GAME_STATE_OFFSET
    0A8C: writeMem 31@ sz 1 vl 0@ vp 0
END
0AB2: 0
PHP:
:SetGameState
{
    0.3.7 R3
    0AB1: @SetGameState 1 GameState 1
    GAMESTATE_WAIT_CONNECT = 1,
    GAMESTATE_CONNECTING = 6,
    GAMESTATE_AWAIT_JOIN = 2,
    GAMESTATE_CONNECTED = 5
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26E8DC // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3CD // SAMP_GAME_STATE_OFFSET
    0A8C: writeMem 31@ sz 1 vl 0@ vp 0
END
0AB2: 0
PHP:
:SetGameState
{
    0.3.7 R4 v1-2
    0AB1: @SetGameState 1 GameState 1
    GAMESTATE_WAIT_CONNECT = 1,
    GAMESTATE_CONNECTING = 6,
    GAMESTATE_AWAIT_JOIN = 2,
    GAMESTATE_CONNECTED = 5
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EA0C // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3CD // SAMP_GAME_STATE_OFFSET
    0A8C: writeMem 31@ sz 1 vl 0@ vp 0
END
0AB2: 0
PHP:
:SetGameState
{
    0.3.7 R5
    0AB1: @SetGameState 1 GameState 1
    GAMESTATE_WAIT_CONNECT = 1,
    GAMESTATE_CONNECTING = 6,
    GAMESTATE_AWAIT_JOIN = 2,
    GAMESTATE_CONNECTED = 5
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26EB94 // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3CD // SAMP_GAME_STATE_OFFSET
    0A8C: writeMem 31@ sz 1 vl 0@ vp 0
END
0AB2: 0
PHP:
:SetGameState
{
    0.3.DL
    0AB1: @SetGameState 1 GameState 1
    GAMESTATE_WAIT_CONNECT = 1,
    GAMESTATE_CONNECTING = 6,
    GAMESTATE_AWAIT_JOIN = 2,
    GAMESTATE_CONNECTED = 5
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x2ACA24 // SAMP_INFO_OFFSET
    0A8D: 31@ readMem 31@ sz 4 vp 0
    31@ += 0x3CD // SAMP_GAME_STATE_OFFSET
    0A8C: writeMem 31@ sz 1 vl 0@ vp 0
END
0AB2: 0
 
Status
Not open for further replies.
Top