[CLEO] Some snippets

Status
Not open for further replies.

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
You can make rainbow your dialog / chat text.
PHP:
:SetChatInputEditBoxTextColor
{
    0.3.7 - R1
    0AB1: @SetChatInputEditBoxTextColor 1 Color 0xFF00FF00
}
if 0AA2: 2@ = "samp.dll"
then
    0A8E: 3@ = 2@ + 0x21A0E8            // SAMP_CHAT_INPUT_INFO_OFFSET (R1)
    0A8D: 3@ = readMem 3@ sz 4 vp 0     // pChatInput;
    0A8E: 4@ = 3@ + 0x8                // pChatInput->pEditBox;
    0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;
    0A8E: 5@ = 4@ + 0x127                // pEditBox->TextColor;
    0A8E: 6@ = 4@ + 0x133                // pEditBox->CharacterAtTextEndColor;
    0A8C: write_memory 5@ size 4 value 0@ virtual_protect 0
    0A8C: write_memory 6@ size 4 value 0@ virtual_protect 0
end
0AB2: 0
PHP:
:SetDialogInputEditBoxTextColor
{
    0.3.7 - R1
    0AB1: @SetDialogInputEditBoxTextColor 1 Color 0xFF00FF00
}
if 0AA2: 2@ = "samp.dll"
then
    0A8E: 3@ = 2@ + 0x21A0B8            // SAMP_DIALOG_INFO_OFFSET (R1)
    0A8D: 3@ = readMem 3@ sz 4 vp 0     // pDialog;
    0A8E: 4@ = 3@ + 0x24                // pDialog->pEditBox;
    0A8D: 4@ = readMem 4@ sz 4 vp 0     // pEditBox;
    0A8E: 5@ = 4@ + 0x127                // pEditBox->TextColor;
    0A8E: 6@ = 4@ + 0x133                // pEditBox->CharacterAtTextEndColor;
    0A8C: write_memory 5@ size 4 value 0@ virtual_protect 0
    0A8C: write_memory 6@ size 4 value 0@ virtual_protect 0
end
0AB2: 0
 
Last edited:

Fr0z3n

Well-known member
Joined
Nov 20, 2019
Messages
294
Reaction score
36
Location
Srbija
Can you make like 1st word orange color, and 2nd word white color ande again 3rd word orange, 4rd white etc...
 

dovidas147

Active member
Joined
Nov 1, 2018
Messages
32
Reaction score
2
OPCODE:
0B49: samp set_current_dialog_list_item 1@
Without SAMPFUNCS


PHP:
:Set_current_dialog_list_item
{
    0.3.7 - R1
    0AB1: @Set_current_dialog_list_item 0 item 5
}
0AA2: 31@ = "samp.dll"
31@ += 0x21A0B8
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
31@ += 0x20
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
31@ += 0x143
0A8C: write_memory 31@ size 1 value 0@ virtual_protect 0
0AB2: ret 0

:Set_current_dialog_list_item
{
    0.3.7 - R2
    0AB1: @Set_current_dialog_list_item 0 item 5
}
0AA2: 31@ = "samp.dll"
31@ += 0x21A0C0
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
31@ += 0x20
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
31@ += 0x143
0A8C: write_memory 31@ size 1 value 0@ virtual_protect 0
0AB2: ret 0

:Set_current_dialog_list_item
{
    0.3.7 - R3
    0AB1: @Set_current_dialog_list_item 0 item 5
}
0AA2: 31@ = "samp.dll"
31@ += 0x26E898
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
31@ += 0x20
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
31@ += 0x143
0A8C: write_memory 31@ size 1 value 0@ virtual_protect 0
0AB2: ret 0

:Set_current_dialog_list_item
{
    0.3.7 - R4
    0AB1: @Set_current_dialog_list_item 0 item 5
}
0AA2: 31@ = "samp.dll"
31@ += 0x26E9C8
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
31@ += 0x20
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
31@ += 0x143
0A8C: write_memory 31@ size 1 value 0@ virtual_protect 0
0AB2: ret 0

