[SNIPPET] Create SA:MP Dialog

With this snippet we can create samp dialog.
Good luck...​



Explain with 0.3.7 .:
PHP:
{$CLEO .cs}

0000:

wait 8500

WHILE TRUE
    WAIT 0

IF 0AB0: 49 {Key 1}
THEN
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AC8: 2@ = allocate_memory_size 260
    0AC8: 3@ = allocate_memory_size 260
    0AD3: 0@ = format "This is Dialog caption"
    0AD3: 1@ = format "DialogText %cDialogText" 0xA // 0xA - NEW LINE
    0AD3: 2@ = format "Ok"
    0AD3: 3@ = format "Close"
    0AB1: @ShowDialog 6 id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
    wait 300
END

END

:ShowDialog
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x6B9C0 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0

Snippets.:


0.3.7
PHP:
:ShowDialog
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x6B9C0 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0

0.3.7-R2
PHP:
:ShowDialog
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x6BA70 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0

0.3.7-R3
PHP:
:ShowDialog
{
    0.3.7 - R3
    0AB1: @ShowDialog 6 id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
}
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x6F8C0 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0


0.3.DL
PHP:
:ShowDialog
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x6FA50 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0

0.3.7 - R4
PHP:
:ShowDialog
{
    0.3.7 - R4
    0AB1: @ShowDialog 6 id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
}
IF 0AA2: 10@ = "samp.dll"
THEN
    0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
    0A8D: 12@ = readMem 11@ sz 4 vp 1
    0A8E: 11@ = 10@ + 0x6FFE0 //SAMP_DIALOG_SHOW
    0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 4@ LeftButton 3@ dText 2@ Caption 1@ dType 5@ dID 0@ bServerside 0 _retVal 6@
END
0AB2: 0

PHP:
########################## Dialog styles ##########################
DIALOG_STYLE_MSGBOX                  := 0
DIALOG_STYLE_INPUT                   := 1
DIALOG_STYLE_LIST                    := 2
DIALOG_STYLE_PASSWORD                := 3
DIALOG_STYLE_TABLIST                 := 4
DIALOG_STYLE_TABLIST_HEADERS         := 5

Memory source.:
https://github.com/SAMP-UDF/SAMP-UDF-for-AutoHotKey/blob/master/SAMP.ahk
 
Last edited:

mpol77

Active member
Joined
Oct 24, 2018
Messages
66
Reaction score
6
@Parazitas what's the point of the bServerside argument? can you make the server think that it ShowPlayerDialog to you?
 

habinabi

Active member
Joined
Nov 10, 2019
Messages
51
Reaction score
2
Location
Czech Republic
Hi, I need that when I select the first line so that it writes the /gps command to the chat and selects 2 lines, and when I select 2 lines it writes /gps and selects 3 lines. Can you please try to write me this?

Version samp: 0.3.7 and sampfuncs 5.3.3
 

88resu

Active member
Joined
Oct 1, 2019
Messages
110
Reaction score
46
Location
Uganda
Hi, I need that when I select the first line so that it writes the /gps command to the chat and selects 2 lines, and when I select 2 lines it writes /gps and selects 3 lines. Can you please try to write me this?

Version samp: 0.3.7 and sampfuncs 5.3.3
 

Attachments

  • tenor.gif
    tenor.gif
    1.3 MB · Views: 11

dphome

Well-known member
Joined
Mar 21, 2020
Messages
456
Solutions
9
Reaction score
165
Location
Poland
Parazitas ^__^
PHP:
:ShowDialog                    
// 0AB1: @ShowDialog 7 SampVersionID 0@ id 1000 caption 0@ text 1@ button_1 2@ button_2 3@ style 2
IF 0AA2: 10@ = "samp.dll"
THEN
    IF NOT 0@ < 0
    THEN
        IF 0@ == 1 // 0.3.7 R1
        THEN      
            0A8E: 11@ = 10@ + 0x21A0B8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6B9C0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
        IF 0@ == 2 // 0.3.7 R2
        THEN      
            0A8E: 11@ = 10@ + 0x21A0C0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6BA70 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
    
        IF 0@ == 3 // 0.3.DL
        THEN      
            0A8E: 11@ = 10@ + 0x2AC9E0 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6FA50 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
    
        IF 0@ == 4 // 0.3.7 R3
        THEN       
            0A8E: 11@ = 10@ + 0x26E898 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6F8C0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
    
        IF 0@ == 5 // 0.3.7 R4
        THEN      
            0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x6FFE0 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END
        
        IF 0@ == 6 // 0.3.7 R4-v2
        THEN      
            0A8E: 11@ = 10@ + 0x26E9C8 // SAMP_DIALOG_INFO_OFFSET
            0A8D: 12@ = readMem 11@ sz 4 vp 1
            0A8E: 11@ = 10@ + 0x70010 //SAMP_DIALOG_SHOW
            0AA6: call_method 11@ struct 12@ num_params 7 pop 0 params 0 RightButton 5@ LeftButton 4@ dText 3@ Caption 2@ dType 6@ dID 1@ bServerside 0 _retVal 7@
        END        
    END
END
0AB2: 0
 
Top