[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
but how to do the opposite?
PHP:
:GetPlayerTargetedEntity
{
    if
    0AB1: @GetPlayerTargetedEntity 0 _Return: TargetedActorHandle 0@
    then
        // do something...
    end
}
0470: 30@ = actor $PLAYER_ACTOR current_weapon
30@ *= 0x70 
30@ += 0xC8AAB8 
30@ += 0x8 
0A8D: 30@ = read_memory 30@ size 4 virtual_protect 0 // weapon range

    0A96: 0@ = actor $PLAYER_ACTOR struct
    0A8D: 1@ = read_memory 0xB6F1A8 size 2 virtual_protect 0 // TheCamera.m_aCams.m_wCamMode
    0AA6: call_method 0x5E4280 struct 0@ num_params 3 pop 0 bIncludeAnim 1 iBoneID 25 vPosition 2@v // CPed__getBonePosition
    000B: 4@ += 0.3
    if or
        0039:   1@ == 53
        0039:   1@ == 55
    then
        0AA6: call_method 0x514970 struct 0xB6F028 num_params 6 pop 0 _targetOut 5@v _cameraOut 8@v _z 4@ _y 3@ _x 2@ _range 30@ // CCamera::Find3rdPersonCamTargetVector
    else
        068E: get_camera_target_point_to 5@ 6@ 7@
        068D: get_camera_position_to 8@ 9@ 10@
        0087: 11@ = 8@ // (float)
        0087: 12@ = 9@ // (float)
        0087: 13@ = 10@ // (float)
       
        0063: 11@ -= 5@  // (float)
        0063: 12@ -= 6@  // (float)
        0063: 13@ -= 7@  // (float)
       
        0087: 14@ = 11@ // (float)
        0087: 15@ = 12@ // (float)
        0087: 16@ = 13@ // (float)
       
        0013: 11@ *= 30@
        0013: 12@ *= 30@
        0013: 13@ *= 30@
       
        0087: 5@ = 8@ // (float)
        0087: 6@ = 9@ // (float)
        0087: 7@ = 10@ // (float)

        0063: 5@ -= 11@  // (float)
        0063: 6@ -= 12@  // (float)
        0063: 7@ -= 13@  // (float)
       
        0063: 8@ -= 14@ // (float)
        0063: 9@ -= 15@ // (float)
        0063: 10@ -= 16@ // (float)

    end
    0006: 1@ = 0 // entity = NULL
    0AA7: call_function 0x56BA00 num_params 12 pop 12 0 0 0 0 _objects 1 _peds 1 _vehicles 1 _buildings 1 _pEntity 1@v _colPoint 8@v _end 5@v _start 2@v _result: 13@ // CWorld::ProcessLineOfSight
    0006: 14@ = 0
    0006: 15@ = 0
   
    if
    1@ <> 0
    then
        0A8E: 2@ = 1@ + 0x36 // 1@ Entity struct
        0A8D: 2@ = read_memory 2@ size 1 virtual_protect 0 // entity->m_nStatusType
        0B10: 2@ = 2@ AND 7
        if
        2@ == 3 // ENTITY_TYPE_PED
        then
            0A96: 31@ = actor $PLAYER_ACTOR struct
            if
            803B:   not 31@ == 1@  // (int)
            then
                0AEA: 15@ = actor_struct 1@ handle
            end
        end
    end

if 056D:   actor 15@ defined
then 0485:  return_true
else 059A:  return_false
end
0AB2: ret 1 15@
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Makes your vehicle drive max speed as vehicle can..
PHP:
:SetVehicleMaxSpeed
// 0AB1: @SetVehicleMaxSpeed 0
03C0: 30@ = actor $PLAYER_ACTOR car
0441: 0@ = car 30@ model
0@ *= 4
0@ += 0xA9B0C8
0A8D: 0@ 0@ 4 0
0@ += 0x4A
0A8D: 0@ 0@ 2 0
0@ *= 0xE0
0@ += 0xC2B9DC
1@ = 0x88
005A: 0@ 1@
0A8D: 3@ 0@ 4 0
3@ *= 60.0
00AD: set_car 30@ max_speed_to 3@
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Player Name By ID
PHP:
:GetPlayerNameByID
{
    0.3.7 R1
    0AC8: 0@ = allocate_memory_size 1024
    0AB1: @GetPlayerNameByID 1 ID 995 _Returned: Name 0@
}
if 0AA2: 10@ = loadLib "samp.dll" //samp base offset
then     
    10@ += 0x21A0F8
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stInfo
    10@ += 0x3CD
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPools
    10@ += 0x18
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPlayerPools
    10@ += 0x2E
    0@ *= 0x4
    005A: 10@ += 0@
    0A8D: 10@ readMem 10@ sz 4 vp 0
    if 10@ > 0
    then
        10@ += 0xC
        0A8D: 11@ readMem 10@ sz 4 vp 0
        11@ += 0x0          
        0A8D: 26@ = readmem 0x8580DC sz 4 vp 0 // 0x8580DC - KERNEL32.lstrlenA
        0AA7: strlen_addr 26@ num_params 1 pop 0 string 11@ _returned_length 25@
        if 25@ > 0
        then 0AB2: ret 1 11@
        else 0AB2: ret 1 10@
        end
    end
end
0AB2: ret 0

PHP:
:GetPlayerNameByID
{
    0.3.7 R2
    0AC8: 0@ = allocate_memory_size 1024
    0AB1: @GetPlayerNameByID 1 ID 995 _Returned: Name 0@
}
if 0AA2: 10@ = loadLib "samp.dll" //samp base offset
then     
    10@ += 0x21A100
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stInfo
    10@ += 0x3C5
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPools
    10@ += 0x8
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPlayerPools
    10@ += 0x26
    0@ *= 0x4
    005A: 10@ += 0@
    0A8D: 10@ readMem 10@ sz 4 vp 0
    if 10@ > 0
    then
        10@ += 0x14
        0A8D: 11@ readMem 10@ sz 4 vp 0
        11@ += 0x0          
        0A8D: 26@ = readmem 0x8580DC sz 4 vp 0 // 0x8580DC - KERNEL32.lstrlenA
        0AA7: strlen_addr 26@ num_params 1 pop 0 string 11@ _returned_length 25@
        if 25@ > 0
        then 0AB2: ret 1 11@
        else 0AB2: ret 1 10@
        end
    end
end
0AB2: ret 0

PHP:
:GetPlayerNameByID
{
    0.3.7 R4 - v1
    0AC8: 0@ = allocate_memory_size 1024
    0AB1: @GetPlayerNameByID 1 ID 995 _Returned: Name 0@
}
if 0AA2: 10@ = loadLib "samp.dll" //samp base offset
then     
    10@ += 0x26EA0C
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stInfo
    10@ += 0x3DE
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPools
    10@ += 0x8
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPlayerPools
    10@ += 0x2E
    0@ *= 0x4
    005A: 10@ += 0@
    0A8D: 10@ readMem 10@ sz 4 vp 0
    if 10@ > 0
    then
        10@ += 0x18
        0A8D: 11@ readMem 10@ sz 4 vp 0
        11@ += 0x0          
        0A8D: 26@ = readmem 0x8580DC sz 4 vp 0 // 0x8580DC - KERNEL32.lstrlenA
        0AA7: strlen_addr 26@ num_params 1 pop 0 string 11@ _returned_length 25@
        if 25@ > 0
        then 0AB2: ret 1 11@
        else 0AB2: ret 1 10@
        end
    end
end
0AB2: ret 0

PHP:
:GetPlayerNameByID
{
    0.3.7 R4 - v2
    0AC8: 0@ = allocate_memory_size 1024
    0AB1: @GetPlayerNameByID 1 ID 995 _Returned: Name 0@
}
if 0AA2: 10@ = loadLib "samp.dll" //samp base offset
then     
    10@ += 0x26EA0C
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stInfo
    10@ += 0x3DE
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPools
    10@ += 0x4
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPlayerPools
    10@ += 0x1F8A
    0@ *= 0x4
    005A: 10@ += 0@
    0A8D: 10@ readMem 10@ sz 4 vp 0
    if 10@ > 0
    then
        10@ += 0x18
        0A8D: 11@ readMem 10@ sz 4 vp 0
        11@ += 0x0          
        0A8D: 26@ = readmem 0x8580DC sz 4 vp 0 // 0x8580DC - KERNEL32.lstrlenA
        0AA7: strlen_addr 26@ num_params 1 pop 0 string 11@ _returned_length 25@
        if 25@ > 0
        then 0AB2: ret 1 11@
        else 0AB2: ret 1 10@
        end
    end
end
0AB2: ret 0

PHP:
:GetPlayerNameByID
{
    0.3.DL
    0AC8: 0@ = allocate_memory_size 1024
    0AB1: @GetPlayerNameByID 1 ID 995 _Returned: Name 0@
}
if 0AA2: 10@ = loadLib "samp.dll" //samp base offset
then     
    10@ += 0x2ACA24
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stInfo
    10@ += 0x3DE
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPools
    10@ += 0x8
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPlayerPools
    10@ += 0x26
    0@ *= 0x4
    005A: 10@ += 0@
    0A8D: 10@ readMem 10@ sz 4 vp 0
    if 10@ > 0
    then
        10@ += 0x14
        0A8D: 11@ readMem 10@ sz 4 vp 0
        11@ += 0x0          
        0A8D: 26@ = readmem 0x8580DC sz 4 vp 0 // 0x8580DC - KERNEL32.lstrlenA
        0AA7: strlen_addr 26@ num_params 1 pop 0 string 11@ _returned_length 25@
        if 25@ > 0
        then 0AB2: ret 1 11@
        else 0AB2: ret 1 10@
        end
    end
end
0AB2: ret 0
 
Last edited:

xAmUser

Active member
Joined
Feb 23, 2018
Messages
55
Reaction score
3
Player Name By ID
PHP:
:GetPlayerNameByID
{
    0.3.7 R1
    0AB1: @GetPlayerHealthByID 1 ID 995 _Returned: Name 0@
}
if 0AA2: 10@ = loadLib "samp.dll" //samp base offset 
then       
    10@ += 0x21A0F8
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stInfo 
    10@ += 0x3CD
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPools
    10@ += 0x18
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPlayerPools
    10@ += 0x2E
    0@ *= 0x4
    005A: 10@ += 0@
    0A8D: 10@ readMem 10@ sz 4 vp 0
    if 10@ > 0
    then
        10@ += 0xC
        0A8D: 11@ readMem 10@ sz 4 vp 0
        11@ += 0x0            
        0A8D: 26@ = readmem 0x8580DC sz 4 vp 0 // 0x8580DC - KERNEL32.lstrlenA
        0AA7: strlen_addr 26@ num_params 1 pop 0 string 11@ _returned_length 25@
        if 25@ > 0
        then 0AB2: ret 1 11@
        else 0AB2: ret 1 10@
        end
    end
end
0AB2: ret 0

PHP:
:GetPlayerNameByID
{
    0.3.7 R2
    0AB1: @GetPlayerHealthByID 1 ID 995 _Returned: Name 0@
}
if 0AA2: 10@ = loadLib "samp.dll" //samp base offset 
then       
    10@ += 0x21A100
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stInfo 
    10@ += 0x3C5
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPools
    10@ += 0x8
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPlayerPools
    10@ += 0x26
    0@ *= 0x4
    005A: 10@ += 0@
    0A8D: 10@ readMem 10@ sz 4 vp 0
    if 10@ > 0
    then
        10@ += 0x14
        0A8D: 11@ readMem 10@ sz 4 vp 0
        11@ += 0x0            
        0A8D: 26@ = readmem 0x8580DC sz 4 vp 0 // 0x8580DC - KERNEL32.lstrlenA
        0AA7: strlen_addr 26@ num_params 1 pop 0 string 11@ _returned_length 25@
        if 25@ > 0
        then 0AB2: ret 1 11@
        else 0AB2: ret 1 10@
        end
    end
end
0AB2: ret 0

PHP:
:GetPlayerNameByID
{
    0.3.7 R4
    0AB1: @GetPlayerHealthByID 1 ID 995 _Returned: Name 0@
}
if 0AA2: 10@ = loadLib "samp.dll" //samp base offset 
then       
    10@ += 0x26EA0C
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stInfo 
    10@ += 0x3DE
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPools
    10@ += 0x8
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPlayerPools
    10@ += 0x2E
    0@ *= 0x4
    005A: 10@ += 0@
    0A8D: 10@ readMem 10@ sz 4 vp 0
    if 10@ > 0
    then
        10@ += 0x18
        0A8D: 11@ readMem 10@ sz 4 vp 0
        11@ += 0x0            
        0A8D: 26@ = readmem 0x8580DC sz 4 vp 0 // 0x8580DC - KERNEL32.lstrlenA
        0AA7: strlen_addr 26@ num_params 1 pop 0 string 11@ _returned_length 25@
        if 25@ > 0
        then 0AB2: ret 1 11@
        else 0AB2: ret 1 10@
        end
    end
end
0AB2: ret 0

PHP:
:GetPlayerNameByID
{
    0.3.DL
    0AB1: @GetPlayerHealthByID 1 ID 995 _Returned: Name 0@
}
if 0AA2: 10@ = loadLib "samp.dll" //samp base offset 
then       
    10@ += 0x2ACA24
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stInfo 
    10@ += 0x3DE
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPools
    10@ += 0x8
    0A8D: 10@ = readmem 10@ sz 4 vp 0 //stPlayerPools
    10@ += 0x26
    0@ *= 0x4
    005A: 10@ += 0@
    0A8D: 10@ readMem 10@ sz 4 vp 0
    if 10@ > 0
    then
        10@ += 0x14
        0A8D: 11@ readMem 10@ sz 4 vp 0
        11@ += 0x0            
        0A8D: 26@ = readmem 0x8580DC sz 4 vp 0 // 0x8580DC - KERNEL32.lstrlenA
        0AA7: strlen_addr 26@ num_params 1 pop 0 string 11@ _returned_length 25@
        if 25@ > 0
        then 0AB2: ret 1 11@
        else 0AB2: ret 1 10@
        end
    end
end
0AB2: ret 0
hi, if it’s not difficult, please drop the circle rendering code
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Instant Game Quit
PHP:
:QuitGame
// 0AB1: @QuitGame 0
0A8D: 10@ = read_memory 0x85820C size 4 virtual_protect 1 // ExitProcess
0AA5: call 10@ num_params 1 pop 0 exit 0
0AB2: ret 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:Convert3DposTo2Dscreen
{
    0xB6FA2C - CAMERA VIEW MATRIX
    input: 0@ 1@ 2@ xyz world coordinates
    output: 0@ 1@ xy screen coordinates (640x448)
    0AB1: @Convert3DposTo2Dscreen 3 XYZ 0@ 1@ 2@ ScreenXY 0@ 1@
}
// x = _x * _11 + _y * _21 + _z * _31 + 1 * _41
0007: 10@ = 0.0 // l=i (float)

0087: 3@ = 0@ // l=l (float)
0A8D: 4@ = read_memory 0xB6FA2C size 4 vp 0 // _11
006B: 3@ *= 4@ // l*=l (float)
005B: 10@ += 3@  // l+=l (float)

0087: 3@ = 1@ // l=l (float)
0A8D: 4@ = read_memory 0xB6FA3C size 4 vp 0 // _21
006B: 3@ *= 4@ // l*=l (float)
005B: 10@ += 3@  // l+=l (float)

0087: 3@ = 2@ // l=l (float)
0A8D: 4@ = read_memory 0xB6FA4C size 4 vp 0 // _31
006B: 3@ *= 4@ // l*=l (float)
005B: 10@ += 3@  // l+=l (float)

0A8D: 4@ = read_memory 0xB6FA5C size 4 vp 0 // _41
005B: 10@ += 4@  // l+=l (float)

// y = _x * _12 + _y * _22 + _z * _32 + 1 * _42
0007: 11@ = 0.0 // l=i (float)

0087: 3@ = 0@ // l=l (float)
0A8D: 4@ = read_memory 0xB6FA30 size 4 vp 0 // _12
006B: 3@ *= 4@ // l*=l (float)
005B: 11@ += 3@  // l+=l (float)

0087: 3@ = 1@ // l=l (float)
0A8D: 4@ = read_memory 0xB6FA40 size 4 vp 0 // _22
006B: 3@ *= 4@ // l*=l (float)
005B: 11@ += 3@  // l+=l (float)

0087: 3@ = 2@ // l=l (float)
0A8D: 4@ = read_memory 0xB6FA50 size 4 vp 0 // _32
006B: 3@ *= 4@ // l*=l (float)
005B: 11@ += 3@  // l+=l (float)
                                
0A8D: 4@ = read_memory 0xB6FA60 size 4 vp 0 // _42
005B: 11@ += 4@  // l+=l (float)

// z = _x * _13 + _y * _23 + _z * _33 + 1 * _43
0007: 12@ = 0.0 // l=i (float)

0087: 3@ = 0@ // l=l (float)
0A8D: 4@ = read_memory 0xB6FA34 size 4 vp 0 // _13
006B: 3@ *= 4@ // l*=l (float)
005B: 12@ += 3@  // l+=l (float)

0087: 3@ = 1@ // l=l (float)
0A8D: 4@ = read_memory 0xB6FA44 size 4 vp 0 // _23
006B: 3@ *= 4@ // l*=l (float)
005B: 12@ += 3@  // l+=l (float)

0087: 3@ = 2@ // l=l (float)
0A8D: 4@ = read_memory 0xB6FA54 size 4 vp 0 // _33
006B: 3@ *= 4@ // l*=l (float)
005B: 12@ += 3@  // l+=l (float)

0A8D: 4@ = read_memory 0xB6FA64 size 4 vp 0 // _43
005B: 12@ += 4@  // l+=l (float)

// x *= 640.0 / z
// y *= 448.0 / z
0007: 0@ = 640.0 // l=i (float)
0007: 1@ = 448.0 // l=i (float)

006B: 0@ *= 10@ // l*=l (float)
006B: 1@ *= 11@ // l*=l (float)

0073: 0@ /= 12@ // l/=l (float)
0073: 1@ /= 12@ // l/=l (float)
0AB2: 2 0@ 1@
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:GetGameText
{ 
    for 0@ = 0 to 7  
        if 0AB1: @GetGameText  1 GameTextID 0@ _returned: string 1@
        then
            // do something...
        end
    end
}
0@ *= 0x80 // size *= ID
0@ += 0xBAACC0 // base pointer
0A8D: 31@ = read_memory 0@ size 1 virtual_protect 0
if 31@ > 0 // if exist then
then
    0A8C: write_memory 0@ size 0 value 0 virtual_protect 0  // anti crash - clear unknown shit i guess
    0485:  return_true
    0AC8: 30@ = allocate_memory_size 260
    0AD3: 30@ = format "%s" 0@
    0AB2: ret 1 30@
else
    059A:  return_false
end
0AB2: ret 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
PHP:
:LockVehicleCamera
// 0AB1: @LockVehicleCamera 0
0A8C: write_memory 0xB70118 size 4 value 50.0 virtual_protect 0
0AB2: ret 0
 

Parazitas

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

0.3.7 - R1
PHP:
:GetCurrentDialogListboxItemsCount
{
    0.3.7 - R1
    0AB1: @GetCurrentDialogListboxItemsCount 0 _Returned: ListboxItemsCount 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0B8 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    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 0AB2: 1 22@
        END
    END     
END  
0AB2: 1 0

0.3.7 - R2
PHP:
:GetCurrentDialogListboxItemsCount
{
    0.3.7 - R2
    0AB1: @GetCurrentDialogListboxItemsCount 0 _Returned: ListboxItemsCount 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0C0 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    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 0AB2: 1 22@
        END
    END     
END  
0AB2: 1 0

0.3.7 - R3
PHP:
:GetCurrentDialogListboxItemsCount
{
    0.3.7 - R3
    0AB1: @GetCurrentDialogListboxItemsCount 0 _Returned: ListboxItemsCount 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E898 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    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 0AB2: 1 22@
        END
    END     
END  
0AB2: 1 0

0.3.DL
PHP:
:GetCurrentDialogListboxItemsCount
{
    0.3.DL
    0AB1: @GetCurrentDialogListboxItemsCount 0 _Returned: ListboxItemsCount 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x2AC9E0 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    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 0AB2: 1 22@
        END
    END     
END  
0AB2: 1 0

0.3.7 - R4
PHP:
:GetCurrentDialogListboxItemsCount
{
    0.3.7 - R4
    0AB1: @GetCurrentDialogListboxItemsCount 0 _Returned: ListboxItemsCount 0@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E9C8 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    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 0AB2: 1 22@
        END
    END     
END  
0AB2: 1 0
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
OPCODE:
0B5B: samp get_listbox_item 1@ text_to 2@
Without SAMPFUNCS, added two more columns returns, see below..

0.3.7 - R1
PHP:
:GetCurrentDialogListboxItemText
{
    0.3.7 - R1
    0AB1: @GetCurrentDialogListboxItemText 1 ListItem 9 _Returned: FirstColumnText 6@ SecondColumnText 7@ ThirdColumnText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0B8 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    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
      
        IF 001D:   0@ > 22@  // (int)
        THEN 0085: 0@ = 22@ // (int)
        END
      
        IF AND
        NOT 0@ < 0
        801D:   0@ > 22@  // (int)
        THEN
            0A8E: 26@ = 27@ + 0x14C // SAMP_DIALOG_LINES_OFFSET
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0@ *= 4
            005A: 26@ += 0@  // (int)
            0A8D: 26@ = readMem 26@ sz 4 vp 0
          
            0A8E: 28@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
          
            IF 28@ == 2 // DIALOG_STYLE_LIST
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0AB2: 1 25@
            END
          
            IF 28@ == 4 // DIALOG_STYLE_TABLIST
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0A8D: 20@ = readMem 24@ sz 1 vp 0
                IF NOT 20@ > 0
                THEN 24@ = 0
                END
                0AB2: 2 25@ 24@
            END
          
            IF 28@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
                0A8E: 23@ = 26@ + 0x182 // SAMP_DIALOG_THIRD_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0A8D: 20@ = readMem 24@ sz 1 vp 0
                IF NOT 20@ > 0
                THEN 24@ = 0
                END
                0A8D: 19@ = readMem 23@ sz 1 vp 0
                IF NOT 19@ > 0
                THEN 23@ = 0
                END
                0AB2: 3 25@ 24@ 23@
            END
        END
    END    
END 
0AB2: 3 0 0 0

0.3.7 - R2
PHP:
:GetCurrentDialogListboxItemText
{
    0.3.7 - R2
    0AB1: @GetCurrentDialogListboxItemText 1 ListItem 9 _Returned: FirstColumnText 6@ SecondColumnText 7@ ThirdColumnText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0C0 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    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
       
        IF 001D:   0@ > 22@  // (int)
        THEN 0085: 0@ = 22@ // (int)
        END
       
        IF AND
        NOT 0@ < 0
        801D:   0@ > 22@  // (int)
        THEN
            0A8E: 26@ = 27@ + 0x14C // SAMP_DIALOG_LINES_OFFSET
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0@ *= 4
            005A: 26@ += 0@  // (int)
            0A8D: 26@ = readMem 26@ sz 4 vp 0 
           
            0A8E: 28@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
           
            IF 28@ == 2 // DIALOG_STYLE_LIST
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0AB2: 1 25@
            END
           
            IF 28@ == 4 // DIALOG_STYLE_TABLIST
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0A8D: 20@ = readMem 24@ sz 1 vp 0
                IF NOT 20@ > 0
                THEN 24@ = 0
                END
                0AB2: 2 25@ 24@
            END
           
            IF 28@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
                0A8E: 23@ = 26@ + 0x182 // SAMP_DIALOG_THIRD_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0A8D: 20@ = readMem 24@ sz 1 vp 0
                IF NOT 20@ > 0
                THEN 24@ = 0
                END
                0A8D: 19@ = readMem 23@ sz 1 vp 0
                IF NOT 19@ > 0
                THEN 23@ = 0
                END
                0AB2: 3 25@ 24@ 23@
            END
        END
    END     
END  
0AB2: 3 0 0 0

0.3.7 - R3
PHP:
:GetCurrentDialogListboxItemText
{
    0.3.7 - R3
    0AB1: @GetCurrentDialogListboxItemText 1 ListItem 9 _Returned: FirstColumnText 6@ SecondColumnText 7@ ThirdColumnText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E898 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    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
       
        IF 001D:   0@ > 22@  // (int)
        THEN 0085: 0@ = 22@ // (int)
        END
       
        IF AND
        NOT 0@ < 0
        801D:   0@ > 22@  // (int)
        THEN
            0A8E: 26@ = 27@ + 0x14C // SAMP_DIALOG_LINES_OFFSET
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0@ *= 4
            005A: 26@ += 0@  // (int)
            0A8D: 26@ = readMem 26@ sz 4 vp 0 
           
            0A8E: 28@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
           
            IF 28@ == 2 // DIALOG_STYLE_LIST
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0AB2: 1 25@
            END
           
            IF 28@ == 4 // DIALOG_STYLE_TABLIST
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0A8D: 20@ = readMem 24@ sz 1 vp 0
                IF NOT 20@ > 0
                THEN 24@ = 0
                END
                0AB2: 2 25@ 24@
            END
           
            IF 28@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
                0A8E: 23@ = 26@ + 0x182 // SAMP_DIALOG_THIRD_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0A8D: 20@ = readMem 24@ sz 1 vp 0
                IF NOT 20@ > 0
                THEN 24@ = 0
                END
                0A8D: 19@ = readMem 23@ sz 1 vp 0
                IF NOT 19@ > 0
                THEN 23@ = 0
                END
                0AB2: 3 25@ 24@ 23@
            END
        END
    END     
END  
0AB2: 3 0 0 0

0.3.DL
PHP:
:GetCurrentDialogListboxItemText
{
    0.3.DL
    0AB1: @GetCurrentDialogListboxItemText 1 ListItem 9 _Returned: FirstColumnText 6@ SecondColumnText 7@ ThirdColumnText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x2AC9E0 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    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
       
        IF 001D:   0@ > 22@  // (int)
        THEN 0085: 0@ = 22@ // (int)
        END
       
        IF AND
        NOT 0@ < 0
        801D:   0@ > 22@  // (int)
        THEN
            0A8E: 26@ = 27@ + 0x14C // SAMP_DIALOG_LINES_OFFSET
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0@ *= 4
            005A: 26@ += 0@  // (int)
            0A8D: 26@ = readMem 26@ sz 4 vp 0 
           
            0A8E: 28@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
           
            IF 28@ == 2 // DIALOG_STYLE_LIST
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0AB2: 1 25@
            END
           
            IF 28@ == 4 // DIALOG_STYLE_TABLIST
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0A8D: 20@ = readMem 24@ sz 1 vp 0
                IF NOT 20@ > 0
                THEN 24@ = 0
                END
                0AB2: 2 25@ 24@
            END
           
            IF 28@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
                0A8E: 23@ = 26@ + 0x182 // SAMP_DIALOG_THIRD_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0A8D: 20@ = readMem 24@ sz 1 vp 0
                IF NOT 20@ > 0
                THEN 24@ = 0
                END
                0A8D: 19@ = readMem 23@ sz 1 vp 0
                IF NOT 19@ > 0
                THEN 23@ = 0
                END
                0AB2: 3 25@ 24@ 23@
            END
        END
    END     
END  
0AB2: 3 0 0 0

0.3.7 - R4
PHP:
:GetCurrentDialogListboxItemText
{
    0.3.7 - R4
    0AB1: @GetCurrentDialogListboxItemText 1 ListItem 9 _Returned: FirstColumnText 6@ SecondColumnText 7@ ThirdColumnText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E9C8 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    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
       
        IF 001D:   0@ > 22@  // (int)
        THEN 0085: 0@ = 22@ // (int)
        END
       
        IF AND
        NOT 0@ < 0
        801D:   0@ > 22@  // (int)
        THEN
            0A8E: 26@ = 27@ + 0x14C // SAMP_DIALOG_LINES_OFFSET
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0@ *= 4
            005A: 26@ += 0@  // (int)
            0A8D: 26@ = readMem 26@ sz 4 vp 0 
           
            0A8E: 28@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
            0A8D: 28@ = readMem 28@ sz 4 vp 0
           
            IF 28@ == 2 // DIALOG_STYLE_LIST
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0AB2: 1 25@
            END
           
            IF 28@ == 4 // DIALOG_STYLE_TABLIST
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0A8D: 20@ = readMem 24@ sz 1 vp 0
                IF NOT 20@ > 0
                THEN 24@ = 0
                END
                0AB2: 2 25@ 24@
            END
           
            IF 28@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
            THEN
                0A8E: 25@ = 26@ + 0x0 // SAMP_DIALOG_FIRST_COLUMN_TEXT_OFFSET
                0A8E: 24@ = 26@ + 0x101 // SAMP_DIALOG_SECOND_COLUMN_TEXT_OFFSET
                0A8E: 23@ = 26@ + 0x182 // SAMP_DIALOG_THIRD_COLUMN_TEXT_OFFSET
                0A8D: 21@ = readMem 25@ sz 1 vp 0
                IF NOT 21@ > 0
                THEN 25@ = 0
                END
                0A8D: 20@ = readMem 24@ sz 1 vp 0
                IF NOT 20@ > 0
                THEN 24@ = 0
                END
                0A8D: 19@ = readMem 23@ sz 1 vp 0
                IF NOT 19@ > 0
                THEN 23@ = 0
                END
                0AB2: 3 25@ 24@ 23@
            END
        END
    END     
END  
0AB2: 3 0 0 0
 

Attachments

  • sa-mp-001.png
    sa-mp-001.png
    1.1 MB · Views: 88
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Opcode:
0B75: samp get_chat_string 1@ text_to 2@ prefix_to 3@ color_to 4@ prefix_color_to 5@
Without SAMPFUNCS

0.3.7 - R1
PHP:
:getChatString
{
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
    0.3.7 - R1
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x21A0E4 // 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@

0.3.7 - R2
PHP:
:getChatString
{
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@ 
    0.3.7 - R2
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x21A0EC // 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@

0.3.7 - R3
PHP:
:getChatString
{
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
    0.3.7 - R3
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26E8C8 // 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@

0.3.DL
PHP:
:getChatString
{
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
    0.3.DL
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x2ACA10 // 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@

0.3.7 - R4
PHP:
:getChatString
{
    0AC8: 0@ = allocate_memory_size 260
    0AC8: 1@ = allocate_memory_size 260
    0AB1: @getChatString 1 ChatID 99 _Returned: Text 0@ PrefixText 1@ Color 2@ PrefixColor 3@
    0.3.7 - R4
}
IF 0AA2: 31@ = "samp.dll"
THEN
    31@ += 0x26E9F8 // 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@
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
NOPs
Disable Chat rendering / showing

0.3.7 - R1
PHP:
:HideSAMPChat
{
    0.3.7 - R1
    0AB1: @HideSAMPChat 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0x64230
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x56 virtual_protect 1
    END
END
0AB2: 0

0.3.7 - R2
PHP:
:HideSAMPChat
{
    0.3.7 - R2
    0AB1: @HideSAMPChat 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0x64300
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x56 virtual_protect 1
    END
END
0AB2: 0

0.3.7 - R3
PHP:
:HideSAMPChat
{
    0.3.7 - R3
    0AB1: @HideSAMPChat 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0x67680
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x56 virtual_protect 1
    END
END
0AB2: 0

0.3.DL
PHP:
:HideSAMPChat
{
    0.3.DL
    0AB1: @HideSAMPChat 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0x67870
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x56 virtual_protect 1
    END
END
0AB2: 0

0.3.7 - R4
PHP:
:HideSAMPChat
{
    0.3.7 - R4
    0AB1: @HideSAMPChat 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0x67DC0
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x56 virtual_protect 1
    END
END
0AB2: 0
 

Attachments

  • on.png
    on.png
    457.3 KB · Views: 51
  • off.png
    off.png
    470.6 KB · Views: 54

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
NOPs
Disable Dialog appearing / showing


0.3.7 - R1
PHP:
:BlockShowDialog
{
    0.3.7 - R1
    0AB1: @BlockShowDialog 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0xCBB0
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x55 virtual_protect 1
    END
END
0AB2: 0

0.3.7 - R2
PHP:
:BlockShowDialog
{
    0.3.7 - R2
    0AB1: @BlockShowDialog 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0xCBB0
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x55 virtual_protect 1
    END
END
0AB2: 0

0.3.7 - R3
PHP:
:BlockShowDialog
{
    0.3.7 - R3
    0AB1: @BlockShowDialog 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0xF7B0
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x55 virtual_protect 1
    END
END
0AB2: 0

0.3.DL
PHP:
:BlockShowDialog
{
    0.3.DL
    0AB1: @BlockShowDialog 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0xF9C0
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x55 virtual_protect 1
    END
END
0AB2: 0

0.3.7 - R4
PHP:
:BlockShowDialog
{
    0.3.7 - R4
    0AB1: @BlockShowDialog 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0xFAD0
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x55 virtual_protect 1
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
With this snippet you can make your own command or just read what you sent to server from chat box.. etc...

0.3.7 - R1
PHP:
:GetLastSentTextFromChatBox
{
    0.3.7 - R1
    0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
}
if 0AA2: 2@ = "samp.dll"
then             
    0A8E: 3@ = 2@ + 0x21A0E8      
    0A8D: 3@ = readMem 3@ sz 4 vp 0  
    0A8E: 4@ = 3@ + 0x14E5 // command
    0A8E: 5@ = 3@ + 0x1565 // text
end
0AB2: 2 4@ 5@

0.3.7 - R2
PHP:
:GetLastSentTextFromChatBox
{
    0.3.7 - R2
    0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
}
if 0AA2: 2@ = "samp.dll"
then             
    0A8E: 3@ = 2@ + 0x21A0F0      
    0A8D: 3@ = readMem 3@ sz 4 vp 0  
    0A8E: 4@ = 3@ + 0x14E5 // command
    0A8E: 5@ = 3@ + 0x1565 // text
end
0AB2: 2 4@ 5@

0.3.7 - R3
PHP:
:GetLastSentTextFromChatBox
{
    0.3.7 - R3
    0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
}
if 0AA2: 2@ = "samp.dll"
then              
    0A8E: 3@ = 2@ + 0x26E8CC       
    0A8D: 3@ = readMem 3@ sz 4 vp 0   
    0A8E: 4@ = 3@ + 0x14E5 // command
    0A8E: 5@ = 3@ + 0x1565 // text
end
0AB2: 2 4@ 5@

0.3.DL
PHP:
:GetLastSentTextFromChatBox
{
    0.3.DL
    0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
}
if 0AA2: 2@ = "samp.dll"
then             
    0A8E: 3@ = 2@ + 0x2ACA14      
    0A8D: 3@ = readMem 3@ sz 4 vp 0  
    0A8E: 4@ = 3@ + 0x14E5 // command
    0A8E: 5@ = 3@ + 0x1565 // text
end
0AB2: 2 4@ 5@

0.3.7 - R4
PHP:
:GetLastSentTextFromChatBox
{
    0.3.7 - R4
    0AB1: @GetLastSentTextFromChatBox 0 _Returned: Command 0@ Text 1@
}
if 0AA2: 2@ = "samp.dll"
then        
    0A8E: 3@ = 2@ + 0x26E9FC
    0A8D: 3@ = readMem 3@ sz 4 vp 0
    0A8E: 4@ = 3@ + 0x14E5 // command
    0A8E: 5@ = 3@ + 0x1565 // text
end
0AB2: 2 4@ 5@
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
Disable Default ScreenShot key (F8)

Take ScreenShot with any key you want, read below from link..
https://ugbase.eu/index.php?threads/some-snippets.20983/page-2#post-128032

0.3.7 - R1
PHP:
:DisableTakingScreenShotWithF8
{
    0.3.7 - R1
    0AB1: @DisableTakingScreenShotWithF8 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0x5D8C1
    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

0.3.7 - R2
PHP:
:DisableTakingScreenShotWithF8
{
    0.3.7 - R2
    0AB1: @DisableTakingScreenShotWithF8 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0x5D991
    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

0.3.7 - R3
PHP:
:DisableTakingScreenShotWithF8
{
    0.3.7 - R3
    0AB1: @DisableTakingScreenShotWithF8 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0x60C61
    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

0.3.DL
PHP:
:DisableTakingScreenShotWithF8
{
    0.3.DL
    0AB1: @DisableTakingScreenShotWithF8 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0x60E51
    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

0.3.7 - R4
PHP:
:DisableTakingScreenShotWithF8
{
    0.3.7 - R4
    0AB1: @DisableTakingScreenShotWithF8 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0x61391
    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
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
NOPs
Mute / Freeze
Server chat


0.3.7 - R1
PHP:
:MuteServerChat
{
    0.3.7 - R1
    0AB1: @MuteServerChat 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0xC050
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x55 virtual_protect 1
    END
END
0AB2: 0

0.3.7 - R2
PHP:
:MuteServerChat
{
    0.3.7 - R2
    0AB1: @MuteServerChat 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0xC050
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x55 virtual_protect 1
    END
END
0AB2: 0

0.3.7 - R3
PHP:
:MuteServerChat
{
    0.3.7 - R3
    0AB1: @MuteServerChat 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0xEC50
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x55 virtual_protect 1
    END
END
0AB2: 0

0.3.DL
PHP:
:MuteServerChat
{
    0.3.DL
    0AB1: @MuteServerChat 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0xEE60
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x55 virtual_protect 1
    END
END
0AB2: 0

0.3.7 - R4
PHP:
:MuteServerChat
{
    0.3.7 - R4
    0AB1: @MuteServerChat 1 State TRUE
}
IF 0AA2:31@ = "samp.dll"
THEN
    31@ += 0xEF60
    IF 0@ == TRUE
    THEN 0A8C: write_memory 31@ size 1 value 0xC3 virtual_protect 1
    ELSE 0A8C: write_memory 31@ size 1 value 0x55 virtual_protect 1
    END
END
0AB2: 0
 

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
OPCODE:
0B3C: samp is_dialog_responded id 1@ button 2@ list_item 3@ input_text 4@
Without SAMPFUNCS, added much more returns, see below..

0.3.7 - R1
PHP:
:isDialogResponded
{
    0.3.7 - R1
    0AB1: @isDialogResponded 0 _Returned: ID 0@ Type 1@ ListboxItem 2@ Button 3@ Text 4@ InputText 5@ Caption 6@ LeftButtonText 7@ RightButtonText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0B8 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    IF 29@ == TRUE // DIALOG OPEN
    THEN

        0A8E: 28@ = 30@ + 0x30 // DIALOG_ID_OFFSET
        0A8D: 28@ = readMem 28@ sz 4 vp 0

        0A8E: 27@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
        0A8D: 27@ = readMem 27@ sz 4 vp 0
        IF OR
        27@ == 2 // DIALOG_STYLE_LIST
        27@ == 4 // DIALOG_STYLE_TABLIST
        27@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
        THEN
            0A8E: 26@ = 30@ + 0x20 // DIALOG_WITH_LIST_OFFSET    
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x84850 // DIALOG_GET_LIST_ITEM_OFFSET
            0AA8: call_function_method 25@ struct 26@ num_params 1 pop 0 -1 _Returned: ListboxItem 24@
        ELSE 24@ = -1
        END

        IF OR
        27@ == 0 // DIALOG_STYLE_MSGBOX
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 14@ = 30@ + 0x34 // DIALOG_TEXT_OFFSET
            0A8D: 14@ = readMem 14@ sz 4 vp 0
        ELSE 14@ = 0
        END

        IF OR
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 23@ = 30@ + 0x24 // DIALOG_EDIT_BOX_OFFSET    
            0A8D: 23@ = readMem 23@ sz 4 vp 0
            0A8E: 22@ = 31@ + 0x81030 // DIALOG_GET_EDIT_BOX_TEXT_OFFSET
            0AA8: call_function_method 22@ struct 23@ num_params 0 pop 0 _Returned: InputText 21@
        ELSE 21@ = 0
        END

        0A8E: 20@ = 30@ + 0x40 // DIALOG_CAPTION_OFFSET

        0A8E: 19@ = 30@ + 0x20 // DIALOG_FIRST_POINTER_OFFSET    
        0A8D: 19@ = readMem 19@ sz 4 vp 0

        0A8E: 18@ = 19@ + 0x1AD // DIALOG_LEFT_BUTTON_TEXT_OFFSET
        0A8D: 16@ = readMem 18@ sz 1 vp 0
        IF NOT 16@ > 0
        THEN 18@ = 0
        END

        0A8E: 10@ = 19@ + 0x20
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        10@ += 0x50
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        0A8E: 17@ = 10@ + 0x4D // DIALOG_RIGHT_BUTTON_TEXT_OFFSET
        0A8D: 15@ = readMem 17@ sz 1 vp 0
        IF NOT 15@ > 0
        THEN 17@ = 0
        END

        0A8E: 13@ = 19@ + 0x166 // DIALOG_LEFT_BUTTON_CLICKED_OFFSET
        0A8D: 13@ = readMem 13@ sz 1 vp 0

        0A8E: 12@ = 10@ + 0x6 // DIALOG_RIGHT_BUTTON_CLICKED_OFFSET
        0A8D: 12@ = readMem 12@ sz 1 vp 0
        IF OR
        0AB0: 27 // ESC
        12@ == 1
        THEN 11@ = 0 // RIGHT_BUTTON_WAS_CLICKED
        ELSE
            IF OR
            0AB0: 13 // ENTER
            13@ == 1
            THEN  11@ = 1 // LEFT_BUTTON_WAS_CLICKED
            ELSE 11@ = -1 // RESET_CLICKED_BUTTONS
            END
        END
    ELSE
        11@ = -1 // RESET_CLICKED_BUTTONS
    END
END
0AB2: 9 28@ 27@ 24@ 11@ 14@ 21@ 20@ 18@ 17@

0.3.7 - R2
PHP:
:isDialogResponded
{
    0.3.7 - R2
    0AB1: @isDialogResponded 0 _Returned: ID 0@ Type 1@ ListboxItem 2@ Button 3@ Text 4@ InputText 5@ Caption 6@ LeftButtonText 7@ RightButtonText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x21A0C0 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    IF 29@ == TRUE // DIALOG OPEN
    THEN

        0A8E: 28@ = 30@ + 0x30 // DIALOG_ID_OFFSET
        0A8D: 28@ = readMem 28@ sz 4 vp 0

        0A8E: 27@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
        0A8D: 27@ = readMem 27@ sz 4 vp 0
        IF OR
        27@ == 2 // DIALOG_STYLE_LIST
        27@ == 4 // DIALOG_STYLE_TABLIST
        27@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
        THEN
            0A8E: 26@ = 30@ + 0x20 // DIALOG_WITH_LIST_OFFSET      
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x848F0 // DIALOG_GET_LIST_ITEM_OFFSET
            0AA8: call_function_method 25@ struct 26@ num_params 1 pop 0 -1 _Returned: ListboxItem 24@
        ELSE 24@ = -1
        END

        IF OR
        27@ == 0 // DIALOG_STYLE_MSGBOX
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 14@ = 30@ + 0x34 // DIALOG_TEXT_OFFSET
            0A8D: 14@ = readMem 14@ sz 4 vp 0
        ELSE 14@ = 0
        END

        IF OR
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 23@ = 30@ + 0x24 // DIALOG_EDIT_BOX_OFFSET      
            0A8D: 23@ = readMem 23@ sz 4 vp 0
            0A8E: 22@ = 31@ + 0x810D0 // DIALOG_GET_EDIT_BOX_TEXT_OFFSET
            0AA8: call_function_method 22@ struct 23@ num_params 0 pop 0 _Returned: InputText 21@
        ELSE 21@ = 0
        END

        0A8E: 20@ = 30@ + 0x40 // DIALOG_CAPTION_OFFSET

        0A8E: 19@ = 30@ + 0x20 // DIALOG_FIRST_POINTER_OFFSET      
        0A8D: 19@ = readMem 19@ sz 4 vp 0

        0A8E: 18@ = 19@ + 0x1AD // DIALOG_LEFT_BUTTON_TEXT_OFFSET
        0A8D: 16@ = readMem 18@ sz 1 vp 0
        IF NOT 16@ > 0
        THEN 18@ = 0
        END

        0A8E: 10@ = 19@ + 0x20
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        10@ += 0x50
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        0A8E: 17@ = 10@ + 0x4D // DIALOG_RIGHT_BUTTON_TEXT_OFFSET
        0A8D: 15@ = readMem 17@ sz 1 vp 0
        IF NOT 15@ > 0
        THEN 17@ = 0
        END

        0A8E: 13@ = 19@ + 0x166 // DIALOG_LEFT_BUTTON_CLICKED_OFFSET
        0A8D: 13@ = readMem 13@ sz 1 vp 0

        0A8E: 12@ = 10@ + 0x6 // DIALOG_RIGHT_BUTTON_CLICKED_OFFSET
        0A8D: 12@ = readMem 12@ sz 1 vp 0
        IF OR
        0AB0: 27 // ESC
        12@ == 1
        THEN 11@ = 0 // RIGHT_BUTTON_WAS_CLICKED
        ELSE
            IF OR
            0AB0: 13 // ENTER
            13@ == 1
            THEN  11@ = 1 // LEFT_BUTTON_WAS_CLICKED
            ELSE 11@ = -1 // RESET_CLICKED_BUTTONS
            END
        END
    ELSE
        11@ = -1 // RESET_CLICKED_BUTTONS
    END
END
0AB2: 9 28@ 27@ 24@ 11@ 14@ 21@ 20@ 18@ 17@

0.3.7 - R3
PHP:
:isDialogResponded
{
    0.3.7 - R3
    0AB1: @isDialogResponded 0 _Returned: ID 0@ Type 1@ ListboxItem 2@ Button 3@ Text 4@ InputText 5@ Caption 6@ LeftButtonText 7@ RightButtonText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E898 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    IF 29@ == TRUE // DIALOG OPEN
    THEN

        0A8E: 28@ = 30@ + 0x30 // DIALOG_ID_OFFSET
        0A8D: 28@ = readMem 28@ sz 4 vp 0

        0A8E: 27@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
        0A8D: 27@ = readMem 27@ sz 4 vp 0
        IF OR
        27@ == 2 // DIALOG_STYLE_LIST
        27@ == 4 // DIALOG_STYLE_TABLIST
        27@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
        THEN
            0A8E: 26@ = 30@ + 0x20 // DIALOG_WITH_LIST_OFFSET      
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x88760 // DIALOG_GET_LIST_ITEM_OFFSET
            0AA8: call_function_method 25@ struct 26@ num_params 1 pop 0 -1 _Returned: ListboxItem 24@
        ELSE 24@ = -1
        END

        IF OR
        27@ == 0 // DIALOG_STYLE_MSGBOX
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 14@ = 30@ + 0x34 // DIALOG_TEXT_OFFSET
            0A8D: 14@ = readMem 14@ sz 4 vp 0
        ELSE 14@ = 0
        END

        IF OR
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 23@ = 30@ + 0x24 // DIALOG_EDIT_BOX_OFFSET      
            0A8D: 23@ = readMem 23@ sz 4 vp 0
            0A8E: 22@ = 31@ + 0x84F40 // DIALOG_GET_EDIT_BOX_TEXT_OFFSET
            0AA8: call_function_method 22@ struct 23@ num_params 0 pop 0 _Returned: InputText 21@
        ELSE 21@ = 0
        END

        0A8E: 20@ = 30@ + 0x40 // DIALOG_CAPTION_OFFSET

        0A8E: 19@ = 30@ + 0x20 // DIALOG_FIRST_POINTER_OFFSET      
        0A8D: 19@ = readMem 19@ sz 4 vp 0

        0A8E: 18@ = 19@ + 0x1AD // DIALOG_LEFT_BUTTON_TEXT_OFFSET
        0A8D: 16@ = readMem 18@ sz 1 vp 0
        IF NOT 16@ > 0
        THEN 18@ = 0
        END

        0A8E: 10@ = 19@ + 0x20
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        10@ += 0x50
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        0A8E: 17@ = 10@ + 0x4D // DIALOG_RIGHT_BUTTON_TEXT_OFFSET
        0A8D: 15@ = readMem 17@ sz 1 vp 0
        IF NOT 15@ > 0
        THEN 17@ = 0
        END

        0A8E: 13@ = 19@ + 0x166 // DIALOG_LEFT_BUTTON_CLICKED_OFFSET
        0A8D: 13@ = readMem 13@ sz 1 vp 0

        0A8E: 12@ = 10@ + 0x6 // DIALOG_RIGHT_BUTTON_CLICKED_OFFSET
        0A8D: 12@ = readMem 12@ sz 1 vp 0
        IF OR
        0AB0: 27 // ESC
        12@ == 1
        THEN 11@ = 0 // RIGHT_BUTTON_WAS_CLICKED
        ELSE
            IF OR
            0AB0: 13 // ENTER
            13@ == 1
            THEN  11@ = 1 // LEFT_BUTTON_WAS_CLICKED
            ELSE 11@ = -1 // RESET_CLICKED_BUTTONS
            END
        END
    ELSE
        11@ = -1 // RESET_CLICKED_BUTTONS
    END
END
0AB2: 9 28@ 27@ 24@ 11@ 14@ 21@ 20@ 18@ 17@

0.3.DL
PHP:
:isDialogResponded
{
    0.3.DL
    0AB1: @isDialogResponded 0 _Returned: ID 0@ Type 1@ ListboxItem 2@ Button 3@ Text 4@ InputText 5@ Caption 6@ LeftButtonText 7@ RightButtonText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x2AC9E0 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    IF 29@ == TRUE // DIALOG OPEN
    THEN

        0A8E: 28@ = 30@ + 0x30 // DIALOG_ID_OFFSET
        0A8D: 28@ = readMem 28@ sz 4 vp 0

        0A8E: 27@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
        0A8D: 27@ = readMem 27@ sz 4 vp 0
        IF OR
        27@ == 2 // DIALOG_STYLE_LIST
        27@ == 4 // DIALOG_STYLE_TABLIST
        27@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
        THEN
            0A8E: 26@ = 30@ + 0x20 // DIALOG_WITH_LIST_OFFSET      
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x888F0 // DIALOG_GET_LIST_ITEM_OFFSET
            0AA8: call_function_method 25@ struct 26@ num_params 1 pop 0 -1 _Returned: ListboxItem 24@
        ELSE 24@ = -1
        END

        IF OR
        27@ == 0 // DIALOG_STYLE_MSGBOX
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 14@ = 30@ + 0x34 // DIALOG_TEXT_OFFSET
            0A8D: 14@ = readMem 14@ sz 4 vp 0
        ELSE 14@ = 0
        END

        IF OR
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 23@ = 30@ + 0x24 // DIALOG_EDIT_BOX_OFFSET      
            0A8D: 23@ = readMem 23@ sz 4 vp 0
            0A8E: 22@ = 31@ + 0x850D0 // DIALOG_GET_EDIT_BOX_TEXT_OFFSET
            0AA8: call_function_method 22@ struct 23@ num_params 0 pop 0 _Returned: InputText 21@
        ELSE 21@ = 0
        END

        0A8E: 20@ = 30@ + 0x40 // DIALOG_CAPTION_OFFSET

        0A8E: 19@ = 30@ + 0x20 // DIALOG_FIRST_POINTER_OFFSET      
        0A8D: 19@ = readMem 19@ sz 4 vp 0

        0A8E: 18@ = 19@ + 0x1AD // DIALOG_LEFT_BUTTON_TEXT_OFFSET
        0A8D: 16@ = readMem 18@ sz 1 vp 0
        IF NOT 16@ > 0
        THEN 18@ = 0
        END

        0A8E: 10@ = 19@ + 0x20
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        10@ += 0x50
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        0A8E: 17@ = 10@ + 0x4D // DIALOG_RIGHT_BUTTON_TEXT_OFFSET
        0A8D: 15@ = readMem 17@ sz 1 vp 0
        IF NOT 15@ > 0
        THEN 17@ = 0
        END

        0A8E: 13@ = 19@ + 0x166 // DIALOG_LEFT_BUTTON_CLICKED_OFFSET
        0A8D: 13@ = readMem 13@ sz 1 vp 0

        0A8E: 12@ = 10@ + 0x6 // DIALOG_RIGHT_BUTTON_CLICKED_OFFSET
        0A8D: 12@ = readMem 12@ sz 1 vp 0
        IF OR
        0AB0: 27 // ESC
        12@ == 1
        THEN 11@ = 0 // RIGHT_BUTTON_WAS_CLICKED
        ELSE
            IF OR
            0AB0: 13 // ENTER
            13@ == 1
            THEN  11@ = 1 // LEFT_BUTTON_WAS_CLICKED
            ELSE 11@ = -1 // RESET_CLICKED_BUTTONS
            END
        END
    ELSE
        11@ = -1 // RESET_CLICKED_BUTTONS
    END
END
0AB2: 9 28@ 27@ 24@ 11@ 14@ 21@ 20@ 18@ 17@

0.3.7 - R4
PHP:
:isDialogResponded
{
    0.3.7 - R4
    0AB1: @isDialogResponded 0 _Returned: ID 0@ Type 1@ ListboxItem 2@ Button 3@ Text 4@ InputText 5@ Caption 6@ LeftButtonText 7@ RightButtonText 8@
}
IF 0AA2: 31@ = "samp.dll"
THEN
    0A8E: 30@ = 31@ + 0x26E9C8 // DIALOG_POINTER_OFFSET
    0A8D: 30@ = readMem 30@ sz 4 vp 0
    0A8E: 29@ = 30@ + 0x28 // DIALOG_OPEN_OFFSET
    0A8D: 29@ = readMem 29@ sz 4 vp 0
    IF 29@ == TRUE // DIALOG OPEN
    THEN

        0A8E: 28@ = 30@ + 0x30 // DIALOG_ID_OFFSET
        0A8D: 28@ = readMem 28@ sz 4 vp 0

        0A8E: 27@ = 30@ + 0x2C // DIALOG_TYPE_OFFSET
        0A8D: 27@ = readMem 27@ sz 4 vp 0
        IF OR
        27@ == 2 // DIALOG_STYLE_LIST
        27@ == 4 // DIALOG_STYLE_TABLIST
        27@ == 5 // DIALOG_STYLE_TABLIST_HEADERS
        THEN
            0A8E: 26@ = 30@ + 0x20 // DIALOG_WITH_LIST_OFFSET       
            0A8D: 26@ = readMem 26@ sz 4 vp 0
            0A8E: 25@ = 31@ + 0x88EA0 // DIALOG_GET_LIST_ITEM_OFFSET
            0AA8: call_function_method 25@ struct 26@ num_params 1 pop 0 -1 _Returned: ListboxItem 24@
        ELSE 24@ = -1
        END

        IF OR
        27@ == 0 // DIALOG_STYLE_MSGBOX
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 14@ = 30@ + 0x34 // DIALOG_TEXT_OFFSET
            0A8D: 14@ = readMem 14@ sz 4 vp 0
        ELSE 14@ = 0
        END

        IF OR
        27@ == 1 // DIALOG_STYLE_INPUT
        27@ == 3 // DIALOG_STYLE_PASSWORD
        THEN
            0A8E: 23@ = 30@ + 0x24 // DIALOG_EDIT_BOX_OFFSET       
            0A8D: 23@ = readMem 23@ sz 4 vp 0
            0A8E: 22@ = 31@ + 0x85680 // DIALOG_GET_EDIT_BOX_TEXT_OFFSET
            0AA8: call_function_method 22@ struct 23@ num_params 0 pop 0 _Returned: InputText 21@
        ELSE 21@ = 0
        END

        0A8E: 20@ = 30@ + 0x40 // DIALOG_CAPTION_OFFSET

        0A8E: 19@ = 30@ + 0x20 // DIALOG_FIRST_POINTER_OFFSET       
        0A8D: 19@ = readMem 19@ sz 4 vp 0

        0A8E: 18@ = 19@ + 0x1AD // DIALOG_LEFT_BUTTON_TEXT_OFFSET
        0A8D: 16@ = readMem 18@ sz 1 vp 0
        IF NOT 16@ > 0
        THEN 18@ = 0
        END

        0A8E: 10@ = 19@ + 0x20
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        10@ += 0x50
        0A8D: 10@ = readMem 10@ sz 4 vp 0
        0A8E: 17@ = 10@ + 0x4D // DIALOG_RIGHT_BUTTON_TEXT_OFFSET
        0A8D: 15@ = readMem 17@ sz 1 vp 0
        IF NOT 15@ > 0
        THEN 17@ = 0
        END

        0A8E: 13@ = 19@ + 0x166 // DIALOG_LEFT_BUTTON_CLICKED_OFFSET
        0A8D: 13@ = readMem 13@ sz 1 vp 0

        0A8E: 12@ = 10@ + 0x6 // DIALOG_RIGHT_BUTTON_CLICKED_OFFSET
        0A8D: 12@ = readMem 12@ sz 1 vp 0
        IF OR
        0AB0: 27 // ESC
        12@ == 1
        THEN 11@ = 0 // RIGHT_BUTTON_WAS_CLICKED
        ELSE
            IF OR
            0AB0: 13 // ENTER
            13@ == 1
            THEN  11@ = 1 // LEFT_BUTTON_WAS_CLICKED
            ELSE 11@ = -1 // RESET_CLICKED_BUTTONS
            END
        END
    ELSE
        11@ = -1 // RESET_CLICKED_BUTTONS
    END
END
0AB2: 9 28@ 27@ 24@ 11@ 14@ 21@ 20@ 18@ 17@
 
Last edited:

Parazitas

God
Staff member
Joined
Jan 2, 2017
Messages
3,315
Solutions
7
Reaction score
935
Location
Lithuania
OPCODE:
0AFA: is_samp_available
Without SAMPFUNCS

PHP:
REPEAT
WAIT 1000
0A8D: 0@ = readMem 0xC8D4C0 sz 4 vp 0
UNTIL 0@ == 9 // SAMP_IS_READY


Usage Example:
PHP:
{$CLEO .cs}

0000:

REPEAT
WAIT 1000
0A8D: 0@ = readMem 0xC8D4C0 sz 4 vp 0
UNTIL 0@ == 9 // SAMP_IS_READY

0AD1: "Game Loaded" 1337

while true
wait 0
end
 
Last edited:
Status
Not open for further replies.
Top