:Set_current_dialog_list_item
{
    0.3.DL
    0AB1: @Set_current_dialog_list_item 0 item 5
}
0AA2: 31@ = "samp.dll"
31@ += 0x2AC9E0
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
31@ += 0x20
0A8D: 31@ = read_memory 31@ size 4 virtual_protect 0
31@ += 0x143
0A8C: write_memory 31@ size 1 value 0@ virtual_protect 0
0AB2: ret 0
Dialog row selection could be shorter with this pointer and offset. I've been using this for 2 weeks, seems good so far:
"samp.dll" + 0x12E350 + 0x143(offset) (SAMP 0.3.7-R1)
 

xAmUser

Active member
Joined
Feb 23, 2018
Messages
55
Reaction score
2
Weapon WallHack
If someone somehow change weapon color and combine with this code.., you can get powerful shit xD

PHP:
0@ readMem 0x732F40 sz 1 vp 0 // Read only one time to get default value


// Write to make weapon skin / wall thru
writeMem 0x732F40 sz 1 vl 1 vp 0

// Write to set default value
writeMem 0x732F40 sz 1 vl 0@ vp 0

hi how to do the same with player skins
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Read Nick Names From .txt file
Modified By:
@monday and me

PHP:
{$CLEO .cs}

0000: NOP

repeat
wait 0
until 0AFA:

// you need update file when you add new one name to the file
0B34: samp register_client_command "reload_names" to_label @cmd_reload_names

0AB1: @load_names 0 _returned_array 0@ _array_size 1@

while true
wait 0

if
0B61:  samp is_local_player_spawned
then
    0085: 31@ = 0@ // (int)
    for 30@ = 1 to 1@ // 1@ = _array_size
        wait 100 // read next name after 100 ms , so if you have 50 names in files he takes 5 sec to read them all. Simple math 100 * 50 = 5000 // 5 sec
        0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0
        0AC8: 28@ = allocate_memory_size 260
        0AB1: @RemoveNewLineOffsetAtStringEnd 2 text 29@ memory_to_store_characters_as_text 28@
    
        chatmsg "%s" -1 28@
    
        31@ += 4 // proceed to next name
    
        0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0
        if
        27@ == 0 // end of file
        then
            chatmsg "{FF0000}End of file was reached" -1
        end
    end
end

end

:RemoveNewLineOffsetAtStringEnd
5@ = false
0C17: 31@ = strlen 0@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset (as the loop progresses it becomes pointers to first-last character)
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if and
        28@ >= 65 // A
        28@ <= 90 // Z
        then
            5@ = true
        else
            if and
            28@ >= 97 // a
            28@ <= 122 // z
            then
                5@ = true
            else
                if
                28@ == 95 // _
                then
                    5@ = true
                else
                    5@ = false
                end
            end
        end
    
        if
        5@ == true
        then
            0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
            1@ += 1 // move to next address
        end
    end
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0


:cmd_reload_names
call @release_names 1 array 0@
call @load_names 0 _returned_array 0@ _array_size 1@
samp.CmdRet()

