[CLEO] Some multi-samp 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:
:SAMPGetObjectHandleByID
{
    0AB1: @SAMPGetObjectHandleByID 1 ObjectID 1249 _Returned: Handle 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        THEN
            31@ += 0x21A0F8 // SAMP_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x3CD // SAMP_PPOOLS_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x4 // SAMP_PPOOL_OBJECT_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // OBJECT_ID * 0x4
            0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = readMem 31@ sz 4 vp 0
        END
        
        IF 17@ == 2 // 0.3.7 R2
        THEN
            31@ += 0x21A100 // SAMP_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x3C5 // SAMP_PPOOLS_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // OBJECT_ID * 0x4
            0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = readMem 31@ sz 4 vp 0
        END
       
        IF 17@ == 3 // 0.3.DL
        THEN
            31@ += 0x2ACA24 // SAMP_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x3DE // SAMP_PPOOLS_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // OBJECT_ID * 0x4
            0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = readMem 31@ sz 4 vp 0 
        END
       
        IF 17@ == 4 // 0.3.7 R3
        THEN
            31@ += 0x26E8DC // SAMP_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x3DE // SAMP_PPOOLS_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // OBJECT_ID * 0x4
            0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = readMem 31@ sz 4 vp 0 
        END
       
        IF 17@ == 5 // 0.3.7 R4
        THEN
            31@ += 0x26EA0C // SAMP_INFO_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x3DE // SAMP_PPOOLS_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            31@ += 0x14 // SAMP_PPOOL_OBJECT_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // OBJECT_ID * 0x4
            0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = readMem 31@ sz 4 vp 0 
        END
       
        IF 17@ == 6 // 0.3.7 R4 - v2
        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@ += 0xC // SAMP_PPOOL_OBJECT_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // OBJECT_ID * 0x4
            0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = readMem 31@ sz 4 vp 0
        END

        IF 17@ == 7 // 0.3.7 R5
        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@ += 0xC // SAMP_PPOOL_OBJECT_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // OBJECT_ID * 0x4
            0@ += 0xFA4  // SAMP_OBJECT_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = readMem 31@ sz 4 vp 0
        END
 
        IF 30@ > 0
        THEN
            30@ += 0x44 // SAMP_OBJECT_HANDLE_OFFSET
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            IF 30@ > 0
            THEN 
                0485:  return_true
                0AB2: ret 1 30@
            ELSE 059A:  return_false
            END
        ELSE 059A:  return_false
        END
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:SetDialogInputEditBoxText
/*
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "text"
    0AB1: @SetDialogInputEditBoxText 1 InputText 0@
*/
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0B8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialogInput;
            0A8E: 28@ = 29@ + 0x24              // pDialogInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x80F60 // CDXUTEditBox::SetText
        END
        
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialogInput;
            0A8E: 28@ = 29@ + 0x24              // pDialogInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x81000 // CDXUTEditBox::SetText
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialogInput;
            0A8E: 28@ = 29@ + 0x24              // pDialogInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85000 // CDXUTEditBox::SetText
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialogInput;
            0A8E: 28@ = 29@ + 0x24              // pDialogInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x84E70 // CDXUTEditBox::SetText
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialogInput;
            0A8E: 28@ = 29@ + 0x24              // pDialogInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x855B0 // CDXUTEditBox::SetText
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x855E0 // CDXUTEditBox::SetText
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85580 // CDXUTEditBox::SetText
        END
    
        0AA8: call_function_method 26@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:get_dialog_text
{
    0AB1: @get_dialog_text 0 _Returned: Text 1@
}
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0B8 // 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
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // 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
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // 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
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // 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
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END

        IF 17@ == 7 // 0.3.7 R5
        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
        END
        IF 29@ == TRUE
        THEN
            0A8E: 28@ = 30@ + 0x34 // SAMP_DIALOG_TEXT_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
            28@ += 0x0
            0485: dialog_open
            0AB2: ret 1 28@
        ELSE 059A:  dialog closed
        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:
:process_dialog_input
/*
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "text"
    0AB1: @process_dialog_input 2 InputText 0@ Button 1 // 1 = Left , 0 = Right
*/
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0B8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x80F60 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x6C040 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x81000 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x6C0F0 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85000 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x700D0 // SAMP_DIALOG_CLOSE_OFFSET
            
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x84E70 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x6FF40 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x855B0 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x70660 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x855E0 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x70690 //SAMP_DIALOG_CLOSE
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50          // SAMP_DIALOG_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0   // pDialog;
            0A8E: 28@ = 29@ + 0x24              // pDialog->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0   // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85580 // CDXUTEditBox::SetText
            0A8E: 25@ = 31@ + 0x70630 // SAMP_DIALOG_CLOSE_OFFSET
        END
    
        0AA8: call_function_method 26@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@
        0AA8: call_function_method 25@ struct 29@ num_params 1 pop 0 Button 1@ _retVal 5@
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:process_current_dialog_list_item
{
    0AB1: @process_current_dialog_list_item 2 ListItem 1 Button 1 // 1 = Left , 0 = Right
}
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET       
            0A8D: 30@ = readMem 30@ sz 4 vp 0   
            0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
            0A8D: 29@ = readMem 29@ sz 4 vp 0   
 
            0A8E: 28@ = 31@ + 0x863C0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
            0A8E: 27@ = 31@ + 0x6C040 // SAMP_DIALOG_CLOSE_OFFSET
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET       
            0A8D: 30@ = readMem 30@ sz 4 vp 0   
            0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
            0A8D: 29@ = readMem 29@ sz 4 vp 0   
 
            0A8E: 28@ = 31@ + 0x86460 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
            0A8E: 27@ = 31@ + 0x6C0F0 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET       
            0A8D: 30@ = readMem 30@ sz 4 vp 0   
            0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
            0A8D: 29@ = readMem 29@ sz 4 vp 0   
 
            0A8E: 28@ = 31@ + 0x8A470 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
            0A8E: 27@ = 31@ + 0x700D0 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET       
            0A8D: 30@ = readMem 30@ sz 4 vp 0   
            0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
            0A8D: 29@ = readMem 29@ sz 4 vp 0   
 
            0A8E: 28@ = 31@ + 0x8A2E0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
            0A8E: 27@ = 31@ + 0x6FF40 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET       
            0A8D: 30@ = readMem 30@ sz 4 vp 0   
            0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
            0A8D: 29@ = readMem 29@ sz 4 vp 0   
 
            0A8E: 28@ = 31@ + 0x8AA20 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
            0A8E: 27@ = 31@ + 0x70660 // SAMP_DIALOG_CLOSE_OFFSET
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET       
            0A8D: 30@ = readMem 30@ sz 4 vp 0   
            0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
            0A8D: 29@ = readMem 29@ sz 4 vp 0   
 
            0A8E: 28@ = 31@ + 0x8AA50 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
            0A8E: 27@ = 31@ + 0x70690 //SAMP_DIALOG_CLOSE
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET       
            0A8D: 30@ = readMem 30@ sz 4 vp 0   
            0A8E: 29@ = 30@ + 0x20 // SAMP_DIALOG_LIST_BOX_OFFSET              
            0A8D: 29@ = readMem 29@ sz 4 vp 0   
 
            0A8E: 28@ = 31@ + 0x8A9F0 // SAMP_SET_DIALOG_LIST_ITEM_OFFSET
            0A8E: 27@ = 31@ + 0x70630 // SAMP_DIALOG_CLOSE_OFFSET
        END
 
        0AA8: call_function_method 28@ struct 29@ num_params 1 pop 0 Item 0@ _RetVal: 6@
        0AA8: call_function_method 27@ struct 30@ num_params 1 pop 0 Button 1@ _retVal 5@
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:get_current_dialog_editbox_text
{
    0AB1: @get_current_dialog_editbox_text 0 _Returned: Text 0@
}
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET      
            0A8D: 30@ = readMem 30@ sz 4 vp 0  
            0A8E: 29@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET             
            0A8D: 29@ = readMem 29@ sz 4 vp 0  
 
            0A8E: 28@ = 31@ + 0x81030 // CDXUTEditBox::GetText
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET      
            0A8D: 30@ = readMem 30@ sz 4 vp 0  
            0A8E: 29@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET             
            0A8D: 29@ = readMem 29@ sz 4 vp 0  
 
            0A8E: 28@ = 31@ + 0x810D0 // CDXUTEditBox::GetText
        END
       
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET      
            0A8D: 30@ = readMem 30@ sz 4 vp 0  
            0A8E: 29@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET             
            0A8D: 29@ = readMem 29@ sz 4 vp 0  
 
            0A8E: 28@ = 31@ + 0x850D0 // CDXUTEditBox::GetText
        END
       
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET      
            0A8D: 30@ = readMem 30@ sz 4 vp 0  
            0A8E: 29@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET             
            0A8D: 29@ = readMem 29@ sz 4 vp 0  
 
            0A8E: 28@ = 31@ + 0x84F40 // CDXUTEditBox::GetText
        END
       
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET      
            0A8D: 30@ = readMem 30@ sz 4 vp 0  
            0A8E: 29@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET             
            0A8D: 29@ = readMem 29@ sz 4 vp 0  
 
            0A8E: 28@ = 31@ + 0x85680 // CDXUTEditBox::GetText
        END
       
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET      
            0A8D: 30@ = readMem 30@ sz 4 vp 0  
            0A8E: 29@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET             
            0A8D: 29@ = readMem 29@ sz 4 vp 0  
 
            0A8E: 28@ = 31@ + 0x856B0 // CDXUTEditBox::GetText
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB50 // SAMP_DIALOG_INFO_OFFSET      
            0A8D: 30@ = readMem 30@ sz 4 vp 0  
            0A8E: 29@ = 30@ + 0x24 // SAMP_DIALOG_EDIT_BOX_OFFSET             
            0A8D: 29@ = readMem 29@ sz 4 vp 0  
 
            0A8E: 28@ = 31@ + 0x85650 // CDXUTEditBox::GetText
        END
 
        0AA8: call_function_method 28@ struct 29@ num_params 0 pop 0 _Returned: Text 6@
    END
END
0AB2: ret 1 6@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:get_dialog_id
{
    0AB1: @get_dialog_id 0 _Returned: ID 1@
}
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0B8 // 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
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // 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
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // 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
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // 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
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END

        IF 17@ == 7 // 0.3.7 R5
        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
        END
        IF 29@ == TRUE
        THEN
            0A8E: 28@ = 30@ + 0x30 // SAMP_DIALOG_ID_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
            0485: dialog_open
            0AB2: ret 1 28@
        ELSE 059A:  dialog closed
        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:
:get_dialog_type
{
    0AB1: @get_dialog_type 0 _Returned: Type 0@
}
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0B8 // 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
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // 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
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // 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
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // 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
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END

        IF 17@ == 7 // 0.3.7 R5
        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
        END
        IF 29@ == TRUE
        THEN
            0A8E: 28@ = 30@ + 0x2C // SAMP_DIALOG_TYPE_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
            0485: dialog_open
            0AB2: ret 1 28@
        ELSE 059A:  dialog closed
        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:
:SetChatInputEditBoxText
/*
    0AC8: 0@ = allocate_memory_size 1024
    0AD3: 0@ = format "text or /command"
    0AB1: @SetChatInputEditBoxText 1 InputText 0@
*/
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0E8            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x80F60 // CDXUTEditBox::SetText
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0F0            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x81000 // CDXUTEditBox::SetText
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA14            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85000 // CDXUTEditBox::SetText
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E8CC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x84E70 // CDXUTEditBox::SetText
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x855B0 // CDXUTEditBox::SetText
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x855E0 // CDXUTEditBox::SetText
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB84            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85580 // CDXUTEditBox::SetText
        END
    
        0AA8: call_function_method 26@ struct 27@ num_params 2 pop 0 _bSelected 0 _pszText 0@ _retVal 6@
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:GetChatInputEditBoxText
{
    0AB1: @GetChatInputEditBoxText 0 _Returned: Text 0@
}
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0E8            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x81030 // CDXUTEditBox::GetText
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0F0            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x810D0 // CDXUTEditBox::GetText
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA14            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x850D0 // CDXUTEditBox::GetText
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E8CC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x84F40 // CDXUTEditBox::GetText
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85680 // CDXUTEditBox::GetText
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9FC            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x856B0 // CDXUTEditBox::GetText
        END

        IF 17@ == 7 // 0.3.7 R5
        THEN
            0A8E: 30@ = 31@ + 0x26EB84            // SAMP_CHAT_INPUT_INFO_OFFSET
            0A8D: 29@ = readMem 30@ sz 4 vp 0     // pChatInput;
            0A8E: 28@ = 29@ + 0x8                // pChatInput->pEditBox;
            0A8D: 27@ = readMem 28@ sz 4 vp 0     // pEditBox;
          
            0A8E: 26@ = 31@ + 0x85650 // CDXUTEditBox::GetText
        END
    
        0AA8: call_function_method 26@ struct 27@ num_params 0 pop 0 _Returned: Text 6@
    END
END
0AB2: 1 6@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:GetPlayerPingByID
{
    0AB1: @GetPlayerPingByID 1 ID 0@ _Returned: Ping 1@
}
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0F8 // SAMP_INFO_OFFSET 
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x3CD // SAMP_PPOOLS_OFFSET        
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x18 // SAMP_PPOOL_PLAYER_OFFSET        
            0A8D: 30@ = readMem 30@ sz 4 vp 0
       
            0A8E: 29@ = 31@ + 0x6A1C0 // SAMP_GET_PLAYER_PING_OFFSET
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A100 // SAMP_INFO_OFFSET   
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x3C5 // SAMP_PPOOLS_OFFSET          
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET          
            0A8D: 30@ = readMem 30@ sz 4 vp 0
        
            0A8E: 29@ = 31@ + 0x6A280 // SAMP_GET_PLAYER_PING_OFFSET
        END
       
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2ACA24 // SAMP_INFO_OFFSET 
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x3DE // SAMP_PPOOLS_OFFSET        
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET        
            0A8D: 30@ = readMem 30@ sz 4 vp 0
       
            0A8E: 29@ = 31@ + 0x6E2B0 // SAMP_GET_PLAYER_PING_OFFSET
        END
       
        IF 17@ == 4 // 0.3.7 R3
        THEN
            0A8E: 30@ = 31@ + 0x26E8DC // SAMP_INFO_OFFSET    
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x3DE // SAMP_PPOOLS_OFFSET           
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET           
            0A8D: 30@ = readMem 30@ sz 4 vp 0
         
            0A8E: 29@ = 31@ + 0x6E110 // SAMP_GET_PLAYER_PING_OFFSET
        END
       
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26EA0C // SAMP_INFO_OFFSET  
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x3DE // SAMP_PPOOLS_OFFSET         
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET         
            0A8D: 30@ = readMem 30@ sz 4 vp 0
       
            0A8E: 29@ = 31@ + 0x6E840 // SAMP_GET_PLAYER_PING_OFFSET
        END
       
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26EA0C // SAMP_INFO_OFFSET  
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x3DE // SAMP_PPOOLS_OFFSET         
            0A8D: 30@ = readMem 30@ sz 4 vp 0
            30@ += 0x4 // SAMP_PPOOL_PLAYER_OFFSET         
            0A8D: 30@ = readMem 30@ sz 4 vp 0
       
            0A8E: 29@ = 31@ + 0x6E880 // SAMP_GET_PLAYER_PING_OFFSET
        END
       
        IF 17@ == 7 // 0.3.7 R5
        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
        END
       
        0AA8: call_function_method 29@ struct 30@ num_params 1 pop 0 ID 0@ _Returned: Ping 28@
        IF 28@ > 0
        THEN 0485:  RETURN_TRUE
        ELSE 059A:  RETURN_FALSE
        END
       
    END
END
0AB2: ret 1 28@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:getPickUpStructure
{
    0AB1: @getPickUpStructure 1 PickupID 0@ _Returned: Model 1@ Type 2@ XYZ 3@ 4@ 5@
}
IF 0AA2: 31@ = "samp.dll"
THEN   
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        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@ += 0x20 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x14 // PICKUP_ID * 0x14
            0@ += 0xF004 // SAMP_PICKUP_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // MODEL
            31@ += 4
            0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // TYPE
            31@ += 4
            0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // X
            31@ += 4
            0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // Y
            31@ += 4
            0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // Z
        END
        
        IF 17@ == 2 // 0.3.7 R2
        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@ += 0x10 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x14 // PICKUP_ID * 0x14
            0@ += 0xF004 // SAMP_PICKUP_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // MODEL
            31@ += 4
            0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // TYPE
            31@ += 4
            0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // X
            31@ += 4
            0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // Y
            31@ += 4
            0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // Z
        END
       
        IF 17@ == 3 // 0.3.DL
        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@ += 0x10 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x14 // PICKUP_ID * 0x14
            0@ += 0xF004 // SAMP_PICKUP_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // MODEL
            31@ += 4
            0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // TYPE
            31@ += 4
            0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // X
            31@ += 4
            0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // Y
            31@ += 4
            0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // Z
        END
       
        IF 17@ == 4 // 0.3.7 R3
        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@ += 0x10 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x14 // PICKUP_ID * 0x14
            0@ += 0xF004 // SAMP_PICKUP_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // MODEL
            31@ += 4
            0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // TYPE
            31@ += 4
            0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // X
            31@ += 4
            0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // Y
            31@ += 4
            0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // Z
        END
       
        IF 17@ == 5 // 0.3.7 R4
        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@ += 0x10 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x14 // PICKUP_ID * 0x14
            0@ += 0xF004 // SAMP_PICKUP_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // MODEL
            31@ += 4
            0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // TYPE
            31@ += 4
            0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // X
            31@ += 4
            0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // Y
            31@ += 4
            0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // Z 
        END
       
        IF 17@ == 6 // 0.3.7 R4 - v2
        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@ += 0x8 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x14 // PICKUP_ID * 0x14
            0@ += 0xF004 // SAMP_PICKUP_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // MODEL
            31@ += 4
            0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // TYPE
            31@ += 4
            0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // X
            31@ += 4
            0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // Y
            31@ += 4
            0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // Z
        END

        IF 17@ == 7 // 0.3.7 R5
        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@ += 0x8 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x14 // PICKUP_ID * 0x14
            0@ += 0xF004 // SAMP_PICKUP_PPOOL_STRUCT_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0 // MODEL
            31@ += 4
            0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0 // TYPE
            31@ += 4
            0A8D: 28@ = read_memory 31@ size 4 virtual_protect 0 // X
            31@ += 4
            0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0 // Y
            31@ += 4
            0A8D: 26@ = read_memory 31@ size 4 virtual_protect 0 // Z
        END
        IF AND
        NOT 30@ < 0
        NOT 29@ < 0
        NOT 28@ == 0.0
        NOT 27@ == 0.0
        NOT 26@ == 0.0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    END
END
0AB2: ret 5 30@ 29@ 28@ 27@ 26@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:get_pickup_handle_by_id
{
    0AB1: @get_pickup_handle_by_id 1 PickupID 0@ _Returned: Handle 1@
}
IF 0AA2: 31@ = "samp.dll"
THEN   
    0AB1: @get_samp_version_id 0 _returned: ID 17@
    IF 17@ > 0
    THEN
        IF 17@ == 1 // 0.3.7 R1
        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@ += 0x20 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // PICKUP_ID * 0x4
            0@ += 0x4 // SAMP_PICKUP_HANDLE_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0  
        END
        
        IF 17@ == 2 // 0.3.7 R2
        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@ += 0x10 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // PICKUP_ID * 0x4
            0@ += 0x4 // SAMP_PICKUP_HANDLE_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0
        END
       
        IF 17@ == 3 // 0.3.DL
        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@ += 0x10 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // PICKUP_ID * 0x4
            0@ += 0x4 // SAMP_PICKUP_HANDLE_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0
        END
       
        IF 17@ == 4 // 0.3.7 R3
        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@ += 0x10 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // PICKUP_ID * 0x4
            0@ += 0x4 // SAMP_PICKUP_HANDLE_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0
        END
       
        IF 17@ == 5 // 0.3.7 R4
        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@ += 0x10 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // PICKUP_ID * 0x4
            0@ += 0x4 // SAMP_PICKUP_HANDLE_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0
        END
       
        IF 17@ == 6 // 0.3.7 R4 - v2
        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@ += 0x8 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // PICKUP_ID * 0x4
            0@ += 0x4 // SAMP_PICKUP_HANDLE_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0
        END

        IF 17@ == 7 // 0.3.7 R5
        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@ += 0x8 // SAMP_PPOOL_PICKUP_OFFSET
            0A8D: 31@ readMem 31@ sz 4 vp 0
            0@ *= 0x4 // PICKUP_ID * 0x4
            0@ += 0x4 // SAMP_PICKUP_HANDLE_OFFSET
            005A: 31@ += 0@
            0A8D: 30@ = read_memory 31@ size 4 virtual_protect 0
        END
        IF NOT 30@ < 0
        THEN 0485:  return_true
        ELSE 059A:  return_false
        END
    END
END
0AB2: ret 1 30@
 

Expl01T3R

Active member
Joined
Nov 20, 2022
Messages
128
Reaction score
21
Location
Czech Republic
0.3.7-R5
Code:
// Created with ReClass.NET 1.2 by KN4CK3R
// Generated by #TeamExpl01T
// BTW: Not sure about gameState offset

class stSAMP_R5
{
public:
    void *pRakClientInterface; //0x0000
    char pad[44]; //0x0004
    char szIP[257]; //0x0030
    char szHostname[259]; //0x0131
    uint8_t bUnk; //0x0234
    uint16_t ulPort; //0x0235
    char pad2[406]; //0x0237
    uint32_t gameState; //0x03CD
    uint32_t iUnk; //0x03D1
    void *pSettings; //0x03D5
    uint8_t bUnk2; //0x03D9
    char pad4[4]; //0x03DA
    class stSAMPPools_R5 *pPools; //0x03DE
}; //Size: 0x03E2

class stSAMPPools_R5
{
public:
    void *pVehicle; //0x0000
    void *pPlayer; //0x0004
    void *pPickups; //0x0008
    void *pObjects; //0x000C
}; //Size: 0x0010

class stPickup_R5
{
public:
    uint32_t iModel; //0x0000
    uint32_t iType; //0x0004
    float fX; //0x0008
    float fY; //0x000C
    float fZ; //0x0010
}; //Size: 0x0014
 

Expl01T3R

Active member
Joined
Nov 20, 2022
Messages
128
Reaction score
21
Location
Czech Republic
0.3.7-R5
Code:
enum Gamestate_R5
{
    GAMESTATE_R5_WAIT_CONNECT = 1,
    GAMESTATE_R5_CONNECTING = 6,
    GAMESTATE_R5_AWAIT_JOIN = 2,
    GAMESTATE_R5_CONNECTED = 5
};
 

Expl01T3R

Active member
Joined
Nov 20, 2022
Messages
128
Reaction score
21
Location
Czech Republic
C++ version of getting pickup structure based on posts above by @Parazitas

C++:
stPickup_R5 getPickup_R5(int pickupId)
{
    return *(stPickup_R5*)((uintptr_t)g_SAMP_R5->pPools->pPickups + 0xF004 + (0x14 * pickupId));
}
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:GetCurrentDialogListboxItemsCount
{
    0AB1: @GetCurrentDialogListboxItemsCount 0 _Returned: ListboxItemsCount 0@
}
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0B8 // 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
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // 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
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // 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
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // 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
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END

        IF 17@ == 7 // 0.3.7 R5
        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
        END

        IF 29@ == TRUE // DIALOG OPEN
        THEN
            0A8E: 27@ = 30@ + 0x20 // SAMP_DIALOG_PTR2_OFFSET         
            0A8D: 27@ = readMem 27@ sz 4 vp 0
           
            0A8E: 22@ = 27@ + 0x150 // SAMP_DIALOG_LINECOUNT_OFFSET         
            0A8D: 22@ = readMem 22@ sz 4 vp 0
            22@ -= 1 // LAST ITEM IS ACTUALLY THEN NULL TERMINATOR 
    
            0A8E: 28@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
               
            IF OR
            28@ == 2 // DIALOG_STYLE_LIST
            28@ == 4 // DIALOG_STYLE_TABLIST
            28@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
            THEN
                0485:  return_true 
                0AB2: 1 22@
            ELSE 059A:  return_false
            END
        END  
    END  
END  
0AB2: 1 0
 

Expl01T3R

Active member
Joined
Nov 20, 2022
Messages
128
Reaction score
21
Location
Czech Republic
Using this stupidly hard-coded struct but it should be more class than struct.. (for 0.3.7-R5)
Can be used for basic s0beit funcs..
pPools = GAME->GetPools()
By #TeamExpl01T
C++:
typedef DWORD (__thiscall* tGetPlayer)(uintptr_t, uint16_t);
typedef char* (__thiscall* tGetPlayerName)(uintptr_t, uint16_t);
typedef bool (__thiscall* tDoesExist)(uintptr_t);
typedef uint32_t(__thiscall* tGetPlayerState)(uintptr_t);
typedef float(__thiscall* tGetDistanceToLocalPlayer)(uintptr_t);

struct stRemotePlayer_R5
{
private:
    uintptr_t* pRemotePlayer;
    CPed* pPed;

    tGetPlayer oGetPlayer;
    tGetPlayerName oGetPlayerName;
    tDoesExist oDoesExist;
    tGetPlayerState oGetPlayerState;
public:
    uint16_t playerId;
    bool IsConnected;
    bool IsValid;
    char* playerName;
    uint32_t playerState;

    stRemotePlayer_R5(int player_id, bool update = true) : playerId(player_id), IsValid(false), IsConnected(false), pRemotePlayer(nullptr), pPed(nullptr), playerName("Dummy"), playerState(0)
    {
        traceLastFunc("stRemotePlayer_R5::stRemotePlayer_R5()");
        oGetPlayer = (tGetPlayer)(g_dwSAMP_Addr + 0x10F0);
        oGetPlayerName = (tGetPlayerName)(g_dwSAMP_Addr + 0x175C0);
        oDoesExist = (tDoesExist)(g_dwSAMP_Addr + 0x1080);
        oGetPlayerState = (tGetPlayerState)(g_dwSAMP_Addr + 0x16330);

        if (update)
        {
            Update(true);
        }
    }

    void Update(bool withPlayerName = false)
    {
        traceLastFunc("stRemotePlayer_R5::stRemotePlayer_R5()::GeneratePlayer(pRemotePlayer)");
        pRemotePlayer = (uintptr_t*)oGetPlayer((uintptr_t)g_SAMP_R5->pPools->pPlayer, playerId);
        traceLastFunc("stRemotePlayer_R5::stRemotePlayer_R5()::CheckValid(IsValid)");
        IsValid = IsConnected = pRemotePlayer != nullptr;

        if (IsValid)
        {
            playerState = oGetPlayerState((uintptr_t)pRemotePlayer);

            if (withPlayerName && oGetPlayerName && g_SAMP_R5 && g_SAMP_R5->pPools && g_SAMP_R5->pPools->pPlayer)
            {
                traceLastFunc("stRemotePlayer_R5::stRemotePlayer_R5()::GenName(playerName)");
                playerName = oGetPlayerName((uintptr_t)g_SAMP_R5->pPools->pPlayer, playerId);
            }

            if (pPools)
            {
                traceLastFunc("stRemotePlayer_R5::stRemotePlayer_R5()::GeneratePed(pPed)");
                auto ped_ptr = GetPedPtr();
                pPed = pPools && ped_ptr ? pPools->GetPedFromRef(ped_ptr) : nullptr;
            }
        }
    }

    uintptr_t GetPedPtr()
    {
        auto check = *(uintptr_t*)((uintptr_t)g_SAMP_R5->pPools->pPlayer + 0x1F8A + (0x4 * playerId));
        if (check > 0)
        {
            check = *(uintptr_t*)(check + 0x10);
            if (check > 0)
            {
                check = *(uintptr_t*)(check + 0x1DD);
                if (check > 0)
                {
                    check = *(uintptr_t*)(check + 0x44);
                    if (check > 0)
                    {
                        return check;
                    }
                }
            }
        }
        return 0;
    }

    CPed* GetPed()
    {
        return pPed ? pPed : (pPools ? pPools->GetPedFromRef(GetPedPtr()) : nullptr);
    }

    DWORD GetPedRef()
    {
        return pPools ? pPools->GetPedRef(pPed) : NULL;
    }

    float GetDistanceToLocalPlayer()
    {
        return ((tGetDistanceToLocalPlayer)(g_dwSAMP_Addr + 0x16120))((uintptr_t)pRemotePlayer);
    }

    uint32_t GetPlayerState()
    {
        return playerState;
    }

    bool IsAFK()
    {
        return GetPlayerState() == 2;
    }

    static int GetLocalPlayerID()
    {
        if (g_Players)
        {
            return g_Players->sLocalPlayerID;//still the same offset for R5 :)
        }
       
        auto localName = getLocalPlayerName();
        for (int i = 0; i < SAMP_MAX_PLAYERS; i++)
        {
            auto pPlayer = new stRemotePlayer_R5(i);
            if (pPlayer->IsValid && !strcmp(localName, pPlayer->playerName))
                return i;
        }
    }

    static char* getLocalPlayerName()
    {
        if (g_Players)
        {
            return (char*)g_Players->strLocalPlayerName.c_str();//still the same offset for R5 :)
        }

        char* nickname = *(char**)(g_dwSAMP_Addr + 0x26E2F7);
        if (strlen(nickname) > 25)
            nickname[25] = '\0';
        return nickname;
    }

    static stLocalPlayer* GetLocalPlayerTest()
    {
        return g_SAMP_R5 && g_SAMP_R5->pPools && g_SAMP_R5->pPools->pPlayer ? ((stPlayerPool*)g_SAMP_R5->pPools->pPlayer)->pLocalPlayer : nullptr;//still the same offset for R5 :)
    }

    static CVector GetPlayerPos(int player_id)
    {
        auto r5_player = new stRemotePlayer_R5(player_id, false);
        r5_player->Update(false);

        if (!r5_player->GetPed())
            return CVector(0, 0, 0);

        return *r5_player->GetPed()->GetPosition();
    }

    static float GetDistanceToLocalPlayer(int player_id)
    {
        auto r5_player = new stRemotePlayer_R5(player_id, false);
        r5_player->Update(false);
        return r5_player->GetDistanceToLocalPlayer();
    }
};
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
This function was made from scratch in order to obtain dialog listbox text by list item and column ids.
To understand more about List items and Columns ids please check attached picture.

PHP:
:GetCurrentDialogListboxItemText
{
    0AB1: @GetCurrentDialogListboxItemText 2 ListItem 5 Column 2 _Returned: Text 6@
}
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0B8 // 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
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // 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
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // 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
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // 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
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END

        IF 17@ == 7 // 0.3.7 R5
        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
        END
        IF 29@ == TRUE // DIALOG OPEN
        THEN
            0A8E: 28@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
            IF OR
            28@ == 2 // DIALOG_STYLE_LIST
            28@ == 4 // DIALOG_STYLE_TABLIST
            28@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
            THEN
                0A8E: 27@ = 30@ + 0x20 // SAMP_DIALOG_LIST_OFFSET        
                0A8D: 27@ = readMem 27@ sz 4 vp 0
              
                0A8E: 26@ = 27@ + 0x150 // SAMP_DIALOG_LIST_ITEM_COUNT_OFFSET        
                0A8D: 26@ = readMem 26@ sz 4 vp 0
                26@ -= 1 // LAST ITEM IS ACTUALLY THE NULL TERMINATOR
                
                0A8E: 25@ = 27@ + 0x4D // SAMP_DIALOG_COLUMNS_COUNT_OFFSET        
                0A8D: 25@ = readMem 25@ sz 4 vp 0
              
                IF AND
                NOT 0@ < 0
                NOT 1@ < 0
                801D:   0@ > 26@  // (int)
                801D:   1@ > 25@  // (int)
                THEN
                    IF 1@ == 0 // column id
                    THEN  
                        0A8E: 24@ = 27@ + 0x14C // SAMP_DIALOG_LINES_OFFSET
                        0A8D: 24@ = readMem 24@ sz 4 vp 0
                        0@ *= 4 // List Item ID * 4
                        005A: 24@ += 0@  // (int)
                        0A8D: 24@ = readMem 24@ sz 4 vp 0
                        24@ += 0x0 // SAMP_DIALOG_LIST_ITEM_TEXT_OFFSET
                    END
                    IF 1@ == 1 // column id
                    THEN  
                        0A8E: 24@ = 27@ + 0x14C // SAMP_DIALOG_LINES_OFFSET
                        0A8D: 24@ = readMem 24@ sz 4 vp 0
                        0@ *= 4 // List Item ID * 4
                        005A: 24@ += 0@  // (int)
                        0A8D: 24@ = readMem 24@ sz 4 vp 0
                        24@ += 0x101 // SAMP_DIALOG_LIST_ITEM_TEXT_OFFSET  
                    END
                    IF 1@ >= 2 // column id
                    THEN  
                        0A8E: 24@ = 27@ + 0x14C // SAMP_DIALOG_LINES_OFFSET
                        0A8D: 24@ = readMem 24@ sz 4 vp 0
                        0@ *= 4 // List Item ID * 4
                        005A: 24@ += 0@  // (int)
                        0A8D: 24@ = readMem 24@ sz 4 vp 0
                        24@ += 0x101 // SAMP_DIALOG_LIST_ITEM_TEXT_OFFSET 
                        1@ *= 0x81 // Column ID * Size of text
                        005A: 24@ += 1@  // (int)
                        24@ -= 0x81 // Adjust offset to match column id 
                    END
                END        
            END
        END
    END    
END 
0AB2: 1 24@
 

Attachments

  • dialog.png
    dialog.png
    321.8 KB · Views: 51

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:isDialogEditBoxActive
/*
    Set TRUE if you wanna check when dialog editbox is active
    Set FALSE if you wanna check when dialog editbox is closed
    Usage:
    IF 0AB1: @isDialogEditBoxActive 1 CheckingState FALSE // State: TRUE = active ; FALSE = closed
*/
IF 0AA2: 31@ = "samp.dll"
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@ + 0x21A0B8 // 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
        END
        IF 17@ == 2 // 0.3.7 R2
        THEN
            0A8E: 30@ = 31@ + 0x21A0C0 // 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
        END
        
        IF 17@ == 3 // 0.3.DL
        THEN
            0A8E: 30@ = 31@ + 0x2AC9E0 // 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
        END
        
        IF 17@ == 4 // 0.3.7 R3 
        THEN
            0A8E: 30@ = 31@ + 0x26E898 // 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
        END
        
        IF 17@ == 5 // 0.3.7 R4
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END
        
        IF 17@ == 6 // 0.3.7 R4 - v2
        THEN
            0A8E: 30@ = 31@ + 0x26E9C8 // 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
        END

        IF 17@ == 7 // 0.3.7 R5
        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
        END
        
        IF 29@ == TRUE
        THEN
            0485:  return_true
            0A8E: 28@ = 30@ + 0x24              // pDialog->pEditBox;
            0A8D: 28@ = readMem 28@ sz 4 vp 0   // pEditBox;
            0A8E: 27@ = 28@ + 0x4              // pEditBox->pEditBoxState;
            0A8D: 27@ = readMem 27@ sz 1 vp 0   // pEditBoxState;
            IF 0@ == TRUE
            THEN
                IF 27@ == TRUE
                THEN 0485:  return_true
                ELSE 059A:  return_false
                END   
            ELSE
                IF 27@ == FALSE
                THEN 0485:  return_true
                ELSE 059A:  return_false
                END
            END
        ELSE 059A:  return_false
        END
    END
END
0AB2: ret 0
 
  • Like
Reactions: Krc
Status
Not open for further replies.
Top