:load_names
{
    Usage:

    call @load_names 0 _returned_array 0@ _array_size 1@
}
if
0AAB:   file_exists "CLEO/Admins.txt"
then
    if
    0A9A: 30@ = openfile "CLEO/Admins.txt" mode "rt"  // IF and SET
    then
        29@ = 0
        alloc 31@ 5000

        // get line count first (we could use 'realloc' function instead and do it all at once but there's no opcode for that)
        while 0AD7: read_string_from_file 30@ to 31@ size 5000 // retrieves data from a file into a buffer until it encounters a new line
        wait 0
            29@ += 1
            //chatmsg "29@ = %d" -1 29@
        end

        //chatmsg "Lines in file: %d" -1 29@
        0085: 21@ = 29@ // 21@ will be returned
   

        // 29@ = line count, so it's the number of pointers that we will have, each pointer will store 4 bytes
        29@ *= 4
        29@ += 4
        alloc 28@ 29@
   
        0085: 23@ = 28@ // 23@ will be returned

        // http://ugbase.eu/index.php?threads/tutorial-using-functions-from-windows-libraries.16774/
        0A8D: 26@ = read_memory 0x8580DC size 4 virtual_protect 0 // 0x8580DC - KERNEL32.lstrlenA
        0A8D: 27@ = read_memory 0x8580D4 size 4 virtual_protect 0 // 0x8580D4 - KERNEL32.lstrcpyA

        0A9B: closefile 30@

        if 0A9A: 30@ = openfile "CLEO/Admins.txt" mode "rt"  // IF and SET
        then
        else
            //chatmsg "file couldn't be reopened for some reason (after counting its' lines)" -1
            //chatmsg "terminating cleo mod" -1
            0A93: end_custom_thread // no idea if this opcode will work in scm function though
        end
   
        while 0AD7: read_string_from_file 30@ to 31@ size 5000 // retrieves data from a file into a buffer until it encounters a new line
        wait 0  
            0AA7: strlen_addr 26@ num_params 1 pop 0 string 31@ _returned_length 25@
            25@ += 1
            alloc 24@ 25@
            0AA7: strcpy_addr 27@ num_params 2 pop 0 src 31@ dst 24@ _ret_ignore 22@
            0A8C: write_memory 28@ size 4 value 24@ virtual_protect 0 // save pointer
            28@ += 4
            //chatmsg "{AAAAAA}Copied string = {FFFFFF}%s" -1 24@
        end
   
        free 31@

        0A8C: write_memory 28@ size 4 value 0 virtual_protect 0 // end the pointer array with 4 bytes equal to 0, this will allow to know it's the end of it

        0A9B: closefile 30@
   
        0AB2: ret 2 array 23@ array_size 21@
    else
        0AD1: show_formatted_text_highpriority "Couldn't open the file" 15000
    end
else
    if
    8AAB: file_exists "CLEO\Admins.txt"
    then
        while 8A9A: 20@ = openfile "CLEO\Admins.txt" mode "at" // IF and SET
        wait 0
        end
   
        0AD9: write_text "" in_file 20@

        0A9B: closefile 20@
        0AD1: show_formatted_text_highpriority "File Admins.txt was created, add some names to make it work!" 20000
    end
end
0AB2: ret 2 0 0


:release_names
{
    If you use @load_names function consecutively without releasing the memory, then it will take too much of it.

    Input params:
    0@ = name_array (pointer to array of pointers to allocated memory)

    Usage:
    call @release_names 1 name_array 0@
}
0A8D: 31@ = read_memory 0@ size 4 virtual_protect 0
repeat
wait 0
    free 31@
    0@ += 4
    0A8D: 31@ = read_memory 0@ size 4 virtual_protect 0
until 31@ == 0    // this check is the reason why in "load_names" function there's: "0A8C: write_memory 28@ size 4 value 0 virtual_protect 0"
0AB2: ret 0

Without SAMPFUNCS
PHP:
{$CLEO .cs}

0000: NOP

wait 8500

0AB1: @load_names 0 _returned_array 0@ _array_size 1@

while true
wait 0

IF
0ADC:   test_cheat "RELOAD"
then // you need update file when you add new one name to the file
    0AB1: @release_names 1 array 0@
    0AB1: @load_names 0 _returned_array 0@ _array_size 1@
end

if
0256:   player $PLAYER_CHAR defined
then
    0085: 31@ = 0@ // (int)
    for 30@ = 1 to 1@ // 1@ = _array_size
        wait 100 // read next name after 100 ms , so if you have 50 names in files he takes 5 sec to read them all. Simple math 100 * 50 = 5000 // 5 sec
        0A8D: 29@ = read_memory 31@ size 4 virtual_protect 0
        0AC8: 28@ = allocate_memory_size 260
        0AB1: @RemoveNewLineOffsetAtStringEnd 2 text 29@ memory_to_store_characters_as_text 28@
     
        //0AD1: "%s" 1337 28@
     
        31@ += 4 // proceed to next name
     
        0A8D: 27@ = read_memory 31@ size 4 virtual_protect 0
        if
        27@ == 0 // end of file
        then
            0AD1: "End of file was reached" 1337
        end
    end
end

end

:RemoveNewLineOffsetAtStringEnd
5@ = false
0AB1: @strlen 1 string 0@ _return: 31@
    for 30@ = 0 to 31@
        0085: 29@ = 0@ // copy pointer
        005A: 29@ += 30@  // add offset (as the loop progresses it becomes pointers to first-last character)
        0A8D: 28@ = read_memory 29@ size 1 virtual_protect 1 // 28@ is the ascii number representing character
        if and
        28@ >= 65 // A
        28@ <= 90 // Z
        then
            5@ = true
        else
            if and
            28@ >= 97 // a
            28@ <= 122 // z
            then
                5@ = true
            else
                if
                28@ == 95 // _
                then
                    5@ = true
                else
                    5@ = false
                end
            end
        end
     
        if
        5@ == true
        then
            0A8C: write_memory 1@ size 1 value 28@ virtual_protect 1
            1@ += 1 // move to next address
        end
    end
0A8C: write_memory 1@ size 1 value 0 virtual_protect 1 // null-termination
0AB2: ret 0

:load_names
{
    Usage:

    0AB1: @load_names 0 _returned_array 0@ _array_size 1@
}
if
0AAB:   file_exists "CLEO/Admins.txt"
then
    if
    0A9A: 30@ = openfile "CLEO/Admins.txt" mode "rt"  // IF and SET
    then
        29@ = 0
        alloc 31@ 5000

        // get line count first (we could use 'realloc' function instead and do it all at once but there's no opcode for that)
        while 0AD7: read_string_from_file 30@ to 31@ size 5000 // retrieves data from a file into a buffer until it encounters a new line
        wait 0
            29@ += 1
        end

        //0AD1: "Lines in file: %d" 1337 29@
        0085: 21@ = 29@ // 21@ will be returned
    

        // 29@ = line count, so it's the number of pointers that we will have, each pointer will store 4 bytes
        29@ *= 4
        29@ += 4
        alloc 28@ 29@
    
        0085: 23@ = 28@ // 23@ will be returned

        // http://ugbase.eu/index.php?threads/tutorial-using-functions-from-windows-libraries.16774/
        0A8D: 26@ = read_memory 0x8580DC size 4 virtual_protect 0 // 0x8580DC - KERNEL32.lstrlenA
        0A8D: 27@ = read_memory 0x8580D4 size 4 virtual_protect 0 // 0x8580D4 - KERNEL32.lstrcpyA

        0A9B: closefile 30@

        if 0A9A: 30@ = openfile "CLEO/Admins.txt" mode "rt"  // IF and SET
        then
        else
            0A93: end_custom_thread // no idea if this opcode will work in scm function though
        end
    
        while 0AD7: read_string_from_file 30@ to 31@ size 5000 // retrieves data from a file into a buffer until it encounters a new line
        wait 0   
            0AA7: strlen_addr 26@ num_params 1 pop 0 string 31@ _returned_length 25@
            25@ += 1
            alloc 24@ 25@
            0AA7: strcpy_addr 27@ num_params 2 pop 0 src 31@ dst 24@ _ret_ignore 22@
            0A8C: write_memory 28@ size 4 value 24@ virtual_protect 0 // save pointer
            28@ += 4
        end
    
        free 31@

        0A8C: write_memory 28@ size 4 value 0 virtual_protect 0 // end the pointer array with 4 bytes equal to 0, this will allow to know it's the end of it

        0A9B: closefile 30@
    
        0AB2: ret 2 array 23@ array_size 21@
    else
        0AD1: show_formatted_text_highpriority "Couldn't open the file" 15000
    end
else
    if
    8AAB: file_exists "CLEO\Admins.txt"
    then
        while 8A9A: 20@ = openfile "CLEO\Admins.txt" mode "at" // IF and SET
        wait 0
        end
    
        0AD9: write_text "" in_file 20@

        0A9B: closefile 20@
        0AD1: show_formatted_text_highpriority "File Admins.txt was created, add some names to make it work!" 20000
    end
end
0AB2: ret 2 0 0


:release_names
{
    If you use @load_names function consecutively without releasing the memory, then it will take too much of it.

    Input params:
    0@ = name_array (pointer to array of pointers to allocated memory)

    Usage:
    call @release_names 1 name_array 0@
}
0A8D: 31@ = read_memory 0@ size 4 virtual_protect 0
repeat
wait 0
    free 31@
    0@ += 4
    0A8D: 31@ = read_memory 0@ size 4 virtual_protect 0
until 31@ == 0    // this check is the reason why in "load_names" function there's: "0A8C: write_memory 28@ size 4 value 0 virtual_protect 0"
0AB2: ret 0

:strlen
{
    Example: 0AB1: @strlen 1 string 1@ return: 3@
    In: 0@ - text;
    Out: 1@ - size;
}
for 1@ = 0 to 1024
    0A8D: 2@ = read_memory 0@ size 1 virtual_protect 0
    if not 2@ == 0
    jf break
    0@ += 1
end
0AB2: ret 1 1@
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Disable / enable crosshair showing.
PHP:
0@ readMem 0x58E020 sz 1 vp 0 // Read only one time to get default value


// Write to disable crosshair
writeMem 0x58E020 sz 1 vl 0xC3 vp 0

// Write to set default value / enable crosshair
writeMem 0x58E020 sz 1 vl 0@ vp 0
 

Attachments

  • crosshair1.png
    crosshair1.png
    89.3 KB · Views: 108
  • crosshair2.png
    crosshair2.png
    90.2 KB · Views: 107

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Chat Rainbow or just for fun
PHP:
:SetChatInputEditBoxColors
{
    0.3.7 - R2
    0AB1: @SetChatInputEditBoxColors 3 BorderColor 0xFF00FF00 TextColor 0xFF00FFFF  CharacterAtTextEnd { |} color 0xFF00FFFF
}
for 10@ = 0 to 4000 step 1 // Borders haven't static offset , we need scan all...
    if 0AA2: 20@ = "samp.dll"
    then
        0A8E: 30@ = 20@ + 0x21A0F0           // SAMP_CHAT_INPUT_INFO_OFFSET 
        0A8D: 30@ = readMem 30@ sz 4 vp 0    // pChatInput;
        0A8E: 14@ = 30@ + 0x8                 // pChatInput->pEditBox;
        0A8D: 14@ = readMem 14@ sz 4 vp 0    // pEditBox;
        0A8E: 15@ = 14@ + 10@                // pEditBox->TextBordersColor;
        0A8E: 17@ = 14@ + 0x127              // pEditBox->TextColor;
        0A8E: 18@ = 14@ + 0x133             // pEditBox->CharacterAtTextEndColor;
        0A8D: 16@ = readMem 15@ sz 4 vp 0
        if 
        16@ == 0xFFFFFFFF // Default ChatBox borders color from orginal sampgui.png
        then 0A8C: write_memory 15@ size 4 value 0@ virtual_protect 0 
        end
     
        0A8C: write_memory 17@ size 4 value 1@ virtual_protect 0 // TextColor
     
        0A8C: write_memory 18@ size 4 value 2@ virtual_protect 0 //  CharacterAtTextEnd { | }
    end
end
0AB2: 0
 

Attachments

  • ChatBox Coloring.png
    ChatBox Coloring.png
    565.7 KB · Views: 90

dovidas147

Active member
Joined
Nov 1, 2018
Messages
32
Reaction score
2
Chat Rainbow or just for fun
PHP:
:SetChatInputEditBoxColors
{
    0.3.7 - R2
    0AB1: @SetChatInputEditBoxColors 3 BorderColor 0xFF00FF00 TextColor 0xFF00FFFF  CharacterAtTextEnd { |} color 0xFF00FFFF
}
for 10@ = 0 to 4000 step 1 // Borders haven't static offset , we need scan all...
    if 0AA2: 20@ = "samp.dll"
    then
        0A8E: 30@ = 20@ + 0x21A0F0           // SAMP_CHAT_INPUT_INFO_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0    // pChatInput;
        0A8E: 14@ = 30@ + 0x8                 // pChatInput->pEditBox;
        0A8D: 14@ = readMem 14@ sz 4 vp 0    // pEditBox;
        0A8E: 15@ = 14@ + 10@                // pEditBox->TextBordersColor;
        0A8E: 17@ = 14@ + 0x127              // pEditBox->TextColor;
        0A8E: 18@ = 14@ + 0x133             // pEditBox->CharacterAtTextEndColor;
        0A8D: 16@ = readMem 15@ sz 4 vp 0
        if
        16@ == 0xFFFFFFFF // Default ChatBox borders color from orginal sampgui.png
        then 0A8C: write_memory 15@ size 4 value 0@ virtual_protect 0
        end
    
        0A8C: write_memory 17@ size 4 value 1@ virtual_protect 0 // TextColor
    
        0A8C: write_memory 18@ size 4 value 2@ virtual_protect 0 //  CharacterAtTextEnd { | }
    end
end
0AB2: 0
Are you sure this is the border color? sampgui.png includes these borders as white that means, your writing to memory some kind of color hue instead? Try with custom made sampgui.png and see what will happen, i'm curious.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Are you sure this is the border color? sampgui.png includes these borders as white that means, your writing to memory some kind of color hue instead? Try with custom made sampgui.png and see what will happen, i'm curious.
Tested with sampgui.png from ophax folder.
Works same.

PHP:
:SetChatInputEditBoxColors
{
    0.3.7 - R1
    0AB1: @SetChatInputEditBoxColors 3 BorderColor 0xFF00FF00 TextColor 0xFF00FFFF  CharacterAtTextEnd color 0xFF00FFFF
}
for 10@ = 0 to 4000 step 1 // Borders haven't static offset , we need scan all...
    if 0AA2: 20@ = "samp.dll"
    then
        0A8E: 30@ = 20@ + 0x21A0E8           // SAMP_CHAT_INPUT_INFO_OFFSET 
        0A8D: 30@ = readMem 30@ sz 4 vp 0    // pChatInput;
        0A8E: 14@ = 30@ + 0x8                // pChatInput->pEditBox;
        0A8D: 14@ = readMem 14@ sz 4 vp 0    // pEditBox;
        0A8E: 15@ = 14@ + 10@                // pEditBox->TextBordersColor;
        0A8E: 17@ = 14@ + 0x127              // pEditBox->TextColor;
        0A8E: 18@ = 14@ + 0x133              // pEditBox->CharacterAtTextEndColor;
        0A8D: 16@ = readMem 15@ sz 4 vp 0
        if 
        16@ == 0xFFFFFFFF // Default ChatBox borders color from orginal sampgui.png
        then 0A8C: write_memory 15@ size 4 value 0@ virtual_protect 0 
        end
     
        0A8C: write_memory 17@ size 4 value 1@ virtual_protect 0 // TextColor
     
        0A8C: write_memory 18@ size 4 value 2@ virtual_protect 0 //  CharacterAtTextEnd { | }
    end
end
0AB2: 0
 

Attachments

  • ChatBox Coloring.png
    ChatBox Coloring.png
    891.1 KB · Views: 63

dovidas147

Active member
Joined
Nov 1, 2018
Messages
32
Reaction score
2
Tested with sampgui.png from ophax folder.
Works same.

PHP:
:SetChatInputEditBoxColors
{
    0.3.7 - R1
    0AB1: @SetChatInputEditBoxColors 3 BorderColor 0xFF00FF00 TextColor 0xFF00FFFF  CharacterAtTextEnd color 0xFF00FFFF
}
for 10@ = 0 to 4000 step 1 // Borders haven't static offset , we need scan all...
    if 0AA2: 20@ = "samp.dll"
    then
        0A8E: 30@ = 20@ + 0x21A0E8           // SAMP_CHAT_INPUT_INFO_OFFSET
        0A8D: 30@ = readMem 30@ sz 4 vp 0    // pChatInput;
        0A8E: 14@ = 30@ + 0x8                // pChatInput->pEditBox;
        0A8D: 14@ = readMem 14@ sz 4 vp 0    // pEditBox;
        0A8E: 15@ = 14@ + 10@                // pEditBox->TextBordersColor;
        0A8E: 17@ = 14@ + 0x127              // pEditBox->TextColor;
        0A8E: 18@ = 14@ + 0x133              // pEditBox->CharacterAtTextEndColor;
        0A8D: 16@ = readMem 15@ sz 4 vp 0
        if
        16@ == 0xFFFFFFFF // Default ChatBox borders color from orginal sampgui.png
        then 0A8C: write_memory 15@ size 4 value 0@ virtual_protect 0
        end
    
        0A8C: write_memory 17@ size 4 value 1@ virtual_protect 0 // TextColor
    
        0A8C: write_memory 18@ size 4 value 2@ virtual_protect 0 //  CharacterAtTextEnd { | }
    end
end
0AB2: 0
can you try it with white some kind of theme? im pretty sure that hue doesnt work on black colors.
 

dovidas147

Active member
Joined
Nov 1, 2018
Messages
32
Reaction score
2
I still cant understand how is this even possible. Maybe this is SA:MP's cut feature? I mean there's sampgui.png file where you can do it how you want it to be. What is that even used for lmao. Colored text is logical, but the border colors, they aren't because you could do it in any color just by editing this png file.
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
I still cant understand how is this even possible. Maybe this is SA:MP's cut feature? I mean there's sampgui.png file where you can do it how you want it to be. What is that even used for lmao. Colored text is logical, but the border colors, they aren't because you could do it in any color just by editing this png file.
A lot stuff have color offset, because we load it in game, we load it in memory.
But it is hard to find pointer or offset.
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Take ScreenShot

PHP:
:TakeScreenShot
// 0AB1: @TakeScreenShot 1 SampVersionID 0@
IF 0AA2: 10@ = "samp.dll"
THEN
    IF 0@ == 1 // 0.3.7 R1
    THEN
        0A8E: 11@ = 10@ + 0x119CBC 
    END

    IF 0@ == 2 // 0.3.7 R2
    THEN
        0A8E: 11@ = 10@ + 0x119CBC
    END

    IF 0@ == 3 // 0.3.DL
    THEN
        0A8E: 11@ = 10@ + 0x16BE7C 
    END

    IF 0@ == 4 // 0.3.7 R3
    THEN
        0A8E: 11@ = 10@ + 0x12DD3C
    END

    IF 0@ == 5 // 0.3.7 R4
    THEN
        0A8E: 11@ = 10@ + 0x12DE64 
    END

    0A8C: write_memory 11@ size 4 value 1 virtual_protect 0
END
0AB2: 0
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Make your Crosshair Any Color you like...
PHP:
:CrosshairColoring
//0AB1: @CrosshairColoring 16 ARGB 255 0 255 0 ARGB 255 0 255 0 ARGB 255 0 255 0 ARGB 255 0 255 0
0A8C: write_memory 0x58E461 size 1 value 0@ virtual_protect 0 // A
0A8C: write_memory 0x58E47C size 1 value 1@ virtual_protect 0 // R
0A8C: write_memory 0x58E473 size 1 value 2@ virtual_protect 0 // G
0A8C: write_memory 0x58E466 size 1 value 3@ virtual_protect 0 // B

0A8C: write_memory 0x58E420 size 1 value 4@ virtual_protect 0 // A
0A8C: write_memory 0x58E433 size 1 value 5@ virtual_protect 0 // R
0A8C: write_memory 0x58E42A size 1 value 6@ virtual_protect 0 // G
0A8C: write_memory 0x58E425 size 1 value 7@ virtual_protect 0 // B

0A8C: write_memory 0x58E3BF size 1 value 8@ virtual_protect 0 // A
0A8C: write_memory 0x58E3DA size 1 value 9@ virtual_protect 0 // R
0A8C: write_memory 0x58E3D1 size 1 value 10@ virtual_protect 0 // G
0A8C: write_memory 0x58E3C8 size 1 value 11@ virtual_protect 0 // B

0A8C: write_memory 0x58E2EC size 1 value 12@ virtual_protect 0 // A
0A8C: write_memory 0x58E301 size 1 value 13@ virtual_protect 0 // R
0A8C: write_memory 0x58E2F6 size 1 value 14@ virtual_protect 0 // G
0A8C: write_memory 0x58E2F1 size 1 value 15@ virtual_protect 0 // B
0AB2: ret 0
 

Attachments

  • Crosshair.png
    Crosshair.png
    405.3 KB · Views: 95

Parazitas

God
Joined
Jan 2, 2017
Messages
3,116
Solutions
5
Reaction score
882
Location
Lithuania
Change drawing lights color from vehicle...
PHP:
:VehicleLightsColoring
//0AB1: @VehicleLightsColoring 6 RGB 0 255 0 RGB 0 255 0
// Motorcycle lights
0A8C: write_memory 0x6E1560 size 1 value 0@ virtual_protect 0
0A8C: write_memory 0x6E155E size 1 value 1@ virtual_protect 0
0A8C: write_memory 0x6E1556 size 1 value 2@ virtual_protect 0
// Car lights
0A8C: write_memory 0x6E1689 size 1 value 3@ virtual_protect 0
0A8C: write_memory 0x6E1687 size 1 value 4@ virtual_protect 0
0A8C: write_memory 0x6E1685 size 1 value 5@ virtual_protect 0
0AB2: ret 0
 

Attachments

  • Motorcycle.png
    Motorcycle.png
    223.3 KB · Views: 56
  • Car.png
    Car.png
    253.5 KB · Views: 50
Last edited:

xAmUser

Active member
Joined
Feb 23, 2018
Messages
55
Reaction score
2
Usefull for some checks...
PHP:
:Ignore_Player_Actor_Car_Entity
// 0AB1: @Ignore_Player_Actor_Car_Entity 0
if 00DF:   actor $PLAYER_ACTOR in_car
then
    03C0: 0@ = actor $PLAYER_ACTOR car
    0A97: 1@ = car 0@ struct
    0A8C: write_mem 0xB7CD68 size 4 val 1@ vp 0
end
0AB2: ret 0

PHP:
:Ignore_Player_Actor_Entity
// 0AB1: @Ignore_Player_Actor_Entity 0
0A96: 2@ = actor $PLAYER_ACTOR struct
0A8C: write_mem 0xB7CD68 size 4 val 2@ vp 0
0AB2: ret 0
but how to do the opposite?
 
Status
Not open for further replies.
Top